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