47 TDirectory *
savedir = gDirectory;
48 TDirectory *
dir = (TDirectory*)gDirectory->FindObjectAny(
"occupancy");
52 TH1I *tag_num_events = (TH1I*)gDirectory->FindObjectAny(
"tag_num_events");
53 if(tag_num_events) Nevents = (double)tag_num_events->GetBinContent(1);
55 TH2I *tagh_adc_occ = (TH2I*)gDirectory->FindObjectAny(
"tagh_adc_occ");
56 TH2I *tagh_tdc_occ = (TH2I*)gDirectory->FindObjectAny(
"tagh_tdc_occ");
57 TH2I *tagm_adc_occ = (TH2I*)gDirectory->FindObjectAny(
"tagm_adc_occ");
58 TH2I *tagm_tdc_occ = (TH2I*)gDirectory->FindObjectAny(
"tagm_tdc_occ");
60 TLegend *legend_sa =
new TLegend(0.1,0.85,0.3,0.9);
61 TLegend *legend_na =
new TLegend(0.3,0.85,0.5,0.9);
63 TLegend *legend_s =
new TLegend(0.1,0.85,0.3,0.9);
64 TLegend *legend_n =
new TLegend(0.3,0.85,0.5,0.9);
67 tagh_tdc_occ->SetBarWidth(0.5);
68 tagh_tdc_occ->SetBarOffset(0);
69 tagh_tdc_occ->SetFillColor(kBlack);
70 tagh_tdc_occ->SetStats(0);
71 tagh_tdc_occ->SetTitle(
"TAGH column occupancy");
72 tagh_tdc_occ->SetXTitle(
"Column number");
73 tagh_tdc_occ->SetYTitle(
"fADC/TDC occupancy");
74 tagh_tdc_occ->SetTitleSize(0.05,
"X");
75 tagh_tdc_occ->GetXaxis()->CenterTitle();
76 tagh_tdc_occ->SetTitleSize(0.05,
"Y");
77 tagh_tdc_occ->GetYaxis()->CenterTitle();
81 tagh_adc_occ->SetBarWidth(0.5);
82 tagh_adc_occ->SetBarOffset(0.5);
83 tagh_adc_occ->SetFillColor(kGreen);
84 tagh_adc_occ->SetStats(0);
85 tagh_adc_occ->SetTitle(
"TAGH column occupancy");
86 tagh_adc_occ->SetXTitle(
"Column number");
87 tagh_adc_occ->SetYTitle(
"fADC/TDC occupancy");
88 tagh_adc_occ->SetTitleSize(0.05,
"X");
89 tagh_adc_occ->GetXaxis()->CenterTitle();
90 tagh_adc_occ->SetTitleSize(0.05,
"Y");
91 tagh_adc_occ->GetYaxis()->CenterTitle();
94 legend_sa->AddEntry(tagh_adc_occ,
"fADC",
"f");
95 legend_na->AddEntry(tagh_tdc_occ,
"TDC",
"f");
98 tagm_tdc_occ->SetBarWidth(0.5);
99 tagm_tdc_occ->SetBarOffset(0);
100 tagm_tdc_occ->SetFillColor(kMagenta);
101 tagm_tdc_occ->SetStats(0);
102 tagm_tdc_occ->SetTitle(
"TAGM column occupancy");
103 tagm_tdc_occ->SetXTitle(
"Column number");
104 tagm_tdc_occ->SetYTitle(
"fADC/TDC occupancy");
105 tagm_tdc_occ->SetTitleSize(0.05,
"X");
106 tagm_tdc_occ->GetXaxis()->CenterTitle();
107 tagm_tdc_occ->SetTitleSize(0.05,
"Y");
108 tagm_tdc_occ->GetYaxis()->CenterTitle();
112 tagm_adc_occ->SetBarWidth(0.5);
113 tagm_adc_occ->SetBarOffset(0.5);
114 tagm_adc_occ->SetFillColor(kBlue);
115 tagm_adc_occ->SetStats(0);
116 tagm_adc_occ->SetTitle(
"TAGM column occupancy");
117 tagm_adc_occ->SetXTitle(
"Column number");
118 tagm_adc_occ->SetYTitle(
"fADC/TDC occupancy");
119 tagm_adc_occ->SetTitleSize(0.05,
"X");
120 tagm_adc_occ->GetXaxis()->CenterTitle();
121 tagm_adc_occ->SetTitleSize(0.05,
"Y");
122 tagm_adc_occ->GetYaxis()->CenterTitle();
125 legend_s->AddEntry(tagm_adc_occ,
"fADC",
"f");
126 legend_n->AddEntry(tagm_tdc_occ,
"TDC",
"f");
129 sprintf(nevents_str,
"%0.0f events", Nevents);
131 lat.SetTextAlign(22);
132 lat.SetTextSize(0.035);
136 TCanvas *
c1 =
new TCanvas(
"c1");
141 if(!gPad) {savedir->cd();
return;}
143 TCanvas *
c1 = gPad->GetCanvas();
154 if(tagm_adc_occ) ymax = tagm_adc_occ->GetMaximum();
156 if(tagm_tdc_occ->GetMaximum() >
ymax) ymax = tagm_tdc_occ->GetMaximum();
159 tagm_adc_occ->GetYaxis()->SetRangeUser(0.0, 1.05*ymax);
160 tagm_adc_occ->Draw(
"BAR");
163 tagm_tdc_occ->GetYaxis()->SetRangeUser(0.0, 1.05*ymax);
164 tagm_tdc_occ->Draw( tagm_adc_occ==NULL ?
"BAR":
"BAR same" );
169 lat.DrawLatex(85.0, 1.075*ymax, nevents_str);
176 if(tagh_adc_occ) ymax = tagh_adc_occ->GetMaximum();
178 if(tagh_tdc_occ->GetMaximum() >
ymax) ymax = tagh_tdc_occ->GetMaximum();
181 tagh_adc_occ->GetYaxis()->SetRangeUser(0.0, 1.05*ymax);
182 tagh_adc_occ->Draw(
"BAR");
185 tagh_tdc_occ->GetYaxis()->SetRangeUser(0.0, 1.05*ymax);
186 tagh_tdc_occ->Draw( tagh_adc_occ==NULL ?
"BAR":
"BAR same" );
191 lat.DrawLatex(225.0, 1.075*ymax, nevents_str);
sprintf(text,"Post KinFit Cut")