]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEmcQA.h
Updates to run with deltas (L. Cunqueiro)
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEmcQA.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 // QA class of Heavy Flavor quark and fragmeted/decayed particles
17 // -Check kinematics of Heavy Quarks/hadrons, and decayed leptons
18 //    pT, rapidity
19 //    decay lepton kinematics w/wo acceptance
20 //    heavy hadron decay length, electron pT fraction carried from decay 
21 // -Check yield of Heavy Quarks/hadrons
22 //    Number of produced heavy quark
23 //    Number of produced hadron of given pdg code
24 //
25
26 #ifndef ALIHFEMCQA_H
27 #define ALIHFEMCQA_H
28
29 #ifndef ROOT_TObject
30 //#include <TObject.h>
31 #endif
32
33 class TH1F;
34 class TH2F;
35 class TList;
36 class TParticle;
37 class TString;
38 class AliMCEvent;
39 class AliGenEventHeader;
40 class AliMCParticle;
41 class AliAODMCParticle;
42 class AliHFEcollection;
43
44 //________________________________________________________________
45 class AliHFEmcQA: public TObject {
46
47   public: 
48     enum heavyType {kCharm=4, kBeauty=5, kOthers=6, kElectronPDG=11};
49     enum qType {kQuark, kantiQuark, kHadron, keHadron, kDeHadron, kElectron, kElectron2nd};
50     enum SourceType {kDirectCharm=1, kDirectBeauty=2, kBeautyCharm=3, kGamma=4, kPi0=5, kElse=6, kMisID=7, kEta=8, kOmega=9, kPhi=10, kEtaPrime=11, kRho0=12, kGammaPi0=13, kGammaEta=14, kGammaOmega=15, kGammaPhi=16, kGammaEtaPrime=17, kGammaRho0=18};
51     enum ProcessType {
52       kPairCreationFromq,  kPairCreationFromg,  kFlavourExitation,  kGluonSplitting, kInitialPartonShower, kLightQuarkShower
53     };
54     enum{
55       kBgPtBins = 44,
56         kElecBgSpecies = 6,
57         kCentBins = 11,
58         kBgLevels = 3
59     };
60
61
62     AliHFEmcQA();
63     AliHFEmcQA(const AliHFEmcQA &p); // copy constructor
64     AliHFEmcQA &operator=(const AliHFEmcQA &); // assignment operator
65
66     virtual ~AliHFEmcQA();
67
68     TList *GetList() const { return fQAhistos; };
69     void PostAnalyze() const;
70     void CreatDefaultHistograms(TList * const qaList); // create default histograms  
71     void CreateHistograms(const Int_t kquark, Int_t icut, TString hnopt=""); // create histograms for mc qa analysis
72     void SetMCEvent(AliMCEvent* const mcEvent){fMCEvent = mcEvent;} 
73     void SetGenEventHeader(AliGenEventHeader* const mcHeader){fMCHeader=mcHeader;} // set stack pointer
74     void SetMCArray(TClonesArray* const mcarry){fMCArray=mcarry;} // set mcarray pointer
75     void Init();
76
77     void GetQuarkKine(TParticle *part, Int_t iTrack, const Int_t kquark); // get heavy quark kinematics distribution
78     void GetHadronKine(TParticle *part, const Int_t kquark); // get heavy hadron kinematics distribution
79     void GetDecayedKine(TParticle *part, const Int_t kquark, const Int_t kdecayed, Int_t icut); // get decay electron kinematics distribution
80     void GetDecayedKine(AliAODMCParticle *mcpart, const Int_t kquark, Int_t kdecayed, Int_t icut); // get decay electron kinematics for AOD 
81     void GetMesonKine(); // get meson and its decay electron pt spectra
82     void EndOfEventAna(const Int_t kquark); // run analysis which should be done at the end of the event loop
83     Int_t GetSource(const TParticle * const mcpart); // return source id 
84     Int_t GetElecSource(TParticle * const mcpart); // return electron source id 
85     Int_t GetSource(const AliAODMCParticle * const mcpart); // return electron source id for AOD
86     Double_t GetWeightFactor(AliMCParticle *mctrack, const Int_t iBgLevel); // return best/lower/upper weighting factor for electron's mother meson
87
88     void SetBackgroundWeightFactor(Double_t *elecBackgroundFactor, Double_t *binLimit);
89
90     void SetCentrality(Int_t centrality) { fCentrality = centrality; };
91     void SetPbPb() { fIsPbPb = kTRUE; };
92     void SetPP() { fIsPbPb = kFALSE; };
93     void SetPPMultiBin() { fIsppMultiBin = kFALSE; };
94     Bool_t IsPbPb() const { return fIsPbPb; };
95     Bool_t IsPP() const { return !fIsPbPb; };
96     Bool_t IsPPMultiBin() const { return fIsppMultiBin; };
97
98   protected:
99     void IdentifyMother(Int_t motherlabel, Int_t &motherpdg, Int_t &grandmotherlabel); // 
100     void HardScattering(const Int_t kquark, Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // check if the quark is produced from hard scattering
101     void ReportStrangeness(Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // report if the quark production process is unknown
102     Bool_t IsFromInitialShower(Int_t inputmotherlabel, Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // check if the quark is produced from initial parton shower 
103     Bool_t IsFromFinalParton(Int_t inputmotherlabel, Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // check if the quark is produced from final parton shower
104
105     AliMCEvent* fMCEvent; // mcevent pointer
106     AliGenEventHeader* fMCHeader; // mcheader pointer
107     TClonesArray *fMCArray; // mc array pointer
108
109     static const Int_t fgkGluon=21; // gluon pdg code
110     static const Int_t fgkMaxGener=10; // ancester level wanted to be checked 
111     static const Int_t fgkMaxIter=100; // number of iteration to find out matching particle 
112     static const Int_t fgkqType=7; // number of particle type to be checked
113
114     struct AliHists{
115       TH1F *fPdgCode; // histogram to store particle pdg code
116       TH1F *fPt; // histogram to store pt
117       TH1F *fY; // histogram to store rapidity
118       TH1F *fEta; // histogram to store eta
119
120                         AliHists()
121                           : fPdgCode()
122                           , fPt()
123                           , fY()
124                           , fEta()
125       {
126                           // default constructor
127                         };
128                         AliHists(const AliHists & p)
129                           : fPdgCode(p.fPdgCode)
130                           , fPt(p.fPt)
131                           , fY(p.fY)
132                           , fEta(p.fEta)
133       {
134                           // copy constructor
135                         };
136                         AliHists &operator=(const AliHists &)
137                         {
138                           // assignment operator, not yet implemented 
139                           return *this;
140                         }
141       void FillList(TList *l) const;
142     };
143     struct AliHistsComm {
144       TH1F *fNq; // histogram to store number of quark
145       TH1F *fProcessID; // histogram to store process id 
146       TH2F *fePtRatio; // fraction of electron pT from D or B hadron
147       TH2F *fPtCorr; // pt correlation between e and direct D or B 
148       TH2F *fPtCorrDp; // pt correlation between e and direct D+
149       TH2F *fPtCorrD0; // pt correlation between e and direct D0
150       TH2F *fPtCorrDrest; // pt correlation between e and direct D rest
151       TH2F *fDePtRatio; // fraction of D electron pT from B hadron 
152       TH2F *feDistance; // distance between electron production point to mother particle 
153       TH2F *fDeDistance; // distance between D electron production point to mother particle
154
155                         AliHistsComm()
156                           : fNq()
157                           , fProcessID()
158                           , fePtRatio()
159                           , fPtCorr()
160                           , fPtCorrDp()
161                           , fPtCorrD0()
162                           , fPtCorrDrest()
163                           , fDePtRatio()
164                           , feDistance()
165                           , fDeDistance()
166       {  
167                           // default constructor
168                         };
169                         AliHistsComm(const AliHistsComm & p)
170                           : fNq(p.fNq)
171                           , fProcessID(p.fProcessID)
172                           , fePtRatio(p.fePtRatio)
173                           , fPtCorr(p.fPtCorr)
174                           , fPtCorrDp(p.fPtCorrDp)
175                           , fPtCorrD0(p.fPtCorrD0)
176                           , fPtCorrDrest(p.fPtCorrDrest)
177                           , fDePtRatio(p.fDePtRatio)
178                           , feDistance(p.feDistance)
179                           , fDeDistance(p.fDeDistance)
180       {
181                           // copy constructor
182                         };
183                         AliHistsComm &operator=(const AliHistsComm &)
184                         {
185                           // assignment operator, not yet implemented 
186                           return *this;
187                         }
188       void FillList(TList *l) const;
189     };
190
191     AliHists fHist[3][7][6]; // struct of histograms to store kinematics of given particles
192     AliHistsComm fHistComm[2][6]; // struct of additional histograms of given particles
193     TH2F *fhD[9]; // D meson pt,Y spectra
194     TH1F *fhDLogbin[9]; // D meson pt w diff binning
195
196     TList *fQAhistos;           // Container for QA histos
197     AliHFEcollection *fMCQACollection;      //! Tasks own QA collection
198     TParticle *fHeavyQuark[50]; //! store pointer of heavy flavour quark 
199     Int_t fIsHeavy[2]; // count of heavy flavour
200     Int_t fNparents; // number of heavy hadrons to be considered
201     Int_t fParentSelect[2][7]; // heavy hadron species
202
203     Double_t fElecBackgroundFactor[kBgLevels][kCentBins][kElecBgSpecies][kBgPtBins];     // Electron background factors
204     Double_t fBinLimit[kBgPtBins+1];      // Electron background bins
205
206 private:
207     Int_t              fCentrality;  // Centrality
208     Bool_t             fIsPbPb;        // Analysis Type: pp or PbPb
209     Bool_t             fIsppMultiBin;  // pp multiplicity bin analysis
210
211   ClassDef(AliHFEmcQA,1);
212 };
213
214 #endif