AliPhysics  1168478 (1168478)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include <TRef.h>
14 #include <TList.h>
15 #include "AliAODTrack.h"
16 #include "AliAODRecoDecay.h"
17 
18 class AliAODEvent;
19 class AliRDHFCuts;
20 class AliKFParticle;
21 
22 class AliAODRecoDecayHF : public AliAODRecoDecay {
23 
24  public:
25 
27  AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
28  Double_t *px,Double_t *py,Double_t *pz,
29  Double_t *d0,Double_t *d0err);
30  AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
31  Double_t *d0,Double_t *d0err);
32  AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
33  Int_t nprongs,Short_t charge,
34  Double_t *px,Double_t *py,Double_t *pz,Double_t *d0);
35  virtual ~AliAODRecoDecayHF();
36 
37  AliAODRecoDecayHF(const AliAODRecoDecayHF& source);
39 
40 
43  AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); }
44  void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);}
45  void CheckOwnPrimaryVtx() const
46  {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;}
47  AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;}
48  void GetOwnPrimaryVtx(Double_t vtx[3]) const
49  {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);}
51  void UnsetOwnSecondaryVtx() {if(fOwnSecondaryVtx) {delete fOwnSecondaryVtx; fOwnSecondaryVtx=0;} return;}
52  AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
53  AliAODVertex* RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod);
54  void RecalculateImpPars(AliAODVertex *vtxAODNew,AliAODEvent *aod);
55 
56  void SetIsFilled(Int_t filled){fIsFilled=filled;}
57  Int_t GetIsFilled() const {return fIsFilled;}
58  virtual void DeleteRecoD();
59 
62  { return AliAODRecoDecay::DecayLength2(GetPrimaryVtx());}
64  { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());}
66  { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());}
68  { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());}
70  { return AliAODRecoDecay::NormalizedDecayLength2(GetPrimaryVtx());}
72  { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());}
74  { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());}
76  { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());}
78  { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());}
80  { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());}
82  { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());}
83  Double_t ImpParXY() const
84  { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());}
86  { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());}
88  { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());}
89 
91  Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];}
92  void Setd0errProngs(Int_t nprongs,Double_t *d0);
94  {return Getd0Prong(ip)/Getd0errProng(ip);}
95  void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t& d0diff, Double_t& errd0diff) const;
96 
97  void SetNProngs();
98  void SetProngIDs(Int_t nIDs,UShort_t *id);
100  {if(fProngID) {return fProngID[ip];} else {return 9999;}}
101 
104 
106  Bool_t IsLikeSign() const;
107 
110  TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());}
111  AliRDHFCuts *GetCuts(const char* name) const;
112 
114  AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
115  Bool_t topoCostraint,Double_t bzkG,
116  Double_t *mass) const;
117 
119  void Misalign(TString misal="null");
120 
122  void SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;}
123  Bool_t HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);}
125 
127 
128  Bool_t HasBadDaughters() const;
129 
130 
131  protected:
132 
133  AliAODVertex *fOwnPrimaryVtx;
135  TRef fListOfCuts;
138  Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
140  UShort_t *fProngID; //[fNProngsHF] track ID of daughters
142  Int_t fIsFilled; // 0 if standard refiltering; 1 if data members of candidates are empty, 2 if data members are refilled in analysis task
143 
145  ClassDef(AliAODRecoDecayHF,7) // base class for AOD reconstructed heavy-flavour decays
147 };
148 
149 
151 if(!GetNProngs())fNProngs=fNProngsHF;
152 }
154 {
155  if(nIDs!=GetNProngs()) {
156  printf("Wrong number of IDs, must be nProngs\n");
157  return;
158  }
159  if(fProngID) delete [] fProngID;
160  fProngID = new UShort_t[nIDs];
161  for(Int_t i=0;i<nIDs;i++)
162  fProngID[i] = id[i];
163  return;
164 }
165 
167 {
169 
170  Int_t ndg=GetNDaughters();
171  if(!ndg) {
172  printf("Daughters not available\n");
173  return kFALSE;
174  }
175  Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
176 
177  for(Int_t i=1; i<ndg; i++) {
178  if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
179  }
180 
181  return kTRUE;
182 }
183 
184 inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const
185 {
187 
188  TList *list = GetListOfCuts();
189  if(!list) return 0;
190 
191 
192  return (AliRDHFCuts*)list->FindObject(name);
193 }
194 
196 {
198 
199  if(l<0 || l>5) {
200  printf("ERROR: layer has to be in the range 0-5\n");
201  return kFALSE;
202  }
203  AliAODTrack *t = (AliAODTrack*)GetDaughter(dg);
204  if(!t) return kFALSE;
205 
206  return TESTBIT(t->GetITSClusterMap(),l);
207 }
208 
210 {
212 
213  Int_t nfakes=0;
214  for(Int_t i=0; i<GetNDaughters(); i++) {
215  AliAODTrack *track=(AliAODTrack*)GetDaughter(i);
216 
217  if(track->Charge()==0) { // this is a two prong decay
218  AliAODRecoDecay *rd=(AliAODRecoDecay*)GetDaughter(i);
219  for(Int_t j=0; j<rd->GetNDaughters(); j++) {
220  AliAODTrack *track2=(AliAODTrack*)GetDaughter(j);
221  if(track2->GetLabel()<0) nfakes++;
222  }
223  continue;
224  }
225 
226  if(track->GetLabel()<0) nfakes++;
227  }
228  return nfakes;
229 }
230 
232 {
233  if(nprongs!=GetNProngs()) {
234  printf("Wrong number of d0 err values, must be nProngs\n");
235  return;
236  }
237  if(!fd0err) {
238  fd0err = new Double32_t[nprongs];
239  }
240  for(Int_t i=0;i<nprongs;i++) {
241  fd0err[i] = d0err[i];
242  }
243 
244  return;
245 }
246 
248 
250 
251  for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
252  if (GetDaughter(iDau)==NULL) continue;
253  AliAODTrack* at=dynamic_cast<AliAODTrack*>(GetDaughter(iDau));
254  if (!at) continue;
255  if(at->Charge()==0) continue;
256  if(at->GetTPCNcls()==0) continue;
257  if(!(at->TestFilterMask(BIT(4)))) return kTRUE;
258  }
259  return kFALSE;
260 }
261 
262 
263 #endif
264 
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
double Double_t
Definition: External.C:58
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
Int_t fIsFilled
used to store outcome of selection in AliAnalysisVertexingHF
TList * list
TDirectory file where lists per trigger are stored in train ouput.
Double_t CosPointingAngleXY() const
virtual void DeleteRecoD()
ULong_t GetSelectionMap() const
AliAODVertex * GetPrimaryVtxRef() const
void RecalculateImpPars(AliAODVertex *vtxAODNew, AliAODEvent *aod)
Bool_t HasBadDaughters() const
void GetOwnPrimaryVtx(Double_t vtx[3]) const
int Int_t
Definition: External.C:63
AliRDHFCuts * GetCuts(const char *name) const
unsigned int UInt_t
Definition: External.C:33
Int_t GetIsFilled() 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
unsigned long ULong_t
Definition: External.C:38
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.
short Short_t
Definition: External.C:23
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)
Int_t fNProngsHF
ref to the list of analysis cuts
TRef fListOfCuts
ref to primary vertex of the event
Double_t DecayLengthError() const
Int_t NumberOfFakeDaughters() const
Double_t QlProngFlightLine(Int_t ip) const
unsigned short UShort_t
Definition: External.C:28
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:
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Double_t DecayLengthXYError() const
Double_t DecayLength() const
Bool_t IsLikeSign() const
check if it is like-sign
void SetIsFilled(Int_t filled)