1 /* created by fbellini@cern.ch on 14/09/2010 */
2 /* last modified by fbellini on 18/06/2012 */
5 #ifndef ALIANALYSISTASKTOFQA_CXX
6 #define ALIANALYSISTASKTOFQA_CXX
14 #include "AliAnalysisTaskSE.h"
15 #include "AliAnalysisManager.h"
16 #include "AliESDEvent.h"
17 #include "AliESDInputHandler.h"
18 #include "AliESDpid.h"
19 #include "AliTOFPIDParams.h"
20 #include "AliCDBManager.h"
21 #include "AliTOFcalib.h"
22 #include "AliTOFT0maker.h"
23 #include "AliTOFT0v1.h"
24 #include "AliAnalysisTaskTOFqa.h"
25 #include "AliAnalysisFilter.h"
26 #include "AliESDtrackCuts.h"
28 #include "AliTOFRawStream.h"
29 #include "AliTOFGeometry.h"
31 ClassImp(AliAnalysisTaskTOFqa)
33 //________________________________________________________________________
34 AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa() :
39 fESDpid(new AliESDpid()),
40 // fTOFT0v1(new AliTOFT0v1(fESDpid)),
42 fEnableAdvancedCheck(kFALSE),
43 fExpTimeBinWidth(24.4),
44 fExpTimeRangeMin(-25010.),
45 fExpTimeRangeMax(25010.),
46 fExpTimeSmallRangeMin(-5002.),
47 fExpTimeSmallRangeMax(5002.),
49 fMyTimeZeroTOFsigma(1e20),
50 fMyTimeZeroTOFtracks(-1),
57 // Default constructor
59 for (Int_t j=0;j<3;j++ ) {
66 //________________________________________________________________________
67 AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa(const char *name) :
68 AliAnalysisTaskSE(name),
73 fESDpid(new AliESDpid()),
74 // fTOFT0v1(new AliTOFT0v1(fESDpid)),
76 fEnableAdvancedCheck(kFALSE),
77 fExpTimeBinWidth(24.4),
78 fExpTimeRangeMin(-25010.),
79 fExpTimeRangeMax(25010.),
80 fExpTimeSmallRangeMin(-5002.),
81 fExpTimeSmallRangeMax(5002.),
83 fMyTimeZeroTOFsigma(1e20),
84 fMyTimeZeroTOFtracks(-1),
92 // Define input and output slots here
93 Info("AliAnalysisTaskTOFqa","Calling Constructor");
95 for (Int_t j=0;j<5;j++ ) {
101 // Input slot #0 works with a TChain
102 DefineInput(0, TChain::Class());
104 // Output slot #0 writes into a TH1 container
105 // Output slot #1 writes into a user defined container
106 DefineOutput(1, TList::Class());
107 DefineOutput(2, TList::Class());
108 DefineOutput(3, TList::Class());
109 DefineOutput(4, TList::Class());
110 DefineOutput(5, TList::Class());
113 //________________________________________________________________________
114 AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa(const AliAnalysisTaskTOFqa& copy)
115 : AliAnalysisTaskSE(),
116 fRunNumber(copy.fRunNumber),
118 fTrackFilter(copy.fTrackFilter),
119 fVertex(copy.fVertex),
120 fESDpid(copy.fESDpid),
121 // fTOFT0v1(copy.fTOFT0v1),
122 fNTOFtracks(copy.fNTOFtracks),
123 fEnableAdvancedCheck(copy.fEnableAdvancedCheck),
124 fExpTimeBinWidth(copy.fExpTimeBinWidth),
125 fExpTimeRangeMin(copy.fExpTimeRangeMin),
126 fExpTimeRangeMax(copy.fExpTimeRangeMax),
127 fExpTimeSmallRangeMin(copy.fExpTimeSmallRangeMin),
128 fExpTimeSmallRangeMax(copy.fExpTimeSmallRangeMax),
129 fMyTimeZeroTOF(copy.fMyTimeZeroTOF),
130 fMyTimeZeroTOFsigma(copy.fMyTimeZeroTOFsigma),
131 fMyTimeZeroTOFtracks(copy.fMyTimeZeroTOFtracks),
133 fHlistTimeZero(copy.fHlistTimeZero),
134 fHlistPID(copy.fHlistPID),
139 for (Int_t j=0;j<5;j++ ) {
140 if (j<3) fT0[j]=copy.fT0[j];
141 fSigmaSpecie[j]=copy.fSigmaSpecie[j];
142 fTrkExpTimes[j]=copy.fTrkExpTimes[j];
143 fThExpTimes[j]=copy.fThExpTimes[j];
149 //___________________________________________________________________________
150 AliAnalysisTaskTOFqa& AliAnalysisTaskTOFqa::operator=(const AliAnalysisTaskTOFqa& copy)
153 // Assignment operator
156 AliAnalysisTaskSE::operator=(copy) ;
157 fRunNumber=copy.fRunNumber;
159 fTrackFilter=copy.fTrackFilter;
160 fVertex=copy.fVertex;
161 fESDpid=copy.fESDpid;
162 // fTOFT0v1=copy.fTOFT0v1;
163 fNTOFtracks=copy.fNTOFtracks;
164 fEnableAdvancedCheck=copy.fEnableAdvancedCheck;
165 fExpTimeBinWidth=copy.fExpTimeBinWidth;
166 fExpTimeRangeMin=copy.fExpTimeRangeMin;
167 fExpTimeRangeMax=copy.fExpTimeRangeMax;
168 fExpTimeSmallRangeMin=copy.fExpTimeSmallRangeMin;
169 fExpTimeSmallRangeMax=copy.fExpTimeSmallRangeMax;
170 fMyTimeZeroTOF=copy.fMyTimeZeroTOF;
171 fMyTimeZeroTOFsigma=copy.fMyTimeZeroTOFsigma;
172 fMyTimeZeroTOFtracks=copy.fMyTimeZeroTOFtracks;
173 for (Int_t j=0;j<5;j++ ) {
174 if (j<3) fT0[j]=copy.fT0[j];
175 fSigmaSpecie[j]=copy.fSigmaSpecie[j];
176 fTrkExpTimes[j]=copy.fTrkExpTimes[j];
177 fThExpTimes[j]=copy.fThExpTimes[j];
180 fHlistTimeZero=copy.fHlistTimeZero;
181 fHlistPID=copy.fHlistPID;
188 //___________________________________________________________________________
189 AliAnalysisTaskTOFqa::~AliAnalysisTaskTOFqa() {
194 Info("~AliAnalysisTaskTOFqa","Calling Destructor");
195 if (fESDpid) delete fESDpid;
196 // if (fTOFT0v1) delete fTOFT0v1;
197 if (fVertex) delete fVertex;
198 if (fTrackFilter) delete fTrackFilter;
199 if (AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return;
204 if (fHlistTimeZero) {
205 delete fHlistTimeZero;
222 //________________________________________________________________________
223 void AliAnalysisTaskTOFqa::UserCreateOutputObjects()
226 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
227 AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());
228 if (!inputHandler) AliFatal("Input handler needed");
230 //pid response object
231 fESDpid=(AliESDpid*)inputHandler->GetPIDResponse();
232 if (!fESDpid) AliError("PIDResponse object was not created");
233 // fESDpid->SetOADBPath("$ALICE_ROOT/OADB");
235 //Defines output objects and histograms
236 Info("CreateOutputObjects","CreateOutputObjects (TList) of task %s", GetName());
238 if (!fHlist) fHlist = new TList();
239 fHlist->SetOwner(kTRUE);
240 if (!fHlistTimeZero) fHlistTimeZero = new TList();
241 fHlistTimeZero->SetOwner(kTRUE);
242 if (!fHlistPID) fHlistPID = new TList();
243 fHlistPID->SetOwner(kTRUE);
244 if (!fHpos) fHpos = new TList();
245 fHpos->SetOwner(kTRUE);
246 if (!fHneg) fHneg = new TList();
247 fHneg->SetOwner(kTRUE);
249 Int_t nExpTimeBins=1;
250 Int_t nExpTimeSmallBins=1;
252 if (fExpTimeRangeMax<fExpTimeRangeMin) {
253 SetExpTimeHistoRange(-25010.,25010.);
255 nExpTimeBins = TMath::Nint((fExpTimeRangeMax - fExpTimeRangeMin)/fExpTimeBinWidth);//ps
256 fExpTimeRangeMax=fExpTimeRangeMin+nExpTimeBins*fExpTimeBinWidth;//ps
258 if (fExpTimeSmallRangeMax<fExpTimeSmallRangeMin) {
259 SetExpTimeHistoSmallRange(-5002.,5002.);
261 nExpTimeSmallBins = TMath::Nint((fExpTimeSmallRangeMax - fExpTimeSmallRangeMin)/fExpTimeBinWidth);//ps
262 fExpTimeSmallRangeMax=fExpTimeSmallRangeMin+nExpTimeSmallBins*fExpTimeBinWidth;//ps
265 TH1I* hTOFmatchedESDperEvt = new TH1I("hTOFmatchedPerEvt", "Matched TOF tracks per event (|#eta| #leq 0.8 and pT #geq 0.3 GeV/c);TOF-matched ESD tracks;Events", 100, 0, 100) ;
266 hTOFmatchedESDperEvt->Sumw2() ;
267 hTOFmatchedESDperEvt->SetLineWidth(2);
268 hTOFmatchedESDperEvt->SetLineColor(kBlue);
269 hTOFmatchedESDperEvt->SetMarkerStyle(20);
270 hTOFmatchedESDperEvt->SetMarkerSize(0.8);
271 hTOFmatchedESDperEvt->SetMarkerColor(kBlue);
272 fHlist->AddLast(hTOFmatchedESDperEvt) ;
274 TH1F* hTOFmatchedESDtime = new TH1F("hTOFmatchedESDtime", "Matched ESDs tracks: TOF Time spectrum; t [ns];Counts", 250, 0., 610. ) ;
275 hTOFmatchedESDtime->Sumw2() ;
276 hTOFmatchedESDtime->SetLineWidth(2);
277 hTOFmatchedESDtime->SetLineColor(kBlue);
278 hTOFmatchedESDtime->SetFillColor(kBlue);
279 hTOFmatchedESDtime->SetDrawOption("BAR");
280 fHlist->AddLast(hTOFmatchedESDtime) ;
282 TH1F* hTOFmatchedESDrawTime = new TH1F("hTOFmatchedESDrawTime", "Matched ESDs tracks: TOF raw Time spectrum;t_{raw} [ns];Counts", 250, 0., 610.) ;
283 hTOFmatchedESDrawTime->Sumw2() ;
284 hTOFmatchedESDrawTime->SetLineWidth(2);
285 hTOFmatchedESDrawTime->SetLineColor(kAzure+2);
286 hTOFmatchedESDrawTime->SetFillColor(kAzure+2);
287 hTOFmatchedESDrawTime->SetDrawOption("BAR");
288 fHlist->AddLast(hTOFmatchedESDrawTime) ;
290 TH1F* hTOFmatchedESDToT = new TH1F("hTOFmatchedESDToT", "Matched ESDs tracks: TOF ToT spectrum; ToT [ns];Counts",100, 0., 48.8) ;
291 hTOFmatchedESDToT->Sumw2() ;
292 hTOFmatchedESDToT->SetLineColor(kOrange+1);
293 hTOFmatchedESDToT->SetMarkerColor(kOrange+1);
294 hTOFmatchedESDToT->SetFillColor(kOrange+1);
295 hTOFmatchedESDToT->SetDrawOption("BAR");
296 fHlist->AddLast(hTOFmatchedESDToT) ;
298 TH1F* hTOFmatchedESDtrkLength = new TH1F("hTOFmatchedESDtrkLength", "Matched ESDs tracks length; Track length [cm];Counts", 1200, -400., 800) ;
299 hTOFmatchedESDtrkLength->Sumw2();
300 hTOFmatchedESDtrkLength->SetLineColor(kViolet-3);
301 hTOFmatchedESDtrkLength->SetMarkerColor(kViolet-3);
302 hTOFmatchedESDtrkLength->SetFillColor(kViolet-3);
303 hTOFmatchedESDtrkLength->SetDrawOption("BAR");
304 fHlist->AddLast(hTOFmatchedESDtrkLength);
306 TH1F* hTOFmatchedESDP = new TH1F("hTOFmatchedESDP", "TPC-TOF matched tracks momentum distribution (GeV/c); p (GeV/c);tracks", 500,0.,5.) ;
307 hTOFmatchedESDP->Sumw2() ;
308 hTOFmatchedESDP->SetLineColor(kBlue);
309 hTOFmatchedESDP->SetMarkerStyle(20);
310 hTOFmatchedESDP->SetMarkerSize(0.7);
311 hTOFmatchedESDP->SetMarkerColor(kBlue);
312 fHlist->AddLast(hTOFmatchedESDP) ;
314 TH1F* hTOFmatchedESDPt = new TH1F("hTOFmatchedESDPt", "TPC-TOF matched tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500,0.,5.) ;
315 hTOFmatchedESDPt->Sumw2() ;
316 hTOFmatchedESDPt->SetLineColor(kBlue);
317 hTOFmatchedESDPt->SetMarkerStyle(21);
318 hTOFmatchedESDPt->SetMarkerSize(0.7);
319 hTOFmatchedESDPt->SetMarkerColor(kBlue);
320 fHlist->AddLast(hTOFmatchedESDPt) ;
323 TH1F* hTOFmatchedESDeta = new TH1F("hTOFmatchedESDeta", "Matched ESDtracks #eta (p_{T} #geq 1.0 GeV/c); #eta;Counts", 200, -1., 1.) ;
324 hTOFmatchedESDeta->Sumw2();
325 hTOFmatchedESDeta->SetLineColor(kBlue);
326 fHlist->AddLast(hTOFmatchedESDeta) ;
328 TH1F* hTOFmatchedESDphi = new TH1F("hTOFmatchedESDphi", "Matched ESDtracks #phi (p_{T} #geq 1.0 GeV/c); #phi (deg);Counts", 72, 0., 360.) ;
329 hTOFmatchedESDphi->Sumw2();
330 hTOFmatchedESDphi->SetLineColor(kBlue);
331 fHlist->AddLast(hTOFmatchedESDphi) ;
334 TH1F* hESDprimaryTrackP = new TH1F("hESDprimaryTrackP", "All ESDs tracks p distribution (GeV/c); p(GeV/c);tracks", 500, 0., 5.0) ;
335 hESDprimaryTrackP->Sumw2();
336 hESDprimaryTrackP->SetLineWidth(1);
337 hESDprimaryTrackP->SetMarkerStyle(24);
338 hESDprimaryTrackP->SetMarkerSize(0.7);
339 hESDprimaryTrackP->SetMarkerColor(kRed);
340 hESDprimaryTrackP->SetLineColor(kRed);
341 fHlist->AddLast(hESDprimaryTrackP);
343 TH1F* hESDprimaryTrackPt = new TH1F("hESDprimaryTrackPt", "ESDs primary tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
344 hESDprimaryTrackPt->Sumw2();
345 hESDprimaryTrackPt->SetLineWidth(1);
346 hESDprimaryTrackPt->SetMarkerStyle(25);
347 hESDprimaryTrackPt->SetMarkerSize(0.7);
348 hESDprimaryTrackPt->SetLineColor(kRed);
349 hESDprimaryTrackPt->SetMarkerColor(kRed);
350 fHlist->AddLast(hESDprimaryTrackPt);
352 TH1F* hTOFprimaryESDeta = new TH1F("hTOFprimaryESDeta", "Primary ESDtracks #eta (p_{T} #geq 1.0 GeV/c); #eta;Counts",200, -1., 1.) ;
353 hTOFprimaryESDeta->Sumw2();
354 hTOFprimaryESDeta->SetLineColor(kRed);
355 fHlist->AddLast(hTOFprimaryESDeta) ;
357 TH1F* hTOFprimaryESDphi = new TH1F("hTOFprimaryESDphi", "Primary ESDtracks #phi (p_{T} #geq 1.0 GeV/c);#phi (deg);Counts", 72, 0., 360.) ;
358 hTOFprimaryESDphi->Sumw2();
359 hTOFprimaryESDphi->SetLineColor(kRed);
360 fHlist->AddLast(hTOFprimaryESDphi) ;
362 TH2F* hTOFmatchedDxVsPtPos = new TH2F("hTOFmatchedDxVsPtPos", "Dx vs p_{T} for positive tracks;p_{T} (GeV/c); Dx [cm]; hits", 500,0.,5.,200, -10., 10.) ;
363 hTOFmatchedDxVsPtPos->Sumw2();
364 fHlist->AddLast(hTOFmatchedDxVsPtPos) ;
366 TH2F* hTOFmatchedDxVsPtNeg = new TH2F("hTOFmatchedDxVsPtNeg", "Dx vs p_{T} for negative tracks;p_{T} (GeV/c); Dx [cm]; hits", 500,0.,5.,200, -10., 10.) ;
367 hTOFmatchedDxVsPtNeg->Sumw2();
368 fHlist->AddLast(hTOFmatchedDxVsPtNeg) ;
371 TH2F* hTOFmatchedDzVsStrip = new TH2F("hTOFmatchedDzVsStrip", "Dz vs strip; strip (#eta); Dz [cm]; hits", 92,0.,92.,200, -10., 10.) ;
372 hTOFmatchedDzVsStrip->Sumw2();
373 fHlist->AddLast(hTOFmatchedDzVsStrip) ;
376 TProfile *hTOFmatchedDxVsCh = new TProfile("hTOFmatchedDxVsCh","Dx vs channel; channel ID; Dx [cm]", 157248., 0.,157248.);
377 fHlist->AddLast(hTOFmatchedDxVsCh);
380 TProfile *hTOFmatchedDzVsCh = new TProfile("hTOFmatchedDzVsCh","Dz vs channel; channel ID; Dz [cm]", 157248., 0.,157248.);
381 fHlist->AddLast(hTOFmatchedDzVsCh);
383 //----------------------------------------------timeZero QA plots
385 TH1D* hEventT0DetAND = new TH1D("hEventT0DetAND", "Event timeZero from T0AC detector ; t0 [ps]; events", 1000, -25000., 25000. ) ;
386 hEventT0DetAND->Sumw2() ;
387 hEventT0DetAND->SetLineWidth(2);
388 hEventT0DetAND->SetLineColor(kRed);
389 hEventT0DetAND->SetFillColor(kRed);
390 fHlistTimeZero->AddLast(hEventT0DetAND) ;
393 TH1D* hEventT0DetA = new TH1D("hEventT0DetA", "Event timeZero from T0A detector; t0 [ps]; events", 1000, -25000., 25000. ) ;
394 hEventT0DetA->Sumw2() ;
395 hEventT0DetA->SetLineWidth(2);
396 hEventT0DetA->SetLineColor(kBlue);
397 hEventT0DetA->SetFillColor(kBlue);
398 fHlistTimeZero->AddLast(hEventT0DetA) ;
401 TH1D* hEventT0DetC = new TH1D("hEventT0DetC", "Event timeZero from T0C detector; t0 [ps]; events", 1000, -25000., 25000.) ;
402 hEventT0DetC->Sumw2() ;
403 hEventT0DetC->SetLineWidth(2);
404 hEventT0DetC->SetLineColor(kGreen);
405 hEventT0DetC->SetFillColor(kGreen);
406 fHlistTimeZero->AddLast(hEventT0DetC);
409 TH1F* hT0DetRes = new TH1F("hT0DetRes", "T0 detector (T0A-T0C)/2; (T0A-T0C)/2 [ps]; events", 200, -500.,500. ) ;
411 hT0DetRes->SetMarkerStyle(24);
412 hT0DetRes->SetMarkerSize(0.7);
413 hT0DetRes->SetMarkerColor(kMagenta+2);
414 hT0DetRes->SetLineColor(kMagenta+2);
415 hT0DetRes->SetFillColor(kMagenta+2);
416 fHlistTimeZero->AddLast(hT0DetRes) ;
419 TH1F* hT0fill = new TH1F("hT0fill", "Event timeZero of fill; t0 [ps]; events", 1000, -25000., 25000. ) ;
421 hT0fill->SetMarkerStyle(20);
422 hT0fill->SetMarkerColor(kBlack);
423 hT0fill->SetLineColor(kBlack);
424 fHlistTimeZero->AddLast(hT0fill) ;
427 TH1F* hT0TOF = new TH1F("hT0TOF", "Event timeZero estimated by TOF; t0 [ps]; events", 1000, -25000., 25000. ) ;
429 hT0TOF->SetMarkerStyle(20);
430 hT0TOF->SetMarkerColor(kBlue);
431 hT0TOF->SetLineColor(kBlue);
432 hT0TOF->SetFillColor(kBlue);
433 fHlistTimeZero->AddLast(hT0TOF) ;
437 TH1F* hT0T0 = new TH1F("hT0T0", "Event timeZero measured by T0 detector (best between AC, A, C); t0 [ps]; events", 1000, -25000.,25000. ) ;
439 hT0T0->SetMarkerStyle(20);
440 hT0T0->SetMarkerColor(kGreen+1);
441 hT0T0->SetLineColor(kGreen+1);
442 hT0T0->SetFillColor(kGreen+1);
443 fHlistTimeZero->AddLast(hT0T0) ;
446 TH1F* hT0best = new TH1F("hT0best", "Event timeZero estimated as T0best; t0 [ps]; events", 1000, -25000.,25000. ) ;
448 hT0best->SetMarkerStyle(20);
449 hT0best->SetMarkerColor(kRed);
450 hT0best->SetLineColor(kRed);
451 hT0best->SetFillColor(kRed);
452 fHlistTimeZero->AddLast(hT0best) ;
455 TH1F* hT0fillRes = new TH1F("hT0fillRes", "Resolution of fillT0; #sigma_{fillT0} [ps];events", 250, 0.,250. ) ;
456 hT0fillRes->Sumw2() ;
457 hT0fillRes->SetMarkerStyle(21);
458 hT0fillRes->SetMarkerColor(kBlack);
459 hT0fillRes->SetLineColor(kBlack);
460 hT0fillRes->SetFillColor(kBlack);
461 fHlistTimeZero->AddLast(hT0fillRes) ;
464 TH1F* hT0TOFRes = new TH1F("hT0TOFRes", "Resolution of timeZero from TOF; #sigma_{TOFT0} [ps];events", 250, 0.,250. ) ;
466 hT0TOFRes->SetLineWidth(1);
467 hT0TOFRes->SetMarkerStyle(21);
468 hT0TOFRes->SetMarkerColor(kBlue);
469 hT0TOFRes->SetLineColor(kBlue);
470 hT0TOFRes->SetFillColor(kBlue);
471 fHlistTimeZero->AddLast(hT0TOFRes) ;
474 TH1F* hT0T0Res = new TH1F("hT0T0Res", "Resolution of timeZero from T0;#sigma_{T0T0} [ps];events", 250, -0., 250. ) ;
476 hT0T0Res->SetMarkerStyle(21);
477 hT0T0Res->SetMarkerColor(kGreen+1);
478 hT0T0Res->SetLineColor(kGreen+1);
479 hT0T0Res->SetFillColor(kGreen+1);
480 fHlistTimeZero->AddLast(hT0T0Res) ;
483 TH1F* hT0bestRes = new TH1F("hT0bestRes", "Resolution of bestT0; #sigma_{bestT0} [ps];events", 250, 0.,250. ) ;
484 hT0bestRes->Sumw2() ;
485 hT0bestRes->SetMarkerStyle(21);
486 hT0bestRes->SetMarkerColor(kRed);
487 hT0bestRes->SetLineColor(kRed);
488 hT0bestRes->SetFillColor(kRed);
489 fHlistTimeZero->AddLast(hT0bestRes) ;
492 TH2F* hT0TOFvsNtrk = new TH2F("hT0TOFvsNtrk", "Event timeZero estimated by TOF vs. number of tracks in event;TOF-matching tracks; t0 [ps]", 100, 0., 100.,1000,-25000.,25000. ) ;
493 hT0TOFvsNtrk->Sumw2() ;
494 fHlistTimeZero->AddLast(hT0TOFvsNtrk) ;
497 TH2F* hEventT0MeanVsVtx = new TH2F("hEventT0MeanVsVtx", "T0 detector: mean vs vertex ; (t0_{A}-t0_{C})/2 [ns]; (t0_{A}+t0_{C})/2 [ns]; events", 500, -25., 25., 500, -25., 25. ) ;
498 hEventT0MeanVsVtx->Sumw2() ;
499 fHlistTimeZero->AddLast(hEventT0MeanVsVtx) ;
502 TH2F* hEventV0MeanVsVtx = new TH2F("hEventV0MeanVsVtx", "V0 detector: mean vs vertex ; (V0_{A}-V0_{C})/2 [ns]; (V0_{A}+V0_{C})/2 [ns]; events", 500, -50., 50., 500, -50., 50. ) ;
503 hEventV0MeanVsVtx->Sumw2() ;
504 fHlistTimeZero->AddLast(hEventV0MeanVsVtx) ;
506 const Double_t startTimeMomBins[13]={ 0.0, 0.3, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.2, 1.5, 2., 3., 10.};
509 TH2F* hStartTimeMaskMatched = new TH2F("hStartTimeMaskMatched","Start Time Mask vs p bin for matched tracks; p(GeV/c);", 12, startTimeMomBins, 8,0.,8.);
510 hStartTimeMaskMatched->Sumw2();
511 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(1,"fill_t0");
512 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(2,"tof_t0");
513 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(3,"T0AC");
514 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(4,"T0AC & tof_t0");
515 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(5,"T0A");
516 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(6,"T0A & tof_t0");
517 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(7,"T0C");
518 hStartTimeMaskMatched->GetYaxis()->SetBinLabel(8,"T0C & tof_t0");
519 fHlistTimeZero->AddLast(hStartTimeMaskMatched);
522 TH2F* hStartTimeMask = new TH2F("hStartTimeMask","Start Time Mask vs p bin for primary tracks; p(GeV/c);", 12, startTimeMomBins, 8,0.,8.);
523 hStartTimeMask->Sumw2();
524 hStartTimeMask->GetYaxis()->SetBinLabel(1,"fill_t0");
525 hStartTimeMask->GetYaxis()->SetBinLabel(2,"tof_t0");
526 hStartTimeMask->GetYaxis()->SetBinLabel(3,"T0AC");
527 hStartTimeMask->GetYaxis()->SetBinLabel(4,"T0AC & tof_t0");
528 hStartTimeMask->GetYaxis()->SetBinLabel(5,"T0A");
529 hStartTimeMask->GetYaxis()->SetBinLabel(6,"T0A & tof_t0");
530 hStartTimeMask->GetYaxis()->SetBinLabel(7,"T0C");
531 hStartTimeMask->GetYaxis()->SetBinLabel(8,"T0C & tof_t0");
532 fHlistTimeZero->AddLast(hStartTimeMask);
534 //--------------------------------------------- TOF PID QA plots
536 TH2F* hTOFmatchedESDpVsBeta = new TH2F("hTOFmatchedESDpVsBeta", "Matched ESDs tracks beta vs. p; p(GeV/c); beta", 500, 0.0, 5.0, 150, 0., 1.5) ;
537 fHlistPID->AddLast(hTOFmatchedESDpVsBeta);
540 TH1F* hTOFmatchedMass= new TH1F("hTOFmatchedMass","Matched ESD tracks mass distribution - (L>0); M (GeV/c^{2}); entries", 500, 0., 5. );
541 hTOFmatchedMass->Sumw2();
542 hTOFmatchedMass->SetLineWidth(2);
543 hTOFmatchedMass->SetLineColor(kBlue);
544 hTOFmatchedMass->SetLineColor(kBlue);
545 fHlistPID->AddLast(hTOFmatchedMass);
548 TH2F* hTOFmatchedExpTimePiVsEta = new TH2F("hTOFmatchedExpTimePiVsEta", "ESDs t_{TOF}-t_{#pi,exp} (from tracking); strip (#eta); t_{TOF}-t_{#pi,exp} [ps]", 92, 0, 92, nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
549 hTOFmatchedExpTimePiVsEta->Sumw2() ;
550 fHlistPID->AddLast(hTOFmatchedExpTimePiVsEta) ;
553 TH1F* hTOFmatchedExpTimePi = new TH1F("hTOFmatchedExpTimePi", "ESDs t_{TOF}-t_{#pi,exp} (from tracking); t_{TOF}-t_{#pi,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
554 hTOFmatchedExpTimePi->Sumw2() ;
555 hTOFmatchedExpTimePi->SetLineWidth(1);
556 hTOFmatchedExpTimePi->SetLineColor(kRed);
557 hTOFmatchedExpTimePi->SetMarkerStyle(20);
558 hTOFmatchedExpTimePi->SetMarkerSize(0.8);
559 hTOFmatchedExpTimePi->SetMarkerColor(kRed);
560 fHlistPID->AddLast(hTOFmatchedExpTimePi) ;
563 TH1F* hExpTimePiFillSub = new TH1F("hExpTimePiFillSub", "ESDs t_{TOF}-t_{#pi,exp}-t_{0,FILL} (from tracking); t_{TOF}-t_{#pi,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
564 hExpTimePiFillSub->Sumw2() ;
565 hExpTimePiFillSub->SetLineWidth(1);
566 hExpTimePiFillSub->SetLineColor(kRed);
567 hExpTimePiFillSub->SetMarkerStyle(20);
568 hExpTimePiFillSub->SetMarkerSize(0.8);
569 hExpTimePiFillSub->SetMarkerColor(kRed);
570 fHlistPID->AddLast(hExpTimePiFillSub) ;
574 TH2F* hTOFmatchedExpTimePiVsP = new TH2F("hTOFmatchedExpTimePiVsP", "ESDs t_{TOF}-t_{#pi,exp} (from tracking) Vs P ; p (GeV/c);t_{TOF}-t_{#pi,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
575 hTOFmatchedExpTimePiVsP->Sumw2() ;
576 fHlistPID->AddLast(hTOFmatchedExpTimePiVsP) ;
579 TH1F* hTOFtheoreticalExpTimePi = new TH1F("hTOFtheoreticalExpTimePi", "ESDs t_{TOF}-t_{#pi,exp} (theoretical); t_{TOF}-t_{#pi,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
580 hTOFtheoreticalExpTimePi->Sumw2() ;
581 hTOFtheoreticalExpTimePi->SetLineWidth(1);
582 hTOFtheoreticalExpTimePi->SetLineColor(kRed);
583 hTOFtheoreticalExpTimePi->SetMarkerStyle(24);
584 hTOFtheoreticalExpTimePi->SetMarkerSize(0.8);
585 hTOFtheoreticalExpTimePi->SetMarkerColor(kRed);
586 fHlistPID->AddLast(hTOFtheoreticalExpTimePi) ;
589 TH2F* hTOFtheoreticalExpTimePiVsP = new TH2F("hTOFtheoreticalExpTimePiVsP", "ESDs t_{TOF}-t_{#pi,exp} (theoretical) Vs P ; p (GeV/c);t_{TOF}-t_{#pi,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
590 hTOFtheoreticalExpTimePiVsP->Sumw2() ;
591 fHlistPID->AddLast(hTOFtheoreticalExpTimePiVsP) ;
594 TH2F* hTOFExpSigmaPi = new TH2F("hTOFExpSigmaPi", "ESDs TOF n#sigma_{PID,#pi} vs p_{T}; p_{T} (GeV/c); n#sigma_{PID,#pi};Tracks", 500,0.,5.,200, -10., 10. ) ;
595 hTOFExpSigmaPi->Sumw2() ;
596 fHlistPID->AddLast(hTOFExpSigmaPi) ;
599 TH1F* hTOFmatchedExpTimeKa = new TH1F("hTOFmatchedExpTimeKa", "ESDs t_{TOF}-t_{K,exp} (from tracking); t_{TOF}-t_{K,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
600 hTOFmatchedExpTimeKa->Sumw2() ;
601 hTOFmatchedExpTimeKa->SetLineWidth(1);
602 hTOFmatchedExpTimeKa->SetLineColor(kBlue);
603 hTOFmatchedExpTimeKa->SetMarkerStyle(21);
604 hTOFmatchedExpTimeKa->SetMarkerSize(0.8);
605 hTOFmatchedExpTimeKa->SetMarkerColor(kBlue);
606 fHlistPID->AddLast(hTOFmatchedExpTimeKa);
609 TH2F* hTOFmatchedExpTimeKaVsP = new TH2F("hTOFmatchedExpTimeKaVsP", "ESDs t_{TOF}-t_{K,exp} (from tracking) Vs P ; p (GeV/c);t_{TOF}-t_{K,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
610 hTOFmatchedExpTimeKaVsP->Sumw2() ;
611 fHlistPID->AddLast(hTOFmatchedExpTimeKaVsP) ;
614 TH1F* hTOFtheoreticalExpTimeKa = new TH1F("hTOFtheoreticalExpTimeKa", "ESDs t_{TOF}-t_{K,exp} (theoretical); t_{TOF}-t_{K,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
615 hTOFtheoreticalExpTimeKa->Sumw2() ;
616 hTOFtheoreticalExpTimeKa->SetLineWidth(1);
617 hTOFtheoreticalExpTimeKa->SetLineColor(kBlue);
618 hTOFtheoreticalExpTimeKa->SetMarkerStyle(24);
619 hTOFtheoreticalExpTimeKa->SetMarkerSize(0.8);
620 hTOFtheoreticalExpTimeKa->SetMarkerColor(kBlue);
621 fHlistPID->AddLast(hTOFtheoreticalExpTimeKa) ;
624 TH2F* hTOFtheoreticalExpTimeKaVsP = new TH2F("hTOFtheoreticalExpTimeKaVsP", "ESDs t_{TOF}-t_{K,exp} (theoretical) Vs P ; p (GeV/c);t_{TOF}-t_{K,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
625 hTOFtheoreticalExpTimeKaVsP->Sumw2() ;
626 fHlistPID->AddLast(hTOFtheoreticalExpTimeKaVsP) ;
629 TH2F* hTOFExpSigmaKa = new TH2F("hTOFExpSigmaKa", "ESDs TOF n#sigma_{PID,K} vs p_{T}; p_{T} (GeV/c);n#sigma_{PID,K};Tracks", 500, 0.,5.,200, -10., 10. ) ;
630 hTOFExpSigmaKa->Sumw2() ;
631 fHlistPID->AddLast(hTOFExpSigmaKa) ;
634 TH1F* hTOFmatchedExpTimePro = new TH1F("hTOFmatchedExpTimePro", "ESDs t_{TOF}-t_{p,exp} (from tracking); t_{TOF}-t_{p,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin,fExpTimeRangeMax) ;
635 hTOFmatchedExpTimePro->Sumw2() ;
636 hTOFmatchedExpTimePro->SetLineWidth(1);
637 hTOFmatchedExpTimePro->SetLineColor(kGreen+1);
638 hTOFmatchedExpTimePro->SetMarkerStyle(22);
639 hTOFmatchedExpTimePro->SetMarkerSize(0.8);
640 hTOFmatchedExpTimePro->SetMarkerColor(kGreen+1);
641 fHlistPID->AddLast(hTOFmatchedExpTimePro) ;
644 TH2F* hTOFmatchedExpTimeProVsP = new TH2F("hTOFmatchedExpTimeProVsP", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
645 hTOFmatchedExpTimeProVsP->Sumw2() ;
646 fHlistPID->AddLast(hTOFmatchedExpTimeProVsP) ;
649 TH1F* hTOFtheoreticalExpTimePro = new TH1F("hTOFtheoreticalExpTimePro", "ESDs t_{TOF}-t_{p,exp} (theoretical); t_{TOF}-t_{p,exp} [ps];Counts", nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
650 hTOFtheoreticalExpTimePro->Sumw2() ;
651 hTOFtheoreticalExpTimePro->SetLineWidth(1);
652 hTOFtheoreticalExpTimePro->SetLineColor(kGreen+1);
653 hTOFtheoreticalExpTimePro->SetMarkerStyle(26);
654 hTOFtheoreticalExpTimePro->SetMarkerSize(0.8);
655 hTOFtheoreticalExpTimePro->SetMarkerColor(kGreen+1);
656 fHlistPID->AddLast(hTOFtheoreticalExpTimePro) ;
659 TH2F* hTOFtheoreticalExpTimeProVsP = new TH2F("hTOFtheoreticalExpTimeProVsP", "ESDs t_{TOF}-t_{p,exp} (theoretical) Vs P ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
660 hTOFtheoreticalExpTimeProVsP->Sumw2() ;
661 fHlistPID->AddLast(hTOFtheoreticalExpTimeProVsP) ;
664 TH2F* hTOFExpSigmaPro = new TH2F("hTOFExpSigmaPro", "ESDs TOF n#sigma_{PID,p} vs. p_{T}; p_{T} (GeV/c); n#sigma_{PID,p};Tracks", 500, 0.,5.,200, -10., 10. ) ;
665 hTOFExpSigmaPro->Sumw2() ;
666 fHlistPID->AddLast(hTOFExpSigmaPro) ;
669 TH2F* hTOFmatchedExpTimePiVsPTRDPos = new TH2F("hTOFmatchedExpTimePiVsPTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
670 hTOFmatchedExpTimePiVsPTRDPos->Sumw2() ;
671 if (fEnableAdvancedCheck)
672 fHlistPID->AddLast(hTOFmatchedExpTimePiVsPTRDPos) ;
675 TH2F* hTOFmatchedExpTimePiVsPNoTRDPos = new TH2F("hTOFmatchedExpTimePiVsPNoTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
676 hTOFmatchedExpTimePiVsPNoTRDPos->Sumw2() ;
677 if (fEnableAdvancedCheck)
678 fHlistPID->AddLast(hTOFmatchedExpTimePiVsPNoTRDPos) ;
681 TH2F* hTOFmatchedExpTimePiVsPTRDNeg = new TH2F("hTOFmatchedExpTimePiVsPTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
682 hTOFmatchedExpTimePiVsPTRDNeg->Sumw2() ;
683 if (fEnableAdvancedCheck)
684 fHlistPID->AddLast(hTOFmatchedExpTimePiVsPTRDNeg) ;
687 TH2F* hTOFmatchedExpTimePiVsPNoTRDNeg = new TH2F("hTOFmatchedExpTimePiVsPNoTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
688 hTOFmatchedExpTimePiVsPNoTRDNeg->Sumw2() ;
689 if (fEnableAdvancedCheck)
690 fHlistPID->AddLast(hTOFmatchedExpTimePiVsPNoTRDNeg) ;
693 TH2F* hTOFmatchedExpTimeKaVsPTRDPos = new TH2F("hTOFmatchedExpTimeKaVsPTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
694 hTOFmatchedExpTimeKaVsPTRDPos->Sumw2() ;
695 if (fEnableAdvancedCheck)
696 fHlistPID->AddLast(hTOFmatchedExpTimeKaVsPTRDPos) ;
699 TH2F* hTOFmatchedExpTimeKaVsPNoTRDPos = new TH2F("hTOFmatchedExpTimeKaVsPNoTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
700 hTOFmatchedExpTimeKaVsPNoTRDPos->Sumw2() ;
701 if (fEnableAdvancedCheck)
702 fHlistPID->AddLast(hTOFmatchedExpTimeKaVsPNoTRDPos) ;
705 TH2F* hTOFmatchedExpTimeKaVsPTRDNeg = new TH2F("hTOFmatchedExpTimeKaVsPTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
706 hTOFmatchedExpTimeKaVsPTRDNeg->Sumw2() ;
707 if (fEnableAdvancedCheck)
708 fHlistPID->AddLast(hTOFmatchedExpTimeKaVsPTRDNeg) ;
711 TH2F* hTOFmatchedExpTimeKaVsPNoTRDNeg = new TH2F("hTOFmatchedExpTimeKaVsPNoTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
712 hTOFmatchedExpTimeKaVsPNoTRDNeg->Sumw2() ;
713 if (fEnableAdvancedCheck)
714 fHlistPID->AddLast(hTOFmatchedExpTimeKaVsPNoTRDNeg) ;
717 TH2F* hTOFmatchedExpTimeProVsPTRDPos = new TH2F("hTOFmatchedExpTimeProVsPTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
718 hTOFmatchedExpTimeProVsPTRDPos->Sumw2() ;
719 if (fEnableAdvancedCheck)
720 fHlistPID->AddLast(hTOFmatchedExpTimeProVsPTRDPos) ;
723 TH2F* hTOFmatchedExpTimeProVsPNoTRDPos = new TH2F("hTOFmatchedExpTimeProVsPNoTRDPos", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
724 hTOFmatchedExpTimeProVsPNoTRDPos->Sumw2() ;
725 if (fEnableAdvancedCheck)
726 fHlistPID->AddLast(hTOFmatchedExpTimeProVsPNoTRDPos) ;
729 TH2F* hTOFmatchedExpTimeProVsPTRDNeg = new TH2F("hTOFmatchedExpTimeProVsPTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (#phi_{outerTPC}#leq 30 || 150 #leq#phi_{outerTPC}#leq 230 || #phi_{outerTPC}#geq 310 ) ; p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
730 hTOFmatchedExpTimeProVsPTRDNeg->Sumw2() ;
731 if (fEnableAdvancedCheck)
732 fHlistPID->AddLast(hTOFmatchedExpTimeProVsPTRDNeg) ;
735 TH2F* hTOFmatchedExpTimeProVsPNoTRDNeg = new TH2F("hTOFmatchedExpTimeProVsPNoTRDNeg", "ESDs t_{TOF}-t_{p,exp} (from tracking) Vs P (50 #leq#phi_{outerTPC}#leq 130 || 250 #leq#phi_{outerTPC}#leq 290); p (GeV/c);t_{TOF}-t_{p,exp} [ps];Counts",500, 0.,5.,nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
736 hTOFmatchedExpTimeProVsPNoTRDNeg->Sumw2() ;
737 if (fEnableAdvancedCheck)
738 fHlistPID->AddLast(hTOFmatchedExpTimeProVsPNoTRDNeg) ;
741 TH2F* hTOFmatchedTimePion1GeV = new TH2F("hTOFmatchedTimePion1GeV", "ESDs t_{TOF}-t_{0}^{TOF}-t_{#pi,exp} (from tracking) for 0.95 <= p_{T} <= 1.05 GeV/c; n tracks used for TOF_T0; t_{TOF}-t_{0}^{TOF}-t_{#pi,exp} [ps];Counts", 1000, 0., 1000., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
742 hTOFmatchedTimePion1GeV->Sumw2() ;
743 fHlistPID->AddLast(hTOFmatchedTimePion1GeV) ;
746 TH2F* hTimeT0subtractedPionVsP = new TH2F("hTimeT0subtractedPionVsP", "ESDs t_{TOF}-t_{0}^{TOF}-t_{#pi,exp} vs p; p (GeV/c); t_{TOF}-t_{0}^{TOF}-t_{#pi,exp} [ps];Counts", 500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
747 hTimeT0subtractedPionVsP->Sumw2() ;
748 fHlistPID->AddLast(hTimeT0subtractedPionVsP) ;
751 TH2F* hTimeT0subtractedKaonVsP = new TH2F("hTimeT0subtractedKaonVsP", "ESDs t_{TOF}-t_{0}^{TOF}-t_{K,exp} vs p; p (GeV/c); t_{TOF}-t_{0}^{TOF}-t_{K,exp} [ps];Counts", 500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
752 hTimeT0subtractedKaonVsP->Sumw2() ;
753 fHlistPID->AddLast(hTimeT0subtractedKaonVsP) ;
756 TH2F* hTimeT0subtractedProtonVsP = new TH2F("hTimeT0subtractedProtonVsP", "ESDs t_{TOF}-t_{0}^{TOF}-t_{p,exp} vs p; p(GeV/c) t_{TOF}-t_{0}^{TOF}-t_{p,exp} [ps];Counts", 500, 0.,5., nExpTimeBins, fExpTimeRangeMin, fExpTimeRangeMax) ;
757 hTimeT0subtractedProtonVsP->Sumw2() ;
758 fHlistPID->AddLast(hTimeT0subtractedProtonVsP) ;
760 //----------------------------------------------------------POSITIVE TRACKS
762 TH1F* hTOFmatchedESDtrkLengthPos = new TH1F("hTOFmatchedESDtrkLengthPos", "Matched positive ESDs tracks length; Track length [cm];Counts", 1600, -800., 800) ;
763 hTOFmatchedESDtrkLengthPos->Sumw2();
764 hTOFmatchedESDtrkLengthPos->SetLineColor(kRed);
765 hTOFmatchedESDtrkLengthPos->SetMarkerColor(kRed);
766 hTOFmatchedESDtrkLengthPos->SetFillColor(kRed);
767 hTOFmatchedESDtrkLengthPos->SetDrawOption("BAR");
768 if (fEnableAdvancedCheck)
769 fHpos->AddLast(hTOFmatchedESDtrkLengthPos);
771 TH1F* hTOFmatchedESDPPos = new TH1F("hTOFmatchedESDPPos", "TPC-TOF matched positive tracks momentum distribution (GeV/c); p (GeV/c);tracks", 500,0.,5.) ;
772 hTOFmatchedESDPPos->Sumw2() ;
773 hTOFmatchedESDPPos->SetLineColor(kRed);
774 hTOFmatchedESDPPos->SetMarkerStyle(20);
775 hTOFmatchedESDPPos->SetMarkerSize(0.7);
776 hTOFmatchedESDPPos->SetMarkerColor(kRed);
777 if (fEnableAdvancedCheck)
778 fHpos->AddLast(hTOFmatchedESDPPos) ;
780 TH1F* hTOFmatchedESDPtPos = new TH1F("hTOFmatchedESDPtPos", "TPC-TOF positive matched tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500,0.,5.) ;
781 hTOFmatchedESDPtPos->Sumw2() ;
782 hTOFmatchedESDPtPos->SetLineColor(kRed);
783 hTOFmatchedESDPtPos->SetMarkerStyle(21);
784 hTOFmatchedESDPtPos->SetMarkerSize(0.7);
785 hTOFmatchedESDPtPos->SetMarkerColor(kRed);
786 if (fEnableAdvancedCheck)
787 fHpos->AddLast(hTOFmatchedESDPtPos) ;
790 TH1F* hTOFmatchedESDetaPos = new TH1F("hTOFmatchedESDetaPos", "Matched positive ESD tracks #eta (p_{T} #geq 1.0 GeV/c); eta;Counts", 200, -1., 1.) ;
791 hTOFmatchedESDetaPos->Sumw2();
792 hTOFmatchedESDetaPos->SetLineColor(kRed);
793 if (fEnableAdvancedCheck)
794 fHpos->AddLast(hTOFmatchedESDetaPos) ;
796 TH1F* hTOFmatchedESDphiPos = new TH1F("hTOFmatchedESDphiPos", "Matched Positive ESD tracks #phi (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);Counts", 72, 0., 360.) ;
797 hTOFmatchedESDphiPos->Sumw2();
798 hTOFmatchedESDphiPos->SetLineColor(kRed);
799 if (fEnableAdvancedCheck)
800 fHpos->AddLast(hTOFmatchedESDphiPos) ;
803 TH1F* hESDmatchedTrackPtPosTRDout = new TH1F("hESDmatchedTrackPtPosTRDout", "ESDs Pos matched tracks p_{T} with kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
804 hESDmatchedTrackPtPosTRDout->Sumw2();
805 hESDmatchedTrackPtPosTRDout->SetLineWidth(1);
806 hESDmatchedTrackPtPosTRDout->SetMarkerStyle(20);
807 hESDmatchedTrackPtPosTRDout->SetMarkerSize(0.7);
808 hESDmatchedTrackPtPosTRDout->SetLineColor(kRed);
809 hESDmatchedTrackPtPosTRDout->SetMarkerColor(kRed);
810 if (fEnableAdvancedCheck)
811 fHpos->AddLast(hESDmatchedTrackPtPosTRDout);
814 TH1F* hESDmatchedTrackPtPosNoTRDout = new TH1F("hESDmatchedTrackPtPosNoTRDout", "ESDs Pos matched tracks p_{T} with !kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
815 hESDmatchedTrackPtPosNoTRDout->Sumw2();
816 hESDmatchedTrackPtPosNoTRDout->SetLineWidth(1);
817 hESDmatchedTrackPtPosNoTRDout->SetMarkerStyle(25);
818 hESDmatchedTrackPtPosNoTRDout->SetMarkerSize(0.7);
819 hESDmatchedTrackPtPosNoTRDout->SetLineColor(kRed);
820 hESDmatchedTrackPtPosNoTRDout->SetMarkerColor(kRed);
821 if (fEnableAdvancedCheck)
822 fHpos->AddLast(hESDmatchedTrackPtPosNoTRDout);
825 TH1F* hESDprimaryTrackPPos = new TH1F("hESDprimaryTrackPPos", "All Pos ESDs tracks p distribution (GeV/c); p(GeV/c);tracks", 500, 0., 5.0) ;
826 hESDprimaryTrackPPos->Sumw2();
827 hESDprimaryTrackPPos->SetLineWidth(1);
828 hESDprimaryTrackPPos->SetMarkerStyle(24);
829 hESDprimaryTrackPPos->SetMarkerSize(0.7);
830 hESDprimaryTrackPPos->SetMarkerColor(kRed);
831 hESDprimaryTrackPPos->SetLineColor(kRed);
832 if (fEnableAdvancedCheck)
833 fHpos->AddLast(hESDprimaryTrackPPos);
835 TH1F* hESDprimaryTrackPtPos = new TH1F("hESDprimaryTrackPtPos", "ESDs Pos primary tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
836 hESDprimaryTrackPtPos->Sumw2();
837 hESDprimaryTrackPtPos->SetLineWidth(1);
838 hESDprimaryTrackPtPos->SetMarkerStyle(25);
839 hESDprimaryTrackPtPos->SetMarkerSize(0.7);
840 hESDprimaryTrackPtPos->SetLineColor(kRed);
841 hESDprimaryTrackPtPos->SetMarkerColor(kRed);
842 if (fEnableAdvancedCheck)
843 fHpos->AddLast(hESDprimaryTrackPtPos);
845 TH1F* hTOFprimaryESDetaPos = new TH1F("hTOFprimaryESDetaPos", "Primary ESD Pos tracks #eta (p_{T} #geq 1.0 GeV/c); #eta;Counts", 200, -1., 1.) ;
846 hTOFprimaryESDetaPos->Sumw2();
847 hTOFprimaryESDetaPos->SetLineColor(kRed);
848 if (fEnableAdvancedCheck)
849 fHpos->AddLast(hTOFprimaryESDetaPos) ;
851 TH1F* hTOFprimaryESDphiPos = new TH1F("hTOFprimaryESDphiPos", "Primary ESD Pos tracks #phi_{out} (p_{T} #geq 1.0 GeV/c);#phi (deg);Counts", 72, 0., 360.) ;
852 hTOFprimaryESDphiPos->Sumw2();
853 hTOFprimaryESDphiPos->SetLineColor(kRed);
854 if (fEnableAdvancedCheck)
855 fHpos->AddLast(hTOFprimaryESDphiPos) ;
858 TH1F* hESDprimaryTrackPtPosTRDout = new TH1F("hESDprimaryTrackPtPosTRDout", "ESDs Pos primary tracks p_{T} with kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
859 hESDprimaryTrackPtPosTRDout->Sumw2();
860 hESDprimaryTrackPtPosTRDout->SetLineWidth(1);
861 hESDprimaryTrackPtPosTRDout->SetMarkerStyle(20);
862 hESDprimaryTrackPtPosTRDout->SetMarkerSize(0.7);
863 hESDprimaryTrackPtPosTRDout->SetLineColor(kRed);
864 hESDprimaryTrackPtPosTRDout->SetMarkerColor(kRed);
865 if (fEnableAdvancedCheck)
866 fHpos->AddLast(hESDprimaryTrackPtPosTRDout);
869 TH1F* hESDprimaryTrackPtPosNoTRDout = new TH1F("hESDprimaryTrackPtPosNoTRDout", "ESDs Pos primary tracks p_{T} with !kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
870 hESDprimaryTrackPtPosNoTRDout->Sumw2();
871 hESDprimaryTrackPtPosNoTRDout->SetLineWidth(1);
872 hESDprimaryTrackPtPosNoTRDout->SetMarkerStyle(25);
873 hESDprimaryTrackPtPosNoTRDout->SetMarkerSize(0.7);
874 hESDprimaryTrackPtPosNoTRDout->SetLineColor(kRed);
875 hESDprimaryTrackPtPosNoTRDout->SetMarkerColor(kRed);
876 if (fEnableAdvancedCheck)
877 fHpos->AddLast(hESDprimaryTrackPtPosNoTRDout);
880 TH1F* hESDprimaryTrackEtaPosTRDout = new TH1F("hESDprimaryTrackEtaPosTRDout", "ESDs Pos primary tracks #eta with kTRDout (p_{T} #geq 1.0 GeV/c); #eta;tracks", 200, -1.0, 1.0) ;
881 hESDprimaryTrackEtaPosTRDout->Sumw2();
882 hESDprimaryTrackEtaPosTRDout->SetLineWidth(1);
883 hESDprimaryTrackEtaPosTRDout->SetMarkerStyle(20);
884 hESDprimaryTrackEtaPosTRDout->SetMarkerSize(0.7);
885 hESDprimaryTrackEtaPosTRDout->SetLineColor(kBlue);
886 hESDprimaryTrackEtaPosTRDout->SetMarkerColor(kBlue);
887 if (fEnableAdvancedCheck)
888 fHpos->AddLast(hESDprimaryTrackEtaPosTRDout);
891 TH1F* hESDprimaryTrackEtaPosNoTRDout = new TH1F("hESDprimaryTrackEtaPosNoTRDout", "ESDs Pos primary tracks #eta with !kTRDout (p_{T} #geq 1.0 GeV/c);#eta;tracks", 200, -1.0, 1.0) ;
892 hESDprimaryTrackEtaPosNoTRDout->Sumw2();
893 hESDprimaryTrackEtaPosNoTRDout->SetLineWidth(1);
894 hESDprimaryTrackEtaPosNoTRDout->SetMarkerStyle(25);
895 hESDprimaryTrackEtaPosNoTRDout->SetMarkerSize(0.7);
896 hESDprimaryTrackEtaPosNoTRDout->SetLineColor(kBlue);
897 hESDprimaryTrackEtaPosNoTRDout->SetMarkerColor(kBlue);
898 if (fEnableAdvancedCheck)
899 fHpos->AddLast(hESDprimaryTrackEtaPosNoTRDout);
902 TH1F* hESDprimaryTrackPhiPosTRDout = new TH1F("hESDprimaryTrackPhiPosTRDout", "ESDs Pos primary tracks #phi with kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out}(deg);tracks", 72, 0., 360.) ;
903 hESDprimaryTrackPhiPosTRDout->Sumw2();
904 hESDprimaryTrackPhiPosTRDout->SetLineWidth(1);
905 hESDprimaryTrackPhiPosTRDout->SetMarkerStyle(20);
906 hESDprimaryTrackPhiPosTRDout->SetMarkerSize(0.7);
907 hESDprimaryTrackPhiPosTRDout->SetLineColor(kBlue);
908 hESDprimaryTrackPhiPosTRDout->SetMarkerColor(kBlue);
909 if (fEnableAdvancedCheck)
910 fHpos->AddLast(hESDprimaryTrackPhiPosTRDout);
913 TH1F* hESDprimaryTrackPhiPosNoTRDout = new TH1F("hESDprimaryTrackPhiPosNoTRDout", "ESDs Pos primary tracks #phi with !kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out}(deg);tracks", 72, 0., 360.) ;
914 hESDprimaryTrackPhiPosNoTRDout->Sumw2();
915 hESDprimaryTrackPhiPosNoTRDout->SetLineWidth(1);
916 hESDprimaryTrackPhiPosNoTRDout->SetMarkerStyle(25);
917 hESDprimaryTrackPhiPosNoTRDout->SetMarkerSize(0.7);
918 hESDprimaryTrackPhiPosNoTRDout->SetLineColor(kBlue);
919 hESDprimaryTrackPhiPosNoTRDout->SetMarkerColor(kBlue);
920 if (fEnableAdvancedCheck)
921 fHpos->AddLast(hESDprimaryTrackPhiPosNoTRDout);
924 TH2F* hTOFmatchedExpTimeProVsPhiPos = new TH2F("hTOFmatchedExpTimeProVsPhiPos", "ESDs t_{TOF}-t_{p,exp} vs #phi at TOF (r=378.cm) (p_{T}<1GeV/c);#phi (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., 500, -5000., 5000. ) ;
925 hTOFmatchedExpTimeProVsPhiPos->Sumw2() ;
926 if (fEnableAdvancedCheck)
927 fHpos->AddLast(hTOFmatchedExpTimeProVsPhiPos) ;
930 TH2F* hTOFmatchedExpTimeProVsPhiVertexPos = new TH2F("hTOFmatchedExpTimeProVsPhiVertexPos", "ESDs t_{TOF}-t_{p,exp} vs #phi at vtx (p_{T}<1GeV/c);#phi (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
931 hTOFmatchedExpTimeProVsPhiVertexPos->Sumw2() ;
932 if (fEnableAdvancedCheck)
933 fHpos->AddLast(hTOFmatchedExpTimeProVsPhiVertexPos) ;
936 TH2F* hTOFmatchedExpTimeProVsPhiTPCPos = new TH2F("hTOFmatchedExpTimeProVsPhiTPCPos", "ESDs t_{TOF}-t_{p,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
937 hTOFmatchedExpTimeProVsPhiTPCPos->Sumw2() ;
938 if (fEnableAdvancedCheck)
939 fHpos->AddLast(hTOFmatchedExpTimeProVsPhiTPCPos) ;
942 TH1F* hESDmatchedTrackEtaPosTRDout = new TH1F("hESDmatchedTrackEtaPosTRDout", "ESDs Pos matched tracks #eta with kTRDout (p_{T} #geq 1.0 GeV/c); #eta;tracks", 200, -1.0, 1.0) ;
943 hESDmatchedTrackEtaPosTRDout->Sumw2();
944 hESDmatchedTrackEtaPosTRDout->SetLineWidth(1);
945 hESDmatchedTrackEtaPosTRDout->SetMarkerStyle(20);
946 hESDmatchedTrackEtaPosTRDout->SetMarkerSize(0.7);
947 hESDmatchedTrackEtaPosTRDout->SetLineColor(kBlue);
948 hESDmatchedTrackEtaPosTRDout->SetMarkerColor(kBlue);
949 if (fEnableAdvancedCheck)
950 fHpos->AddLast(hESDmatchedTrackEtaPosTRDout);
953 TH1F* hESDmatchedTrackEtaPosNoTRDout = new TH1F("hESDmatchedTrackEtaPosNoTRDout", "ESDs Pos matched tracks #eta with !kTRDout (p_{T} #geq 1.0 GeV/c);#eta;tracks", 200, -1.0, 1.0) ;
954 hESDmatchedTrackEtaPosNoTRDout->Sumw2();
955 hESDmatchedTrackEtaPosNoTRDout->SetLineWidth(1);
956 hESDmatchedTrackEtaPosNoTRDout->SetMarkerStyle(25);
957 hESDmatchedTrackEtaPosNoTRDout->SetMarkerSize(0.7);
958 hESDmatchedTrackEtaPosNoTRDout->SetLineColor(kBlue);
959 hESDmatchedTrackEtaPosNoTRDout->SetMarkerColor(kBlue);
960 if (fEnableAdvancedCheck)
961 fHpos->AddLast(hESDmatchedTrackEtaPosNoTRDout);
964 TH1F* hESDmatchedTrackPhiPosTRDout = new TH1F("hESDmatchedTrackPhiPosTRDout", "ESDs Pos matched tracks #phi with kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out}(deg);tracks", 72, 0., 360.) ;
965 hESDmatchedTrackPhiPosTRDout->Sumw2();
966 hESDmatchedTrackPhiPosTRDout->SetLineWidth(1);
967 hESDmatchedTrackPhiPosTRDout->SetMarkerStyle(20);
968 hESDmatchedTrackPhiPosTRDout->SetMarkerSize(0.7);
969 hESDmatchedTrackPhiPosTRDout->SetLineColor(kBlue);
970 hESDmatchedTrackPhiPosTRDout->SetMarkerColor(kBlue);
971 if (fEnableAdvancedCheck)
972 fHpos->AddLast(hESDmatchedTrackPhiPosTRDout);
975 TH1F* hESDmatchedTrackPhiPosNoTRDout = new TH1F("hESDmatchedTrackPhiPosNoTRDout", "ESDs Pos matched tracks #phi with !kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out}(deg);tracks", 72, 0., 360.) ;
976 hESDmatchedTrackPhiPosNoTRDout->Sumw2();
977 hESDmatchedTrackPhiPosNoTRDout->SetLineWidth(1);
978 hESDmatchedTrackPhiPosNoTRDout->SetMarkerStyle(25);
979 hESDmatchedTrackPhiPosNoTRDout->SetMarkerSize(0.7);
980 hESDmatchedTrackPhiPosNoTRDout->SetLineColor(kBlue);
981 hESDmatchedTrackPhiPosNoTRDout->SetMarkerColor(kBlue);
982 if (fEnableAdvancedCheck)
983 fHpos->AddLast(hESDmatchedTrackPhiPosNoTRDout);
986 TH2F* hTOFmatchedExpTimePiVsPhiTPCPos = new TH2F("hTOFmatchedExpTimePiVsPhiTPCPos", "ESDs t_{TOF}-t_{#pi,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi_{out} (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
987 hTOFmatchedExpTimePiVsPhiTPCPos->Sumw2() ;
988 if (fEnableAdvancedCheck)
989 fHpos->AddLast(hTOFmatchedExpTimePiVsPhiTPCPos) ;
992 TH2F* hTOFmatchedExpTimeKaVsPhiTPCPos = new TH2F("hTOFmatchedExpTimeKaVsPhiTPCPos", "ESDs t_{TOF}-t_{K,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi_{out} (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
993 hTOFmatchedExpTimeKaVsPhiTPCPos->Sumw2() ;
994 if (fEnableAdvancedCheck)
995 fHpos->AddLast(hTOFmatchedExpTimeKaVsPhiTPCPos) ;
998 TH2F* hTOFprimaryEtaVsPhiOutPos = new TH2F("hTOFprimaryEtaVsPhiOutPos", "Positive tracks, p_{T}>1GeV/c;#phi_{out} (degree); #eta; Counts", 72, 0., 360., 20, -1.,1.) ;
999 hTOFprimaryEtaVsPhiOutPos->Sumw2() ;
1000 if (fEnableAdvancedCheck)
1001 fHpos->AddLast(hTOFprimaryEtaVsPhiOutPos) ;
1004 TH2F* hTOFmatchedEtaVsPhiOutPos = new TH2F("hTOFmatchedEtaVsPhiOutPos", "Positive tracks, p_{T}>1GeV/c;#phi_{out} (degree); #eta; Counts", 72, 0., 360., 20, -1.,1.) ;
1005 hTOFmatchedEtaVsPhiOutPos->Sumw2() ;
1006 if (fEnableAdvancedCheck)
1007 fHpos->AddLast(hTOFmatchedEtaVsPhiOutPos) ;
1010 TH2F* hTOFprimaryPtVsPhiOutPos = new TH2F("hTOFprimaryPtVsPhiOutPos", "Positive tracks;#phi_{out}(degree); p_{T}(GeV/c); Counts", 500, 0., 5., 20, -1.,1.) ;
1011 hTOFprimaryPtVsPhiOutPos->Sumw2() ;
1012 if (fEnableAdvancedCheck)
1013 fHpos->AddLast(hTOFprimaryPtVsPhiOutPos) ;
1016 TH2F* hTOFmatchedPtVsPhiOutPos = new TH2F("hTOFmatchedPtVsPhiOutPos", "Positive tracks;#phi_{out}(degree); p_{T}(GeV/c); Counts", 500, 0., 5., 20, -1.,1.) ;
1017 hTOFmatchedPtVsPhiOutPos->Sumw2() ;
1018 if (fEnableAdvancedCheck)
1019 fHpos->AddLast(hTOFmatchedPtVsPhiOutPos) ;
1023 //----------------------------------------------------------NEGATIVE TRACKS
1025 TH1F* hTOFmatchedESDtrkLengthNeg = new TH1F("hTOFmatchedESDtrkLengthNeg", "Matched positive ESDs tracks length; Track length [cm];Counts", 1600, -800., 800) ;
1026 hTOFmatchedESDtrkLengthNeg->Sumw2();
1027 hTOFmatchedESDtrkLengthNeg->SetLineColor(kBlue);
1028 hTOFmatchedESDtrkLengthNeg->SetMarkerColor(kBlue);
1029 hTOFmatchedESDtrkLengthNeg->SetFillColor(kBlue);
1030 hTOFmatchedESDtrkLengthNeg->SetDrawOption("BAR");
1031 if (fEnableAdvancedCheck)
1032 fHneg->AddLast(hTOFmatchedESDtrkLengthNeg);
1034 TH1F* hTOFmatchedESDPNeg = new TH1F("hTOFmatchedESDPNeg", "TPC-TOF matched positive tracks momentum distribution (GeV/c); p (GeV/c);tracks", 500,0.,5.) ;
1035 hTOFmatchedESDPNeg->Sumw2() ;
1036 hTOFmatchedESDPNeg->SetLineColor(kBlue);
1037 hTOFmatchedESDPNeg->SetMarkerStyle(20);
1038 hTOFmatchedESDPNeg->SetMarkerSize(0.7);
1039 hTOFmatchedESDPNeg->SetMarkerColor(kBlue);
1040 if (fEnableAdvancedCheck)
1041 fHneg->AddLast(hTOFmatchedESDPNeg) ;
1043 TH1F* hTOFmatchedESDPtNeg = new TH1F("hTOFmatchedESDPtNeg", "TPC-TOF positive matched tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500,0.,5.) ;
1044 hTOFmatchedESDPtNeg->Sumw2() ;
1045 hTOFmatchedESDPtNeg->SetLineColor(kBlue);
1046 hTOFmatchedESDPtNeg->SetMarkerStyle(21);
1047 hTOFmatchedESDPtNeg->SetMarkerSize(0.7);
1048 hTOFmatchedESDPtNeg->SetMarkerColor(kBlue);
1049 if (fEnableAdvancedCheck)
1050 fHneg->AddLast(hTOFmatchedESDPtNeg) ;
1053 TH1F* hTOFmatchedESDetaNeg = new TH1F("hTOFmatchedESDetaNeg", "Matched positive ESD tracks #eta (p_{T} #geq 1.0 GeV/c); eta;Counts", 200, -1., 1.) ;
1054 hTOFmatchedESDetaNeg->Sumw2();
1055 hTOFmatchedESDetaNeg->SetLineColor(kBlue);
1056 if (fEnableAdvancedCheck)
1057 fHneg->AddLast(hTOFmatchedESDetaNeg) ;
1059 TH1F* hTOFmatchedESDphiNeg = new TH1F("hTOFmatchedESDphiNeg", "Matched Negative ESD tracks #phi (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);Counts", 72, 0., 360.) ;
1060 hTOFmatchedESDphiNeg->Sumw2();
1061 hTOFmatchedESDphiNeg->SetLineColor(kBlue);
1062 if (fEnableAdvancedCheck)
1063 fHneg->AddLast(hTOFmatchedESDphiNeg) ;
1066 TH1F* hESDmatchedTrackPtNegTRDout = new TH1F("hESDmatchedTrackPtNegTRDout", "ESDs Neg matched tracks p_{T} with kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
1067 hESDmatchedTrackPtNegTRDout->Sumw2();
1068 hESDmatchedTrackPtNegTRDout->SetLineWidth(1);
1069 hESDmatchedTrackPtNegTRDout->SetMarkerStyle(20);
1070 hESDmatchedTrackPtNegTRDout->SetMarkerSize(0.7);
1071 hESDmatchedTrackPtNegTRDout->SetLineColor(kBlue);
1072 hESDmatchedTrackPtNegTRDout->SetMarkerColor(kBlue);
1073 if (fEnableAdvancedCheck)
1074 fHneg->AddLast(hESDmatchedTrackPtNegTRDout);
1077 TH1F* hESDmatchedTrackPtNegNoTRDout = new TH1F("hESDmatchedTrackPtNegNoTRDout", "ESDs Neg matched tracks p_{T} with !kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
1078 hESDmatchedTrackPtNegNoTRDout->Sumw2();
1079 hESDmatchedTrackPtNegNoTRDout->SetLineWidth(1);
1080 hESDmatchedTrackPtNegNoTRDout->SetMarkerStyle(25);
1081 hESDmatchedTrackPtNegNoTRDout->SetMarkerSize(0.7);
1082 hESDmatchedTrackPtNegNoTRDout->SetLineColor(kBlue);
1083 hESDmatchedTrackPtNegNoTRDout->SetMarkerColor(kBlue);
1084 if (fEnableAdvancedCheck)
1085 fHneg->AddLast(hESDmatchedTrackPtNegNoTRDout);
1088 TH1F* hESDprimaryTrackPNeg = new TH1F("hESDprimaryTrackPNeg", "All Neg ESDs tracks p distribution (GeV/c); p(GeV/c);tracks", 500, 0., 5.0) ;
1089 hESDprimaryTrackPNeg->Sumw2();
1090 hESDprimaryTrackPNeg->SetLineWidth(1);
1091 hESDprimaryTrackPNeg->SetMarkerStyle(24);
1092 hESDprimaryTrackPNeg->SetMarkerSize(0.7);
1093 hESDprimaryTrackPNeg->SetMarkerColor(kBlue);
1094 hESDprimaryTrackPNeg->SetLineColor(kBlue);
1095 if (fEnableAdvancedCheck)
1096 fHneg->AddLast(hESDprimaryTrackPNeg);
1098 TH1F* hESDprimaryTrackPtNeg = new TH1F("hESDprimaryTrackPtNeg", "ESDs Neg primary tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
1099 hESDprimaryTrackPtNeg->Sumw2();
1100 hESDprimaryTrackPtNeg->SetLineWidth(1);
1101 hESDprimaryTrackPtNeg->SetMarkerStyle(25);
1102 hESDprimaryTrackPtNeg->SetMarkerSize(0.7);
1103 hESDprimaryTrackPtNeg->SetLineColor(kBlue);
1104 hESDprimaryTrackPtNeg->SetMarkerColor(kBlue);
1105 if (fEnableAdvancedCheck)
1106 fHneg->AddLast(hESDprimaryTrackPtNeg);
1108 TH1F* hTOFprimaryESDetaNeg = new TH1F("hTOFprimaryESDetaNeg", "Primary ESD Neg tracks #eta (p_{T} #geq 1.0 GeV/c); #eta;Counts", 200, -1., 1.) ;
1109 hTOFprimaryESDetaNeg->Sumw2();
1110 hTOFprimaryESDetaNeg->SetLineColor(kBlue);
1111 if (fEnableAdvancedCheck)
1112 fHneg->AddLast(hTOFprimaryESDetaNeg) ;
1114 TH1F* hTOFprimaryESDphiNeg = new TH1F("hTOFprimaryESDphiNeg", "Primary ESD Neg tracks #phi (p_{T} #geq 1.0 GeV/c);#phi_{out} (deg);Counts", 72, 0., 360.) ;
1115 hTOFprimaryESDphiNeg->Sumw2();
1116 hTOFprimaryESDphiNeg->SetLineColor(kBlue);
1117 if (fEnableAdvancedCheck)
1118 fHneg->AddLast(hTOFprimaryESDphiNeg) ;
1121 TH1F* hESDprimaryTrackPtNegTRDout = new TH1F("hESDprimaryTrackPtNegTRDout", "ESDs Neg primary tracks p_{T} with kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
1122 hESDprimaryTrackPtNegTRDout->Sumw2();
1123 hESDprimaryTrackPtNegTRDout->SetLineWidth(1);
1124 hESDprimaryTrackPtNegTRDout->SetMarkerStyle(20);
1125 hESDprimaryTrackPtNegTRDout->SetMarkerSize(0.7);
1126 hESDprimaryTrackPtNegTRDout->SetLineColor(kBlue);
1127 hESDprimaryTrackPtNegTRDout->SetMarkerColor(kBlue);
1128 if (fEnableAdvancedCheck)
1129 fHneg->AddLast(hESDprimaryTrackPtNegTRDout);
1132 TH1F* hESDprimaryTrackPtNegNoTRDout = new TH1F("hESDprimaryTrackPtNegNoTRDout", "ESDs Neg primary tracks p_{T} with !kTRDout distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ;
1133 hESDprimaryTrackPtNegNoTRDout->Sumw2();
1134 hESDprimaryTrackPtNegNoTRDout->SetLineWidth(1);
1135 hESDprimaryTrackPtNegNoTRDout->SetMarkerStyle(25);
1136 hESDprimaryTrackPtNegNoTRDout->SetMarkerSize(0.7);
1137 hESDprimaryTrackPtNegNoTRDout->SetLineColor(kBlue);
1138 hESDprimaryTrackPtNegNoTRDout->SetMarkerColor(kBlue);
1139 if (fEnableAdvancedCheck)
1140 fHneg->AddLast(hESDprimaryTrackPtNegNoTRDout);
1143 TH1F* hESDprimaryTrackEtaNegTRDout = new TH1F("hESDprimaryTrackEtaNegTRDout", "ESDs Neg primary tracks #eta with kTRDout (p_{T} #geq 1.0 GeV/c); #eta;tracks", 200, -1.0, 1.0) ;
1144 hESDprimaryTrackEtaNegTRDout->Sumw2();
1145 hESDprimaryTrackEtaNegTRDout->SetLineWidth(1);
1146 hESDprimaryTrackEtaNegTRDout->SetMarkerStyle(20);
1147 hESDprimaryTrackEtaNegTRDout->SetMarkerSize(0.7);
1148 hESDprimaryTrackEtaNegTRDout->SetLineColor(kBlue);
1149 hESDprimaryTrackEtaNegTRDout->SetMarkerColor(kBlue);
1150 if (fEnableAdvancedCheck)
1151 fHneg->AddLast(hESDprimaryTrackEtaNegTRDout);
1154 TH1F* hESDprimaryTrackEtaNegNoTRDout = new TH1F("hESDprimaryTrackEtaNegNoTRDout", "ESDs Neg primary tracks #eta with !kTRDout (p_{T} #geq 1.0 GeV/c);#eta;tracks", 200, -1.0, 1.0) ;
1155 hESDprimaryTrackEtaNegNoTRDout->Sumw2();
1156 hESDprimaryTrackEtaNegNoTRDout->SetLineWidth(1);
1157 hESDprimaryTrackEtaNegNoTRDout->SetMarkerStyle(25);
1158 hESDprimaryTrackEtaNegNoTRDout->SetMarkerSize(0.7);
1159 hESDprimaryTrackEtaNegNoTRDout->SetLineColor(kBlue);
1160 hESDprimaryTrackEtaNegNoTRDout->SetMarkerColor(kBlue);
1161 if (fEnableAdvancedCheck)
1162 fHneg->AddLast(hESDprimaryTrackEtaNegNoTRDout);
1165 TH1F* hESDprimaryTrackPhiNegTRDout = new TH1F("hESDprimaryTrackPhiNegTRDout", "ESDs Neg primary tracks #phi with kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);tracks", 72, 0., 360.) ;
1166 hESDprimaryTrackPhiNegTRDout->Sumw2();
1167 hESDprimaryTrackPhiNegTRDout->SetLineWidth(1);
1168 hESDprimaryTrackPhiNegTRDout->SetMarkerStyle(20);
1169 hESDprimaryTrackPhiNegTRDout->SetMarkerSize(0.7);
1170 hESDprimaryTrackPhiNegTRDout->SetLineColor(kBlue);
1171 hESDprimaryTrackPhiNegTRDout->SetMarkerColor(kBlue);
1172 if (fEnableAdvancedCheck)
1173 fHneg->AddLast(hESDprimaryTrackPhiNegTRDout);
1176 TH1F* hESDprimaryTrackPhiNegNoTRDout = new TH1F("hESDprimaryTrackPhiNegNoTRDout", "ESDs Neg primary tracks #phi with !kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);tracks", 72, 0., 360.) ;
1177 hESDprimaryTrackPhiNegNoTRDout->Sumw2();
1178 hESDprimaryTrackPhiNegNoTRDout->SetLineWidth(1);
1179 hESDprimaryTrackPhiNegNoTRDout->SetMarkerStyle(25);
1180 hESDprimaryTrackPhiNegNoTRDout->SetMarkerSize(0.7);
1181 hESDprimaryTrackPhiNegNoTRDout->SetLineColor(kBlue);
1182 hESDprimaryTrackPhiNegNoTRDout->SetMarkerColor(kBlue);
1183 if (fEnableAdvancedCheck)
1184 fHneg->AddLast(hESDprimaryTrackPhiNegNoTRDout);
1187 TH2F* hTOFmatchedExpTimeProVsPhiNeg = new TH2F("hTOFmatchedExpTimeProVsPhiNeg", "ESDs t_{TOF}-t_{p,exp} vs #phi at TOF (r=378.cm) (p_{T}<1GeV/c);#phi (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
1188 hTOFmatchedExpTimeProVsPhiNeg->Sumw2() ;
1189 if (fEnableAdvancedCheck)
1190 fHneg->AddLast(hTOFmatchedExpTimeProVsPhiNeg) ;
1193 TH2F* hTOFmatchedExpTimeProVsPhiVertexNeg = new TH2F("hTOFmatchedExpTimeProVsPhiVertexNeg", "ESDs t_{TOF}-t_{p,exp} vs #phi at vtx (p_{T}<1GeV/c);#phi (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
1194 hTOFmatchedExpTimeProVsPhiVertexNeg->Sumw2() ;
1195 if (fEnableAdvancedCheck)
1196 fHneg->AddLast(hTOFmatchedExpTimeProVsPhiVertexNeg) ;
1199 TH2F* hTOFmatchedExpTimeProVsPhiTPCNeg = new TH2F("hTOFmatchedExpTimeProVsPhiTPCNeg", "ESDs t_{TOF}-t_{p,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi_{out} (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
1200 hTOFmatchedExpTimeProVsPhiTPCNeg->Sumw2() ;
1201 if (fEnableAdvancedCheck)
1202 fHneg->AddLast(hTOFmatchedExpTimeProVsPhiTPCNeg) ;
1206 TH1F* hESDmatchedTrackEtaNegTRDout = new TH1F("hESDmatchedTrackEtaNegTRDout", "ESDs Neg matched tracks #eta with kTRDout (p_{T} #geq 1.0 GeV/c); #eta;tracks", 200, -1.0, 1.0) ;
1207 hESDmatchedTrackEtaNegTRDout->Sumw2();
1208 hESDmatchedTrackEtaNegTRDout->SetLineWidth(1);
1209 hESDmatchedTrackEtaNegTRDout->SetMarkerStyle(20);
1210 hESDmatchedTrackEtaNegTRDout->SetMarkerSize(0.7);
1211 hESDmatchedTrackEtaNegTRDout->SetLineColor(kBlue);
1212 hESDmatchedTrackEtaNegTRDout->SetMarkerColor(kBlue);
1213 if (fEnableAdvancedCheck)
1214 fHneg->AddLast(hESDmatchedTrackEtaNegTRDout);
1217 TH1F* hESDmatchedTrackEtaNegNoTRDout = new TH1F("hESDmatchedTrackEtaNegNoTRDout", "ESDs Neg matched tracks #eta with !kTRDout (p_{T} #geq 1.0 GeV/c);#eta;tracks", 200, -1.0, 1.0) ;
1218 hESDmatchedTrackEtaNegNoTRDout->Sumw2();
1219 hESDmatchedTrackEtaNegNoTRDout->SetLineWidth(1);
1220 hESDmatchedTrackEtaNegNoTRDout->SetMarkerStyle(25);
1221 hESDmatchedTrackEtaNegNoTRDout->SetMarkerSize(0.7);
1222 hESDmatchedTrackEtaNegNoTRDout->SetLineColor(kBlue);
1223 hESDmatchedTrackEtaNegNoTRDout->SetMarkerColor(kBlue);
1224 if (fEnableAdvancedCheck)
1225 fHneg->AddLast(hESDmatchedTrackEtaNegNoTRDout);
1228 TH1F* hESDmatchedTrackPhiNegTRDout = new TH1F("hESDmatchedTrackPhiNegTRDout", "ESDs Neg matched tracks #phi with kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);tracks", 72, 0., 360.) ;
1229 hESDmatchedTrackPhiNegTRDout->Sumw2();
1230 hESDmatchedTrackPhiNegTRDout->SetLineWidth(1);
1231 hESDmatchedTrackPhiNegTRDout->SetMarkerStyle(20);
1232 hESDmatchedTrackPhiNegTRDout->SetMarkerSize(0.7);
1233 hESDmatchedTrackPhiNegTRDout->SetLineColor(kBlue);
1234 hESDmatchedTrackPhiNegTRDout->SetMarkerColor(kBlue);
1235 if (fEnableAdvancedCheck)
1236 fHneg->AddLast(hESDmatchedTrackPhiNegTRDout);
1239 TH1F* hESDmatchedTrackPhiNegNoTRDout = new TH1F("hESDmatchedTrackPhiNegNoTRDout", "ESDs Neg matched tracks #phi with !kTRDout (p_{T} #geq 1.0 GeV/c); #phi_{out} (deg);tracks", 72, 0., 360.) ;
1240 hESDmatchedTrackPhiNegNoTRDout->Sumw2();
1241 hESDmatchedTrackPhiNegNoTRDout->SetLineWidth(1);
1242 hESDmatchedTrackPhiNegNoTRDout->SetMarkerStyle(25);
1243 hESDmatchedTrackPhiNegNoTRDout->SetMarkerSize(0.7);
1244 hESDmatchedTrackPhiNegNoTRDout->SetLineColor(kBlue);
1245 hESDmatchedTrackPhiNegNoTRDout->SetMarkerColor(kBlue);
1246 if (fEnableAdvancedCheck)
1247 fHneg->AddLast(hESDmatchedTrackPhiNegNoTRDout);
1250 TH2F* hTOFmatchedExpTimePiVsPhiTPCNeg = new TH2F("hTOFmatchedExpTimePiVsPhiTPCNeg", "ESDs t_{TOF}-t_{#pi,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi_{out} (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
1251 hTOFmatchedExpTimePiVsPhiTPCNeg->Sumw2() ;
1252 if (fEnableAdvancedCheck)
1253 fHneg->AddLast(hTOFmatchedExpTimePiVsPhiTPCNeg) ;
1256 TH2F* hTOFmatchedExpTimeKaVsPhiTPCNeg = new TH2F("hTOFmatchedExpTimeKaVsPhiTPCNeg", "ESDs t_{TOF}-t_{K,exp} vs #phi at outer TPC (p_{T}<1GeV/c);#phi_{out} (deg); t_{TOF}-t_{p,exp} [ps];Counts",72, 0.,360., nExpTimeSmallBins, fExpTimeSmallRangeMin, fExpTimeSmallRangeMax) ;
1257 hTOFmatchedExpTimeKaVsPhiTPCNeg->Sumw2() ;
1258 if (fEnableAdvancedCheck)
1259 fHneg->AddLast(hTOFmatchedExpTimeKaVsPhiTPCNeg) ;
1262 TH2F* hTOFprimaryEtaVsPhiOutNeg = new TH2F("hTOFprimaryEtaVsPhiOutNeg", "Negative tracks, p_{T}>1GeV/c;#phi_{out} (degree); #eta; Counts", 72, 0., 360., 20, -1.,1.) ;
1263 hTOFprimaryEtaVsPhiOutNeg->Sumw2() ;
1264 if (fEnableAdvancedCheck)
1265 fHneg->AddLast(hTOFprimaryEtaVsPhiOutNeg) ;
1268 TH2F* hTOFmatchedEtaVsPhiOutNeg = new TH2F("hTOFmatchedEtaVsPhiOutNeg", "Negative tracks, p_{T}>1GeV/c;#phi_{out} (degree); #eta; Counts", 72, 0., 360., 20, -1.,1.) ;
1269 hTOFmatchedEtaVsPhiOutNeg->Sumw2() ;
1270 if (fEnableAdvancedCheck)
1271 fHneg->AddLast(hTOFmatchedEtaVsPhiOutNeg) ;
1274 TH2F* hTOFprimaryPtVsPhiOutNeg = new TH2F("hTOFprimaryPtVsPhiOutNeg", "Negative tracks;#phi_{out}(degree); p_{T}(GeV/c); Counts", 500, 0., 5., 20, -1.,1.) ;
1275 hTOFprimaryPtVsPhiOutNeg->Sumw2() ;
1276 if (fEnableAdvancedCheck)
1277 fHneg->AddLast(hTOFprimaryPtVsPhiOutNeg) ;
1280 TH2F* hTOFmatchedPtVsPhiOutNeg = new TH2F("hTOFmatchedPtVsPhiOutNeg", "Negative tracks;#phi_{out}(degree); p_{T}(GeV/c); Counts", 500, 0., 5., 20, -1.,1.) ;
1281 hTOFmatchedPtVsPhiOutNeg->Sumw2() ;
1282 if (fEnableAdvancedCheck)
1283 fHneg->AddLast(hTOFmatchedPtVsPhiOutNeg) ;
1286 PostData(1, fHlist);
1287 PostData(2, fHlistTimeZero);
1288 PostData(3, fHlistPID);
1292 //________________________________________________________________________
1293 void AliAnalysisTaskTOFqa::UserExec(Option_t *)
1295 /* Main - executed for each event.
1296 It extracts event information and track information after selecting
1297 primary tracks via standard cuts. */
1300 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
1302 Printf("ERROR: Could not get ESDInputHandler");
1305 fESD = (AliESDEvent*) esdH->GetEvent();
1308 fESD=(AliESDEvent*)InputEvent();
1309 if (!fESD||!fESDpid) return;
1313 Printf("ERROR: fESD not available");
1317 AliPIDResponse::EStartTimeType_t startTimeMethodDefault = AliPIDResponse::kBest_T0;
1318 if (fESDpid->GetTOFPIDParams()) { // during reconstruction OADB not yet available
1319 startTimeMethodDefault = ((AliTOFPIDParams *)fESDpid->GetTOFPIDParams())->GetStartTimeMethod();
1324 /* get run number */
1325 Int_t runNb = fESD->GetRunNumber();
1329 // /* added PA: this ensure PID Response is correctly initialized!!! */
1330 // Int_t passNumber = 2; // this is needed
1331 // fESDpid->InitialiseEvent(fESD,passNumber); // after this call a default startTime method is selected
1333 //Get vertex info and apply vertex cut
1334 fVertex = (AliESDVertex*) fESD->GetPrimaryVertexTracks();
1335 if(fVertex->GetNContributors()<1) {
1337 fVertex = (AliESDVertex*) fESD->GetPrimaryVertexSPD();
1338 if(fVertex->GetNContributors()<1) fVertex = 0x0;
1340 if (!fVertex) return;
1341 if (! (TMath::Abs(fVertex->GetZv())<10.0) ) return;
1343 // info from V0 detector QA
1344 AliESDVZERO * vzero = fESD->GetVZEROData();
1345 Float_t V0Atime = vzero->GetV0ATime();
1346 Float_t V0Ctime = vzero->GetV0CTime();
1347 ((TH2F*)fHlistTimeZero->FindObject("hEventV0MeanVsVtx"))->Fill((V0Atime-V0Ctime)*0.5,(V0Atime+V0Ctime)*0.5);
1349 // info from T0 detector QA
1350 for (Int_t j=0;j<3;j++){
1351 fT0[j]= (Float_t) fESD->GetT0TOF(j);//ps
1352 if (fT0[j]>90000.) fT0[j]=99999.;//fix old default values to the new one
1355 Float_t matchingMomCut = 1.0; //GeV/c
1356 Float_t t0cut = 90000.;
1357 //Float_t t0cut =3 * t0spread; //use this cut to check t0 used in tof response
1358 // if(t0cut < 500) t0cut = 500;
1360 if(TMath::Abs(fT0[1]) < t0cut && TMath::Abs(fT0[2]) < t0cut ) {
1361 //&& TMath::Abs(fT0[2]-fT0[1]) < 500) //add this condition to check t0 used in tof response
1362 ((TH1F*)fHlistTimeZero->FindObject("hT0DetRes"))->Fill((fT0[2]-fT0[1])*0.5);
1363 ((TH1F*)fHlistTimeZero->FindObject("hEventT0DetAND"))->Fill(fT0[0]);
1364 ((TH2F*)fHlistTimeZero->FindObject("hEventT0MeanVsVtx"))->Fill((fT0[2]-fT0[1])*0.5,(fT0[2]+fT0[1])*0.5);
1366 if(TMath::Abs(fT0[1]) < t0cut){
1367 ((TH1F*)fHlistTimeZero->FindObject("hEventT0DetA"))->Fill(fT0[1]);
1369 if(TMath::Abs(fT0[2]) < t0cut){
1370 ((TH1F*)fHlistTimeZero->FindObject("hEventT0DetC"))->Fill(fT0[2]);
1373 // event timeZero QA via AliESDpid::SetTOFResponse()
1374 Double_t timeZero[4]={99999.,99999.,99999.,99999.};
1375 Double_t timeZeroRes[4]={99999.,99999.,99999.,99999.};
1377 TString timeZeroHisto[4]={"hT0fill","hT0TOF","hT0T0","hT0best"};
1378 TString timeZeroHistoRes[4]={"hT0fillRes","hT0TOFRes","hT0T0Res","hT0bestRes"};
1379 for (Int_t j=0;j<4;j++){
1380 fESDpid->SetTOFResponse(fESD, (AliESDpid::EStartTimeType_t) j);//(fill_t0, tof_t0, t0_t0, best_t0)
1381 timeZero[j]=fESDpid->GetTOFResponse().GetStartTime(10.); //timeZero for bin pT>10GeV/c
1382 timeZeroRes[j]=fESDpid->GetTOFResponse().GetStartTimeRes(10.); //timeZero for bin pT>10GeV/c
1383 ((TH1D*)(fHlistTimeZero->FindObject(timeZeroHisto[j].Data())))->Fill(timeZero[j]);
1384 ((TH1D*)(fHlistTimeZero->FindObject(timeZeroHistoRes[j].Data())))->Fill(timeZeroRes[j]);
1386 //response set to best_t0 by previous loop
1387 FillStartTimeMaskHisto();
1389 // loop over ESD tracks
1391 // fNPrimaryTracks=0;
1393 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
1394 AliESDtrack* track = fESD->GetTrack(iTracks);
1396 Printf("ERROR: Could not receive track %d", iTracks);
1399 //set response tof_t0 for all checks but one
1400 fESDpid->SetTOFResponse(fESD,AliESDpid::kTOF_T0);//(fill_t0, tof_t0, t0_t0, best_t0)
1402 //primary tracks selection: kTPCrefit and std cuts
1404 if(!fTrackFilter->IsSelected(track)) continue;
1407 Printf("No track filter found, skipping the track loop");
1411 Double_t eta=track->Eta();
1412 if (TMath::Abs(eta)>0.8) continue; //cut for acceptance
1414 Double_t mom=track->P();
1415 Double_t mom2 = mom*mom;
1416 Double_t length=track->GetIntegratedLength();
1417 Double_t pT = track->Pt();
1418 Double_t phi=track->Phi()*TMath::RadToDeg();
1419 track->GetIntegratedTimes(fTrkExpTimes);
1421 ((TH1F*)fHlist->FindObject("hESDprimaryTrackP"))->Fill(mom);
1422 ((TH1F*)fHlist->FindObject("hESDprimaryTrackPt"))->Fill(pT);
1423 if (pT>=matchingMomCut) {
1424 ((TH1F*)fHlist->FindObject("hTOFprimaryESDeta"))->Fill(eta);
1425 ((TH1F*)fHlist->FindObject("hTOFprimaryESDphi"))->Fill(phi);
1428 //get track phi at TPC outer radius
1429 Double_t tpcoutcoord[3]={0.,0.,0.};
1430 track->GetOuterXYZ(tpcoutcoord);
1431 Double_t phiOuterTPC=TMath::ATan2(tpcoutcoord[1],tpcoutcoord[0])*TMath::RadToDeg();
1432 if (phiOuterTPC<0) phiOuterTPC+= (2*TMath::Pi()*TMath::RadToDeg());
1435 if (fEnableAdvancedCheck){
1436 if (track->GetSign()>0){
1437 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPPos"))->Fill(mom);
1438 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPtPos"))->Fill(pT);
1439 ((TH2F*)fHpos->FindObject("hTOFprimaryPtVsPhiOutPos"))->Fill(phiOuterTPC,pT);
1440 if (pT>=matchingMomCut){
1441 ((TH1F*)fHpos->FindObject("hTOFprimaryESDetaPos"))->Fill(eta);
1442 ((TH1F*)fHpos->FindObject("hTOFprimaryESDphiPos"))->Fill(phiOuterTPC);
1443 ((TH2F*)fHpos->FindObject("hTOFprimaryEtaVsPhiOutPos"))->Fill(phiOuterTPC,eta);
1445 if ( (track->IsOn(AliESDtrack::kTRDout)) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1446 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPtPosTRDout"))->Fill(pT);
1447 if (pT>=matchingMomCut) {
1448 ((TH1F*)fHpos->FindObject("hESDprimaryTrackEtaPosTRDout"))->Fill(eta);
1449 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPhiPosTRDout"))->Fill(phiOuterTPC);
1452 if ((!(track->IsOn(AliESDtrack::kTRDout))) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1453 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPtPosNoTRDout"))->Fill(pT);
1454 if (pT>=matchingMomCut) {
1455 ((TH1F*)fHpos->FindObject("hESDprimaryTrackEtaPosNoTRDout"))->Fill(eta);
1456 ((TH1F*)fHpos->FindObject("hESDprimaryTrackPhiPosNoTRDout"))->Fill(phiOuterTPC);
1461 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPNeg"))->Fill(mom);
1462 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPtNeg"))->Fill(pT);
1463 ((TH2F*)fHneg->FindObject("hTOFprimaryPtVsPhiOutNeg"))->Fill(phiOuterTPC,pT);
1465 if (pT>=matchingMomCut){
1466 ((TH1F*)fHneg->FindObject("hTOFprimaryESDetaNeg"))->Fill(eta);
1467 ((TH1F*)fHneg->FindObject("hTOFprimaryESDphiNeg"))->Fill(phiOuterTPC);
1468 ((TH2F*)fHneg->FindObject("hTOFprimaryEtaVsPhiOutNeg"))->Fill(phiOuterTPC,eta);
1470 if ((track->IsOn(AliESDtrack::kTRDout)) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1471 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPtNegTRDout"))->Fill(pT);
1472 if (pT>=matchingMomCut) {
1473 ((TH1F*)fHneg->FindObject("hESDprimaryTrackEtaNegTRDout"))->Fill(eta);
1474 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPhiNegTRDout"))->Fill(phiOuterTPC);
1477 if ((!(track->IsOn(AliESDtrack::kTRDout))) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1478 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPtNegNoTRDout"))->Fill(pT);
1479 if (pT>=matchingMomCut){
1480 ((TH1F*)fHneg->FindObject("hESDprimaryTrackEtaNegNoTRDout"))->Fill(eta);
1481 ((TH1F*)fHneg->FindObject("hESDprimaryTrackPhiNegNoTRDout"))->Fill(phiOuterTPC);
1485 }//end flag advanced check
1487 //matched tracks selection: kTOFout and kTIME
1488 if ( (track->IsOn(AliESDtrack::kTOFout)) &&
1489 (track->IsOn(AliESDtrack::kTIME)) &&
1490 (track->IsOn(AliESDtrack::kTPCout)) ) {
1492 Double_t tofTime=track->GetTOFsignal();//in ps
1493 Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps
1494 Double_t tofToT=track->GetTOFsignalToT(); //in ps
1495 Int_t channel=track->GetTOFCalChannel();
1496 Int_t volId[5]; //(sector, plate,strip,padZ,padX)
1497 AliTOFGeometry::GetVolumeIndices(channel,volId);
1499 if (pT>=0.3) fNTOFtracks++; //matched counter
1500 Double_t tof= tofTime*1E-3; // ns, average T0 fill subtracted, no info from T0detector
1501 ((TH1F*)fHlist->FindObject("hTOFmatchedESDtime"))->Fill(tof); //ns
1502 ((TH1F*)fHlist->FindObject("hTOFmatchedESDrawTime"))->Fill(tofTimeRaw*1E-3); //ns
1503 ((TH1F*)fHlist->FindObject("hTOFmatchedESDToT"))->Fill(tofToT);
1504 ((TH1F*)fHlist->FindObject("hTOFmatchedESDtrkLength"))->Fill(length);
1505 ((TH1F*)fHlist->FindObject("hTOFmatchedESDP"))->Fill(mom);
1506 ((TH1F*)fHlist->FindObject("hTOFmatchedESDPt"))->Fill(pT);
1507 if (pT>=matchingMomCut){
1508 ((TH1F*)fHlist->FindObject("hTOFmatchedESDeta"))->Fill(eta);
1509 ((TH1F*)fHlist->FindObject("hTOFmatchedESDphi"))->Fill(phi);
1511 if (track->GetSign()>0)
1512 ((TH2F*)fHlist->FindObject("hTOFmatchedDxVsPtPos"))->Fill(pT,track->GetTOFsignalDx());
1513 else ((TH2F*)fHlist->FindObject("hTOFmatchedDxVsPtNeg"))->Fill(pT,track->GetTOFsignalDx());
1514 ((TH2F*)fHlist->FindObject("hTOFmatchedDzVsStrip"))->Fill((Int_t)GetStripIndex(volId),track->GetTOFsignalDz());
1515 ((TProfile*)fHlist->FindObject("hTOFmatchedDxVsCh"))->Fill(channel,track->GetTOFsignalDx());
1516 ((TProfile*)fHlist->FindObject("hTOFmatchedDzVsCh"))->Fill(channel,track->GetTOFsignalDz());
1518 if (fEnableAdvancedCheck){
1519 if (track->GetSign()>0){
1520 ((TH1F*)fHpos->FindObject("hTOFmatchedESDtrkLengthPos"))->Fill(length);
1521 ((TH1F*)fHpos->FindObject("hTOFmatchedESDPPos"))->Fill(mom);
1522 ((TH1F*)fHpos->FindObject("hTOFmatchedESDPtPos"))->Fill(pT);
1523 ((TH2F*)fHpos->FindObject("hTOFmatchedPtVsPhiOutPos"))->Fill(phiOuterTPC,pT);
1524 if (pT>=matchingMomCut){
1525 ((TH1F*)fHpos->FindObject("hTOFmatchedESDetaPos"))->Fill(eta);
1526 ((TH1F*)fHpos->FindObject("hTOFmatchedESDphiPos"))->Fill(phiOuterTPC);
1527 ((TH2F*)fHpos->FindObject("hTOFmatchedEtaVsPhiOutPos"))->Fill(phiOuterTPC,eta);
1529 if ( (track->IsOn(AliESDtrack::kTRDout)) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1530 ((TH1F*)fHpos->FindObject("hESDmatchedTrackPtPosTRDout"))->Fill(pT);
1531 if (pT>=matchingMomCut){
1532 ((TH1F*)fHpos->FindObject("hESDmatchedTrackEtaPosTRDout"))->Fill(eta);
1533 ((TH1F*)fHpos->FindObject("hESDmatchedTrackPhiPosTRDout"))->Fill(phiOuterTPC);
1536 if ((!(track->IsOn(AliESDtrack::kTRDout))) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1537 ((TH1F*)fHpos->FindObject("hESDmatchedTrackPtPosNoTRDout"))->Fill(pT);
1538 if (pT>=matchingMomCut) {
1539 ((TH1F*)fHpos->FindObject("hESDmatchedTrackEtaPosNoTRDout"))->Fill(eta);
1540 ((TH1F*)fHpos->FindObject("hESDmatchedTrackPhiPosNoTRDout"))->Fill(phiOuterTPC);
1545 ((TH1F*)fHneg->FindObject("hTOFmatchedESDtrkLengthNeg"))->Fill(length);
1546 ((TH1F*)fHneg->FindObject("hTOFmatchedESDPNeg"))->Fill(mom);
1547 ((TH1F*)fHneg->FindObject("hTOFmatchedESDPtNeg"))->Fill(pT);
1548 ((TH2F*)fHneg->FindObject("hTOFmatchedPtVsPhiOutNeg"))->Fill(phiOuterTPC,pT);
1550 if (pT>=matchingMomCut) {
1551 ((TH1F*)fHneg->FindObject("hTOFmatchedESDetaNeg"))->Fill(eta);
1552 ((TH1F*)fHneg->FindObject("hTOFmatchedESDphiNeg"))->Fill(phiOuterTPC);
1553 ((TH2F*)fHneg->FindObject("hTOFmatchedEtaVsPhiOutNeg"))->Fill(phiOuterTPC,eta);
1555 if ((track->IsOn(AliESDtrack::kTRDout)) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1556 ((TH1F*)fHneg->FindObject("hESDmatchedTrackPtNegTRDout"))->Fill(pT);
1557 if (pT>=matchingMomCut) {
1558 ((TH1F*)fHneg->FindObject("hESDmatchedTrackEtaNegTRDout"))->Fill(eta);
1559 ((TH1F*)fHneg->FindObject("hESDmatchedTrackPhiNegTRDout"))->Fill(phiOuterTPC);
1562 if ((!(track->IsOn(AliESDtrack::kTRDout))) && (track->IsOn(AliESDtrack::kTPCout)) ) {
1563 ((TH1F*)fHneg->FindObject("hESDmatchedTrackPtNegNoTRDout"))->Fill(pT);
1564 if (pT>=matchingMomCut) {
1565 ((TH1F*)fHneg->FindObject("hESDmatchedTrackEtaNegNoTRDout"))->Fill(eta);
1566 ((TH1F*)fHneg->FindObject("hESDmatchedTrackPhiNegNoTRDout"))->Fill(phiOuterTPC);
1570 }//end advanced check
1572 //basic PID performance check
1574 printf("WARNING: track with negative TOF time found! Skipping this track for PID checks\n");
1578 printf("WARNING: track with negative square momentum found! Skipping this track for PID checks\n");
1582 printf("WARNING: track with negative length found!Skipping this track for PID checks\n");
1585 Double_t c=TMath::C()*1.E-9;// m/ns
1586 Double_t mass=0.; //GeV
1587 length =length*0.01; // in meters
1589 Double_t beta=length/tof;
1590 Double_t fact= (tof/length)*(tof/length) -1.;
1592 mass = -mom*TMath::Sqrt(-fact);
1594 mass = mom*TMath::Sqrt(fact);
1596 ((TH2F*)fHlistPID->FindObject("hTOFmatchedESDpVsBeta"))->Fill(mom,beta);
1597 ((TH1F*) fHlistPID->FindObject("hTOFmatchedMass"))->Fill(mass);
1600 Bool_t isValidBeta[AliPID::kSPECIES]={0,0,0,0,0};
1601 for (Int_t specie = 0; specie < AliPID::kSPECIES; specie++){
1602 fSigmaSpecie[specie] = fESDpid->GetTOFResponse().GetExpectedSigma(mom, fTrkExpTimes[specie], AliPID::ParticleMass(specie));
1603 beta=1/TMath::Sqrt(1+AliPID::ParticleMass(specie)*AliPID::ParticleMass(specie)/(mom2));
1605 fThExpTimes[specie]=length*1.E3/(beta*c);//ps
1606 isValidBeta[specie]=kTRUE;
1608 fThExpTimes[specie]=1E-10;
1609 isValidBeta[specie]=kFALSE;
1612 Float_t timeZeroTOF = (Float_t) fESDpid->GetTOFResponse().GetStartTime(pT);
1613 if (isValidBeta[AliPID::kPion]){
1614 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsEta"))->Fill((Int_t)GetStripIndex(volId),tofTime-fTrkExpTimes[AliPID::kPion]);//ps
1615 ((TH1F*)fHlistPID->FindObject("hTOFmatchedExpTimePi"))->Fill(tofTime-fTrkExpTimes[AliPID::kPion]);//ps
1616 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsP"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kPion]));
1617 ((TH1F*)fHlistPID->FindObject("hTOFtheoreticalExpTimePi"))->Fill(tofTime-fThExpTimes[AliPID::kPion]);//ps
1618 ((TH2F*)fHlistPID->FindObject("hTOFtheoreticalExpTimePiVsP"))->Fill(mom,(tofTime-fThExpTimes[AliPID::kPion]));
1619 ((TH2F*)fHlistPID->FindObject("hTOFExpSigmaPi"))->Fill(pT,(tofTime-fTrkExpTimes[AliPID::kPion])/fSigmaSpecie[AliPID::kPion]);
1620 ((TH2F*)fHlistPID->FindObject("hTimeT0subtractedPionVsP"))->Fill(mom,tofTime-fTrkExpTimes[AliPID::kPion]-timeZeroTOF);
1623 if (isValidBeta[AliPID::kKaon]){
1624 ((TH1F*)fHlistPID->FindObject("hTOFmatchedExpTimeKa"))->Fill(tofTime-fTrkExpTimes[AliPID::kKaon]);//ps
1625 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeKaVsP"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kKaon]));
1626 ((TH1F*)fHlistPID->FindObject("hTOFtheoreticalExpTimeKa"))->Fill(tofTime-fThExpTimes[AliPID::kKaon]);//ps
1627 ((TH2F*)fHlistPID->FindObject("hTOFtheoreticalExpTimeKaVsP"))->Fill(mom,(tofTime-fThExpTimes[AliPID::kKaon]));
1628 ((TH2F*)fHlistPID->FindObject("hTOFExpSigmaKa"))->Fill(pT,(tofTime-fTrkExpTimes[AliPID::kKaon])/fSigmaSpecie[AliPID::kKaon]);
1629 ((TH2F*)fHlistPID->FindObject("hTimeT0subtractedKaonVsP"))->Fill(mom,tofTime-fTrkExpTimes[AliPID::kKaon]-timeZeroTOF);
1631 if (isValidBeta[AliPID::kProton]){
1632 ((TH1F*)fHlistPID->FindObject("hTOFmatchedExpTimePro"))->Fill(tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1633 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeProVsP"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kProton]));
1634 ((TH1F*)fHlistPID->FindObject("hTOFtheoreticalExpTimePro"))->Fill(tofTime-fThExpTimes[AliPID::kProton]);//ps
1635 ((TH2F*)fHlistPID->FindObject("hTOFtheoreticalExpTimeProVsP"))->Fill(mom,(tofTime-fThExpTimes[AliPID::kProton]));
1636 ((TH2F*)fHlistPID->FindObject("hTOFExpSigmaPro"))->Fill(pT,(tofTime-fTrkExpTimes[AliPID::kProton])/fSigmaSpecie[AliPID::kProton]);
1637 ((TH2F*)fHlistPID->FindObject("hTimeT0subtractedProtonVsP"))->Fill(mom,tofTime-fTrkExpTimes[AliPID::kProton]-timeZeroTOF);
1640 if (fEnableAdvancedCheck && (pT<1.)) {
1641 Double_t pos[3]={0.,0.,0.};
1642 track->GetXYZAt(378.,5.,pos);
1643 if ((pos[0]==0.)&&(pos[1]==0.)&&(pos[2]==0.))continue;
1645 Double_t phiTOF=TMath::ATan2(pos[1],pos[0])*TMath::RadToDeg();
1646 if (phiTOF<0) phiTOF+= (2*TMath::Pi()*TMath::RadToDeg());
1648 if (isValidBeta[AliPID::kProton]){
1649 if (track->GetSign()>0){
1650 ((TH2F*)fHpos->FindObject("hTOFmatchedExpTimeProVsPhiPos"))->Fill(phiTOF,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1651 ((TH2F*)fHpos->FindObject("hTOFmatchedExpTimeProVsPhiVertexPos"))->Fill(phi,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1653 ((TH2F*)fHneg->FindObject("hTOFmatchedExpTimeProVsPhiNeg"))->Fill(phiTOF,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1654 ((TH2F*)fHneg->FindObject("hTOFmatchedExpTimeProVsPhiVertexNeg"))->Fill(phi,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1658 // track->GetOuterXYZ(pos);
1659 // Double_t phiOuterTPC=TMath::ATan2(pos[1],pos[0])*TMath::RadToDeg();
1660 // if (phiOuterTPC<0) phiOuterTPC+= (2*TMath::Pi()*TMath::RadToDeg());
1662 if (track->GetSign()>0){
1663 if (isValidBeta[AliPID::kProton])
1664 ((TH2F*)fHpos->FindObject("hTOFmatchedExpTimeProVsPhiTPCPos"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1665 if (isValidBeta[AliPID::kPion])
1666 ((TH2F*)fHpos->FindObject("hTOFmatchedExpTimePiVsPhiTPCPos"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kPion]);//ps
1667 if (isValidBeta[AliPID::kKaon])
1668 ((TH2F*)fHpos->FindObject("hTOFmatchedExpTimeKaVsPhiTPCPos"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kKaon]);//ps
1670 if ((phiOuterTPC<=30) || ((phiOuterTPC>=150)&&(phiOuterTPC<=230)) || (phiOuterTPC>=310) ) { //TRD sectors
1671 if (isValidBeta[AliPID::kPion])
1672 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsPTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kPion]));
1673 if (isValidBeta[AliPID::kKaon])
1674 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeKaVsPTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kKaon]));
1675 if (isValidBeta[AliPID::kProton])
1676 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeProVsPTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kProton]));
1678 if ( ((phiOuterTPC>=50)&&(phiOuterTPC<=130)) || ((phiOuterTPC>=250)&&(phiOuterTPC<=290)) ) {//no TRD sectors
1679 if (isValidBeta[AliPID::kPion])
1680 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsPNoTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kPion]));
1681 if (isValidBeta[AliPID::kKaon])
1682 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeKaVsPNoTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kKaon]));
1683 if (isValidBeta[AliPID::kProton])
1684 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeProVsPNoTRDPos"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kProton]));
1687 if (isValidBeta[AliPID::kPion])
1688 ((TH2F*)fHneg->FindObject("hTOFmatchedExpTimePiVsPhiTPCNeg"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kPion]);//ps
1689 if (isValidBeta[AliPID::kKaon])
1690 ((TH2F*)fHneg->FindObject("hTOFmatchedExpTimeKaVsPhiTPCNeg"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kKaon]);//ps
1691 if (isValidBeta[AliPID::kProton])
1692 ((TH2F*)fHneg->FindObject("hTOFmatchedExpTimeProVsPhiTPCNeg"))->Fill(phiOuterTPC,tofTime-fTrkExpTimes[AliPID::kProton]);//ps
1694 if ((phiOuterTPC<=30) || ((phiOuterTPC>=150)&&(phiOuterTPC<=230)) || (phiOuterTPC>=310) ) { //TRD sectors
1695 if (isValidBeta[AliPID::kPion])
1696 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsPTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kPion]));
1697 if (isValidBeta[AliPID::kKaon])
1698 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeKaVsPTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kKaon]));
1699 if (isValidBeta[AliPID::kProton])
1700 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeProVsPTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kProton]));
1702 if ( ((phiOuterTPC>=50)&&(phiOuterTPC<=130)) || ((phiOuterTPC>=250)&&(phiOuterTPC<=290)) ) {//no TRD sectors
1703 if (isValidBeta[AliPID::kPion])
1704 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimePiVsPNoTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kPion]));
1705 if (isValidBeta[AliPID::kKaon])
1706 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeKaVsPNoTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kKaon]));
1707 if (isValidBeta[AliPID::kProton])
1708 ((TH2F*)fHlistPID->FindObject("hTOFmatchedExpTimeProVsPNoTRDNeg"))->Fill(mom,(tofTime-fTrkExpTimes[AliPID::kProton]));
1711 }//end advanced checks && cut on pT for t-texp phi distrib
1713 if (ComputeTimeZeroByTOF1GeV()){
1714 if ((pT>0.95)&&(pT<1.05)){
1715 ((TH2F*)fHlistPID->FindObject("hTOFmatchedTimePion1GeV"))->Fill(fMyTimeZeroTOFtracks,tofTime-fMyTimeZeroTOF-fTrkExpTimes[AliPID::kPion]);
1717 }//fill timeZero TOF vs number of tracks used
1719 //re-set response kFILL_T0 to check post-alignment wih OADB
1720 fESDpid->SetTOFResponse(fESD,AliESDpid::kFILL_T0);//(fill_t0, tof_t0, t0_t0, best_t0)
1721 Float_t startTimeFill=fESDpid->GetTOFResponse().GetStartTime(mom); //timeZero for bin pT>10GeV/c
1722 ((TH1F*)fHlistPID->FindObject("hExpTimePiFillSub"))->Fill(tofTime-fTrkExpTimes[AliPID::kPion]-startTimeFill);//ps
1727 }//end loop on tracks
1729 ((TH1F*)fHlist->FindObject("hTOFmatchedPerEvt"))->Fill(fNTOFtracks) ;
1730 ((TH2F*)fHlistTimeZero->FindObject("hT0TOFvsNtrk"))->Fill(fNTOFtracks,timeZero[AliESDpid::kTOF_T0]);
1732 fESDpid->SetTOFResponse(fESD,startTimeMethodDefault);//restore value set by AliPIDResponseTask for subsequent wagons
1734 PostData(1, fHlist);
1735 PostData(2, fHlistTimeZero);
1736 PostData(3, fHlistPID);
1741 //________________________________________________________________________
1742 void AliAnalysisTaskTOFqa::Terminate(Option_t *)
1744 //check on output validity
1745 fHlist = dynamic_cast<TList*> (GetOutputData(1));
1746 if (!fHlist || !fHlistTimeZero) {
1747 Printf("ERROR: lists not available");
1753 //---------------------------------------------------------------
1754 Int_t AliAnalysisTaskTOFqa::GetStripIndex(const Int_t * const in)
1756 /* return tof strip index between 0 and 91 */
1758 Int_t nStripA = AliTOFGeometry::NStripA();
1759 Int_t nStripB = AliTOFGeometry::NStripB();
1760 Int_t nStripC = AliTOFGeometry::NStripC();
1762 Int_t iplate = in[1];
1763 Int_t istrip = in[2];
1765 Int_t stripOffset = 0;
1771 stripOffset = nStripC;
1774 stripOffset = nStripC+nStripB;
1777 stripOffset = nStripC+nStripB+nStripA;
1780 stripOffset = nStripC+nStripB+nStripA+nStripB;
1787 if (stripOffset<0 || stripOffset>92) return -1;
1789 return (stripOffset+istrip);
1792 //-----------------------------------------------------------------
1793 void AliAnalysisTaskTOFqa::FillStartTimeMaskHisto()
1795 /* set pid response to use best_T0 and for each
1796 accepted track fills the histogram with the
1800 //set response best_t0
1801 //fESDpid->SetTOFResponse(fESD,AliESDpid::kBest_T0);
1803 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
1804 AliESDtrack* track = fESD->GetTrack(iTracks);
1806 Printf("ERROR: Could not receive track %d", iTracks);
1809 //primary tracks selection: kTPCrefit and std cuts
1811 if(!fTrackFilter->IsSelected(track)) continue;
1814 Printf("No track filter found, skipping the track loop");
1817 if (TMath::Abs(track->Eta())>0.8) continue; //cut for acceptance
1819 Int_t StartTimeBit = fESDpid->GetTOFResponse().GetStartTimeMask(track->P());
1820 ((TH2F*)fHlistTimeZero->FindObject("hStartTimeMask"))->Fill(track->P(),StartTimeBit);
1822 //matched tracks selection: kTOFout and kTIME
1823 if ( (track->IsOn(AliESDtrack::kTOFout)) &&
1824 (track->IsOn(AliESDtrack::kTIME)) &&
1825 (track->IsOn(AliESDtrack::kTPCout)) ) {
1826 ((TH2F*)fHlistTimeZero->FindObject("hStartTimeMaskMatched"))->Fill(track->P(),StartTimeBit);
1832 //----------------------------------------------------
1833 Bool_t AliAnalysisTaskTOFqa::ComputeTimeZeroByTOF1GeV()
1835 /* compute T0-TOF for tracks within momentum range [0.95, 1.05] */
1837 AliTOFT0v1 *fTOFT0v1 = new AliTOFT0v1(fESDpid); // TOF-T0 v1
1838 fTOFT0v1->Init(fESD);
1839 //AliTOFT0v1 *fTOFT0v1 = new AliTOFT0v1(fESDpid);
1840 fTOFT0v1->DefineT0("all", 0.95, 1.05);
1841 fMyTimeZeroTOF = -1000. * fTOFT0v1->GetResult(0);
1842 fMyTimeZeroTOFsigma = 1000. * fTOFT0v1->GetResult(1);
1843 fMyTimeZeroTOFtracks = fTOFT0v1->GetResult(3);
1844 Bool_t hasTimeZeroTOF = kFALSE;
1845 if (fTOFT0v1) delete fTOFT0v1;
1846 /* check T0-TOF sigma */
1847 if (fMyTimeZeroTOFsigma < 250.)
1848 hasTimeZeroTOF = kTRUE;
1849 return hasTimeZeroTOF;