New classes for the cuts on charm candidates
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisVertexingHF.h
CommitLineData
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
6//-------------------------------------------------------------------------
7// Class AliAnalysisVertexingHF
8// Reconstruction of heavy-flavour decay candidates
9//
2ff20727 10// Origin: E.Bruna, G.E.Bruno, A.Dainese, F.Prino, R.Romita, X.M.Zhang
a25935a9 11// Contact: andrea.dainese@pd.infn.it
6a213b59 12//-------------------------------------------------------------------------
13
14#include <TNamed.h>
6a213b59 15
c4cdf105 16class AliESDVertex;
17class AliAODRecoDecayHF;
18class AliAODRecoDecayHF2Prong;
19class AliAODRecoDecayHF3Prong;
20class AliAODRecoDecayHF4Prong;
21class AliAODRecoCascadeHF;
22class AliAnalysisFilter;
f3014dc3 23class AliRDHFCutsD0toKpi;
e3d40058 24class AliRDHFCutsJpsitoee;
25class AliRDHFCutsDplustoKpipi;
26class AliRDHFCutsDstoKKpi;
27class AliRDHFCutsLctopKpi;
28class AliRDHFCutsD0toKpipipi;
dcb444c9 29class AliESDtrack;
30class AliVEvent;
31class AliAODVertex;
32
6a213b59 33//-----------------------------------------------------------------------------
34class AliAnalysisVertexingHF : public TNamed {
35 public:
36 //
37 AliAnalysisVertexingHF();
13977a79 38 AliAnalysisVertexingHF(const AliAnalysisVertexingHF& source);
39 AliAnalysisVertexingHF& operator=(const AliAnalysisVertexingHF& source);
6a213b59 40 virtual ~AliAnalysisVertexingHF();
41
dcb444c9 42 void FindCandidates(AliVEvent *event,
43 TClonesArray *aodVerticesHFTClArr,
44 TClonesArray *aodD0toKpiTClArr,
45 TClonesArray *aodJPSItoEleTClArr,
46 TClonesArray *aodCharm3ProngTClArr,
2ff20727 47 TClonesArray *aodCharm4ProngTClArr,
dc963de9 48 TClonesArray *aodDstarTClArr,
423fb9ae 49 TClonesArray *aodLikeSign2ProngTClArr,
50 TClonesArray *aodLikeSign3ProngTClArr);
dcb444c9 51
6a213b59 52 void PrintStatus() const;
b82f6d67 53 void SetSecVtxWithKF() { fSecVtxWithKF=kTRUE; }
6a213b59 54 void SetD0toKpiOn() { fD0toKpi=kTRUE; }
55 void SetD0toKpiOff() { fD0toKpi=kFALSE; }
56 void SetJPSItoEleOn() { fJPSItoEle=kTRUE; }
57 void SetJPSItoEleOff() { fJPSItoEle=kFALSE; }
58 void Set3ProngOn() { f3Prong=kTRUE; }
59 void Set3ProngOff() { f3Prong=kFALSE; }
60 void Set4ProngOn() { f4Prong=kTRUE; }
61 void Set4ProngOff() { f4Prong=kFALSE; }
2ff20727 62 void SetDstarOn() { fDstar=kTRUE; }
63 void SetDstarOff() { fDstar=kFALSE; }
dc963de9 64 void SetLikeSignOn() { fLikeSign=kTRUE; }
65 void SetLikeSignOff() { fLikeSign=kFALSE; }
a25935a9 66 void SetMixEventOn() { fMixEvent=kTRUE; }
67 void SetMixEventOff() { fMixEvent=kFALSE; }
68 void SetInputAOD() { fInputAOD=kTRUE; }
c4cdf105 69 Bool_t GetD0toKpi() const { return fD0toKpi; }
70 Bool_t GetJPSItoEle() const { return fJPSItoEle; }
71 Bool_t Get3Prong() const { return f3Prong; }
72 Bool_t Get4Prong() const { return f4Prong; }
73 Bool_t GetDstar() const { return fDstar; }
74 Bool_t GetLikeSign() const { return fLikeSign; }
75 Bool_t GetMixEvent() const { return fMixEvent; }
76 Bool_t GetInputAOD() const { return fInputAOD; }
77 Bool_t GetRecoPrimVtxSkippingTrks() const {return fRecoPrimVtxSkippingTrks;}
78 Bool_t GetRmTrksFromPrimVtx() const {return fRmTrksFromPrimVtx;}
eee95e18 79 void SetFindVertexForDstar(Bool_t vtx=kTRUE) { fFindVertexForDstar=vtx; }
6a213b59 80 void SetRecoPrimVtxSkippingTrks()
81 { fRecoPrimVtxSkippingTrks=kTRUE; fRmTrksFromPrimVtx=kFALSE;}
a25935a9 82 void UnsetRecoPrimVtxSkippingTrks()
83 { fRecoPrimVtxSkippingTrks=kFALSE; fRmTrksFromPrimVtx=kFALSE;}
6a213b59 84 void SetRmTrksFromPrimVtx()
85 {fRmTrksFromPrimVtx=kTRUE; fRecoPrimVtxSkippingTrks=kFALSE; }
f8fa4595 86 void SetTrackFilter(AliAnalysisFilter* trackF) { fTrackFilter = trackF; }
2ff20727 87 void SetTrackFilterSoftPi(AliAnalysisFilter* trackF) { fTrackFilterSoftPi = trackF; }
dc963de9 88 AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; }
89 AliAnalysisFilter* GetTrackFilterSoftPi() const { return fTrackFilterSoftPi; }
f3014dc3 90 void SetCutsD0toKpi(AliRDHFCutsD0toKpi* cuts) { fCutsD0toKpi = cuts; }
91 AliRDHFCutsD0toKpi* GetCutsD0toKpi() const { return fCutsD0toKpi; }
e3d40058 92 void SetCutsJpsitoee(AliRDHFCutsJpsitoee* cuts) { fCutsJpsitoee = cuts; }
93 AliRDHFCutsJpsitoee* GetCutsJpsitoee() const { return fCutsJpsitoee; }
94 void SetCutsDplustoKpipi(AliRDHFCutsDplustoKpipi* cuts) { fCutsDplustoKpipi = cuts; }
95 AliRDHFCutsDplustoKpipi* GetCutsDplustoKpipi() const { return fCutsDplustoKpipi; }
96 void SetCutsDstoKKpi(AliRDHFCutsDstoKKpi* cuts) { fCutsDstoKKpi = cuts; }
97 AliRDHFCutsDstoKKpi* GetCutsDstoKKpi() const { return fCutsDstoKKpi; }
98 void SetCutsLctopKpi(AliRDHFCutsLctopKpi* cuts) { fCutsLctopKpi = cuts; }
99 AliRDHFCutsLctopKpi* GetCutsLctopKpi() const { return fCutsLctopKpi; }
100 void SetCutsD0toKpipipi(AliRDHFCutsD0toKpipipi* cuts) { fCutsD0toKpipipi = cuts; }
101 AliRDHFCutsD0toKpipipi* GetCutsD0toKpipipi() const { return fCutsD0toKpipipi; }
102 void SetCutsD0fromDstar(AliRDHFCutsD0toKpi* cuts) { fCutsD0fromDstar = cuts; }
103 AliRDHFCutsD0toKpi* GetCutsD0fromDstar() const { return fCutsD0fromDstar; }
6a213b59 104 void SetD0toKpiCuts(Double_t cut0=1000.,Double_t cut1=100000.,
105 Double_t cut2=1.1,Double_t cut3=0.,Double_t cut4=0.,
106 Double_t cut5=100000.,Double_t cut6=100000.,
107 Double_t cut7=100000000.,Double_t cut8=-1.1);
108 void SetD0toKpiCuts(const Double_t cuts[9]);
2ff20727 109 void SetD0fromDstarCuts(Double_t cut0=1000.,Double_t cut1=100000.,
110 Double_t cut2=1.1,Double_t cut3=0.,Double_t cut4=0.,
111 Double_t cut5=100000.,Double_t cut6=100000.,
112 Double_t cut7=100000000.,Double_t cut8=-1.1);
113 void SetD0fromDstarCuts(const Double_t cuts[9]);
6a213b59 114 void SetBtoJPSICuts(Double_t cut0=1000.,Double_t cut1=100000.,
115 Double_t cut2=1.1,Double_t cut3=0.,Double_t cut4=0.,
116 Double_t cut5=100000.,Double_t cut6=100000.,
117 Double_t cut7=100000000.,Double_t cut8=-1.1);
118 void SetBtoJPSICuts(const Double_t cuts[9]);
119 void SetDplusCuts(Double_t cut0=1000.,Double_t cut1=0.,
120 Double_t cut2=0.,Double_t cut3=0.,Double_t cut4=0.,
121 Double_t cut5=0.,Double_t cut6=10000000000.,
122 Double_t cut7=0.,Double_t cut8=0.,
123 Double_t cut9=-1.1,Double_t cut10=0.,
81679460 124 Double_t cut11=10000000000.);
6a213b59 125 void SetDplusCuts(const Double_t cuts[12]);
6ea608bf 126 void SetDsCuts(Double_t cut0=1000.,Double_t cut1=0.,
f7c170b4 127 Double_t cut2=0.,Double_t cut3=0.,Double_t cut4=0.,
128 Double_t cut5=0.,Double_t cut6=10000000000.,
129 Double_t cut7=0.,Double_t cut8=0.,
130 Double_t cut9=-1.1,Double_t cut10=0.,
131 Double_t cut11=10000000000., Double_t cut12=1000.,
132 Double_t cut13=1000.);
133 void SetDsCuts(const Double_t cuts[14]);
6ea608bf 134 void SetLcCuts(Double_t cut0=1000.,Double_t cut1=0.,
135 Double_t cut2=0.,Double_t cut3=0.,Double_t cut4=0.,
136 Double_t cut5=0.,Double_t cut6=10000000000.,
137 Double_t cut7=0.,Double_t cut8=0.,
138 Double_t cut9=-1.1,Double_t cut10=0.,
81679460 139 Double_t cut11=10000000000.);
6ea608bf 140 void SetLcCuts(const Double_t cuts[12]);
2ff20727 141 void SetDstarCuts(Double_t cut0=1000., Double_t cut1=1000.,
142 Double_t cut2=-1., Double_t cut3=1000.,
143 Double_t cut4=1.6);
144 void SetDstarCuts(const Double_t cuts[5]);
721c0b8f 145 void SetD0to4ProngsCuts(Double_t cut0=1000.,Double_t cut1=100000.,
146 Double_t cut2=0.,Double_t cut3=0.,Double_t cut4=0.,
147 Double_t cut5=-1.1,Double_t cut6=0.,
148 Double_t cut7=0.,Double_t cut8=0.);
149 void SetD0to4ProngsCuts(const Double_t cuts[9]);
dc963de9 150 const Double_t *GetD0toKpiCuts() const {return fD0toKpiCuts;}
151 const Double_t *GetD0fromDstarCuts() const {return fD0fromDstarCuts;}
152 const Double_t *GetBtoJPSICuts() const {return fBtoJPSICuts;}
153 const Double_t *GetDplusCuts() const {return fDplusCuts;}
154 const Double_t *GetDsCuts() const {return fDsCuts;}
155 const Double_t *GetLcCuts() const {return fLcCuts;}
156 const Double_t *GetDstarCuts() const {return fDstarCuts;}
721c0b8f 157 const Double_t *GetD0to4ProngsCuts() const {return fD0to4ProngsCuts;}
6ea608bf 158
6a213b59 159 //
160 private:
161 //
2ff20727 162 enum { kBitDispl = 0, kBitSoftPi = 1 };
163
dcb444c9 164 Bool_t fInputAOD; // input from AOD (kTRUE) or ESD (kFALSE)
c8ab4e4f 165 Int_t fAODMapSize; // size of fAODMap
166 Int_t *fAODMap; //[fAODMapSize] map between index and ID for AOD tracks
dcb444c9 167
b82f6d67 168 Double_t fBzkG; // z componenent of field in kG
169
170 Bool_t fSecVtxWithKF; // if kTRUE use KF vertexer, else AliVertexerTracks
171
6a213b59 172 Bool_t fRecoPrimVtxSkippingTrks; // flag for primary vertex reco on the fly
173 // for each candidate, w/o its daughters
174 Bool_t fRmTrksFromPrimVtx; // flag for fast removal of daughters from
175 // the primary vertex
176
177 AliESDVertex *fV1; // primary vertex
178
6a213b59 179 // flag to enable candidates production
2ff20727 180 Bool_t fD0toKpi; // D0->Kpi
181 Bool_t fJPSItoEle; // Jpsi->ee
182 Bool_t f3Prong; // D+,Ds,Lc
183 Bool_t f4Prong; // D0->Kpipipi
184 Bool_t fDstar; // D*->D0pi
dc963de9 185 Bool_t fLikeSign; // Like-sign pairs
a25935a9 186 Bool_t fMixEvent; // event mixing
6a213b59 187
188 // single-track cuts
2ff20727 189 AliAnalysisFilter *fTrackFilter; // Track Filter for displaced vertices
190 AliAnalysisFilter *fTrackFilterSoftPi; // Track Filter for D* soft pion
6a213b59 191 // candidates cuts
f3014dc3 192 AliRDHFCutsD0toKpi *fCutsD0toKpi; // D0->Kpi cuts
e3d40058 193 AliRDHFCutsJpsitoee *fCutsJpsitoee; // J/psi->ee cuts
194 AliRDHFCutsDplustoKpipi *fCutsDplustoKpipi; // D+->Kpipi cuts
195 AliRDHFCutsDstoKKpi *fCutsDstoKKpi; // Ds->KKpi cuts
196 AliRDHFCutsLctopKpi *fCutsLctopKpi; // Lc->pKpi cuts
197 AliRDHFCutsD0toKpipipi *fCutsD0toKpipipi; // D0->Kpipipi cuts
198 AliRDHFCutsD0toKpi *fCutsD0fromDstar; // D0 from Dstar cuts
f3014dc3 199
6a213b59 200 Double_t fD0toKpiCuts[9]; // cuts on D0->Kpi candidates
201 // (to be passed to AliAODRecoDecayHF2Prong::SelectD0())
202 // 0 = inv. mass half width [GeV]
203 // 1 = dca [cm]
204 // 2 = cosThetaStar
205 // 3 = pTK [GeV/c]
206 // 4 = pTPi [GeV/c]
207 // 5 = d0K [cm] upper limit!
208 // 6 = d0Pi [cm] upper limit!
209 // 7 = d0d0 [cm^2]
210 // 8 = cosThetaPoint
2ff20727 211 Double_t fD0fromDstarCuts[9]; // cuts on D0->Kpi candidates from D*
212 // (to be passed to AliAODRecoCascadeHF::SelectDstar())
213 // 0 = inv. mass half width [GeV]
214 // 1 = dca [cm]
215 // 2 = cosThetaStar
216 // 3 = pTK [GeV/c]
217 // 4 = pTPi [GeV/c]
218 // 5 = d0K [cm] upper limit!
219 // 6 = d0Pi [cm] upper limit!
220 // 7 = d0d0 [cm^2]
221 // 8 = cosThetaPoint
6a213b59 222 Double_t fBtoJPSICuts[9]; // cuts on JPSI candidates
223 // (to be passed to AliAODRecoDecayHF2Prong::SelectBtoJPSI())
224 // 0 = inv. mass half width [GeV]
225 // 1 = dca [cm]
226 // 2 = cosThetaStar (negative electron)
227 // 3 = pTP [GeV/c]
228 // 4 = pTN [GeV/c]
229 // 5 = d0O [cm] upper limit!
230 // 6 = d0N [cm] upper limit!
231 // 7 = d0d0 [cm^2]
232 // 8 = cosThetaPoint
233 Double_t fDplusCuts[12]; // cuts on Dplus candidates
6ea608bf 234 // (to be passed to AliAODRecoDecayHF3Prong::SelectDplus())
6a213b59 235 // 0 = inv. mass half width [GeV]
236 // 1 = pTK [GeV/c]
237 // 2 = pTPi [GeV/c]
238 // 3 = d0K [cm] lower limit!
239 // 4 = d0Pi [cm] lower limit!
240 // 5 = dist12 (cm)
241 // 6 = sigmavert (cm)
242 // 7 = dist prim-sec (cm)
243 // 8 = pM=Max{pT1,pT2,pT3} (GeV/c)
244 // 9 = cosThetaPoint
245 // 10 = Sum d0^2 (cm^2)
246 // 11 = dca cut (cm)
f7c170b4 247 Double_t fDsCuts[14]; // cuts on Ds candidates
6ea608bf 248 // (to be passed to AliAODRecoDecayHF3Prong::SelectDs())
249 // 0 = inv. mass half width [GeV]
250 // 1 = pTK [GeV/c]
251 // 2 = pTPi [GeV/c]
252 // 3 = d0K [cm] lower limit!
253 // 4 = d0Pi [cm] lower limit!
254 // 5 = dist12 (cm)
255 // 6 = sigmavert (cm)
256 // 7 = dist prim-sec (cm)
257 // 8 = pM=Max{pT1,pT2,pT3} (GeV/c)
258 // 9 = cosThetaPoint
259 // 10 = Sum d0^2 (cm^2)
260 // 11 = dca cut (cm)
f7c170b4 261 // 12 = inv. mass cut around phi
262 // 13 = inv. mass cut around phi K0* [GeV]
81679460 263 Double_t fLcCuts[12]; // cuts on Lambdac candidates
6ea608bf 264 // (to be passed to AliAODRecoDecayHF3Prong::SelectLc())
265 // 0 = inv. mass half width [GeV]
266 // 1 = pTP [GeV/c]
267 // 2 = pTPi abd pTK [GeV/c]
268 // 3 = d0P [cm] lower limit!
269 // 4 = d0Pi and d0K [cm] lower limit!
270 // 5 = dist12 (cm)
271 // 6 = sigmavert (cm)
272 // 7 = dist prim-sec (cm)
273 // 8 = pM=Max{pT1,pT2,pT3} (GeV/c)
274 // 9 = cosThetaPoint
275 // 10 = Sum d0^2 (cm^2)
276 // 11 = dca cut (cm)
2ff20727 277 Double_t fDstarCuts[5]; // cuts on D* candidates
278 // (to be passed to AliAODRecoCascadeHF::SelectDstar())
279 // 0 = inv. mass half width of D* [GeV]
280 // 1 = half width of (M_Kpipi-M_Kpi) [GeV]
281 // 2 = PtMin of pi_s [GeV/c]
282 // 3 = PtMax of pi_s [GeV/c]
283 // 4 = theta, angle between the track of pi_s and D0 decay plane [rad]
284
721c0b8f 285 Double_t fD0to4ProngsCuts[9]; // cuts on D0->K3pi candidates
286 // (to be passed to AliAODRecoDecayHF4Prong::SelectD0())
287 // 0 = inv. mass half width of D0 [GeV]
288 // 1 = DCA between opposite sign tracks
289 // 2 = Distance between primary and two tracks vertex fDist12toPrim
290 // 3 = Distance between primary and three tracks vertex fDist3toPrim
291 // 4 = Distance between primary and two tracks vertex fDist4toPrim
292 // 5 = Cosinus of the pointing angle
293 // 6 = Transverse momentum of the D0 candidate
294 // 7 = Mass Pi+Pi- = mass of the rho0
295 // 8 = PID cut (one K in the quadruplet)
296
eee95e18 297 Bool_t fFindVertexForDstar; // reconstruct a secondary vertex or assume it's from the primary vertex
6a213b59 298 //
c4cdf105 299 void AddDaughterRefs(AliAODVertex *v,const AliVEvent *event,
300 const TObjArray *trkArray) const;
dcb444c9 301 AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliVEvent *event,
302 AliAODVertex *secVert,Double_t dcap1n1,
2ff20727 303 Bool_t &okD0,Bool_t &okJPSI,Bool_t &okD0fromDstar) const;
dcb444c9 304 AliAODRecoDecayHF3Prong* Make3Prong(TObjArray *threeTrackArray,AliVEvent *event,
305 AliAODVertex *secVert,
306 Double_t dispersion,
c4cdf105 307 const AliAODVertex *vertexp1n1,
308 const AliAODVertex *vertexp2n1,
dcb444c9 309 Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2,
310 Bool_t &ok3Prong) const;
311 AliAODRecoDecayHF4Prong* Make4Prong(TObjArray *fourTrackArray,AliVEvent *event,
721c0b8f 312 AliAODVertex *secVert,
c4cdf105 313 const AliAODVertex *vertexp1n1,
314 const AliAODVertex *vertexp1n1p2,
721c0b8f 315 Double_t dcap1n1,Double_t dcap1n2,
316 Double_t dcap2n1,Double_t dcap2n2,
317 Bool_t &ok4Prong) const;
2ff20727 318 AliAODRecoCascadeHF* MakeCascade(TObjArray *twoTrackArray,AliVEvent *event,
319 AliAODVertex *secVert,
320 AliAODRecoDecayHF2Prong *rd2Prong,
321 Double_t dca,
322 Bool_t &okDstar) const;
dcb444c9 323
c4cdf105 324 AliAODVertex* PrimaryVertex(const TObjArray *trkArray=0x0,AliVEvent *event=0x0) const;
dcfa35b3 325 AliAODVertex* ReconstructSecondaryVertex(TObjArray *trkArray,Double_t &dispersion,Bool_t useTRefArray=kTRUE) const;
6a213b59 326 Bool_t SelectInvMass(Int_t decay,Int_t nprongs,
327 Double_t *px,Double_t *py,Double_t *pz) const;
c4cdf105 328 void SelectTracksAndCopyVertex(const AliVEvent *event,
2ff20727 329 TObjArray &seleTrksArray,Int_t &nSeleTrks,
a25935a9 330 UChar_t *seleFlags,Int_t *evtNumber);
2ff20727 331 Bool_t SingleTrkCuts(AliESDtrack *trk,Bool_t &okDisplaced,Bool_t &okSoftPi) const;
6a213b59 332 //
e3d40058 333 ClassDef(AliAnalysisVertexingHF,15); // Reconstruction of HF decay candidates
6a213b59 334};
335
336
337#endif
338
339
340
341
342
343
344
345