AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAODRecoDecayHF.h
Go to the documentation of this file.
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 
6 /* $Id$ */
7 
13 
14 #include <TRef.h>
15 #include <TList.h>
16 #include "AliAODTrack.h"
17 #include "AliAODRecoDecay.h"
18 
19 class AliAODEvent;
20 class AliRDHFCuts;
21 class AliKFParticle;
22 
23 class AliAODRecoDecayHF : public AliAODRecoDecay {
24 
25  public:
26 
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);
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);
36  virtual ~AliAODRecoDecayHF();
37 
38  AliAODRecoDecayHF(const AliAODRecoDecayHF& source);
40 
41 
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);}
52  AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
53  AliAODVertex* RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod);
54  void RecalculateImpPars(AliAODVertex *vtxAODNew,AliAODEvent *aod);
55 
56 
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 
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  void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t& d0diff, Double_t& errd0diff) const;
93 
94 
95  void SetProngIDs(Int_t nIDs,UShort_t *id);
96  UShort_t GetProngID(Int_t ip) const
97  {if(fProngID) {return fProngID[ip];} else {return 9999;}}
98 
100  Bool_t DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const;
101 
103  Bool_t IsLikeSign() const;
104 
106  void SetListOfCutsRef(TObject *obj) {fListOfCuts=obj;}
107  TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());}
108  AliRDHFCuts *GetCuts(const char* name) const;
109 
111  AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
112  Bool_t topoCostraint,Double_t bzkG,
113  Double_t *mass) const;
114 
116  void Misalign(TString misal="null");
117 
119  void SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;}
120  Bool_t HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);}
121  ULong_t GetSelectionMap() const {return fSelectionMap;}
122 
123  Int_t NumberOfFakeDaughters() const;
124 
125  Bool_t HasBadDaughters() const;
126 
127  protected:
128 
129  AliAODVertex *fOwnPrimaryVtx;
131  TRef fListOfCuts;
132  Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
135  UShort_t *fProngID; //[fNProngs] track ID of daughters
136  ULong_t fSelectionMap;
137 
139  ClassDef(AliAODRecoDecayHF,5);
140 };
142 
143 inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id)
144 {
145  if(nIDs!=GetNProngs()) {
146  printf("Wrong number of IDs, must be nProngs\n");
147  return;
148  }
149  if(fProngID) delete [] fProngID;
150  fProngID = new UShort_t[nIDs];
151  for(Int_t i=0;i<nIDs;i++)
152  fProngID[i] = id[i];
153  return;
154 }
155 
156 inline Bool_t AliAODRecoDecayHF::IsLikeSign() const
157 {
159 
160  Int_t ndg=GetNDaughters();
161  if(!ndg) {
162  printf("Daughters not available\n");
163  return kFALSE;
164  }
165  Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
166 
167  for(Int_t i=1; i<ndg; i++) {
168  if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
169  }
170 
171  return kTRUE;
172 }
173 
174 inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const
175 {
177 
178  TList *list = GetListOfCuts();
179  if(!list) return 0;
180 
181 
182  return (AliRDHFCuts*)list->FindObject(name);
183 }
184 
185 inline Bool_t AliAODRecoDecayHF::DaughterHasPointOnITSLayer(Int_t dg,Int_t l) const
186 {
188 
189  if(l<0 || l>5) {
190  printf("ERROR: layer has to be in the range 0-5\n");
191  return kFALSE;
192  }
193  AliAODTrack *t = (AliAODTrack*)GetDaughter(dg);
194  if(!t) return kFALSE;
195 
196  return TESTBIT(t->GetITSClusterMap(),l);
197 }
198 
200 {
202 
203  Int_t nfakes=0;
204  for(Int_t i=0; i<GetNDaughters(); i++) {
205  AliAODTrack *track=(AliAODTrack*)GetDaughter(i);
206 
207  if(track->Charge()==0) { // this is a two prong decay
208  AliAODRecoDecay *rd=(AliAODRecoDecay*)GetDaughter(i);
209  for(Int_t j=0; j<rd->GetNDaughters(); j++) {
210  AliAODTrack *track2=(AliAODTrack*)GetDaughter(j);
211  if(track2->GetLabel()<0) nfakes++;
212  }
213  continue;
214  }
215 
216  if(track->GetLabel()<0) nfakes++;
217  }
218  return nfakes;
219 }
220 
221 inline void AliAODRecoDecayHF::Setd0errProngs(Int_t nprongs,Double_t *d0err)
222 {
223  if(nprongs!=GetNProngs()) {
224  printf("Wrong number of momenta, must be nProngs");
225  return;
226  }
227  if(!fd0) {
228  fd0err = new Double32_t[nprongs];
229  }
230  for(Int_t i=0;i<nprongs;i++) {
231  fd0err[i] = d0err[i];
232  }
233 
234  return;
235 }
236 
237 inline Bool_t AliAODRecoDecayHF::HasBadDaughters() const {
238 
240 
241  for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
242  if (GetDaughter(iDau)==NULL) continue;
243  AliAODTrack* at=dynamic_cast<AliAODTrack*>(GetDaughter(iDau));
244  if (!at) continue;
245  if(at->Charge()==0) continue;
246  if(at->GetTPCNcls()==0) continue;
247  if(!(at->TestFilterMask(BIT(4)))) return kTRUE;
248  }
249  return kFALSE;
250 }
251 
252 
253 #endif
254 
Int_t charge
Double_t * fd0err
error on prongs rphi impact param [cm]
Double_t NormalizedDecayLengthXY() const
Int_t pdg
Double_t NormalizedDecayLength() const
AliAODRecoDecayHF & operator=(const AliAODRecoDecayHF &source)
void SetSelectionBit(Int_t i)
selection map
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
Bool_t HasSelectionBit(Int_t i) const
Double_t Ct(UInt_t pdg) const
TList * GetListOfCuts() const
AliAODVertex * fOwnPrimaryVtx
TPC+ITS tracks not passing the StandardCuts2010 with loose DCA.
Double_t mass
Double_t NormalizedDecayLength2() const
Double_t ImpParXY() const
TList * list
Double_t CosPointingAngleXY() const
ULong_t GetSelectionMap() const
AliAODVertex * GetPrimaryVtxRef() const
void RecalculateImpPars(AliAODVertex *vtxAODNew, AliAODEvent *aod)
Bool_t HasBadDaughters() const
void GetOwnPrimaryVtx(Double_t vtx[3]) const
AliRDHFCuts * GetCuts(const char *name) const
void SetListOfCutsRef(TObject *obj)
list of cuts
AliAODVertex * GetOwnPrimaryVtx() const
void SetProngIDs(Int_t nIDs, UShort_t *id)
Double_t Getd0errProng(Int_t ip) const
prongs
UShort_t GetProngID(Int_t ip) const
UShort_t * fProngID
track ID of daughters
AliAODVertex * RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod)
Double_t DecayLength2() const
kinematics & topology
void SetPrimaryVtxRef(TObject *vtx)
primary vertex
void Misalign(TString misal="null")
misalign
Bool_t DaughterHasPointOnITSLayer(Int_t dg, Int_t l) const
ITS clustermap for daughters.
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t DecayLengthXY() const
TRef fEventPrimaryVtx
primary vertex for this candidate
Double_t Normalizedd0Prong(Int_t ip) const
void Setd0errProngs(Int_t nprongs, Double_t *d0)
TRef fListOfCuts
ref to primary vertex of the event
Double_t DecayLengthError() const
Int_t NumberOfFakeDaughters() const
Double_t QlProngFlightLine(Int_t ip) const
void CheckOwnPrimaryVtx() const
AliAODVertex * GetPrimaryVtx() const
Double_t QtProngFlightLine(Int_t ip) const
AliKFParticle * ApplyVertexingKF(Int_t *iprongs, Int_t nprongs, Int_t *pdgs, Bool_t topoCostraint, Double_t bzkG, Double_t *mass) const
vertexing KF:
Double_t CosPointingAngle() const
Double_t DecayLengthXYError() const
Double_t DecayLength() const
Bool_t IsLikeSign() const
check if it is like-sign