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