AliPhysics  c7b8e89 (c7b8e89)
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 SetNProngsHF(Int_t nprongsHF);
99  void SetProngIDs(Int_t nIDs,UShort_t *id);
101  {if(fProngID) {return fProngID[ip];} else {return 9999;}}
102 
105 
107  Bool_t IsLikeSign() const;
108 
111  TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());}
112  AliRDHFCuts *GetCuts(const char* name) const;
113 
115  AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
116  Bool_t topoCostraint,Double_t bzkG,
117  Double_t *mass) const;
118 
120  void Misalign(TString misal="null");
121 
123  void SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;}
124  Bool_t HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);}
126 
128 
129  Bool_t HasBadDaughters() const;
130 
131 
132  protected:
133 
134  AliAODVertex *fOwnPrimaryVtx;
136  TRef fListOfCuts;
139  Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
141  UShort_t *fProngID; //[fNProngsHF] track ID of daughters
143  Int_t fIsFilled; // 0 if standard refiltering; 1 if data members of candidates are empty, 2 if data members are refilled in analysis task
144 
146  ClassDef(AliAODRecoDecayHF,7) // base class for AOD reconstructed heavy-flavour decays
148 };
149 
150 
152 if(!GetNProngs())fNProngs=fNProngsHF;
153 }
154 inline void AliAODRecoDecayHF::SetNProngsHF(Int_t nprongsHF){
155  if(GetNProngs() && nprongsHF!=GetNProngs()){
156  printf("Cannot set nprongsHF for a candidate with a value already set \n ");
157  return;
158  }
159  fNProngsHF=nprongsHF;
160 }
162 {
163  if(nIDs!=GetNProngs()) {
164  printf("Wrong number of IDs, must be nProngs\n");
165  return;
166  }
167  if(fProngID) delete [] fProngID;
168  fProngID = new UShort_t[nIDs];
169  for(Int_t i=0;i<nIDs;i++)
170  fProngID[i] = id[i];
171  return;
172 }
173 
175 {
177 
178  Int_t ndg=GetNDaughters();
179  if(!ndg) {
180  printf("Daughters not available\n");
181  return kFALSE;
182  }
183  Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
184 
185  for(Int_t i=1; i<ndg; i++) {
186  if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
187  }
188 
189  return kTRUE;
190 }
191 
192 inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const
193 {
195 
196  TList *list = GetListOfCuts();
197  if(!list) return 0;
198 
199 
200  return (AliRDHFCuts*)list->FindObject(name);
201 }
202 
204 {
206 
207  if(l<0 || l>5) {
208  printf("ERROR: layer has to be in the range 0-5\n");
209  return kFALSE;
210  }
211  AliAODTrack *t = (AliAODTrack*)GetDaughter(dg);
212  if(!t) return kFALSE;
213 
214  return TESTBIT(t->GetITSClusterMap(),l);
215 }
216 
218 {
220 
221  Int_t nfakes=0;
222  for(Int_t i=0; i<GetNDaughters(); i++) {
223  AliAODTrack *track=(AliAODTrack*)GetDaughter(i);
224 
225  if(track->Charge()==0) { // this is a two prong decay
226  AliAODRecoDecay *rd=(AliAODRecoDecay*)GetDaughter(i);
227  for(Int_t j=0; j<rd->GetNDaughters(); j++) {
228  AliAODTrack *track2=(AliAODTrack*)GetDaughter(j);
229  if(track2->GetLabel()<0) nfakes++;
230  }
231  continue;
232  }
233 
234  if(track->GetLabel()<0) nfakes++;
235  }
236  return nfakes;
237 }
238 
240 {
241  if(nprongs!=GetNProngs()) {
242  printf("Wrong number of d0 err values, must be nProngs\n");
243  return;
244  }
245  if(!fd0err) {
246  fd0err = new Double32_t[nprongs];
247  }
248  for(Int_t i=0;i<nprongs;i++) {
249  fd0err[i] = d0err[i];
250  }
251 
252  return;
253 }
254 
256 
258 
259  for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
260  if (GetDaughter(iDau)==NULL) continue;
261  AliAODTrack* at=dynamic_cast<AliAODTrack*>(GetDaughter(iDau));
262  if (!at) continue;
263  if(at->Charge()==0) continue;
264  if(at->GetTPCNcls()==0) continue;
265  if(!(at->TestFilterMask(BIT(4)))) return kTRUE;
266  }
267  return kFALSE;
268 }
269 
270 
271 #endif
272 
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
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
void SetNProngsHF(Int_t nprongsHF)
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)