]>
Commit | Line | Data |
---|---|---|
3244eeed | 1 | #ifndef ALIAODRECODECAYHF_H |
2 | #define ALIAODRECODECAYHF_H | |
3 | /* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
27de2dfb | 6 | /* $Id$ */ |
7 | ||
3244eeed | 8 | //*********************************************************** |
9 | // Class AliAODRecoDecayHF | |
10 | // base class for AOD reconstructed heavy-flavour decays | |
11 | // Author: A.Dainese, andrea.dainese@lnl.infn.it | |
12 | //*********************************************************** | |
13 | ||
460cd990 | 14 | #include <TRef.h> |
a9b75906 | 15 | #include <TList.h> |
ac7797a7 | 16 | #include "AliAODTrack.h" |
3244eeed | 17 | #include "AliAODRecoDecay.h" |
18 | ||
ead561f0 | 19 | class AliAODEvent; |
a9b75906 | 20 | class AliRDHFCuts; |
ec653946 | 21 | class AliKFParticle; |
22 | ||
3244eeed | 23 | class AliAODRecoDecayHF : public AliAODRecoDecay { |
24 | ||
25 | public: | |
26 | ||
27 | AliAODRecoDecayHF(); | |
28 | AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge, | |
29 | Double_t *px,Double_t *py,Double_t *pz, | |
30 | Double_t *d0,Double_t *d0err); | |
31 | AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge, | |
32 | Double_t *d0,Double_t *d0err); | |
b39168f9 | 33 | AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3], |
34 | Int_t nprongs,Short_t charge, | |
35 | Double_t *px,Double_t *py,Double_t *pz,Double_t *d0); | |
3244eeed | 36 | virtual ~AliAODRecoDecayHF(); |
37 | ||
38 | AliAODRecoDecayHF(const AliAODRecoDecayHF& source); | |
39 | AliAODRecoDecayHF& operator=(const AliAODRecoDecayHF& source); | |
40 | ||
41 | ||
42 | // primary vertex | |
460cd990 | 43 | void SetPrimaryVtxRef(TObject *vtx) { fEventPrimaryVtx = vtx; } |
44 | AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); } | |
45 | void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);} | |
3244eeed | 46 | void CheckOwnPrimaryVtx() const |
47 | {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;} | |
48 | AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;} | |
49 | void GetOwnPrimaryVtx(Double_t vtx[3]) const | |
50 | {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);} | |
0a65d33f | 51 | void UnsetOwnPrimaryVtx() {if(fOwnPrimaryVtx) {delete fOwnPrimaryVtx; fOwnPrimaryVtx=0;} return;} |
460cd990 | 52 | AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); } |
ead561f0 | 53 | AliAODVertex* RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod); |
54 | ||
3244eeed | 55 | |
56 | // kinematics & topology | |
fcf73952 | 57 | Double_t DecayLength2() const |
58 | { return AliAODRecoDecay::DecayLength2(GetPrimaryVtx());} | |
3244eeed | 59 | Double_t DecayLength() const |
460cd990 | 60 | { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());} |
3244eeed | 61 | Double_t DecayLengthError() const |
460cd990 | 62 | { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());} |
3244eeed | 63 | Double_t NormalizedDecayLength() const |
460cd990 | 64 | { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());} |
be9cad0c | 65 | Double_t NormalizedDecayLength2() const |
66 | { return AliAODRecoDecay::NormalizedDecayLength2(GetPrimaryVtx());} | |
3244eeed | 67 | Double_t DecayLengthXY() const |
460cd990 | 68 | { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());} |
3244eeed | 69 | Double_t DecayLengthXYError() const |
460cd990 | 70 | { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());} |
3244eeed | 71 | Double_t NormalizedDecayLengthXY() const |
460cd990 | 72 | { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());} |
3244eeed | 73 | Double_t Ct(UInt_t pdg) const |
460cd990 | 74 | { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());} |
3244eeed | 75 | Double_t CosPointingAngle() const |
460cd990 | 76 | { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());} |
3244eeed | 77 | Double_t CosPointingAngleXY() const |
460cd990 | 78 | { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());} |
3244eeed | 79 | Double_t ImpParXY() const |
460cd990 | 80 | { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());} |
3244eeed | 81 | Double_t QtProngFlightLine(Int_t ip) const |
460cd990 | 82 | { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());} |
3244eeed | 83 | Double_t QlProngFlightLine(Int_t ip) const |
460cd990 | 84 | { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());} |
3244eeed | 85 | |
86 | // prongs | |
87 | Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];} | |
ed6324e5 | 88 | void Setd0errProngs(Int_t nprongs,Double_t *d0); |
3244eeed | 89 | Double_t Normalizedd0Prong(Int_t ip) const |
90 | {return Getd0Prong(ip)/Getd0errProng(ip);} | |
91 | ||
6185d025 | 92 | void SetProngIDs(Int_t nIDs,UShort_t *id); |
93 | UShort_t GetProngID(Int_t ip) const | |
dcb444c9 | 94 | {if(fProngID) {return fProngID[ip];} else {return 9999;}} |
6185d025 | 95 | |
ac7797a7 | 96 | // ITS clustermap for daughters |
97 | Bool_t DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const; | |
98 | ||
27917274 | 99 | // check if it is like-sign |
100 | Bool_t IsLikeSign() const; | |
3244eeed | 101 | |
a9b75906 | 102 | // list of cuts |
103 | void SetListOfCutsRef(TObject *obj) {fListOfCuts=obj;} | |
104 | TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());} | |
105 | AliRDHFCuts *GetCuts(const char* name) const; | |
ec653946 | 106 | |
107 | // vertexing KF: | |
108 | AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs, | |
109 | Bool_t topoCostraint,Double_t bzkG, | |
110 | Double_t *mass) const; | |
111 | ||
15c6df42 | 112 | // misalign |
113 | void Misalign(TString misal="null"); | |
114 | ||
939850df | 115 | // selection map |
116 | void SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;} | |
117 | Bool_t HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);} | |
118 | ULong_t GetSelectionMap() const {return fSelectionMap;} | |
119 | ||
79a848cd | 120 | Int_t NumberOfFakeDaughters() const; |
121 | ||
3244eeed | 122 | protected: |
123 | ||
124 | AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate | |
460cd990 | 125 | TRef fEventPrimaryVtx; // ref to primary vertex of the event |
a9b75906 | 126 | TRef fListOfCuts; // ref to the list of analysis cuts |
6185d025 | 127 | Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm] |
128 | UShort_t *fProngID; //[fNProngs] track ID of daughters | |
939850df | 129 | ULong_t fSelectionMap; // used to store outcome of selection in AliAnalysisVertexingHF |
3244eeed | 130 | |
939850df | 131 | ClassDef(AliAODRecoDecayHF,5) // base class for AOD reconstructed heavy-flavour decays |
3244eeed | 132 | }; |
133 | ||
6185d025 | 134 | inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id) |
135 | { | |
136 | if(nIDs!=GetNProngs()) { | |
137 | printf("Wrong number of IDs, must be nProngs\n"); | |
138 | return; | |
139 | } | |
140 | if(fProngID) delete [] fProngID; | |
141 | fProngID = new UShort_t[nIDs]; | |
142 | for(Int_t i=0;i<nIDs;i++) | |
143 | fProngID[i] = id[i]; | |
144 | return; | |
145 | } | |
146 | ||
27917274 | 147 | inline Bool_t AliAODRecoDecayHF::IsLikeSign() const |
148 | { | |
149 | // check if it is like-sign | |
150 | ||
151 | Int_t ndg=GetNDaughters(); | |
152 | if(!ndg) { | |
153 | printf("Daughters not available\n"); | |
154 | return kFALSE; | |
155 | } | |
156 | Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge(); | |
157 | ||
158 | for(Int_t i=1; i<ndg; i++) { | |
159 | if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE; | |
160 | } | |
161 | ||
162 | return kTRUE; | |
163 | } | |
164 | ||
a9b75906 | 165 | inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const |
166 | { | |
167 | // returns the analysis cuts | |
168 | ||
169 | TList *list = GetListOfCuts(); | |
170 | if(!list) return 0; | |
171 | ||
172 | ||
173 | return (AliRDHFCuts*)list->FindObject(name); | |
174 | } | |
175 | ||
ac7797a7 | 176 | inline Bool_t AliAODRecoDecayHF::DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const |
177 | { | |
178 | // ITS clustermap for daughters | |
179 | ||
180 | if(l<0 || l>5) { | |
181 | printf("ERROR: layer has to be in the range 0-5\n"); | |
182 | return kFALSE; | |
183 | } | |
184 | AliAODTrack *t = (AliAODTrack*)GetDaughter(dg); | |
185 | if(!t) return kFALSE; | |
186 | ||
187 | return TESTBIT(t->GetITSClusterMap(),l); | |
188 | } | |
189 | ||
79a848cd | 190 | inline Int_t AliAODRecoDecayHF::NumberOfFakeDaughters() const |
191 | { | |
192 | // Count number of daughters with negative label | |
193 | ||
194 | Int_t nfakes=0; | |
195 | for(Int_t i=0; i<GetNDaughters(); i++) { | |
196 | AliAODTrack *track=(AliAODTrack*)GetDaughter(i); | |
197 | ||
198 | if(track->Charge()==0) { // this is a two prong decay | |
199 | AliAODRecoDecay *rd=(AliAODRecoDecay*)GetDaughter(i); | |
200 | for(Int_t j=0; j<rd->GetNDaughters(); j++) { | |
201 | AliAODTrack *track2=(AliAODTrack*)GetDaughter(j); | |
202 | if(track2->GetLabel()<0) nfakes++; | |
203 | } | |
204 | continue; | |
205 | } | |
206 | ||
207 | if(track->GetLabel()<0) nfakes++; | |
208 | } | |
209 | return nfakes; | |
210 | } | |
211 | ||
ed6324e5 | 212 | inline void AliAODRecoDecayHF::Setd0errProngs(Int_t nprongs,Double_t *d0err) |
213 | { | |
214 | if(nprongs!=GetNProngs()) { | |
215 | printf("Wrong number of momenta, must be nProngs"); | |
216 | return; | |
217 | } | |
218 | if(!fd0) { | |
219 | fd0err = new Double32_t[nprongs]; | |
220 | } | |
221 | for(Int_t i=0;i<nprongs;i++) { | |
222 | fd0err[i] = d0err[i]; | |
223 | } | |
224 | ||
225 | return; | |
226 | } | |
227 | ||
3244eeed | 228 | #endif |
27917274 | 229 |