25 TDirectory *
savedir = gDirectory;
26 TDirectory *
dir = (TDirectory*)gDirectory->FindObjectAny(
"occupancy");
30 TH1I *
tof_num_events = (TH1I*)gDirectory->FindObjectAny(
"tof_num_events");
31 if(tof_num_events) Nevents = (double)tof_num_events->GetBinContent(1);
33 TH1I *ha_s = (TH1I*)gDirectory->FindObjectAny(
"tof_adc_S_occ");
34 TH1I *ha_n = (TH1I*)gDirectory->FindObjectAny(
"tof_adc_N_occ");
35 TH1I *ha_u = (TH1I*)gDirectory->FindObjectAny(
"tof_adc_U_occ");
36 TH1I *ha_d = (TH1I*)gDirectory->FindObjectAny(
"tof_adc_D_occ");
38 TH1I *h_s = (TH1I*)gDirectory->FindObjectAny(
"tof_tdc_S_occ");
39 TH1I *h_n = (TH1I*)gDirectory->FindObjectAny(
"tof_tdc_N_occ");
40 TH1I *h_u = (TH1I*)gDirectory->FindObjectAny(
"tof_tdc_U_occ");
41 TH1I *h_d = (TH1I*)gDirectory->FindObjectAny(
"tof_tdc_D_occ");
43 TLegend *legend_sa =
new TLegend(0.1,0.85,0.3,0.9);
44 TLegend *legend_na =
new TLegend(0.3,0.85,0.5,0.9);
45 TLegend *legend_ua =
new TLegend(0.5,0.85,0.7,0.9);
46 TLegend *legend_da =
new TLegend(0.7,0.85,0.9,0.9);
48 TLegend *legend_s =
new TLegend(0.1,0.85,0.3,0.9);
49 TLegend *legend_n =
new TLegend(0.3,0.85,0.5,0.9);
50 TLegend *legend_u =
new TLegend(0.5,0.85,0.7,0.9);
51 TLegend *legend_d =
new TLegend(0.7,0.85,0.9,0.9);
54 ha_s->SetBarWidth(0.5);
55 ha_s->SetBarOffset(0);
56 ha_s->SetFillColor(2);
58 ha_s->SetXTitle(
"Module number");
59 ha_s->SetYTitle(
"fADC occupancy");
60 ha_s->SetTitleSize(0.05,
"X");
61 ha_s->GetXaxis()->CenterTitle();
62 ha_s->SetTitleSize(0.05,
"Y");
63 ha_s->GetYaxis()->CenterTitle();
67 ha_n->SetBarWidth(0.5);
68 ha_n->SetBarOffset(0.5);
69 ha_n->SetFillColor(3);
74 ha_u->SetBarWidth(0.5);
75 ha_u->SetBarOffset(1.0);
76 ha_u->SetFillColor(4);
81 ha_d->SetBarWidth(0.5);
82 ha_d->SetBarOffset(1.5);
83 ha_d->SetFillColor(6);
88 h_s->SetBarWidth(0.5);
92 h_s->SetXTitle(
"Module number");
93 h_s->SetYTitle(
"TDC occupancy");
94 h_s->SetTitleSize(0.05,
"X");
95 h_s->GetXaxis()->CenterTitle();
96 h_s->SetTitleSize(0.05,
"Y");
97 h_s->GetYaxis()->CenterTitle();
101 h_n->SetBarWidth(0.5);
102 h_n->SetBarOffset(0.5);
103 h_n->SetFillColor(3);
108 h_u->SetBarWidth(0.5);
109 h_u->SetBarOffset(1.0);
110 h_u->SetFillColor(4);
115 h_d->SetBarWidth(0.5);
116 h_d->SetBarOffset(1.5);
117 h_d->SetFillColor(6);
121 legend_sa->AddEntry(ha_s,
"South",
"f");
122 legend_na->AddEntry(ha_n,
"North",
"f");
123 legend_ua->AddEntry(ha_u,
"Up",
"f");
124 legend_da->AddEntry(ha_d,
"Down",
"f");
126 legend_s->AddEntry(h_s,
"South",
"f");
127 legend_n->AddEntry(h_n,
"North",
"f");
128 legend_u->AddEntry(h_u,
"Up",
"f");
129 legend_d->AddEntry(h_d,
"Down",
"f");
134 TCanvas *
c1 =
new TCanvas(
"c1");
139 if(!gPad) {savedir->cd();
return;}
141 TCanvas *
c1 = gPad->GetCanvas();
149 if(ha_s) ha_s->Draw(
"BAR");
150 if(ha_n) ha_n->Draw(
"BAR sames");
151 if(ha_u) ha_u->Draw(
"BAR sames");
152 if(ha_d) ha_d->Draw(
"BAR sames");
159 TVirtualPad *
pad2 = c1->cd(2);
162 if(h_s) h_s->Draw(
"BAR");
163 if(h_n) h_n->Draw(
"BAR sames");
164 if(h_u) h_u->Draw(
"BAR sames");
165 if(h_d) h_d->Draw(
"BAR sames");
175 sprintf(str,
"%0.0f events", Nevents);
176 TLatex
lat(24, 1.075*ha_s->GetMaximum(),
str);
177 lat.SetTextAlign(22);
178 lat.SetTextSize(0.035);
sprintf(text,"Post KinFit Cut")
static TH1I * tof_num_events