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