Fix
[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
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>
6a213b59 17
a9b75906 18class TList;
c4cdf105 19class AliESDVertex;
e0732246 20class AliAODRecoDecay;
c4cdf105 21class AliAODRecoDecayHF;
22class AliAODRecoDecayHF2Prong;
23class AliAODRecoDecayHF3Prong;
24class AliAODRecoDecayHF4Prong;
25class AliAODRecoCascadeHF;
26class AliAnalysisFilter;
939850df 27class AliRDHFCuts;
f3014dc3 28class AliRDHFCutsD0toKpi;
e3d40058 29class AliRDHFCutsJpsitoee;
30class AliRDHFCutsDplustoKpipi;
31class AliRDHFCutsDstoKKpi;
32class AliRDHFCutsLctopKpi;
a07ad8e0 33class AliRDHFCutsLctoV0;
e3d40058 34class AliRDHFCutsD0toKpipipi;
da6fefc3 35class AliRDHFCutsDStartoKpipi;
dcb444c9 36class AliESDtrack;
37class AliVEvent;
38class AliAODVertex;
a07ad8e0 39class AliESDv0;
40class AliAODv0;
dcb444c9 41
6a213b59 42//-----------------------------------------------------------------------------
43class AliAnalysisVertexingHF : public TNamed {
44 public:
45 //
46 AliAnalysisVertexingHF();
13977a79 47 AliAnalysisVertexingHF(const AliAnalysisVertexingHF& source);
48 AliAnalysisVertexingHF& operator=(const AliAnalysisVertexingHF& source);
6a213b59 49 virtual ~AliAnalysisVertexingHF();
50
dcb444c9 51 void FindCandidates(AliVEvent *event,
52 TClonesArray *aodVerticesHFTClArr,
53 TClonesArray *aodD0toKpiTClArr,
54 TClonesArray *aodJPSItoEleTClArr,
55 TClonesArray *aodCharm3ProngTClArr,
2ff20727 56 TClonesArray *aodCharm4ProngTClArr,
dc963de9 57 TClonesArray *aodDstarTClArr,
a07ad8e0 58 TClonesArray *aodCascadesTClArr,
423fb9ae 59 TClonesArray *aodLikeSign2ProngTClArr,
60 TClonesArray *aodLikeSign3ProngTClArr);
dcb444c9 61
a9b75906 62 TList* FillListOfCuts();
37fc73f1 63 void FixReferences(AliAODEvent *aod);
6a213b59 64 void PrintStatus() const;
b82f6d67 65 void SetSecVtxWithKF() { fSecVtxWithKF=kTRUE; }
6a213b59 66 void SetD0toKpiOn() { fD0toKpi=kTRUE; }
67 void SetD0toKpiOff() { fD0toKpi=kFALSE; }
68 void SetJPSItoEleOn() { fJPSItoEle=kTRUE; }
69 void SetJPSItoEleOff() { fJPSItoEle=kFALSE; }
70 void Set3ProngOn() { f3Prong=kTRUE; }
71 void Set3ProngOff() { f3Prong=kFALSE; }
72 void Set4ProngOn() { f4Prong=kTRUE; }
73 void Set4ProngOff() { f4Prong=kFALSE; }
2ff20727 74 void SetDstarOn() { fDstar=kTRUE; }
75 void SetDstarOff() { fDstar=kFALSE; }
a07ad8e0 76 void SetCascadesOn() { fCascades=kTRUE; }
77 void SetCascadesOff() { fCascades=kFALSE; }
dc963de9 78 void SetLikeSignOn() { fLikeSign=kTRUE; }
1992284a 79 void SetLikeSignOff() {fLikeSign=kFALSE; fLikeSign3prong=kFALSE;}
80 void SetLikeSign3prongOn() { fLikeSign=kTRUE; fLikeSign3prong=kTRUE; }
81 void SetLikeSign3prongOff() { fLikeSign3prong=kFALSE; }
a25935a9 82 void SetMixEventOn() { fMixEvent=kTRUE; }
83 void SetMixEventOff() { fMixEvent=kFALSE; }
84 void SetInputAOD() { fInputAOD=kTRUE; }
c4cdf105 85 Bool_t GetD0toKpi() const { return fD0toKpi; }
86 Bool_t GetJPSItoEle() const { return fJPSItoEle; }
87 Bool_t Get3Prong() const { return f3Prong; }
88 Bool_t Get4Prong() const { return f4Prong; }
89 Bool_t GetDstar() const { return fDstar; }
a07ad8e0 90 Bool_t GetCascades() const { return fCascades; }
c4cdf105 91 Bool_t GetLikeSign() const { return fLikeSign; }
1992284a 92 Bool_t GetLikeSign3prong() const { return fLikeSign3prong; }
c4cdf105 93 Bool_t GetMixEvent() const { return fMixEvent; }
94 Bool_t GetInputAOD() const { return fInputAOD; }
95 Bool_t GetRecoPrimVtxSkippingTrks() const {return fRecoPrimVtxSkippingTrks;}
96 Bool_t GetRmTrksFromPrimVtx() const {return fRmTrksFromPrimVtx;}
eee95e18 97 void SetFindVertexForDstar(Bool_t vtx=kTRUE) { fFindVertexForDstar=vtx; }
a07ad8e0 98 void SetFindVertexForCascades(Bool_t vtx=kTRUE) { fFindVertexForCascades=vtx; }
6a213b59 99 void SetRecoPrimVtxSkippingTrks()
100 { fRecoPrimVtxSkippingTrks=kTRUE; fRmTrksFromPrimVtx=kFALSE;}
a25935a9 101 void UnsetRecoPrimVtxSkippingTrks()
102 { fRecoPrimVtxSkippingTrks=kFALSE; fRmTrksFromPrimVtx=kFALSE;}
6a213b59 103 void SetRmTrksFromPrimVtx()
104 {fRmTrksFromPrimVtx=kTRUE; fRecoPrimVtxSkippingTrks=kFALSE; }
f8fa4595 105 void SetTrackFilter(AliAnalysisFilter* trackF) { fTrackFilter = trackF; }
2ff20727 106 void SetTrackFilterSoftPi(AliAnalysisFilter* trackF) { fTrackFilterSoftPi = trackF; }
dc963de9 107 AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; }
108 AliAnalysisFilter* GetTrackFilterSoftPi() const { return fTrackFilterSoftPi; }
f3014dc3 109 void SetCutsD0toKpi(AliRDHFCutsD0toKpi* cuts) { fCutsD0toKpi = cuts; }
110 AliRDHFCutsD0toKpi* GetCutsD0toKpi() const { return fCutsD0toKpi; }
e3d40058 111 void SetCutsJpsitoee(AliRDHFCutsJpsitoee* cuts) { fCutsJpsitoee = cuts; }
112 AliRDHFCutsJpsitoee* GetCutsJpsitoee() const { return fCutsJpsitoee; }
113 void SetCutsDplustoKpipi(AliRDHFCutsDplustoKpipi* cuts) { fCutsDplustoKpipi = cuts; }
114 AliRDHFCutsDplustoKpipi* GetCutsDplustoKpipi() const { return fCutsDplustoKpipi; }
115 void SetCutsDstoKKpi(AliRDHFCutsDstoKKpi* cuts) { fCutsDstoKKpi = cuts; }
116 AliRDHFCutsDstoKKpi* GetCutsDstoKKpi() const { return fCutsDstoKKpi; }
117 void SetCutsLctopKpi(AliRDHFCutsLctopKpi* cuts) { fCutsLctopKpi = cuts; }
118 AliRDHFCutsLctopKpi* GetCutsLctopKpi() const { return fCutsLctopKpi; }
a07ad8e0 119 void SetCutsLctoV0(AliRDHFCutsLctoV0* cuts) { fCutsLctoV0 = cuts; }
120 AliRDHFCutsLctoV0* GetCutsLctoV0() const { return fCutsLctoV0; }
e3d40058 121 void SetCutsD0toKpipipi(AliRDHFCutsD0toKpipipi* cuts) { fCutsD0toKpipipi = cuts; }
122 AliRDHFCutsD0toKpipipi* GetCutsD0toKpipipi() const { return fCutsD0toKpipipi; }
da6fefc3 123 void SetCutsDStartoKpipi(AliRDHFCutsDStartoKpipi* cuts) { fCutsDStartoKpipi = cuts; }
124 AliRDHFCutsDStartoKpipi* GetCutsDStartoKpipi() const { return fCutsDStartoKpipi; }
e0732246 125 void SetMassCutBeforeVertexing(Bool_t flag) { fMassCutBeforeVertexing=flag; }
6ea608bf 126
6a213b59 127 //
128 private:
129 //
2ff20727 130 enum { kBitDispl = 0, kBitSoftPi = 1 };
131
dcb444c9 132 Bool_t fInputAOD; // input from AOD (kTRUE) or ESD (kFALSE)
c8ab4e4f 133 Int_t fAODMapSize; // size of fAODMap
134 Int_t *fAODMap; //[fAODMapSize] map between index and ID for AOD tracks
dcb444c9 135
b82f6d67 136 Double_t fBzkG; // z componenent of field in kG
137
138 Bool_t fSecVtxWithKF; // if kTRUE use KF vertexer, else AliVertexerTracks
139
6a213b59 140 Bool_t fRecoPrimVtxSkippingTrks; // flag for primary vertex reco on the fly
141 // for each candidate, w/o its daughters
142 Bool_t fRmTrksFromPrimVtx; // flag for fast removal of daughters from
143 // the primary vertex
144
145 AliESDVertex *fV1; // primary vertex
146
6a213b59 147 // flag to enable candidates production
2ff20727 148 Bool_t fD0toKpi; // D0->Kpi
149 Bool_t fJPSItoEle; // Jpsi->ee
150 Bool_t f3Prong; // D+,Ds,Lc
151 Bool_t f4Prong; // D0->Kpipipi
152 Bool_t fDstar; // D*->D0pi
a07ad8e0 153 Bool_t fCascades; // cascades, Lc --> v0+track
dc963de9 154 Bool_t fLikeSign; // Like-sign pairs
1992284a 155 Bool_t fLikeSign3prong; // Like-sign triplets
a25935a9 156 Bool_t fMixEvent; // event mixing
6a213b59 157
158 // single-track cuts
2ff20727 159 AliAnalysisFilter *fTrackFilter; // Track Filter for displaced vertices
160 AliAnalysisFilter *fTrackFilterSoftPi; // Track Filter for D* soft pion
6a213b59 161 // candidates cuts
f3014dc3 162 AliRDHFCutsD0toKpi *fCutsD0toKpi; // D0->Kpi cuts
e3d40058 163 AliRDHFCutsJpsitoee *fCutsJpsitoee; // J/psi->ee cuts
164 AliRDHFCutsDplustoKpipi *fCutsDplustoKpipi; // D+->Kpipi cuts
165 AliRDHFCutsDstoKKpi *fCutsDstoKKpi; // Ds->KKpi cuts
166 AliRDHFCutsLctopKpi *fCutsLctopKpi; // Lc->pKpi cuts
a07ad8e0 167 AliRDHFCutsLctoV0 *fCutsLctoV0; // Lc --> v0 + bachelor cuts
e3d40058 168 AliRDHFCutsD0toKpipipi *fCutsD0toKpipipi; // D0->Kpipipi cuts
da6fefc3 169 AliRDHFCutsDStartoKpipi *fCutsDStartoKpipi; // Dstar->D0pi cuts
f3014dc3 170
a9b75906 171 TList *fListOfCuts; // pointer to list of cuts for output file
eee95e18 172 Bool_t fFindVertexForDstar; // reconstruct a secondary vertex or assume it's from the primary vertex
a07ad8e0 173 Bool_t fFindVertexForCascades; // reconstruct a secondary vertex or assume it's from the primary vertex
e0732246 174 Bool_t fMassCutBeforeVertexing; // to go faster in PbPb
175 // dummies for invariant mass calculation
176 AliAODRecoDecay *fMassCalc2; // for 2 prong
177 AliAODRecoDecay *fMassCalc3; // for 3 prong
178 AliAODRecoDecay *fMassCalc4; // for 4 prong
5e938293 179
180 Int_t fnTrksTotal;
181 Int_t fnSeleTrksTotal;
182
6a213b59 183 //
a9b75906 184 void AddRefs(AliAODVertex *v,AliAODRecoDecayHF *rd,const AliVEvent *event,
185 const TObjArray *trkArray) const;
c4cdf105 186 void AddDaughterRefs(AliAODVertex *v,const AliVEvent *event,
187 const TObjArray *trkArray) const;
dcb444c9 188 AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliVEvent *event,
189 AliAODVertex *secVert,Double_t dcap1n1,
2ff20727 190 Bool_t &okD0,Bool_t &okJPSI,Bool_t &okD0fromDstar) const;
dcb444c9 191 AliAODRecoDecayHF3Prong* Make3Prong(TObjArray *threeTrackArray,AliVEvent *event,
192 AliAODVertex *secVert,
193 Double_t dispersion,
c4cdf105 194 const AliAODVertex *vertexp1n1,
195 const AliAODVertex *vertexp2n1,
dcb444c9 196 Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2,
197 Bool_t &ok3Prong) const;
198 AliAODRecoDecayHF4Prong* Make4Prong(TObjArray *fourTrackArray,AliVEvent *event,
721c0b8f 199 AliAODVertex *secVert,
c4cdf105 200 const AliAODVertex *vertexp1n1,
201 const AliAODVertex *vertexp1n1p2,
721c0b8f 202 Double_t dcap1n1,Double_t dcap1n2,
203 Double_t dcap2n1,Double_t dcap2n2,
204 Bool_t &ok4Prong) const;
2ff20727 205 AliAODRecoCascadeHF* MakeCascade(TObjArray *twoTrackArray,AliVEvent *event,
206 AliAODVertex *secVert,
207 AliAODRecoDecayHF2Prong *rd2Prong,
208 Double_t dca,
209 Bool_t &okDstar) const;
a07ad8e0 210 AliAODRecoCascadeHF* MakeCascade(TObjArray *twoTrackArray,AliVEvent *event,
211 AliAODVertex *secVert,
212 AliAODv0 *v0,
213 Double_t dca,
214 Bool_t &okCascades) const;
dcb444c9 215
c4cdf105 216 AliAODVertex* PrimaryVertex(const TObjArray *trkArray=0x0,AliVEvent *event=0x0) const;
dcfa35b3 217 AliAODVertex* ReconstructSecondaryVertex(TObjArray *trkArray,Double_t &dispersion,Bool_t useTRefArray=kTRUE) const;
6965b459 218 Bool_t SelectInvMassAndPt(Int_t decay,Int_t nprongs,
6a213b59 219 Double_t *px,Double_t *py,Double_t *pz) const;
6965b459 220 Bool_t SelectInvMassAndPt(TObjArray *trkArray) const;
e11ae259 221 void SelectTracksAndCopyVertex(const AliVEvent *event,Int_t trkEntries,
1992284a 222 TObjArray &seleTrksArray,
223 TObjArray &tracksAtVertex,
224 Int_t &nSeleTrks,
a25935a9 225 UChar_t *seleFlags,Int_t *evtNumber);
1992284a 226 void SetParametersAtVertex(AliESDtrack* esdt, AliExternalTrackParam* extpar) const;
227
2ff20727 228 Bool_t SingleTrkCuts(AliESDtrack *trk,Bool_t &okDisplaced,Bool_t &okSoftPi) const;
a07ad8e0 229
c20e04a0 230 void SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd,Int_t bit);
939850df 231
a07ad8e0 232 AliAODv0* TransformESDv0toAODv0(AliESDv0 *esdv0,
233 TObjArray *twoTrackArrayV0);
234
6a213b59 235 //
1992284a 236 ClassDef(AliAnalysisVertexingHF,19); // Reconstruction of HF decay candidates
6a213b59 237};
238
239
240#endif
241
242
243
244
245
246
247
248