]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEelecbackground.h
Possibility to select on the basis of the presence of at least a fake track among...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEelecbackground.h
1 #ifndef ALIHFEELECBACKGROUND_H
2 #define ALIHFEELECBACKGROUND_H
3
4 /**************************************************************************
5  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  *                                                                        *
7  * Author: The ALICE Off-line Project.                                    *
8  * Contributors are mentioned in the code where appropriate.              *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
22 //  Secondary vertexing construction Class
23 //  Construct secondary vertex from Beauty hadron with electron and
24 //  hadrons, then apply selection criteria
25 //
26
27 #ifndef ROOT_TObject
28 //#include <TObject.h>
29 #endif
30
31 class AliESDEvent;
32 class AliESDpid;
33 class AliESDVertex;
34 class AliAODEvent;
35 class AliESDtrack;
36 class AliAODTrack;
37 class AliMCEvent;
38
39 class AliHFEpid;
40
41
42 //________________________________________________________________
43 class AliHFEelecbackground : public TObject {
44   public: 
45     AliHFEelecbackground();
46     AliHFEelecbackground(const AliHFEelecbackground &p);
47     AliHFEelecbackground &operator=(const AliHFEelecbackground &);
48     virtual ~AliHFEelecbackground();
49                 virtual Bool_t Load(const Char_t *filename);
50                 virtual Bool_t Load(TList * const outputlist);
51
52     void CreateHistograms(TList * const qaList);
53                 void Reset();
54
55     Bool_t HasMCData() const { return TestBit(kHasMCData); };
56     Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
57     Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
58
59     void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData,hasMCdata); };
60     void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
61     void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
62     void SetEvent(AliESDEvent* const ESD); 
63     void SetEventAOD(AliAODEvent* const AOD){fAOD1=AOD;}; 
64     void SetMCEvent(AliMCEvent* const mcEvent){fMCEvent=mcEvent;};  
65     
66     void SetOpeningAngleCut(Double_t openingAngleCut){fOpeningAngleCut = openingAngleCut;};
67     void SetInvMassCut(Double_t invMassCut){fInvMassCut = invMassCut;};
68     void SetChi2NdfCut(Double_t chi2NdfCut){fChi2NdfCut = chi2NdfCut;};
69     void SetUseAliKFCode(Bool_t useAliKFCode){fUseAliKFCode = useAliKFCode;};    
70     void SetSharedClusterCut(Bool_t sharedClusterCut){fSharedClusterCut = sharedClusterCut;};
71     void SetRequireITSStandalone(Short_t requireITSStandalone){fRequireITSStandalone = requireITSStandalone;};
72     void SetMinITSChi2(Double_t minITSChi2) {fMinITSChi2 = minITSChi2;};
73     void SetMinNbCls(Int_t minNbCls){fMinNbCls = minNbCls;};
74     void SetMinNbClsSDDSPD(Int_t minNbClsSDDSPD){fMinNbClsSDDSPD = minNbClsSDDSPD;};
75     void SetPIDPartner();
76     void SetPIDMethodPartner(AliHFEpid * const pid) {fPIDMethodPartner = pid;};
77     void SetPIDMethodPartnerITS(AliESDpid * const pid) {fPIDMethodPartnerITS = pid;};
78     void SetDebugLevel(Short_t debugLevel) { fDebugLevel = debugLevel;};
79     
80     Double_t GetOpeningAngleCut() const { return fOpeningAngleCut; };
81     Double_t GetInvMassCut() const { return fInvMassCut; };
82     Double_t GetChi2NdfCut() const { return fChi2NdfCut; };
83     Bool_t GetUseAliKFCode() const { return fUseAliKFCode; };
84     Bool_t GetSharedClusterCut() const { return fSharedClusterCut; };
85     Short_t GetRequireITSStandalone() const { return fRequireITSStandalone; };
86     Int_t GetMinNbCls() const { return fMinNbCls;};
87     Double_t GetMinITSChi2() const { return fMinITSChi2; };
88     Int_t GetMinNbClsSDDSPD() const { return fMinNbClsSDDSPD;};
89     Bool_t GetPIDPartner() const { return fPIDPartner;};
90     
91     TList *GetList()  const           { return fList; };
92     TList *GetListPostProcess() const { return fListPostProcess; };
93     
94     Bool_t SingleTrackCut(AliESDtrack* const trackPart) const;
95     Bool_t ShareCluster(AliESDtrack * const track1,AliESDtrack * const track2); 
96     Bool_t PIDTrackCut(AliESDtrack* const trackPart);
97     void PairAnalysis(AliESDtrack* const track, AliESDtrack* const trackpart); 
98     void FillOutput(Double_t *results, Double_t *resultsr, Int_t sign); 
99     void PostProcess();
100     void Plot() const;
101     
102  private:
103     enum{
104       kHasMCData = BIT(15),             // bitset for mc data usage
105         kAODanalysis = BIT(16)            // bitset for aod analysis
106         };
107     enum {kDatai=0, kDatar=1, kDatadca=2, kDatachi2Ndf=3, kMCo=4, kMCr=5, kMCdca=6, kMCchi2Ndf=7, kMCe=8, kMCcutPart0=9, kMCcutPart1=10, kMCcutPart2=11, kMCcutPart3=12};   // In the fList Data/MC
108     enum {kOs=0, kPp=1, kNn=2, kR=3};            // In the last dimension Charge
109     enum {kOos=0, kOss=1, kOr=2, kOdiff=3};      // outputs 
110     enum {kNOutput=4,kNMCInfo=5};                // Nb of outputs
111     enum{
112       kElectronFromBackground = 0,
113         kElectronFromGamma = 1,
114         kElectronFromPi0 = 2,
115         kElectronFromEta = 3,
116         kElectronFromC = 4,
117         kElectronFromB = 5                
118         };                                // MC: Origin 
119     enum {kNotSplitted=0, kSplittedOs=1, kSplittedSs=2}; // MC: splitted 
120     
121     Bool_t CalculateMotherVariable(AliESDtrack* const track, AliESDtrack* const trackpart, Double_t *results);
122     void CalculateMotherVariableR(AliESDtrack* const track, AliESDtrack* const trackpart, Double_t *results);
123     Int_t IsMotherGamma(Int_t tr);
124     Int_t IsMotherPi0(Int_t tr);
125     Int_t IsMotherEta(Int_t tr);
126     Int_t IsMotherC(Int_t tr);
127     Int_t IsMotherB(Int_t tr);
128     Int_t GetPdg(Int_t tr);
129     Int_t GetLabMother(Int_t tr);
130     
131     static Double_t BetheBlochElectronITS(const Double_t *x, const Double_t * /*par*/);
132     static Double_t BetheBlochMuonITS(const Double_t *x, const Double_t * /*par*/);
133     static Double_t BetheBlochPionITS(const Double_t *x, const Double_t * /*par*/);
134     static Double_t BetheBlochKaonITS(const Double_t *x, const Double_t * /*par*/);
135     static Double_t BetheBlochProtonITS(const Double_t *x, const Double_t * /*par*/); 
136     
137     static Double_t BetheBlochElectronTPC(const Double_t *x, const Double_t * /*par*/);
138     static Double_t BetheBlochMuonTPC(const Double_t *x, const Double_t * /*par*/);
139     static Double_t BetheBlochPionTPC(const Double_t *x, const Double_t * /*par*/);
140     static Double_t BetheBlochKaonTPC(const Double_t *x, const Double_t * /*par*/);
141     static Double_t BetheBlochProtonTPC(const Double_t *x, const Double_t * /*par*/); 
142     
143     THnSparseF *fhtmp;     // Only to avoid coverity problem
144     TH2F *fhtmpf;          // Only to avoid coverity problem
145     TH1F *fhtmpp;          // Only to avoid coverity problem
146     
147     AliESDEvent* fESD1;              //! ESD pointer             
148     AliAODEvent* fAOD1;              //! AOD pointer             
149     AliMCEvent*  fMCEvent;           //! MC event             
150     Double_t fBz;                    // Magnetic field 
151     const AliESDVertex *fkVertex;    //! Primary vertex
152     static const Double_t fgkMe;     //!  Mass of the electron
153     
154     Double_t fPtESD;                 //! pt of tagged electron
155     Int_t fIndexTrack;               //! index track
156     Int_t fPdg;                      //! pdg code track 
157     Int_t fLabMother;                //! label first mother track 
158     Int_t fIsFrom;                   //! is track from
159     Int_t fMotherGamma;              //! Gamma, mother of track
160     Int_t fMotherPi0;                //! Pi0, mother of track
161     Int_t fMotherC;                  //! C, mother of track
162     Int_t fMotherB;                  //! B, mother of track
163     Int_t fMotherEta;                //! eta, mother of track
164     Bool_t fIsPartner;               //! Are partners
165     Bool_t fIsSplittedTrack;         //! Are splitted track
166     
167     Double_t fOpeningAngleCut;       //! Opening angle cut
168     Double_t fInvMassCut;            //! Inv mass cut
169     Double_t fChi2NdfCut;            //! chi2ndf cut for KF code
170     
171     Bool_t   fUseAliKFCode;          //! Use AliKF code to calculate the pair properties
172     
173     Bool_t  fSharedClusterCut;       //! Shared Cluster Cut
174     Short_t fRequireITSStandalone;   //! ITS standalone: 1 and 2 (pureITSStandalone)
175     Int_t  fMinNbCls;                //! Min Nb of clusters ITS or TPC
176     Double_t fMinITSChi2;            //! ITS chi2 min
177     Int_t  fMinNbClsSDDSPD;          //! Min Nb of clusters ITS SDD&SPD
178     Bool_t fPIDPartner;              //! PID partner
179     AliHFEpid *fPIDMethodPartner;    //! PID cuts
180     AliESDpid *fPIDMethodPartnerITS; //! PID cuts ITS
181     
182     Short_t fDebugLevel;             //! Debug Level
183     
184     Bool_t   fCuts[10];               //! Cut passed already
185     
186     TList *fList;                    //! list for outputs
187     TList *fListPostProcess;         //! list for postprocess
188     
189     static Bool_t  fgUseMCPID;       // flag to use MC PID for tagged electron
190     
191     ClassDef(AliHFEelecbackground,0);
192 };
193
194 #endif