]>
Commit | Line | Data |
---|---|---|
c4cdf105 | 1 | #ifndef ALIANALYSISVERTEXINGHF_H |
2 | #define ALIANALYSISVERTEXINGHF_H | |
6a213b59 | 3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
27de2dfb | 6 | /* $Id$ */ |
7 | ||
6a213b59 | 8 | //------------------------------------------------------------------------- |
9 | // Class AliAnalysisVertexingHF | |
10 | // Reconstruction of heavy-flavour decay candidates | |
11 | // | |
2ff20727 | 12 | // Origin: E.Bruna, G.E.Bruno, A.Dainese, F.Prino, R.Romita, X.M.Zhang |
a25935a9 | 13 | // Contact: andrea.dainese@pd.infn.it |
6a213b59 | 14 | //------------------------------------------------------------------------- |
15 | ||
16 | #include <TNamed.h> | |
19ccb888 | 17 | #include <TList.h> |
18 | ||
19 | #include "AliAnalysisFilter.h" | |
20 | #include "AliESDtrackCuts.h" | |
6a213b59 | 21 | |
c4cdf105 | 22 | class AliESDVertex; |
e0732246 | 23 | class AliAODRecoDecay; |
c4cdf105 | 24 | class AliAODRecoDecayHF; |
25 | class AliAODRecoDecayHF2Prong; | |
26 | class AliAODRecoDecayHF3Prong; | |
27 | class AliAODRecoDecayHF4Prong; | |
28 | class AliAODRecoCascadeHF; | |
29 | class AliAnalysisFilter; | |
939850df | 30 | class AliRDHFCuts; |
f3014dc3 | 31 | class AliRDHFCutsD0toKpi; |
e3d40058 | 32 | class AliRDHFCutsJpsitoee; |
33 | class AliRDHFCutsDplustoKpipi; | |
34 | class AliRDHFCutsDstoKKpi; | |
35 | class AliRDHFCutsLctopKpi; | |
a07ad8e0 | 36 | class AliRDHFCutsLctoV0; |
e3d40058 | 37 | class AliRDHFCutsD0toKpipipi; |
da6fefc3 | 38 | class AliRDHFCutsDStartoKpipi; |
dcb444c9 | 39 | class AliESDtrack; |
40 | class AliVEvent; | |
41 | class AliAODVertex; | |
c7d3975b | 42 | class AliVertexerTracks; |
a07ad8e0 | 43 | class AliESDv0; |
44 | class AliAODv0; | |
dcb444c9 | 45 | |
6a213b59 | 46 | //----------------------------------------------------------------------------- |
47 | class AliAnalysisVertexingHF : public TNamed { | |
48 | public: | |
49 | // | |
50 | AliAnalysisVertexingHF(); | |
13977a79 | 51 | AliAnalysisVertexingHF(const AliAnalysisVertexingHF& source); |
52 | AliAnalysisVertexingHF& operator=(const AliAnalysisVertexingHF& source); | |
6a213b59 | 53 | virtual ~AliAnalysisVertexingHF(); |
54 | ||
dcb444c9 | 55 | void FindCandidates(AliVEvent *event, |
56 | TClonesArray *aodVerticesHFTClArr, | |
57 | TClonesArray *aodD0toKpiTClArr, | |
58 | TClonesArray *aodJPSItoEleTClArr, | |
59 | TClonesArray *aodCharm3ProngTClArr, | |
2ff20727 | 60 | TClonesArray *aodCharm4ProngTClArr, |
dc963de9 | 61 | TClonesArray *aodDstarTClArr, |
a07ad8e0 | 62 | TClonesArray *aodCascadesTClArr, |
423fb9ae | 63 | TClonesArray *aodLikeSign2ProngTClArr, |
64 | TClonesArray *aodLikeSign3ProngTClArr); | |
dcb444c9 | 65 | |
a9b75906 | 66 | TList* FillListOfCuts(); |
37fc73f1 | 67 | void FixReferences(AliAODEvent *aod); |
6a213b59 | 68 | void PrintStatus() const; |
b82f6d67 | 69 | void SetSecVtxWithKF() { fSecVtxWithKF=kTRUE; } |
6a213b59 | 70 | void SetD0toKpiOn() { fD0toKpi=kTRUE; } |
71 | void SetD0toKpiOff() { fD0toKpi=kFALSE; } | |
72 | void SetJPSItoEleOn() { fJPSItoEle=kTRUE; } | |
73 | void SetJPSItoEleOff() { fJPSItoEle=kFALSE; } | |
74 | void Set3ProngOn() { f3Prong=kTRUE; } | |
75 | void Set3ProngOff() { f3Prong=kFALSE; } | |
76 | void Set4ProngOn() { f4Prong=kTRUE; } | |
77 | void Set4ProngOff() { f4Prong=kFALSE; } | |
2ff20727 | 78 | void SetDstarOn() { fDstar=kTRUE; } |
79 | void SetDstarOff() { fDstar=kFALSE; } | |
a07ad8e0 | 80 | void SetCascadesOn() { fCascades=kTRUE; } |
81 | void SetCascadesOff() { fCascades=kFALSE; } | |
dc963de9 | 82 | void SetLikeSignOn() { fLikeSign=kTRUE; } |
1992284a | 83 | void SetLikeSignOff() {fLikeSign=kFALSE; fLikeSign3prong=kFALSE;} |
84 | void SetLikeSign3prongOn() { fLikeSign=kTRUE; fLikeSign3prong=kTRUE; } | |
85 | void SetLikeSign3prongOff() { fLikeSign3prong=kFALSE; } | |
a25935a9 | 86 | void SetMixEventOn() { fMixEvent=kTRUE; } |
87 | void SetMixEventOff() { fMixEvent=kFALSE; } | |
88 | void SetInputAOD() { fInputAOD=kTRUE; } | |
c4cdf105 | 89 | Bool_t GetD0toKpi() const { return fD0toKpi; } |
90 | Bool_t GetJPSItoEle() const { return fJPSItoEle; } | |
91 | Bool_t Get3Prong() const { return f3Prong; } | |
92 | Bool_t Get4Prong() const { return f4Prong; } | |
93 | Bool_t GetDstar() const { return fDstar; } | |
a07ad8e0 | 94 | Bool_t GetCascades() const { return fCascades; } |
c4cdf105 | 95 | Bool_t GetLikeSign() const { return fLikeSign; } |
1992284a | 96 | Bool_t GetLikeSign3prong() const { return fLikeSign3prong; } |
c4cdf105 | 97 | Bool_t GetMixEvent() const { return fMixEvent; } |
98 | Bool_t GetInputAOD() const { return fInputAOD; } | |
99 | Bool_t GetRecoPrimVtxSkippingTrks() const {return fRecoPrimVtxSkippingTrks;} | |
100 | Bool_t GetRmTrksFromPrimVtx() const {return fRmTrksFromPrimVtx;} | |
eee95e18 | 101 | void SetFindVertexForDstar(Bool_t vtx=kTRUE) { fFindVertexForDstar=vtx; } |
a07ad8e0 | 102 | void SetFindVertexForCascades(Bool_t vtx=kTRUE) { fFindVertexForCascades=vtx; } |
6a213b59 | 103 | void SetRecoPrimVtxSkippingTrks() |
104 | { fRecoPrimVtxSkippingTrks=kTRUE; fRmTrksFromPrimVtx=kFALSE;} | |
a25935a9 | 105 | void UnsetRecoPrimVtxSkippingTrks() |
106 | { fRecoPrimVtxSkippingTrks=kFALSE; fRmTrksFromPrimVtx=kFALSE;} | |
6a213b59 | 107 | void SetRmTrksFromPrimVtx() |
108 | {fRmTrksFromPrimVtx=kTRUE; fRecoPrimVtxSkippingTrks=kFALSE; } | |
19ccb888 | 109 | void SetTrackFilter(AliAnalysisFilter* trackF) { |
110 | // switch off the TOF selection that cannot be applied with AODTracks | |
111 | TList *l = (TList*)trackF->GetCuts(); | |
112 | AliESDtrackCuts *tcuts = (AliESDtrackCuts*)l->FindObject("AliESDtrackCuts"); | |
113 | if(tcuts->GetFlagCutTOFdistance()) tcuts->SetFlagCutTOFdistance(kFALSE); | |
114 | fTrackFilter = trackF; | |
115 | } | |
c7d3975b | 116 | void SetTrackFilter2prongPbCentral(Float_t maxPercentile, AliAnalysisFilter* trackF) { |
117 | // switch off the TOF selection that cannot be applied with AODTracks | |
118 | TList *l = (TList*)trackF->GetCuts(); | |
119 | AliESDtrackCuts *tcuts = (AliESDtrackCuts*)l->FindObject("AliESDtrackCuts"); | |
120 | if(tcuts->GetFlagCutTOFdistance()) tcuts->SetFlagCutTOFdistance(kFALSE); | |
121 | fTrackFilter2prongCentral = trackF; | |
122 | fMaxCentPercentileForTightCuts=maxPercentile; | |
123 | } | |
124 | void SetTrackFilter3prongPbCentral(Float_t maxPercentile, AliAnalysisFilter* trackF) { | |
125 | // switch off the TOF selection that cannot be applied with AODTracks | |
126 | TList *l = (TList*)trackF->GetCuts(); | |
127 | AliESDtrackCuts *tcuts = (AliESDtrackCuts*)l->FindObject("AliESDtrackCuts"); | |
128 | if(tcuts->GetFlagCutTOFdistance()) tcuts->SetFlagCutTOFdistance(kFALSE); | |
129 | fTrackFilter3prongCentral = trackF; | |
130 | fMaxCentPercentileForTightCuts=maxPercentile; | |
131 | } | |
19ccb888 | 132 | void SetTrackFilterSoftPi(AliAnalysisFilter* trackF) { |
133 | // switch off the TOF selection that cannot be applied with AODTracks | |
134 | TList *l = (TList*)trackF->GetCuts(); | |
135 | AliESDtrackCuts *tcuts = (AliESDtrackCuts*)l->FindObject("AliESDtrackCuts"); | |
136 | if(tcuts->GetFlagCutTOFdistance()) tcuts->SetFlagCutTOFdistance(kFALSE); | |
137 | fTrackFilterSoftPi = trackF; | |
138 | } | |
dc963de9 | 139 | AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; } |
140 | AliAnalysisFilter* GetTrackFilterSoftPi() const { return fTrackFilterSoftPi; } | |
f3014dc3 | 141 | void SetCutsD0toKpi(AliRDHFCutsD0toKpi* cuts) { fCutsD0toKpi = cuts; } |
142 | AliRDHFCutsD0toKpi* GetCutsD0toKpi() const { return fCutsD0toKpi; } | |
e3d40058 | 143 | void SetCutsJpsitoee(AliRDHFCutsJpsitoee* cuts) { fCutsJpsitoee = cuts; } |
144 | AliRDHFCutsJpsitoee* GetCutsJpsitoee() const { return fCutsJpsitoee; } | |
145 | void SetCutsDplustoKpipi(AliRDHFCutsDplustoKpipi* cuts) { fCutsDplustoKpipi = cuts; } | |
146 | AliRDHFCutsDplustoKpipi* GetCutsDplustoKpipi() const { return fCutsDplustoKpipi; } | |
147 | void SetCutsDstoKKpi(AliRDHFCutsDstoKKpi* cuts) { fCutsDstoKKpi = cuts; } | |
148 | AliRDHFCutsDstoKKpi* GetCutsDstoKKpi() const { return fCutsDstoKKpi; } | |
149 | void SetCutsLctopKpi(AliRDHFCutsLctopKpi* cuts) { fCutsLctopKpi = cuts; } | |
150 | AliRDHFCutsLctopKpi* GetCutsLctopKpi() const { return fCutsLctopKpi; } | |
a07ad8e0 | 151 | void SetCutsLctoV0(AliRDHFCutsLctoV0* cuts) { fCutsLctoV0 = cuts; } |
152 | AliRDHFCutsLctoV0* GetCutsLctoV0() const { return fCutsLctoV0; } | |
e3d40058 | 153 | void SetCutsD0toKpipipi(AliRDHFCutsD0toKpipipi* cuts) { fCutsD0toKpipipi = cuts; } |
154 | AliRDHFCutsD0toKpipipi* GetCutsD0toKpipipi() const { return fCutsD0toKpipipi; } | |
da6fefc3 | 155 | void SetCutsDStartoKpipi(AliRDHFCutsDStartoKpipi* cuts) { fCutsDStartoKpipi = cuts; } |
156 | AliRDHFCutsDStartoKpipi* GetCutsDStartoKpipi() const { return fCutsDStartoKpipi; } | |
e0732246 | 157 | void SetMassCutBeforeVertexing(Bool_t flag) { fMassCutBeforeVertexing=flag; } |
6ea608bf | 158 | |
c7d3975b | 159 | void SetMasses(); |
160 | ||
6a213b59 | 161 | // |
162 | private: | |
163 | // | |
c7d3975b | 164 | enum { kBitDispl = 0, kBitSoftPi = 1, kBit3Prong = 2 }; |
2ff20727 | 165 | |
dcb444c9 | 166 | Bool_t fInputAOD; // input from AOD (kTRUE) or ESD (kFALSE) |
c8ab4e4f | 167 | Int_t fAODMapSize; // size of fAODMap |
168 | Int_t *fAODMap; //[fAODMapSize] map between index and ID for AOD tracks | |
dcb444c9 | 169 | |
c7d3975b | 170 | AliVertexerTracks* fVertexerTracks; // vertexer, to compute secondary vertices |
b82f6d67 | 171 | Double_t fBzkG; // z componenent of field in kG |
172 | ||
173 | Bool_t fSecVtxWithKF; // if kTRUE use KF vertexer, else AliVertexerTracks | |
174 | ||
6a213b59 | 175 | Bool_t fRecoPrimVtxSkippingTrks; // flag for primary vertex reco on the fly |
176 | // for each candidate, w/o its daughters | |
177 | Bool_t fRmTrksFromPrimVtx; // flag for fast removal of daughters from | |
178 | // the primary vertex | |
179 | ||
180 | AliESDVertex *fV1; // primary vertex | |
181 | ||
6a213b59 | 182 | // flag to enable candidates production |
2ff20727 | 183 | Bool_t fD0toKpi; // D0->Kpi |
184 | Bool_t fJPSItoEle; // Jpsi->ee | |
185 | Bool_t f3Prong; // D+,Ds,Lc | |
186 | Bool_t f4Prong; // D0->Kpipipi | |
187 | Bool_t fDstar; // D*->D0pi | |
a07ad8e0 | 188 | Bool_t fCascades; // cascades, Lc --> v0+track |
dc963de9 | 189 | Bool_t fLikeSign; // Like-sign pairs |
1992284a | 190 | Bool_t fLikeSign3prong; // Like-sign triplets |
a25935a9 | 191 | Bool_t fMixEvent; // event mixing |
6a213b59 | 192 | |
c7d3975b | 193 | Float_t fMaxCentPercentileForTightCuts; //max. centrality percentile for using tight cuts |
194 | ||
6a213b59 | 195 | // single-track cuts |
2ff20727 | 196 | AliAnalysisFilter *fTrackFilter; // Track Filter for displaced vertices |
c7d3975b | 197 | AliAnalysisFilter *fTrackFilter2prongCentral; // Track Filter for displaced vertices in PbPb central events (tighter cuts) for 2 prong (D0->Kpi) |
198 | AliAnalysisFilter *fTrackFilter3prongCentral; // Track Filter for displaced vertices in PbPb central events (tighter cuts) for 3 prong (D+, Ds, Lc) | |
2ff20727 | 199 | AliAnalysisFilter *fTrackFilterSoftPi; // Track Filter for D* soft pion |
6a213b59 | 200 | // candidates cuts |
f3014dc3 | 201 | AliRDHFCutsD0toKpi *fCutsD0toKpi; // D0->Kpi cuts |
e3d40058 | 202 | AliRDHFCutsJpsitoee *fCutsJpsitoee; // J/psi->ee cuts |
203 | AliRDHFCutsDplustoKpipi *fCutsDplustoKpipi; // D+->Kpipi cuts | |
204 | AliRDHFCutsDstoKKpi *fCutsDstoKKpi; // Ds->KKpi cuts | |
205 | AliRDHFCutsLctopKpi *fCutsLctopKpi; // Lc->pKpi cuts | |
a07ad8e0 | 206 | AliRDHFCutsLctoV0 *fCutsLctoV0; // Lc --> v0 + bachelor cuts |
e3d40058 | 207 | AliRDHFCutsD0toKpipipi *fCutsD0toKpipipi; // D0->Kpipipi cuts |
da6fefc3 | 208 | AliRDHFCutsDStartoKpipi *fCutsDStartoKpipi; // Dstar->D0pi cuts |
f3014dc3 | 209 | |
a9b75906 | 210 | TList *fListOfCuts; // pointer to list of cuts for output file |
eee95e18 | 211 | Bool_t fFindVertexForDstar; // reconstruct a secondary vertex or assume it's from the primary vertex |
a07ad8e0 | 212 | Bool_t fFindVertexForCascades; // reconstruct a secondary vertex or assume it's from the primary vertex |
e0732246 | 213 | Bool_t fMassCutBeforeVertexing; // to go faster in PbPb |
214 | // dummies for invariant mass calculation | |
215 | AliAODRecoDecay *fMassCalc2; // for 2 prong | |
216 | AliAODRecoDecay *fMassCalc3; // for 3 prong | |
217 | AliAODRecoDecay *fMassCalc4; // for 4 prong | |
c7d3975b | 218 | Bool_t fOKInvMassD0; // pair fullfilling D0 inv mass selection |
219 | Bool_t fOKInvMassJpsi; // pair fullfilling Jpsi inv mass selection | |
220 | Bool_t fOKInvMassDplus; // triplet fullfilling D+ inv mass selection | |
221 | Bool_t fOKInvMassDs; // triplet fullfilling Ds inv mass selection | |
222 | Bool_t fOKInvMassLc; // triplet fullfilling Lc inv mass selection | |
223 | Bool_t fOKInvMassDstar; // combination fullfilling D* inv mass selection | |
224 | Bool_t fOKInvMassD0to4p; // 4tracks fullfilling D0 inv mass selection | |
225 | Bool_t fOKInvMassLctoV0; // triplet fullfilling Lc inv mass selection | |
5e938293 | 226 | |
227 | Int_t fnTrksTotal; | |
228 | Int_t fnSeleTrksTotal; | |
229 | ||
c7d3975b | 230 | Double_t fMassDzero; |
231 | Double_t fMassDplus; | |
232 | Double_t fMassDs; | |
233 | Double_t fMassLambdaC; | |
234 | Double_t fMassDstar; | |
235 | Double_t fMassJpsi; | |
236 | ||
237 | ||
6a213b59 | 238 | // |
a9b75906 | 239 | void AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd,const AliVEvent *event, |
240 | const TObjArray *trkArray) const; | |
c4cdf105 | 241 | void AddDaughterRefs(AliAODVertex *v,const AliVEvent *event, |
242 | const TObjArray *trkArray) const; | |
dcb444c9 | 243 | AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliVEvent *event, |
244 | AliAODVertex *secVert,Double_t dcap1n1, | |
c7d3975b | 245 | Bool_t &okD0,Bool_t &okJPSI,Bool_t &okD0fromDstar); |
dcb444c9 | 246 | AliAODRecoDecayHF3Prong* Make3Prong(TObjArray *threeTrackArray,AliVEvent *event, |
247 | AliAODVertex *secVert, | |
248 | Double_t dispersion, | |
c4cdf105 | 249 | const AliAODVertex *vertexp1n1, |
250 | const AliAODVertex *vertexp2n1, | |
dcb444c9 | 251 | Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2, |
c7d3975b | 252 | Bool_t &ok3Prong); |
dcb444c9 | 253 | AliAODRecoDecayHF4Prong* Make4Prong(TObjArray *fourTrackArray,AliVEvent *event, |
721c0b8f | 254 | AliAODVertex *secVert, |
c4cdf105 | 255 | const AliAODVertex *vertexp1n1, |
256 | const AliAODVertex *vertexp1n1p2, | |
721c0b8f | 257 | Double_t dcap1n1,Double_t dcap1n2, |
258 | Double_t dcap2n1,Double_t dcap2n2, | |
c7d3975b | 259 | Bool_t &ok4Prong); |
2ff20727 | 260 | AliAODRecoCascadeHF* MakeCascade(TObjArray *twoTrackArray,AliVEvent *event, |
261 | AliAODVertex *secVert, | |
262 | AliAODRecoDecayHF2Prong *rd2Prong, | |
263 | Double_t dca, | |
c7d3975b | 264 | Bool_t &okDstar); |
a07ad8e0 | 265 | AliAODRecoCascadeHF* MakeCascade(TObjArray *twoTrackArray,AliVEvent *event, |
266 | AliAODVertex *secVert, | |
267 | AliAODv0 *v0, | |
268 | Double_t dca, | |
c7d3975b | 269 | Bool_t &okCascades); |
dcb444c9 | 270 | |
c4cdf105 | 271 | AliAODVertex* PrimaryVertex(const TObjArray *trkArray=0x0,AliVEvent *event=0x0) const; |
dcfa35b3 | 272 | AliAODVertex* ReconstructSecondaryVertex(TObjArray *trkArray,Double_t &dispersion,Bool_t useTRefArray=kTRUE) const; |
c7d3975b | 273 | |
274 | Bool_t SelectInvMassAndPt3prong(Double_t *px,Double_t *py,Double_t *pz); | |
275 | Bool_t SelectInvMassAndPt4prong(Double_t *px,Double_t *py,Double_t *pz); | |
276 | Bool_t SelectInvMassAndPtD0Kpi(Double_t *px,Double_t *py,Double_t *pz); | |
277 | Bool_t SelectInvMassAndPtJpsiee(Double_t *px,Double_t *py,Double_t *pz); | |
278 | Bool_t SelectInvMassAndPtDstarD0pi(Double_t *px,Double_t *py,Double_t *pz); | |
279 | Bool_t SelectInvMassAndPtCascade(Double_t *px,Double_t *py,Double_t *pz); | |
280 | ||
281 | Bool_t SelectInvMassAndPt3prong(TObjArray *trkArray); | |
282 | Bool_t SelectInvMassAndPt4prong(TObjArray *trkArray); | |
283 | Bool_t SelectInvMassAndPtDstarD0pi(TObjArray *trkArray); | |
284 | ||
e11ae259 | 285 | void SelectTracksAndCopyVertex(const AliVEvent *event,Int_t trkEntries, |
1992284a | 286 | TObjArray &seleTrksArray, |
287 | TObjArray &tracksAtVertex, | |
288 | Int_t &nSeleTrks, | |
a25935a9 | 289 | UChar_t *seleFlags,Int_t *evtNumber); |
c3379416 | 290 | void SetParametersAtVertex(AliESDtrack* esdt, const AliExternalTrackParam* extpar) const; |
1992284a | 291 | |
c7d3975b | 292 | Bool_t SingleTrkCuts(AliESDtrack *trk,Float_t centralityperc, Bool_t &okDisplaced,Bool_t &okSoftPi, Bool_t &ok3prong) const; |
a07ad8e0 | 293 | |
c20e04a0 | 294 | void SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd,Int_t bit); |
939850df | 295 | |
a07ad8e0 | 296 | AliAODv0* TransformESDv0toAODv0(AliESDv0 *esdv0, |
297 | TObjArray *twoTrackArrayV0); | |
298 | ||
6a213b59 | 299 | // |
c7d3975b | 300 | ClassDef(AliAnalysisVertexingHF,20); // Reconstruction of HF decay candidates |
6a213b59 | 301 | }; |
302 | ||
303 | ||
304 | #endif | |
305 | ||
306 | ||
307 | ||
308 | ||
309 | ||
310 | ||
311 | ||
312 |