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