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