]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/base/AliPtMothFromPtDaugh.h
New classes for the cuts on charm candidates
[u/mrichter/AliRoot.git] / PWG3 / base / AliPtMothFromPtDaugh.h
1 #ifndef AliPtMothFromPtDaugh_H
2 #define AliPtMothFromPtDaugh_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6 ////////////////////////////////////////////////////////////////////////////
7 //  Class to perform pt-spectra (and ptMin-spectra) extraction of mothers //
8 //  particles starting from measured pt-spectra of daughters particles    //
9 //  that come from inclusive decays.                                      //
10 //                                                                        //  
11 //  Contact: Giuseppe.Bruno@ba.infn.it  &  Fiorella.Fionda@ba.infn.it     //
12 ////////////////////////////////////////////////////////////////////////////
13 class TH1F;
14 class TNtuple;
15 class AliStack;
16 class TParticle;
17 class TArrayI;
18
19 class AliPtMothFromPtDaugh: public TObject {
20  public:
21    typedef enum {
22           kUserAnalysis,
23           kBtoJPSI,
24           kBtoEle,
25           kBtoMuon,
26           kBtoD0
27           } Analysis_mode;
28
29    AliPtMothFromPtDaugh(); 
30    virtual ~AliPtMothFromPtDaugh(); 
31    AliPtMothFromPtDaugh(const AliPtMothFromPtDaugh &extraction); 
32    AliPtMothFromPtDaugh& operator=(const AliPtMothFromPtDaugh& extraction);
33
34    Bool_t CreateWeights(); // method which create the containers for the corrections for the deconvolution
35    void DeleteWeights();   // reset the containers
36
37    // Read kinematics and daughter histogram
38    Bool_t ReadKinematics(const char *pathFileName = "galice.root"); // read (only once) the Kinematics.root
39                                                                     // produce an ntupla in a file
40    Bool_t ReadHistoPtDaught(TH1F *hist);                            // this is input, i.e. the spectrum of the daughter.
41  
42    // setters  
43    //
44    void SetDefaultAnalysis(Analysis_mode mode){fAnalysisMode = mode; InitDefaultAnalysis();}
45    void SetPdgDaugh(Int_t pdgD); // set the pdg of the daughter particle
46    void SetBeautyMothers(); // all the Beauty particles are considered as "mothers" 
47    void SetPdgMothers(Int_t n_mothers,Int_t *pdgM);  // define which particles are considered as possible mothers
48    void SetReadKineFromNtupla(Bool_t readKine){fReadKine = readKine;}   // this to speed up, to avoid several 
49                                                                         // readings of the Kinematics.root
50    // (here you can set the pt binning of the final spectrum, i.e. that of the mothers )
51    void SetBinsPtMoth(Double_t ptmin, Double_t ptmax,Int_t nbins,Double_t alpha=1.0); // binning of histo pt(Mothers)
52    void SetBinsPtMoth(Int_t nbins, Double_t *edgeBins);                          //   "      "    "      " 
53    void SetBinsPtMinMoth(Double_t ptmin, Double_t ptmax,Int_t nbins,Double_t alpha=1.0); // histo of pt_min(Mothers)
54    void SetBinsPtMinMoth(Int_t nbins, Double_t *edgeBins);                          // histo of pt_min(Mothers)
55    //
56    void SetYmothers(Double_t yMin, Double_t yMax){fyMothMin = yMin;                     // define rapidity range 
57                                                   fyMothMax = yMax; SetUseEta(kFALSE);} // of the mothers
58    void SetYdaughter(Double_t yMin, Double_t yMax){fyDaughMin = yMin;                     // define rapidity range
59                                                    fyDaughMax = yMax; SetUseEta(kFALSE);} // of the daughter
60
61    void SetEtaMothers(Double_t etaMin, Double_t etaMax){fyMothMin = etaMin;   // define pseudo-rapidity range of mothers
62                                                         fyMothMax = etaMax; SetUseEta(kTRUE);}
63    void SetEtaDaughter(Double_t etaMin, Double_t etaMax){fyDaughMin = etaMin; // define pseudo-rapidity range of daughter
64                                                          fyDaughMax = etaMax; SetUseEta(kTRUE);}
65    //getters
66    Double_t* GetBinsSize(const TH1F *hist, Int_t &n) const;   
67    Bool_t GetEtaMothers(Double_t &etaMin, Double_t &etaMax) const;  // get pseudorapidity edges for mothers if pseudorapidity
68                                                                     // is used    (return kFALSE if rapidity has been used) 
69    Bool_t GetEtaDaughter(Double_t &etaMin, Double_t &etaMax) const; // get pseudorapidity edges for daughters if pseudorapidity
70                                                                     // is used    (return kFALSE if rapidity has ben used)
71    Bool_t GetYMothers(Double_t &yMin, Double_t &yMax) const;    // get rapidity edges for mothers if rapidity is used
72    Bool_t GetYDaughter(Double_t &yMin, Double_t &yMax) const;   // get rapidity edges for daughters if rapidity is used
73  
74    Int_t GetPdgDaugh() const {return fDaughter;} // return the pdg of the daughter particle
75    Int_t* GetPdgMothers(Int_t &n_mothers) const; // return the pdg codes of the mothers particles 
76  
77    // main method to evaluate mothers spectra (for pt and ptMin)
78    Bool_t EvaluatePtMoth();
79    void WritePtMothHistoToFile(char *fileOutName="Mothers.root");
80
81    // return values of correction factors for pt-mothers ditribution
82    Double_t GetW(Int_t i,Int_t j) const;
83    Double_t GetF(Int_t i) const;
84   
85    // return values of correction factors for ptMin-mothers ditribution
86    Double_t GetWmin(Int_t i,Int_t j) const;
87    Double_t GetFmin(Int_t i) const;
88    
89    // return errors on correction factors for pt-mothers distribution
90    Double_t GetStatErrW(Int_t i,Int_t j) const; 
91    Double_t GetStatErrF(Int_t i) const;
92  
93    // return errors on correction factors for ptMin-mothers distribution
94    Double_t GetStatErrWmin(Int_t i,Int_t j) const;
95    Double_t GetStatErrFmin(Int_t i) const;
96
97    // return pointers to pt and ptMin mothers histograms 
98    TH1F* GetHistoPtMother() const {return fHistoPtMothers;}
99    TH1F* GetHistoPtMinMother() const {return fHistoPtMinMothers;}
100
101  protected:
102  
103    void InitDefaultAnalysis(); // set the default analysis for one of the specific Analysis_mode, apart kUserAnalysis
104      // methods to evaluate correction factors
105    Bool_t EvaluateWij(); // 
106    Bool_t EvaluateFi();  // 
107
108    void SetUseEta(Bool_t useEta){fUseEta=useEta;}   // decide whether to use rapidity or pseudo-rapidity cut
109    Double_t* SetBinsSize(Double_t ptmin, Double_t ptmax,Int_t nbins,Double_t alpha); 
110    // method to evaluate raw-mothers spectra (for pt and ptMin)
111    Bool_t EvaluatePtMothRaw(TH1F *histoPt, TH1F *histoPtMin); 
112    //method to evaluate statistical errors on extracted distribution
113    Bool_t EvaluateErrPt(Double_t *erStat);
114    Bool_t EvaluateErrPtMin(Double_t *erStat);
115    
116    void SetPdgMothersPrivate(Int_t n_mothers,Int_t *pdgM);  // define which particles are considered as possible mothers
117
118    //method to read the kinematic
119    Int_t GiveBinIndex(Double_t Ptpart,const TH1F *ptHist);
120    Bool_t Rapidity(const TParticle *particle, Double_t &y);
121    Bool_t IsMothers(Int_t pdgCode);
122    Bool_t IsSelectedDaugh(const TParticle *part, Int_t &labelDaugh, AliStack *stack);
123    Bool_t CutDaugh(Double_t yD,Double_t ptD);
124
125    TNtuple*             fDecayKine; //! Ntupla to store kinematic information of Decay 
126    Double_t**           fWij; //! pointer to store correction factors
127    Double_t*            fFi;  //! "            "                "
128    Double_t**           fWijMin; //! "        "                "
129    Double_t*            fFiMin; //! "         "                "
130    TH1F*                fHistoPtDaughter; //! pointers to pt-histogram of Daughther 
131    TH1F*                fHistoPtMothers; //! pointers to ptMin-histogram of mothers
132    TH1F*                fHistoPtMinMothers; //! pointers for pt_min-histogram of Mothers
133    TArrayI*             fMothers; // Array with pdg codes of mothers
134    Int_t                fDaughter; // pdg code of daughter 
135    Bool_t               fReadKine; //! kTRUE if kinematic is red and the Ntupla is created 
136    Double_t             fyMothMax; // max rapidity (or pseudorapidity) of mothers
137    Double_t             fyMothMin; // min  "             "                 " 
138    Double_t             fyDaughMax; // max "             "             of daughters  
139    Double_t             fyDaughMin; // min "             "                 "
140    Bool_t               fUseEta; // kTRUE if pseudorapidity range is used 
141    Analysis_mode        fAnalysisMode; // analysis mode    
142
143    ClassDef(AliPtMothFromPtDaugh, 0)  
144   };
145
146 #endif