]>
Commit | Line | Data |
---|---|---|
7fecd941 | 1 | /* |
2 | fbellini@cern.ch - last update on 27/02/2014 | |
3 | Macro to draw the TOF QA trending plots by accessing the std tree. | |
4 | To be mainly used with the automatic scripts to fill the QA repository. | |
5 | Launch with | |
6 | aliroot -x -b -q "DrawTrendingTOFQA.C" | |
7 | The macro produces one png file for each trending variables | |
8 | and a .root file with the histograms | |
9 | */ | |
10 | Int_t DrawTrendingTOFQA(TString mergedTrendFile = "trending.root", // trending tree file | |
11 | Bool_t displayAll = kFALSE) //set to kTRUE to display trending for expert plots | |
12 | { | |
13 | // | |
14 | //reads merged trending.root file and draws trending plots from tree | |
15 | // | |
16 | if (!mergedTrendFile) { | |
17 | Printf("Cannot open merged trend file with TOF QA"); | |
18 | return 1; | |
19 | } | |
20 | ||
21 | char outfilename[200]= "ProductionQA.hist.root"; | |
22 | TString plotDir("."); | |
23 | // TString plotDir(Form("PlotsTrending")); | |
24 | // gSystem->Exec(Form("mkdir %s",plotDir.Data())); | |
25 | ||
26 | Int_t runNumber=0; | |
27 | Double_t avTime=0., peakTime=0., spreadTime=0., peakTimeErr=0., spreadTimeErr=0.,negTimeRatio=0., | |
28 | avRawTime=0., peakRawTime=0., spreadRawTime=0., peakRawTimeErr=0., spreadRawTimeErr=0., | |
29 | avTot=0., peakTot=0.,spreadTot=0., peakTotErr=0.,spreadTotErr=0., | |
30 | orphansRatio=0., avL=0., negLratio=0., | |
31 | effPt1=0., effPt2=0., matchEffLinFit1Gev=0.,matchEffLinFit1GevErr=0.; | |
32 | Double_t avDiffTime=0.,peakDiffTime=0., spreadDiffTime=0.,peakDiffTimeErr=0., spreadDiffTimeErr=0.,avT0fillRes=0.; | |
33 | ||
34 | Double_t avT0A=0.,peakT0A=0., spreadT0A=0.,peakT0AErr=0., spreadT0AErr=0.; | |
35 | Double_t avT0C=0.,peakT0C=0., spreadT0C=0.,peakT0CErr=0., spreadT0CErr=0.; | |
36 | Double_t avT0AC=0.,peakT0AC=0., spreadT0AC=0.,peakT0ACErr=0., spreadT0ACErr=0.; | |
37 | Double_t avT0res=0.,peakT0res=0., spreadT0res=0.,peakT0resErr=0., spreadT0resErr=0.; | |
38 | Float_t avMulti=0; | |
39 | Float_t fractionEventsWHits=0.0; | |
40 | Double_t goodChannelRatio=0.0; | |
65ae12f9 | 41 | Double_t goodChannelRatioInAcc=0.0; |
42 | ||
7fecd941 | 43 | |
44 | TFile * fin = TFile::Open(mergedTrendFile.Data()); | |
45 | TTree * ttree = (TTree*) fin->Get("trending"); | |
46 | if (!ttree){ | |
47 | Printf("Invalid trending tree."); | |
48 | return 2; | |
49 | } | |
50 | ttree->SetBranchAddress("run",&runNumber); | |
51 | ttree->SetBranchAddress("avMulti",&avMulti); | |
52 | ttree->SetBranchAddress("goodChannelsRatio",&goodChannelRatio); | |
65ae12f9 | 53 | ttree->SetBranchAddress("goodChannelsRatioInAcc",&goodChannelRatioInAcc); |
7fecd941 | 54 | ttree->SetBranchAddress("avTime",&avTime); //mean time |
55 | ttree->SetBranchAddress("peakTime",&peakTime); //main peak time after fit | |
56 | ttree->SetBranchAddress("spreadTime",&spreadTime); //spread of main peak of time after fit | |
57 | ttree->SetBranchAddress("peakTimeErr",&peakTimeErr); //main peak time after fit error | |
58 | ttree->SetBranchAddress("spreadTimeErr",&spreadTimeErr); //spread of main peak of time after fit error | |
59 | ttree->SetBranchAddress("negTimeRatio",&negTimeRatio); //negative time ratio | |
60 | ttree->SetBranchAddress("avRawTime",&avRawTime); //mean raw time | |
61 | ttree->SetBranchAddress("peakRawTime",&peakRawTime); //mean peak of raw time after fit | |
62 | ttree->SetBranchAddress("spreadRawTime",&spreadRawTime); //spread of main peak of raw time after fit | |
63 | ttree->SetBranchAddress("peakRawTimeErr",&peakRawTimeErr); //main peak raw time after fit error | |
64 | ttree->SetBranchAddress("spreadRawTimeErr",&spreadRawTimeErr); //spread of raw main peak of time after fit error | |
65 | ttree->SetBranchAddress("avTot",&avTot); //main peak tot | |
66 | ttree->SetBranchAddress("peakTot",&peakTot); // main peak of tot after fit | |
67 | ttree->SetBranchAddress("spreadTot",&spreadTot); //spread of main peak of tot after fit | |
68 | ttree->SetBranchAddress("peakTotErr",&peakTotErr); // main peak of tot after fit | |
69 | ttree->SetBranchAddress("spreadTotErr",&spreadTotErr); //spread of main peak of tot after fit | |
70 | ttree->SetBranchAddress("orphansRatio",&orphansRatio); //orphans ratio | |
71 | ttree->SetBranchAddress("avL",&avL); //mean track length | |
72 | ttree->SetBranchAddress("negLratio",&negLratio);//ratio of tracks with track length <350 cm | |
73 | ttree->SetBranchAddress("effPt1",&effPt1);//matching eff at 1 GeV/c | |
74 | ttree->SetBranchAddress("effPt2",&effPt2); //matching eff at 2 GeV/c | |
75 | ttree->SetBranchAddress("matchEffLinFit1Gev",&matchEffLinFit1Gev);//matching eff fit param | |
76 | ttree->SetBranchAddress("matchEffLinFit1GevErr",&matchEffLinFit1GevErr);////matching eff fit param error | |
77 | ttree->SetBranchAddress("avPiDiffTime",&avDiffTime); //mean t-texp | |
78 | ttree->SetBranchAddress("peakPiDiffTime",&peakDiffTime); //main peak t-texp after fit | |
79 | ttree->SetBranchAddress("spreadPiDiffTime",&spreadDiffTime); //spread of main peak t-texp after fit | |
80 | ttree->SetBranchAddress("peakPiDiffTimeErr",&peakDiffTimeErr); //main peak t-texp after fit error | |
81 | ttree->SetBranchAddress("spreadPiDiffTimeErr",&spreadDiffTimeErr); //spread of main peak of t-texp after fit error | |
82 | ttree->SetBranchAddress("avT0A",&avT0A); //main peak t0A | |
83 | ttree->SetBranchAddress("peakT0A",&peakT0A); // main peak of t0A after fit | |
84 | ttree->SetBranchAddress("spreadT0A",&spreadT0A); //spread of main peak of t0A after fit | |
85 | ttree->SetBranchAddress("peakT0AErr",&peakT0AErr); // main peak of t0A after fit | |
86 | ttree->SetBranchAddress("spreadT0AErr",&spreadT0AErr); //spread of main peak of t0A after fit | |
87 | ttree->SetBranchAddress("avT0C",&avT0C); //main peak t0C | |
88 | ttree->SetBranchAddress("peakT0C",&peakT0C); // main peak of t0C after fit | |
89 | ttree->SetBranchAddress("spreadT0C",&spreadT0C); //spread of main peak of t0C after fit | |
90 | ttree->SetBranchAddress("peakT0CErr",&peakT0CErr); // main peak of t0C after fit | |
91 | ttree->SetBranchAddress("spreadT0CErr",&spreadT0CErr); //spread of main peak of t0C after fit | |
92 | ttree->SetBranchAddress("avT0AC",&avT0AC); //main peak t0AC | |
93 | ttree->SetBranchAddress("peakT0AC",&peakT0AC); // main peak of t0AC after fit | |
94 | ttree->SetBranchAddress("spreadT0AC",&spreadT0AC); //spread of main peak of t0AC after fit | |
95 | ttree->SetBranchAddress("peakT0ACErr",&peakT0ACErr); // main peak of t0AC after fit | |
96 | ttree->SetBranchAddress("spreadT0ACErr",&spreadT0ACErr); //spread of main peak of t0AC after fit | |
97 | ttree->SetBranchAddress("avT0res",&avT0res); //main peak t0AC | |
98 | ttree->SetBranchAddress("peakT0res",&peakT0res); // main peak of t0AC after fit | |
99 | ttree->SetBranchAddress("spreadT0res",&spreadT0res); //spread of main peak of t0AC after fit | |
100 | ttree->SetBranchAddress("peakT0resErr",&peakT0resErr); // main peak of t0AC after fit | |
101 | ttree->SetBranchAddress("spreadT0resErr",&spreadT0resErr); //spread of main peak of t0AC after fit | |
102 | ttree->SetBranchAddress("avT0fillRes",&avT0fillRes); //t0 fill res | |
103 | ||
104 | Int_t nRuns=ttree->GetEntries(); | |
105 | TList lista; | |
106 | ||
107 | TH1F * hAvMulti=new TH1F("hAvMulti","Average multiplicity of matched tracks <N_{TOF}>;; <N_{TOF}>", nRuns,0., nRuns);//, 600, 0. , 600.); | |
108 | hAvMulti->SetDrawOption("E1"); | |
109 | hAvMulti->SetMarkerStyle(20); | |
110 | hAvMulti->SetMarkerColor(kBlue); | |
111 | ||
112 | TH1F * hAvDiffTimeVsRun=new TH1F("hAvDiffTimeVsRun","Mean t-t_{exp} (no fit);run;<t^{TOF}-t_{exp,#pi}> (ps)",nRuns,0., nRuns);//, 600, 0. , 600.); | |
113 | hAvDiffTimeVsRun->SetDrawOption("E1"); | |
114 | hAvDiffTimeVsRun->SetMarkerStyle(20); | |
115 | hAvDiffTimeVsRun->SetMarkerColor(kBlue); | |
116 | // hAvTimeVsRun->GetYaxis()->SetRangeUser(0.0, 50.0); | |
117 | ||
118 | TH1F * hPeakDiffTimeVsRun=new TH1F("hPeakDiffTimeVsRun","t-t_{exp} (gaussian fit) ;; <t^{TOF}-t_{exp,#pi}> (ps)",nRuns,0., nRuns);//,600, 0. , 600. ); | |
119 | hPeakDiffTimeVsRun->SetDrawOption("E1"); | |
120 | hPeakDiffTimeVsRun->SetMarkerStyle(20); | |
121 | hPeakDiffTimeVsRun->SetMarkerColor(kBlue); | |
122 | ||
123 | TH1F * hSpreadDiffTimeVsRun=new TH1F("hSpreadDiffTimeVsRun","#sigma(t-t_{exp}) (gaussian fit);; #sigma(t^{TOF}-t_{exp,#pi}) (ns)",nRuns,0., nRuns);//, 100, 0. , 100.); | |
124 | hSpreadDiffTimeVsRun->SetDrawOption("E1"); | |
125 | hSpreadDiffTimeVsRun->SetMarkerStyle(20); | |
126 | hSpreadDiffTimeVsRun->SetMarkerColor(kBlue); | |
127 | ||
128 | TH1F * hAvTimeVsRun=new TH1F("hAvTimeVsRun","<t^{TOF}>;;<t^{TOF}> (ns)",nRuns,0., nRuns);//, 600, 0. , 600.); | |
129 | hAvTimeVsRun->SetDrawOption("E1"); | |
130 | hAvTimeVsRun->SetMarkerStyle(20); | |
131 | hAvTimeVsRun->SetMarkerColor(kBlue); | |
132 | // hAvTimeVsRun->GetYaxis()->SetRangeUser(0.0, 50.0); | |
133 | ||
134 | TH1F * hPeakTimeVsRun=new TH1F("hPeakTimeVsRun","Peak value of t^{TOF} (landau fit);;t_{peak}^{TOF} (ns)",nRuns,0., nRuns);//,600, 0. , 600. ); | |
135 | hPeakTimeVsRun->SetDrawOption("E1"); | |
136 | hPeakTimeVsRun->SetMarkerStyle(20); | |
137 | hPeakTimeVsRun->SetMarkerColor(kBlue); | |
138 | ||
139 | TH1F * hSpreadTimeVsRun=new TH1F("hSpreadTimeVsRun","Spread of t^{TOF} (landau fit);; #sigma(t^{TOF}) (ns)",nRuns,0., nRuns);//, 100, 0. , 100.); | |
140 | hSpreadTimeVsRun->SetDrawOption("E1"); | |
141 | hSpreadTimeVsRun->SetMarkerStyle(20); | |
142 | hSpreadTimeVsRun->SetMarkerColor(kBlue); | |
143 | ||
144 | TH1F * hAvRawTimeVsRun=new TH1F("hAvRawTimeVsRun","Peak value of raw t^{TOF};;<t_{raw}^{TOF}> (ns)",nRuns,0., nRuns);//, 600, 0. , 600.); | |
145 | hAvRawTimeVsRun->SetDrawOption("E1"); | |
146 | hAvRawTimeVsRun->SetMarkerStyle(21); | |
147 | hAvRawTimeVsRun->SetMarkerColor(kGreen); | |
148 | ||
149 | TH1F * hPeakRawTimeVsRun=new TH1F("hPeakRawTimeVsRun","Peak value of raw t^{TOF} (landau fit);;t_{peak,raw}^{TOF} (ns)",nRuns,0., nRuns);//, 600, 0. , 600.); | |
150 | hPeakRawTimeVsRun->SetDrawOption("E1"); | |
151 | hPeakRawTimeVsRun->SetMarkerStyle(21); | |
152 | hPeakRawTimeVsRun->SetMarkerColor(kGreen); | |
153 | ||
154 | TH1F * hSpreadRawTimeVsRun=new TH1F("hSpreadRawTimeVsRun","Spread of raw t^{TOF} (landau fit);;#sigma(t_{raw}^{TOF}) (ns)",nRuns,0., nRuns);//, 100, 0. , 100.); | |
155 | hSpreadRawTimeVsRun->SetDrawOption("E1"); | |
156 | hSpreadRawTimeVsRun->SetMarkerStyle(21); | |
157 | hSpreadRawTimeVsRun->SetMarkerColor(kGreen); | |
158 | ||
159 | TH1F * hAvTotVsRun=new TH1F("hAvTotVsRun","<ToT> (no fit);run;<ToT> (ns)",nRuns,0., nRuns);//, 50, 0. , 50.); | |
160 | hAvTotVsRun->SetDrawOption("E1"); | |
161 | hAvTotVsRun->SetMarkerStyle(22); | |
162 | ||
163 | TH1F * hPeakTotVsRun=new TH1F("hPeakTotVsRun","<ToT> (gaussian fit);;ToT_{peak} (ns)",nRuns,0., nRuns);//, 50, 0. , 50.); | |
164 | hPeakTotVsRun->SetDrawOption("E1"); | |
165 | hPeakTotVsRun->SetMarkerStyle(22); | |
166 | ||
167 | TH1F * hSpreadTotVsRun=new TH1F("hSpreadTotVsRun","#sigma(ToT) (gaussian fit);#sigma(ToT) (ns)",nRuns,0., nRuns);//, 50, 0. , 50.); | |
168 | hSpreadTotVsRun->SetDrawOption("E1"); | |
169 | hSpreadTotVsRun->SetMarkerStyle(22); | |
170 | ||
171 | TH1F * hNegTimeRatioVsRun=new TH1F("hNegTimeRatioVsRun","Ratio of tracks with t^{TOF}<12.5 ns; ; ratio of tracks with t^{TOF}<12.5 ns (%)",nRuns, 0., nRuns);//, 100, 0. , 100.); | |
172 | hNegTimeRatioVsRun->SetDrawOption("E"); | |
173 | ||
174 | TH1F * hOrphansRatioVsRun=new TH1F("hOrphansRatioVsRun","Ratio of orphans (hits with ToT=0); ; ratio of orphans (%)",nRuns, 0., nRuns);//, 1000, 0. , 100.); | |
175 | hOrphansRatioVsRun->SetDrawOption("E"); | |
176 | ||
177 | TH1F * hMeanLVsRun=new TH1F("hMeanLVsRun","Average track length;; <L> (cm)",nRuns, 0., nRuns);//, 350, 350. , 700.); | |
178 | hMeanLVsRun->SetDrawOption("E"); | |
179 | TH1F * hNegLRatioVsRun=new TH1F("hNegLRatioVsRun","Ratio of tracks with L<350 cm;; ratio of tracks with L<350 cm (%)",nRuns, 0., nRuns);//, 1000, 0. , 100.); | |
180 | hNegLRatioVsRun->SetDrawOption("E"); | |
65ae12f9 | 181 | TH1F * hMatchEffVsRun=new TH1F("hMatchEffVsRun","#epsilon_{match} (linear fit for p_{T}>1.0 GeV/c);;#epsilon_{match} (p_{T}>1.0 GeV/c)",nRuns, 0., nRuns);//, 100, 0. , 1.); |
7fecd941 | 182 | hMatchEffVsRun->SetDrawOption("E"); |
65ae12f9 | 183 | TH1F * hMatchEffVsRunNormToGoodCh=new TH1F("hMatchEffVsRunNormToGoodCh","#epsilon_{match} normalized to percentage of TOF good channels;;#epsilon_{match}(p_{T}>1.0 GeV/c,|#eta|<0.8)/f_{all good}",nRuns, 0., nRuns);//, 100, 0. , 1.); |
7fecd941 | 184 | hMatchEffVsRunNormToGoodCh->SetDrawOption("E"); |
185 | ||
65ae12f9 | 186 | TH1F * hMatchEffVsRunNormToGoodChInAcc=new TH1F("hMatchEffVsRunNormToGoodChInAcc","#epsilon_{match} normalized to TOF good channels in |#eta|<0.8;;#epsilon_{match}(p_{T}>1.0 GeV/c,|#eta|<0.8/f_{good}(|#eta|<0.8)",nRuns, 0., nRuns);//, 100, 0. , 1.); |
187 | hMatchEffVsRunNormToGoodChInAcc->SetDrawOption("E"); | |
188 | ||
189 | TH1F * hMatchEffVsRun1=new TH1F("hMatchEffVsRun1","#epsilon_{match}(p_{T}=1.0 GeV/c);;#epsilon_{match} (p_{T}=1.0 GeV/c)",nRuns, 0., nRuns); | |
7fecd941 | 190 | hMatchEffVsRun1->SetDrawOption("E"); |
191 | TH1F * hPeakT0AVsRun=new TH1F("hPeakT0AVsRun","Peak value of T0A (gaussian fit);;t0A (ps)",nRuns,0., nRuns); | |
192 | TH1F * hPeakT0CVsRun=new TH1F("hPeakT0CVsRun","Peak value of T0C (gaussian fit);;t0AC (ps)",nRuns,0., nRuns); | |
193 | TH1F * hPeakT0ACVsRun=new TH1F("hPeakT0ACVsRun","Peak value of T0AC (gaussian fit);;t0AC (ps)",nRuns,0., nRuns); | |
194 | TH1F * hT0fillResVsRun=new TH1F("hT0fillResVsRun","t0_fill spread;;t0_spread (ps)",nRuns,0., nRuns); | |
195 | ||
8838f3e0 | 196 | TH1F * hGoodChannelsRatio=new TH1F("hGoodChannelsRatio","Fraction of TOF good channels;;fraction of good channels",nRuns, 0., nRuns);//, 100, 0. , 1.); |
197 | hGoodChannelsRatio->SetDrawOption("E"); | |
65ae12f9 | 198 | |
199 | TH1F * hGoodChannelsRatioInAcc=new TH1F("hGoodChannelsRatioInAcc","Fraction of TOF good channels in |#eta|<0.8;;fraction of good channels in |#eta|<0.8",nRuns, 0., nRuns);//, 100, 0. , 1.); | |
200 | hGoodChannelsRatioInAcc->SetDrawOption("E"); | |
7fecd941 | 201 | |
202 | lista.Add(hAvMulti); | |
203 | lista.Add(hAvDiffTimeVsRun); | |
204 | lista.Add(hPeakDiffTimeVsRun); | |
205 | lista.Add(hSpreadDiffTimeVsRun); | |
206 | lista.Add(hAvTimeVsRun); | |
207 | lista.Add(hPeakTimeVsRun); | |
208 | lista.Add(hSpreadTimeVsRun); | |
209 | lista.Add( hAvRawTimeVsRun); | |
210 | lista.Add( hPeakRawTimeVsRun); | |
211 | lista.Add( hSpreadRawTimeVsRun); | |
212 | lista.Add( hAvTotVsRun); | |
213 | lista.Add( hPeakTotVsRun); | |
214 | lista.Add( hSpreadTotVsRun); | |
215 | lista.Add( hNegTimeRatioVsRun); | |
216 | lista.Add( hOrphansRatioVsRun); | |
217 | lista.Add( hMeanLVsRun); | |
218 | lista.Add( hNegLRatioVsRun); | |
219 | lista.Add( hMatchEffVsRun); | |
220 | lista.Add(hMatchEffVsRunNormToGoodCh); | |
65ae12f9 | 221 | lista.Add(hMatchEffVsRunNormToGoodChInAcc); |
7fecd941 | 222 | lista.Add(hPeakT0AVsRun); |
223 | lista.Add(hPeakT0CVsRun); | |
224 | lista.Add(hPeakT0ACVsRun); | |
225 | lista.Add(hT0fillResVsRun); | |
8838f3e0 | 226 | lista.Add(hGoodChannelsRatio); |
65ae12f9 | 227 | lista.Add(hGoodChannelsRatioInAcc); |
8838f3e0 | 228 | |
7fecd941 | 229 | char runlabel[6]; |
230 | ||
231 | for (Int_t irun=0;irun<nRuns;irun++){ | |
232 | ttree->GetEntry(irun); | |
233 | ||
234 | sprintf(runlabel,"%i",runNumber); | |
235 | ||
236 | hAvMulti->SetBinContent(irun+1, avMulti); | |
237 | hAvMulti->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
238 | ||
239 | hAvDiffTimeVsRun->SetBinContent(irun+1, avDiffTime); | |
240 | hAvDiffTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
241 | ||
242 | hPeakDiffTimeVsRun->SetBinContent(irun+1,peakDiffTime); | |
243 | hPeakDiffTimeVsRun->SetBinError(irun+1,peakDiffTimeErr); | |
244 | hPeakDiffTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
245 | ||
246 | hSpreadDiffTimeVsRun->SetBinContent(irun+1,spreadDiffTime); | |
247 | hSpreadDiffTimeVsRun->SetBinError(irun+1,spreadDiffTimeErr); | |
248 | hSpreadDiffTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
249 | ||
250 | hAvTimeVsRun->SetBinContent(irun+1, avTime); | |
251 | hAvTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
252 | ||
253 | hPeakTimeVsRun->SetBinContent(irun+1,peakTime); | |
254 | hPeakTimeVsRun->SetBinError(irun+1,peakTimeErr); | |
255 | hPeakTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
256 | ||
257 | hSpreadTimeVsRun->SetBinContent(irun+1,spreadTime); | |
258 | hSpreadTimeVsRun->SetBinError(irun+1,spreadTimeErr); | |
259 | hSpreadTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
260 | ||
261 | hAvRawTimeVsRun->SetBinContent(irun+1, avRawTime); | |
262 | hAvRawTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
263 | ||
264 | hPeakRawTimeVsRun->SetBinContent(irun+1,peakRawTime); | |
265 | hPeakRawTimeVsRun->SetBinError(irun+1,peakRawTimeErr); | |
266 | hPeakRawTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
267 | ||
268 | hSpreadRawTimeVsRun->SetBinContent(irun+1,spreadRawTime); | |
269 | hSpreadRawTimeVsRun->SetBinError(irun+1,spreadRawTimeErr); | |
270 | hSpreadRawTimeVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
271 | ||
272 | hAvTotVsRun->SetBinContent(irun+1,avTot); | |
273 | hAvTotVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
274 | ||
275 | hPeakTotVsRun->SetBinContent(irun+1,peakTot); | |
276 | hPeakTotVsRun->SetBinError(irun+1,peakTotErr); | |
277 | hPeakTotVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
278 | ||
279 | hSpreadTotVsRun->SetBinContent(irun+1,spreadTot); | |
280 | hSpreadTotVsRun->SetBinError(irun+1,spreadTotErr); | |
281 | hSpreadTotVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
282 | ||
283 | hNegTimeRatioVsRun->SetBinContent(irun+1,negTimeRatio); | |
284 | hNegTimeRatioVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
285 | ||
286 | hOrphansRatioVsRun->SetBinContent(irun+1,orphansRatio); | |
287 | hOrphansRatioVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
288 | ||
289 | hMeanLVsRun->SetBinContent(irun+1,avL); | |
290 | hMeanLVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
291 | ||
292 | hNegLRatioVsRun->SetBinContent(irun+1,negLratio); | |
293 | hNegLRatioVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
294 | ||
295 | hMatchEffVsRun->SetBinContent(irun+1,matchEffLinFit1Gev); | |
296 | hMatchEffVsRun->SetBinError(irun+1,matchEffLinFit1GevErr); | |
297 | hMatchEffVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
298 | hMatchEffVsRun->SetLineColor(kRed); | |
299 | hMatchEffVsRun->SetLineWidth(2); | |
300 | ||
301 | if (goodChannelRatio>0) | |
302 | hMatchEffVsRunNormToGoodCh->SetBinContent(irun+1,matchEffLinFit1Gev/goodChannelRatio); | |
303 | else | |
304 | hMatchEffVsRunNormToGoodCh->SetBinContent(irun+1, 0.0); | |
305 | hMatchEffVsRunNormToGoodCh->SetBinError(irun+1,matchEffLinFit1GevErr); | |
306 | hMatchEffVsRunNormToGoodCh->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
65ae12f9 | 307 | hMatchEffVsRunNormToGoodCh->SetLineColor(kCyan+2); |
7fecd941 | 308 | hMatchEffVsRunNormToGoodCh->SetLineWidth(2); |
309 | ||
8838f3e0 | 310 | hGoodChannelsRatio->SetBinContent(irun+1, goodChannelRatio); |
65ae12f9 | 311 | hGoodChannelsRatio->SetLineColor(kCyan-1); |
8838f3e0 | 312 | hGoodChannelsRatio->SetLineWidth(2); |
313 | hGoodChannelsRatio->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
314 | ||
65ae12f9 | 315 | if (goodChannelRatioInAcc>0) |
316 | hMatchEffVsRunNormToGoodChInAcc->SetBinContent(irun+1,matchEffLinFit1Gev/goodChannelRatioInAcc); | |
317 | else | |
318 | hMatchEffVsRunNormToGoodChInAcc->SetBinContent(irun+1, 0.0); | |
319 | hMatchEffVsRunNormToGoodChInAcc->SetBinError(irun+1,matchEffLinFit1GevErr); | |
320 | hMatchEffVsRunNormToGoodChInAcc->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
321 | hMatchEffVsRunNormToGoodChInAcc->SetLineColor(kBlue); | |
322 | hMatchEffVsRunNormToGoodChInAcc->SetLineWidth(2); | |
323 | ||
324 | hGoodChannelsRatioInAcc->SetBinContent(irun+1, goodChannelRatioInAcc); | |
325 | hGoodChannelsRatioInAcc->SetLineColor(kBlue+2); | |
326 | hGoodChannelsRatioInAcc->SetLineWidth(2); | |
327 | hGoodChannelsRatioInAcc->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
328 | ||
7fecd941 | 329 | hPeakT0AVsRun->SetBinContent(irun+1,peakT0A); |
330 | hPeakT0AVsRun->SetBinError(irun+1,spreadT0A); | |
331 | hPeakT0AVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
332 | ||
333 | hPeakT0CVsRun->SetBinContent(irun+1,peakT0C); | |
334 | hPeakT0CVsRun->SetBinError(irun+1,spreadT0C); | |
335 | hPeakT0CVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
336 | ||
337 | hPeakT0ACVsRun->SetBinContent(irun+1,peakT0AC); | |
338 | hPeakT0ACVsRun->SetBinError(irun+1,spreadT0AC); | |
339 | hPeakT0ACVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
340 | ||
341 | hT0fillResVsRun->SetBinContent(irun+1,avT0fillRes); | |
342 | hT0fillResVsRun->GetXaxis()->SetBinLabel(irun+1,runlabel); | |
343 | } | |
344 | ||
345 | TFile * fout=new TFile(outfilename,"recreate"); | |
346 | fout->cd(); | |
347 | lista.Write(); | |
348 | fout->Close(); | |
349 | ||
8838f3e0 | 350 | gStyle->SetOptStat(10); |
351 | ||
352 | TCanvas* cPeakDiffTimeVsRun = new TCanvas("cPeakDiffTimeVsRun","cPeakDiffTimeVsRun", 50,50,1050, 550); | |
7fecd941 | 353 | hPeakDiffTimeVsRun->GetYaxis()->SetRangeUser(-50.,50.); |
354 | hPeakDiffTimeVsRun->Draw(); | |
355 | cPeakDiffTimeVsRun->Print(Form("%s/cPeakDiffTimeVsRun.png",plotDir.Data())); | |
356 | ||
8838f3e0 | 357 | TCanvas* cSpreadDiffTimeVsRun = new TCanvas("cSpreadDiffTimeVsRun","cSpreadDiffTimeVsRun", 50,50,1050, 550); |
7fecd941 | 358 | hSpreadDiffTimeVsRun->GetYaxis()->SetRangeUser(200.,400.); |
359 | hSpreadDiffTimeVsRun->Draw(); | |
360 | cSpreadDiffTimeVsRun->Print(Form("%s/cSpreadDiffTimeVsRun.png",plotDir.Data())); | |
361 | ||
8838f3e0 | 362 | TCanvas* cMatchEffVsRun = new TCanvas("cMatchEffVsRun","cMatchEffVsRun",50, 50, 1050, 550); |
7fecd941 | 363 | hMatchEffVsRun->GetYaxis()->SetRangeUser(0.,1.); |
364 | hMatchEffVsRun->Draw(); | |
365 | cMatchEffVsRun->Print(Form("%s/cMatchEffVsRun.png",plotDir.Data())); | |
65ae12f9 | 366 | |
367 | TCanvas* cMatchEffNormToGoodChInAcc = new TCanvas("cMatchEffNormToGoodChInAcc","cMatchEffNormToGoodChInAcc",50, 50,1050, 550); | |
368 | hMatchEffVsRunNormToGoodChInAcc->GetYaxis()->SetRangeUser(0.,1.); | |
369 | hMatchEffVsRunNormToGoodChInAcc->Draw(); | |
370 | cMatchEffNormToGoodChInAcc->Print(Form("%s/cMatchEffNormToGoodChInAcc.png",plotDir.Data())); | |
371 | ||
8838f3e0 | 372 | TCanvas* cMatchEffNormToGoodCh = new TCanvas("cMatchEffNormToGoodCh","cMatchEffNormToGoodCh",50, 50,1050, 550); |
7fecd941 | 373 | hMatchEffVsRunNormToGoodCh->GetYaxis()->SetRangeUser(0.,1.); |
374 | hMatchEffVsRunNormToGoodCh->Draw(); | |
375 | cMatchEffNormToGoodCh->Print(Form("%s/cMatchEffNormToGoodCh.png",plotDir.Data())); | |
8838f3e0 | 376 | |
377 | TCanvas* cGoodCh = new TCanvas("cGoodCh","cGoodCh",50, 50,1050, 550); | |
378 | hGoodChannelsRatio->GetYaxis()->SetRangeUser(0.75,1.); | |
379 | hGoodChannelsRatio->Draw(); | |
380 | cGoodCh->Print(Form("%s/cGoodCh.png",plotDir.Data())); | |
381 | ||
65ae12f9 | 382 | TCanvas* cGoodChInAcc = new TCanvas("cGoodChInAcc","cGoodChInAcc",50, 50,1050, 550); |
383 | hGoodChannelsRatioInAcc->GetYaxis()->SetRangeUser(0.75,1.); | |
384 | hGoodChannelsRatioInAcc->Draw(); | |
385 | cGoodChInAcc->Print(Form("%s/cGoodChInAcc.png",plotDir.Data())); | |
386 | ||
8838f3e0 | 387 | if (displayAll) { |
388 | TCanvas* cPeakT0AVsRun = new TCanvas("cPeakT0AVsRun","cPeakT0AVsRun", 50,50,1050, 550); | |
389 | hPeakT0AVsRun->Draw(); | |
390 | cPeakT0AVsRun->Print(Form("%s/cPeakT0AVsRun.png",plotDir.Data())); | |
7fecd941 | 391 | |
8838f3e0 | 392 | TCanvas* cPeakT0CVsRun = new TCanvas("cPeakT0CVsRun","cPeakT0CVsRun", 50,50,1050, 550); |
393 | hPeakT0CVsRun->Draw(); | |
394 | cPeakT0CVsRun->Print(Form("%s/cPeakT0CVsRun.png",plotDir.Data())); | |
7fecd941 | 395 | |
8838f3e0 | 396 | TCanvas* cPeakT0ACVsRun = new TCanvas("cPeakT0ACVsRun","cPeakT0ACVsRun", 50,50,1050, 550); |
397 | hPeakT0ACVsRun->Draw(); | |
398 | cPeakT0ACVsRun->Print(Form("%s/cPeakT0ACVsRun.png",plotDir.Data())); | |
7fecd941 | 399 | |
8838f3e0 | 400 | TCanvas* cT0fillResVsRun = new TCanvas("cT0fillResVsRun","cT0fillResVsRun", 50,50,1050, 550); |
401 | hT0fillResVsRun->Draw(); | |
402 | cT0fillResVsRun->Print(Form("%s/cT0fillResVsRun.png",plotDir.Data())); | |
7fecd941 | 403 | |
8838f3e0 | 404 | TCanvas* cAvDiffTimeVsRun = new TCanvas("cAvDiffTimeVsRun","cAvDiffTimeVsRun",50,50,1050, 550); |
7fecd941 | 405 | gPad->SetGridx(); |
406 | gPad->SetGridy(); | |
407 | hAvDiffTimeVsRun->Draw(); | |
408 | cAvDiffTimeVsRun->Print(Form("%s/cAvDiffTimeVsRun.png",plotDir.Data())); | |
409 | ||
8838f3e0 | 410 | TCanvas* cAvTimeVsRun = new TCanvas("cAvTimeVsRun","cAvTimeVsRun", 50,50,1050, 550); |
7fecd941 | 411 | hAvTimeVsRun->Draw(); |
412 | cAvTimeVsRun->Print(Form("%s/cAvTimeVsRun.png",plotDir.Data())); | |
413 | ||
8838f3e0 | 414 | TCanvas* cPeakTimeVsRun = new TCanvas("cPeakTimeVsRun","cPeakTimeVsRun", 50,50,1050, 550); |
7fecd941 | 415 | hPeakTimeVsRun->Draw(); |
416 | cPeakTimeVsRun->Print(Form("%s/cPeakTimeVsRun.png",plotDir.Data())); | |
417 | ||
8838f3e0 | 418 | TCanvas* cSpreadTimeVsRun = new TCanvas("cSpreadTimeVsRun","cSpreadTimeVsRun", 50,50,1050, 550); |
7fecd941 | 419 | hSpreadTimeVsRun->Draw(); |
420 | cSpreadTimeVsRun->Print(Form("%s/cSpreadTimeVsRun.png",plotDir.Data())); | |
421 | ||
8838f3e0 | 422 | TCanvas* cAvRawTimeVsRun = new TCanvas("cAvRawTimeVsRun","cAvRawTimeVsRun", 50,50,1050, 550); |
7fecd941 | 423 | hAvRawTimeVsRun->Draw(); |
424 | cAvRawTimeVsRun->Print(Form("%s/cAvRawTimeVsRun.png",plotDir.Data())); | |
425 | ||
8838f3e0 | 426 | TCanvas* cPeakRawTimeVsRun = new TCanvas("cPeakRawTimeVsRun","cPeakRawTimeVsRun", 50,50,1050, 550); |
7fecd941 | 427 | hPeakRawTimeVsRun->Draw(); |
428 | cPeakRawTimeVsRun->Print(Form("%s/cPeakRawTimeVsRun.png",plotDir.Data())); | |
429 | ||
8838f3e0 | 430 | TCanvas* cSpreadRawTimeVsRun = new TCanvas("cSpreadRawTimeVsRun","cSpreadRawTimeVsRun", 50,50,1050, 550); |
7fecd941 | 431 | hSpreadRawTimeVsRun->Draw(); |
432 | cSpreadRawTimeVsRun->Print(Form("%s/cSpreadRawTimeVsRun.png",plotDir.Data())); | |
433 | ||
8838f3e0 | 434 | TCanvas* cAvTotVsRun = new TCanvas("cAvTotVsRun","cAvTotVsRun", 50,50,1050, 550); |
7fecd941 | 435 | hAvTotVsRun->Draw(); |
436 | cAvTotVsRun->Print(Form("%s/cAvTotVsRun.png",plotDir.Data())); | |
437 | ||
8838f3e0 | 438 | TCanvas* cPeakTotVsRun = new TCanvas("cPeakTotVsRun","cPeakTotVsRun", 50,50,1050, 550); |
7fecd941 | 439 | hPeakTotVsRun->Draw(); |
440 | cPeakTotVsRun->Print(Form("%s/cPeakTotVsRun.png",plotDir.Data())); | |
441 | ||
8838f3e0 | 442 | TCanvas* cSpreadTotVsRun = new TCanvas("cSpreadTotVsRun","cSpreadTotVsRun", 50,50,1050, 550); |
7fecd941 | 443 | hSpreadTotVsRun->Draw(); |
444 | cSpreadTotVsRun->Print(Form("%s/cSpreadTotVsRun.png",plotDir.Data())); | |
445 | ||
8838f3e0 | 446 | TCanvas* cNegTimeRatioVsRun = new TCanvas("cNegTimeRatioVsRun","cNegTimeRatioVsRun", 50,50,1050, 550); |
7fecd941 | 447 | hNegTimeRatioVsRun->Draw(); |
448 | cNegTimeRatioVsRun->Print(Form("%s/cNegTimeRatioVsRun.png",plotDir.Data())); | |
449 | ||
8838f3e0 | 450 | TCanvas* cOrphansRatioVsRun = new TCanvas("cOrphansRatioVsRun","cOrphansRatioVsRun", 50,50,1050, 550); |
7fecd941 | 451 | hOrphansRatioVsRun->Draw(); |
452 | cOrphansRatioVsRun->Print(Form("%s/cOrphansRatioVsRun.png",plotDir.Data())); | |
453 | ||
8838f3e0 | 454 | TCanvas* cMeanLVsRun = new TCanvas("cMeanLVsRun","cMeanLVsRun", 50,50,1050, 550); |
7fecd941 | 455 | hMeanLVsRun->Draw(); |
456 | cMeanLVsRun->Print(Form("%s/cMeanLVsRun.png",plotDir.Data())); | |
457 | ||
8838f3e0 | 458 | TCanvas* cNegLRatioVsRun = new TCanvas("cNegLRatioVsRun","cNegLRatioVsRun", 50,50,1050, 550); |
7fecd941 | 459 | hNegLRatioVsRun->Draw(); |
460 | cNegLRatioVsRun->Print(Form("%s/cNegLRatioVsRun.png",plotDir.Data())); | |
461 | } | |
462 | ||
463 | return 0; | |
464 | } |