Coding rules (Markus)
[u/mrichter/AliRoot.git] / PWG3 / 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 TParticle;
36 class TString;
37 class AliStack;
38 class AliAODMCParticle;
39
40 //________________________________________________________________
41 class AliHFEmcQA: public TObject {
42
43         public: 
44                 enum heavyType {kCharm=4, kBeauty=5, kElectronPDG=11};
45                 enum qType {kQuark, kantiQuark, kHadron, keHadron, kDeHadron, kElectron, kElectron2nd};
46                 enum SourceType {kDirectCharm=1, kDirectBeauty=2, kBeautyCharm=3, kGamma=4, kPi0=5, kElse=6};
47                 enum ProcessType
48                         {
49                         kPairCreationFromq,  kPairCreationFromg,  kFlavourExitation,  kGluonSplitting, kInitialPartonShower, kLightQuarkShower
50                         };
51
52                 AliHFEmcQA();
53                 AliHFEmcQA(const AliHFEmcQA &p); // copy constructor
54                 AliHFEmcQA &operator=(const AliHFEmcQA &); // assignment operator
55
56                 virtual ~AliHFEmcQA();
57
58                 void PostAnalyze() const;
59                 void CreateHistograms(const Int_t kquark, Int_t icut, TString hnopt=""); // create histograms for mc qa analysis
60                 void SetStack(AliStack* const stack){fStack=stack;} // set stack pointer
61                 void SetMCArray(TClonesArray* const mcarry){fMCArray=mcarry;} // set mcarray pointer
62                 void Init();
63
64                 void GetQuarkKine(TParticle *part, Int_t iTrack, const Int_t kquark); // get heavy quark kinematics distribution
65                 void GetHadronKine(TParticle *part, const Int_t kquark); // get heavy hadron kinematics distribution
66                 void GetDecayedKine(TParticle *part, const Int_t kquark, const Int_t kdecayed, Int_t icut); // get decay electron kinematics distribution
67                 void GetDecayedKine(AliAODMCParticle *mcpart, const Int_t kquark, Int_t kdecayed, Int_t icut); // get decay electron kinematics for AOD 
68                 void EndOfEventAna(const Int_t kquark); // run analysis which should be done at the end of the event loop
69                 Int_t GetElectronSource(TParticle* mcpart); // return electron source id 
70                 Int_t GetElectronSource(AliAODMCParticle *mcpart); // return electron source id for AOD
71
72         protected:
73                 void IdentifyMother(Int_t motherlabel, Int_t &motherpdg, Int_t &grandmotherlabel); // 
74                 void HardScattering(const Int_t kquark, Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // check if the quark is produced from hard scattering
75                 void ReportStrangeness(Int_t &motherID, Int_t &mothertype, Int_t &motherlabel); // report if the quark production process is unknown
76                 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 
77                 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
78                 Float_t GetRapidity(TParticle *part) const; // return rapidity
79                 Float_t GetRapidity(AliAODMCParticle *part) const; // return rapidity
80
81                 AliStack* fStack; // stack pointer           
82                 TClonesArray *fMCArray; // mc array pointer
83
84                 static const Int_t fgkGluon; // gluon pdg code
85                 static const Int_t fgkMaxGener; // ancester level wanted to be checked 
86                 static const Int_t fgkMaxIter; // number of iteration to find out matching particle 
87                 static const Int_t fgkqType; // number of particle type to be checked
88
89                 struct AliHists{
90                         TH1F *fPdgCode; // histogram to store particle pdg code
91                         TH1F *fPt; // histogram to store pt
92                         TH1F *fY; // histogram to store rapidity
93                         TH1F *fEta; // histogram to store eta
94
95                         AliHists()
96                           : fPdgCode()
97                           , fPt()
98                           , fY()
99                           , fEta()
100                         {
101                           // default constructor
102                         };
103                         AliHists(const AliHists & p)
104                           : fPdgCode(p.fPdgCode)
105                           , fPt(p.fPt)
106                           , fY(p.fY)
107                           , fEta(p.fEta)
108                         {
109                           // copy constructor
110                         };
111                         AliHists &operator=(const AliHists &)
112                         {
113                           // assignment operator, not yet implemented 
114                           return *this;
115                         }
116                 };
117                 struct AliHistsComm {
118                         TH1F *fNq; // histogram to store number of quark
119                         TH1F *fProcessID; // histogram to store process id 
120                         TH2F *fePtRatio; // fraction of electron pT from D or B hadron
121                         TH2F *fDePtRatio; // fraction of D electron pT from B hadron 
122                         TH2F *feDistance; // distance between electron production point to mother particle 
123                         TH2F *fDeDistance; // distance between D electron production point to mother particle
124
125                         AliHistsComm()
126                           : fNq()
127                           , fProcessID()
128                           , fePtRatio()
129                           , fDePtRatio()
130                           , feDistance()
131                           , fDeDistance()
132                         {
133                           // default constructor
134                         };
135                         AliHistsComm(const AliHistsComm & p)
136                           : fNq(p.fNq)
137                           , fProcessID(p.fProcessID)
138                           , fePtRatio(p.fePtRatio)
139                           , fDePtRatio(p.fDePtRatio)
140                           , feDistance(p.feDistance)
141                           , fDeDistance(p.fDeDistance)
142                         {
143                           // copy constructor
144                         };
145                         AliHistsComm &operator=(const AliHistsComm &)
146                         {
147                           // assignment operator, not yet implemented 
148                           return *this;
149                         }
150                 };
151
152                 AliHists fHist[2][7][5]; // struct of histograms to store kinematics of given particles
153                 AliHistsComm fHistComm[2][5]; // struct of additional histograms of given particles
154
155                 TParticle *fHeavyQuark[50]; // store pointer of heavy flavour quark 
156                 Int_t fIsHeavy[2]; // count of heavy flavour
157                 Int_t fNparents; // number of heavy hadrons to be considered
158                 Int_t fParentSelect[2][7]; // heavy hadron species
159
160
161         ClassDef(AliHFEmcQA,1);
162 };
163
164 #endif