]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/hfe/AliHFEmcQA.h
Update of the hfe package
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEmcQA.h
index 118ecc1906c5a94cf31ab89bb40744824a885e87..23bcd5145bbaf1d653b229cb934b401656e9551c 100644 (file)
@@ -35,20 +35,29 @@ class TH2F;
 class TList;
 class TParticle;
 class TString;
-class AliStack;
+class AliMCEvent;
 class AliGenEventHeader;
+class AliMCParticle;
 class AliAODMCParticle;
+class AliHFEcollection;
 
 //________________________________________________________________
 class AliHFEmcQA: public TObject {
 
   public: 
-    enum heavyType {kCharm=4, kBeauty=5, kElectronPDG=11};
+    enum heavyType {kCharm=4, kBeauty=5, kOthers=6, kElectronPDG=11};
     enum qType {kQuark, kantiQuark, kHadron, keHadron, kDeHadron, kElectron, kElectron2nd};
-    enum SourceType {kDirectCharm=1, kDirectBeauty=2, kBeautyCharm=3, kGamma=4, kPi0=5, kElse=6};
+    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};
     enum ProcessType {
       kPairCreationFromq,  kPairCreationFromg,  kFlavourExitation,  kGluonSplitting, kInitialPartonShower, kLightQuarkShower
     };
+    enum{
+      kBgPtBins = 44,
+       kElecBgSpecies = 6,
+       kCentBins = 11,
+       kBgLevels = 3
+    };
+
 
     AliHFEmcQA();
     AliHFEmcQA(const AliHFEmcQA &p); // copy constructor
