]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/ITS/AliITSQAtrend.C
Bug fix
[u/mrichter/AliRoot.git] / PWG1 / ITS / AliITSQAtrend.C
CommitLineData
bde144f1 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <TH1F.h>
3#include <TH2F.h>
4#include <TF1.h>
5#include <TPad.h>
6#include <TGraphErrors.h>
7#include <TROOT.h>
8#include <TFile.h>
9#include <TTree.h>
10#include <TGrid.h>
11#include <TGridResult.h>
12#include <TMath.h>
13#include <TSystem.h>
14#include <TNtuple.h>
15#include <TCanvas.h>
16#include <TStyle.h>
17#include <TLatex.h>
18#include <TLegend.h>
19#include <TLegendEntry.h>
20#include <Riostream.h>
21#include "AliITSgeomTGeo.h"
22#endif
23
24TString pdfFileNames="";
25void MakePlot(TString ntupleFileName="TrendingITS.root");
26void PlotITSSA(TFile *fil,Int_t *myIndex);
27void FillITSSAntuple(TFile* f,TNtuple* nt, Int_t nrun);
28void AliITSQAtrend(TString runListFile="LHC11hNo.txt",TString ntupleFileName="TrendingITS.root");
29
30////////////////////////////////////////////////////////////////
31// Please, read this comment before using this macro
32//
33// INPUT FILE: a text file (by default LHC11hNo.txt) which contains
34// a list of the complete path+file name of the QAresults root files
35// (without the alien:// prefix).
36// One file per line. The order is irrelevant.
37//
38// USAGE:
39//
40// Function AliITSQAtrend():
41// it looks for a local root file named TrendingITS.root,
42// where the ntuples used to build the trending plots are
43// stored. This file is used to generate incrementally the ntuple contents:
44// when you add a new entry in the LHC11hNo.txt file and you have a
45// local copy of the TrendingITS.root file, only the additional run will
46// be processed. The whole list is processed only the first time you use the
47// macro. Please, bear in mind that this macro is RAM-intensive: all the
48// ntuples are kept in memory. It is better to add few runs to the list at
49// each time, according to the RAM of your computer.
50// The function AliITSQAtrend does not produce any plot.
51//
52// Function MakePlot():
53// it produces the plots. For each canvas a PDF file is created.
54// A PDF file with all the canvases merged is also produced
55////////////////////////////////////////////////////////////////
56
57/* $Id$ */
58
59void MakePlot(TString ntupleFileName){
60 //TrendingITS.root
61 TFile* fil=new TFile(ntupleFileName.Data(),"read");
62 if(!fil){
63 printf("File with ntuple does not exist\n");
64 return;
65 }
66 TNtuple* ntsdd=(TNtuple*)fil->Get("ntsdd");
67
68 Float_t nrun;
69 Float_t meanTrPts3,errmeanTrPts3,meanTrPts4,errmeanTrPts4;
70 Float_t minDrTime,errminDrTime,meanDrTime,errmeanDrTime;
71 Float_t fracTrackWithClu1,fracTrackWithClu2,errfracTrackWithClu1,errfracTrackWithClu2;
72 Float_t fracTrackWithClu3,fracTrackWithClu4,errfracTrackWithClu3,errfracTrackWithClu4;
73 Float_t fracTrackWithClu5,fracTrackWithClu6,errfracTrackWithClu5,errfracTrackWithClu6;
74 Float_t fracExtra,errfracExtra;
75 Float_t meandEdxLay3,errmeandEdxLay3,meandEdxLay4,errmeandEdxLay4;
76 Float_t meandEdxTB0,errmeandEdxTB0,meandEdxTB5,errmeandEdxTB5;
77 Float_t nMod95,nMod80,nMod60,nModEmpty;
78
79 ntsdd->SetBranchAddress("nrun",&nrun);
80 ntsdd->SetBranchAddress("fracTrackWithClu1",&fracTrackWithClu1);
81 ntsdd->SetBranchAddress("errfracTrackWithClu1",&errfracTrackWithClu1);
82 ntsdd->SetBranchAddress("fracTrackWithClu2",&fracTrackWithClu2);
83 ntsdd->SetBranchAddress("errfracTrackWithClu2",&errfracTrackWithClu2);
84 ntsdd->SetBranchAddress("fracTrackWithClu3",&fracTrackWithClu3);
85 ntsdd->SetBranchAddress("errfracTrackWithClu3",&errfracTrackWithClu3);
86 ntsdd->SetBranchAddress("fracTrackWithClu4",&fracTrackWithClu4);
87 ntsdd->SetBranchAddress("errfracTrackWithClu4",&errfracTrackWithClu4);
88 ntsdd->SetBranchAddress("fracTrackWithClu5",&fracTrackWithClu5);
89 ntsdd->SetBranchAddress("errfracTrackWithClu5",&errfracTrackWithClu5);
90 ntsdd->SetBranchAddress("fracTrackWithClu6",&fracTrackWithClu6);
91 ntsdd->SetBranchAddress("errfracTrackWithClu6",&errfracTrackWithClu6);
92 ntsdd->SetBranchAddress("nMod95",&nMod95);
93 ntsdd->SetBranchAddress("nMod80",&nMod80);
94 ntsdd->SetBranchAddress("nMod60",&nMod60);
95 ntsdd->SetBranchAddress("nModEmpty",&nModEmpty);
96
97 ntsdd->SetBranchAddress("meanTrPts3",&meanTrPts3);
98 ntsdd->SetBranchAddress("errmeanTrPts3",&errmeanTrPts3);
99 ntsdd->SetBranchAddress("meanTrPts4",&meanTrPts4);
100 ntsdd->SetBranchAddress("errmeanTrPts4",&errmeanTrPts4);
101 ntsdd->SetBranchAddress("minDrTime",&minDrTime);
102 ntsdd->SetBranchAddress("errminDrTime",&errminDrTime);
103 ntsdd->SetBranchAddress("meanDrTime",&meanDrTime);
104 ntsdd->SetBranchAddress("errmeanDrTime",&errmeanDrTime);
105 ntsdd->SetBranchAddress("fracExtra",&fracExtra);
106 ntsdd->SetBranchAddress("errfracExtra",&errfracExtra);
107 ntsdd->SetBranchAddress("meandEdxTB0",&meandEdxTB0);
108 ntsdd->SetBranchAddress("errmeandEdxTB0",&errmeandEdxTB0);
109 ntsdd->SetBranchAddress("meandEdxTB5",&meandEdxTB5);
110 ntsdd->SetBranchAddress("errmeandEdxTB5",&errmeandEdxTB5);
111 ntsdd->SetBranchAddress("meandEdxLay3",&meandEdxLay3);
112 ntsdd->SetBranchAddress("errmeandEdxLay3",&errmeandEdxLay3);
113 ntsdd->SetBranchAddress("meandEdxLay4",&meandEdxLay4);
114 ntsdd->SetBranchAddress("errmeandEdxLay4",&errmeandEdxLay4);
115
116 TH1F* histotrp3=new TH1F("histotrp3","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
117 TH1F* histotrp4=new TH1F("histotrp4","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
118 TH1F* histominTime=new TH1F("histominTime","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
119 TH1F* histomeanTime=new TH1F("histomeanTime","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
120 TH1F* histofracExtra=new TH1F("histofracExtra","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
121 TH1F* histodEdxTB0=new TH1F("histodEdxTB0","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
122 TH1F* histodEdxTB5=new TH1F("histodEdxTB5","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
123 TH1F* histodEdxLay3=new TH1F("histodEdxLay3","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
124 TH1F* histodEdxLay4=new TH1F("histodEdxLay4","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
125 TH1F* histoTrackClu1=new TH1F("histoTrackClu1","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
126 TH1F* histoTrackClu2=new TH1F("histoTrackClu2","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
127 TH1F* histoTrackClu3=new TH1F("histoTrackClu3","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
128 TH1F* histoTrackClu4=new TH1F("histoTrackClu4","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
129 TH1F* histoTrackClu5=new TH1F("histoTrackClu5","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
130 TH1F* histoTrackClu6=new TH1F("histoTrackClu6","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
131
132 TH1F* histoNmodEffBelow95=new TH1F("histoNmodEffBelow95","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
133 TH1F* histoNmodEffBelow80=new TH1F("histoNmodEffBelow80","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
134 TH1F* histoNmodEffBelow60=new TH1F("histoNmodEffBelow60","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
135 TH1F* histoNmodEmpty=new TH1F("histoNmodEmpty","",(Int_t)ntsdd->GetEntries(),0.,ntsdd->GetEntries());
136 // Sort entries according to run number
137 // Same order is assumed for all the subsequent ntuples
138 Int_t nr=ntsdd->GetEntries();
139 Int_t *myIndex = new Int_t [nr];
140 Int_t *noRuns = new Int_t [nr];
141 for(Int_t i=0; i<nr;i++){
142 ntsdd->GetEvent(i);
143 noRuns[i]=nrun;
144 }
145 TMath::Sort(nr,noRuns,myIndex,kFALSE);
146 for(Int_t i=0; i<ntsdd->GetEntries();i++){
147 ntsdd->GetEvent(myIndex[i]);
148 histoTrackClu1->SetBinContent(i+1,fracTrackWithClu1);
149 histoTrackClu1->SetBinError(i+1,errfracTrackWithClu1);
150 histoTrackClu1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
151 histoTrackClu2->SetBinContent(i+1,fracTrackWithClu2);
152 histoTrackClu2->SetBinError(i+1,errfracTrackWithClu2);
153 histoTrackClu2->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
154 histoTrackClu3->SetBinContent(i+1,fracTrackWithClu3);
155 histoTrackClu3->SetBinError(i+1,errfracTrackWithClu3);
156 histoTrackClu3->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
157 histoTrackClu4->SetBinContent(i+1,fracTrackWithClu4);
158 histoTrackClu4->SetBinError(i+1,errfracTrackWithClu4);
159 histoTrackClu4->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
160 histoTrackClu5->SetBinContent(i+1,fracTrackWithClu5);
161 histoTrackClu5->SetBinError(i+1,errfracTrackWithClu5);
162 histoTrackClu5->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
163 histoTrackClu6->SetBinContent(i+1,fracTrackWithClu6);
164 histoTrackClu6->SetBinError(i+1,errfracTrackWithClu6);
165 histoTrackClu6->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
166 histominTime->SetBinContent(i+1,minDrTime);
167 histominTime->SetBinError(i+1,errminDrTime);
168 histominTime->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
169 histomeanTime->SetBinContent(i+1,meanDrTime);
170 histomeanTime->SetBinError(i+1,errmeanDrTime);
171 histomeanTime->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
172 histotrp3->SetBinContent(i+1,meanTrPts3);
173 histotrp3->SetBinError(i+1,errmeanTrPts3);
174 histotrp3->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
175 histotrp4->SetBinContent(i+1,meanTrPts4);
176 histotrp4->SetBinError(i+1,errmeanTrPts3);
177 histotrp4->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
178 histofracExtra->SetBinContent(i+1,fracExtra);
179 histofracExtra->SetBinError(i+1,errfracExtra);
180 histofracExtra->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
181 histodEdxTB0->SetBinContent(i+1,meandEdxTB0);
182 histodEdxTB0->SetBinError(i+1,errmeandEdxTB0);
183 histodEdxTB0->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
184 histodEdxTB5->SetBinContent(i+1,meandEdxTB5);
185 histodEdxTB5->SetBinError(i+1,errmeandEdxTB5);
186 histodEdxTB5->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
187 histodEdxLay3->SetBinContent(i+1,meandEdxLay3);
188 histodEdxLay3->SetBinError(i+1,errmeandEdxLay3);
189 histodEdxLay3->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
190 histodEdxLay4->SetBinContent(i+1,meandEdxLay4);
191 histodEdxLay4->SetBinError(i+1,errmeandEdxLay4);
192 histodEdxLay4->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
193
194 histoNmodEffBelow95->SetBinContent(i+1,nMod95);
195 histoNmodEffBelow95->SetBinError(i+1,0.0000001);
196 histoNmodEffBelow95->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
197 histoNmodEffBelow80->SetBinContent(i+1,nMod80);
198 histoNmodEffBelow80->SetBinError(i+1,0.0000001);
199 histoNmodEffBelow80->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
200 histoNmodEffBelow60->SetBinContent(i+1,nMod60);
201 histoNmodEffBelow60->SetBinError(i+1,0.0000001);
202 histoNmodEffBelow60->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
203 histoNmodEmpty->SetBinContent(i+1,nModEmpty);
204 histoNmodEmpty->SetBinError(i+1,0.000001);
205 histoNmodEmpty->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrun));
206 }
207
208
209 //---SSD
210
211 TNtuple* ntssd=(TNtuple*)fil->Get("ntssd");
212
213 Float_t nrunSSD, meandEdxLay5,errmeandEdxLay5,meandEdxLay6,errmeandEdxLay6;
214 Float_t ChargeRatioL5,errChargeratioL5,ChargeRatioL6, errChargeratioL6, moduleOff;
215
216 ntssd->SetBranchAddress("nrun",&nrunSSD);
217 ntssd->SetBranchAddress("meandEdxLay5",&meandEdxLay5);
218 ntssd->SetBranchAddress("errmeandEdxLay5",&errmeandEdxLay5);
219 ntssd->SetBranchAddress("meandEdxLay6",&meandEdxLay6);
220 ntssd->SetBranchAddress("errmeandEdxLay6",&errmeandEdxLay6);
221 ntssd->SetBranchAddress("ChargeRatioL5",&ChargeRatioL5);
222 ntssd->SetBranchAddress("errChargeratioL5",&errChargeratioL5);
223 ntssd->SetBranchAddress("ChargeRatioL6",&ChargeRatioL6);
224 ntssd->SetBranchAddress("errChargeratioL6",&errChargeratioL6);
225 ntssd->SetBranchAddress("moduleOff",&moduleOff);
226
227 TH1F* histodEdxLay5=new TH1F("histodEdxLay5","",(Int_t)ntssd->GetEntries(),0.,ntssd->GetEntries());
228 TH1F* histodEdxLay6=new TH1F("histodEdxLay6","",(Int_t)ntssd->GetEntries(),0.,ntssd->GetEntries());
229
230 TH1F* histoChargeRatioLay5=new TH1F("histoChargeRatioLay5","",(Int_t)ntssd->GetEntries(),0.,ntssd->GetEntries());
231 TH1F* histoChargeRatioLay6=new TH1F("histoChargeRatioLay6","",(Int_t)ntssd->GetEntries(),0.,ntssd->GetEntries());
232
233 TH1F* histoEmpty=new TH1F("histoEmpty","",(Int_t)ntssd->GetEntries(),0.,ntssd->GetEntries());
234
235 for(Int_t i=0; i<ntssd->GetEntries();i++){
236
237 ntssd->GetEvent(myIndex[i]);
238
239 histodEdxLay5->SetBinContent(i+1,meandEdxLay5);
240 histodEdxLay5->SetBinError(i+1,errmeandEdxLay5);
241 histodEdxLay5->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunSSD));
242
243 histodEdxLay6->SetBinContent(i+1,meandEdxLay6);
244 histodEdxLay6->SetBinError(i+1,errmeandEdxLay6);
245 histodEdxLay6->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunSSD));
246
247 histoChargeRatioLay5->SetBinContent(i+1,ChargeRatioL5);
248 histoChargeRatioLay5->SetBinError(i+1,errChargeratioL5);
249 histoChargeRatioLay5->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunSSD));
250
251 histoChargeRatioLay6->SetBinContent(i+1,ChargeRatioL6);
252 histoChargeRatioLay6->SetBinError(i+1,errChargeratioL6);
253 histoChargeRatioLay6->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunSSD));
254
255 histoEmpty->SetBinContent(i+1,moduleOff);
256 histoEmpty->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunSSD));
257
258 }
259
260 //Matching
261
262 TNtuple* ntmatching=(TNtuple*)fil->Get("ntmatching");
263
264 Float_t nrunMatch;
265 Float_t FracSPD1;
266 Float_t errFracSPD1;
267 Float_t FracSPD2;
268 Float_t errFracSPD2;
269 Float_t Eff6Pt02;
270 Float_t errEff6Pt02;
271 Float_t Eff6Pt1;
272 Float_t errEff6Pt1;
273 Float_t Eff6Pt10;
274 Float_t errEff6Pt10;
275 Float_t Eff5Pt02;
276 Float_t errEff5Pt02;
277 Float_t Eff5Pt1;
278 Float_t errEff5Pt1;
279 Float_t Eff5Pt10;
280 Float_t errEff5Pt10;
281 Float_t Eff4Pt02;
282 Float_t errEff4Pt02;
283 Float_t Eff4Pt1;
284 Float_t errEff4Pt1;
285 Float_t Eff4Pt10;
286 Float_t errEff4Pt10;
287 Float_t Eff3Pt02;
288 Float_t errEff3Pt02;
289 Float_t Eff3Pt1;
290 Float_t errEff3Pt1;
291 Float_t Eff3Pt10;
292 Float_t errEff3Pt10;
293 Float_t Eff2Pt02;
294 Float_t errEff2Pt02;
295 Float_t Eff2Pt1;
296 Float_t errEff2Pt1;
297 Float_t Eff2Pt10;
298 Float_t errEff2Pt10;
299 Float_t EffSPDPt02;
300 Float_t errEffSPDPt02;
301 Float_t EffSPDPt1;
302 Float_t errEffSPDPt1;
303 Float_t EffSPDPt10;
304 Float_t errEffSPDPt10;
305 Float_t EffoneSPDPt02;
306 Float_t errEffoneSPDPt02;
307 Float_t EffoneSPDPt1;
308 Float_t errEffoneSPDPt1;
309 Float_t EffoneSPDPt10;
310 Float_t errEffoneSPDPt10;
311 Float_t EffTOTPt02;
312 Float_t errEffTOTPt02;
313 Float_t EffTOTPt1;
314 Float_t errEffTOTPt1;
315 Float_t EffTOTPt10;
316 Float_t errEffTOTPt10;
317
318 ntmatching->SetBranchAddress("nrun",&nrunMatch);
319 // ntmatching->SetBranchAddress("nrunMatch",&nrunMatch);
320 ntmatching->SetBranchAddress("FracSPD1",&FracSPD1);
321 ntmatching->SetBranchAddress("errFracSPD1",&errFracSPD1);
322 ntmatching->SetBranchAddress("FracSPD2",&FracSPD2);
323 ntmatching->SetBranchAddress("errFracSPD2",&errFracSPD2);
324 ntmatching->SetBranchAddress("Eff6Pt02",&Eff6Pt02);
325 ntmatching->SetBranchAddress("errEff6Pt02",&errEff6Pt02);
326 ntmatching->SetBranchAddress("Eff6Pt1",&Eff6Pt1);
327 ntmatching->SetBranchAddress("errEff6Pt1",&errEff6Pt1);
328 ntmatching->SetBranchAddress("Eff6Pt10",&Eff6Pt10);
329 ntmatching->SetBranchAddress("errEff6Pt10",&errEff6Pt10);
330 ntmatching->SetBranchAddress("Eff5Pt02",&Eff5Pt02);
331 ntmatching->SetBranchAddress("errEff5Pt02",&errEff5Pt02);
332 ntmatching->SetBranchAddress("Eff5Pt1",&Eff5Pt1);
333 ntmatching->SetBranchAddress("errEff5Pt1",&errEff5Pt1);
334 ntmatching->SetBranchAddress("Eff5Pt10",&Eff5Pt10);
335 ntmatching->SetBranchAddress("errEff5Pt10",&errEff5Pt10);
336 ntmatching->SetBranchAddress("Eff4Pt02",&Eff4Pt02);
337 ntmatching->SetBranchAddress("errEff4Pt02",&errEff4Pt02);
338 ntmatching->SetBranchAddress("Eff4Pt1",&Eff4Pt1);
339 ntmatching->SetBranchAddress("errEff4Pt1",&errEff4Pt1);
340 ntmatching->SetBranchAddress("Eff4Pt10",&Eff4Pt10);
341 ntmatching->SetBranchAddress("errEff4Pt10",&errEff4Pt10);
342 ntmatching->SetBranchAddress("Eff3Pt02",&Eff3Pt02);
343 ntmatching->SetBranchAddress("errEff3Pt02",&errEff3Pt02);
344 ntmatching->SetBranchAddress("Eff3Pt1",&Eff3Pt1);
345 ntmatching->SetBranchAddress("errEff3Pt1",&errEff3Pt1);
346 ntmatching->SetBranchAddress("Eff3Pt10",&Eff3Pt10);
347 ntmatching->SetBranchAddress("errEff3Pt10",&errEff3Pt10);
348 ntmatching->SetBranchAddress("Eff2Pt02",&Eff2Pt02);
349 ntmatching->SetBranchAddress("errEff2Pt02",&errEff2Pt02);
350 ntmatching->SetBranchAddress("Eff2Pt1",&Eff2Pt1);
351 ntmatching->SetBranchAddress("errEff2Pt1",&errEff2Pt1);
352 ntmatching->SetBranchAddress("Eff2Pt10",&Eff2Pt10);
353 ntmatching->SetBranchAddress("errEff2Pt10",&errEff2Pt10);
354 ntmatching->SetBranchAddress("EffSPDPt02",&EffSPDPt02);
355 ntmatching->SetBranchAddress("errEffSPDPt02",&errEffSPDPt02);
356 ntmatching->SetBranchAddress("EffSPDPt1",&EffSPDPt1);
357 ntmatching->SetBranchAddress("errEffSPDPt1",&errEffSPDPt1);
358 ntmatching->SetBranchAddress("EffSPDPt10",&EffSPDPt10);
359 ntmatching->SetBranchAddress("errEffSPDPt10",&errEffSPDPt10);
360 ntmatching->SetBranchAddress("EffoneSPDPt02",&EffoneSPDPt02);
361 ntmatching->SetBranchAddress("errEffoneSPDPt02",&errEffoneSPDPt02);
362 ntmatching->SetBranchAddress("EffoneSPDPt1",&EffoneSPDPt1);
363 ntmatching->SetBranchAddress("errEffoneSPDPt1",&errEffoneSPDPt1);
364 ntmatching->SetBranchAddress("EffoneSPDPt10",&EffoneSPDPt10);
365 ntmatching->SetBranchAddress("errEffoneSPDPt10",&errEffoneSPDPt10);
366 ntmatching->SetBranchAddress("EffTOTPt02",&EffTOTPt02);
367 ntmatching->SetBranchAddress("errEffTOTPt02",&errEffTOTPt02);
368 ntmatching->SetBranchAddress("EffTOTPt1",&EffTOTPt1);
369 ntmatching->SetBranchAddress("errEffTOTPt1",&errEffTOTPt1);
370 ntmatching->SetBranchAddress("EffTOTPt10",&EffTOTPt10);
371 ntmatching->SetBranchAddress("errEffTOTPt10",&errEffTOTPt10);
372
373
374 TH1F *hFracSPD1 = new TH1F("hFracSPD1","SPD inner; run number; Fraction of HSs",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
3f614ddf 375 hFracSPD1->SetLineColor(kGreen+2);
376 hFracSPD1->SetMarkerColor(kGreen+2);
bde144f1 377 hFracSPD1->SetMarkerStyle(20);
378
379 TH1F *hFracSPD2 = new TH1F("hFracSPD2","SPD outer; run number; Fraction of HSs",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
3f614ddf 380 hFracSPD2->SetLineColor(kYellow+2);
381 hFracSPD2->SetMarkerColor(kYellow+2);
bde144f1 382 hFracSPD2->SetMarkerStyle(20);
383
384 TH1F *hEffSPDPt02 = new TH1F("hEffSPDPt02","Efficiency - P_{T} = 0.2; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
385 hEffSPDPt02->SetLineWidth(2);
386 hEffSPDPt02->SetLineColor(kAzure+1);
387 hEffSPDPt02->SetMarkerColor(kAzure+1);
388 hEffSPDPt02->SetMarkerStyle(20);
389
390 TH1F *hEffSPDPt1 = new TH1F("hEffSPDPt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
391 hEffSPDPt1->SetLineWidth(2);
392 hEffSPDPt1->SetLineColor(kAzure+1);
393 hEffSPDPt1->SetMarkerColor(kAzure+1);
394 hEffSPDPt1->SetMarkerStyle(20);
395
396 TH1F *hEffSPDPt10 = new TH1F("hEffSPDPt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
397 hEffSPDPt10->SetLineWidth(2);
398 hEffSPDPt10->SetLineColor(kAzure+1);
399 hEffSPDPt10->SetMarkerColor(kAzure+1);
400 hEffSPDPt10->SetMarkerStyle(20);
401
402 TH1F *hEffoneSPDPt02 = new TH1F("hEffoneSPDPt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
403 hEffoneSPDPt02->SetLineWidth(2);
404 hEffoneSPDPt02->SetLineColor(kGray);
405 hEffoneSPDPt02->SetMarkerColor(kGray);
406 hEffoneSPDPt02->SetMarkerStyle(20);
407 TH1F *hEffoneSPDPt1 = new TH1F("hEffoneSPDPt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
408 hEffoneSPDPt1->SetLineWidth(2);
409 hEffoneSPDPt1->SetLineColor(kGray);
410 hEffoneSPDPt1->SetMarkerColor(kGray);
411 hEffoneSPDPt1->SetMarkerStyle(20);
412 TH1F *hEffoneSPDPt10 = new TH1F("hEffoneSPDPt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
413 hEffoneSPDPt10->SetLineWidth(2);
414 hEffoneSPDPt10->SetLineColor(kGray);
415 hEffoneSPDPt10->SetMarkerColor(kGray);
416 hEffoneSPDPt10->SetMarkerStyle(20);
417
418 TH1F *hEff2Pt02 = new TH1F("hEff2Pt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
419 hEff2Pt02->SetLineWidth(2);
420 hEff2Pt02->SetLineColor(kViolet);
421 hEff2Pt02->SetMarkerColor(kViolet);
422 hEff2Pt02->SetMarkerStyle(20);
423 TH1F *hEff2Pt1 = new TH1F("hEff2Pt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
424 hEff2Pt1->SetLineWidth(2);
425 hEff2Pt1->SetLineColor(kViolet);
426 hEff2Pt1->SetMarkerColor(kViolet);
427 hEff2Pt1->SetMarkerStyle(20);
428 TH1F *hEff2Pt10 = new TH1F("hEff2Pt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
429 hEff2Pt10->SetLineWidth(2);
430 hEff2Pt10->SetLineColor(kViolet);
431 hEff2Pt10->SetMarkerColor(kViolet);
432 hEff2Pt10->SetMarkerStyle(20);
433
434 TH1F *hEff3Pt02 = new TH1F("hEff3Pt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
435 hEff3Pt02->SetLineWidth(2);
436 hEff3Pt02->SetLineColor(6);
437 hEff3Pt02->SetMarkerColor(6);
438 hEff3Pt02->SetMarkerStyle(20);
439 TH1F *hEff3Pt1 = new TH1F("hEff3Pt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
440 hEff3Pt1->SetLineWidth(2);
441 hEff3Pt1->SetLineColor(6);
442 hEff3Pt1->SetMarkerColor(6);
443 hEff3Pt1->SetMarkerStyle(20);
444 TH1F *hEff3Pt10 = new TH1F("hEff3Pt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
445 hEff3Pt10->SetLineWidth(2);
446 hEff3Pt10->SetLineColor(6);
447 hEff3Pt10->SetMarkerColor(6);
448 hEff3Pt10->SetMarkerStyle(20);
449
450 TH1F *hEff4Pt02 = new TH1F("hEff4Pt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
451 hEff4Pt02->SetLineWidth(2);
452 hEff4Pt02->SetLineColor(4);
453 hEff4Pt02->SetMarkerColor(4);
454 hEff4Pt02->SetMarkerStyle(20);
455 TH1F *hEff4Pt1 = new TH1F("hEff4Pt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
456 hEff4Pt1->SetLineWidth(2);
457 hEff4Pt1->SetLineColor(4);
458 hEff4Pt1->SetMarkerColor(4);
459 hEff4Pt1->SetMarkerStyle(20);
460 TH1F *hEff4Pt10 = new TH1F("hEff4Pt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
461 hEff4Pt10->SetLineWidth(2);
462 hEff4Pt10->SetLineColor(4);
463 hEff4Pt10->SetMarkerColor(4);
464 hEff4Pt10->SetMarkerStyle(20);
465
466 TH1F *hEff5Pt02 = new TH1F("hEff5Pt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
467 hEff5Pt02->SetLineWidth(2);
468 hEff5Pt02->SetLineColor(3);
469 hEff5Pt02->SetMarkerColor(3);
470 hEff5Pt02->SetMarkerStyle(20);
471 TH1F *hEff5Pt1 = new TH1F("hEff5Pt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
472 hEff5Pt1->SetLineWidth(2);
473 hEff5Pt1->SetLineColor(3);
474 hEff5Pt1->SetMarkerColor(3);
475 hEff5Pt1->SetMarkerStyle(20);
476 TH1F *hEff5Pt10 = new TH1F("hEff5Pt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
477 hEff5Pt10->SetLineWidth(3);
478 hEff5Pt10->SetLineColor(3);
479 hEff5Pt10->SetMarkerColor(3);
480 hEff5Pt10->SetMarkerStyle(20);
481
482 TH1F *hEff6Pt02 = new TH1F("hEff6Pt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
483 hEff6Pt02->SetLineWidth(2);
484 hEff6Pt02->SetLineColor(2);
485 hEff6Pt02->SetMarkerColor(2);
486 hEff6Pt02->SetMarkerStyle(20);
487 TH1F *hEff6Pt1 = new TH1F("hEff6Pt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
488 hEff6Pt1->SetLineWidth(2);
489 hEff6Pt1->SetLineColor(2);
490 hEff6Pt1->SetMarkerColor(2);
491 hEff6Pt1->SetMarkerStyle(20);
492 TH1F *hEff6Pt10 = new TH1F("hEff6Pt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
493 hEff6Pt10->SetLineWidth(2);
494 hEff6Pt10->SetLineColor(2);
495 hEff6Pt10->SetMarkerColor(2);
496 hEff6Pt10->SetMarkerStyle(20);
497
498
499 TH1F *hEffTOTPt02 = new TH1F("hEffTOTPt02","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
500 hEffTOTPt02->SetLineWidth(2);
501 hEffTOTPt02->SetLineColor(kBlue+2);
502 hEffTOTPt02->SetMarkerColor(kBlue+2);
503 hEffTOTPt02->SetMarkerStyle(20);
504 TH1F *hEffTOTPt1 = new TH1F("hEffTOTPt1","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
505 hEffTOTPt1->SetLineWidth(2);
506 hEffTOTPt1->SetLineColor(kBlue+2);
507 hEffTOTPt1->SetMarkerColor(kBlue+2);
508 hEffTOTPt1->SetMarkerStyle(20);
509 TH1F *hEffTOTPt10 = new TH1F("hEffTOTPt10","Efficiency; run number; TPC+ITS / TPC",(Int_t)ntmatching->GetEntries(),0.,ntmatching->GetEntries());
510 hEffTOTPt10->SetLineWidth(2);
511 hEffTOTPt10->SetLineColor(kBlue+2);
512 hEffTOTPt10->SetMarkerColor(kBlue+2);
513 hEffTOTPt10->SetMarkerStyle(20);
514
515 Int_t nEntriesMatch=ntmatching->GetEntries();
516
517 for(Int_t i=0;i<nEntriesMatch;i++){
518
519 ntmatching->GetEvent(myIndex[i]);
520 // Int_t bin=nrunMatch;
521
522 // fill histos
3f614ddf 523 // cout<<i<<") "<<"Index= "<<myIndex[i]<<" nrun= "<<nrunMatch<<", FracSPD1= "<<FracSPD1<<", FracSPD2"<<FracSPD2<<endl;
524 hFracSPD1->SetBinContent(i+1,FracSPD1);
525 hFracSPD1->SetBinError(i+1,.01);
bde144f1 526 hFracSPD1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
527
528 // cout<<FracSPD1<<endl;
529
530 hFracSPD2->SetBinContent(i+1,FracSPD2);
531 hFracSPD2->SetBinError(i+1,.01);
532 hFracSPD2->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
533
534 // cout<<FracSPD2<<endl;
535
536 //-------------------------
537
538 hEff6Pt02->SetBinContent(i+1,Eff6Pt02);
539 hEff6Pt02->SetBinError(i+1,errEff6Pt02);
540 hEff6Pt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
541
542 hEff6Pt1->SetBinContent(i+1,Eff6Pt1);
543 hEff6Pt1->SetBinError(i+1,errEff6Pt1);
544 hEff6Pt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
545
546 hEff6Pt10->SetBinContent(i+1,Eff6Pt10);
547 hEff6Pt10->SetBinError(i+1,errEff6Pt10);
548 hEff6Pt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
549
550 hEff5Pt02->SetBinContent(i+1,Eff5Pt02);
551 hEff5Pt02->SetBinError(i+1,errEff5Pt02);
552 hEff5Pt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
553
554 hEff5Pt1->SetBinContent(i+1,Eff5Pt1);
555 hEff5Pt1->SetBinError(i+1,errEff5Pt1);
556 hEff5Pt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
557
558 hEff5Pt10->SetBinContent(i+1,Eff5Pt10);
559 hEff5Pt10->SetBinError(i+1,errEff5Pt10);
560 hEff5Pt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
561
562 hEff4Pt02->SetBinContent(i+1,Eff4Pt02);
563 hEff4Pt02->SetBinError(i+1,errEff4Pt1);
564 hEff4Pt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
565
566 hEff4Pt1->SetBinContent(i+1,Eff4Pt1);
567 hEff4Pt1->SetBinError(i+1,errEff4Pt1);
568 hEff4Pt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
569
570 hEff4Pt10->SetBinContent(i+1,Eff4Pt10);
571 hEff4Pt10->SetBinError(i+1,errEff4Pt10);
572 hEff4Pt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
573
574 hEff3Pt02->SetBinContent(i+1,Eff3Pt02);
575 hEff3Pt02->SetBinError(i+1,errEff3Pt02);
576 hEff3Pt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
577
578 hEff3Pt1->SetBinContent(i+1,Eff3Pt1);
579 hEff3Pt1->SetBinError(i+1,errEff3Pt1);
580 hEff3Pt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
581
582 hEff3Pt10->SetBinContent(i+1,Eff3Pt10);
583 hEff3Pt10->SetBinError(i+1,errEff3Pt10);
584 hEff3Pt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
585
586 hEff2Pt02->SetBinContent(i+1,Eff2Pt02);
587 hEff2Pt02->SetBinError(i+1,errEff2Pt02);
588 hEff2Pt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
589
590 hEff2Pt1->SetBinContent(i+1,Eff2Pt1);
591 hEff2Pt1->SetBinError(i+1,errEff2Pt1);
592 hEff2Pt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
593
594 hEff2Pt10->SetBinContent(i+1,Eff2Pt10);
595 hEff2Pt10->SetBinError(i+1,errEff2Pt10);
596 hEff2Pt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
597
598
599 hEffSPDPt02->SetBinContent(i+1,EffSPDPt02);
600 hEffSPDPt02->SetBinError(i+1,errEffSPDPt02);
601 hEffSPDPt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
602
603 hEffSPDPt1->SetBinContent(i+1,EffSPDPt1);
604 hEffSPDPt1->SetBinError(i+1,errEffSPDPt1);
605 hEffSPDPt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
606
607 hEffSPDPt10->SetBinContent(i+1,EffSPDPt10);
608 hEffSPDPt10->SetBinError(i+1,errEffSPDPt10);
609 hEffSPDPt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
610
611 hEffoneSPDPt02->SetBinContent(i+1,EffoneSPDPt02);
612 hEffoneSPDPt02->SetBinError(i+1,errEffoneSPDPt02);
613 hEffoneSPDPt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
614
615 hEffoneSPDPt1->SetBinContent(i+1,EffoneSPDPt1);
616 hEffoneSPDPt1->SetBinError(i+1,errEffoneSPDPt1);
617 hEffoneSPDPt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
618
619 hEffoneSPDPt10->SetBinContent(i+1,EffoneSPDPt10);
620 hEffoneSPDPt10->SetBinError(i+1,errEffoneSPDPt10);
621 hEffoneSPDPt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
622
623 hEffTOTPt02->SetBinContent(i+1,EffTOTPt02);
624 hEffTOTPt02->SetBinError(i+1,errEffTOTPt02);
625 hEffTOTPt02->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
626
627 hEffTOTPt1->SetBinContent(i+1,EffTOTPt1);
628 hEffTOTPt1->SetBinError(i+1,errEffTOTPt1);
629 hEffTOTPt1->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
630
631 hEffTOTPt10->SetBinContent(i+1,EffTOTPt10);
632 hEffTOTPt10->SetBinError(i+1,errEffTOTPt10);
633 hEffTOTPt10->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunMatch));
634
635 }
636
637 //-----------------------------------
638
639 //---vertex
640
641 TNtuple* ntvertex=(TNtuple*)fil->Get("ntvertex");
642
643 Float_t nrunVertex,Vx,errVx,sigmaVx,errsigmaVx,Vy,errVy,sigmaVy,errsigmaVy,Vz,errVz,sigmaVz,errsigmaVz;
644
645 ntvertex->SetBranchAddress("nrun",&nrunVertex);
646 ntvertex->SetBranchAddress("Vx",&Vx);
647 ntvertex->SetBranchAddress("errVx",&errVx);
648 ntvertex->SetBranchAddress("sigmaVx",&sigmaVx);
649 ntvertex->SetBranchAddress("errsigmaVx",&errsigmaVx);
650 ntvertex->SetBranchAddress("Vy",&Vy);
651 ntvertex->SetBranchAddress("errVy",&errVy);
652 ntvertex->SetBranchAddress("sigmaVy",&sigmaVy);
653 ntvertex->SetBranchAddress("errsigmaVy",&errsigmaVy);
654 ntvertex->SetBranchAddress("Vz",&Vz);
655 ntvertex->SetBranchAddress("errVz",&errVz);
656 ntvertex->SetBranchAddress("sigmaVz",&sigmaVz);
657 ntvertex->SetBranchAddress("errsigmaVz",&errsigmaVz);
658
659
660 TH1F *hVx = new TH1F("hVx","Track Vertex Vx Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
661 hVx->SetLineWidth(2);
662 hVx->SetLineColor(kBlue+2);
663 hVx->SetMarkerColor(kBlue+2);
664 hVx->SetMarkerStyle(20);
665
666 TH1F *hVy = new TH1F("hVy","Track Vertex Vy Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
667 hVy->SetLineWidth(2);
668 hVy->SetLineColor(kBlue+2);
669 hVy->SetMarkerColor(kBlue+2);
670 hVy->SetMarkerStyle(20);
671
672 TH1F *hVz = new TH1F("hVz","Track Vertex Vz Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
673 hVz->SetLineWidth(2);
674 hVz->SetLineColor(kBlue+2);
675 hVz->SetMarkerColor(kBlue+2);
676 hVz->SetMarkerStyle(20);
677
678 TH1F *hSigmaVx = new TH1F("hSigmaVx","Track Vertex SigmaVx Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
679 hSigmaVx->SetLineWidth(2);
680 hSigmaVx->SetLineColor(kBlue+2);
681 hSigmaVx->SetMarkerColor(kBlue+2);
682 hSigmaVx->SetMarkerStyle(20);
683
684 TH1F *hSigmaVy = new TH1F("hSigmaVy","Track Vertex SigmaVy Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
685 hSigmaVy->SetLineWidth(2);
686 hSigmaVy->SetLineColor(kBlue+2);
687 hSigmaVy->SetMarkerColor(kBlue+2);
688 hSigmaVy->SetMarkerStyle(20);
689
690 TH1F *hSigmaVz = new TH1F("hSigmaVz","Track Vertex SigmaVz Distribution",(Int_t)ntvertex->GetEntries(),0.,ntvertex->GetEntries());
691 hSigmaVz->SetLineWidth(2);
692 hSigmaVz->SetLineColor(kBlue+2);
693 hSigmaVz->SetMarkerColor(kBlue+2);
694 hSigmaVz->SetMarkerStyle(20);
695
696
697 Int_t nEntriesVertex=ntvertex->GetEntries();
698
699 for(Int_t i=0;i<nEntriesVertex;i++){
700
701 ntvertex->GetEvent(myIndex[i]);
702
703 // cout<<Vx<<endl;
704
705 hVx->SetBinContent(i+1,Vx);
706 hVx->SetBinError(i+1,errVx);
707 hVx->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
708
709 hVy->SetBinContent(i+1,Vy);
710 hVy->SetBinError(i+1,errVy);
711 hVy->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
712
713 hVz->SetBinContent(i+1,Vz);
714 hVz->SetBinError(i+1,errVz);
715 hVz->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
716
717
718 hSigmaVx->SetBinContent(i+1,sigmaVx);
719 hSigmaVx->SetBinError(i+1,errsigmaVx);
720 hSigmaVx->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
721
722 hSigmaVy->SetBinContent(i+1,sigmaVy);
723 hSigmaVy->SetBinError(i+1,errsigmaVy);
724 hSigmaVy->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
725
726 hSigmaVz->SetBinContent(i+1,sigmaVz);
727 hSigmaVz->SetBinError(i+1,errsigmaVz);
728 hSigmaVz->GetXaxis()->SetBinLabel(i+1,Form("%d",(Int_t)nrunVertex));
729
730 }
731 //-------- Draw Vertex histograms ---------
732 TCanvas *cVertexDisto=new TCanvas("cVertexDisto","cVertexDisto",1200,800);
733 cVertexDisto->Divide(3,2);
734 cVertexDisto->cd(1);
735 hVx->SetMinimum(0.03);
736 hVx->SetMaximum(0.08);
737 hVx->GetYaxis()->SetTitle("Vertex X coordinate");
738 hVx->Draw();
739 cVertexDisto->cd(2);
740 hVy->SetMinimum(0.25);
741 hVy->SetMaximum(0.30);
742 hVy->GetYaxis()->SetTitle("Vertex Y coordinate");
743 hVy->Draw();
744 cVertexDisto->cd(3);
745 hVz->SetMinimum(-1.);
746 hVz->SetMaximum(1.);
747 hVz->GetYaxis()->SetTitle("Vertex Z coordinate");
748 hVz->Draw();
749 cVertexDisto->cd(4);
750 hSigmaVx->SetMinimum(0.);
751 hSigmaVx->SetMaximum(0.01);
752 hSigmaVx->GetYaxis()->SetTitle("sigma on x coordinate");
753 hSigmaVx->Draw();
754 cVertexDisto->cd(5);
755 hSigmaVy->SetMinimum(0.);
756 hSigmaVy->SetMaximum(0.01);
757 hSigmaVy->GetYaxis()->SetTitle("sigma on y coordinate");
758 hSigmaVy->Draw();
759 cVertexDisto->cd(6);
760 hSigmaVz->SetMinimum(6.);
761 hSigmaVz->SetMaximum(10.);
762 hSigmaVz->GetYaxis()->SetTitle("sigma on z coordinate");
763 hSigmaVz->Draw();
764 cVertexDisto->SaveAs("Vertex_trend.pdf");
765 pdfFileNames+=" Vertex_trend.pdf";
766 //-----------------------------------
767
768 gStyle->SetOptStat(0);
769
770 TCanvas* c5=new TCanvas("c5","Track With points in ITS");
771 histoTrackClu3->Draw();
772 histoTrackClu3->SetLineColor(1);
773 histoTrackClu3->SetMarkerStyle(20);
774 histoTrackClu3->Draw();
775 histoTrackClu3->SetMinimum(0.);
776 histoTrackClu3->SetMaximum(1.05);
777 histoTrackClu4->SetLineColor(2);
778 histoTrackClu4->SetMarkerColor(2);
779 histoTrackClu4->SetMarkerStyle(22);
780 histoTrackClu4->Draw("same");
781 histoTrackClu1->SetLineColor(kGray+1);
782 histoTrackClu1->SetMarkerColor(kGray+1);
783 histoTrackClu1->SetMarkerStyle(24);
784 histoTrackClu1->Draw("same");
785 histoTrackClu2->SetLineColor(kGray+2);
786 histoTrackClu2->SetMarkerColor(kGray+2);
787 histoTrackClu2->SetMarkerStyle(26);
788 histoTrackClu2->Draw("same");
789 histoTrackClu5->SetLineColor(4);
790 histoTrackClu5->SetMarkerColor(4);
791 histoTrackClu5->SetMarkerStyle(29);
792 histoTrackClu5->Draw("same");
793 histoTrackClu6->SetLineColor(kBlue+1);
794 histoTrackClu6->SetMarkerColor(kBlue+1);
795 histoTrackClu6->SetMarkerStyle(30);
796 histoTrackClu6->SetTitle("Fraction of tracks with points in ITS");
797 histoTrackClu6->Draw("same");
798 histoTrackClu3->GetYaxis()->SetTitle("Fraction of Tracks with Points in ITS Layers");
799 TLegend* leg3=new TLegend(0.7,0.15,0.88,0.35);
800 TLegendEntry* ent;
801 ent=leg3->AddEntry(histoTrackClu1,"Layer1","PL");
802 ent->SetTextColor(histoTrackClu1->GetMarkerColor());
803 ent=leg3->AddEntry(histoTrackClu2,"Layer2","PL");
804 ent->SetTextColor(histoTrackClu2->GetMarkerColor());
805 ent=leg3->AddEntry(histoTrackClu3,"Layer3","PL");
806 ent->SetTextColor(histoTrackClu3->GetMarkerColor());
807 ent=leg3->AddEntry(histoTrackClu4,"Layer4","PL");
808 ent->SetTextColor(histoTrackClu4->GetMarkerColor());
809 ent=leg3->AddEntry(histoTrackClu5,"Layer5","PL");
810 ent->SetTextColor(histoTrackClu5->GetMarkerColor());
811 ent=leg3->AddEntry(histoTrackClu6,"Layer6","PL");
812 ent->SetTextColor(histoTrackClu6->GetMarkerColor());
813
814 leg3->SetFillStyle(0);
815 leg3->Draw();
816 c5->SaveAs("TrackPoints_trend.pdf");
817 pdfFileNames+=" TrackPoints_trend.pdf";
818 c5->Update();
819
820
821
822 TCanvas* c2=new TCanvas("c2","SDD DriftTime & Charge",1200,800);
823 c2->Divide(2,2);
824 c2->cd(1);
825 histominTime->Draw();
826 histominTime->SetMinimum(450);
827 histominTime->SetMaximum(550);
828 histominTime->GetYaxis()->SetTitle("Minimum Drift Time (ns)");
829 TLatex* td1=new TLatex(0.2,0.85,"SDD minimum drift time (ref=505ns)");
830 td1->SetNDC();
831 td1->SetTextColor(1);
832 td1->Draw();
833 c2->cd(2);
834 histomeanTime->Draw();
835 histomeanTime->SetMinimum(3200);
836 histomeanTime->SetMaximum(3300);
837 histomeanTime->GetYaxis()->SetTitle("Average Drift Time (ns)");
838 TLatex* td2=new TLatex(0.2,0.85,"SDD average drift time");
839 td2->SetNDC();
840 // td2>SetTextColor(1);
841 td2->Draw();
842
843 // TCanvas* c4=new TCanvas("c4","Charge");
844 c2->cd(3);
845 histodEdxTB0->SetLineColor(1);
846 histodEdxTB0->SetMarkerStyle(20);
847 histodEdxTB0->Draw();
848 histodEdxTB0->SetMinimum(90.);
849 histodEdxTB0->SetMaximum(120.);
850 histodEdxTB5->SetLineColor(4);
851 histodEdxTB5->SetMarkerColor(4);
852 histodEdxTB5->SetMarkerStyle(23);
853 // histodEdxTB5->SetMinimum(90);
854 // histodEdxTB5->SetMaximum(120);
855 histodEdxTB5->Draw("same");
856 histodEdxTB0->GetYaxis()->SetTitle("<dE/dx> (keV/300 #mum)");
857 TLegend* leg2=new TLegend(0.6,0.15,0.88,0.35);
858 ent=leg2->AddEntry(histodEdxTB0,"Small drift time","PL");
859 ent=leg2->AddEntry(histodEdxTB5,"Large drift time","PL");
860 ent->SetTextColor(histodEdxTB5->GetMarkerColor());
861 leg2->SetFillStyle(0);
862 leg2->Draw();
863 TLatex* tc1=new TLatex(0.2,0.85,"SDD charge in different drift regions");
864 tc1->SetNDC();
865 tc1->SetTextColor(1);
866 tc1->Draw();
867 // TCanvas* c4b=new TCanvas("c4b","Charge per Layer");
868 c2->cd(4);
869 histodEdxLay3->SetLineColor(1);
870 histodEdxLay3->SetMarkerStyle(20);
871 histodEdxLay3->Draw();
872 histodEdxLay3->SetMinimum(90.);
873 histodEdxLay3->SetMaximum(120.);
874 histodEdxLay4->SetLineColor(4);
875 histodEdxLay4->SetMarkerColor(4);
876 histodEdxLay4->SetMarkerStyle(23);
877 histodEdxLay4->Draw("same");
878
879 histodEdxLay5->SetLineColor(6);
880 histodEdxLay5->SetMarkerColor(6);
881 histodEdxLay5->SetMarkerStyle(22);
882 histodEdxLay5->Draw("same");
883 histodEdxLay5->SetMinimum(0.);
884 histodEdxLay6->SetLineColor(7);
885 histodEdxLay6->SetMarkerColor(7);
886 histodEdxLay6->SetMarkerStyle(24);
887 histodEdxLay6->Draw("same");
888
889 histodEdxLay3->GetYaxis()->SetTitle("<dE/dx> (keV/300 #mum)");
890
891 TLegend* leg2b=new TLegend(0.6,0.15,0.88,0.35);
892 ent=leg2b->AddEntry(histodEdxLay3,"Layer 3","PL");
893 ent=leg2b->AddEntry(histodEdxLay4,"Layer 4","PL");
894 ent=leg2b->AddEntry(histodEdxLay5,"Layer 5","PL");
895 ent=leg2b->AddEntry(histodEdxLay6,"Layer 6","PL");
896 ent->SetTextColor(histodEdxLay4->GetMarkerColor());
897 leg2b->SetFillStyle(0);
898 leg2b->Draw();
899 // c4b->Update();
900 TLatex* tc2=new TLatex(0.2,0.85,"SDD and SSD charge in different layers");
901 tc2->SetNDC();
902 tc2->SetTextColor(1);
903 tc2->Draw();
904 c2->SaveAs("SDD_SSD_drift_charge_trend.pdf");
905 pdfFileNames+=" SDD_SSD_drift_charge_trend.pdf";
906 c2->Update();
907
908 TCanvas *c7=new TCanvas("c7","Charge ratio");
909 c7->cd();
910 histoChargeRatioLay5->SetLineColor(6);
911 histoChargeRatioLay5->SetMarkerColor(6);
912 histoChargeRatioLay5->SetMarkerStyle(20);
913 histoChargeRatioLay5->SetMinimum(-0.01);
914 histoChargeRatioLay5->SetMaximum(+0.01);
915 histoChargeRatioLay5->Draw();
916 histoChargeRatioLay6->SetLineColor(7);
917 histoChargeRatioLay6->SetMarkerColor(7);
918 histoChargeRatioLay6->SetMarkerStyle(22);
919 histoChargeRatioLay6->GetYaxis()->SetTitle("SSD charge ratio");
920 histoChargeRatioLay6->Draw("same");
921 TLegend* legCR=new TLegend(0.7,0.75,0.88,0.85);
922 ent=legCR->AddEntry(histoChargeRatioLay5,"Layer5","PL");
923 ent->SetTextColor(histoChargeRatioLay5->GetMarkerColor());
924 ent=legCR->AddEntry(histoChargeRatioLay6,"Layer6","PL");
925 ent->SetTextColor(histoChargeRatioLay6->GetMarkerColor());
926 legCR->SetFillStyle(0);
927 legCR->Draw();
928 TLatex* tc3=new TLatex(0.2,0.85,"SSD charge ratio in different layers");
929 tc3->SetNDC();
930 tc3->SetTextColor(1);
931 tc3->Draw();
932 c7->SaveAs("SSD_chargeratio_trend.pdf");
933 pdfFileNames+=" SSD_chargeratio_trend.pdf";
934 // TCanvas *c8=new TCanvas("c8","Masked modules");
935 // c8->cd();
936 // histoEmpty->Draw();
937
938 TCanvas *cpt02=new TCanvas("cpt02","TPC-ITS matching efficiency",1200,1000);
939 cpt02->Divide(2,2);
940 cpt02->cd(1);
941 hEff6Pt02->SetMinimum(0);
942 hEff6Pt02->Draw();
943 hEff5Pt02->Draw("same");
944 hEff4Pt02->Draw("same");
945 hEff3Pt02->Draw("same");
946 hEff2Pt02->Draw("same");
947 hEffSPDPt02->Draw("same");
948 hEffoneSPDPt02->Draw("same");
949 hEffTOTPt02->Draw("same");
950 hEff6Pt02->GetYaxis()->SetRangeUser(0,1);
951 TLegend* lpt02=new TLegend(0.9,0.8,1,1);
952 lpt02->AddEntry(hEff6Pt02,"6 cls","l");
953 lpt02->AddEntry(hEff5Pt02,"5 cls","l");
954 lpt02->AddEntry(hEff4Pt02,"4 cls","l");
955 lpt02->AddEntry(hEff3Pt02,"3 cls","l");
956 lpt02->AddEntry(hEff2Pt02,"2 cls","l");
957 lpt02->AddEntry(hEffSPDPt02,"2SPD + any","l");
958 lpt02->AddEntry(hEffoneSPDPt02,">=1SPD + any","l");
959 lpt02->AddEntry(hEffTOTPt02,">=2","l");
960 lpt02->Draw("same");
961 TLatex* tpc1=new TLatex(0.2,0.85,"TPCITS match eff Pt=0.2");
962 tpc1->SetNDC();
963 tpc1->SetTextColor(1);
964 tpc1->Draw();
965
966 // TCanvas *cpt1=new TCanvas("cpt1","cpt1");
967 // cpt1->cd(1);
968 cpt02->cd(2);
969
970 hEff6Pt1->Draw();
971 hEff5Pt1->Draw("same");
972 hEff4Pt1->Draw("same");
973 hEff3Pt1->Draw("same");
974 hEff2Pt1->Draw("same");
975 hEffSPDPt1->Draw("same");
976 hEffoneSPDPt1->Draw("same");
977 hEffTOTPt1->Draw("same");
978 hEff6Pt1->GetYaxis()->SetRangeUser(0,1);
979
980 TLegend* lpt1=new TLegend(0.9,0.8,1,1);
981 lpt1->AddEntry(hEff6Pt1,"6 cls","l");
982 lpt1->AddEntry(hEff5Pt1,"5 cls","l");
983 lpt1->AddEntry(hEff4Pt1,"4 cls","l");
984 lpt1->AddEntry(hEff3Pt1,"3 cls","l");
985 lpt1->AddEntry(hEff2Pt1,"2 cls","l");
986 lpt1->AddEntry(hEffSPDPt1,"2SPD + any","l");
987 lpt1->AddEntry(hEffoneSPDPt1,">=1SPD + any","l");
988 lpt1->AddEntry(hEffTOTPt02,">=2","l");
989 lpt1->Draw("same");
990 TLatex* tpc2=new TLatex(0.2,0.75,"TPCITS match eff Pt=1");
991 tpc2->SetNDC();
992 tpc2->SetTextColor(1);
993 tpc2->Draw();
994
995
996 // TCanvas *cpt10=new TCanvas("cpt10","cpt10");
997 cpt02->cd(3);
998
999 hEff6Pt10->Draw();
1000 hEff5Pt10->Draw("same");
1001 hEff4Pt10->Draw("same");
1002 hEff3Pt10->Draw("same");
1003 hEff2Pt10->Draw("same");
1004 hEffSPDPt10->Draw("same");
1005 hEffoneSPDPt10->Draw("same");
1006 hEffTOTPt10->Draw("same");
1007 hEff6Pt10->GetYaxis()->SetRangeUser(0,1);
1008
1009 TLegend* lpt10=new TLegend(0.9,0.8,1,1);
1010 lpt10->AddEntry(hEff6Pt10,"6 cls","l");
1011 lpt10->AddEntry(hEff5Pt10,"5 cls","l");
1012 lpt10->AddEntry(hEff4Pt10,"4 cls","l");
1013 lpt10->AddEntry(hEff3Pt10,"3 cls","l");
1014 lpt10->AddEntry(hEff2Pt10,"2 cls","l");
1015 lpt10->AddEntry(hEffSPDPt10,"2SPD + any","l");
1016 lpt10->AddEntry(hEffoneSPDPt10,">=1SPD + any","l");
1017 lpt10->AddEntry(hEffTOTPt02,">=2","l");
1018 lpt10->Draw("same");
1019
1020 TLatex* tpc3=new TLatex(0.2,0.75,"TPCITS match eff Pt=10");
1021 tpc3->SetNDC();
1022 tpc3->SetTextColor(1);
1023 tpc3->Draw();
1024
1025 cpt02->cd(4);
1026
1027
1028 // TCanvas *cSPD = new TCanvas("cSPD","cSPD",0,0,1000,300);
1029 // cSPD->SetGridy();
1030 hFracSPD1->SetMaximum(1.2);
3f614ddf 1031 hFracSPD1->SetMinimum(0);
bde144f1 1032 hFracSPD1->Draw("p");
1033 hFracSPD2->Draw("same,p");
1034
1035 TLegend* lSPD=new TLegend(0.9,0.8,1,1);
1036 lSPD->AddEntry(hFracSPD1,"Frac. SPD1 ON","l");
1037 lSPD->AddEntry(hFracSPD2,"Frac. SPD2 ON","l");
1038 lSPD->Draw();
1039 TLatex* tSPD=new TLatex(0.2,0.85,"Fraction of SPD half staves ON");
1040 tSPD->SetNDC();
1041 tSPD->SetTextColor(1);
1042 tSPD->Draw();
1043 cpt02->SaveAs("TPCITS_trend.pdf");
1044 pdfFileNames+=" TPCITS_trend.pdf";
1045 cpt02->Update();
1046
1047 //----------- ITS SA -----------
1048 PlotITSSA(fil,myIndex);
1049 // merge the pdf files
1050 TString command("gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged");
1051 command=command+"ITS_trend.pdf "+pdfFileNames;
1052 gSystem->Exec(command.Data());
1053 printf(" Merging the pdf file: %s \n",command.Data());
1054 delete [] myIndex;
1055 delete [] noRuns;
1056}
1057
1058
1059void PlotITSSA(TFile *fil,Int_t *myIndex){
1060 Double_t Lowbin[3]={0.1,0.5,0.9};
1061 Double_t Upbin[3]={0.2,0.6,1};
1062 gROOT->SetStyle("Plain");
1063 gStyle->SetOptTitle(0);
1064 gStyle->SetOptStat(0);
1065 gStyle->SetFillColor(0);
1066 gStyle->SetTextFont(32);
1067
1068 TNtuple* nt = (TNtuple*)fil->Get("ntITSsa");
1069 Int_t nruns=nt->GetEntries();
1070 printf("Events = %d\n",nruns);
1071 Float_t ITSA[3];
1072 Float_t TPIT[3];
1073 Float_t RAT[3];
1074 Float_t run;
1075 nt->SetBranchAddress("run",&run);
1076 nt->SetBranchAddress("NITSsaPtBin0",&ITSA[0]);
1077 nt->SetBranchAddress("NITSsaPtBin1",&ITSA[1]);
1078 nt->SetBranchAddress("NITSsaPtBin2",&ITSA[2]);
1079 nt->SetBranchAddress("NITSTPCPtBin0",&TPIT[0]);
1080 nt->SetBranchAddress("NITSTPCPtBin1",&TPIT[1]);
1081 nt->SetBranchAddress("NITSTPCPtBin2",&TPIT[2]);
1082 nt->SetBranchAddress("ratioPtBin0",&RAT[0]);
1083 nt->SetBranchAddress("ratioPtBin1",&RAT[1]);
1084 nt->SetBranchAddress("ratioPtBin2",&RAT[2]);
1085 TH1F *h0=new TH1F("h0","h0",nruns,-0.5,nruns-0.5);
1086 TH1F *h1=new TH1F("h1","h1",nruns,-0.5,nruns-0.5);
1087 TH1F *h2=new TH1F("h2","h2",nruns,-0.5,nruns-0.5);
1088 TH1F *h3=new TH1F("h3","h4",nruns,-0.5,nruns-0.5);
1089 TH1F *h4=new TH1F("h4","h5",nruns,-0.5,nruns-0.5);
1090 TH1F *h5=new TH1F("h5","h5",nruns,-0.5,nruns-0.5);
1091 TH1F *h6=new TH1F("h6","h6",nruns,-0.5,nruns-0.5);
1092 TH1F *h7=new TH1F("h7","h7",nruns,-0.5,nruns-0.5);
1093 TH1F *h8=new TH1F("h8","h8",nruns,-0.5,nruns-0.5);
1094 for(Int_t iev=0;iev<nruns;iev++){
1095 nt->GetEvent(myIndex[iev]);
1096 //cout<<"Numeri TPCITS "<<TPIT[0]<<" "<<TPIT[1]<<" "<<TPIT[2]<<endl;
1097 h0->Fill(iev,ITSA[0]);
1098 h1->Fill(iev,ITSA[1]);
1099 h2->Fill(iev,ITSA[2]);
1100 h3->Fill(iev,TPIT[0]);
1101 h4->Fill(iev,TPIT[1]);
1102 h5->Fill(iev,TPIT[2]);
1103 h6->Fill(iev,RAT[0]);
1104 h7->Fill(iev,RAT[1]);
1105 h8->Fill(iev,RAT[2]);
1106 h0->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1107 h1->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1108 h2->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1109 h3->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1110 h4->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1111 h5->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1112 h6->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1113 h7->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1114 h8->GetXaxis()->SetBinLabel(iev+1,Form("%.0f",run));
1115 Printf("%f %f %f",ITSA[0],ITSA[1],ITSA[2]);
1116 }
1117 h0->Print("all");
1118 h0->GetYaxis()->SetTitle("ITSsa tracks");
1119 h0->GetXaxis()->SetTitle("run");
1120 h1->GetYaxis()->SetTitle("ITSsa tracks");
1121 h1->GetXaxis()->SetTitle("run");
1122 h2->GetYaxis()->SetTitle("ITSsa tracks");
1123 h2->GetXaxis()->SetTitle("run");
1124 h3->GetYaxis()->SetTitle("ITS+TPC tracks");
1125 h3->GetXaxis()->SetTitle("run");
1126 h4->GetYaxis()->SetTitle("ITS+TPC tracks");
1127 h4->GetXaxis()->SetTitle("run");
1128 h5->GetYaxis()->SetTitle("ITS+TPC tracks");
1129 h5->GetXaxis()->SetTitle("run");
1130 h6->GetYaxis()->SetTitle("(TPC+ITS)/ITS");
1131 h6->GetXaxis()->SetTitle("run");
1132 h7->GetYaxis()->SetTitle("(TPC+ITS)/ITS");
1133 h7->GetXaxis()->SetTitle("run");
1134 h8->GetYaxis()->SetTitle("(TPC+ITS)/ITS");
1135 h8->GetXaxis()->SetTitle("run");
1136 h0->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[0],Upbin[0]));
1137 h1->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[1],Upbin[1]));
1138 h2->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[2],Upbin[2]));
1139 h3->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[0],Upbin[0]));
1140 h4->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[1],Upbin[1]));
1141 h5->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[2],Upbin[2]));
1142 h6->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[0],Upbin[0]));
1143 h7->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[1],Upbin[1]));
1144 h8->SetTitle(Form("%.1f GeV/c < pt < %.1f GeV/c",Lowbin[2],Upbin[2]));
1145 h0->SetMinimum(100);
1146// h0->SetMaximum(2);
1147 h1->SetMinimum(100);
1148// h1->SetMaximum(2);
1149 h2->SetMinimum(100);
1150// h2->SetMaximum(2);
1151 h3->SetMinimum(100);
1152 h4->SetMinimum(100);
1153 h5->SetMinimum(100);
1154
1155 h8->SetMinimum(0.);
1156 h8->SetMaximum(20.);
1157
1158 h0->SetMarkerStyle(22);
1159 h1->SetMarkerStyle(23);
1160 h2->SetMarkerStyle(24);
1161 h0->SetMarkerColor(2);
1162 h1->SetMarkerColor(1);
1163 h2->SetMarkerColor(4);
1164 h0->SetLineColor(2);
1165 h1->SetLineColor(1);
1166 h2->SetLineColor(4);
1167
1168 h3->SetMarkerStyle(22);
1169 h4->SetMarkerStyle(23);
1170 h5->SetMarkerStyle(24);
1171 h3->SetMarkerColor(2);
1172 h4->SetMarkerColor(1);
1173 h5->SetMarkerColor(4);
1174 h3->SetLineColor(2);
1175 h4->SetLineColor(1);
1176 h5->SetLineColor(4);
1177
1178 h6->SetMarkerStyle(22);
1179 h7->SetMarkerStyle(23);
1180 h8->SetMarkerStyle(24);
1181 h6->SetMarkerColor(2);
1182 h7->SetMarkerColor(1);
1183 h8->SetMarkerColor(4);
1184 h6->SetLineColor(2);
1185 h7->SetLineColor(1);
1186 h8->SetLineColor(4);
1187
1188 TCanvas *c=new TCanvas();
1189 c->SetLogy();
1190 c->SetGridy();
1191 h0->Draw("p");
1192 h1->Draw("psame");
1193 h2->Draw("psame");
1194c->BuildLegend(0.11,0.15,0.45,0.30);
1195 TLatex* ti1=new TLatex(0.11,0.40,"ITS standalone tracks (normalized to number of events)");
1196 ti1->SetNDC();
1197 ti1->SetTextColor(1);
1198 ti1->Draw();
1199 c->SaveAs("ITSsa_trend.pdf");
1200 pdfFileNames+=" ITSsa_trend.pdf";
1201 TCanvas *c2=new TCanvas();
1202 c2->SetLogy();
1203 c2->SetGridy();
1204 h3->Draw("p");
1205 h4->Draw("psame");
1206 h5->Draw("psame");
1207 c2->BuildLegend(0.11,0.15,0.45,0.30);
1208 TLatex* ti2=new TLatex(0.11,0.40,"ITS+TPC tracks (normalized to number of events)");
1209 ti2->SetNDC();
1210 ti2->SetTextColor(1);
1211 ti2->Draw();
1212 c2->SaveAs("ITSTPC_trend.pdf");
1213 pdfFileNames+=" ITSTPC_trend.pdf";
1214
1215 TCanvas *c3=new TCanvas();
1216 c3->SetGridy();
1217 h8->Draw("p");
1218 h7->Draw("psame");
1219 h6->Draw("psame");
1220 c3->BuildLegend();
1221 TLatex* ti3=new TLatex(0.15,0.8,"ratio (ITS+TPC)/ITS ");
1222 ti3->SetNDC();
1223 ti3->Draw();
1224 c3->SaveAs("tracks_ratio_trend.pdf");
1225 pdfFileNames+=" tracks_ratio_trend.pdf";
1226
1227}
1228
1229void AliITSQAtrend(TString runListFile,TString ntupleFileName){
1230
1231 TGrid::Connect("alien://");
1232
1233
1234
1235 //-----------SDD
1236
1237 const Int_t nVariables=35;
1238 TNtuple* ntsdd=new TNtuple("ntsdd","SDD trending","nrun:fracTrackWithClu1:errfracTrackWithClu1:fracTrackWithClu2:errfracTrackWithClu2:fracTrackWithClu3:errfracTrackWithClu3:fracTrackWithClu4:errfracTrackWithClu4:fracTrackWithClu5:errfracTrackWithClu5:fracTrackWithClu6:errfracTrackWithClu6:meanTrPts3:errmeanTrPts3:meanTrPts4:errmeanTrPts4:minDrTime:errminDrTime:meanDrTime:errmeanDrTime:fracExtra:errfracExtra:meandEdxLay3:errmeandEdxLay3:meandEdxLay4:errmeandEdxLay4:meandEdxTB0:errmeandEdxTB0:meandEdxTB5:errmeandEdxTB5:nMod95:nMod80:nMod60:nModEmpty");
1239 Float_t xnt[nVariables];
1240
1241 //--------------SSD
1242
1243 const Int_t nVariablesSSD=10;
1244 TNtuple* ntssd=new TNtuple("ntssd","SSD trending","nrun:meandEdxLay5:errmeandEdxLay5:meandEdxLay6:errmeandEdxLay6:ChargeRatioL5:errChargeratioL5:ChargeRatioL6:errChargeratioL6:moduleOff");
1245 Float_t xntSSD[nVariablesSSD];
1246
1247 //----Matching
1248
1249 const Int_t nVariablesMatching=60;
1250 TNtuple* ntmatching=new TNtuple("ntmatching","Matching Efficiency","nrun:FracSPD1:errFracSPD1:FracSPD2:errFracSPD2:Eff6Pt02:errEff6Pt02:Eff6Pt1:errEff6Pt1:Eff6Pt10:errEff6Pt10:Eff5Pt02:errEff5Pt02:Eff5Pt1:errEff5Pt1:Eff5Pt10:errEff5Pt10:Eff4Pt02:errEff4Pt02:Eff4Pt1:errEff4Pt1:Eff4Pt10:errEff4Pt10:Eff3Pt02:errEff3Pt02:Eff3Pt1:errEff3Pt1:Eff3Pt10:errEff3Pt10:Eff2Pt02:errEff2Pt02:Eff2Pt1:errEff2Pt1:Eff2Pt10:errEff2Pt10:EffSPDPt02:errEffSPDPt02:EffSPDPt1:errEffSPDPt1:EffSPDPt10:errEffSPDPt10:EffoneSPDPt02:errEffoneSPDPt02:EffoneSPDPt1:errEffoneSPDPt1:EffoneSPDPt10:errEffoneSPDPt10:EffTOTPt02:errEffTOTPt02:EffTOTPt1:errEffTOTPt1:EffTOTPt10:errEffTOTPt10");
1251
1252 Float_t xntMatching[nVariablesMatching];
1253
1254 //--------------------------------
1255
1256 //----QA Vertex
1257
1258 const Int_t nVariablesVertex=15;
1259 TNtuple* ntvertex=new TNtuple("ntvertex","QA Vertex","nrun:Vx:errVx:sigmaVx:errsigmaVx:Vy:errVy:sigmaVy:errsigmaVy:Vz:errVz:sigmaVz:errsigmaVz");
1260
1261 Float_t xntVertex[nVariablesVertex];
1262
1263 //--------------------------------
1264
1265 //----- Tracking ITS SA
1266 const Int_t nVariablesSA=13;
1267 Float_t xntSA[nVariablesSA];
1268 TNtuple *ntSA=new TNtuple("ntITSsa","ntITSsa","run:NITSTPCPtBin0:NITSTPCPtBin1:NITSTPCPtBin2:NITSsaPtBin0:NITSsaPtBin1:NITSsaPtBin2:NITSpureSAPtBin0:NITSpureSAPtBin1:NITSpureSAPtBin2:ratioPtBin0:ratioPtBin1:ratioPtBin2");
1269
1270 //---------------------------------
1271
1272
1273
1274 TBits* readRun=new TBits(999999);
1275 readRun->ResetAllBits();
1276 // if(!useExternalList){
1277 if(!gSystem->Exec(Form("ls -l %s > /dev/null 2>&1",ntupleFileName.Data()))){
1278 TFile* oldfil=new TFile(ntupleFileName.Data());
1279
1280 TNtuple* ntmp=(TNtuple*)oldfil->Get("ntsdd");
1281
1282 TNtuple* ntmpSSD=(TNtuple*)oldfil->Get("ntssd");
1283
1284 TNtuple* ntmpMatching=(TNtuple*)oldfil->Get("ntmatching");
1285
1286 TNtuple* ntmpVertex=(TNtuple*)oldfil->Get("ntvertex");
1287
1288 TNtuple* ntmpSA=(TNtuple*)oldfil->Get("ntITSsa");
1289
1290
1291 //-------SDD
1292
1293 Bool_t isOK=kFALSE;
1294 if(ntmp){
1295 if(ntmp->GetNvar()==ntsdd->GetNvar()){
1296 isOK=kTRUE;
1297 TObjArray* arr1=(TObjArray*)ntsdd->GetListOfBranches();
1298 TObjArray* arr2=(TObjArray*)ntmp->GetListOfBranches();
1299 for(Int_t iV=0; iV<ntmp->GetNvar(); iV++){
1300 TString vnam1=arr1->At(iV)->GetName();
1301 TString vnam2=arr2->At(iV)->GetName();
1302 if(vnam1!=vnam2) isOK=kFALSE;
1303 ntmp->SetBranchAddress(vnam2.Data(),&xnt[iV]);
1304 }
1305 if(isOK){
1306 for(Int_t nE=0; nE<ntmp->GetEntries(); nE++){
1307 ntmp->GetEvent(nE);
1308 Int_t theRun=(Int_t)(xnt[0]+0.0001);
1309 readRun->SetBitNumber(theRun);
1310 ntsdd->Fill(xnt);
1311 }
1312 }
1313 }
1314 }
1315 if(!isOK){
1316 printf("Ntuple in local file not OK -> will be recreated\n");
1317 }
1318
1319 //----------SSD----------
1320
1321 Bool_t isOKSSD=kFALSE;
1322 if(ntmpSSD){
1323 if(ntmpSSD->GetNvar()==ntssd->GetNvar()){
1324 isOKSSD=kTRUE;
1325 TObjArray* arr1ssd=(TObjArray*)ntssd->GetListOfBranches();
1326 TObjArray* arr2ssd=(TObjArray*)ntmpSSD->GetListOfBranches();
1327 for(Int_t iV=0; iV<ntmpSSD->GetNvar(); iV++){
1328 TString vnam1=arr1ssd->At(iV)->GetName();
1329 TString vnam2=arr2ssd->At(iV)->GetName();
1330 if(vnam1!=vnam2) isOKSSD=kFALSE;
1331 ntmpSSD->SetBranchAddress(vnam2.Data(),&xntSSD[iV]);
1332 }
1333 if(isOKSSD){
1334 for(Int_t nE=0; nE<ntmpSSD->GetEntries(); nE++){
1335 ntmpSSD->GetEvent(nE);
1336 Int_t theRun=(Int_t)(xntSSD[0]+0.0001);
1337 readRun->SetBitNumber(theRun);
1338 ntssd->Fill(xntSSD);
1339 }
1340 }
1341 }
1342 }
1343 if(!isOKSSD){
1344 printf("\n\nNtuple SSD in local file not OK -> will be recreated\n\n");
1345 }
1346
1347 //---------Matching---------
1348
1349 Bool_t isOKMatching=kFALSE;
1350 if(ntmpMatching){
1351 if(ntmpMatching->GetNvar()==ntmatching->GetNvar()){
1352 isOKMatching=kTRUE;
1353 TObjArray* arr1matching=(TObjArray*)ntmatching->GetListOfBranches();
1354 TObjArray* arr2matching=(TObjArray*)ntmpMatching->GetListOfBranches();
1355 for(Int_t iV=0; iV<ntmpMatching->GetNvar(); iV++){
1356 TString vnam1=arr1matching->At(iV)->GetName();
1357 TString vnam2=arr2matching->At(iV)->GetName();
1358 if(vnam1!=vnam2) isOKMatching=kFALSE;
1359 ntmpMatching->SetBranchAddress(vnam2.Data(),&xntMatching[iV]);
1360 }
1361 if(isOKMatching){
1362 for(Int_t nE=0; nE<ntmpMatching->GetEntries(); nE++){
1363 ntmpMatching->GetEvent(nE);
1364 Int_t theRun=(Int_t)(xntMatching[0]+0.0001);
1365 readRun->SetBitNumber(theRun);
1366 ntmatching->Fill(xntMatching);
1367 }
1368 }
1369 }
1370 }
1371 if(!isOKMatching){
1372 printf("\n\nNtuple Matching in local file not OK -> will be recreated\n\n");
1373 }
1374 //-----------------------
1375
1376 //---------Vertex QA---------
1377
1378 Bool_t isOKVertex=kFALSE;
1379 if(ntmpVertex){
1380 if(ntmpVertex->GetNvar()==ntvertex->GetNvar()){
1381 isOKVertex=kTRUE;
1382 TObjArray* arr1vertex=(TObjArray*)ntvertex->GetListOfBranches();
1383 TObjArray* arr2vertex=(TObjArray*)ntmpVertex->GetListOfBranches();
1384 for(Int_t iV=0; iV<ntmpVertex->GetNvar(); iV++){
1385 TString vnam1=arr1vertex->At(iV)->GetName();
1386 TString vnam2=arr2vertex->At(iV)->GetName();
1387 if(vnam1!=vnam2) isOKVertex=kFALSE;
1388 ntmpVertex->SetBranchAddress(vnam2.Data(),&xntVertex[iV]);
1389 }
1390 if(isOKVertex){
1391 for(Int_t nE=0; nE<ntmpVertex->GetEntries(); nE++){
1392 ntmpVertex->GetEvent(nE);
1393 Int_t theRun=(Int_t)(xntVertex[0]+0.0001);
1394 readRun->SetBitNumber(theRun);
1395 ntvertex->Fill(xntVertex);
1396 }
1397 }
1398 }
1399 }
1400 if(!isOKVertex){
1401 printf("\n\nNtuple Vertex in local file not OK -> will be recreated\n\n");
1402 }
1403 //-----------------------
1404
1405 //-----------Tracking SA ----------------
1406 Bool_t isOKSA = kFALSE;
1407 if(ntmpSA){
1408 if(ntmpSA->GetNvar()==ntSA->GetNvar()){
1409 isOKSA = kTRUE;
1410 TObjArray* arr1SA=(TObjArray*)ntSA->GetListOfBranches();
1411 TObjArray* arr2SA=(TObjArray*)ntmpSA->GetListOfBranches();
1412 for(Int_t iV=0; iV<ntmpSA->GetNvar(); iV++){
1413 TString vnam1=arr1SA->At(iV)->GetName();
1414 TString vnam2=arr2SA->At(iV)->GetName();
1415 if(vnam1!=vnam2) isOKSA=kFALSE;
1416 ntmpSA->SetBranchAddress(vnam2.Data(),&xntSA[iV]);
1417 }
1418 if(isOKSA){
1419 for(Int_t nE=0; nE<ntmpSA->GetEntries(); nE++){
1420 ntmpSA->GetEvent(nE);
1421 Int_t theRun=(Int_t)(xntSA[0]+0.0001);
1422 readRun->SetBitNumber(theRun);
1423 ntSA->Fill(xntSA);
1424 }
1425 }
1426 }
1427 }
1428
1429 oldfil->Close();
1430 delete oldfil;
1431 }
1432
1433#define MAX_LINES 200
1434#define MAX_LINE_LEN 255
1435
1436 char strings[MAX_LINES][MAX_LINE_LEN];
1437 ifstream in(runListFile.Data());
1438 int j = 0;
1439 Int_t nrun=0;
1440 Int_t runNumb[MAX_LINES];
1441 while ( in ) {
1442 in.getline(strings[j], MAX_LINE_LEN);
1443 TString aux(strings[j]);
1444 if(aux.Length()<27)continue;
1445 aux=aux.Remove(0,27);
1446 aux=aux.Remove(6,aux.Length());
1447 runNumb[j]=atoi(aux.Data());
1448 printf("%d ) - path %s \n",runNumb[j],strings[j]);
1449 j++;
1450 nrun++;
1451 }
1452
1453 printf("\n ******************* Loop on runs *********** \n");
1454 for(Int_t jru=0;jru<nrun;jru++) {
1455 printf("jru=%d - run number= %d \n",jru,runNumb[jru]);
1456 Int_t iRun=runNumb[jru];
1457 if(readRun->TestBitNumber(iRun))printf("Run %d - already processed\n",iRun);
1458 if(readRun->TestBitNumber(iRun))continue;
1459 //cout << "Value from file is " <<t << endl;
1460
1461 printf("%s\n",strings[jru]);
1462
1463
1464 if(!gGrid||!gGrid->IsConnected()) {
1465 printf("gGrid not found! exit macro\n");
1466 return;
1467 }
1468
1469 TFile *f=TFile::Open(Form("alien://%s",strings[jru]));
1470
1471 TDirectoryFile* df=(TDirectoryFile*)f->Get("SDD_Performance");
1472 if(!df){
1473 printf("Run %d SDD_Performance MISSING -> Exit\n",iRun);
1474 continue;
1475 }
1476
1477 TList* l=(TList*)df->Get("coutputRP");
1478 if(!df){
1479 printf("Run %d coutputRP TList MISSING -> Exit\n",iRun);
1480 continue;
1481 }
1482
1483 //-------------------
1484
1485
1486 //------------SDD
1487
1488 TH1F* hcllay=(TH1F*)l->FindObject("hCluInLay");
1489 Float_t fracT[6]={0.,0.,0.,0.,0.,0.};
1490 Float_t efracT[6]={0.,0.,0.,0.,0.,0.};
1491 if(hcllay->GetBinContent(1)>0){
1492 for(Int_t iLay=0; iLay<6; iLay++){
1493 fracT[iLay]=hcllay->GetBinContent(iLay+2)/hcllay->GetBinContent(1);
1494 efracT[iLay]=TMath::Sqrt(fracT[iLay]*(1-fracT[iLay])/hcllay->GetBinContent(1));
1495 }
1496 }
1497 TH1F* hmodT=(TH1F*)l->FindObject("hTPMod");
1498 TH1F* hgamod=(TH1F*)l->FindObject("hGAMod");
1499 Int_t bestMod=0;
1500 for(Int_t iMod=0; iMod<260;iMod++){
1501 Int_t gda=(Int_t)hgamod->GetBinContent(iMod+1);
1502 if(gda>bestMod) bestMod=gda;
1503 }
1504 Int_t nChunks=1;
1505 if(bestMod>512){
1506 nChunks=(Int_t)(bestMod/512.+0.5);
1507 }
1508 hgamod->Scale(1./nChunks);
1509
1510 TH1F* hev=(TH1F*)l->FindObject("hNEvents");
1511 Int_t nTotEvents=hev->GetBinContent(2);
1512 Int_t nTrigEvents=hev->GetBinContent(3);
1513 Int_t nEvents=nTotEvents;
1514 printf("Run %d Number of Events = %d Triggered=%d\n",iRun,nTotEvents,nTrigEvents);
1515 if(nTrigEvents>0){
1516 nEvents=nTrigEvents;
1517 }
1518 if(nTotEvents==0) continue;
1519 Int_t nModGood3=0;
1520 Int_t nModGood4=0;
1521 Int_t nModBadAn=0;
1522 Float_t sumtp3=0;
1523 Float_t sumtp4=0;
1524 Float_t sumEtp3=0;
1525 Float_t sumEtp4=0;
1526 for(Int_t iMod=0; iMod<260; iMod++){
1527 Float_t tps=hmodT->GetBinContent(iMod+1);
1528 Float_t ga=hgamod->GetBinContent(iMod+1);
1529 if(ga<500) nModBadAn++;
1530 Float_t tpsN=0.;
1531 Float_t etpsN=0.;
1532 if(ga>0){
1533 tpsN=tps/ga/(Float_t)nEvents;
1534 etpsN=TMath::Sqrt(tps)/ga/(Float_t)nEvents;
1535 if(iMod<84){
1536 sumtp3+=tpsN;
1537 sumEtp3+=(etpsN*etpsN);
1538 nModGood3++;
1539 }
1540 else{
1541 sumtp4+=tpsN;
1542 sumEtp4+=(etpsN*etpsN);
1543 nModGood4++;
1544 }
1545 }
1546 }
1547
1548 TH1F* hapmod=(TH1F*)l->FindObject("hAllPmod");
1549 TH1F* hgpmod=(TH1F*)l->FindObject("hGoodPmod");
1550 // TH1F* hmpmod=(TH1F*)l->FindObject("hMissPmod");
1551 TH1F* hbrmod=(TH1F*)l->FindObject("hBadRegmod");
1552 TH1F* hskmod=(TH1F*)l->FindObject("hSkippedmod");
1553 TH1F* hoamod=(TH1F*)l->FindObject("hOutAccmod");
1554 TH1F* hnrmod=(TH1F*)l->FindObject("hNoRefitmod");
1555 Int_t nBelow95=0;
1556 Int_t nBelow80=0;
1557 Int_t nBelow60=0;
1558 Int_t nZeroP=0;
1559 for(Int_t imod=0; imod<260;imod++){
1560 Float_t numer=hgpmod->GetBinContent(imod+1)+hbrmod->GetBinContent(imod+1)+hoamod->GetBinContent(imod+1)+hnrmod->GetBinContent(imod+1)+hskmod->GetBinContent(imod+1);
1561 Float_t denom=hapmod->GetBinContent(imod+1);
1562 if(denom>0){
1563 Float_t eff=numer/denom;
1564 if(eff<0.95) nBelow95++;
1565 if(eff<0.80) nBelow80++;
1566 if(eff<0.60) nBelow60++;
1567 }
1568 if(hmodT->GetBinContent(imod+1)<1.){
1569 nZeroP++;
1570 }
1571 }
1572
1573 TH1F* htimT=(TH1F*)l->FindObject("hDrTimTPAll");
1574 TH1F* htimTe=(TH1F*)l->FindObject("hDrTimTPExtra");
1575
1576 Double_t fracExtra=0.;
1577 Double_t errFracExtra=0.;
1578 if(htimT->GetEntries()>0){
1579 fracExtra=htimTe->GetEntries()/htimT->GetEntries();
1580 errFracExtra=TMath::Sqrt(htimTe->GetEntries())/htimT->GetEntries();
1581 }
1582 Double_t averPoints=0.;
1583 Double_t cntBins=0.;
1584 for(Int_t iBin=1; iBin<=htimT->GetNbinsX(); iBin++){
1585 Float_t tim=htimT->GetBinCenter(iBin);
1586 if(tim>2000. && tim<4000.){
1587 averPoints+=htimT->GetBinContent(iBin);
1588 cntBins+=1;
1589 }
1590 }
1591 Double_t minTime=-999.;
1592 Double_t errMinTime=0.;
1593 if(cntBins>0){
1594 averPoints/=cntBins;
1595 for(Int_t iBin=1; iBin<=htimT->GetNbinsX(); iBin++){
1596 if(htimT->GetBinContent(iBin)>0.5*averPoints){
1597 minTime=htimT->GetBinCenter(iBin);
1598 errMinTime=0.5*htimT->GetBinWidth(iBin);
1599 break;
1600 }
1601 }
1602 }
1603
1604 TH2F* hdedxmod=(TH2F*)l->FindObject("hdEdxVsMod");
1605 TH1D* hdedxLay3=hdedxmod->ProjectionY("hdedxLay3",1,84);
1606 TH1D* hdedxLay4=hdedxmod->ProjectionY("hdedxLay4",85,260);
1607
1608 TH1F* hSigTim0=(TH1F*)l->FindObject("hSigTimeInt0");
1609 TH1F* hSigTim5=(TH1F*)l->FindObject("hSigTimeInt5");
1610
1611 Int_t index=0;
1612 xnt[index++]=iRun;
1613 xnt[index++]=fracT[0];
1614 xnt[index++]=efracT[0];
1615 xnt[index++]=fracT[1];
1616 xnt[index++]=efracT[1];
1617 xnt[index++]=fracT[2];
1618 xnt[index++]=efracT[2];
1619 xnt[index++]=fracT[3];
1620 xnt[index++]=efracT[3];
1621 xnt[index++]=fracT[4];
1622 xnt[index++]=efracT[4];
1623 xnt[index++]=fracT[5];
1624 xnt[index++]=efracT[5];
1625 xnt[index++]=sumtp3/nModGood3;
1626 xnt[index++]=TMath::Sqrt(sumEtp3)/nModGood3;
1627 xnt[index++]=sumtp4/nModGood4;
1628 xnt[index++]=TMath::Sqrt(sumEtp4)/nModGood4;
1629 xnt[index++]=minTime;
1630 xnt[index++]=errMinTime;
1631 xnt[index++]=htimT->GetMean();
1632 xnt[index++]=htimT->GetMeanError();
1633 xnt[index++]=fracExtra;
1634 xnt[index++]=errFracExtra;
1635 xnt[index++]=hdedxLay3->GetMean();
1636 xnt[index++]=hdedxLay3->GetMeanError();
1637 xnt[index++]=hdedxLay4->GetMean();
1638 xnt[index++]=hdedxLay4->GetMeanError();
1639 xnt[index++]=hSigTim0->GetMean();
1640 xnt[index++]=hSigTim0->GetMeanError();
1641 xnt[index++]=hSigTim5->GetMean();
1642 xnt[index++]=hSigTim5->GetMeanError();
1643 xnt[index++]=(Float_t)nBelow95;
1644 xnt[index++]=(Float_t)nBelow80;
1645 xnt[index++]=(Float_t)nBelow60;
1646 xnt[index++]=(Float_t)nZeroP;
1647 ntsdd->Fill(xnt);
1648
1649 cout<<"\n\nirun sDD"<<iRun<<endl<<endl;
1650
1651 //-------SSD
1652
1653 //TFile* fSSD=TFile::Open(fileNameLong.Data());
1654
1655 //TDirectoryFile* dfSSD=(TDirectoryFile*)fSSD->Get("PWG1dEdxSSDQA");
1656 TDirectoryFile* dfSSD=(TDirectoryFile*)f->Get("PWG1dEdxSSDQA");
1657 if(!dfSSD){
1658 printf("Run %d SDD_Performance MISSING -> Exit\n",iRun);
1659 continue;
1660 }
1661
1662 TList* lSSD=(TList*)dfSSD->Get("SSDdEdxQA");
1663 if(!dfSSD){
1664 printf("Run %d coutputRP TList MISSING -> Exit\n",iRun);
1665 continue;
1666 }
1667 //
1668
1669 TH2F* QAchargeRatio=(TH2F*)lSSD->FindObject("QAChargeRatio");
1670 TH2F* QAcharge=(TH2F*)lSSD->FindObject("QACharge");
1671
1672 Int_t biny = QAcharge->GetXaxis()->FindBin(747);
1673 Int_t maxy = QAcharge->GetXaxis()->GetXmax();
1674 // Int_t miny = QAcharge->GetXaxis()->GetXmin();
1675
1676 Int_t contEmpty=0;
1677 Int_t contFull=0;
1678
1679 TH1D *hChargeL5=QAcharge->ProjectionY("hChargeL5",0,biny);
1680 TH1D *hChargeL6=QAcharge->ProjectionY("hChargeL6",biny,maxy);
1681
1682 cout<< hChargeL5->GetMean()<< " " << hChargeL5->GetRMS()<<endl;
1683 cout<< hChargeL6->GetMean()<< " " << hChargeL6->GetRMS()<<endl;
1684
1685 TH1D *hChargeRatioL5=QAchargeRatio->ProjectionY("hChargeRatioL5",0,biny);
1686 TH1D *hChargeRatioL6=QAchargeRatio->ProjectionY("hChargeRatioL6",biny,maxy);
1687
1688 cout<< hChargeRatioL5->GetMean()<< " " << hChargeRatioL5->GetRMS()<<endl;
1689 cout<< hChargeRatioL6->GetMean()<< " " << hChargeRatioL6->GetRMS()<<endl;
1690
1691 if(QAcharge->GetEntries()< 45000)
1692 contEmpty=1;
1693
1694 else{
1695 for(Int_t i =0;i<1698;i++){
1696
1697 TString tmpQ("Q");
1698 tmpQ+=i;
1699
1700 TH1D* fHist1DQ= QAcharge->ProjectionY(tmpQ,i+1,i+1);
1701 Double_t mean=fHist1DQ->GetMean();
1702
1703 if(TMath::Abs(mean)<1.0 ||fHist1DQ->GetEntries()<10)
1704 contEmpty++;
1705
1706 else
1707 contFull++;
1708
1709 }
1710 }
1711
1712 cout<<"contFull: " <<contFull<<" contEmpty: "<<contEmpty<<endl;
1713 cout<<hChargeL5->GetMean()<<endl;
1714
1715 Int_t indexSSD=0;
1716 xntSSD[indexSSD++]=iRun;
1717 xntSSD[indexSSD++]=(Float_t)hChargeL5->GetMean();
1718 xntSSD[indexSSD++]=(Float_t)hChargeL5->GetMeanError();
1719 xntSSD[indexSSD++]=(Float_t)hChargeL6->GetMean();
1720 xntSSD[indexSSD++]=(Float_t)hChargeL6->GetMeanError();
1721 xntSSD[indexSSD++]=(Float_t)hChargeRatioL5->GetMean();
1722 xntSSD[indexSSD++]=(Float_t)hChargeRatioL5->GetMeanError();
1723 xntSSD[indexSSD++]=(Float_t)hChargeRatioL6->GetMean();
1724 xntSSD[indexSSD++]=(Float_t)hChargeRatioL6->GetMeanError();
1725 xntSSD[indexSSD++]=(Float_t)contEmpty;
1726 ntssd->Fill(xntSSD);
1727
1728 cout<<xnt<<endl<<endl;
1729
1730 cout<<"\n\nirun ssd "<<iRun<<endl<<endl;
1731
1732 cout<< iRun<<" "<<hChargeL5->GetMean()<<" "<< hChargeL5->GetRMS()<<" "<<hChargeL6->GetMean()<<" "<<hChargeRatioL5->GetMean()<<" "<<" "<<hChargeRatioL5->GetRMS()<<" "<<hChargeRatioL6->GetMean()<<" "<<hChargeRatioL6->GetRMS()<<" "<<contEmpty<<endl;
1733
1734 cout<<xntSSD[0]<<" "<<xntSSD[1]<<" "<<xntSSD[2]<<" "<<xntSSD[3]<<endl;;
1735
1736 //--------------matching
1737
1738 TDirectoryFile *dirMatch=(TDirectoryFile*)f->GetDirectory("ITS_Performance");
1739 TList *list=NULL;
1740 TList *listSPD=NULL;
1741
1742 if(dirMatch) list = (TList*)dirMatch->Get("cOutputITS_3500_10000");
1743 dirMatch=(TDirectoryFile*)f->GetDirectory("SPD_Performance");
1744 if(dirMatch) listSPD = (TList*)dirMatch->Get("coutput1");
1745
1746 // if(!list) return kFALSE;
1747
1748 Float_t ioValues[30];
1749 Float_t ioErrors[30];
1750 for(Int_t jj=0;jj<30;jj++){
1751 ioValues[jj]=0.;
1752 ioErrors[jj]=0.;
1753 }
1754
1755 Float_t ptbin=0;
1756
1757 TH1F *hFiredChip = (TH1F*)listSPD->FindObject("hFiredChip");
1758 Int_t nHSsInner=0,nHSsOuter=0;
1759 for(Int_t i=0;i<400;i++) if(hFiredChip->GetBinContent(i)>0) nHSsInner++;
1760 for(Int_t i=400;i<1200;i++) if(hFiredChip->GetBinContent(i)>0) nHSsOuter++;
1761 nHSsInner = (Int_t)(nHSsInner/10);
1762 nHSsOuter = (Int_t)(nHSsOuter/10);
1763 // hnHSsSPD->SetBinContent(1,nHSsInner);
1764 // hnHSsSPD->SetBinContent(2,nHSsOuter);
1765
1766 ioValues[0]=(Float_t)nHSsInner/40.;
1767 ioValues[1]=(Float_t)nHSsOuter/80.;
1768
1769 TH1F *fHistPtTPCInAcc = (TH1F*)list->FindObject("fHistPtTPCInAcc");
1770
1771 TH1F *fHistPtITSMI6InAcc = (TH1F*)list->FindObject("fHistPtITSMI6InAcc");
1772 TH1F *fHistPtITSMI5InAcc = (TH1F*)list->FindObject("fHistPtITSMI5InAcc");
1773 TH1F *fHistPtITSMI4InAcc = (TH1F*)list->FindObject("fHistPtITSMI4InAcc");
1774 TH1F *fHistPtITSMI3InAcc = (TH1F*)list->FindObject("fHistPtITSMI3InAcc");
1775 TH1F *fHistPtITSMI2InAcc = (TH1F*)list->FindObject("fHistPtITSMI2InAcc");
1776 TH1F *fHistPtITSMISPDInAcc = (TH1F*)list->FindObject("fHistPtITSMISPDInAcc");
1777 TH1F *fHistPtITSMIoneSPDInAcc = (TH1F*)list->FindObject("fHistPtITSMIoneSPDInAcc");
1778
1779
1780 TH1F *fHistPtITSMIge2InAcc = (TH1F*)fHistPtITSMI6InAcc->Clone("fHistPtITSMIge2InAcc");
1781 fHistPtITSMIge2InAcc->Add(fHistPtITSMI5InAcc);
1782 fHistPtITSMIge2InAcc->Add(fHistPtITSMI4InAcc);
1783 fHistPtITSMIge2InAcc->Add(fHistPtITSMI3InAcc);
1784 fHistPtITSMIge2InAcc->Add(fHistPtITSMI2InAcc);
1785
1786
1787
1788 fHistPtITSMI6InAcc->Divide(fHistPtITSMI6InAcc,fHistPtTPCInAcc,1,1,"B");
1789 ptbin=fHistPtITSMI6InAcc->FindBin(0.201);
1790 ioValues[2]=fHistPtITSMI6InAcc->GetBinContent(ptbin);
1791 ioErrors[2]=fHistPtITSMI6InAcc->GetBinError(ptbin);
1792 ptbin=fHistPtITSMI6InAcc->FindBin(1.001);
1793 ioValues[3]=fHistPtITSMI6InAcc->GetBinContent(ptbin);
1794 ioErrors[3]=fHistPtITSMI6InAcc->GetBinError(ptbin);
1795 ptbin=fHistPtITSMI6InAcc->FindBin(10.001);
1796 ioValues[4]=fHistPtITSMI6InAcc->GetBinContent(ptbin);
1797 ioErrors[4]=fHistPtITSMI6InAcc->GetBinError(ptbin);
1798
1799 fHistPtITSMI5InAcc->Divide(fHistPtITSMI5InAcc,fHistPtTPCInAcc,1,1,"B");
1800
1801 ptbin=fHistPtITSMI5InAcc->FindBin(0.201);
1802 ioValues[5]=fHistPtITSMI5InAcc->GetBinContent(ptbin);
1803 ioErrors[5]=fHistPtITSMI5InAcc->GetBinError(ptbin);
1804 ptbin=fHistPtITSMI5InAcc->FindBin(1.001);
1805 ioValues[6]=fHistPtITSMI5InAcc->GetBinContent(ptbin);
1806 ioErrors[6]=fHistPtITSMI5InAcc->GetBinError(ptbin);
1807 ptbin=fHistPtITSMI5InAcc->FindBin(10.001);
1808 ioValues[7]=fHistPtITSMI5InAcc->GetBinContent(ptbin);
1809 ioErrors[7]=fHistPtITSMI5InAcc->GetBinError(ptbin);
1810
1811 fHistPtITSMI4InAcc->Divide(fHistPtITSMI4InAcc,fHistPtTPCInAcc,1,1,"B");
1812
1813 ptbin=fHistPtITSMI4InAcc->FindBin(0.201);
1814 ioValues[9]=fHistPtITSMI4InAcc->GetBinContent(ptbin);
1815 ioErrors[9]=fHistPtITSMI4InAcc->GetBinError(ptbin);
1816 ptbin=fHistPtITSMI4InAcc->FindBin(1.001);
1817 ioValues[10]=fHistPtITSMI4InAcc->GetBinContent(ptbin);
1818 ioErrors[10]=fHistPtITSMI4InAcc->GetBinError(ptbin);
1819 ptbin=fHistPtITSMI4InAcc->FindBin(10.001);
1820 ioValues[11]=fHistPtITSMI4InAcc->GetBinContent(ptbin);
1821 ioErrors[11]=fHistPtITSMI4InAcc->GetBinError(ptbin);
1822
1823 fHistPtITSMI3InAcc->Divide(fHistPtITSMI3InAcc,fHistPtTPCInAcc,1,1,"B");
1824
1825 ptbin=fHistPtITSMI3InAcc->FindBin(0.201);
1826 ioValues[12]=fHistPtITSMI3InAcc->GetBinContent(ptbin);
1827 ioErrors[12]=fHistPtITSMI3InAcc->GetBinError(ptbin);
1828 ptbin=fHistPtITSMI3InAcc->FindBin(1.001);
1829 ioValues[13]=fHistPtITSMI3InAcc->GetBinContent(ptbin);
1830 ioErrors[13]=fHistPtITSMI3InAcc->GetBinError(ptbin);
1831 ptbin=fHistPtITSMI3InAcc->FindBin(10.001);
1832 ioValues[14]=fHistPtITSMI3InAcc->GetBinContent(ptbin);
1833 ioErrors[14]=fHistPtITSMI3InAcc->GetBinError(ptbin);
1834
1835 fHistPtITSMI2InAcc->Divide(fHistPtITSMI2InAcc,fHistPtTPCInAcc,1,1,"B");
1836
1837 ptbin=fHistPtITSMI2InAcc->FindBin(0.201);
1838 ioValues[15]=fHistPtITSMI2InAcc->GetBinContent(ptbin);
1839 ioErrors[15]=fHistPtITSMI2InAcc->GetBinError(ptbin);
1840 ptbin=fHistPtITSMI2InAcc->FindBin(1.001);
1841 ioValues[16]=fHistPtITSMI2InAcc->GetBinContent(ptbin);
1842 ioErrors[16]=fHistPtITSMI2InAcc->GetBinError(ptbin);
1843 ptbin=fHistPtITSMI2InAcc->FindBin(10.001);
1844 ioValues[17]=fHistPtITSMI2InAcc->GetBinContent(ptbin);
1845 ioErrors[17]=fHistPtITSMI2InAcc->GetBinError(ptbin);
1846
1847 fHistPtITSMISPDInAcc->Divide(fHistPtITSMISPDInAcc,fHistPtTPCInAcc,1,1,"B");
1848 ptbin=fHistPtITSMISPDInAcc->FindBin(0.201);
1849 ioValues[18]=fHistPtITSMISPDInAcc->GetBinContent(ptbin);
1850 ioErrors[18]=fHistPtITSMISPDInAcc->GetBinError(ptbin);
1851 ptbin=fHistPtITSMISPDInAcc->FindBin(1.001);
1852 ioValues[19]=fHistPtITSMISPDInAcc->GetBinContent(ptbin);
1853 ioErrors[19]=fHistPtITSMISPDInAcc->GetBinError(ptbin);
1854 ptbin=fHistPtITSMISPDInAcc->FindBin(10.001);
1855 ioValues[20]=fHistPtITSMISPDInAcc->GetBinContent(ptbin);
1856 ioErrors[20]=fHistPtITSMISPDInAcc->GetBinError(ptbin);
1857
1858 fHistPtITSMIoneSPDInAcc->Divide(fHistPtITSMIoneSPDInAcc,fHistPtTPCInAcc,1,1,"B");
1859
1860 ptbin=fHistPtITSMIoneSPDInAcc->FindBin(0.201);
1861 ioValues[21]=fHistPtITSMIoneSPDInAcc->GetBinContent(ptbin);
1862 ioErrors[21]=fHistPtITSMIoneSPDInAcc->GetBinError(ptbin);
1863 ptbin=fHistPtITSMIoneSPDInAcc->FindBin(1.001);
1864 ioValues[22]=fHistPtITSMIoneSPDInAcc->GetBinContent(ptbin);
1865 ioErrors[22]=fHistPtITSMIoneSPDInAcc->GetBinError(ptbin);
1866 ptbin=fHistPtITSMIoneSPDInAcc->FindBin(10.001);
1867 ioValues[23]=fHistPtITSMIoneSPDInAcc->GetBinContent(ptbin);
1868 ioErrors[23]=fHistPtITSMIoneSPDInAcc->GetBinError(ptbin);
1869
1870
1871 fHistPtITSMIge2InAcc->Divide(fHistPtITSMIge2InAcc,fHistPtTPCInAcc,1,1,"B");
1872 ptbin=fHistPtITSMIge2InAcc->FindBin(0.201);
1873 ioValues[24]=fHistPtITSMIge2InAcc->GetBinContent(ptbin);
1874 ioErrors[24]=fHistPtITSMIge2InAcc->GetBinError(ptbin);
1875 ptbin=fHistPtITSMIge2InAcc->FindBin(1.001);
1876 ioValues[25]=fHistPtITSMIge2InAcc->GetBinContent(ptbin);
1877 ioErrors[25]=fHistPtITSMIge2InAcc->GetBinError(ptbin);
1878 ptbin=fHistPtITSMIge2InAcc->FindBin(10.001);
1879 ioValues[26]=fHistPtITSMIge2InAcc->GetBinContent(ptbin);
1880 ioErrors[26]=fHistPtITSMIge2InAcc->GetBinError(ptbin);
1881
1882 Int_t indexMatching=0;
1883 xntMatching[indexMatching++]=iRun;
1884 xntMatching[indexMatching++]=ioValues[0];
1885 xntMatching[indexMatching++]=ioErrors[0];
1886 xntMatching[indexMatching++]=ioValues[1];
1887 xntMatching[indexMatching++]=ioErrors[1];
1888 xntMatching[indexMatching++]=ioValues[2];
1889 xntMatching[indexMatching++]=ioErrors[2];
1890 xntMatching[indexMatching++]=ioValues[3];
1891 xntMatching[indexMatching++]=ioErrors[3];
1892 xntMatching[indexMatching++]=ioValues[4];
1893 xntMatching[indexMatching++]=ioErrors[4];
1894 xntMatching[indexMatching++]=ioValues[5];
1895 xntMatching[indexMatching++]=ioErrors[5];
1896 xntMatching[indexMatching++]=ioValues[6];
1897 xntMatching[indexMatching++]=ioErrors[6];
1898 xntMatching[indexMatching++]=ioValues[7];
1899 xntMatching[indexMatching++]=ioErrors[7];
1900 xntMatching[indexMatching++]=ioValues[8];
1901 xntMatching[indexMatching++]=ioErrors[8];
1902 xntMatching[indexMatching++]=ioValues[9];
1903 xntMatching[indexMatching++]=ioErrors[9];
1904 xntMatching[indexMatching++]=ioValues[10];
1905 xntMatching[indexMatching++]=ioErrors[10];
1906 xntMatching[indexMatching++]=ioValues[11];
1907 xntMatching[indexMatching++]=ioErrors[11];
1908 xntMatching[indexMatching++]=ioValues[12];
1909 xntMatching[indexMatching++]=ioErrors[12];
1910 xntMatching[indexMatching++]=ioValues[13];
1911 xntMatching[indexMatching++]=ioErrors[13];
1912 xntMatching[indexMatching++]=ioValues[14];
1913 xntMatching[indexMatching++]=ioErrors[14];
1914 xntMatching[indexMatching++]=ioValues[15];
1915 xntMatching[indexMatching++]=ioErrors[15];
1916 xntMatching[indexMatching++]=ioValues[16];
1917 xntMatching[indexMatching++]=ioErrors[16];
1918 xntMatching[indexMatching++]=ioValues[17];
1919 xntMatching[indexMatching++]=ioErrors[17];
1920 xntMatching[indexMatching++]=ioValues[18];
1921 xntMatching[indexMatching++]=ioErrors[18];
1922 xntMatching[indexMatching++]=ioValues[19];
1923 xntMatching[indexMatching++]=ioErrors[19];
1924 xntMatching[indexMatching++]=ioValues[20];
1925 xntMatching[indexMatching++]=ioErrors[20];
1926 xntMatching[indexMatching++]=ioValues[21];
1927 xntMatching[indexMatching++]=ioErrors[21];
1928 xntMatching[indexMatching++]=ioValues[22];
1929 xntMatching[indexMatching++]=ioErrors[22];
1930 xntMatching[indexMatching++]=ioValues[23];
1931 xntMatching[indexMatching++]=ioErrors[23];
1932 xntMatching[indexMatching++]=ioValues[24];
1933 xntMatching[indexMatching++]=ioErrors[24];
1934 xntMatching[indexMatching++]=ioValues[25];
1935 xntMatching[indexMatching++]=ioErrors[25];
1936 xntMatching[indexMatching++]=ioValues[26];
1937 xntMatching[indexMatching++]=ioErrors[26];
1938
1939 ntmatching->Fill(xntMatching);
1940
1941 //---------------------------
1942
1943 TDirectoryFile *dirVertex = (TDirectoryFile*)f->Get("Vertex_Performance");
1944 if(!dirVertex){
1945 Printf("Vertex directory not found... check!");
1946 }
1947
1948 TList *lt = (TList*)dirVertex->Get("cOutputVtxESD");
1949
1950 TH1F *xVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexX");
1951 TH1F *yVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexY");
1952 TH1F *zVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexZ");
1953
1954 TF1 *fxTRK = new TF1("gausx", "gaus", -1, 1);
1955 xVtxTRK->Fit("gausx", "M");
1956
1957 TF1 *fyTRK = new TF1("gausy", "gaus", -1, 1);
1958 yVtxTRK->Fit("gausy","M");
1959 cout<<fyTRK->GetParameter(1)<<endl;
1960 cout<<fyTRK->GetParError(1)<<endl;
1961 cout<<fyTRK->GetParameter(2)<<endl;
1962 cout<<fyTRK->GetParError(2)<<endl;
1963
1964 TF1 *fzTRK = new TF1("gausz", "gaus", -1, 1);
1965 zVtxTRK->Fit("gausz","M");
1966 cout<<fzTRK->GetParameter(1)<<endl;
1967 cout<<fzTRK->GetParError(1)<<endl;
1968 cout<<fzTRK->GetParameter(2)<<endl;
1969 cout<<fzTRK->GetParError(2)<<endl;
1970
1971
1972 Int_t indexVertex=0;
1973 xntVertex[indexVertex++]=iRun;
1974 xntVertex[indexVertex++]=(Float_t)fxTRK->GetParameter(1);
1975 xntVertex[indexVertex++]=(Float_t)fxTRK->GetParError(1);
1976 xntVertex[indexVertex++]=(Float_t)fxTRK->GetParameter(2);
1977 xntVertex[indexVertex++]=(Float_t)fxTRK->GetParError(2);
1978 xntVertex[indexVertex++]=(Float_t)fyTRK->GetParameter(1);
1979 xntVertex[indexVertex++]=(Float_t)fyTRK->GetParError(1);
1980 xntVertex[indexVertex++]=(Float_t)fyTRK->GetParameter(2);
1981 xntVertex[indexVertex++]=(Float_t)fyTRK->GetParError(2);
1982 xntVertex[indexVertex++]=(Float_t)fzTRK->GetParameter(1);
1983 xntVertex[indexVertex++]=(Float_t)fzTRK->GetParError(1);
1984 xntVertex[indexVertex++]=(Float_t)fzTRK->GetParameter(2);
1985 xntVertex[indexVertex++]=(Float_t)fzTRK->GetParError(2);
1986 ntvertex->Fill(xntVertex);
1987
1988
1989
1990 //---------------------------
1991
1992 //-------------- ITS SA ---------------
1993
1994 FillITSSAntuple(f,ntSA,iRun);
1995
1996 } // loop on runs
1997
1998 TFile* outfil=new TFile(ntupleFileName.Data(),"recreate");
1999 outfil->cd();
2000 ntsdd->Write();
2001 ntssd->Write();
2002 ntmatching->Write();
2003 ntvertex->Write();
2004 ntSA->Write();
2005 outfil->Close();
2006 delete outfil;
2007 delete ntsdd;
2008 delete ntssd;
2009 delete ntmatching;
2010 delete ntvertex;
2011 delete ntSA;
2012
2013}
2014
2015//____________________________________________________________________________
2016void FillITSSAntuple(TFile* f,TNtuple* nt, Int_t nrun){
2017 static const Int_t nVariables=13;
2018 static Float_t xnt[nVariables];
2019 TH1F *hPtTPCITS=0x0;
2020 TH1F *hPtITSsa=0x0;
2021 TH1F *hPtITSpureSA=0x0;
2022 Double_t Lowbin[3]={0.1,0.5,0.9};
2023 Double_t Upbin[3]={0.2,0.6,1};
2024 Double_t NTPCITS[3];
2025 Double_t NITSsa[3];
2026 Double_t NITSpureSA[3];
2027 Double_t Ratio[3];
2028 TDirectory *dirFile=(TDirectory*)f->Get("ITSsaTracks");
2029 TList *cOutput = (TList*)dirFile->Get("clistITSsaTracks");
2030 // histogram with number of events: in the first cell there is the number of the events
2031 // in the second, the number of events with SPD vertex.
2032 // normalization will be done to the second number
2033 TH1F *hnev =(TH1F*)cOutput->FindObject("hNEvents");
2034 Double_t noEvents = hnev->GetBinContent(1);
2035 if(noEvents<1.)noEvents=1.; // protection to avoid division by zero
2036 hPtTPCITS=(TH1F*)cOutput->FindObject("hPtTPCITS");
2037 hPtITSsa=(TH1F*)cOutput->FindObject("hPtITSsa");
2038 hPtITSpureSA=(TH1F*)cOutput->FindObject("hPtITSpureSA");
2039
2040 for(Int_t ibin=0;ibin<=2;ibin++){
2041 NTPCITS[ibin]=hPtTPCITS->Integral(hPtTPCITS->FindBin(Lowbin[ibin]),hPtTPCITS->FindBin(Upbin[ibin]))/noEvents;
2042 NITSsa[ibin]=hPtITSsa->Integral(hPtITSsa->FindBin(Lowbin[ibin]),hPtITSsa->FindBin(Upbin[ibin]))/noEvents;
2043 NITSpureSA[ibin]=hPtITSpureSA->Integral(hPtITSpureSA->FindBin(Lowbin[ibin]),hPtITSpureSA->FindBin(Upbin[ibin]))/noEvents;
2044 if(NTPCITS[ibin]!=0 && NITSsa[ibin]!=0)Ratio[ibin]=NTPCITS[ibin]/NITSsa[ibin];
2045 else Ratio[ibin]=0;
2046 }
2047
2048 Int_t index=0;
2049 xnt[index++]=(Float_t)nrun;
2050 xnt[index++]=NTPCITS[0];
2051 xnt[index++]=NTPCITS[1];
2052 xnt[index++]=NTPCITS[2];
2053 xnt[index++]=NITSsa[0];
2054 xnt[index++]=NITSsa[1];
2055 xnt[index++]=NITSsa[2];
2056 xnt[index++]=NITSpureSA[0];
2057 xnt[index++]=NITSpureSA[1];
2058 xnt[index++]=NITSpureSA[2];
2059 xnt[index++]=Ratio[0];
2060 xnt[index++]=Ratio[1];
2061 xnt[index++]=Ratio[2];
2062 nt->Fill(xnt);
2063}