plot_validation.C
Go to the documentation of this file.
1 void plot(TFile* f, std::string plotname, double x0 = 0, double x1 = 0, int rebin = 0)
2 {
3  TH1* h = (TH1*)f->Get(plotname.c_str());
4  h->SetTitle(TString::Format("%s %s", plotname.c_str(), h->GetTitle()));
5  if(rebin) h->Rebin(rebin);
6  if(x0 || x1) h->GetXaxis()->SetRangeUser(x0, x1);
7  h->Draw();
8  gPad->SetLogy(false);
9  gPad->Print(("plots/valid/"+plotname+".eps").c_str());
10 
11  gPad->SetLogy(true);
12  gPad->Print(("plots/valid/"+plotname+"_log.eps").c_str());
13 }
14 
15 void plot2d(TFile* f, std::string plotname, int rebin = 0)
16 {
17  TH2* h = (TH2*)f->Get(plotname.c_str());
18  if(!h){
19  std::cerr << "Didn't find " << plotname << std::endl;
20  // return;
21  }
22  h->SetTitle(plotname.c_str());
23  if(rebin) h->Rebin2D(rebin, rebin);
24  h->Draw("colz");
25  gPad->SetLogy(false);
26  gPad->SetLogz(false);
27  gPad->Print(("plots/valid/"+plotname+".eps").c_str());
28 
29  gPad->SetLogz(true);
30  gPad->Print(("plots/valid/"+plotname+"_log.eps").c_str());
31 }
32 
34 {
35  gStyle->SetOptStat(1111);
36 
37  TFile* f = new TFile("dtvalidation_hist.root");
38 
39  plot(f, "kaldt/trackLength2d", 0, 200);
40  plot(f, "kaldt/hitsPerTrack2d", 0, 100);
41  plot(f, "kaldt/cosX2d");
42  plot(f, "kaldt/cosY2d");
43  plot(f, "kaldt/cosZ2d");
44  plot(f, "kaldt/xPosStart", 0, 0, 5);
45  plot(f, "kaldt/yPosStart", 0, 0, 5);
46  plot(f, "kaldt/zPosStart", 0, 0, 10);
47  plot(f, "kaldt/xPosEnd", 0, 0, 5);
48  plot(f, "kaldt/yPosEnd", 0, 0, 5);
49  plot(f, "kaldt/zPosEnd", 0, 0, 10);
50  plot(f, "kaldt/2dTracksPerEvent");
51 
52  plot(f, "kaldtm/trackLength", 0, 1e3);
53  plot(f, "kaldtm/hitsPerTrack", 0, 200);
54  plot(f, "kaldtm/cosX");
55  plot(f, "kaldtm/cosY");
56  plot(f, "kaldtm/cosZ");
57  plot(f, "kaldtm/xPosStart", 0, 0, 5);
58  plot(f, "kaldtm/yPosStart", 0, 0, 5);
59  plot(f, "kaldtm/zPosStart", 0, 0, 10);
60  plot(f, "kaldtm/xPosEnd", 0, 0, 5);
61  plot(f, "kaldtm/yPosEnd", 0, 0, 5);
62  plot(f, "kaldtm/zPosEnd", 0, 0, 10);
63 
64  plot2d(f, "kaldtm/XvYStart", 5);
65  plot2d(f, "kaldtm/XvYEnd", 5);
66  plot2d(f, "kaldtm/ZvXReco", 5);
67  plot2d(f, "kaldtm/ZvYReco", 5);
68  plot2d(f, "kaldtm/ZvX", 5);
69  plot2d(f, "kaldtm/ZvY", 5);
70 
71  plot(f, "kaldtm/tracksPerEvent");
72  plot(f, "kaldtm/xHitsPerPlane", 0, 0, 2);
73  plot(f, "kaldtm/yHitsPerPlane", 0, 0, 2);
74  plot(f, "kaldtm/hitsPerPlane");
75  plot(f, "kaldtm/xHitsPerCell");
76  plot(f, "kaldtm/yHitsPerCell");
77  plot(f, "kaldtm/xPos", 0, 0, 5);
78  plot(f, "kaldtm/yPos", 0, 0, 5);
79  plot(f, "kaldtm/xRecoPos");
80  plot(f, "kaldtm/yRecoPos");
81  plot2d(f, "kaldtm/xPlaneVCell");
82  plot2d(f, "kaldtm/yPlaneVCell");
83  plot2d(f, "kaldtm/planeVCell");
84 
85 
86  plot(f, "fuzzydt/fHistoNt");
87  plot(f, "fuzzydt/fHistoLen", 0, 200);
88  plot(f, "fuzzydt/fHistoSZ");
89  plot(f, "fuzzydt/fHistoNCells", 0, 100);
90  plot(f, "fuzzydt/fHistoPECorr", 0, 1e4);
91 
92  plot(f, "fuzzydtm/fHistoNt");
93  plot(f, "fuzzydtm/fHistoLen", 0, 1000);
94  plot(f, "fuzzydtm/fHistoSX");
95  plot(f, "fuzzydtm/fHistoSY");
96  plot(f, "fuzzydtm/fHistoSZ", 0, 0, 2);
97  plot(f, "fuzzydtm/fHistoDX");
98  plot(f, "fuzzydtm/fHistoDY");
99  plot(f, "fuzzydtm/fHistoDZ");
100  plot(f, "fuzzydtm/fHistoNCells");
101  plot(f, "fuzzydtm/fHistoNCellsX");
102  plot(f, "fuzzydtm/fHistoNCellsY");
103  plot2d(f, "fuzzydtm/fHistoNCellsXY");
104  plot(f, "fuzzydtm/fHistoPECorr");
105  plot2d(f, "fuzzydtm/fHistoPECorrYvX");
106  plot(f, "fuzzydtm/fHistoEff");
107  plot(f, "fuzzydtm/fHistoPur");
108  plot(f, "fuzzydtm/fHistoAngle");
109  plot(f, "fuzzydtm/fHistoMatched");
110  plot(f, "fuzzydtm/fHistoUnMatched");
111  plot(f, "fuzzydtm/fHistoLeft");
112  plot(f, "fuzzydtm/fHistoLeptonEff");
113  plot(f, "fuzzydtm/fHistoLeptonPur");
114  plot(f, "fuzzydtm/fHistoLeptonAngle");
115  plot2d(f, "fuzzydtm/fHistoUvL");
116  plot(f, "fuzzydtm/fHistoUnVisE");
117  plot(f, "fuzzydtm/fHistoMVisE");
118  plot2d(f, "fuzzydtm/fHistoEffvEvis");
119  plot2d(f, "fuzzydtm/fHistoPurvEvis");
120  plot2d(f, "fuzzydtm/fHistoAnglevEvis");
121  plot2d(f, "fuzzydtm/fHistoEffvPur");
122 }
void plot(TFile *f, std::string plotname, double x0=0, double x1=0, int rebin=0)
void plot_validation()
void plot2d(TFile *f, std::string plotname, int rebin=0)
Float_t x1[n_points_granero]
Definition: compare.C:5
OStream cerr
Definition: OStream.cxx:7
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
enum BeamMode string