4 # include <TGraphErrors.h> 40 TFile*
Init(
const char* fname)
44 TFile*
file = TFile::Open(filename,
"READ");
46 Error(
"Run",
"Failed to open \"%s\"", filename.Data());
73 if (!(file =
Init(fname)))
return;
77 pdfName.ReplaceAll(
".root",
".pdf");
97 Info(
"DrawBetaGammadEdx",
"Drawing beta*gamma & dE/dx from %s",
101 TH2* betaGammadEdx =
GetH2(dir,
"betaGammadEdx");
102 TH2* betaGammaEta =
GetH2(dir,
"betaGammaEta");
103 TH2* dEdxEta =
GetH2(dir,
"dEdxEta");
106 Int_t n = betaGammadEdx->GetEntries();
107 betaGammadEdx->Scale(1./n,
"width");
110 TGraph* gs[] = { 0, 0, 0, 0, 0 };
118 TArrow* mip =
new TArrow(3.5, 1.1*betaGammadEdx->GetYaxis()->GetXmin(),
119 3.5, .6, 0.02,
"<|");
121 mip->SetLineWidth(2);
122 mip->SetFillColor(mip->GetLineColor());
126 TLegend* l =
new TLegend(0.05, 0.05, 0.95, 0.95);
132 for (
Int_t i = 0; i < 5; i++) {
133 if (!gs[i])
continue;
134 l->AddEntry(gs[i], gs[i]->GetTitle(),
"l");
140 Int_t n = betaGammaEta->GetEntries();
141 betaGammaEta->Scale(1./n,
"width");
145 Int_t n = dEdxEta->GetEntries();
146 dEdxEta->Scale(1. / n,
"width");
151 if (!tit.IsNull()) tit.Append(
" - ");
152 tit.Append(
"BetaGamma and dE/dx");
158 const char* folderName =
"mcTrackELoss";
168 Info(
"DrawELossFits",
"Drawing energy loss fits");
174 const Char_t** ringPtr = ringNames;
183 Info(
"DrawELossFits",
"Drawing energy loss fits for %s", *ringPtr);
188 if (!all || !prim || !sec) {
198 while ((allHist = static_cast<TH1*>(next()))) {
199 TH1* primHist =
static_cast<TH1*
>(prim->FindObject(allHist->GetName()));
200 TH1* secHist =
static_cast<TH1*
>(sec ->FindObject(allHist->GetName()));
201 if (!primHist || !secHist)
continue;
203 allHist ->GetXaxis()->SetRangeUser(0,2);
204 primHist->SetMarkerStyle(24);
205 secHist ->SetMarkerStyle(25);
207 if (iPad == 0)
fBody->Divide(2,1);
217 *ringPtr, iPad/nPad));
222 Info(
"DrawELossFits",
"Drew %d energy loss fits for %s",
233 TLatex* ltx =
new TLatex(.5, .7,
"MC track inspection");
235 ltx->SetTextSize(0.07);
236 ltx->SetTextAlign(22);
292 const Double_t rho = (density ? 2.33 : 1);
293 for (
Int_t i = 0; i < graph->GetN(); i++)
294 graph->SetPoint(i, x[i] /
mass, y[i] * rho);
303 graph->GetHistogram()->SetXTitle(
"#beta#gamma");
304 graph->GetHistogram()->SetYTitle(
"#Delta E/#Delta x [MeV/cm]");
305 graph->SetFillColor(0);
306 graph->SetLineColor(kRed+1);
307 graph->SetLineStyle(2);
308 graph->SetLineWidth(2);
309 graph->SetName(
"full_stop");
310 graph->SetTitle(
"Stopping (MeVcm^{2}/g) [RPP fig 27.1]");
311 graph->SetPoint(0,0.001461622,40.17542);
312 graph->SetPoint(1,0.003775053,91.28429);
313 graph->SetPoint(2,0.01178769,202.7359);
314 graph->SetPoint(3,0.01722915,212.1938);
315 graph->SetPoint(4,0.03162278,172.8318);
316 graph->SetPoint(5,0.06028646,91.28429);
317 graph->SetPoint(6,0.09506529,51.62633);
318 graph->SetPoint(7,0.433873,5.281682);
319 graph->SetPoint(8,1.255744,1.808947);
320 graph->SetPoint(9,2.393982,1.440177);
321 graph->SetPoint(10,3.499097,1.407715);
322 graph->SetPoint(11,10.92601,1.542122);
323 graph->SetPoint(12,60.28646,1.85066);
324 graph->SetPoint(13,236.3885,2.121938);
325 graph->SetPoint(14,468.0903,2.324538);
326 graph->SetPoint(15,1208.976,2.987085);
327 graph->SetPoint(16,6670.768,7.961412);
328 graph->SetPoint(17,23341.67,24.3298);
329 graph->SetPoint(18,110651.2,104.6651);
330 graph->SetPoint(19,264896.9,260.5203);
333 graph->Draw(
"C same");
345 graph->SetName(
"stop_nodelta");
346 graph->SetTitle(
"Stopping w/o #delta's [RPP fig 27.1]");
347 graph->GetHistogram()->SetYTitle(
"(MeVcm^{2}/g)");
348 graph->GetHistogram()->SetXTitle(
"#beta#gamma");
349 graph->SetFillColor(0);
350 graph->SetLineColor(kGreen+1);
351 graph->SetLineStyle(2);
352 graph->SetLineWidth(2);
353 graph->SetPoint(0,0.001461622,40.17542);
354 graph->SetPoint(1,0.003775053,91.28429);
355 graph->SetPoint(2,0.01178769,202.7359);
356 graph->SetPoint(3,0.01722915,212.1938);
357 graph->SetPoint(4,0.03162278,172.8318);
358 graph->SetPoint(5,0.06028646,91.28429);
359 graph->SetPoint(6,0.09506529,51.62633);
360 graph->SetPoint(7,0.433873,5.281682);
361 graph->SetPoint(8,1.255744,1.808947);
362 graph->SetPoint(9,2.304822,1.473387);
363 graph->SetPoint(10,3.921088,1.473387);
364 graph->SetPoint(11,8.064796,1.614064);
365 graph->SetPoint(12,26.15667,1.936996);
366 graph->SetPoint(13,264.8969,2.489084);
367 graph->SetPoint(14,544.8334,2.665278);
368 graph->SetPoint(15,1163.949,2.853945);
369 graph->SetPoint(16,5312.204,3.19853);
370 graph->SetPoint(17,15374.93,3.424944);
371 graph->SetPoint(18,49865.73,3.667384);
372 graph->SetPoint(19,634158.5,4.110185);
386 graph->SetName(
"norad_stop");
387 graph->SetTitle(
"Stopping w/o radiative loss [RPP fig. 27.1]");
388 graph->GetHistogram()->SetYTitle(
"(MeVcm^{2}/g)");
389 graph->GetHistogram()->SetXTitle(
"#beta#gamma");
390 graph->SetFillColor(0);
391 graph->SetLineColor(kBlue+1);
392 graph->SetLineWidth(2);
393 graph->SetLineStyle(2);
394 graph->SetPoint(0,0.001,24.3298);
395 graph->SetPoint(1,0.003117649,74.35105);
396 graph->SetPoint(2,0.008675042,172.8318);
397 graph->SetPoint(3,0.01782497,212.1938);
398 graph->SetPoint(4,0.02704573,189.3336);
399 graph->SetPoint(5,0.07481082,70.29816);
400 graph->SetPoint(6,0.3300035,8.524974);
401 graph->SetPoint(7,0.819559,2.489084);
402 graph->SetPoint(8,1.447084,1.651284);
403 graph->SetPoint(9,2.555097,1.440177);
404 graph->SetPoint(10,4.026598,1.407715);
405 graph->SetPoint(11,32.38084,1.728318);
406 graph->SetPoint(12,97.19733,1.893336);
407 graph->SetPoint(13,1732.539,2.170869);
408 graph->SetPoint(14,11098.58,2.324538);
409 graph->SetPoint(15,32075.46,2.378141);
410 graph->SetPoint(16,221655.8,2.546482);
411 graph->SetPoint(17,593830.6,2.605203);
424 graph->SetName(
"mean_eloss");
425 graph->SetTitle(
"Mean #Delta E/#Delta x - " 426 "electronic only [RPP fig. 27.6]");
427 graph->GetHistogram()->SetYTitle(
"(MeVcm^{2}/g)");
428 graph->GetHistogram()->SetXTitle(
"#mu E_{kin} (GeV)");
429 graph->SetFillColor(0);
430 graph->SetLineStyle(2);
431 graph->SetLineWidth(2);
432 graph->SetLineColor(kMagenta+1);
433 graph->SetMarkerStyle(21);
434 graph->SetMarkerSize(0.6);
435 graph->SetPoint(0,0.1,1.346561);
436 graph->SetPoint(1,0.1435819,1.230159);
437 graph->SetPoint(2,0.2061576,1.156085);
438 graph->SetPoint(3,0.3698076,1.124339);
439 graph->SetPoint(4,0.4620113,1.124339);
440 graph->SetPoint(5,0.8521452,1.145503);
441 graph->SetPoint(6,1.909707,1.177249);
442 graph->SetPoint(7,4.048096,1.198413);
443 graph->SetPoint(8,12.66832,1.219577);
444 graph->SetPoint(9,48.17031,1.230159);
445 graph->SetPoint(10,285.8863,1.230159);
446 graph->SetPoint(11,894.6674,1.230159);
461 gre->SetName(
"ELOSS");
462 gre->SetTitle(
"Energy loss 300#mu Si [GFMATE]");
463 gre->GetHistogram()->SetXTitle(
"#beta#gamma");
464 gre->GetHistogram()->SetYTitle(
"#Delta E/#Delta x [MeV/cm]");
465 gre->SetFillColor(kGray);
466 gre->SetFillStyle(3001);
467 gre->SetLineColor(kGray+1);
468 gre->SetLineStyle(1);
469 gre->SetLineWidth(2);
470 gre->SetPoint(0,7.16486e-05,1218.84);
471 gre->SetPoint(1,9.25378e-05,1221.38);
472 gre->SetPoint(2,0.000119517,1180.12);
473 gre->SetPoint(3,0.000154362,1100.31);
474 gre->SetPoint(4,0.000199367,996.621);
475 gre->SetPoint(5,0.000257492,886.005);
476 gre->SetPoint(6,0.000332563,780.483);
477 gre->SetPoint(7,0.000429522,684.927);
478 gre->SetPoint(8,0.000554749,599.407);
479 gre->SetPoint(9,0.000716486,522.375);
480 gre->SetPoint(10,0.000925378,452.497);
481 gre->SetPoint(11,0.00119517,389.101);
482 gre->SetPoint(12,0.00154362,331.974);
483 gre->SetPoint(13,0.00199367,280.969);
484 gre->SetPoint(14,0.00257492,235.689);
485 gre->SetPoint(15,0.00332564,196.156);
486 gre->SetPoint(16,0.00429522,162.402);
487 gre->SetPoint(17,0.00554749,133.87);
488 gre->SetPoint(18,0.00716486,109.959);
489 gre->SetPoint(19,0.00925378,90.2035);
490 gre->SetPoint(20,0.0119517,74.1317);
491 gre->SetPoint(21,0.0154362,60.8988);
492 gre->SetPoint(22,0.0199367,49.9915);
493 gre->SetPoint(23,0.0257492,40.9812);
494 gre->SetPoint(24,0.0332564,33.5739);
495 gre->SetPoint(25,0.0429522,27.5127);
496 gre->SetPoint(26,0.0554749,22.5744);
497 gre->SetPoint(27,0.0716486,18.5674);
498 gre->SetPoint(28,0.0925378,15.3292);
499 gre->SetPoint(29,0.119517,12.7231);
500 gre->SetPoint(30,0.154362,10.6352);
501 gre->SetPoint(31,0.199367,8.97115);
502 gre->SetPoint(32,0.257492,7.65358);
503 gre->SetPoint(33,0.332564,6.61909);
504 gre->SetPoint(34,0.429522,5.79837);
505 gre->SetPoint(35,0.554749,5.148);
506 gre->SetPoint(36,0.716486,4.65024);
507 gre->SetPoint(37,0.925378,4.27671);
508 gre->SetPoint(38,1.19517,3.99831);
509 gre->SetPoint(39,1.54362,3.79877);
510 gre->SetPoint(40,1.99367,3.6629);
511 gre->SetPoint(41,2.57492,3.57594);
512 gre->SetPoint(42,3.32564,3.52565);
513 gre->SetPoint(43,4.29522,3.50206);
514 gre->SetPoint(44,5.54749,3.49715);
515 gre->SetPoint(45,7.16486,3.50467);
516 gre->SetPoint(46,9.25378,3.51988);
517 gre->SetPoint(47,11.9517,3.53932);
518 gre->SetPoint(48,15.4362,3.56054);
519 gre->SetPoint(49,19.9367,3.58189);
520 gre->SetPoint(50,25.7492,3.60231);
521 gre->SetPoint(51,33.2564,3.62113);
522 gre->SetPoint(52,42.9522,3.638);
523 gre->SetPoint(53,55.4749,3.65275);
524 gre->SetPoint(54,71.6486,3.66537);
525 gre->SetPoint(55,92.5378,3.67586);
526 gre->SetPoint(56,119.517,3.68433);
527 gre->SetPoint(57,154.362,3.69105);
528 gre->SetPoint(58,199.367,3.6962);
529 gre->SetPoint(59,257.492,3.69997);
530 gre->SetPoint(60,332.564,3.70257);
531 gre->SetPoint(61,429.522,3.70421);
532 gre->SetPoint(62,554.749,3.70511);
533 gre->SetPoint(63,716.486,3.7055);
534 gre->SetPoint(64,925.378,3.70559);
535 gre->SetPoint(65,1195.17,3.70558);
536 gre->SetPoint(66,1543.62,3.70557);
537 gre->SetPoint(67,1993.67,3.70555);
538 gre->SetPoint(68,2574.92,3.70553);
539 gre->SetPoint(69,3325.64,3.70552);
540 gre->SetPoint(70,4295.22,3.7055);
541 gre->SetPoint(71,5547.49,3.70548);
542 gre->SetPoint(72,7164.86,3.70547);
543 gre->SetPoint(73,9253.78,3.70545);
544 gre->SetPoint(74,11951.7,3.70544);
545 gre->SetPoint(75,15436.2,3.70544);
546 gre->SetPoint(76,19936.7,3.70544);
547 gre->SetPoint(77,25749.2,3.70544);
548 gre->SetPoint(78,33256.4,3.70544);
549 gre->SetPoint(79,42952.2,3.70544);
550 gre->SetPoint(80,55474.9,3.70544);
551 gre->SetPoint(81,71648.6,3.70544);
552 gre->SetPoint(82,92537.8,3.70544);
553 gre->SetPoint(83,119517,3.70544);
554 gre->SetPoint(84,154362,3.70544);
555 gre->SetPoint(85,199367,3.70544);
556 gre->SetPoint(86,257492,3.70544);
557 gre->SetPoint(87,332563,3.70544);
558 gre->SetPoint(88,429522,3.70544);
559 gre->SetPoint(89,554749,3.70544);
560 gre->SetPoint(90,716486,3.70544);
563 for (
Int_t i = 0; i < gre->GetN(); i++)
564 gre->SetPointError(i, 0, 2 * 0.1 * y[i]);
580 graph->SetName(
"si_resp");
581 graph->SetTitle(
"f(#Delta/x) scaled to the MPV value ");
582 graph->GetHistogram()->SetXTitle(
"#Delta/x (MeVcm^{2}/g)");
583 graph->GetHistogram()->SetYTitle(
"f(#Delta/x)");
584 graph->SetLineColor(kBlue+1);
585 graph->SetLineWidth(2);
586 graph->SetFillColor(kBlue+1);
587 graph->SetMarkerStyle(21);
588 graph->SetMarkerSize(0.6);
589 graph->SetPoint(0,0.8115124,0.009771987);
590 graph->SetPoint(1,0.9198646,0.228013);
591 graph->SetPoint(2,0.996614,0.5895765);
592 graph->SetPoint(3,1.041761,0.8241042);
593 graph->SetPoint(4,1.059819,0.8794788);
594 graph->SetPoint(5,1.077878,0.9348534);
595 graph->SetPoint(6,1.100451,0.980456);
596 graph->SetPoint(7,1.141084,0.9967427);
597 graph->SetPoint(8,1.204289,0.9153094);
598 graph->SetPoint(9,1.276524,0.742671);
599 graph->SetPoint(10,1.402935,0.465798);
600 graph->SetPoint(11,1.515801,0.3029316);
601 graph->SetPoint(12,1.73702,0.1465798);
602 graph->SetPoint(13,1.985327,0.08143322);
603 graph->SetPoint(14,2.301354,0.04234528);
604 graph->SetPoint(15,2.56772,0.02931596);
618 graph->SetName(
"graph");
619 graph->SetTitle(
"(#Delta_{p}/x)/(dE/dx)|_{mip} for 320#mu Si");
620 graph->GetHistogram()->SetXTitle(
"#beta#gamma = p/m");
621 graph->SetFillColor(1);
622 graph->SetLineColor(7);
623 graph->SetMarkerStyle(21);
624 graph->SetMarkerSize(0.6);
625 graph->SetPoint(0,1.196058,0.9944915);
626 graph->SetPoint(1,1.28502,0.9411017);
627 graph->SetPoint(2,1.484334,0.8559322);
628 graph->SetPoint(3,1.984617,0.7491525);
629 graph->SetPoint(4,2.658367,0.6983051);
630 graph->SetPoint(5,3.780227,0.6779661);
631 graph->SetPoint(6,4.997358,0.6741525);
632 graph->SetPoint(7,8.611026,0.684322);
633 graph->SetPoint(8,15.28296,0.6995763);
634 graph->SetPoint(9,41.54516,0.7186441);
635 graph->SetPoint(10,98.91461,0.7288136);
636 graph->SetPoint(11,203.2734,0.7326271);
637 graph->SetPoint(12,505.6421,0.7338983);
638 graph->SetPoint(13,896.973,0.7338983);
Base class for classes to draw summaries.
static TH2 * GetH2(const TObject *parent, const TString &name, Bool_t verb=true)
void Run(const char *fname, UShort_t what=kNormal)
TFile * Init(const char *fname)
void DrawTrackDensity(TCollection *parent, const char *folderName="mcTrackDensity")
static void SysString(UShort_t sys, TString &str)
static Bool_t GetParameter(const TObject *c, const TString &name, Short_t &value, Bool_t verb=true)
void CreateCanvas(const TString &pname, Bool_t landscape=false, Bool_t pdf=true, Bool_t useTop=true)
void DrawParameter(Double_t &y, const TString &name, const TString &value, Double_t size=0)
static const Char_t ** GetRingNames(Bool_t lower=false)
void PrintCanvas(const TString &title, Float_t size=.7)
void DrawELossFits(TCollection *parent)
static void SNNString(UShort_t sNN, TString &str)
virtual void DrawEventInspector(TCollection *parent)
TFile * file
TList with histograms for a given trigger.
TGraph * FromRPPNoDelta()
void DrawBetaGammadEdx(TCollection *dir, const char *prefix, UShort_t extra=0x1F)
TObject * DrawInPad(TVirtualPad *c, Int_t padNo, TObject *h, Option_t *opts="", UInt_t flags=0x0, const char *title="")
void DrawTrackDensity(TCollection *parent)
void ScaleGraph(TGraph *graph, bool density=true, double mass=1)
static TCollection * GetCollection(const TObject *parent, const TString &name, Bool_t verb=true)