@@ -56,11 +65,11 @@ class AliHFEmcQA: public TObject {
 
     virtual ~AliHFEmcQA();
 
-    void MakeHistograms();
     TList *GetList() const { return fQAhistos; };
     void PostAnalyze() const;
+    void CreatDefaultHistograms(TList * const qaList); // create default histograms  
     void CreateHistograms(const Int_t kquark, Int_t icut, TString hnopt=""); // create histograms for mc qa analysis
-    void SetStack(AliStack* const stack){fStack=stack;} // set stack pointer
+    void SetMCEvent(AliMCEvent* const mcEvent){fMCEvent = mcEvent;} 
     void SetGenEventHeader(AliGenEventHeader* const mcHeader){fMCHeader=mcHeader;} // set stack pointer
     void SetMCArray(TClonesArray* const mcarry){fMCArray=mcarry;} // set mcarray pointer
     void Init();
@@ -68,10 +77,23 @@ class AliHFEmcQA: public TObject {
     void GetQuarkKine(TParticle *part, Int_t iTrack, const Int_t kquark); // get heavy quark kinematics distribution
     void GetHadronKine(TParticle *part, const Int_t kquark); // get heavy hadron kinematics distribution
     void GetDecayedKine(TParticle *part, const Int_t kquark, const Int_t kdecayed, Int_t icut); // get decay electron kinematics distribution
-               void GetDecayedKine(AliAODMCParticle *mcpart, const Int_t kquark, Int_t kdecayed, Int_t icut); // get decay electron kinematics for AOD 
+    void GetDecayedKine(AliAODMCParticle *mcpart, const Int_t kquark, Int_t kdecayed, Int_t icut); // get decay electron kinematics for AOD 
+    void GetMesonKine(); // get meson and its decay electron pt spectra
     void EndOfEventAna(const Int_t kquark); // run analysis which should be done at the end of the event loop
-               Int_t GetSource(TParticle * const mcpart); // return electron source id 
-               Int_t GetSource(AliAODMCParticle * const mcpart); // return electron source id for AOD
+    Int_t GetSource(const TParticle * const mcpart); // return source id 
+    Int_t GetElecSource(TParticle * const mcpart); // return electron source id 
+    Int_t GetSource(const AliAODMCParticle * const mcpart); // return electron source id for AOD
+    Double_t GetWeightFactor(AliMCParticle *mctrack, const Int_t iBgLevel); // return best/lower/upper weighting factor for electron's mother meson
+
+    void SetBackgroundWeightFactor(Double_t *elecBackgroundFactor, Double_t *binLimit);
+
+    void SetCentrality(Int_t centrality) { fCentrality = centrality; };
+    void SetPbPb() { fIsPbPb = kTRUE; };
+    void SetPP() { fIsPbPb = kFALSE; };
+    void SetPPMultiBin() { fIsppMultiBin = kFALSE; };
+    Bool_t IsPbPb() const { return fIsPbPb; };
+    Bool_t IsPP() const { return !fIsPbPb; };
+    Bool_t IsPPMultiBin() const { return fIsppMultiBin; };
 
   protected:
     void IdentifyMother(Int_t motherlabel, Int_t &motherpdg, Int_t &grandmotherlabel); // 
@@ -80,14 +102,14 @@ class AliHFEmcQA: public TObject {
     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 
     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
 
-    AliStack* fStack; // stack pointer           
+    AliMCEvent* fMCEvent; // mcevent pointer
     AliGenEventHeader* fMCHeader; // mcheader pointer
     TClonesArray *fMCArray; // mc array pointer
 
-    static const Int_t fgkGluon; // gluon pdg code
-    static const Int_t fgkMaxGener; // ancester level wanted to be checked 
-    static const Int_t fgkMaxIter; // number of iteration to find out matching particle 
-    static const Int_t fgkqType; // number of particle type to be checked
+    static const Int_t fgkGluon=21; // gluon pdg code
+    static const Int_t fgkMaxGener=10; // ancester level wanted to be checked 
+    static const Int_t fgkMaxIter=100; // number of iteration to find out matching particle 
+    static const Int_t fgkqType=7; // number of particle type to be checked
 
     struct AliHists{
       TH1F *fPdgCode; // histogram to store particle pdg code
@@ -122,6 +144,10 @@ class AliHFEmcQA: public TObject {
       TH1F *fNq; // histogram to store number of quark
       TH1F *fProcessID; // histogram to store process id 
       TH2F *fePtRatio; // fraction of electron pT from D or B hadron
+      TH2F *fPtCorr; // pt correlation between e and direct D or B 
+      TH2F *fPtCorrDp; // pt correlation between e and direct D+
+      TH2F *fPtCorrD0; // pt correlation between e and direct D0
+      TH2F *fPtCorrDrest; // pt correlation between e and direct D rest
       TH2F *fDePtRatio; // fraction of D electron pT from B hadron 
       TH2F *feDistance; // distance between electron production point to mother particle 
       TH2F *fDeDistance; // distance between D electron production point to mother particle
@@ -130,6 +156,10 @@ class AliHFEmcQA: public TObject {
                          : fNq()
                          , fProcessID()
                          , fePtRatio()
+                         , fPtCorr()
+                         , fPtCorrDp()
+                         , fPtCorrD0()
+                         , fPtCorrDrest()
                          , fDePtRatio()
                          , feDistance()
                          , fDeDistance()
@@ -140,6 +170,10 @@ class AliHFEmcQA: public TObject {
                          : fNq(p.fNq)
                          , fProcessID(p.fProcessID)
                          , fePtRatio(p.fePtRatio)
+                         , fPtCorr(p.fPtCorr)
+                         , fPtCorrDp(p.fPtCorrDp)
+                         , fPtCorrD0(p.fPtCorrD0)
+                         , fPtCorrDrest(p.fPtCorrDrest)
                          , fDePtRatio(p.fDePtRatio)
                          , feDistance(p.feDistance)
                          , fDeDistance(p.fDeDistance)
@@ -154,15 +188,25 @@ class AliHFEmcQA: public TObject {
       void FillList(TList *l) const;
     };
 
-    AliHists fHist[2][7][5]; // struct of histograms to store kinematics of given particles
-    AliHistsComm fHistComm[2][5]; // struct of additional histograms of given particles
+    AliHists fHist[3][7][6]; // struct of histograms to store kinematics of given particles
+    AliHistsComm fHistComm[2][6]; // struct of additional histograms of given particles
+    TH2F *fhD[9]; // D meson pt,Y spectra
+    TH1F *fhDLogbin[9]; // D meson pt w diff binning
 
     TList *fQAhistos;           // Container for QA histos
-    TParticle *fHeavyQuark[50]; // store pointer of heavy flavour quark 
+    AliHFEcollection *fMCQACollection;      //! Tasks own QA collection
+    TParticle *fHeavyQuark[50]; //! store pointer of heavy flavour quark 
     Int_t fIsHeavy[2]; // count of heavy flavour
     Int_t fNparents; // number of heavy hadrons to be considered
     Int_t fParentSelect[2][7]; // heavy hadron species
 
+    Double_t fElecBackgroundFactor[kBgLevels][kCentBins][kElecBgSpecies][kBgPtBins];     // Electron background factors
+    Double_t fBinLimit[kBgPtBins+1];      // Electron background bins
+
+private:
+    Int_t              fCentrality;  // Centrality
+    Bool_t             fIsPbPb;        // Analysis Type: pp or PbPb
+    Bool_t             fIsppMultiBin;  // pp multiplicity bin analysis
 
   ClassDef(AliHFEmcQA,1);
 };