Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tof_tdc_occup.C
Go to the documentation of this file.
1 // hnamepath: /tof/tdcOccS
2 // hnamepath: /tof/tdcOccN
3 // hnamepath: /tof/tdcOccU
4 // hnamepath: /tof/tdcOccD
5 // hnamepath: /tof/adcOccS
6 // hnamepath: /tof/adcOccN
7 // hnamepath: /tof/adcOccU
8 // hnamepath: /tof/adcOccD
9 // hnamepath: /tof/planeHor
10 // hnamepath: /tof/planeVer
11 // hnamepath: /tof/histPed
12 
13 {
14 
15  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("tof");
16  if(dir) dir->cd();
17 
18  TH2I *planeHor = (TH2I*)gDirectory->FindObjectAny("planeHor");
19  TH2I *planeVer = (TH2I*)gDirectory->FindObjectAny("planeVer");
20 
21  TH1I *histPed = (TH1I*)gDirectory->FindObjectAny("histPed");
22  TH1I *hTimeAdc = (TH1I*)gDirectory->FindObjectAny("hTimeAdc");
23  TH1I *hTimeTdc = (TH1I*)gDirectory->FindObjectAny("hTimeTdc");
24 
25  TH1I *ha_s = (TH1I*)gDirectory->FindObjectAny("adcOccS");
26  TH1I *ha_n = (TH1I*)gDirectory->FindObjectAny("adcOccN");
27  TH1I *ha_u = (TH1I*)gDirectory->FindObjectAny("adcOccU");
28  TH1I *ha_d = (TH1I*)gDirectory->FindObjectAny("adcOccD");
29 
30  TH1I *h_s = (TH1I*)gDirectory->FindObjectAny("tdcOccS");
31  TH1I *h_n = (TH1I*)gDirectory->FindObjectAny("tdcOccN");
32  TH1I *h_u = (TH1I*)gDirectory->FindObjectAny("tdcOccU");
33  TH1I *h_d = (TH1I*)gDirectory->FindObjectAny("tdcOccD");
34 
35  TLegend *legend_sa = new TLegend(0.1,0.85,0.3,0.9);
36  TLegend *legend_na = new TLegend(0.3,0.85,0.5,0.9);
37  TLegend *legend_ua = new TLegend(0.5,0.85,0.7,0.9);
38  TLegend *legend_da = new TLegend(0.7,0.85,0.9,0.9);
39 
40  TLegend *legend_s = new TLegend(0.1,0.85,0.3,0.9);
41  TLegend *legend_n = new TLegend(0.3,0.85,0.5,0.9);
42  TLegend *legend_u = new TLegend(0.5,0.85,0.7,0.9);
43  TLegend *legend_d = new TLegend(0.7,0.85,0.9,0.9);
44 
45  ha_s->SetBarWidth(0.5);
46  ha_s->SetBarOffset(0);
47  ha_s->SetFillColor(2);
48  ha_s->SetStats(0);
49  ha_s->SetXTitle("Module number");
50  ha_s->SetYTitle("fADC occupancy");
51  ha_s->SetTitleSize(0.05,"X");
52  ha_s->GetXaxis()->CenterTitle();
53  ha_s->SetTitleSize(0.05,"Y");
54  ha_s->GetYaxis()->CenterTitle();
55 
56  ha_n->SetBarWidth(0.5);
57  ha_n->SetBarOffset(0.5);
58  ha_n->SetFillColor(3);
59  ha_n->SetStats(0);
60 
61  ha_u->SetBarWidth(0.5);
62  ha_u->SetBarOffset(1.0);
63  ha_u->SetFillColor(4);
64  ha_u->SetStats(0);
65 
66  ha_d->SetBarWidth(0.5);
67  ha_d->SetBarOffset(1.5);
68  ha_d->SetFillColor(6);
69  ha_d->SetStats(0);
70 
71  h_s->SetBarWidth(0.5);
72  h_s->SetBarOffset(0);
73  h_s->SetFillColor(2);
74  h_s->SetStats(0);
75  h_s->SetXTitle("Module number");
76  h_s->SetYTitle("TDC occupancy");
77  h_s->SetTitleSize(0.05,"X");
78  h_s->GetXaxis()->CenterTitle();
79  h_s->SetTitleSize(0.05,"Y");
80  h_s->GetYaxis()->CenterTitle();
81 
82  h_n->SetBarWidth(0.5);
83  h_n->SetBarOffset(0.5);
84  h_n->SetFillColor(3);
85  h_n->SetStats(0);
86 
87  h_u->SetBarWidth(0.5);
88  h_u->SetBarOffset(1.0);
89  h_u->SetFillColor(4);
90  h_u->SetStats(0);
91 
92  h_d->SetBarWidth(0.5);
93  h_d->SetBarOffset(1.5);
94  h_d->SetFillColor(6);
95  h_d->SetStats(0);
96 
97  planeHor->SetXTitle("X, cm");
98  planeHor->SetYTitle("Y, cm");
99  planeHor->SetStats(0);
100  planeHor->SetTitleSize(0.05,"X");
101  planeHor->GetXaxis()->CenterTitle();
102  planeHor->SetTitleSize(0.05,"Y");
103  planeHor->GetYaxis()->CenterTitle();
104 
105  planeVer->SetXTitle("X, cm");
106  planeVer->SetYTitle("Y, cm");
107  planeVer->SetStats(0);
108  planeVer->SetTitleSize(0.05,"X");
109  planeVer->GetXaxis()->CenterTitle();
110  planeVer->SetTitleSize(0.05,"Y");
111  planeVer->GetYaxis()->CenterTitle();
112 
113  legend_sa->AddEntry(ha_s,"South","f");
114  legend_na->AddEntry(ha_n,"North","f");
115  legend_ua->AddEntry(ha_u,"Up","f");
116  legend_da->AddEntry(ha_d,"Down","f");
117 
118  legend_s->AddEntry(h_s,"South","f");
119  legend_n->AddEntry(h_n,"North","f");
120  legend_u->AddEntry(h_u,"Up","f");
121  legend_d->AddEntry(h_d,"Down","f");
122 
123 
124  // Just for testing
125  if(gPad == NULL){
126  TCanvas *c1 = new TCanvas("c1");
127  c1->cd(0);
128  c1->Draw();
129  c1->Update();
130  }
131 
132  if(!gPad) return;
133  TCanvas *c1 = gPad->GetCanvas();
134  c1->Divide(3,3);
135  c1->cd(1);
136  if(ha_s) ha_s->Draw("BAR");
137  if(ha_n) ha_n->Draw("BAR sames");
138  if(ha_u) ha_u->Draw("BAR sames");
139  if(ha_d) ha_d->Draw("BAR sames");
140 
141  legend_sa->Draw();
142  legend_na->Draw();
143  legend_ua->Draw();
144  legend_da->Draw();
145 
146  c1->cd(2);
147  if(h_s) h_s->Draw("BAR");
148  if(h_n) h_n->Draw("BAR sames");
149  if(h_u) h_u->Draw("BAR sames");
150  if(h_d) h_d->Draw("BAR sames");
151 
152  legend_s->Draw();
153  legend_n->Draw();
154  legend_u->Draw();
155  legend_d->Draw();
156 
157  c1->cd(3);
158  if(histPed) histPed->Draw("");
159 
160  c1->cd(4);
161  if(planeVer) planeVer->Draw("COLZ");
162 
163  c1->cd(5);
164  if(planeHor) planeHor->Draw("COLZ");
165 
166  c1->cd(6);
167  if(hTimeAdc) hTimeAdc->Draw("");
168 
169  c1->cd(7);
170  if(hTimeTdc) hTimeTdc->Draw("");
171 
172 
173 }
static TH1I * hTimeTdc
static TH2I * planeHor
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
static TH1I * hTimeAdc
static TH2I * planeVer
TDirectory * dir
Definition: bcal_hist_eff.C:31
static TH1I * histPed