AliPhysics  aaf9c62 (aaf9c62)
AliAnalysisTaskSEHFQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
19 //
20 // AliAnalysisTaskSE for HF quality assurance
21 //
22 // Author: Chiara Bianchin, chiara.bianchin@pd.infn.it
24 
25 #include <Riostream.h>
26 #include <TClonesArray.h>
27 #include <TCanvas.h>
28 #include <TList.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 #include <TH3F.h>
32 #include <TProfile2D.h>
33 #include <TDatabasePDG.h>
34 
35 #include <AliAnalysisDataSlot.h>
36 #include <AliAnalysisDataContainer.h>
37 #include "AliAnalysisManager.h"
38 #include "AliESDtrack.h"
39 #include "AliESDVertex.h"
40 #include "AliVertexerTracks.h"
41 #include "AliPID.h"
42 #include "AliPIDResponse.h"
43 #include "AliTPCPIDResponse.h"
44 #include "AliAODHandler.h"
45 #include "AliAODEvent.h"
46 #include "AliAODVertex.h"
47 #include "AliAODTrack.h"
48 #include "AliAODMCParticle.h"
49 #include "AliAODMCHeader.h"
51 #include "AliAODRecoCascadeHF.h"
52 #include "AliAnalysisVertexingHF.h"
53 #include "AliAnalysisTaskSE.h"
54 #include "AliCounterCollection.h"
55 #include "AliRDHFCuts.h"
57 #include "AliRDHFCutsD0toKpipipi.h"
58 #include "AliRDHFCutsDstoKKpi.h"
60 #include "AliRDHFCutsD0toKpi.h"
61 #include "AliRDHFCutsLctopKpi.h"
62 #include "AliRDHFCutsLctoV0.h"
63 #include "AliVertexingHFUtils.h"
64 #include "AliInputEventHandler.h"
65 #include "AliMultSelection.h"
66 
67 #include "AliFlowEvent.h"
68 #include "AliFlowTrackCuts.h"
69 #include "AliFlowTrackSimple.h"
70 #include "AliFlowVector.h"
71 
72 #include "AliTRDTriggerAnalysis.h"
73 
74 #include "AliAnalysisTaskSEHFQA.h"
75 
76 using std::cout;
77 using std::endl;
78 
79 
81 ClassImp(AliAnalysisTaskSEHFQA);
83 
84 //____________________________________________________________________________
85 
87  , fOutputEntries(0x0)
88  , fOutputPID(0x0)
89  , fOutputTrack(0x0)
90  , fOutputCounters(0x0)
91  , fOutputCheckCentrality(0x0)
92  , fOutputEvSelection(0x0)
93  , fOutputFlowObs(0x0)
94  , fDecayChannel(AliAnalysisTaskSEHFQA::kD0toKpi)
95  , fCuts(0x0)
96  , fFlowEvent(0x0)
97  , fRFPcuts(0x0)
98  , fEstimator(AliRDHFCuts::kCentTRK)
99  , fReadMC(kFALSE)
100  , fSimpleMode(kFALSE)
101  , fUseSelectionBit(kTRUE)
102  , fOnOff()
103  , fFillDistrTrackEffChecks(kFALSE)
104  , fAODProtection(1)
105  , fHisNentries(0)
106  , fHisNentriesSelBit(0)
107  , fHisTOFflags(0)
108  , fHisTOFsig(0)
109  , fHisTOFstartTimeMask(0)
110  , fHisTOFstartTimeRes(0)
111  , fHisTOFstartTimeDistrib(0)
112  , fHisTOFtime(0)
113  , fHisTOFtimeKaonHyptime(0)
114  , fHisTOFtimeKaonHyptimeAC(0)
115  , fHisTOFsigmaKSigPid(0)
116  , fHisTOFsigmaPionSigPid(0)
117  , fHisTOFsigmaProtonSigPid(0)
118  , fHisTOFsigPid3sigPion(0)
119  , fHisTOFsigPid3sigKaon(0)
120  , fHisTOFsigPid3sigProton(0)
121  , fHisTPCsig(0)
122  , fHisTPCsigvsp(0)
123  , fHisTPCsigvspAC(0)
124  , fHisTPCsigmaK(0)
125  , fHisTPCsigmaPion(0)
126  , fHisTPCsigmaProton(0)
127  , fHisTPCsigNvsPtAllTracks(0)
128  , fHisTPCsigNvsPhiAllTracks(0)
129  , fHisTPCsigNvsEtaAllTracks(0)
130  , fHisTPCsigNvsPtDaughters(0)
131  , fHisTPCsigNvsPhiDaughters(0)
132  , fHisTPCsigNvsEtaDaughters(0)
133  , fHisTOFsigmaMCKSigPid(0)
134  , fHisTOFsigmaMCPionSigPid(0)
135  , fHisTOFsigmaMCProtonSigPid(0)
136  , fHisTPCsigmaMCK(0)
137  , fHisTPCsigmaMCPion(0)
138  , fHisTPCsigmaMCProton(0)
139  , fHisnClsITS(0)
140  , fHisnClsITSselTr(0)
141  , fHisnClsITSSA(0)
142  , fHisnClsITSSAspdAny(0)
143  , fHisnClsITSSAspdIn(0)
144  , fHisnClsITSSAspdOut(0)
145  , fHisnLayerITS(0)
146  , fHisnLayerITSselTr(0)
147  , fHisnLayerITSsa(0)
148  , fHisnClsSPD(0)
149  , fHisptGoodTr(0)
150  , fHisptGoodTrFromDaugh(0)
151  , fHisptGoodTrFromDaugh_filt(0)
152  , fHisdistrGoodTr(0)
153  , fHisdistrSelTr(0)
154  , fHisd0dau(0)
155  , fHisd0dau_filt(0)
156  , fHisd0dauphi(0)
157  , fHisd0dauphi_filt(0)
158  , fHisd0zdau(0)
159  , fHisd0zdau_filt(0)
160  , fHisd0zdauphi(0)
161  , fHisd0zdauphi_filt(0)
162  , fHisd0TracksSPDin(0)
163  , fHisd0TracksSPDany(0)
164  , fHisd0TracksFilterBit4(0)
165  , fHisd0TracksTPCITSSPDany(0)
166  , fHisPtDaughters(0)
167  , fHisPhiDaughters(0)
168  , fHisEtaDaughters(0)
169  , fHisEtavsPhiDaughters(0)
170  , fHisNTPCclsvsPtDaughters(0)
171  , fHisNTPCclsvsPhiDaughters(0)
172  , fHisNTPCclsvsEtaDaughters(0)
173  , fHisNTPCCrossedRowsvsPtDaughters(0)
174  , fHisNTPCCrossedRowsvsPhiDaughters(0)
175  , fHisNTPCCrossedRowsvsEtaDaughters(0)
176  , fHisRatioCRowsOverFclsvsPtDaughters(0)
177  , fHisRatioCRowsOverFclsvsPhiDaughters(0)
178  , fHisRatioCRowsOverFclsvsEtaDaughters(0)
179  , fHisNITSclsvsPtDaughters(0)
180  , fHisNITSclsvsPhiDaughters(0)
181  , fHisNITSclsvsEtaDaughters(0)
182  , fHisSPDclsDaughters(0)
183  , fHisPtAllTracks(0)
184  , fHisPhiAllTracks(0)
185  , fHisEtaAllTracks(0)
186  , fHisEtavsPhiAllTracks(0)
187  , fHisNTPCclsvsPtAllTracks(0)
188  , fHisNTPCclsvsPhiAllTracks(0)
189  , fHisNTPCclsvsEtaAllTracks(0)
190  , fHisNTPCCrossedRowsvsPtAllTracks(0)
191  , fHisNTPCCrossedRowsvsPhiAllTracks(0)
192  , fHisNTPCCrossedRowsvsEtaAllTracks(0)
193  , fHisRatioCRowsOverFclsvsPtAllTracks(0)
194  , fHisRatioCRowsOverFclsvsPhiAllTracks(0)
195  , fHisRatioCRowsOverFclsvsEtaAllTracks(0)
196  , fHisNITSclsvsPtAllTracks(0)
197  , fHisNITSclsvsPhiAllTracks(0)
198  , fHisNITSclsvsEtaAllTracks(0)
199  , fHisSPDclsAllTracks(0)
200  , fHisdistrFakeTr(0)
201  , fHisd0f(0)
202  , fHisd0f_filt(0)
203  , fHisptFakeTr(0)
204  , fHisptFakeTrFromDaugh(0)
205  , fHisptFakeTrFromDaughFilt(0)
206  , fHisNtracklets(0)
207  , fHisNtracklets01(0)
208  , fHisNtracklets01AllEv(0)
209  , fHisMult(0)
210  , fHisMultFBit4(0)
211  , fHisMultComb05(0)
212  , fHisMultComb08(0)
213  , fHisNtrackletsIn(0)
214  , fHisMultIn(0)
215  , fHisNtrackletsOut(0)
216  , fHisMultOut(0)
217  , fHisMultvsPercentile(0)
218  , fHisntrklvsPercentile(0)
219  , fHisntrklvsPercentile01(0)
220  , fHisntrklvsPercentile01AllEv(0)
221  , fHisnTPCTracksvsPercentile(0)
222  , fHisnTPCITSTracksvsPercentile(0)
223  , fHisnTPCITS1SPDTracksvsPercentile(0)
224  , fHisStdEstimSignalPercentile(0)
225  , fHisStdEstimSignalNtrackletsIn(0)
226  , fHisStdEstimSignal(0)
227  , fHisStdPercentileSecondPercentile(0)
228  , fHisStdSignalSecondSignal(0)
229  , fHisStdPercentileOldFrwPercentile(0)
230  , fHisStdPercentileOldFrwPercentileDev(0)
231  , fHisxvtx(0)
232  , fHisyvtx(0)
233  , fHiszvtx(0)
234  , fHisxvtxSelEv(0)
235  , fHisyvtxSelEv(0)
236  , fHiszvtxSelEv(0)
237  , fHisxvtxSelEvWithD(0)
238  , fHisyvtxSelEvWithD(0)
239  , fHiszvtxSelEvWithD(0)
240  , fHisWhichVert(0)
241  , fHisWhichVertSelEv(0)
242  , fHisTrigCent(0)
243  , fHisTrigMul(0)
244  , fHisTrigCentSel(0)
245  , fHisTrigMulSel(0)
246  , fHisWhyEvRejected(0)
247  , fHisnClsITSvsNtrackletsSel(0)
248  , fHiszvtxvsSPDzvtx(0)
249  , fHiszvtxvsSPDzvtxSel(0)
250  , fHiszvtxvsSPDzvtxSelWithD(0)
251  , fHisFEvents(0)
252  , fHisTPCVZE_AngleQ(0)
253  , fHisCentVsMultRPS(0)
254 {
256  fOnOff[0]=kTRUE;
257  fOnOff[1]=kTRUE;
258  fOnOff[2]=kTRUE;
259  fOnOff[3]=kTRUE;
260  fOnOff[4]=kTRUE;
261 
262  for (Int_t iii=0; iii<3; iii++) {
263  fHisQ[iii]=0;
264  fHisAngleQ[iii]=0;
265  fHisPhiEta[iii]=0;
266  }
267 }
268 
269 //____________________________________________________________________________
271  AliAnalysisTaskSE(name)
272  , fOutputEntries(0x0)
273  , fOutputPID(0x0)
274  , fOutputTrack(0x0)
275  , fOutputCounters(0x0)
277  , fOutputEvSelection(0x0)
278  , fOutputFlowObs(0x0)
279  , fDecayChannel(ch)
280  , fCuts(0x0)
281  , fFlowEvent(0x0)
282  , fRFPcuts(0x0)
283  , fEstimator(AliRDHFCuts::kCentTRK)
284  , fReadMC(kFALSE)
285  , fSimpleMode(kFALSE)
286  , fUseSelectionBit(kTRUE)
287  , fOnOff()
288  , fFillDistrTrackEffChecks(kFALSE)
289  , fAODProtection(1)
290  , fHisNentries(0)
291  , fHisNentriesSelBit(0)
292  , fHisTOFflags(0)
293  , fHisTOFsig(0)
297  , fHisTOFtime(0)
306  , fHisTPCsig(0)
307  , fHisTPCsigvsp(0)
308  , fHisTPCsigvspAC(0)
309  , fHisTPCsigmaK(0)
310  , fHisTPCsigmaPion(0)
311  , fHisTPCsigmaProton(0)
321  , fHisTPCsigmaMCK(0)
322  , fHisTPCsigmaMCPion(0)
324  , fHisnClsITS(0)
325  , fHisnClsITSselTr(0)
326  , fHisnClsITSSA(0)
328  , fHisnClsITSSAspdIn(0)
330  , fHisnLayerITS(0)
331  , fHisnLayerITSselTr(0)
332  , fHisnLayerITSsa(0)
333  , fHisnClsSPD(0)
334  , fHisptGoodTr(0)
337  , fHisdistrGoodTr(0)
338  , fHisdistrSelTr(0)
339  , fHisd0dau(0)
340  , fHisd0dau_filt(0)
341  , fHisd0dauphi(0)
342  , fHisd0dauphi_filt(0)
343  , fHisd0zdau(0)
344  , fHisd0zdau_filt(0)
345  , fHisd0zdauphi(0)
346  , fHisd0zdauphi_filt(0)
347  , fHisd0TracksSPDin(0)
348  , fHisd0TracksSPDany(0)
351  , fHisPtDaughters(0)
352  , fHisPhiDaughters(0)
353  , fHisEtaDaughters(0)
368  , fHisPtAllTracks(0)
369  , fHisPhiAllTracks(0)
370  , fHisEtaAllTracks(0)
385  , fHisdistrFakeTr(0)
386  , fHisd0f(0)
387  , fHisd0f_filt(0)
388  , fHisptFakeTr(0)
391  , fHisNtracklets(0)
392  , fHisNtracklets01(0)
394  , fHisMult(0)
395  , fHisMultFBit4(0)
396  , fHisMultComb05(0)
397  , fHisMultComb08(0)
398  , fHisNtrackletsIn(0)
399  , fHisMultIn(0)
400  , fHisNtrackletsOut(0)
401  , fHisMultOut(0)
411  , fHisStdEstimSignal(0)
416  , fHisxvtx(0)
417  , fHisyvtx(0)
418  , fHiszvtx(0)
419  , fHisxvtxSelEv(0)
420  , fHisyvtxSelEv(0)
421  , fHiszvtxSelEv(0)
422  , fHisxvtxSelEvWithD(0)
423  , fHisyvtxSelEvWithD(0)
424  , fHiszvtxSelEvWithD(0)
425  , fHisWhichVert(0)
426  , fHisWhichVertSelEv(0)
427  , fHisTrigCent(0)
428  , fHisTrigMul(0)
429  , fHisTrigCentSel(0)
430  , fHisTrigMulSel(0)
431  , fHisWhyEvRejected(0)
433  , fHiszvtxvsSPDzvtx(0)
436  , fHisFEvents(0)
437  , fHisTPCVZE_AngleQ(0)
438  , fHisCentVsMultRPS(0)
439 {
441 
442  //SetCutObject(cuts);
443  fCuts=cuts;
444 
445  fOnOff[0]=kTRUE;
446  fOnOff[1]=kTRUE;
447  fOnOff[2]=kTRUE;
448  fOnOff[3]=kTRUE;
449  fOnOff[4]=kTRUE;
450 
451  for (Int_t iii=0; iii<3; iii++) {
452  fHisQ[iii]=0;
453  fHisAngleQ[iii]=0;
454  fHisPhiEta[iii]=0;
455  }
456 
457  // Output slot #1 writes into a TList container (number of events)
458  DefineOutput(1,TList::Class());
459  // Output slot #2 writes into a TList container (PID)
460  if (fOnOff[1]) DefineOutput(2,TList::Class()); //My private output
461  // Output slot #3 writes into a TList container (Tracks)
462  if (fOnOff[0]) DefineOutput(3,TList::Class()); //My private output
463  // Output slot #4 writes into a AliRDHFCuts container (cuts)
464  switch(fDecayChannel){
465  case 0:
466  DefineOutput(4,AliRDHFCutsDplustoKpipi::Class()); //My private output
467  break;
468  case 1:
469  DefineOutput(4,AliRDHFCutsD0toKpi::Class()); //My private output
470  break;
471  case 2:
472  DefineOutput(4,AliRDHFCutsDStartoKpipi::Class()); //My private output
473  break;
474  case 3:
475  DefineOutput(4,AliRDHFCutsDstoKKpi::Class()); //My private output
476  break;
477  case 4:
478  DefineOutput(4,AliRDHFCutsD0toKpipipi::Class()); //My private output
479  break;
480  case 5:
481  DefineOutput(4,AliRDHFCutsLctopKpi::Class()); //My private output
482  break;
483  case kLambdactoV0:
484  DefineOutput(4,AliRDHFCutsLctoV0::Class()); //My private output
485  break;
486  }
487  if (fOnOff[2]) {
488  // Output slot #5 writes into a TList container (AliCounterCollection)
489  DefineOutput(5,TList::Class()); //My private output
490  // Output slot #6 writes into a TList container (TH1F)
491  DefineOutput(6,TList::Class()); //My private output
492  }
493 
494  if(fOnOff[3]) DefineOutput(7,TList::Class()); //My private output
495  if(fOnOff[4]) DefineOutput(8,TList::Class()); //My private output
496 
497 }
498 
499 //___________________________________________________________________________
501 {
503 
504  delete fOutputEntries;
505 
506  delete fOutputPID;
507 
508  delete fOutputTrack;
509 
510  delete fOutputCounters;
511 
512  delete fOutputCheckCentrality;
513 
514  delete fOutputEvSelection;
515 
516  if(fOnOff[4]) {
517  delete fOutputFlowObs;
518  delete fFlowEvent;
519  }
520 
521 }
522 
523 //___________________________________________________________________________
525 
527  if(fDebug > 1) printf("AnalysisTaskSEHFQA::Init() \n");
528  AliRDHFCuts *copycut = 0x0;
529 
530  switch(fDecayChannel){
531  case 0:
532  {
533  copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
534  }
535  break;
536  case 1:
537  {
538  copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
539  }
540  break;
541  case 2:
542  {
543  copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
544  }
545  break;
546  case 3:
547  {
548  copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
549  }
550  break;
551  case 4:
552  {
553  copycut=new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
554  }
555  break;
556  case 5:
557  {
558  copycut=new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
559  }
560  break;
561  case kLambdactoV0:
562  {
563  copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
564  }
565  break;
566  default:
567  AliFatal("Bad initialization for the decay channe - Exiting...");
568  break;
569  }
570 
571  const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
572  if (copycut){
573  copycut->SetName(nameoutput);
574 
575  // Post the data
576  PostData(4,copycut);
577  }else{
578  AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
579  }
580 
581  return;
582 
583 }
584 
585 //___________________________________________________________________________
587 {
588 
590  if(fDebug > 1) printf("AnalysisTaskSEHFQA::UserCreateOutputObjects() \n");
591 
592  //count events
593  fOutputEntries=new TList();
594  fOutputEntries->SetOwner();
595  fOutputEntries->SetName(GetOutputSlot(1)->GetContainer()->GetName());
596 
597 
598  TString hnameEntries="hNentries";
599  fHisNentries=new TH1F(hnameEntries.Data(), "Counts the number of events", 15,-0.5,14.5);
600  fHisNentries->GetXaxis()->SetBinLabel(1,"nEventsRead");
601  fHisNentries->GetXaxis()->SetBinLabel(2,"nEvents Matched dAOD");
602  fHisNentries->GetXaxis()->SetBinLabel(3,"Mismatched dAOD (Event numbers)");
603  fHisNentries->GetXaxis()->SetBinLabel(4,"Mismatched dAOD (TProcessID)");
604  fHisNentries->GetXaxis()->SetBinLabel(5,"Mismatched Old New Centrality");
605  fHisNentries->GetXaxis()->SetBinLabel(6,"nEventsAnal");
606  fHisNentries->GetXaxis()->SetBinLabel(7,"Pile-up Rej");
607  fHisNentries->GetXaxis()->SetBinLabel(8,"No VertexingHF");
608  fHisNentries->GetXaxis()->SetBinLabel(9,"nCandidates(AnCuts)");
609  fHisNentries->GetXaxis()->SetBinLabel(10,"EventsWithGoodVtx");
610  fHisNentries->GetXaxis()->SetBinLabel(11,"N candidates");
611  if(fReadMC){
612  fHisNentries->GetXaxis()->SetBinLabel(12,"MC Cand from c");
613  fHisNentries->GetXaxis()->SetBinLabel(13,"MC Cand from b");
614  fHisNentries->GetXaxis()->SetBinLabel(14,"N fake Trks");
615  fHisNentries->GetXaxis()->SetBinLabel(15,"N true Trks");
616  }
617 
618  fHisNentries->GetXaxis()->SetNdivisions(1,kFALSE);
619 
620  hnameEntries="HasSelBit";
621  fHisNentriesSelBit=new TH2F(hnameEntries.Data(), "Counts the number of events with SelectionBit", 5,0.,5.,100,0.,30.);
622  fHisNentriesSelBit->GetXaxis()->SetBinLabel(1,"Dplus");
623  fHisNentriesSelBit->GetXaxis()->SetBinLabel(2,"Ds");
624  fHisNentriesSelBit->GetXaxis()->SetBinLabel(3,"LcKpi");
625  fHisNentriesSelBit->GetXaxis()->SetBinLabel(4,"D0toKpi");
626  fHisNentriesSelBit->GetXaxis()->SetBinLabel(5,"Dstar");
627 
630 
631 
632  //PID
633  if(fOnOff[1]){
634  fOutputPID=new TList();
635  fOutputPID->SetOwner();
636  fOutputPID->SetName(GetOutputSlot(2)->GetContainer()->GetName());
637 
638  //TOF pid
639  fHisTOFflags=new TH1F("hTOFflags","TOF flags",7,-0.5,6.5);
640  fHisTOFflags->SetMinimum(0.);
641  fHisTOFflags->GetXaxis()->SetBinLabel(1,"All Tracks");
642  fHisTOFflags->GetXaxis()->SetBinLabel(2,"kTPCout");
643  fHisTOFflags->GetXaxis()->SetBinLabel(3,"kTOFout");
644  fHisTOFflags->GetXaxis()->SetBinLabel(4,"kTIME");
645  fHisTOFflags->GetXaxis()->SetBinLabel(5,"kTOFpid");
646  fHisTOFflags->GetXaxis()->SetBinLabel(6,"kTOFmismatch");
647  fHisTOFflags->GetXaxis()->SetBinLabel(7,"kDetPidOK");
648 
649  TString hname="hTOFsig";
650  fHisTOFsig=new TH1F(hname.Data(),"Distribution of TOF signal;TOF time [ps];Entries", 100, -2.e3,40.e3);
651 
652  hname="hTOFstartTimeMask";
653  fHisTOFstartTimeMask=new TH1F(hname.Data(),"TOF start time mask; Mask ;Entries", 8, -0.5,7.5);
654  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(1,"FILL");
655  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(2,"TOF");
656  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(3,"T0A");
657  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(4,"TOF.and.T0A");
658  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(5,"T0C");
659  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(6,"TOF.and.T0C");
660  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(7,"T0AC");
661  fHisTOFstartTimeMask->GetXaxis()->SetBinLabel(8,"TOF.and.T0AC");
662 
663  hname="hTOFstartTimeRes";
664  fHisTOFstartTimeRes=new TH1F(hname.Data(),"TOF start time resolution; Resolution (ps) ;Entries", 100, 0.,300.);
665 
666  hname="hTOFstartTimeDistrib";
667  fHisTOFstartTimeDistrib=new TH1F(hname.Data(),"TOF start time distribution; Start time ;Entries", 400, -1000.,1000.);
668 
669  hname="hTOFtime";
670  fHisTOFtime=new TH1F(hname.Data(),"Distribution of TOF time Kaon;TOF time(Kaon) [ps];Entries", 1000, 0.,50000.);
671 
672  hname="hTOFtimeKaonHyptime";
673  fHisTOFtimeKaonHyptime=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
674 
675  hname="hTOFtimeKaonHyptimeAC";
676  fHisTOFtimeKaonHyptimeAC=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
677 
678  hname="hTOFsigmaKSigPid";
679  fHisTOFsigmaKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
680 
681  hname="hTOFsigmaPionSigPid";
682  fHisTOFsigmaPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
683 
684  hname="hTOFsigmaProtonSigPid";
685  fHisTOFsigmaProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
686 
687  hname="hTOFsigPid3sigPion";
688  fHisTOFsigPid3sigPion=new TH1F(hname.Data(),"TOF PID resolution (#pi) [ps]",500,0.,1000.);
689 
690  hname="hTOFsigPid3sigKaon";
691  fHisTOFsigPid3sigKaon=new TH1F(hname.Data(),"TOF PID resolution (K) [ps]",500,0.,1000.);
692 
693  hname="hTOFsigPid3sigProton";
694  fHisTOFsigPid3sigProton=new TH1F(hname.Data(),"TOF PID resolution (p) [ps]",500,0.,1000.);
695 
696 
697  //TPC pid
698  hname="hTPCsig";
699  fHisTPCsig=new TH1F(hname.Data(),"Distribution of TPC signal;TPC sig;Entries", 100, 35.,100.);
700 
701  hname="hTPCsigvsp";
702  fHisTPCsigvsp=new TH2F(hname.Data(),"TPCsig vs p;TPC p[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
703 
704  hname="hTPCsigvspAC";
705  fHisTPCsigvspAC=new TH2F(hname.Data(),"TPCsig vs p;TPCp[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
706 
707  hname="hTPCsigmaK";
708  fHisTPCsigmaK=new TH2F(hname.Data(),"TPC Sigma for K as a function of momentum;p[GeV/c];Sigma Kaon",500,0.,10.,400,-20,20);
709 
710  hname="hTPCsigmaPion";
711  fHisTPCsigmaPion=new TH2F(hname.Data(),"TPC Sigma for #pi as a function of momentum;p[GeV/c];Sigma #pi",500,0.,10.,400,-20,20);
712 
713  hname="hTPCsigmaProton";
714  fHisTPCsigmaProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
715 
716 
717  fOutputPID->Add(fHisTOFflags);
718  fOutputPID->Add(fHisTOFsig);
719  fOutputPID->Add(fHisTPCsig);
723  fOutputPID->Add(fHisTOFtime);
737 
739 
740  hname="hTPCsigNvsPtAllTracks";
741  fHisTPCsigNvsPtAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
742 
743  hname="hTPCsigNvsPhiAllTracks";
744  fHisTPCsigNvsPhiAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
745 
746  hname="hTPCsigNvsEtaAllTracks";
747  fHisTPCsigNvsEtaAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
748 
749  hname="hTPCsigNvsPtDaughters";
750  fHisTPCsigNvsPtDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
751 
752  hname="hTPCsigNvsPhiDaughters";
753  fHisTPCsigNvsPhiDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
754 
755  hname="hTPCsigNvsEtaDaughters";
756  fHisTPCsigNvsEtaDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
757 
764  }
765 
766 
767  if(fReadMC){
768  //TOF
769  hname="hTOFsigmaMCKSigPid";
770  fHisTOFsigmaMCKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
771 
772  hname="hTOFsigmaMCPionSigPid";
773  fHisTOFsigmaMCPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
774 
775  hname="hTOFsigmaMCProtonSigPid";
776  fHisTOFsigmaMCProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
777 
778  //TPC
779  hname="hTPCsigmaMCK";
780  fHisTPCsigmaMCK=new TH2F(hname.Data(),"TPC Sigma for K as a function of momentum;p[GeV/c];Sigma Kaon",500,0.,10.,400,-20,20);
781 
782  hname="hTPCsigmaMCPion";
783  fHisTPCsigmaMCPion=new TH2F(hname.Data(),"TPC Sigma for #pi as a function of momentum;p[GeV/c];Sigma #pi",500,0.,10.,400,-20,20);
784 
785  hname="hTPCsigmaMCProton";
786  fHisTPCsigmaMCProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
787 
794 
795  }
796  }
797 
798  //quality of the tracks
799  if(fOnOff[0]){
800  fOutputTrack=new TList();
801  fOutputTrack->SetOwner();
802  fOutputTrack->SetName(GetOutputSlot(3)->GetContainer()->GetName());
803 
804  TString hname="hnClsITS";
805  fHisnClsITS=new TH1F(hname.Data(),"Distribution of number of ITS clusters;nITScls;Entries",7,-0.5,6.5);
806 
807  hname="hnClsITSselTr";
808  fHisnClsITSselTr=new TH1F(hname.Data(),"Distribution of number of ITS clusters selected tracks;nITScls;Entries",7,-0.5,6.5);
809 
810  hname="hnClsITS-SA";
811  fHisnClsITSSA=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA);nITScls;Entries",7,-0.5,6.5);
812  hname="hnClsITS-SA-SPDAny";
813  fHisnClsITSSAspdAny=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA) - SPD kAny;nITScls;Entries",7,-0.5,6.5);
814  hname="hnClsITS-SA-SPDIn";
815  fHisnClsITSSAspdIn=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA) - SPDin;nITScls;Entries",7,-0.5,6.5);
816  hname="hnClsITS-SA-SPDOut";
817  fHisnClsITSSAspdOut=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA) - SPDout;nITScls;Entries",7,-0.5,6.5);
818 
819 
820  hname="hnLayerITS";
821  fHisnLayerITS=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
822  fHisnLayerITS->GetXaxis()->SetBinLabel(1,"n tracks");
823  fHisnLayerITS->GetXaxis()->SetBinLabel(2,"SPDin");
824  fHisnLayerITS->GetXaxis()->SetBinLabel(3,"SPDout");
825  fHisnLayerITS->GetXaxis()->SetBinLabel(4,"SDDin");
826  fHisnLayerITS->GetXaxis()->SetBinLabel(5,"SDDout");
827  fHisnLayerITS->GetXaxis()->SetBinLabel(6,"SSDin");
828  fHisnLayerITS->GetXaxis()->SetBinLabel(7,"SSDout");
829 
830  hname="hnLayerITSselTr";
831  fHisnLayerITSselTr=new TH1F(hname.Data(),"Number of selected tracks with point in layer;ITS layer;",7,-1.5,5.5);
832  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(1,"n tracks");
833  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(2,"SPDin");
834  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(3,"SPDout");
835  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(4,"SDDin");
836  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(5,"SDDout");
837  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(6,"SSDin");
838  fHisnLayerITSselTr->GetXaxis()->SetBinLabel(7,"SSDout");
839 
840  hname="hnLayerITSsa";
841  fHisnLayerITSsa=new TH1F(hname.Data(),"Number of ITSsa tracks with point in layer;ITS layer;",7,-1.5,5.5);
842  fHisnLayerITSsa->GetXaxis()->SetBinLabel(1,"n tracks");
843  fHisnLayerITSsa->GetXaxis()->SetBinLabel(2,"SPDin");
844  fHisnLayerITSsa->GetXaxis()->SetBinLabel(3,"SPDout");
845  fHisnLayerITSsa->GetXaxis()->SetBinLabel(4,"SDDin");
846  fHisnLayerITSsa->GetXaxis()->SetBinLabel(5,"SDDout");
847  fHisnLayerITSsa->GetXaxis()->SetBinLabel(6,"SSDin");
848  fHisnLayerITSsa->GetXaxis()->SetBinLabel(7,"SSDout");
849 
850  hname="hnClsSPD";
851  fHisnClsSPD=new TH1F(hname.Data(),"Distribution of number of SPD clusters;nSPDcls;Entries",3,-0.5,2.5);
852 
853  hname="hptGoodTr";
854  fHisptGoodTr=new TH1F(hname.Data(),"Pt distribution of 'good' tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
855  fHisptGoodTr->SetTitleOffset(1.3,"Y");
856 
857  if(!fSimpleMode){
858  hname="hptGoodTrFromDaugh";
859  fHisptGoodTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
860  fHisptGoodTrFromDaugh->SetTitleOffset(1.3,"Y");
862  hname="hptGoodTrFromDaugh_filt";
863  fHisptGoodTrFromDaugh_filt=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters, cuts level;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
864  fHisptGoodTrFromDaugh_filt->SetTitleOffset(1.3,"Y");
866  }
867 
868  hname="hdistrGoodTr";
869  fHisdistrGoodTr=new TH1F(hname.Data(),"Distribution of number of 'good' candidate's daughters per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
870  fHisdistrGoodTr->SetTitleOffset(1.3,"Y");
871 
872  hname="hdistrSelTr";
873  fHisdistrSelTr=new TH1F(hname.Data(),"Distribution of number of Selected tracks per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
874  fHisdistrSelTr->SetTitleOffset(1.3,"Y");
875 
876  hname="hd0dau";
877  fHisd0dau=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of D daughter tracks;d_{0rphi}[cm];Entries/10^{3} cm",200,-0.1,0.1);
878 
879  hname="hd0dau_filt";
880  fHisd0dau_filt=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of D daughter tracks, cut level;d_{0rphi}[cm];Entries/10^{3} cm",200,-0.1,0.1);
881 
882  hname="hd0dauphi";
883  fHisd0dauphi=new TH2F(hname.Data(), "Impact parameter (rphi) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0rphi} [cm]",400,0,6.3,200,-0.1,0.1);
884 
885  hname="hd0dauphi_filt";
886  fHisd0dauphi_filt=new TH2F(hname.Data(), "Impact parameter (rphi) distribution of D daughter tracks versus #phi, cut level; #phi [rad]; d_{0rphi} [cm]",400,0,6.3,200,-0.1,0.1);
887 
888  hname="hd0zdau";
889  fHisd0zdau=new TH1F(hname.Data(),"Impact parameter (z) distribution of D daughter tracks;d_{0z}[cm];Entries/10^{3} cm",200,-0.1,0.1);
890 
891  hname="hd0zdau_filt";
892  fHisd0zdau_filt=new TH1F(hname.Data(),"Impact parameter (z) distribution of D daughter tracks, cut level;d_{0z}[cm];Entries/10^{3} cm",200,-0.1,0.1);
893 
894 
895  hname="hd0zdauphi";
896  fHisd0zdauphi=new TH2F(hname.Data(), "Impact parameter (z) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0z} [cm]",400,0,6.3,200,-0.1,0.1);
897 
898  hname="hd0zdauphi_filt";
899  fHisd0zdauphi_filt=new TH2F(hname.Data(), "Impact parameter (z) distribution of D daughter tracks versus #phi, filtering level; #phi [rad]; d_{0z} [cm]",400,0,6.3,200,-0.1,0.1);
900 
901  hname="hd0TracksSPDin";
902  fHisd0TracksSPDin=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDinner; d_{0rphi}[cm];Entries",200,-0.5,0.5);
903 
904  hname="hd0TracksSPDany";
905  fHisd0TracksSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
906 
907  hname="hd0TracksFilterBit4";
908  fHisd0TracksFilterBit4=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks FilterBit4; d_{0rphi}[cm];Entries",200,-0.5,0.5);
909 
910  hname="hd0TracksTPCITSSPDany";
911  fHisd0TracksTPCITSSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks TPC+ITScuts+SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
912 
913 
915  hname="hPtDaughters";
916  fHisPtDaughters=new TH1F(hname.Data(),"p_{T} distributions of the daughter tracks;p_{T} [GeV/c];Entries",200,0.,20.);
917 
918  hname="hPhiDaughters";
919  fHisPhiDaughters=new TH1F(hname.Data(),"#phi distribution of the daughter tracks;#phi [rad];Entries",100,0.,2*(TMath::Pi()));
920 
921  hname="hEtaDaughters";
922  fHisEtaDaughters=new TH1F(hname.Data(),"#eta distribution of the daughter tracks;#eta;Entries",80,-2.,2.);
923 
924  hname="hEtavsPhiDaughters";
925  fHisEtavsPhiDaughters=new TH2F(hname.Data(),"#eta vs #phi distribution of the daughter tracks;#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
926 
927  hname="hNTPCclsvsPtDaughters";
928  fHisNTPCclsvsPtDaughters=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cls",200,0.,20.,85,-0.5,169.5);
929 
930  hname="hNTPCclsvsPhiDaughters";
931  fHisNTPCclsvsPhiDaughters=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the daughter tracks;#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
932 
933  hname="hNTPCclsvsEtaDaughters";
934  fHisNTPCclsvsEtaDaughters=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the daughter tracks;#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
935 
936  hname="hNTPCCrossedRowsvsPtDaughters";
937  fHisNTPCCrossedRowsvsPtDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
938 
939  hname="hNTPCCrossedRowsvsPhiDaughters";
940  fHisNTPCCrossedRowsvsPhiDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the daughter tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
941 
942  hname="hNTPCCrossedRowsvsEtaDaughters";
943  fHisNTPCCrossedRowsvsEtaDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the daughter tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
944 
945  hname="hRatioCRowsOverFclsvsPtDaughters";
946  fHisRatioCRowsOverFclsvsPtDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
947 
948  hname="hRatioCRowsOverFclsvsPhiDaughters";
949  fHisRatioCRowsOverFclsvsPhiDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the daughter tracks;#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
950 
951  hname="hRatioCRowsOverFclsvsEtaDaughters";
952  fHisRatioCRowsOverFclsvsEtaDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the daughter tracks;#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
953 
954  hname="hNITSclsvsPtDaughters";
955  fHisNITSclsvsPtDaughters=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
956 
957  hname="hNITSclsvsPhiDaughters";
958  fHisNITSclsvsPhiDaughters=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the daughter tracks;#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
959 
960  hname="hNITSclsvsEtaDaughters";
961  fHisNITSclsvsEtaDaughters=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the daughter tracks;#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
962 
963  hname="hSPDclsDaughters";
964  fHisSPDclsDaughters = new TH1F(hname.Data(),"N SPD points distribution;;Entries",4,-0.5,3.5);
965  fHisSPDclsDaughters->GetXaxis()->SetBinLabel(1, "no SPD");
966  fHisSPDclsDaughters->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
967  fHisSPDclsDaughters->GetXaxis()->SetBinLabel(3, "kOnlySecond");
968  fHisSPDclsDaughters->GetXaxis()->SetBinLabel(4, "kBoth");
969 
970  hname="hPtAllTracks";
971  fHisPtAllTracks=new TH1F(hname.Data(),"p_{T} distributions of the AOD tracks (ID>0);p_{T} [GeV/c];Entries",200,0.,20.);
972 
973  hname="hPhiAllTracks";
974  fHisPhiAllTracks=new TH1F(hname.Data(),"#phi distribution of the AOD tracks (ID>0);#phi [rad];Entries",100,0.,2*(TMath::Pi()));
975 
976  hname="hEtaAllTracks";
977  fHisEtaAllTracks=new TH1F(hname.Data(),"#eta distribution of the AOD tracks (ID>0);#eta;Entries",80,-2.,2.);
978 
979  hname="hEtavsPhiAllTracks";
980  fHisEtavsPhiAllTracks=new TH2F(hname.Data(),"#eta vs #phi distribution of the AOD tracks (ID>0);#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
981 
982  hname="hNTPCclsvsPtAllTracks";
983  fHisNTPCclsvsPtAllTracks=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N TPC cls",200,0.,20,85,-0.5,169.5);
984 
985  hname="hNTPCclsvsPhiAllTracks";
986  fHisNTPCclsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
987 
988  hname="hNTPCclsvsEtaAllTracks";
989  fHisNTPCclsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
990 
991  hname="hNTPCCrossedRowsvsPtAllTracks";
992  fHisNTPCCrossedRowsvsPtAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the AOD tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
993 
994  hname="hNTPCCrossedRowsvsPhiAllTracks";
995  fHisNTPCCrossedRowsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the AOD tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
996 
997  hname="hNTPCCrossedRowsvsEtaAllTracks";
998  fHisNTPCCrossedRowsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the AOD tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
999 
1000  hname="hRatioCRowsOverFclsvsPtAllTracks";
1001  fHisRatioCRowsOverFclsvsPtAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
1002 
1003  hname="hRatioCRowsOverFclsvsPhiAllTracks";
1004  fHisRatioCRowsOverFclsvsPhiAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
1005 
1006  hname="hRatioCRowsOverFclsvsEtaAllTracks";
1007  fHisRatioCRowsOverFclsvsEtaAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the AOD tracks (ID>0);#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
1008 
1009  hname="hNITSclsvsPtAllTracks";
1010  fHisNITSclsvsPtAllTracks=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
1011 
1012  hname="hNITSclsvsPhiAllTracks";
1013  fHisNITSclsvsPhiAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
1014 
1015  hname="hNITSclsvsEtaAllTracks";
1016  fHisNITSclsvsEtaAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
1017 
1018  hname="hSPDclsAllTracks";
1019  fHisSPDclsAllTracks = new TH1F(hname.Data(),"N SPD points distribution AOD tracks (ID>0);;Entries",4,-0.5,3.5);
1020  fHisSPDclsAllTracks->GetXaxis()->SetBinLabel(1, "no SPD");
1021  fHisSPDclsAllTracks->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
1022  fHisSPDclsAllTracks->GetXaxis()->SetBinLabel(3, "kOnlySecond");
1023  fHisSPDclsAllTracks->GetXaxis()->SetBinLabel(4, "kBoth");
1024 
1025 
1060 
1061  }
1062 
1063  fOutputTrack->Add(fHisnClsITS);
1072  fOutputTrack->Add(fHisnClsSPD);
1073  fOutputTrack->Add(fHisptGoodTr);
1080  fOutputTrack->Add(fHisd0dau);
1081  fOutputTrack->Add(fHisd0dauphi);
1082  fOutputTrack->Add(fHisd0zdau);
1088 
1089 
1090  if(fReadMC){
1091  hname="hdistrFakeTr";
1092  fHisdistrFakeTr=new TH1F(hname.Data(),"Distribution of number of fake tracks per event;no.fake-tracks/ev;Entries",4000,-0.5,3999.5);
1093  fHisdistrFakeTr->SetTitleOffset(1.3,"Y");
1094 
1095  hname="hd0f";
1096  fHisd0f=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
1097 
1098  hname="hd0f_filt";
1099  fHisd0f_filt=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks, cut level;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
1100 
1101 
1102  hname="hptFakeTr";
1103  fHisptFakeTr=new TH1F(hname.Data(),"Pt distribution of fake tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
1104  fHisptFakeTr->SetTitleOffset(1.3,"Y");
1105  if(!fSimpleMode){
1106  hname="hptFakeTrFromDaugh";
1107  fHisptFakeTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
1108  fHisptFakeTrFromDaugh->SetTitleOffset(1.3,"Y");
1110 
1111  hname="hptFakeTrFromDaugh_filt";
1112  fHisptFakeTrFromDaughFilt=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters, cut level;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
1113  fHisptFakeTrFromDaughFilt->SetTitleOffset(1.3,"Y");
1115  }
1116 
1117  fOutputTrack->Add(fHisptFakeTr);
1119  fOutputTrack->Add(fHisd0f);
1120  fOutputTrack->Add(fHisd0f_filt);
1121  }
1122  }
1123 
1124 
1125  if(fOnOff[2] && fCuts->GetUseCentrality()){
1126 
1127  //Centrality (Counters)
1128  fOutputCounters=new TList();
1129  fOutputCounters->SetOwner();
1130  fOutputCounters->SetName(GetOutputSlot(5)->GetContainer()->GetName());
1131 
1132  AliCounterCollection *stdEstimator=new AliCounterCollection("stdEstimator");
1133  stdEstimator->AddRubric("run",500000);
1134  stdEstimator->AddRubric("centralityclass","-10_0/0_10/10_20/20_30/30_40/40_50/50_60/60_70/70_80/80_90/90_100/-990_-980");
1135  stdEstimator->Init();
1136  AliCounterCollection *secondEstimator=new AliCounterCollection("secondEstimator");
1137  secondEstimator->AddRubric("run",500000);
1138  secondEstimator->AddRubric("centralityclass","-10_0/0_10/10_20/20_30/30_40/40_50/50_60/60_70/70_80/80_90/90_100/-990_-980");
1139  secondEstimator->Init();
1140 
1141  fOutputCounters->Add(stdEstimator);
1142  fOutputCounters->Add(secondEstimator);
1143 
1144  //Centrality (Checks)
1146  fOutputCheckCentrality->SetOwner();
1147  fOutputCheckCentrality->SetName(GetOutputSlot(6)->GetContainer()->GetName());
1148 
1149  TString hname="hNtrackletsIn";
1150  fHisNtrackletsIn=new TH1F(hname.Data(),"Number of tracklets in Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
1151 
1152  hname="hMultIn";
1153  fHisMultIn=new TH1F(hname.Data(),"Multiplicity;multiplicity in Centrality range;Entries",10000,-0.5,9999.5);
1154 
1155  hname="hNtrackletsOut";
1156  fHisNtrackletsOut=new TH1F(hname.Data(),"Number of tracklets out of Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
1157 
1158  hname="hMultOut";
1159  fHisMultOut=new TH1F(hname.Data(),"Multiplicity out of Centrality range;multiplicity;Entries",10000,-0.5,9999.5);
1160 
1161  hname="hMultvsPercentile";
1162  fHisMultvsPercentile=new TH2F(hname.Data(),"Multiplicity vs Percentile;multiplicity;percentile",10000,-0.5,9999.5,240,-10.,110);
1163 
1164  hname="hntrklvsPercentile";
1165  fHisntrklvsPercentile=new TH2F(hname.Data(),"N tracklets vs Percentile;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
1166 
1167  hname="hntrklvsPercentile01";
1168  fHisntrklvsPercentile01=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
1169 
1170  hname="hntrklvsPercentile01AllEv";
1171  fHisntrklvsPercentile01AllEv=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1 - All Events;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
1172 
1173  hname="hnTPCTracksvsPercentile";
1174  fHisnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
1175 
1176  hname="hnTPCITSTracksvsPercentile";
1177  fHisnTPCITSTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS tracks vs Percentile;nTPCITSTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
1178 
1179  hname="hnTPCITS1SPDTracksvsPercentile";
1180  fHisnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
1181 
1182  hname="hStdEstimSignalPercentile";
1183  fHisStdEstimSignalPercentile = new TH2F(hname.Data(),"Std estimator signal vs Percentile;Std estimator signal;percentile",1000,-0.5,9999.5,120,-10.,110);
1184 
1185  hname="hStdEstimSignalNtrackletsIn";
1186  fHisStdEstimSignalNtrackletsIn = new TH2F(hname.Data(),"Std estimator signal vs Number of tracklets in the CC;Std estimator signal;number of tracklets",1000,-0.5,9999.5,5000,-0.5,4999.5);
1187 
1188  hname="hStdEstimSignal";
1189  fHisStdEstimSignal = new TH1F(hname.Data(),"Std estimator signal",700,0,1400);
1190 
1191  hname="hStdPercentileSecondPercentile";
1192  fHisStdPercentileSecondPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs Second Estimator Percentile;Std estimator percentile;Second estimator percentile",120,-10.,110,120,-10.,110);
1193 
1194  hname="hStdSignalSecondSignal";
1195  fHisStdSignalSecondSignal = new TH2F(hname.Data(),"Std estimator signal Vs Second Estimator signal;Std estimator;Second estimator",1000,-0.5,9999.5,1000,-0.5,9999.5);
1196 
1197  hname="hStdPercentileOldFrwPercentile";
1198  fHisStdPercentileOldFrwPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs Old Framework estimator Percentile;Std estimator percentile;Old framework estimator percentile",120,-10.,110,120,-10.,110);
1199 
1200  hname="hStdPercentileOldFrwPercentileDev";
1201  fHisStdPercentileOldFrwPercentileDev = new TH1F(hname.Data(),"Std estimator Percentile Vs Old Framework estimator Percentile deviation",5,-0.5,4.5);
1202  fHisStdPercentileOldFrwPercentileDev->GetXaxis()->SetBinLabel(1, "nEvts with >1% difference");
1203  fHisStdPercentileOldFrwPercentileDev->GetXaxis()->SetBinLabel(2, "nEvts with >0.5% difference");
1204  fHisStdPercentileOldFrwPercentileDev->GetXaxis()->SetBinLabel(3, "nEvts default <20, new >20");
1205  fHisStdPercentileOldFrwPercentileDev->GetXaxis()->SetBinLabel(4, "nEvts default >20, new <20");
1206  fHisStdPercentileOldFrwPercentileDev->GetXaxis()->SetBinLabel(5, "nEvts rejected due to centrality mismatch");
1207 
1208 
1227 
1228  PostData(6,fOutputCheckCentrality);
1229 
1230  } else{
1231  if(fOnOff[0]){
1232  TString hname="hNtracklets";
1233  fHisNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
1234  hname="hNtracklets01";
1235  fHisNtracklets01=new TH1F(hname.Data(),"Number of tracklets |#eta|<1;ntracklets;Entries",5000,-0.5,4999.5);
1236  hname="hNtracklets01AllEv";
1237  fHisNtracklets01AllEv=new TH1F(hname.Data(),"Number of tracklets |#eta|<1 - All events;ntracklets;Entries",5000,-0.5,4999.5);
1238  hname="hMult";
1239  fHisMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
1240  hname="hMultFBit4";
1241  fHisMultFBit4=new TH1F(hname.Data(),"Multiplicity (global+tracklet) with filter bit 4;multiplicity;Entries",10000,-0.5,9999.5);
1242  hname="hMultComb05";
1243  fHisMultComb05=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.5;multiplicity;Entries",10000,-0.5,9999.5);
1244  hname="hMultComb08";
1245  fHisMultComb08=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.8;multiplicity;Entries",10000,-0.5,9999.5);
1246 
1250  fOutputTrack->Add(fHisMult);
1254  }
1255  }
1256 
1257  //event selection (z vertex for the moment)
1258  if(fOnOff[3]){
1259  fOutputEvSelection=new TList();
1260  fOutputEvSelection->SetOwner();
1261  fOutputEvSelection->SetName(GetOutputSlot(7)->GetContainer()->GetName());
1262  AliCounterCollection *evselection=new AliCounterCollection("evselection");
1263  evselection->AddRubric("run",500000);
1264  evselection->AddRubric("evnonsel","zvtx");
1265  evselection->Init();
1266 
1267  fHisxvtx=new TH1F("hxvtx", "Distribution of x_{VTX};x_{VTX} [cm];Entries",800,-1,1);
1268  fHisyvtx=new TH1F("hyvtx", "Distribution of y_{VTX};y_{VTX} [cm];Entries",800,-1,1);
1269  fHiszvtx=new TH1F("hzvtx", "Distribution of z_{VTX};z_{VTX} [cm];Entries",800,-30,30);
1270  fHisxvtxSelEv=new TH1F("hxvtxSelEv", "Distribution of x_{VTX} Selected Ev;x_{VTX} [cm];Entries",800,-1,1);
1271  fHisyvtxSelEv=new TH1F("hyvtxSelEv", "Distribution of y_{VTX} Selected Ev;y_{VTX} [cm];Entries",800,-1,1);
1272  fHiszvtxSelEv=new TH1F("hzvtxSelEv", "Distribution of z_{VTX} Selected Ev;z_{VTX} [cm];Entries",800,-30,30);
1273  fHisxvtxSelEvWithD=new TH1F("hxvtxSelEvWithD", "Distribution of x_{VTX} Selected Ev w/ D mesons;x_{VTX} [cm];Entries",800,-1,1);
1274  fHisyvtxSelEvWithD=new TH1F("hyvtxSelEvWithD", "Distribution of y_{VTX} Selected Ev w/ D mesons;y_{VTX} [cm];Entries",800,-1,1);
1275  fHiszvtxSelEvWithD=new TH1F("hzvtxSelEvWithD", "Distribution of z_{VTX} Selected Ev w/ D mesons;z_{VTX} [cm];Entries",800,-30,30);
1276  fHisWhichVert=new TH1F("hWhichVert","Vertex Type",4,-1.5,2.5);
1277  fHisWhichVert->GetXaxis()->SetBinLabel(1,"Not found");
1278  fHisWhichVert->GetXaxis()->SetBinLabel(2,"Track");
1279  fHisWhichVert->GetXaxis()->SetBinLabel(3,"SPD-3D");
1280  fHisWhichVert->GetXaxis()->SetBinLabel(4,"SPD-z");
1281  fHisWhichVertSelEv=new TH1F("hWhichVertSelEv","Vertex Type",4,-1.5,2.5);
1282  fHisWhichVertSelEv->GetXaxis()->SetBinLabel(1,"Not found");
1283  fHisWhichVertSelEv->GetXaxis()->SetBinLabel(2,"Track");
1284  fHisWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
1285  fHisWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
1286 
1287  fHisnClsITSvsNtrackletsSel=new TH2F("hnClsITSvsNtrackletsSel","number of SPD clusters vs number of SPD tracklets; n. SPD clusters; Ntracklets",200,0,6000,500,0,20000); // max values should be changed for pp data to about 200 and 1000 respectively
1288  fHiszvtxvsSPDzvtx=new TH2F("hzvtxvsSPDzvtx","event primary z-vertex vs SPD z-vertex - before event selection; PV z-vertex [cm]; SPD z-vertex [cm]",800,-30,30,800,-30,30);
1289  fHiszvtxvsSPDzvtxSel=new TH2F("hzvtxvsSPDzvtxSel","event primary z-vertex vs SPD z-vertex - after event selection; PV z-vertex [cm]; SPD z-vertex [cm]",800,-30,30,800,-30,30);
1290  fHiszvtxvsSPDzvtxSelWithD=new TH2F("hzvtxvsSPDzvtxSelWithD","event primary z-vertex vs SPD z-vertex - after event selection w/ D mesons; PV z-vertex [cm]; SPD z-vertex [cm]",800,-30,30,800,-30,30);
1291 
1292  fHisTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",24,-1.5,22.5,12,-10,110);
1293  fHisTrigCent->GetXaxis()->SetBinLabel(1,"All");
1294  fHisTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
1295  fHisTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
1296  fHisTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
1297  fHisTrigCent->GetXaxis()->SetBinLabel(5,"kINT8");
1298  fHisTrigCent->GetXaxis()->SetBinLabel(6,"kCINT5");
1299  fHisTrigCent->GetXaxis()->SetBinLabel(7,"kCent");
1300  fHisTrigCent->GetXaxis()->SetBinLabel(8,"kSemiCent");
1301  fHisTrigCent->GetXaxis()->SetBinLabel(9,"kEMC1");
1302  fHisTrigCent->GetXaxis()->SetBinLabel(10,"kEMC7");
1303  fHisTrigCent->GetXaxis()->SetBinLabel(11,"kEMC8");
1304  fHisTrigCent->GetXaxis()->SetBinLabel(12,"kEMCJET7");
1305  fHisTrigCent->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
1306  fHisTrigCent->GetXaxis()->SetBinLabel(14,"kEMCJET8");
1307  fHisTrigCent->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
1308  fHisTrigCent->GetXaxis()->SetBinLabel(16,"Muons");
1309  fHisTrigCent->GetXaxis()->SetBinLabel(17,"PHOS");
1310  fHisTrigCent->GetXaxis()->SetBinLabel(18,"TRD");
1311  fHisTrigCent->GetXaxis()->SetBinLabel(19,"TRDHJT");
1312  fHisTrigCent->GetXaxis()->SetBinLabel(20,"TRDHSE");
1313  fHisTrigCent->GetXaxis()->SetBinLabel(21,"HighMult");
1314  fHisTrigCent->GetXaxis()->SetBinLabel(22,"SPI7");
1315  fHisTrigCent->GetXaxis()->SetBinLabel(23,"SPI8");
1316  fHisTrigCent->GetXaxis()->SetBinLabel(24,"Others");
1317 
1318  fHisTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
1319  fHisTrigMul->GetXaxis()->SetBinLabel(1,"All");
1320  fHisTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
1321  fHisTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
1322  fHisTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
1323  fHisTrigMul->GetXaxis()->SetBinLabel(5,"kINT8");
1324  fHisTrigMul->GetXaxis()->SetBinLabel(6,"kCINT5");
1325  fHisTrigMul->GetXaxis()->SetBinLabel(7,"kCent");
1326  fHisTrigMul->GetXaxis()->SetBinLabel(8,"kSemiCent");
1327  fHisTrigMul->GetXaxis()->SetBinLabel(9,"kEMC1");
1328  fHisTrigMul->GetXaxis()->SetBinLabel(10,"kEMC7");
1329  fHisTrigMul->GetXaxis()->SetBinLabel(11,"kEMC8");
1330  fHisTrigMul->GetXaxis()->SetBinLabel(12,"kEMCJET7");
1331  fHisTrigMul->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
1332  fHisTrigMul->GetXaxis()->SetBinLabel(14,"kEMCJET8");
1333  fHisTrigMul->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
1334  fHisTrigMul->GetXaxis()->SetBinLabel(16,"Muons");
1335  fHisTrigMul->GetXaxis()->SetBinLabel(17,"PHOS");
1336  fHisTrigMul->GetXaxis()->SetBinLabel(18,"TRD");
1337  fHisTrigMul->GetXaxis()->SetBinLabel(19,"TRDHJT");
1338  fHisTrigMul->GetXaxis()->SetBinLabel(20,"TRDHSE");
1339  fHisTrigMul->GetXaxis()->SetBinLabel(21,"HighMult");
1340  fHisTrigMul->GetXaxis()->SetBinLabel(22,"SPI7");
1341  fHisTrigMul->GetXaxis()->SetBinLabel(23,"SPI8");
1342  fHisTrigMul->GetXaxis()->SetBinLabel(24,"Others");
1343 
1344  fHisTrigCentSel=new TH2F("hTrigCentSel","Trigger types",24,-1.5,22.5,12,-10,110);
1345  fHisTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
1346  fHisTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
1347  fHisTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
1348  fHisTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
1349  fHisTrigCentSel->GetXaxis()->SetBinLabel(5,"kINT8");
1350  fHisTrigCentSel->GetXaxis()->SetBinLabel(6,"kCINT5");
1351  fHisTrigCentSel->GetXaxis()->SetBinLabel(7,"kCent");
1352  fHisTrigCentSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
1353  fHisTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMC1");
1354  fHisTrigCentSel->GetXaxis()->SetBinLabel(10,"kEMC7");
1355  fHisTrigCentSel->GetXaxis()->SetBinLabel(11,"kEMC8");
1356  fHisTrigCentSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
1357  fHisTrigCentSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
1358  fHisTrigCentSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
1359  fHisTrigCentSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
1360  fHisTrigCentSel->GetXaxis()->SetBinLabel(16,"Muons");
1361  fHisTrigCentSel->GetXaxis()->SetBinLabel(17,"PHOS");
1362  fHisTrigCentSel->GetXaxis()->SetBinLabel(18,"TRD");
1363  fHisTrigCentSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
1364  fHisTrigCentSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
1365  fHisTrigCentSel->GetXaxis()->SetBinLabel(21,"HighMult");
1366  fHisTrigCentSel->GetXaxis()->SetBinLabel(22,"SPI7");
1367  fHisTrigCentSel->GetXaxis()->SetBinLabel(23,"SPI8");
1368  fHisTrigCentSel->GetXaxis()->SetBinLabel(24,"Others");
1369 
1370  fHisTrigMulSel=new TH2F("hTrigMulSel","Multiplicity after selection vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
1371  fHisTrigMulSel->GetXaxis()->SetBinLabel(1,"All");
1372  fHisTrigMulSel->GetXaxis()->SetBinLabel(2,"kAny");
1373  fHisTrigMulSel->GetXaxis()->SetBinLabel(3,"kMB");
1374  fHisTrigMulSel->GetXaxis()->SetBinLabel(4,"kINT7");
1375  fHisTrigMulSel->GetXaxis()->SetBinLabel(5,"kINT8");
1376  fHisTrigMulSel->GetXaxis()->SetBinLabel(6,"kCINT5");
1377  fHisTrigMulSel->GetXaxis()->SetBinLabel(7,"kCent");
1378  fHisTrigMulSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
1379  fHisTrigMulSel->GetXaxis()->SetBinLabel(9,"kEMC1");
1380  fHisTrigMulSel->GetXaxis()->SetBinLabel(10,"kEMC7");
1381  fHisTrigMulSel->GetXaxis()->SetBinLabel(11,"kEMC8");
1382  fHisTrigMulSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
1383  fHisTrigMulSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
1384  fHisTrigMulSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
1385  fHisTrigMulSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
1386  fHisTrigMulSel->GetXaxis()->SetBinLabel(16,"Muons");
1387  fHisTrigMulSel->GetXaxis()->SetBinLabel(17,"PHOS");
1388  fHisTrigMulSel->GetXaxis()->SetBinLabel(18,"TRD");
1389  fHisTrigMulSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
1390  fHisTrigMulSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
1391  fHisTrigMulSel->GetXaxis()->SetBinLabel(21,"HighMult");
1392  fHisTrigMulSel->GetXaxis()->SetBinLabel(22,"SPI7");
1393  fHisTrigMulSel->GetXaxis()->SetBinLabel(23,"SPI8");
1394  fHisTrigMulSel->GetXaxis()->SetBinLabel(24,"Others");
1395 
1396  AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
1397  trigCounter->AddRubric("run",500000);
1398  trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7/INT8");
1399  trigCounter->Init();
1400 
1401  AliCounterCollection *trigCounter2=new AliCounterCollection("trigCounter2");
1402  trigCounter2->AddRubric("run",500000);
1403  trigCounter2->AddRubric("triggerType","All/Any/MB/CINT7/INT8/NoPhysSelEvNot7/NoPhysSelMB/HighMult/SPI7/SPI8/EMC1/EMC7/EMC8/EMCJET7/EMCJET8/EMCGAMMA/TRD/TRDHJT/TRDHSE");
1404  trigCounter2->Init();
1405 
1406  fHisWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",7,-1.5,5.5);
1407 
1408  fHisWhyEvRejected->GetXaxis()->SetBinLabel(1,"N events");
1409  fHisWhyEvRejected->GetXaxis()->SetBinLabel(2,"pileup");
1410  fHisWhyEvRejected->GetXaxis()->SetBinLabel(3,"centrality");
1411  fHisWhyEvRejected->GetXaxis()->SetBinLabel(4,"Vertex not found");
1412  fHisWhyEvRejected->GetXaxis()->SetBinLabel(5,"trigger");
1413  fHisWhyEvRejected->GetXaxis()->SetBinLabel(6,"z vertex out of 10 cm");
1414  fHisWhyEvRejected->GetXaxis()->SetBinLabel(7,"physics sel");
1415 
1416 
1417  fOutputEvSelection->Add(evselection);
1433  fOutputEvSelection->Add(trigCounter);
1434  fOutputEvSelection->Add(trigCounter2);
1440 
1441  }
1442  if(fOnOff[4]){ // FLOW OBSERVABLES
1443  fOutputFlowObs=new TList();
1444  fOutputFlowObs->SetOwner();
1445  fOutputFlowObs->SetName(GetOutputSlot(8)->GetContainer()->GetName());
1446 
1447  fFlowEvent = new AliFlowEvent(3000);
1448  fRFPcuts = new AliFlowTrackCuts("rfpCuts");
1449 
1450  fHisFEvents = new TH2F("hFlowEvents","FlowEvent Selection",7,0,7,7,-10,60);
1451  fHisFEvents->GetXaxis()->SetBinLabel(1,"REACHED");
1452  fHisFEvents->GetXaxis()->SetBinLabel(2,"TRIGGERED");
1453  fHisFEvents->GetXaxis()->SetBinLabel(3,"kMB");
1454  fHisFEvents->GetXaxis()->SetBinLabel(4,"kCent");
1455  fHisFEvents->GetXaxis()->SetBinLabel(5,"kSemiC");
1456  fHisFEvents->GetXaxis()->SetBinLabel(6,"Triggered + vtx cut");
1457  fHisFEvents->GetXaxis()->SetBinLabel(7,"UnexpectedBehaviour");
1459 
1460  TString ref[3] = {"FB1","FB128","VZE"};
1461  Int_t etabin[3] = {40,40,20};
1462  Int_t etamax[3] = { 1, 1, 5};
1463  for(Int_t i=0; i<3; ++i) {
1464  fHisQ[i]= new TProfile2D( Form("h%s_Q",ref[i].Data()),
1465  Form("Q_{2} components for %s",ref[i].Data()),
1466  4,0,4,12,0,60,"s");
1467  fHisQ[i]->GetXaxis()->SetBinLabel(1,"Qx^{-}");
1468  fHisQ[i]->GetXaxis()->SetBinLabel(2,"Qy^{-}");
1469  fHisQ[i]->GetXaxis()->SetBinLabel(3,"Qx^{+}");
1470  fHisQ[i]->GetXaxis()->SetBinLabel(4,"Qy^{+}");
1471  fHisQ[i]->GetYaxis()->SetTitle("Centrality");
1472  fOutputFlowObs->Add(fHisQ[i]);
1473 
1474  fHisAngleQ[i] = new TH2F( Form("h%s_AngleQ",ref[i].Data()),
1475  Form("#Psi_{2} for %s",ref[i].Data()),
1476  72,0,TMath::Pi(),12,0,60);
1477  fHisAngleQ[i]->GetXaxis()->SetTitle( Form("#Psi_{2}^{%s}",ref[i].Data()) );
1478  fHisAngleQ[i]->GetYaxis()->SetTitle("Centrality");
1479  fOutputFlowObs->Add(fHisAngleQ[i]);
1480 
1481  fHisPhiEta[i] = new TH3F( Form("h%s_PhiEta",ref[i].Data()),
1482  Form("Eta vs Phi for %s",ref[i].Data()),
1483  144,0,TMath::TwoPi(),etabin[i],-1.0*etamax[i],+1.0*etamax[i],12,0,60);
1484  fHisPhiEta[i]->GetXaxis()->SetTitle("Phi");
1485  fHisPhiEta[i]->GetYaxis()->SetTitle("Eta");
1486  fHisPhiEta[i]->GetZaxis()->SetTitle("Centrality");
1487  fOutputFlowObs->Add(fHisPhiEta[i]);
1488 
1489  }
1490  fHisTPCVZE_AngleQ = new TH3F("hTPCVZE_AngleQ","#Psi_{2}^{VZERO} vs #Psi_{2}^{TPC}", 72,0,TMath::Pi(),72,0,TMath::Pi(),12,0,60);
1491  fHisTPCVZE_AngleQ->GetXaxis()->SetTitle("#Psi_{2}^{TPC}");
1492  fHisTPCVZE_AngleQ->GetYaxis()->SetTitle("#Psi_{2}^{VZE}");
1493  fHisTPCVZE_AngleQ->GetZaxis()->SetTitle("Centrality");
1495 
1496  fHisCentVsMultRPS = new TH2F("hCentVsMultRPS", " Centrality Vs. Multiplicity RPs",5000, 0, 5000.,12,0,60 );
1497  fHisCentVsMultRPS->GetXaxis()->SetTitle("Multiplicity RPs");
1498  fHisCentVsMultRPS->GetYaxis()->SetTitle("Centrality");
1500  }
1501 
1502  // Post the data
1503  PostData(1,fOutputEntries);
1504 
1505  if(fOnOff[1]) PostData(2,fOutputPID);
1506  if(fOnOff[0]) PostData(3,fOutputTrack);
1507  PostData(4,fCuts);
1508  if(fOnOff[2]) PostData(5,fOutputCounters);
1509  if(fOnOff[3]) PostData(7,fOutputEvSelection);
1510  if(fOnOff[4]) PostData(8,fOutputFlowObs);
1511 
1512  if(!fOnOff[0] && !fOnOff[1] && !fOnOff[2]) AliError("Nothing will be filled!");
1513 }
1514 
1515 //___________________________________________________________________________
1517 {
1519 
1520  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
1521  if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
1522  // Post the data already here
1523  PostData(1,fOutputEntries);
1524  if(fOnOff[1]) PostData(2,fOutputPID);
1525  if(fOnOff[0]) PostData(3,fOutputTrack);
1526  PostData(4,fCuts);
1527  if(fOnOff[2]) {
1528  PostData(5,fOutputCounters);
1529  if(fCuts->GetUseCentrality()) PostData(6,fOutputCheckCentrality);
1530  }
1531 
1532 
1533  fHisNentries->Fill(0);
1534  if(fAODProtection>=0){
1535  // Protection against different number of events in the AOD and deltaAOD
1536  // In case of discrepancy the event is rejected.
1537  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
1538  if (matchingAODdeltaAODlevel==-1) fHisNentries->Fill(2);
1539  if (matchingAODdeltaAODlevel==0) fHisNentries->Fill(3);
1540  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
1541  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
1542  return;
1543  }
1544  fHisNentries->Fill(1);
1545  }
1546 
1548 
1549 
1550  TClonesArray *arrayProng =0;
1551 
1552  // Load all the branches of the DeltaAOD - needed for SelectionBit counting
1553  TClonesArray *arrayProngD0toKpi =0;
1554  TClonesArray *arrayProng3Prong =0;
1555  TClonesArray *arrayProng4Prong =0;
1556  TClonesArray *arrayProngDstar =0;
1557  TClonesArray *arrayProngCascades =0;
1558 
1559  Int_t pdg=0;
1560  Int_t *pdgdaughters=0x0;
1562 
1563  if(!aod && AODEvent() && IsStandardAOD()) {
1564  // In case there is an AOD handler writing a standard AOD, use the AOD
1565  // event in memory rather than the input (ESD) event.
1566  aod = dynamic_cast<AliAODEvent*> (AODEvent());
1567  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1568  // have to taken from the AOD event hold by the AliAODExtension
1569  AliAODHandler* aodHandler = (AliAODHandler*)
1570  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1571  if(aodHandler->GetExtensions()) {
1572 
1573  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1574  AliAODEvent *aodFromExt = ext->GetAOD();
1575 
1576  arrayProng3Prong =(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1577  arrayProng4Prong =(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
1578  arrayProngD0toKpi =(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
1579  arrayProngDstar =(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
1580  arrayProngCascades=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
1581 
1582  switch(fDecayChannel){
1583 
1584  case 0:
1585  arrayProng=arrayProng3Prong;
1586  pdg=411;
1587  if(fReadMC){
1588  pdgdaughters =new Int_t[3];
1589  pdgdaughters[0]=211;//pi
1590  pdgdaughters[1]=321;//K
1591  pdgdaughters[2]=211;//pi
1592  }
1593  break;
1594  case 1:
1595  arrayProng=arrayProngD0toKpi;
1596  pdg=421;
1597  if(fReadMC){
1598  pdgdaughters =new Int_t[2];
1599  pdgdaughters[0]=211;//pi
1600  pdgdaughters[1]=321;//K
1601  }
1602  break;
1603  case 2:
1604  arrayProng=arrayProngDstar;
1605  pdg=413;
1606  if(fReadMC){
1607  pdgdaughters =new Int_t[3];
1608  pdgdaughters[1]=211;//pi
1609  pdgdaughters[0]=321;//K
1610  pdgdaughters[2]=211;//pi (soft?)
1611  }
1612  break;
1613  case 3:
1614  arrayProng=arrayProng3Prong;
1615  pdg=431;
1616  if(fReadMC){
1617  pdgdaughters =new Int_t[3];
1618  pdgdaughters[0]=321;//K
1619  pdgdaughters[1]=321;//K
1620  pdgdaughters[2]=211;//pi
1621  }
1622  break;
1623  case 4:
1624  arrayProng=arrayProng4Prong;
1625  pdg=421;
1626  if(fReadMC){
1627  pdgdaughters =new Int_t[4];
1628  pdgdaughters[0]=321;
1629  pdgdaughters[1]=211;
1630  pdgdaughters[2]=211;
1631  pdgdaughters[3]=211;
1632  }
1633  break;
1634  case 5:
1635  arrayProng=arrayProng3Prong;
1636  pdg=4122;
1637  if(fReadMC){
1638  pdgdaughters =new Int_t[3];
1639  pdgdaughters[0]=2212;//p
1640  pdgdaughters[1]=321;//K
1641  pdgdaughters[2]=211;//pi
1642  }
1643  break;
1644  case kLambdactoV0:
1645  arrayProng=arrayProngCascades;
1646  pdg=4122;
1647  if(fReadMC){
1648  pdgdaughters =new Int_t[3];
1649  pdgdaughters[0]=2212;//p
1650  pdgdaughters[1]=211;//pi
1651  pdgdaughters[2]=211;//pi
1652  }
1653  break;
1654  }
1655  }
1656  } else if(aod) {
1657 
1658  arrayProng3Prong =(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1659  arrayProng4Prong =(TClonesArray*)aod->GetList()->FindObject("Charm4Prong");
1660  arrayProngD0toKpi =(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
1661  arrayProngDstar =(TClonesArray*)aod->GetList()->FindObject("Dstar");
1662  arrayProngCascades=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
1663 
1664  switch(fDecayChannel){
1665 
1666  case 0:
1667  arrayProng=arrayProng3Prong;
1668  pdg=411;
1669  if(fReadMC){
1670  pdgdaughters =new Int_t[3];
1671  pdgdaughters[0]=211;//pi
1672  pdgdaughters[1]=321;//K
1673  pdgdaughters[2]=211;//pi
1674  }
1675  break;
1676  case 1:
1677  arrayProng=arrayProngD0toKpi;
1678  pdg=421;
1679  if(fReadMC){
1680  pdgdaughters =new Int_t[2];
1681  pdgdaughters[0]=211;//pi
1682  pdgdaughters[1]=321;//K
1683  }
1684  break;
1685  case 2:
1686  arrayProng=arrayProngDstar;
1687  pdg=413;
1688  if(fReadMC){
1689  pdgdaughters =new Int_t[3];
1690  pdgdaughters[1]=211;//pi
1691  pdgdaughters[0]=321;//K
1692  pdgdaughters[2]=211;//pi (soft?)
1693  }
1694  break;
1695  case 3:
1696  arrayProng=arrayProng3Prong;
1697  pdg=431;
1698  if(fReadMC){
1699  pdgdaughters =new Int_t[3];
1700  pdgdaughters[0]=321;//K
1701  pdgdaughters[1]=321;//K
1702  pdgdaughters[2]=211;//pi
1703  }
1704  break;
1705  case 4:
1706  arrayProng=arrayProng4Prong;
1707  pdg=421;
1708  if(fReadMC){
1709  pdgdaughters =new Int_t[4];
1710  pdgdaughters[0]=321;
1711  pdgdaughters[1]=211;
1712  pdgdaughters[2]=211;
1713  pdgdaughters[3]=211;
1714  }
1715  break;
1716  case 5:
1717  arrayProng=arrayProng3Prong;
1718  pdg=4122;
1719  if(fReadMC){
1720  pdgdaughters =new Int_t[3];
1721  pdgdaughters[0]=2212;//p
1722  pdgdaughters[1]=321;//K
1723  pdgdaughters[2]=211;//pi
1724  }
1725  break;
1726  case kLambdactoV0:
1727  arrayProng=arrayProngCascades;
1728  pdg=4122;
1729  if(fReadMC){
1730  pdgdaughters =new Int_t[3];
1731  pdgdaughters[0]=2212;//p
1732  pdgdaughters[1]=211;//pi
1733  pdgdaughters[2]=211;//pi
1734  }
1735  break;
1736  }
1737  }
1738  Bool_t isSimpleMode=fSimpleMode;
1739  if(!arrayProng) {
1740  AliInfo("Branch not found! The output will contain only track related histograms\n");
1741  isSimpleMode=kTRUE;
1742  fHisNentries->Fill(7);
1743  }
1744 
1745  TClonesArray *mcArray = 0;
1746  AliAODMCHeader *mcHeader = 0;
1747 
1748  if(!aod) {
1749  delete [] pdgdaughters;
1750  return;
1751  }
1752 
1753  //check if MC
1754  if(fReadMC) {
1755  // load MC particles
1756  mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1757  if(!mcArray) {
1758  printf("AliAnalysisTaskSEHFQA::UserExec: MC particles branch not found!\n");
1759  delete [] pdgdaughters;
1760  return;
1761  }
1762 
1763  // load MC header
1764  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1765  if(!mcHeader) {
1766  printf("AliAnalysisTaskSEHFQA::UserExec: MC header branch not found!\n");
1767  delete [] pdgdaughters;
1768  return;
1769  }
1770  }
1771 
1772 
1773  UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1775  AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
1776  if(!header) AliFatal("Not a standard AOD");
1777 
1778  Double_t multiplicity=header->GetRefMultiplicity();
1779  Int_t runNumber = aod->GetRunNumber();
1780  TString trigClass=aod->GetFiredTriggerClasses();
1781  Int_t nAODtracks=aod->GetNumberOfTracks();
1782  Int_t nSelTracksTPCOnly=0;
1783  Int_t nSelTracksTPCITS=0;
1784  Int_t nSelTracksTPCITS1SPD=0;
1785  Int_t ntracksFBit4=0;
1786 
1787  AliTRDTriggerAnalysis trdSelection;
1788  trdSelection.CalcTriggers(aod);
1789 
1790  if(fReadMC) {
1791  if(aod->GetTriggerMask()==0 &&
1792  (runNumber>=195344 && runNumber<=195677)){
1793  AliDebug(3,"Event rejected because of null trigger mask");
1794  delete [] pdgdaughters;
1795  return;
1796  }
1797  }
1798 
1799  for (Int_t k=0;k<nAODtracks;k++){
1800  AliAODTrack* track=dynamic_cast<AliAODTrack*>(aod->GetTrack(k));
1801  if(!track) AliFatal("Not a standard AOD");
1802  if(track->GetID()<0) continue;
1803  Int_t nclsTot=0,nclsSPD=0;
1804  for(Int_t l=0;l<6;l++) {
1805  if(TESTBIT(track->GetITSClusterMap(),l)) {
1806  nclsTot++; if(l<2) nclsSPD++;
1807  }
1808  }
1809  UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
1810  if(TMath::Abs(track->Eta())<0.8 && nTPCClus>=70 && track->GetStatus()&AliESDtrack::kTPCrefit){
1811  if(track->TestFilterBit(1)) nSelTracksTPCOnly++;
1812  if(track->GetStatus()&AliESDtrack::kITSrefit){
1813  nSelTracksTPCITS++;
1814  if(nclsSPD>0) nSelTracksTPCITS1SPD++;
1815  }
1816  }
1817  if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1818  ntracksFBit4++;
1819  }
1820  }
1821 
1822  if(fOnOff[4]) {
1823  FillFlowObs(aod);
1824  PostData(8,fOutputFlowObs);
1825  }
1826  if(fOnOff[3]){
1827  AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
1828  AliCounterCollection* trigCount2=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter2");
1829 
1830  fHisTrigCent->Fill(-1.,centrality);
1831  fHisTrigMul->Fill(-1.,multiplicity);
1832  trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
1833  trigCount2->Count(Form("triggerType:All/Run:%d",runNumber));
1834  if(evSelMask==0){
1835  if(aod->GetEventType()!=7 || trigClass.Contains("BEAMB")){
1836  trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1837  trigCount2->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1838  }else if(trigClass.Contains("CMUP1")){
1839  trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
1840  }else if(trigClass.Contains("MUON")){
1841  trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
1842  }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
1843  trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1844  trigCount2->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1845  }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
1846  trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
1847  }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
1848  trigCount->Count(Form("triggerType:NoPhysSelSemiCent/Run:%d",runNumber));
1849  }
1850  }
1851  if(evSelMask & AliVEvent::kAny){
1852  fHisTrigCent->Fill(0.,centrality);
1853  fHisTrigMul->Fill(0.,multiplicity);
1854  trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
1855  trigCount2->Count(Form("triggerType:Any/Run:%d",runNumber));
1856  }
1857  if(evSelMask & AliVEvent::kMB){
1858  fHisTrigCent->Fill(1.,centrality);
1859  fHisTrigMul->Fill(1.,multiplicity);
1860  trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
1861  trigCount2->Count(Form("triggerType:MB/Run:%d",runNumber));
1862  }
1863  if(evSelMask & AliVEvent::kINT7){
1864  fHisTrigCent->Fill(2.,centrality);
1865  fHisTrigMul->Fill(2.,multiplicity);
1866  trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1867  trigCount2->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1868  }
1869  if(evSelMask & AliVEvent::kINT8){
1870  fHisTrigCent->Fill(3.,centrality);
1871  fHisTrigMul->Fill(3.,multiplicity);
1872  trigCount->Count(Form("triggerType:INT8/Run:%d",runNumber));
1873  trigCount2->Count(Form("triggerType:INT8/Run:%d",runNumber));
1874  }
1875  if(evSelMask & AliVEvent::kCINT5){
1876  fHisTrigCent->Fill(4.,centrality);
1877  fHisTrigMul->Fill(4.,multiplicity);
1878  }
1879  if(evSelMask & AliVEvent::kCentral){
1880  fHisTrigCent->Fill(5.,centrality);
1881  fHisTrigMul->Fill(5.,multiplicity);
1882  trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
1883  }
1884  if(evSelMask & AliVEvent::kSemiCentral){
1885  fHisTrigCent->Fill(6.,centrality);
1886  fHisTrigMul->Fill(6.,multiplicity);
1887  trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
1888  }
1889 
1890  if(evSelMask & AliVEvent::kEMC1){
1891  fHisTrigCent->Fill(7.,centrality);
1892  fHisTrigMul->Fill(7.,multiplicity);
1893  trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1894  trigCount2->Count(Form("triggerType:EMC1/Run:%d",runNumber));
1895  }
1896  if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
1897  fHisTrigCent->Fill(8.,centrality);
1898  fHisTrigMul->Fill(8.,multiplicity);
1899  trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1900  trigCount2->Count(Form("triggerType:EMC7/Run:%d",runNumber));
1901  }
1902  if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
1903  fHisTrigCent->Fill(9.,centrality);
1904  fHisTrigMul->Fill(9.,multiplicity);
1905  trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1906  trigCount2->Count(Form("triggerType:EMC8/Run:%d",runNumber));
1907  }
1908  if(evSelMask & AliVEvent::kEMCEJE){
1909  trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1910  if(trigClass.Contains("CEMC7EJE")) {
1911  trigCount2->Count(Form("triggerType:EMCJET7/Run:%d",runNumber));
1912  fHisTrigCent->Fill(10.,centrality);
1913  fHisTrigMul->Fill(10.,multiplicity);
1914 
1915  }
1916  else if(trigClass.Contains("CEMC8EJE")) {
1917  trigCount2->Count(Form("triggerType:EMCJET8/Run:%d",runNumber));
1918  fHisTrigCent->Fill(12.,centrality);
1919  fHisTrigMul->Fill(12.,multiplicity);
1920  }
1921  }
1922  if(evSelMask & AliVEvent::kEMCEGA){
1923  if(trigClass.Contains("CEMC7EGA")) {
1924  fHisTrigCent->Fill(11.,centrality);
1925  fHisTrigMul->Fill(11.,multiplicity);
1926  } else if (trigClass.Contains("CEMC8EGA")){
1927  fHisTrigCent->Fill(13.,centrality);
1928  fHisTrigMul->Fill(13.,multiplicity);
1929 
1930  }
1931  trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1932  trigCount2->Count(Form("triggerType:EMCGAMMA/Run:%d",runNumber));
1933  }
1934  if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1935  fHisTrigCent->Fill(14.,centrality);
1936  fHisTrigMul->Fill(14.,multiplicity);
1937  trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
1938  }
1939  if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1940  fHisTrigCent->Fill(15.,centrality);
1941  fHisTrigMul->Fill(15.,multiplicity);
1942  }
1943  if(evSelMask & (AliVEvent::kTRD)){
1944  fHisTrigCent->Fill(16.,centrality);
1945  fHisTrigMul->Fill(16.,multiplicity);
1946  trigCount2->Count(Form("triggerType:TRD/Run:%d",runNumber));
1947  }
1948  if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
1949  fHisTrigCent->Fill(17.,centrality);
1950  fHisTrigMul->Fill(17.,multiplicity);
1951  trigCount2->Count(Form("triggerType:TRDHJT/Run:%d",runNumber));
1952  }
1953  if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
1954  fHisTrigCent->Fill(18.,centrality);
1955  fHisTrigMul->Fill(18.,multiplicity);
1956  trigCount2->Count(Form("triggerType:TRDHSE/Run:%d",runNumber));
1957  }
1958  if(evSelMask & (AliVEvent::kHighMult)){
1959  fHisTrigCent->Fill(19.,centrality);
1960  fHisTrigMul->Fill(19.,multiplicity);
1961  trigCount2->Count(Form("triggerType:HighMult/Run:%d",runNumber));
1962  }
1963  if(evSelMask & AliVEvent::kSPI7){
1964  if(trigClass.Contains("CSPI7")) {
1965  fHisTrigCent->Fill(20.,centrality);
1966  fHisTrigMul->Fill(20.,multiplicity);
1967  trigCount2->Count(Form("triggerType:SPI7/Run:%d",runNumber));
1968  }
1969  }
1970  if(evSelMask & AliVEvent::kSPI){
1971  if(trigClass.Contains("CSPI8")) {
1972  fHisTrigCent->Fill(21.,centrality);
1973  fHisTrigMul->Fill(21.,multiplicity);
1974  trigCount2->Count(Form("triggerType:SPI8/Run:%d",runNumber));
1975  }
1976  }
1977  if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1978  fHisTrigCent->Fill(22.,centrality);
1979  fHisTrigMul->Fill(22.,multiplicity);
1980  }
1981  }
1982 
1983 
1984  // fix for temporary bug in ESDfilter
1985  // the AODs with null vertex pointer didn't pass the PhysSel
1986  Double_t magField = aod->GetMagneticField();
1987  if(!aod->GetPrimaryVertex() || TMath::Abs(magField)<0.001) {
1988  delete [] pdgdaughters;
1989  return;
1990  }
1991 
1992  // count event
1993  fHisNentries->Fill(5);
1994  //count events with good vertex
1995  // AOD primary vertex
1996  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1997  Double_t pos[3],cov[6];
1998  vtx1->GetXYZ(pos);
1999  vtx1->GetCovarianceMatrix(cov);
2000  const AliESDVertex vESD(pos,cov,100.,100);
2001 
2002  TString primTitle = vtx1->GetTitle();
2003  if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fHisNentries->Fill(9);
2004 
2005  // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
2006  //TString trigclass=aod->GetFiredTriggerClasses();
2007  //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fHisNentries->Fill(9); //tmp
2008 
2009 
2010 
2011 
2012  Bool_t evSelbyCentrality=kTRUE,evSelected=kTRUE,evSelByVertex=kTRUE,evselByPileup=kTRUE,evSelByPS=kTRUE;
2013 
2014  if(fOnOff[3]){
2015  fHisWhyEvRejected->Fill(-1);
2016  }
2017 
2018  //select event
2019  if(!fCuts->IsEventSelected(aod)) {
2020  evSelected=kFALSE;
2022  fHisWhyEvRejected->Fill(0);
2023  evselByPileup=kFALSE;
2024  }// rejected for pileup
2026  fHisWhyEvRejected->Fill(1);
2027  evSelbyCentrality=kFALSE; //rejected by centrality
2028  }
2031  evSelByVertex=kFALSE;
2032  fHisWhyEvRejected->Fill(2);
2033  }
2035  fHisWhyEvRejected->Fill(3);
2036  }
2038  evSelByVertex=kFALSE;
2039  if(fOnOff[3]) ((AliCounterCollection*)fOutputEvSelection->FindObject("evselection"))->Count(Form("evnonsel:zvtx/Run:%d",runNumber));
2040  fHisWhyEvRejected->Fill(4);
2041  }
2043  evSelByPS=kFALSE;
2044  fHisWhyEvRejected->Fill(5);
2045  }
2046  }
2047  if(evSelected && fOnOff[3]){
2048  fHisTrigCentSel->Fill(-1.,centrality);
2049  fHisTrigMulSel->Fill(-1.,multiplicity);
2050  if(evSelMask & AliVEvent::kAny) {
2051  fHisTrigCentSel->Fill(0.,centrality);
2052  fHisTrigMulSel->Fill(0.,multiplicity);}
2053  if(evSelMask & AliVEvent::kMB) {
2054  fHisTrigCentSel->Fill(1.,centrality);
2055  fHisTrigMulSel->Fill(1.,multiplicity);}
2056  if(evSelMask & AliVEvent::kINT7){
2057  fHisTrigCentSel->Fill(2.,centrality);
2058  fHisTrigMulSel->Fill(2.,multiplicity);}
2059  if(evSelMask & AliVEvent::kINT8){
2060  fHisTrigCentSel->Fill(3.,centrality);
2061  fHisTrigMulSel->Fill(3.,multiplicity);}
2062  if(evSelMask & AliVEvent::kCINT5){
2063  fHisTrigCentSel->Fill(4.,centrality);
2064  fHisTrigMulSel->Fill(4.,multiplicity);}
2065  if(evSelMask & AliVEvent::kCentral){
2066  fHisTrigCentSel->Fill(5.,centrality);
2067  fHisTrigMulSel->Fill(5.,multiplicity);}
2068  if(evSelMask & AliVEvent::kSemiCentral){
2069  fHisTrigCentSel->Fill(6.,centrality);
2070  fHisTrigMulSel->Fill(6.,multiplicity);}
2071  if(evSelMask & AliVEvent::kEMC1){
2072  fHisTrigCentSel->Fill(7.,centrality);
2073  fHisTrigMulSel->Fill(7.,multiplicity);
2074  }
2075  if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
2076  fHisTrigCentSel->Fill(8.,centrality);
2077  fHisTrigMulSel->Fill(8.,multiplicity);
2078  }
2079  if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
2080  fHisTrigCentSel->Fill(9.,centrality);
2081  fHisTrigMulSel->Fill(9.,multiplicity);
2082  }
2083  if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC7EJE")){
2084  fHisTrigCentSel->Fill(10.,centrality);
2085  fHisTrigMulSel->Fill(10.,multiplicity);
2086  }
2087  if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC7EGA")){
2088  fHisTrigCentSel->Fill(11.,centrality);
2089  fHisTrigMulSel->Fill(11.,multiplicity);
2090  }
2091  if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC8EJE")){
2092  fHisTrigCentSel->Fill(12.,centrality);
2093  fHisTrigMulSel->Fill(12.,multiplicity);
2094  }
2095  if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC8EGA")){
2096  fHisTrigCentSel->Fill(13.,centrality);
2097  fHisTrigMulSel->Fill(13.,multiplicity);
2098  }
2099  if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
2100  fHisTrigCentSel->Fill(14.,centrality);
2101  fHisTrigMulSel->Fill(14.,multiplicity);}
2102  if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
2103  fHisTrigCentSel->Fill(15.,centrality);
2104  fHisTrigMulSel->Fill(15.,multiplicity);}
2105  if(evSelMask & (AliVEvent::kTRD)){
2106  fHisTrigCentSel->Fill(16.,centrality);
2107  fHisTrigMulSel->Fill(16.,multiplicity);
2108  }
2109  if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
2110  fHisTrigCentSel->Fill(17.,centrality);
2111  fHisTrigMulSel->Fill(17.,multiplicity);
2112  }
2113  if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
2114  fHisTrigCentSel->Fill(18.,centrality);
2115  fHisTrigMulSel->Fill(18.,multiplicity);
2116  }
2117  if(evSelMask & (AliVEvent::kHighMult)){
2118  fHisTrigCentSel->Fill(19.,centrality);
2119  fHisTrigMulSel->Fill(19.,multiplicity);}
2120  if(evSelMask & AliVEvent::kSPI7){
2121  if(trigClass.Contains("CSPI7")) {
2122  fHisTrigCentSel->Fill(20.,centrality);
2123  fHisTrigMulSel->Fill(20.,multiplicity);
2124  }
2125  }
2126  if(evSelMask & AliVEvent::kSPI){
2127  if(trigClass.Contains("CSPI8")) {
2128  fHisTrigCentSel->Fill(21.,centrality);
2129  fHisTrigMulSel->Fill(21.,multiplicity);
2130  }
2131  }
2132  if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
2133  fHisTrigCentSel->Fill(22.,centrality);
2134  fHisTrigMulSel->Fill(22.,multiplicity);}
2135  }
2136 
2137  if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
2138  if(fOnOff[2] && fCuts->GetUseCentrality()){
2139 
2140  Float_t stdCentf=fCuts->GetCentrality(aod);
2141  Int_t stdCent = (Int_t)(stdCentf+0.5);
2142  Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
2143  Int_t secondCent = (Int_t)(secondCentf+0.5);
2144  Int_t mincent=stdCent-stdCent%10;
2145  Float_t stdSignal = 0.;
2146  Float_t secondSignal = 0.;
2147  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
2148  AliAODZDC *zdcAOD = (AliAODZDC*)aod->GetZDCData();
2149  const Double_t *towerZNASignal = zdcAOD->GetZNATowerEnergy();
2150  switch(fCuts->GetUseCentrality())
2151  {
2152  case AliRDHFCuts::kCentV0M:
2153  stdSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
2154  break;
2155  case AliRDHFCuts::kCentV0A:
2156  stdSignal = vzeroAOD->GetMTotV0A();
2157  break;
2158  case AliRDHFCuts::kCentZNA:
2159  stdSignal = towerZNASignal[0];
2160  break;
2161  default:
2162  stdSignal = 0.;
2163  break;
2164  }
2165  switch(fEstimator)
2166  {
2167  case AliRDHFCuts::kCentV0M:
2168  secondSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
2169  break;
2170  case AliRDHFCuts::kCentV0A:
2171  secondSignal = vzeroAOD->GetMTotV0A();
2172  break;
2173  case AliRDHFCuts::kCentZNA:
2174  secondSignal = towerZNASignal[0];
2175  break;
2176  default:
2177  secondSignal = 0.;
2178  break;
2179  }
2180  //AliCentrality *aodcent = aod->GetCentrality();
2181  // Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
2182  if(stdCentf==-1) {
2183  mincent=-10;
2184  stdCent=-1;
2185  }
2186  if(mincent==100)mincent--;
2187  ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
2188 
2189  mincent=secondCent-secondCent%10;
2190  if(secondCentf==-1) {
2191  mincent=-10;
2192  secondCent=-1;
2193  }
2194  if(mincent==100)mincent--;
2195  ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
2196 
2197  if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
2198  fHisNtrackletsOut->Fill(aod->GetTracklets()->GetNumberOfTracklets());
2199  fHisMultOut->Fill(header->GetRefMultiplicity());
2200  }else{
2201  fHisNtrackletsIn->Fill(aod->GetTracklets()->GetNumberOfTracklets());
2202  fHisMultIn->Fill(header->GetRefMultiplicity());
2203  }
2204  fHisMultvsPercentile->Fill(header->GetRefMultiplicity(),stdCentf);
2205  fHisntrklvsPercentile->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
2207  fHisnTPCTracksvsPercentile->Fill(nSelTracksTPCOnly,stdCentf);
2208  fHisnTPCITSTracksvsPercentile->Fill(nSelTracksTPCITS,stdCentf);
2209  fHisnTPCITS1SPDTracksvsPercentile->Fill(nSelTracksTPCITS1SPD,stdCentf);
2210  fHisStdEstimSignalPercentile->Fill(stdSignal,stdCentf);
2211  fHisStdEstimSignal->Fill(stdSignal);
2212  fHisStdEstimSignalNtrackletsIn->Fill(stdSignal,aod->GetTracklets()->GetNumberOfTracklets());
2213  fHisStdPercentileSecondPercentile->Fill(stdCentf,secondCentf);
2214  fHisStdSignalSecondSignal->Fill(stdSignal,secondSignal);
2215 
2216  if( (fCuts->GetMultSelectionObjectName()).CompareTo("MultSelection")!=0 ){
2217  AliMultSelection *multSelectionOld = (AliMultSelection*) aod -> FindListObject("MultSelection");
2218  Float_t oldFrmwCent = multSelectionOld ? multSelectionOld->GetMultiplicityPercentile("V0M") : -1;
2219  // Printf(" HFQA task: new centrality %3.3f vs old centrality %3.2f \n",stdCentf,oldFrmwCent);
2220  fHisStdPercentileOldFrwPercentile->Fill(stdCentf,oldFrmwCent);
2221  //
2222  Double_t differenceCent = TMath::Abs( stdCentf - oldFrmwCent );
2223  if(differenceCent>1) fHisStdPercentileOldFrwPercentileDev->Fill(0.);
2224  if(differenceCent>0.5) fHisStdPercentileOldFrwPercentileDev->Fill(1.);
2225  if( (stdCentf<20) && (oldFrmwCent>20) ) fHisStdPercentileOldFrwPercentileDev->Fill(2.);
2226  if( (stdCentf>20) && (oldFrmwCent<20) ) fHisStdPercentileOldFrwPercentileDev->Fill(3.);
2228  }
2229 
2230  PostData(6,fOutputCheckCentrality);
2231 
2232  } else{
2233  if(fOnOff[0]){
2234  fHisNtracklets->Fill(aod->GetTracklets()->GetNumberOfTracklets());
2236  fHisMult->Fill(header->GetRefMultiplicity());
2237  fHisMultFBit4->Fill(ntracksFBit4);
2238  fHisMultComb05->Fill(header->GetRefMultiplicityComb05());
2239  fHisMultComb08->Fill(header->GetRefMultiplicityComb08());
2240  }
2241  }
2242  }
2243 
2244  if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS) || (!evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
2245  if(fOnOff[2] && fCuts->GetUseCentrality()){
2247  }else{
2248  if(fOnOff[0]){
2250  }
2251  }
2252  }
2253 
2254  if(fOnOff[3]){
2255  const AliVVertex *vertex = aod->GetPrimaryVertex();
2256  Double_t xvtx=vertex->GetX();
2257  Double_t yvtx=vertex->GetY();
2258  Double_t zvtx=vertex->GetZ();
2259  Int_t vtxTyp=0;
2260  if(vertex->GetNContributors()<=0) vtxTyp=-1;
2261  TString title=vertex->GetTitle();
2262  if(title.Contains("Z")) vtxTyp=2;
2263  if(title.Contains("3D")) vtxTyp=1;
2264  fHisxvtx->Fill(xvtx);
2265  fHisyvtx->Fill(yvtx);
2266  fHiszvtx->Fill(zvtx);
2267  fHisWhichVert->Fill(vtxTyp);
2268  const AliVVertex *vSPD = aod->GetPrimaryVertexSPD();
2269  fHiszvtxvsSPDzvtx->Fill(vSPD->GetZ(),zvtx);
2270  if(evSelected){
2271  fHisxvtxSelEv->Fill(xvtx);
2272  fHisyvtxSelEv->Fill(yvtx);
2273  fHiszvtxSelEv->Fill(zvtx);
2274  fHisWhichVertSelEv->Fill(vtxTyp);
2275  fHiszvtxvsSPDzvtxSel->Fill(vSPD->GetZ(),zvtx);
2276  }
2277 
2278  Int_t nCls = aod->GetNumberOfITSClusters(0) + aod->GetNumberOfITSClusters(1);
2279  fHisnClsITSvsNtrackletsSel->Fill(nCls,aod->GetTracklets()->GetNumberOfTracklets());
2280 
2281  }
2282 
2283  if(!evSelected) {
2284  delete [] pdgdaughters;
2285  return; //discard all events not selected (vtx and/or centrality)
2286  }
2287 
2288 
2289  AliAODPidHF* pidHF=fCuts->GetPidHF();
2290  if(!pidHF) {
2291  delete [] pdgdaughters;
2292  return;
2293  }
2294  //load all the branches, re-fill the candidates and fill the SelectionBit histo
2295 
2296  Int_t nCand3Prong = arrayProng3Prong->GetEntriesFast();
2297  Int_t nCandD0toKpi = arrayProngD0toKpi->GetEntriesFast();
2298  Int_t nCandDstar = arrayProngDstar->GetEntriesFast();
2299  Int_t nCandCasc=0;
2300  // Int_t n4Prong=0;
2301  if(arrayProngCascades)nCandCasc = arrayProngCascades->GetEntriesFast();
2302  // if(arrayProng4Prong)n4Prong = arrayProng4Prong->GetEntriesFast();
2303  // D+, Ds and Lc
2304  AliAODRecoDecayHF *d;
2305  for (Int_t iCand = 0; iCand < nCand3Prong; iCand++) {
2306  d = (AliAODRecoDecayHF*)arrayProng3Prong->UncheckedAt(iCand);
2307  if(!vHF->FillRecoCand(aod,(AliAODRecoDecayHF3Prong*)d))continue;
2308 
2309  if(fUseSelectionBit){
2310  Double_t ptCand_selBit = d->Pt();
2311  if(fUseSelectionBit && d->GetSelectionMap()) {
2312  if(d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) fHisNentriesSelBit->Fill(0.0,ptCand_selBit);
2313  if(d->HasSelectionBit(AliRDHFCuts::kDsCuts)) fHisNentriesSelBit->Fill(1.0,ptCand_selBit);
2314  if(d->HasSelectionBit(AliRDHFCuts::kLcCuts)) fHisNentriesSelBit->Fill(2.0,ptCand_selBit);
2315  }
2316  }
2317  }
2318  // D0kpi
2319  for (Int_t iCand = 0; iCand < nCandD0toKpi; iCand++) {
2320  d = (AliAODRecoDecayHF*)arrayProngD0toKpi->UncheckedAt(iCand);
2321  if(!vHF->FillRecoCand(aod,(AliAODRecoDecayHF2Prong*)d))continue;
2322  if(fUseSelectionBit){
2323  Double_t ptCand_selBit = d->Pt();
2324  if(fUseSelectionBit && d->GetSelectionMap()) {
2325  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) fHisNentriesSelBit->Fill(3.0,ptCand_selBit);
2326  }
2327  }
2328  }
2329  // Dstar
2330  for (Int_t iCand = 0; iCand < nCandDstar; iCand++) {
2331  d = (AliAODRecoDecayHF*)arrayProngDstar->UncheckedAt(iCand);
2332  if(!vHF->FillRecoCasc(aod,((AliAODRecoCascadeHF*)d),kTRUE))continue;
2333  if(fUseSelectionBit){
2334  Double_t ptCand_selBit = d->Pt();
2335  if(fUseSelectionBit && d->GetSelectionMap()) {
2336  if(d->HasSelectionBit(AliRDHFCuts::kDstarCuts)) fHisNentriesSelBit->Fill(4.0,ptCand_selBit);
2337  }
2338  }
2339  }
2340 // //Cascade
2341  if(arrayProngCascades){
2342  for (Int_t iCand = 0; iCand < nCandCasc; iCand++) {
2343  d=(AliAODRecoDecayHF*)arrayProngCascades->UncheckedAt(iCand);
2344  if(!vHF->FillRecoCasc(aod,((AliAODRecoCascadeHF*)d),kFALSE))continue;
2345  }
2346  }
2347  //end refill
2348 
2349  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2350  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
2351  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
2352 
2353  //AliPIDResponse* respF=pidHF->GetPidResponse();
2354  AliTPCPIDResponse* tpcres=new AliTPCPIDResponse();
2355  Bool_t oldPID=pidHF->GetOldPid();
2356  if(oldPID){
2357  Double_t alephParameters[5];
2358  pidHF->GetTPCBetheBlochParams(alephParameters);
2359  tpcres->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
2360  }
2361 
2362 
2363  Int_t ntracks=0;
2364  Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
2365 
2366  if(aod) ntracks=aod->GetNumberOfTracks();
2367 
2368  if(fOnOff[0] || fOnOff[1]){
2369  //loop on tracks in the event
2370  for (Int_t k=0;k<ntracks;k++){
2371  AliAODTrack* track=dynamic_cast<AliAODTrack*>(aod->GetTrack(k));
2372  if(!track) AliFatal("Not a standard AOD");
2373  // Track selection cuts
2374  if(track->GetID()<0) continue;
2375  Double_t d0z0[2],covd0z0[3];
2376  if(!track->PropagateToDCA(vtx1,magField,99999.,d0z0,covd0z0)) continue;
2377  if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
2378  fHisd0TracksFilterBit4->Fill(d0z0[0]);
2379  }
2380  ULong_t trStatus=track->GetStatus();
2381  if(trStatus&AliESDtrack::kITSrefit){
2382  if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
2383  fHisd0TracksSPDany->Fill(d0z0[0]);
2384  if(track->HasPointOnITSLayer(0)){
2385  fHisd0TracksSPDin->Fill(d0z0[0]);
2386  }
2387  }
2388  }
2389 
2390  Bool_t selTrack=kTRUE;
2391  if (!((trStatus & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
2392  !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
2393  selTrack=kFALSE;
2394  }
2395  if(!track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){ // BIT(4) standard cuts with very loose DCA
2396  selTrack=kFALSE;
2397  }
2398  if(TMath::Abs(track->Eta())>0.9){
2399  selTrack=kFALSE;
2400  }
2401  Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
2402  Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0;
2403  if (track->GetTPCNclsF()>0) {
2404  ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
2405  }
2406 
2407  Bool_t selTrackNoSPD=selTrack;
2408  if(selTrack){
2409  if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
2410  fHisd0TracksTPCITSSPDany->Fill(d0z0[0]);
2411  }
2412  }
2413 
2414  AliAODPid *pid = track->GetDetPid();
2415  if(!pid && fDebug>1) cout<<"No AliAODPid found"<<endl;
2416 
2417  if(pid && fOnOff[1]){
2418  Double_t times[AliPID::kSPECIES];
2419  pid->GetIntegratedTimes(times);
2420 
2421  Double_t tofRes[AliPID::kSPECIES];
2422  pid->GetTOFpidResolution(tofRes);
2423 
2424  //check TOF
2425  fHisTOFflags->Fill(0.);
2426  if (trStatus&AliESDtrack::kTPCout) fHisTOFflags->Fill(1.);
2427  if (trStatus&AliESDtrack::kTOFout) fHisTOFflags->Fill(2.);
2428  if (trStatus&AliESDtrack::kTIME) fHisTOFflags->Fill(3.);
2429  if (trStatus&AliESDtrack::kTOFpid) fHisTOFflags->Fill(4.);
2430  if (trStatus&AliESDtrack::kTOFmismatch) fHisTOFflags->Fill(5.);
2431 
2432  Bool_t isTOFok=kFALSE;
2433  if(pidResp){
2434  Double_t prob[AliPID::kSPECIES];
2435  if(pidResp->ComputeTOFProbability(track,AliPID::kSPECIES,prob)==AliPIDResponse::kDetPidOk){
2436  isTOFok=kTRUE;
2437  fHisTOFflags->Fill(6.);
2438  }
2439  }
2440 
2441  if(selTrack && isTOFok){
2442  Double_t tofTime=pid->GetTOFsignal();
2443  AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
2444  if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
2445  // with new AOD we need to retrieve startTime, subtract it and retrieve correctly TOF PID resolutions *PA*
2446  AliTOFPIDResponse tofResp=pidResp->GetTOFResponse();
2447  Double_t startTime = tofResp.GetStartTime(track->P());
2448  Float_t startTimeRes = tofResp.GetStartTimeRes(track->P());
2449  Int_t startTimeMask = tofResp.GetStartTimeMask(track->P());
2450  fHisTOFstartTimeDistrib->Fill(startTime);
2451  fHisTOFstartTimeMask->Fill(startTimeMask);
2452  fHisTOFstartTimeRes->Fill(startTimeRes);
2453  tofTime-=startTime;
2454  for (Int_t type=0;type<AliPID::kSPECIES;type++) tofRes[type]=tofResp.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMassZ(type));
2455  }
2456  fHisTOFtime->Fill(times[AliPID::kKaon]);
2457  fHisTOFtimeKaonHyptime->Fill(track->P(),tofTime-times[3]); //3 is kaon
2458  fHisTOFsig->Fill(tofTime);
2459  if (pid->GetTOFsignal()< 0) fHisTOFsig->Fill(-1);
2460 
2461  Double_t nsigma[3]={-10,-10,-10};
2462  nsigma[0]=pidResp->NumberOfSigmasTOF(track,AliPID::kPion);
2463  nsigma[1]=pidResp->NumberOfSigmasTOF(track,AliPID::kKaon);
2464  nsigma[2]=pidResp->NumberOfSigmasTOF(track,AliPID::kProton);
2465 
2466  fHisTOFsigmaKSigPid->Fill(track->P(),nsigma[1]);
2467  fHisTOFsigmaPionSigPid->Fill(track->P(),nsigma[0]);
2468  fHisTOFsigmaProtonSigPid->Fill(track->P(),nsigma[2]);
2469  if(fReadMC){
2470  Int_t label=track->GetLabel();
2471  if(label<=0) continue;
2472  AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
2473  if(mcpart){
2474  Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
2475  if(abspdgcode==211) fHisTOFsigmaMCPionSigPid->Fill(track->P(),nsigma[0]);
2476  if(abspdgcode==321) fHisTOFsigmaMCKSigPid->Fill(track->P(),nsigma[1]);
2477  if(abspdgcode==2212) fHisTOFsigmaMCProtonSigPid->Fill(track->P(),nsigma[2]);
2478 
2479  }
2480  }
2481 
2482  for (Int_t iS=2; iS<5; iS++){ //we plot TOF Pid resolution for 3-sigma identified particles
2483  if ( TMath::Abs(nsigma[iS-2])<3.){
2484  switch (iS) {
2485  case AliPID::kPion:
2486  fHisTOFsigPid3sigPion->Fill(tofRes[iS]);
2487  break;
2488  case AliPID::kKaon:
2489  fHisTOFsigPid3sigKaon->Fill(tofRes[iS]);
2490  break;
2491  case AliPID::kProton:
2492  fHisTOFsigPid3sigProton->Fill(tofRes[iS]);
2493  break;
2494  default:
2495  break;
2496  }
2497  }
2498  }
2499  }//if TOF status
2500  //}
2501 
2502  if(pidHF && pidHF->CheckStatus(track,"TPC") && selTrack){
2503 
2504  Double_t TPCp=pid->GetTPCmomentum();
2505  Double_t TPCsignal=pid->GetTPCsignal();
2506  UShort_t TPCsignalN=pid->GetTPCsignalN();
2507  fHisTPCsig->Fill(TPCsignal);
2508  fHisTPCsigvsp->Fill(TPCp,TPCsignal);
2509  //if (pidHF->IsKaonRaw(track, "TOF"))
2510  Double_t nsigma[3]={-10,-10,-10};
2511  pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kPion,nsigma[0]);
2512  pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kKaon,nsigma[1]);
2513  pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kProton,nsigma[2]);
2514 
2515  fHisTPCsigmaK->Fill(TPCp,nsigma[1]);
2516 
2517  fHisTPCsigmaPion->Fill(TPCp,nsigma[0]);
2518  fHisTPCsigmaProton->Fill(TPCp,nsigma[2]);
2519 
2520  if(fReadMC){
2521  Int_t label=track->GetLabel();
2522  if(label<=0) continue;
2523  AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
2524  if(mcpart){
2525  Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
2526  if(abspdgcode==211) fHisTPCsigmaMCPion->Fill(track->P(),nsigma[0]);
2527  if(abspdgcode==321) fHisTPCsigmaMCK->Fill(track->P(),nsigma[1]);
2528  if(abspdgcode==2212) fHisTPCsigmaMCProton->Fill(track->P(),nsigma[2]);
2529 
2530  }
2531 
2532  }
2533  if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
2534  fHisTPCsigNvsPtAllTracks->Fill(track->Pt(),(Float_t)TPCsignalN);
2535  fHisTPCsigNvsPhiAllTracks->Fill(track->Phi(),(Float_t)TPCsignalN);
2536  fHisTPCsigNvsEtaAllTracks->Fill(track->Eta(),(Float_t)TPCsignalN);
2537  }
2538 
2539  }//if TPC status
2540  } //end PID histograms
2541 
2542  Int_t nclsTot=0,nclsSPD=0;
2543 
2544  //check clusters of the tracks
2545  if(fOnOff[0]){
2546 
2547  fHisnLayerITS->Fill(-1);
2548  if(selTrackNoSPD) fHisnLayerITSselTr->Fill(-1);
2549  for(Int_t l=0;l<6;l++) {
2550  if(TESTBIT(track->GetITSClusterMap(),l)) {
2551  fHisnLayerITS->Fill(l);
2552  if(selTrackNoSPD) fHisnLayerITSselTr->Fill(l);
2553  nclsTot++; if(l<2) nclsSPD++;
2554  }
2555  }
2556  fHisnClsITS->Fill(nclsTot);
2557  fHisnClsSPD->Fill(nclsSPD);
2558 
2559  if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
2560 
2561  fHisPtAllTracks->Fill(track->Pt());
2562  fHisPhiAllTracks->Fill(track->Phi());
2563  fHisEtaAllTracks->Fill(track->Eta());
2564  fHisEtavsPhiAllTracks->Fill(track->Phi(),track->Eta());
2565  fHisNTPCclsvsPtAllTracks->Fill(track->Pt(),track->GetTPCNcls());
2566  fHisNTPCclsvsPhiAllTracks->Fill(track->Phi(),track->GetTPCNcls());
2567  fHisNTPCclsvsEtaAllTracks->Fill(track->Eta(),track->GetTPCNcls());
2568 
2569  fHisNTPCCrossedRowsvsPtAllTracks->Fill(track->Pt(),nCrossedRowsTPC);
2570  fHisNTPCCrossedRowsvsPhiAllTracks->Fill(track->Phi(),nCrossedRowsTPC);
2571  fHisNTPCCrossedRowsvsEtaAllTracks->Fill(track->Eta(),nCrossedRowsTPC);
2572 
2573  fHisRatioCRowsOverFclsvsPtAllTracks->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
2574  fHisRatioCRowsOverFclsvsPhiAllTracks->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
2575  fHisRatioCRowsOverFclsvsEtaAllTracks->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
2576 
2577  if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2578  fHisSPDclsAllTracks->Fill(0);
2579  }
2580  if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2581  fHisSPDclsAllTracks->Fill(1);
2582  }
2583  if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2584  fHisSPDclsAllTracks->Fill(2);
2585  }
2586  if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2587  fHisSPDclsAllTracks->Fill(3);
2588  }
2589  fHisNITSclsvsPtAllTracks->Fill(track->Pt(), nclsTot);
2590  fHisNITSclsvsPhiAllTracks->Fill(track->Phi(), nclsTot);
2591  fHisNITSclsvsEtaAllTracks->Fill(track->Eta(), nclsTot);
2592 
2593  }
2594 
2595  if(track->Pt()>0.3 &&
2596  TMath::Abs(track->Eta())<0.8 &&
2597  track->GetStatus()&AliESDtrack::kITSrefit &&
2598  track->GetStatus()&AliESDtrack::kTPCrefit &&
2599  nclsSPD>0){
2600  fHisnClsITSselTr->Fill(nclsTot);
2601  }
2602  if(!(track->GetStatus()&AliESDtrack::kTPCin) && track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kITSpureSA)){//tracks retrieved in the ITS and not reconstructed in the TPC
2603  fHisnClsITSSA->Fill(nclsTot);
2604  if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1))
2605  fHisnClsITSSAspdAny->Fill(nclsTot);
2606  if(track->HasPointOnITSLayer(0))
2607  fHisnClsITSSAspdIn->Fill(nclsTot);
2608  if(track->HasPointOnITSLayer(1))
2609  fHisnClsITSSAspdOut->Fill(nclsTot);
2610  fHisnLayerITSsa->Fill(-1);
2611  for(Int_t l=0;l<6;l++) {
2612  if(TESTBIT(track->GetITSClusterMap(),l)) {
2613  fHisnLayerITSsa->Fill(l);
2614  }
2615  }
2616  }
2617  Int_t label=0;
2618  if(fReadMC){
2619  label=track->GetLabel();
2620  if (label<0) fHisNentries->Fill(13);
2621  else fHisNentries->Fill(14);
2622  }
2623 
2624 
2625  if (track->Pt()>0.3 &&
2626  track->GetStatus()&AliESDtrack::kTPCrefit &&
2627  track->GetStatus()&AliESDtrack::kITSrefit &&
2628  /*nclsTot>3 &&*/
2629  nclsSPD>0) {//count good tracks
2630 
2631 
2632  if(fReadMC && label<0) {
2633  fHisptFakeTr->Fill(track->Pt());
2634  isFakeTrack++;
2635  } else {
2636  fHisptGoodTr->Fill(track->Pt());
2637  isGoodTrack++;
2638  }
2639 
2640  if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts(),aod)){
2641  isSelTrack++;
2642  }//select tracks for our analyses
2643 
2644  }
2645  } //fill track histos
2646  } //end loop on tracks
2647 
2648  //fill once per event
2649  if(fOnOff[0]){
2650  if (fReadMC) fHisdistrFakeTr->Fill(isFakeTrack);
2651  fHisdistrGoodTr->Fill(isGoodTrack);
2652  fHisdistrSelTr->Fill(isSelTrack);
2653  }
2654 
2655  if(!isSimpleMode){
2656  // loop over candidates
2657  Int_t nCand = arrayProng->GetEntriesFast();
2658  Int_t ndaugh=3;
2661 
2662  for (Int_t iCand = 0; iCand < nCand; iCand++) {
2663  AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
2664  if(d->GetIsFilled()<1) continue;//0 = not refilled. or refill failed. 1 = standard dAODs. 2 = succesfully refilled
2665  if(fUseSelectionBit && d->GetSelectionMap()) {
2666  if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi && !d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) continue; //skip the D0 from Dstar
2668  }
2669  if(fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && !((dynamic_cast<AliAODRecoCascadeHF*>(d))->CheckCascadeFlags())) continue;
2670 
2671  if(fReadMC){
2672 
2673  Int_t labD = -1;
2674  if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2675 
2676  Int_t pdgDgLctoV0bachelor[2]={2212,310};
2677  Int_t pdgDgV0toDaughters[2]={211,211};
2678  Int_t mcLabelK0S = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->K0S+p and cc
2679  pdgDgLctoV0bachelor[1]=3122, pdgDgLctoV0bachelor[0]=211;
2680  pdgDgV0toDaughters[0]=2212, pdgDgV0toDaughters[1]=211;
2681  Int_t mcLabelLambda = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->Lambda+pi and cc
2682  if (mcLabelK0S!=-1 || mcLabelLambda!=-1) AliInfo(Form("mcLabelK0S=%d - mcLabelLambda=%d",mcLabelK0S,mcLabelLambda));
2683 
2684  if (mcLabelK0S!=-1 && mcLabelLambda!=-1)
2685  AliInfo("Strange: current Lc->V0+bachelor candidate has two MC different labels!");
2686  else if (mcLabelK0S>-1 && mcLabelLambda==-1)
2687  labD = mcLabelK0S;
2688  else if (mcLabelLambda>-1 && mcLabelK0S==-1)
2689  labD = mcLabelLambda;
2690  }
2691  else
2692  labD = d->MatchToMC(pdg,mcArray,ndaugh,pdgdaughters);
2693 
2694  if(labD>=0){
2695  AliAODMCParticle *partD = (AliAODMCParticle*)mcArray->At(labD);
2696  Int_t label=partD->GetMother();
2697  AliAODMCParticle *mot = (AliAODMCParticle*)mcArray->At(label);
2698  while(label>=0){//get first mother
2699  mot = (AliAODMCParticle*)mcArray->At(label);
2700  label=mot->GetMother();
2701  }
2702  if(mot){
2703  Int_t pdgMotCode = mot->GetPdgCode();
2704 
2705  if(TMath::Abs(pdgMotCode)==4) fHisNentries->Fill(11); //from primary charm
2706  if(TMath::Abs(pdgMotCode)==5) fHisNentries->Fill(12); //from beauty
2707  }
2708  // Primary vertex position for selected events with true generated (not necessarily reconstructed) D mesons
2709  const AliVVertex *vertex = aod->GetPrimaryVertex();
2710  const AliVVertex *vSPD = aod->GetPrimaryVertexSPD();
2711  fHisxvtxSelEvWithD->Fill( vertex->GetX() );
2712  fHisyvtxSelEvWithD->Fill( vertex->GetY() );
2713  fHiszvtxSelEvWithD->Fill( vertex->GetZ() );
2714  fHiszvtxvsSPDzvtxSelWithD->Fill(vSPD->GetZ(), vertex->GetZ());
2715  }
2716  }//end MC
2717  fHisNentries->Fill(10);//count the candidates (data and MC)
2718 
2719  for(Int_t id=0;id<ndaugh;id++){
2720  //other histograms to be filled when the cut object is given
2721  AliAODTrack* track=0;
2722 
2723  if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2724  if (id==0)
2725  track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->GetBachelor();
2726  else if (id==1)
2727  track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0PositiveTrack();
2728  else if (id==2)
2729  track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0NegativeTrack();
2730  }
2731  else
2732  track=(AliAODTrack*)d->GetDaughter(id);
2733 
2734 
2735  // filtering cut level
2736  Int_t isSelectedCand = fCuts->IsSelected(d, AliRDHFCuts::kAll, aod);
2737 
2738  if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && isSelectedCand) {
2739 
2740  Int_t label=0;
2741  if(fReadMC)label=track->GetLabel();
2742  if(fOnOff[0]){
2743 
2744  if(fReadMC && label<0) {
2745  isFakeTrack++;
2746  fHisptFakeTrFromDaughFilt->Fill(track->Pt());
2747 
2748  fHisd0f_filt->Fill(d->Getd0Prong(id));
2749  } else {
2750  fHisptGoodTrFromDaugh_filt->Fill(track->Pt());
2751  fHisd0dau_filt->Fill(d->Getd0Prong(id));
2752  Double_t phidaughter = d->PhiProng(id);
2753  if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
2754  fHisd0dauphi_filt->Fill(phidaughter, d->Getd0Prong(id));
2755  Double_t d0rphiz[2],covd0[3];
2756  Bool_t isDCA=track->PropagateToDCA(vtx1,magField,9999.,d0rphiz,covd0);
2757  if(isDCA){
2758  fHisd0zdau_filt->Fill(d0rphiz[1]);
2759  fHisd0zdauphi_filt->Fill(phidaughter,d0rphiz[1]);
2760  }
2761  }
2762  }
2763 
2764  // If the reconstructed candidate is within mPDG +/- 40 MeV/c2, then it is considered as a good candidate
2765  Bool_t isGoodCandidate = kFALSE;
2766  Double_t pdgMass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
2767 
2768  if (fDecayChannel==kD0toKpi) {
2769  if (isSelectedCand==1 || isSelectedCand==3) { // D0
2770  if (TMath::Abs((dynamic_cast<AliAODRecoDecayHF2Prong*>(d))->InvMassD0() - pdgMass) < 0.04) isGoodCandidate=kTRUE;
2771  }
2772  if (isSelectedCand==2 || isSelectedCand==3) { // D0bar
2773  if (TMath::Abs((dynamic_cast<AliAODRecoDecayHF2Prong*>(d))->InvMassD0bar() - pdgMass) < 0.04) isGoodCandidate=kTRUE;
2774  }
2775  } else if (fDecayChannel==kDplustoKpipi) {
2776  if (TMath::Abs((dynamic_cast<AliAODRecoDecayHF3Prong*>(d))->InvMassDplus() - pdgMass) < 0.04) isGoodCandidate=kTRUE;
2777  }
2778 
2779  if (isGoodCandidate) {
2780  const AliVVertex *vertex = aod->GetPrimaryVertex();
2781  const AliVVertex *vSPD = aod->GetPrimaryVertexSPD();
2782  fHisxvtxSelEvWithD->Fill( vertex->GetX() );
2783  fHisyvtxSelEvWithD->Fill( vertex->GetY() );
2784  fHiszvtxSelEvWithD->Fill( vertex->GetZ() );
2785  fHiszvtxvsSPDzvtxSelWithD->Fill(vSPD->GetZ(), vertex->GetZ());
2786  }
2787  }
2788 
2789 
2790 
2791  //track quality
2792 
2793  if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
2794 
2795  Int_t label=0;
2796  if(fReadMC)label=track->GetLabel();
2797  if(fOnOff[0]){
2798 
2799  if(fReadMC && label<0) {
2800  isFakeTrack++;
2801  fHisptFakeTrFromDaugh->Fill(track->Pt());
2802 
2803  fHisd0f->Fill(d->Getd0Prong(id));
2804  } else {
2805  fHisptGoodTrFromDaugh->Fill(track->Pt());
2806  fHisd0dau->Fill(d->Getd0Prong(id));
2807  Double_t phidaughter = d->PhiProng(id);
2808  if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
2809  fHisd0dauphi->Fill(phidaughter, d->Getd0Prong(id));
2810  Double_t d0rphiz[2],covd0[3];
2811  Bool_t isDCA=track->PropagateToDCA(vtx1,magField,9999.,d0rphiz,covd0);
2812  if(isDCA){
2813  fHisd0zdau->Fill(d0rphiz[1]);
2814  fHisd0zdauphi->Fill(phidaughter,d0rphiz[1]);
2815  }
2816  }
2817  }
2818 
2819 
2821  Int_t nITScls = 0;
2822  Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
2823  Double_t ratioCrossedRowsOverFcls = 1.0;
2824  if(track->GetTPCNclsF()>0){
2825  ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
2826  }
2827  for(Int_t l=0;l<6;l++) {
2828  if(TESTBIT(track->GetITSClusterMap(),l)) {
2829  nITScls++;
2830  }
2831  }
2832 
2833  fHisPtDaughters->Fill(track->Pt());
2834  fHisPhiDaughters->Fill(track->Phi());
2835  fHisEtaDaughters->Fill(track->Eta());
2836  fHisEtavsPhiDaughters->Fill(track->Phi(),track->Eta());
2837 
2838  fHisNTPCclsvsPtDaughters->Fill(track->Pt(),track->GetTPCNcls());
2839  fHisNTPCclsvsPhiDaughters->Fill(track->Phi(),track->GetTPCNcls());
2840  fHisNTPCclsvsEtaDaughters->Fill(track->Eta(),track->GetTPCNcls());
2841 
2842  fHisNTPCCrossedRowsvsPtDaughters->Fill(track->Pt(),nTPCCrossedRows);
2843  fHisNTPCCrossedRowsvsPhiDaughters->Fill(track->Phi(),nTPCCrossedRows);
2844  fHisNTPCCrossedRowsvsEtaDaughters->Fill(track->Eta(),nTPCCrossedRows);
2845 
2846  fHisRatioCRowsOverFclsvsPtDaughters->Fill(track->Pt(),ratioCrossedRowsOverFcls);
2847  fHisRatioCRowsOverFclsvsPhiDaughters->Fill(track->Phi(),ratioCrossedRowsOverFcls);
2848  fHisRatioCRowsOverFclsvsEtaDaughters->Fill(track->Eta(),ratioCrossedRowsOverFcls);
2849 
2850  fHisNITSclsvsPtDaughters->Fill(track->Pt(), nITScls);
2851  fHisNITSclsvsPhiDaughters->Fill(track->Phi(), nITScls);
2852  fHisNITSclsvsEtaDaughters->Fill(track->Eta(), nITScls);
2853  if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2854  fHisSPDclsDaughters->Fill(0);
2855  }
2856  if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2857  fHisSPDclsDaughters->Fill(1);
2858  }
2859  if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2860  fHisSPDclsDaughters->Fill(2);
2861  }
2862  if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2863  fHisSPDclsDaughters->Fill(3);
2864  }
2865 
2866 
2867  if(fOnOff[1]){
2868  AliAODPid *pid = track->GetDetPid();
2869  if(pid){
2870  if(pidHF && pidHF->CheckStatus(track,"TPC")){
2871  fHisTPCsigNvsPtDaughters->Fill(track->Pt(),pid->GetTPCsignalN());
2872  fHisTPCsigNvsPhiDaughters->Fill(track->Phi(),pid->GetTPCsignalN());
2873  fHisTPCsigNvsEtaDaughters->Fill(track->Eta(),pid->GetTPCsignalN());
2874  }
2875  }
2876  }
2877  }
2878 
2879 
2880  if (isSelectedCand && fOnOff[1]){
2881  fHisNentries->Fill(8); //candidates passing analysis cuts
2882 
2883  AliAODPid *pid = track->GetDetPid();
2884  if(pid){
2885  Double_t times[5];
2886  pid->GetIntegratedTimes(times);
2887  if(pidHF && pidHF->CheckStatus(track,"TOF")){
2888  Double_t tofTime=pid->GetTOFsignal();
2889  AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
2890  Double_t tofRes[AliPID::kSPECIES];
2891  pid->GetTOFpidResolution(tofRes);
2892  if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
2893  AliTOFPIDResponse tofResp=pidHF->GetPidResponse()->GetTOFResponse();
2894  Double_t startTime=tofResp.GetStartTime(track->P());
2895  tofTime-=startTime;
2896  }
2897  fHisTOFtimeKaonHyptimeAC->Fill(track->P(),tofTime-times[AliPID::kKaon]);
2898  }
2899  if(pidHF && pidHF->CheckStatus(track,"TPC")) fHisTPCsigvspAC->Fill(pid->GetTPCmomentum(),pid->GetTPCsignal());
2900  }
2901 
2902  } //end analysis cuts
2903  } //end acceptance and track cuts
2904  } //end loop on tracks in the candidate
2905  } //end loop on candidates
2906 
2907  }
2908  } //end if on pid or track histograms
2909  delete vHF;
2910  delete tpcres;
2911  delete [] pdgdaughters;
2912  PostData(1,fOutputEntries);
2913  if(fOnOff[1]) PostData(2,fOutputPID);
2914  if(fOnOff[0]) PostData(3,fOutputTrack);
2915  PostData(4,fCuts);
2916  if(fOnOff[2]) PostData(5,fOutputCounters);
2917  //Post data 6 done in case of centrality on
2918 }
2919 
2920 //____________________________________________________________________________
2923  Double_t cc;
2924  cc = fCuts->GetCentrality(aod);
2925  fHisFEvents->Fill(0., cc);
2926 
2927  UInt_t mask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
2928  UInt_t trigger=AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
2929  if(mask & trigger) {
2930  fHisFEvents->Fill(1.,cc); // fired
2931  if (mask & AliVEvent::kMB) fHisFEvents->Fill(2.,cc);
2932  if (mask & AliVEvent::kCentral) fHisFEvents->Fill(3.,cc);
2933  if (mask & AliVEvent::kSemiCentral) fHisFEvents->Fill(4.,cc);
2934  Bool_t rejected=false;
2935  if(cc<0 || cc>60) rejected=true;
2936  const AliVVertex *vertex = aod->GetPrimaryVertex();
2937  Double_t zvtx=vertex->GetZ();
2938  if(TMath::Abs(zvtx)>fCuts->GetMaxVtxZ()) rejected=true;
2939  if(rejected) return; //not interesting for flow QA
2940  } else {
2941  return;
2942  }
2943 
2944  // event accepted
2945  fHisFEvents->Fill(5.,cc);
2947  fRFPcuts->SetPtRange(0.2,5.);
2948  fRFPcuts->SetEtaRange(-0.8,0.8);
2953  fRFPcuts->SetEvent(aod);
2954 
2955  // "FB1" (i=0), "FB128" (i=1), "VZE" (i=2)
2956  Double_t psi[3];
2957  for(Int_t i=0; i!=3; ++i) {
2958  if(i==0) { // switching to bit 1
2961  } else { // switching to bit 128
2963  fRFPcuts->SetAODfilterBit(128);
2964  }
2965  if(i>1) {
2967  fRFPcuts->SetEtaRange(-5,+5);
2968  fRFPcuts->SetPhiMin(0);
2969  fRFPcuts->SetPhiMax(TMath::TwoPi());
2970  }
2972  fFlowEvent->TagSubeventsInEta(-5,0,0,+5);
2973  // getting informationt
2974  AliFlowVector vQ, vQaQb[2];
2975  fFlowEvent->Get2Qsub(vQaQb,2);
2976  vQ = vQaQb[0]+vQaQb[1];
2977  Double_t dMa=vQaQb[0].GetMult();
2978  Double_t dMb=vQaQb[1].GetMult();
2979  if( dMa<2 || dMb<2 ) {
2980  fHisFEvents->Fill(6.,cc); //???
2981  continue;
2982  }
2983  psi[i] = vQ.Phi()/2;
2984  // publishing
2985  fHisQ[i]->Fill(0,cc,vQaQb[0].X()/dMa,dMa); // Qx-
2986  fHisQ[i]->Fill(1,cc,vQaQb[0].Y()/dMa,dMa); // Qy-
2987  fHisQ[i]->Fill(2,cc,vQaQb[1].X()/dMb,dMb); // Qx+
2988  fHisQ[i]->Fill(3,cc,vQaQb[1].Y()/dMb,dMb); // Qy+
2989  fHisAngleQ[i]->Fill(psi[i],cc); // Psi
2990  AliFlowTrackSimple *track;
2991  for(Int_t t=0; t!=fFlowEvent->NumberOfTracks(); ++t) {
2992  track = (AliFlowTrackSimple*) fFlowEvent->GetTrack(t);
2993  if(!track) continue;
2994  if(!track->InRPSelection()) continue;
2995  fHisPhiEta[i]->Fill(track->Phi(),track->Eta(),cc,track->Weight()); //PhiEta
2996  }
2997 
2998  //histo filled only for TPCFB1
2999  if (i==0) {
3001  }
3002  }
3003  // TPC vs VZERO
3004  fHisTPCVZE_AngleQ->Fill(psi[0],psi[2],cc);
3005 }
3006 
3007 //____________________________________________________________________________
3010 
3011  fOutputEntries = dynamic_cast<TList*> (GetOutputData(1));
3012  if (!fOutputEntries && fOnOff[1]) {
3013  printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
3014  return;
3015  }
3016 
3017  fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
3018  if (!fOutputPID && fOnOff[1]) {
3019  printf("ERROR: %s not available\n",GetOutputSlot(2)->GetContainer()->GetName());
3020  return;
3021  }
3022 
3023  fOutputTrack = dynamic_cast<TList*> (GetOutputData(3));
3024  if (!fOutputTrack && fOnOff[0]) {
3025  printf("ERROR: %s not available\n",GetOutputSlot(3)->GetContainer()->GetName());
3026  return;
3027  }
3028 
3029 }
3030 
3031 
3032 
Bool_t fOnOff[5]
flag to use or not the selection bit
Float_t GetMaxCentrality() const
Definition: AliRDHFCuts.h:282
TH2F * fHisTPCsigNvsEtaAllTracks
! Histo. of output slot #2 (fOutputPID)
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:335
TH2F * fHiszvtxvsSPDzvtxSel
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisd0dau_filt
! Histo. of output slot #3 (fOutputTrack)
Int_t pdg
TH1F * fHisd0zdau
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:329
TH2F * fHisNTPCCrossedRowsvsPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisRatioCRowsOverFclsvsPtDaughters
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisRatioCRowsOverFclsvsEtaDaughters
! Histo. of output slot #3 (fOutputTrack)
const Color_t cc[]
Definition: DrawKs.C:1
TH2F * fHisnClsITSvsNtrackletsSel
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisRatioCRowsOverFclsvsEtaAllTracks
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:320
TH2F * fHisNentriesSelBit
! Histo. of output slot #1 (fOutputEntries)
TH1F * fHisNtracklets
! Histo. of output slot #3 (fOutputTrack)
double Double_t
Definition: External.C:58
void SetMaxChi2PerClusterTPC(Float_t a)
TH1F * fHisMultComb08
! Histo. of output slot #3 (fOutputTrack)
Definition: External.C:260
TH2F * fHisTPCsigmaMCPion
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisd0TracksSPDin
! Histo. of output slot #3 (fOutputTrack)
TList * fOutputCounters
! list sent on output slot 5
TH1F * fHisNtrackletsIn
! Histo. of output slot #6 (fOutputCheckCentrality)
Definition: External.C:236
TH2F * fHisRatioCRowsOverFclsvsPtAllTracks
! Histo. of output slot #3 (fOutputTrack)
Bool_t fUseSelectionBit
if true, don&#39;t do candidates (much faster in PbPb)
const char * title
Definition: MakeQAPdf.C:27
TH1F * fHisnClsITSSAspdOut
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisTOFstartTimeRes
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisntrklvsPercentile01AllEv
! Histo. of output slot #6 (fOutputCheckCentrality)
TH1F * fHisPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisMultComb05
! Histo. of output slot #3 (fOutputTrack)
virtual void UserCreateOutputObjects()
Implementation of interface methods.
TH2F * fHisnTPCITS1SPDTracksvsPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
Bool_t HasSelectionBit(Int_t i) const
TH2F * fHisTPCsigmaProton
! Histo. of output slot #2 (fOutputPID)
Int_t GetNumberOfRPs() const
TH2F * fHisNTPCclsvsPtDaughters
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTPCsigNvsPhiAllTracks
! Histo. of output slot #2 (fOutputPID)
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const
TH2F * fHisStdEstimSignalNtrackletsIn
! Histo. of output slot #6 (fOutputCheckCentrality)
TH1F * fHisPtAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisdistrFakeTr
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTPCsigNvsPhiDaughters
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisStdSignalSecondSignal
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisAngleQ[3]
! Histo. of output slot #8 (fOutputFlowObs)
centrality
static Int_t CheckMatchingAODdeltaAODevents()
Double_t GetMult() const
Definition: AliFlowVector.h:46
TH2F * fHisNTPCCrossedRowsvsPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisRatioCRowsOverFclsvsPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisptGoodTr
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisnClsITS
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:323
TList * fOutputEvSelection
! list sent on output slot 7
TH1F * fHisdistrGoodTr
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisNTPCclsvsEtaDaughters
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisnClsITSSAspdIn
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisd0TracksSPDany
! Histo. of output slot #3 (fOutputTrack)
AliFlowEvent * fFlowEvent
! to handle the reusage of the flowEvent object
TString GetMultSelectionObjectName() const
Definition: AliRDHFCuts.h:283
TH1F * fHiszvtxSelEvWithD
! Histo. of output slot #7 (fOutputEvSelection)
void SetPhiMin(Double_t min)
TH1F * fHisEtaAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHiszvtx
! Histo. of output slot #7 (fOutputEvSelection)
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TH1F * fHisNentries
! Histo. of output slot #1 (fOutputEntries)
TH2F * fHisTPCsigmaK
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisEtavsPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
void SetParamType(trackParameterType paramType)
ULong_t GetSelectionMap() const
TH1F * fHisyvtx
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisntrklvsPercentile01
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisnTPCITSTracksvsPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:257
TH1F * fHisMultFBit4
! Histo. of output slot #3 (fOutputTrack)
void SetAODfilterBit(UInt_t a)
TH2F * fHisCentVsMultRPS
! Histo. of output slot #8 (fOutputFlowObs)
TH1F * fHisyvtxSelEvWithD
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisEtaDaughters
! Histo. of output slot #3 (fOutputTrack)
Bool_t InRPSelection() const
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar, Bool_t recoSecVtx=kFALSE)
TH2F * fHisEtavsPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisd0zdau_filt
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTPCsigvsp
! Histo. of output slot #2 (fOutputPID)
Bool_t GetOldPid()
Definition: AliAODPidHF.h:157
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:247
AliFlowTrack * GetTrack(Int_t i)
TH1F * fHisNtracklets01
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisptFakeTr
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisStdEstimSignalPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
TH1F * fHisxvtxSelEv
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisNTPCCrossedRowsvsEtaDaughters
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTOFsigmaMCProtonSigPid
! Histo. of output slot #2 (fOutputPID)
Class for cuts on AOD reconstructed D+->Kpipi.
AliRDHFCuts::ECentrality fEstimator
void SetPtRange(Float_t r1, Float_t r2)
TH2F * fHisTrigCentSel
! Histo. of output slot #7 (fOutputEvSelection)
Double_t Phi() const
TH1F * fHisd0f_filt
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisNTPCCrossedRowsvsPtAllTracks
! Histo. of output slot #3 (fOutputTrack)
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH2F * fHisd0dauphi_filt
! Histo. of output slot #3 (fOutputTrack)
void Fill(AliFlowTrackCuts *rpCuts, AliFlowTrackCuts *poiCuts)
void SetMinimalTPCdedx(Double_t d=10.)
int Int_t
Definition: External.C:63
TH1F * fHisTOFtime
! Histo. of output slot #2 (fOutputPID)
unsigned int UInt_t
Definition: External.C:33
Int_t GetIsFilled() const
float Float_t
Definition: External.C:68
TProfile2D * fHisQ[3]
! Histo. of output slot #8 (fOutputFlowObs)
void GetTPCBetheBlochParams(Double_t alephParameters[5]) const
TH2F * fHisNITSclsvsEtaAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisStdPercentileOldFrwPercentileDev
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisTOFsigmaPionSigPid
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisptFakeTrFromDaugh
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisStdPercentileOldFrwPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisTrigCent
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisNITSclsvsPtDaughters
! Histo. of output slot #3 (fOutputTrack)
TList * fOutputPID
! list sent on output slot 2
Bool_t CheckStatus(AliAODTrack *track, TString detectors) const
TList * fOutputCheckCentrality
! list sent on output slot 6
TList * fOutputEntries
! list sent on output slot 1
TH2F * fHisNTPCCrossedRowsvsPtDaughters
! Histo. of output slot #3 (fOutputTrack)
virtual void UserExec(Option_t *option)
TH1F * fHisPtDaughters
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisTOFsigPid3sigKaon
! Histo. of output slot #2 (fOutputPID)
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:262
TH1F * fHisxvtx
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisnClsSPD
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisdistrSelTr
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisNITSclsvsPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisTOFsigPid3sigPion
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisMult
! Histo. of output slot #3 (fOutputTrack)
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:258
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:332
TH2F * fHisTPCsigmaMCProton
! Histo. of output slot #2 (fOutputPID)
TH1F * fHiszvtxSelEv
! Histo. of output slot #7 (fOutputEvSelection)
Double_t nsigma
unsigned long ULong_t
Definition: External.C:38
TH2F * fHisTOFsigmaMCKSigPid
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisTOFsig
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisTrigMulSel
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisTPCsigmaMCK
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisNTPCclsvsEtaAllTracks
! Histo. of output slot #3 (fOutputTrack)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
TH1F * fHisnLayerITSselTr
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisd0dauphi
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisWhichVert
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisTOFstartTimeMask
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisFEvents
! Histo. of output slot #8 (fOutputFlowObs)
TH1F * fHisnClsITSSA
! Histo. of output slot #3 (fOutputTrack)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH2F * fHisd0zdauphi_filt
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:350
TH2F * fHisNTPCclsvsPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
TList * fOutputFlowObs
! list sent on output slot 8
TH2F * fHisTrigMul
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisTOFsigPid3sigProton
! Histo. of output slot #2 (fOutputPID)
Bool_t fSimpleMode
flag to read MC
TH2F * fHisNITSclsvsPtAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisnLayerITS
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHiszvtxvsSPDzvtx
! Histo. of output slot #7 (fOutputEvSelection)
Bool_t IsEventRejectedDueToMismatchOldNewCentrality() const
Definition: AliRDHFCuts.h:347
TH2F * fHisntrklvsPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHiszvtxvsSPDzvtxSelWithD
! Histo. of output slot #7 (fOutputEvSelection)
void SetAcceptKinkDaughters(Bool_t a)
TH1F * fHisTOFstartTimeDistrib
! Histo. of output slot #2 (fOutputPID)
AliFlowTrackCuts * fRFPcuts
! reference flow particle cuts
TH2F * fHisStdPercentileSecondPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
Bool_t IsEventSelected(AliVEvent *event)
void SetEvent(AliVEvent *event, AliMCEvent *mcEvent=NULL)
TH2F * fHisNITSclsvsPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisNTPCclsvsPhiAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTOFtimeKaonHyptimeAC
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisptGoodTrFromDaugh
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisd0TracksTPCITSSPDany
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisWhyEvRejected
! Histo. of output slot #7 (fOutputEvSelection)
TH2F * fHisTOFsigmaKSigPid
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisyvtxSelEv
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisMultIn
! Histo. of output slot #6 (fOutputCheckCentrality)
TH1F * fHisptGoodTrFromDaugh_filt
! Histo. of output slot #3 (fOutputTrack)
void SetMinNClustersTPC(Int_t a)
TList * fOutputTrack
! list sent on output slot 3
const Double_t etamax
Double_t Weight() const
TH3F * fHisPhiEta[3]
! Histo. of output slot #8 (fOutputFlowObs)
Bool_t IsSelected(TObject *obj)
Definition: AliRDHFCuts.h:292
TH1F * fHisTOFflags
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisnClsITSSAspdAny
! Histo. of output slot #3 (fOutputTrack)
void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB)
void SetPhiMax(Double_t max)
unsigned short UShort_t
Definition: External.C:28
TH1F * fHisnLayerITSsa
! Histo. of output slot #3 (fOutputTrack)
TH3F * fHisTPCVZE_AngleQ
! Histo. of output slot #8 (fOutputFlowObs)
void SetMinChi2PerClusterTPC(Float_t a)
const char Option_t
Definition: External.C:48
TH2F * fHisTOFsigmaProtonSigPid
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisMultOut
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisnTPCTracksvsPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
TH1F * fHisStdEstimSignal
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisRatioCRowsOverFclsvsPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:317
TH2F * fHisNTPCclsvsPtAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisd0zdauphi
! Histo. of output slot #3 (fOutputTrack)
Double_t Eta() const
virtual void Get2Qsub(AliFlowVector *Qarray, Int_t n=2, TList *weightsList=0x0, Bool_t usePhiWeights=0x0, Bool_t usePtWeights=0x0, Bool_t useEtaWeights=0x0)
bool Bool_t
Definition: External.C:53
TH2F * fHisMultvsPercentile
! Histo. of output slot #6 (fOutputCheckCentrality)
virtual void Terminate(Option_t *option)
TH1F * fHisTPCsig
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisd0dau
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisSPDclsDaughters
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTOFtimeKaonHyptime
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisTPCsigmaPion
! Histo. of output slot #2 (fOutputPID)
void FillFlowObs(AliAODEvent *aod)
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Definition: AliRDHFCuts.h:312
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:280
TH1F * fHisNtrackletsOut
! Histo. of output slot #6 (fOutputCheckCentrality)
TH2F * fHisTPCsigNvsPtDaughters
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisTPCsigvspAC
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisd0TracksFilterBit4
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisWhichVertSelEv
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisPhiDaughters
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisNtracklets01AllEv
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisnClsITSselTr
! Histo. of output slot #3 (fOutputTrack)
TH1F * fHisptFakeTrFromDaughFilt
! Histo. of output slot #3 (fOutputTrack)
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts, const AliAODEvent *aod=0x0) const
TH2F * fHisNTPCCrossedRowsvsEtaAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisTPCsigNvsPtAllTracks
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisTOFsigmaMCPionSigPid
! Histo. of output slot #2 (fOutputPID)
TH2F * fHisTPCsigNvsEtaDaughters
! Histo. of output slot #2 (fOutputPID)
TH1F * fHisxvtxSelEvWithD
! Histo. of output slot #7 (fOutputEvSelection)
TH1F * fHisd0f
! Histo. of output slot #3 (fOutputTrack)
Bool_t fFillDistrTrackEffChecks
on-off the QA on tracks (0), PID (1), centrality (2), event selection – default is {kTRUE...
TH1F * fHisSPDclsAllTracks
! Histo. of output slot #3 (fOutputTrack)
TH2F * fHisNITSclsvsEtaDaughters
! Histo. of output slot #3 (fOutputTrack)
void SetEtaRange(Float_t r1, Float_t r2)
Int_t NumberOfTracks() const