]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEsecVtx.h
Adapting to CORRFW changes (Markus)
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEsecVtx.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 //  Secondary vertexing construction Class
17 //  Construct secondary vertex from Beauty hadron with electron and
18 //  hadrons, then apply selection criteria
19 //
20
21 #ifndef ALIHFESECVTX_H
22 #define ALIHFESECVTX_H
23
24 #ifndef ROOT_TObject
25 //#include <TObject.h>
26 #endif
27
28 class TH1F;
29 class TH2F;
30 class TString;
31 class AliESDEvent;
32 class AliESDtrack;
33 class AliStack;
34
35 //________________________________________________________________
36 class AliHFEsecVtx : public TObject {
37
38         public: 
39                 AliHFEsecVtx();
40                 AliHFEsecVtx(const AliHFEsecVtx &p); // copy constructor
41                 AliHFEsecVtx &operator=(const AliHFEsecVtx &); // assignment operator
42                 virtual ~AliHFEsecVtx();
43
44                 void CreateHistograms(TString hnopt="");
45
46                 void SetEvent(AliESDEvent* const ESD){fESD1=ESD;}; // set ESD pointer
47                 void SetStack(AliStack* const stack){fStack=stack;} // set stack pointer
48                 void InitAnaPair(); // initialize default parameters 
49                 void AnaPair(AliESDtrack* ESDtrack1, AliESDtrack* ESDtrack2, Int_t index2); // do e-h analysis
50                 void RunSECVTX(AliESDtrack *track); // run secondary vertexing algorithm
51
52                 Int_t GetMCPID(AliESDtrack *track); // return MC pid
53                 Int_t PairOrigin(AliESDtrack* track1, AliESDtrack* track2); // return pair origin as a pdg code
54                 Int_t PairCode(AliESDtrack* track1,AliESDtrack* track2); // return corresponding pair code to pdg code
55                 Int_t GetElectronSource(Int_t mclabel); // return origin of the electron
56
57                 Bool_t SingleTrackCut(AliESDtrack* track1) const; // single track cut
58
59         protected:
60
61                 void Init();
62                 void FindSECVTXCandid4Tracks(AliESDtrack* track1); // find secondary vertex for 4 tracks
63                 void FindSECVTXCandid3Tracks(AliESDtrack* track1); // find secondary vertex for 3 tracks        
64                 void FindSECVTXCandid2Tracks(AliESDtrack* track1); // find secondary vertex for 2 tracks
65                 void CalcSECVTXProperty(AliESDtrack* track1, AliESDtrack* track2, AliESDtrack* track3); // calculated distinctive variables
66                 void ApplyPairTagCut(); // apply strict tagging condition for 1 pair secondary vertex
67                 void ApplyVtxTagCut(Double_t chi2, Int_t id1, Int_t id2); // apply tagging condition for 3 track secondary vertex
68                 void ResetTagVar(); // reset tagging variables
69
70                 Bool_t ApplyPairTagCut(Int_t id); // apply strict tagging condition for 1 pair secondary vertex
71                 Bool_t ApplyTagCut(Double_t chi2); // apply tagging condition
72
73
74                 Double_t GetSecVtxChi2(AliESDtrack* track1, AliESDtrack* track2, AliESDtrack* track3, AliESDtrack* track4); // get secondary vertex chi2 for 4 tracks
75                 Double_t GetSecVtxChi2(AliESDtrack* track1, AliESDtrack* track2, AliESDtrack* track3); // get secondary vertex chi2 for 3 tracks
76                 Double_t GetSecVtxChi2(AliESDtrack* track1, AliESDtrack* track2); // get secondary vertex chi2 for 2 tracks
77
78
79         private:
80
81                 AliESDEvent* fESD1; // ESD pointer             
82                 AliStack* fStack; // stack pointer              
83
84                 Int_t fParentSelect[2][7]; // heavy hadron species
85                 Int_t fNparents; // number of heavy hadrons to be considered
86
87                 TString fkSourceLabel[10]; // electron source label
88
89                 enum {kAll, kDirectCharm, kDirectBeauty, kBeautyCharm, kGamma, kPi0, kElse, kBeautyGamma, kBeautyPi0, kBeautyElse};
90                 enum {kCharm=4, kBeauty=5};
91
92                 struct AliHistspair{
93                         TH2F *fInvMass; // histogram to store pair invariant mass
94                         TH2F *fInvMassCut1; // histogram to store pair invariant mass after cut1
95                         TH2F *fInvMassCut2; // histogram to store pair invariant mass after cut2
96                         TH1F *fKFChi2; // histogram to store pair vertex chi2
97                         TH1F *fOpenAngle; // histogram to store pair opening angle
98                         TH1F *fCosOpenAngle; // histogram to store cosine of the pair opening angle
99                         TH2F *fSignedLxy; // histogram to store signed Lxy
100                         TH1F *fKFIP; // histogram to store pair impact parameter
101                         TH1F *fIPMax; // histogram to store larger impact parameter among pair tracks
102
103                         AliHistspair()
104                         : fInvMass()
105                         , fInvMassCut1()
106                         , fInvMassCut2()
107                         , fKFChi2()
108                         , fOpenAngle()
109                         , fCosOpenAngle()
110                         , fSignedLxy()
111                         , fKFIP()
112                         , fIPMax()
113                         {
114                           // define constructor
115                         }
116                         AliHistspair(const AliHistspair & p)
117                         : fInvMass(p.fInvMass)
118                         , fInvMassCut1(p.fInvMassCut1)
119                         , fInvMassCut2(p.fInvMassCut2)
120                         , fKFChi2(p.fKFChi2)
121                         , fOpenAngle(p.fOpenAngle)
122                         , fCosOpenAngle(p.fCosOpenAngle)
123                         , fSignedLxy(p.fSignedLxy)
124                         , fKFIP(p.fKFIP)
125                         , fIPMax(p.fIPMax)
126                         {
127                           // copy constructor
128                         }
129                         AliHistspair &operator=(const AliHistspair &)
130                         {
131                           // assignment operator, not yet implemented
132                           return *this;
133                         }
134                 };
135
136                 struct AliHiststag{
137                         TH1F *fPtBeautyElec; // histogram for electrons of single track cut passed 
138                         TH1F *fPtTaggedElec; // histogram for total b tagged electrons
139                         TH1F *fPtRightTaggedElec; // histogram for right b tagged electrons
140                         TH1F *fPtWrongTaggedElec; // histogram for wrong b tagged electrons
141                         TH1F *fInvmassBeautyElecSecVtx;  // histogram for right-tagged b invariant mass
142                         TH1F *fInvmassNotBeautyElecSecVtx; // histogram for mis-tagged b invariant mass
143                         TH1F *fSignedLxyBeautyElecSecVtx; // histogram for right-tagged b signed Lxy
144                         TH1F *fSignedLxyNotBeautyElecSecVtx; // histogram for mis-tagged b signed Lxy
145                         TH1F *fDistTwoVtxBeautyElecSecVtx; // histogram for right-tagged b two vertex distance
146                         TH1F *fDistTwoVtxNotBeautyElecSecVtx; // histogram for mis-tagged b two vertex distance
147                         TH1F *fCosPhiBeautyElecSecVtx; // histogram for right-tagged b cos of opening angle
148                         TH1F *fCosPhiNotBeautyElecSecVtx; // histogram for mis-tagged b cos of opening angle
149                         TH1F *fChi2BeautyElecSecVtx; // histogram for right-tagged b chi2 of secondary vertex 
150                         TH1F *fChi2NotBeautyElecSecVtx; // histogram for mis-tagged b chi2 of secondary vertex
151                         TH1F *fInvmassBeautyElec2trkVtx; // histogram for right-tagged b invariant mass of two track vertex
152                         TH1F *fInvmassNotBeautyElec2trkVtx; // histogram for mis-tagged b invariant mass of two track vertex
153                         TH1F *fSignedLxyBeautyElec2trkVtx; // histogram for right-tagged b signed Lxy of two track vertex
154                         TH1F *fSignedLxyNotBeautyElec2trkVtx; // histogram for mis-tagged b signed Lxy of two track vertex
155                         TH1F *fChi2BeautyElec2trkVtx; // histogram for right-tagged b chi2 of two track vertex
156                         TH1F *fChi2NotBeautyElec2trkVtx; // histogram for mis-tagged b chi2 of two track vertex
157
158                         AliHiststag()
159                         : fPtBeautyElec()
160                         , fPtTaggedElec()
161                         , fPtRightTaggedElec()
162                         , fPtWrongTaggedElec()
163                         , fInvmassBeautyElecSecVtx()
164                         , fInvmassNotBeautyElecSecVtx()
165                         , fSignedLxyBeautyElecSecVtx()
166                         , fSignedLxyNotBeautyElecSecVtx()
167                         , fDistTwoVtxBeautyElecSecVtx()
168                         , fDistTwoVtxNotBeautyElecSecVtx()
169                         , fCosPhiBeautyElecSecVtx()
170                         , fCosPhiNotBeautyElecSecVtx()
171                         , fChi2BeautyElecSecVtx()
172                         , fChi2NotBeautyElecSecVtx()
173                         , fInvmassBeautyElec2trkVtx()
174                         , fInvmassNotBeautyElec2trkVtx()
175                         , fSignedLxyBeautyElec2trkVtx()
176                         , fSignedLxyNotBeautyElec2trkVtx()
177                         , fChi2BeautyElec2trkVtx()
178                         , fChi2NotBeautyElec2trkVtx()
179                         {
180                           // define constructor
181                         }
182                         AliHiststag(const AliHiststag & p)
183                         : fPtBeautyElec(p.fPtBeautyElec)
184                         , fPtTaggedElec(p.fPtTaggedElec)
185                         , fPtRightTaggedElec(p.fPtRightTaggedElec)
186                         , fPtWrongTaggedElec(p.fPtWrongTaggedElec)
187                         , fInvmassBeautyElecSecVtx(p.fInvmassBeautyElecSecVtx)
188                         , fInvmassNotBeautyElecSecVtx(p.fInvmassNotBeautyElecSecVtx)
189                         , fSignedLxyBeautyElecSecVtx(p.fSignedLxyBeautyElecSecVtx)
190                         , fSignedLxyNotBeautyElecSecVtx(p.fSignedLxyNotBeautyElecSecVtx)
191                         , fDistTwoVtxBeautyElecSecVtx(p.fDistTwoVtxBeautyElecSecVtx)
192                         , fDistTwoVtxNotBeautyElecSecVtx(p.fDistTwoVtxNotBeautyElecSecVtx)
193                         , fCosPhiBeautyElecSecVtx(p.fCosPhiBeautyElecSecVtx)
194                         , fCosPhiNotBeautyElecSecVtx(p.fCosPhiNotBeautyElecSecVtx)
195                         , fChi2BeautyElecSecVtx(p.fChi2BeautyElecSecVtx)
196                         , fChi2NotBeautyElecSecVtx(p.fChi2NotBeautyElecSecVtx)
197                         , fInvmassBeautyElec2trkVtx(p.fInvmassBeautyElec2trkVtx)
198                         , fInvmassNotBeautyElec2trkVtx(p.fInvmassNotBeautyElec2trkVtx)
199                         , fSignedLxyBeautyElec2trkVtx(p.fSignedLxyBeautyElec2trkVtx)
200                         , fSignedLxyNotBeautyElec2trkVtx(p.fSignedLxyNotBeautyElec2trkVtx)
201                         , fChi2BeautyElec2trkVtx(p.fChi2BeautyElec2trkVtx)
202                         , fChi2NotBeautyElec2trkVtx(p.fChi2NotBeautyElec2trkVtx)
203                         {
204                           // copy constructor
205                         }
206                         AliHiststag &operator=(const AliHiststag &)
207                         {
208                           // assignment operator, not yet implemented
209                           return *this;
210                         }
211                 };
212
213                 AliHistspair fHistPair[10]; // struct of above given histogram for different electron sources
214                 AliHiststag fHistTagged; // struct of above given histogram
215
216                 Int_t fPairTagged; // number of tagged e-h pairs
217                 Int_t fpairedTrackID[20]; // paird hadron track track 
218                 Double_t fpairedChi2[20]; // pair chi2
219                 Double_t fpairedInvMass[20]; // pair invariant mass
220                 Double_t fpairedSignedLxy[20]; // pair signed Lxy
221
222                 Int_t fid[4][3]; // index to store sorting result
223                 Int_t fia[4][3][2]; // index to store sorting result
224
225                 Double_t fdistTwoSecVtx; // distance between two pair vertex
226                 Double_t fcosPhi; // cos of opening angle of two pair vertex
227                 Double_t fsignedLxy; // signed Lxy of secondary vertex
228                 Double_t finvmass; // invariant mass of secondary vertex
229                 Double_t finvmassSigma; // invariant mass sigma of secondary vertex
230
231                 Bool_t fBTagged; // if b tagged, set true
232                 Bool_t fBElec; // if set true for b electron, set true
233
234         ClassDef(AliHFEsecVtx,0);
235 };
236
237 #endif