44 TNtuple *ntuple =
new TNtuple(
"ntuple",
"data",
"side:phi:straw:status:hits:occ:htocc:eff:lay");
52 in.open(
"TRT_StrawStatusReport.txt");
57 for (
int i = 0;
i < 5;
i++){
61 for (
int i = 0;
i < 3;
i++){
78 printf(
"read %d lines from file\n",
count);
82 TFile* myfile =
new TFile(
"test.HIST.root",
"RECREATE");
84 TCanvas *
c1 =
new TCanvas(
"c1",
"This is the canvas test", 1200,800);
89 gStyle->SetOptStat(10);
90 gStyle->SetStatY(0.98);
91 gStyle->SetStatX(0.9);
92 gStyle->SetStatW(0.15);
93 gStyle->SetStatH(0.1);
95 c1->SaveAs(
"allPlots.pdf[");
97 std::unique_ptr<TH1F>
h1 = std::make_unique<TH1F>(
"h1",
"", 101, 0., 101);
98 ntuple->Project(
"h1",
"eff");
99 h1->GetXaxis()->SetTitle(
"Straw hit efficiency [%]");
100 h1->GetXaxis()->SetTitleSize(0.04);
101 h1->GetYaxis()->SetTitle(
"Number of straws");
102 h1->GetYaxis()->SetTitleSize(0.04);
105 std::unique_ptr<TH1F> h1a = std::make_unique<TH1F>(
"h1a",
"", 101, 0., 101);
106 ntuple->Project(
"h1a",
"eff",
"status>0");
107 h1a->SetFillStyle(1001);
108 h1a->SetFillColor(kOrange);
111 std::unique_ptr<TH1F> h1b = std::make_unique<TH1F>(
"h1b",
"", 101, 0., 101);
112 ntuple->Project(
"h1b",
"eff",
"status==42");
113 h1b->SetFillStyle(1001);
114 h1b->SetFillColor(2);
121 mytext.SetTextAlign(21);
123 mytext.SetTextSize(0.04);
124 mytext.SetTextFont(42);
125 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
127 print(Form(
"strawHitEfficiency_%d",
run),
c1);
134 double htrange = 0.1;
135 std::unique_ptr<TH1F> hh1 = std::make_unique<TH1F>(
"hh1",
"", 100, 0., htrange);
136 ntuple->Project(
"hh1",
"htocc");
138 hh1->GetXaxis()->SetTitle(
"Straw HT occupancy");
139 hh1->GetXaxis()->SetTitleSize(0.04);
141 hh1->GetYaxis()->SetTitle(
"Number of straws");
142 hh1->GetYaxis()->SetTitleSize(0.04);
144 hh1->SetBinContent(100, hh1->GetBinContent(100) + hh1->GetBinContent(101));
147 std::unique_ptr<TH1F> hh1a = std::make_unique<TH1F>(
"hh1a",
"", 100, 0., htrange);
148 ntuple->Project(
"hh1a",
"htocc",
"status>0");
149 hh1a->SetFillStyle(1001);
150 hh1a->SetFillColor(kOrange);
151 hh1a->SetBinContent(100, hh1a->GetBinContent(100) + hh1a->GetBinContent(101));
154 std::unique_ptr<TH1F> hh1b = std::make_unique<TH1F>(
"hh1b",
"", 100, 0., htrange);
155 ntuple->Project(
"hh1b",
"htocc",
"status==52");
156 hh1b->SetFillStyle(1001);
157 hh1b->SetFillColor(2);
158 hh1b->SetBinContent(100, hh1b->GetBinContent(100) + hh1b->GetBinContent(101));
163 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
171 gStyle->SetPalette(1);
172 c1->SetRightMargin(0.2);
175 std::unique_ptr<TH1F> h7 = std::make_unique<TH1F>(
"h7",
"", 100, 0, 10000);
176 ntuple->Draw(
"hits>>h7",
"straw>=147&&straw<200&&eff>0.7");
177 double range = h7->GetMean();
180 std::unique_ptr<TH2F> h2 = std::make_unique<TH2F>(
"h2",
"", 110, -0.5, 5481.5, 100, 0.,
range * 1.2);
181 ntuple->Project(
"h2",
"hits:straw",
"status==0");
183 h2->GetXaxis()->SetTitle(
"Straw index");
184 h2->GetXaxis()->SetTitleSize(0.04);
186 h2->GetYaxis()->SetTitleOffset(1.2);
187 h2->GetYaxis()->SetTitle(
"Number of hits on track");
188 h2->GetYaxis()->SetTitleSize(0.04);
190 h2->GetZaxis()->SetTitleOffset(1.2);
191 h2->GetZaxis()->SetTitle(
"Number of straws");
192 h2->GetZaxis()->SetTitleSize(0.04);
195 ntuple->SetMarkerStyle(20);
196 ntuple->SetMarkerSize(0.8);
197 ntuple->SetMarkerColor(1);
198 ntuple->Draw(
"hits:straw",
"status==52||status==51",
"same");
202 l.DrawLatex(750,
range * 1.1,
"black points: straws excluded due to low / high HT occupancy");
203 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
205 print(Form(
"numberOfHitsOnTrack_%d",
run),
c1);
211 std::unique_ptr<TH2F> hh22 = std::make_unique<TH2F>(
"hh22",
"", 5, -2.5, 2.5, 32, -0.5, 31.5);
212 ntuple->Project(
"hh22",
"phi:side",
"status>1");
214 hh22->GetXaxis()->SetTitle(
"Detector side (athena numbering) Z");
215 hh22->GetXaxis()->SetTitleSize(0.04);
217 hh22->GetYaxis()->SetTitleOffset(0.8);
218 hh22->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
219 hh22->GetYaxis()->SetTitleSize(0.04);
221 hh22->GetZaxis()->SetTitle(
"Number of additional excluded straws");
222 hh22->GetZaxis()->SetTitleSize(0.04);
226 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
227 mytext.DrawLatex(0.23, 0.91,
"Endcap || Barrel");
228 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
229 mytext.DrawLatex(0.67, 0.91,
"Barrel || Endcap");
231 print(Form(
"additionalExcludedStraws_%d",
run),
c1);
234 std::unique_ptr<TH2F> h3 = std::make_unique<TH2F>(
"h3",
"", 7, -3.5, 3.5, 32, -0.5, 31.5);
235 ntuple->Project(
"h3",
"phi:side*(lay+1)/abs(side)",
"status>1 && abs(side)==1");
236 h3->GetXaxis()->SetTitle(
"Barrel Module (athena numbering) Z");
237 h3->GetXaxis()->SetTitleSize(0.04);
239 h3->GetYaxis()->SetTitleOffset(0.8);
240 h3->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
241 h3->GetYaxis()->SetTitleSize(0.04);
243 h3->GetZaxis()->SetTitle(
"Number of additional excluded straws");
244 h3->GetZaxis()->SetTitleSize(0.04);
246 h3->Draw(
"colz text");
248 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
249 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
251 print(Form(
"additionalExcludedStrawsBarrel_%d",
run),
c1);
254 std::unique_ptr<TH2F> h4 = std::make_unique<TH2F>(
"h4",
"", 29, -14.5, 14.5, 32, -0.5, 31.5);
255 ntuple->Project(
"h4",
"phi:side*(lay+1)/abs(side)",
"status>1 && abs(side)==2");
257 h4->GetXaxis()->SetTitle(
"Endcap Wheel (athena numbering) Z");
258 h4->GetXaxis()->SetTitleSize(0.04);
260 h4->GetYaxis()->SetTitleOffset(0.8);
261 h4->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
262 h4->GetYaxis()->SetTitleSize(0.04);
264 h4->GetZaxis()->SetTitle(
"Number of additional excluded straws");
265 h4->GetZaxis()->SetTitleSize(0.04);
267 h4->Draw(
"colz text");
269 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
270 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
272 print(Form(
"additionalExcludedStrawsEndcap_%d",
run),
c1);
275 std::unique_ptr<TH2F> h5 = std::make_unique<TH2F>(
"h5",
"", 7, -3.5, 3.5, 32, -0.5, 31.5);
276 ntuple->Project(
"h5",
"phi:side*(lay+1)/abs(side)",
"status == 12 && abs(side)==1");
277 if (h5->GetEntries() != 0)
280 h5->GetXaxis()->SetTitle(
"Barrel Module (athena numbering) Z");
281 h5->GetXaxis()->SetTitleSize(0.04);
283 h5->GetYaxis()->SetTitleOffset(0.8);
284 h5->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
285 h5->GetYaxis()->SetTitleSize(0.04);
287 h5->GetZaxis()->SetTitle(
"Number of additional DEAD excluded straws");
288 h5->GetZaxis()->SetTitleSize(0.04);
290 h5->Draw(
"colz text");
292 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
293 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
295 print(Form(
"additionalExcludedDEADStrawsBarrel_%d",
run),
c1);
299 std::unique_ptr<TH2F> h6 = std::make_unique<TH2F>(
"h6",
"", 29, -14.5, 14.5, 32, -0.5, 31.5);
300 ntuple->Project(
"h6",
"phi:side*(lay+1)/abs(side)",
"status == 12 && abs(side)==2");
301 if (h6->GetEntries() != 0)
304 h6->GetXaxis()->SetTitle(
"Endcap Module (athena numbering) Z");
305 h6->GetXaxis()->SetTitleSize(0.04);
307 h6->GetYaxis()->SetTitleOffset(0.8);
308 h6->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
309 h6->GetYaxis()->SetTitleSize(0.04);
311 h6->GetZaxis()->SetTitle(
"Number of additional DEAD excluded straws");
312 h6->GetZaxis()->SetTitleSize(0.04);
314 h6->Draw(
"colz text");
316 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
317 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
319 print(Form(
"additionalExcludedDEADStrawsEndcap_%d",
run),
c1);
323 std::unique_ptr<TH2F> h55 = std::make_unique<TH2F>(
"h55",
"", 7, -3.5, 3.5, 32, -0.5, 31.5);
324 ntuple->Project(
"h55",
"phi:side*(lay+1)/abs(side)",
"status == 11 && abs(side)==1");
325 if (h55->GetEntries() != 0)
328 h55->GetXaxis()->SetTitle(
"Barrel Module (athena numbering) Z");
329 h55->GetXaxis()->SetTitleSize(0.04);
331 h55->GetYaxis()->SetTitleOffset(0.8);
332 h55->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
333 h55->GetYaxis()->SetTitleSize(0.04);
335 h55->GetZaxis()->SetTitle(
"Number of additional NOISY excluded straws");
336 h55->GetZaxis()->SetTitleSize(0.04);
338 h55->Draw(
"colz text");
340 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
341 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
343 print(Form(
"additionalExcludedNOISYStrawsBarrel_%d",
run),
c1);
348 std::unique_ptr<TH2F> h66 = std::make_unique<TH2F>(
"h66",
"", 29, -14.5, 14.5, 32, -0.5, 31.5);
349 ntuple->Project(
"h66",
"phi:side*(lay+1)/abs(side)",
"status == 11 && abs(side)==2");
350 if (h66->GetEntries() != 0)
353 h66->GetXaxis()->SetTitle(
"Endcap Module (athena numbering) Z");
354 h66->GetXaxis()->SetTitleSize(0.04);
356 h66->GetYaxis()->SetTitleOffset(0.8);
357 h66->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
358 h66->GetYaxis()->SetTitleSize(0.04);
360 h66->GetZaxis()->SetTitle(
"Number of additional NOISY excluded straws");
361 h66->GetZaxis()->SetTitleSize(0.04);
363 h66->Draw(
"colz text");
365 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
366 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
368 print(Form(
"additionalExcludedNOISYStrawsEndcap_%d",
run),
c1);
372 std::unique_ptr<TH2F> h555 = std::make_unique<TH2F>(
"h555",
"", 7, -3.5, 3.5, 32, -0.5, 31.5);
373 ntuple->Project(
"h555",
"phi:side*(lay+1)/abs(side)",
"status == 42 && abs(side)==1");
374 if (h555->GetEntries() != 0)
377 h555->GetXaxis()->SetTitle(
"Barrel Module (athena numbering) Z");
378 h555->GetXaxis()->SetTitleSize(0.04);
380 h555->GetYaxis()->SetTitleOffset(0.8);
381 h555->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
382 h555->GetYaxis()->SetTitleSize(0.04);
384 h555->GetZaxis()->SetTitle(
"Number of additional LowEff excluded straws");
385 h555->GetZaxis()->SetTitleSize(0.04);
387 h555->Draw(
"colz text");
389 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
390 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
392 print(Form(
"additionalExcludedLowEffStrawsBarrel_%d",
run),
c1);
396 std::unique_ptr<TH2F> h666 = std::make_unique<TH2F>(
"h666",
"", 29, -14.5, 14.5, 32, -0.5, 31.5);
397 ntuple->Project(
"h666",
"phi:side*(lay+1)/abs(side)",
"status == 42 && abs(side)==2");
398 if (h666->GetEntries() != 0)
401 h666->GetXaxis()->SetTitle(
"Endcap Module (athena numbering) Z");
402 h666->GetXaxis()->SetTitleSize(0.04);
404 h666->GetYaxis()->SetTitleOffset(0.8);
405 h666->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
406 h666->GetYaxis()->SetTitleSize(0.04);
408 h666->GetZaxis()->SetTitle(
"Number of additional LowEff excluded straws");
409 h666->GetZaxis()->SetTitleSize(0.04);
411 h666->Draw(
"colz text");
413 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
414 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
416 print(Form(
"additionalExcludedLowEffStrawsEndcap_%d",
run),
c1);
420 std::unique_ptr<TH2F> h5555 = std::make_unique<TH2F>(
"h5555",
"", 7, -3.5, 3.5, 32, -0.5, 31.5);
421 ntuple->Project(
"h5555",
"phi:side*(lay+1)/abs(side)",
"status > 50 && abs(side)==1");
422 if (h5555->GetEntries() != 0)
425 h5555->GetXaxis()->SetTitle(
"Barrel Module (athena numbering) Z");
426 h5555->GetXaxis()->SetTitleSize(0.04);
428 h5555->GetYaxis()->SetTitleOffset(0.8);
429 h5555->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
430 h5555->GetYaxis()->SetTitleSize(0.04);
432 h5555->GetZaxis()->SetTitle(
"Number of additional BadHT excluded straws");
433 h5555->GetZaxis()->SetTitleSize(0.04);
435 h5555->Draw(
"colz text");
437 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
438 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
440 print(Form(
"additionalExcludedBadHTStrawsBarrel_%d",
run),
c1);
444 std::unique_ptr<TH2F> h6666 = std::make_unique<TH2F>(
"h6666",
"", 29, -14.5, 14.5, 32, -0.5, 31.5);
445 ntuple->Project(
"h6666",
"phi:side*(lay+1)/abs(side)",
"status > 50 && abs(side)==2");
446 if (h6666->GetEntries() != 0)
449 h6666->GetXaxis()->SetTitle(
"Endcap Module (athena numbering) Z");
450 h6666->GetXaxis()->SetTitleSize(0.04);
452 h6666->GetYaxis()->SetTitleOffset(0.8);
453 h6666->GetYaxis()->SetTitle(
"Detector #phi (athena 0-31 range)");
454 h6666->GetYaxis()->SetTitleSize(0.04);
456 h6666->GetZaxis()->SetTitle(
"Number of additional BadHT excluded straws");
457 h6666->GetZaxis()->SetTitleSize(0.04);
459 h6666->Draw(
"colz text");
461 mytext.DrawLatex(0.10, 0.02, Form(
"Run %d",
run));
462 mytext.DrawLatex(0.45, 0.91,
"#leftarrow C || A #rightarrow");
464 print(Form(
"additionalExcludedBadHTStrawsEndcap_%d",
run),
c1);
468 c1->SaveAs(
"allPlots.pdf]");
469 myfile->Write(0,TObject::kOverwrite);