update for INEL>0 analysis
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF.h
CommitLineData
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
6//***********************************************************
7// Class AliAODRecoDecayHF
8// base class for AOD reconstructed heavy-flavour decays
9// Author: A.Dainese, andrea.dainese@lnl.infn.it
10//***********************************************************
11
460cd990 12#include <TRef.h>
a9b75906 13#include <TList.h>
3244eeed 14#include "AliAODRecoDecay.h"
15
a9b75906 16class AliRDHFCuts;
ec653946 17class AliKFParticle;
18
3244eeed 19class AliAODRecoDecayHF : public AliAODRecoDecay {
20
21 public:
22
23 AliAODRecoDecayHF();
24 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
25 Double_t *px,Double_t *py,Double_t *pz,
26 Double_t *d0,Double_t *d0err);
27 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
28 Double_t *d0,Double_t *d0err);
b39168f9 29 AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
30 Int_t nprongs,Short_t charge,
31 Double_t *px,Double_t *py,Double_t *pz,Double_t *d0);
3244eeed 32 virtual ~AliAODRecoDecayHF();
33
34 AliAODRecoDecayHF(const AliAODRecoDecayHF& source);
35 AliAODRecoDecayHF& operator=(const AliAODRecoDecayHF& source);
36
37
38 // primary vertex
460cd990 39 void SetPrimaryVtxRef(TObject *vtx) { fEventPrimaryVtx = vtx; }
40 AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); }
41 void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);}
3244eeed 42 void CheckOwnPrimaryVtx() const
43 {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;}
44 AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;}
45 void GetOwnPrimaryVtx(Double_t vtx[3]) const
46 {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);}
0a65d33f 47 void UnsetOwnPrimaryVtx() {if(fOwnPrimaryVtx) {delete fOwnPrimaryVtx; fOwnPrimaryVtx=0;} return;}
460cd990 48 AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
3244eeed 49
50 // kinematics & topology
51 Double_t DecayLength() const
460cd990 52 { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());}
3244eeed 53 Double_t DecayLengthError() const
460cd990 54 { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());}
3244eeed 55 Double_t NormalizedDecayLength() const
460cd990 56 { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());}
3244eeed 57 Double_t DecayLengthXY() const
460cd990 58 { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());}
3244eeed 59 Double_t DecayLengthXYError() const
460cd990 60 { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());}
3244eeed 61 Double_t NormalizedDecayLengthXY() const
460cd990 62 { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());}
3244eeed 63 Double_t Ct(UInt_t pdg) const
460cd990 64 { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());}
3244eeed 65 Double_t CosPointingAngle() const
460cd990 66 { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());}
3244eeed 67 Double_t CosPointingAngleXY() const
460cd990 68 { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());}
3244eeed 69 Double_t ImpParXY() const
460cd990 70 { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());}
3244eeed 71 Double_t QtProngFlightLine(Int_t ip) const
460cd990 72 { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 73 Double_t QlProngFlightLine(Int_t ip) const
460cd990 74 { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 75
76 // prongs
77 Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];}
78 Double_t Normalizedd0Prong(Int_t ip) const
79 {return Getd0Prong(ip)/Getd0errProng(ip);}
80
6185d025 81 void SetProngIDs(Int_t nIDs,UShort_t *id);
82 UShort_t GetProngID(Int_t ip) const
dcb444c9 83 {if(fProngID) {return fProngID[ip];} else {return 9999;}}
6185d025 84
27917274 85 // check if it is like-sign
86 Bool_t IsLikeSign() const;
3244eeed 87
a9b75906 88 // list of cuts
89 void SetListOfCutsRef(TObject *obj) {fListOfCuts=obj;}
90 TList *GetListOfCuts() const {return (TList*)(fListOfCuts.GetObject());}
91 AliRDHFCuts *GetCuts(const char* name) const;
ec653946 92
93 // vertexing KF:
94 AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
95 Bool_t topoCostraint,Double_t bzkG,
96 Double_t *mass) const;
97
3244eeed 98 protected:
99
100 AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate
460cd990 101 TRef fEventPrimaryVtx; // ref to primary vertex of the event
a9b75906 102 TRef fListOfCuts; // ref to the list of analysis cuts
6185d025 103 Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
104 UShort_t *fProngID; //[fNProngs] track ID of daughters
3244eeed 105
a9b75906 106 ClassDef(AliAODRecoDecayHF,4) // base class for AOD reconstructed heavy-flavour decays
3244eeed 107};
108
6185d025 109inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id)
110{
111 if(nIDs!=GetNProngs()) {
112 printf("Wrong number of IDs, must be nProngs\n");
113 return;
114 }
115 if(fProngID) delete [] fProngID;
116 fProngID = new UShort_t[nIDs];
117 for(Int_t i=0;i<nIDs;i++)
118 fProngID[i] = id[i];
119 return;
120}
121
27917274 122inline Bool_t AliAODRecoDecayHF::IsLikeSign() const
123{
124 // check if it is like-sign
125
126 Int_t ndg=GetNDaughters();
127 if(!ndg) {
128 printf("Daughters not available\n");
129 return kFALSE;
130 }
131 Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
132
133 for(Int_t i=1; i<ndg; i++) {
134 if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
135 }
136
137 return kTRUE;
138}
139
a9b75906 140inline AliRDHFCuts *AliAODRecoDecayHF::GetCuts(const char* name) const
141{
142 // returns the analysis cuts
143
144 TList *list = GetListOfCuts();
145 if(!list) return 0;
146
147
148 return (AliRDHFCuts*)list->FindObject(name);
149}
150
3244eeed 151#endif
27917274 152