o updates for PbPb analysis of B->J/psi (Fiorella)
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliAnalysisTaskDielectronReadAODBranch.h
1 #ifndef ALIANALYSISTASKDIELECTRONREADAODBRANCH_H
2 #define ALIANALYSISTASKDIELECTRONREADAODBRANCH_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////////////////////////////////////////////////////////////////////////////
8 //  Class to retrieve the branch of the dielectron candidates stored in   //
9 //  filtered AOD files (AliAOD.Dielectron.root). It is possible to        //
10 //  apply tighter cuts to candidates stored in the branch and do the      //
11 //  matching with MC truth                                                //
12 //                                                                        //
13 //  Contacts : G. Bruno / Giuseppe.Bruno@ba.infn.it,                      //
14 //             F. Fionda / Fiorella.Fionda@ba.infn.it,                    //
15 //             C. Di Giglio / Carmelo.Digiglio@ba.infn.it                 // 
16 ////////////////////////////////////////////////////////////////////////////
17
18 #include "AliAnalysisTaskSE.h"
19
20 class TNtuple;
21 class TH1F;
22 class TH2F;
23 class AliDielectronPair;
24
25 class AliAnalysisTaskDielectronReadAODBranch : public AliAnalysisTaskSE
26 {
27         public:
28                 AliAnalysisTaskDielectronReadAODBranch();
29                 AliAnalysisTaskDielectronReadAODBranch(const char *name);
30                 virtual ~AliAnalysisTaskDielectronReadAODBranch();
31
32                 // Implementation of interface methods
33                 virtual void UserCreateOutputObjects();
34                 virtual void Init();
35                 virtual void LocalInit() {Init();}
36                 virtual void UserExec(Option_t *option);
37                 virtual void Terminate(Option_t *option);
38               
39                 //setters
40                 void SetPtLeg(Double_t cutPt){ fPtCut = cutPt;} 
41                 void SetSpdFirstRequired(Bool_t spdfirst){fSpdFirstRequired = spdfirst;}
42                 void SetNclsTPC(Int_t nCls){fClsTPC = nCls;}
43                 void SetPairType(Int_t type){fPairType = type;}
44                 void SetPtJpsi(Double_t ptjpsi) {fPtJpsi = ptjpsi;}
45                 void SetInvMassSignalRegion(Double_t lowLimit, Double_t upLimit){fInvMassSignalLimits[0]=lowLimit; fInvMassSignalLimits[1]=upLimit;}
46                 void SetInvMassSidebandRegion(Double_t lowLimit, Double_t upLimit){fInvMassSideBandsLimits[0]=lowLimit; fInvMassSideBandsLimits[1]=upLimit;}
47                 void SetHasMC(Bool_t mcFlag) {fHasMC = mcFlag;}
48
49
50      enum {
51     kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
52       kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
53       kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
54       kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
55       kHMPIDout=0x10000,kHMPIDpid=0x20000
56   };
57
58         private:
59                 AliAnalysisTaskDielectronReadAODBranch(const AliAnalysisTaskDielectronReadAODBranch &c);
60                 AliAnalysisTaskDielectronReadAODBranch& operator= (const AliAnalysisTaskDielectronReadAODBranch &c);
61
62                 TList      *fOutput;                 // output list with histo
63                 TNtuple    *fNtupleJPSI;             // ntupla to store invariant mass and psproper of candidates
64                 TH1F       *fNentries;               // number of filtered events
65                 TH1F       *fInvMass;                // invariant mass of candidates in branch after tighter cuts application
66                 TH1F       *fInvMassNoCuts;          // invariant mass of candidates in branch without cuts
67                 TH1F       *fpsproperSignal;         // psproper distribution in the mass signal region           
68                 TH1F       *fpsproperSidebands;      // psproper distribution in the mass sidebands region           
69                 TH1F       *fpsproperAll;            // whole psproper distribution          
70                 TH1F       *fpsproperUnder;          // psproper distribution in the lower mass sidebands region 
71                 TH1F       *fpsproperUpper;          // psproper distribution in the upper mass sidebands region
72                 TH2F       *fLxyVsPtleg1;            // psproper vs pt for leg1
73                 TH2F       *fLxyVsPtleg2;            // psproper vs pt for leg2          
74                 TH2F       *fLxyVsPt;                // psproper vs pt jpsi 
75                 TH2F       *fMeeVsPt;                // invariant mass vs pt jpsi
76                 TH2F       *fMeeVsLxy;               // invariant mass vs psproper
77
78                 // QA plots
79                 TH1F       *fprimvtxZ;               // z coord of primary vertex        
80                 TH1F       *fsecvtxZ;                // z coord of secondary vertex        
81                 TH1F       *fprimvtxX;               // x coord of primary vertex          
82                 TH1F       *fsecvtxX;                // x coord of secondary vertex           
83                 TH1F       *fprimvtxY;               // y coord of primary vertex          
84                 TH1F       *fsecvtxY;                // y coord of secondary vertex          
85                 TH1F       *fPt;                     // pT(J/psi) distribution               
86                 TH1F       *fPtLeg1;                 // pT(leg1)  distribution. Warning: mixture of pos and neg tracks               
87                 TH1F       *fPtLeg2;                 // pT(leg2)  distribution. Warning: mixture of pos and neg tracks               
88                 TH2F       *fdEdxP;                  // dEdx vs P for legs
89                 Bool_t     fHasMC;                   // flag for read MC branch
90                 TObjArray  *fobj;                    // TObjArray with stored reconstructed candidates
91                 TObjArray  *fobjMC;                  // TObjArray with MC tracks
92  
93                 // cuts on candidates
94                 Double_t  fPtCut;                    // ptLeg 
95                 Bool_t    fSpdFirstRequired;         // spd any/first 
96                 Int_t     fClsTPC;                   // #clsTPC
97                 Int_t     fPairType;                 // pair Type
98                 Double_t  fPtJpsi;                   // pt jpsi
99                 Double_t  *fInvMassSignalLimits;     // invariant mass signal region to extract psproper distribution
100                 Double_t  *fInvMassSideBandsLimits;  // invariant mass sideband region to extract psproper distribution 
101
102                 Int_t     fSecondary;                // 1(0) to select secondary (prompt) jpsi
103                 ClassDef(AliAnalysisTaskDielectronReadAODBranch,2); // AliAnalysisTaskSE for the MC association of heavy-flavour decay candidates
104 };
105
106
107 #endif