]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/STRANGENESS/Cascades/lightvertexers/AliLightV0vertexer.cxx
Lightweight cascade checks -> code implementation 2
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Cascades / lightvertexers / AliLightV0vertexer.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //-------------------------------------------------------------------------
17 //               Implementation of the V0 vertexer class
18 //                  reads tracks writes out V0 vertices
19 //                      fills the ESD with the V0s
20 //     Origin: Iouri Belikov, IPHC, Strasbourg, Jouri.Belikov@cern.ch
21 //-------------------------------------------------------------------------
22 //                Adapted for more customizability and
23 //                   lightweight operation in Pb-Pb
24 //
25 //          This is still being tested! Use at your own risk!
26 //-------------------------------------------------------------------------
27
28 #include "AliESDEvent.h"
29 #include "AliESDv0.h"
30 #include "AliLightV0vertexer.h"
31
32 ClassImp(AliLightV0vertexer)
33
34
35 //A set of very loose cuts
36 Double_t AliLightV0vertexer::fgChi2max=33.; //max chi2
37 Double_t AliLightV0vertexer::fgDNmin=0.05;  //min imp parameter for the 1st daughter
38 Double_t AliLightV0vertexer::fgDPmin=0.05;  //min imp parameter for the 2nd daughter
39 Double_t AliLightV0vertexer::fgDCAmax=1.5;  //max DCA between the daughter tracks
40 Double_t AliLightV0vertexer::fgCPAmin=0.9;  //min cosine of V0's pointing angle
41 Double_t AliLightV0vertexer::fgRmin=0.2;    //min radius of the fiducial volume
42 Double_t AliLightV0vertexer::fgRmax=200.;   //max radius of the fiducial volume
43
44 Double_t AliLightV0vertexer::fgMaxEta=0.8;        //max |eta|
45 Double_t AliLightV0vertexer::fgMinClusters=70;   //min clusters (>=)
46
47 Int_t AliLightV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
48     //--------------------------------------------------------------------
49     //This function reconstructs V0 vertices
50     //--------------------------------------------------------------------
51     
52     const AliESDVertex *vtxT3D=event->GetPrimaryVertex();
53     
54     Double_t xPrimaryVertex=vtxT3D->GetX();
55     Double_t yPrimaryVertex=vtxT3D->GetY();
56     Double_t zPrimaryVertex=vtxT3D->GetZ();
57     
58     Int_t nentr=event->GetNumberOfTracks();
59     Double_t b=event->GetMagneticField();
60     
61     if (nentr<2) return 0;
62     
63     TArrayI neg(nentr);
64     TArrayI pos(nentr);
65     
66     Int_t nneg=0, npos=0, nvtx=0;
67     
68     Int_t i;
69     for (i=0; i<nentr; i++) {
70         AliESDtrack *esdTrack=event->GetTrack(i);
71         ULong_t status=esdTrack->GetStatus();
72         
73         //if ((status&AliESDtrack::kITSrefit)==0)//not to accept the ITS SA tracks
74         if ((status&AliESDtrack::kTPCrefit)==0) continue;
75         
76         //Track pre-selection: clusters
77         if (esdTrack->GetTPCNcls() < fMinClusters ) continue;
78         
79         Double_t d=esdTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
80         if (TMath::Abs(d)<fDPmin) continue;
81         if (TMath::Abs(d)>fRmax) continue;
82         
83         if (esdTrack->GetSign() < 0.) neg[nneg++]=i;
84         else pos[npos++]=i;
85     }
86     
87     
88     for (i=0; i<nneg; i++) {
89         Int_t nidx=neg[i];
90         AliESDtrack *ntrk=event->GetTrack(nidx);
91         
92         for (Int_t k=0; k<npos; k++) {
93             Int_t pidx=pos[k];
94             AliESDtrack *ptrk=event->GetTrack(pidx);
95             
96             //Track pre-selection: clusters
97             if (ptrk->GetTPCNcls() < fMinClusters ) continue;
98             
99             if (TMath::Abs(ntrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin)
100                 if (TMath::Abs(ptrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin) continue;
101             
102             Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
103             if (dca > fDCAmax) continue;
104             if ((xn+xp) > 2*fRmax) continue;
105             if ((xn+xp) < 2*fRmin) continue;
106             
107             AliExternalTrackParam nt(*ntrk), pt(*ptrk);
108             Bool_t corrected=kFALSE;
109             if ((nt.GetX() > 3.) && (xn < 3.)) {
110                 //correct for the beam pipe material
111                 corrected=kTRUE;
112             }
113             if ((pt.GetX() > 3.) && (xp < 3.)) {
114                 //correct for the beam pipe material
115                 corrected=kTRUE;
116             }
117             if (corrected) {
118                 dca=nt.GetDCA(&pt,b,xn,xp);
119                 if (dca > fDCAmax) continue;
120                 if ((xn+xp) > 2*fRmax) continue;
121                 if ((xn+xp) < 2*fRmin) continue;
122             }
123             
124             nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
125             
126             //select maximum eta range (after propagation)
127             if (TMath::Abs(nt.Eta())>fMaxEta) continue;
128             if (TMath::Abs(pt.Eta())>fMaxEta) continue;
129             
130             AliESDv0 vertex(nt,nidx,pt,pidx);
131             if (vertex.GetChi2V0() > fChi2max) continue;
132             
133             Double_t x=vertex.Xv(), y=vertex.Yv();
134             Double_t r2=x*x + y*y;
135             if (r2 < fRmin*fRmin) continue;
136             if (r2 > fRmax*fRmax) continue;
137             
138             Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
139             
140             //Simple cosine cut (no pt dependence for now)
141             if (cpa < fCPAmin) continue;
142             
143             vertex.SetDcaV0Daughters(dca);
144             vertex.SetV0CosineOfPointingAngle(cpa);
145             vertex.ChangeMassHypothesis(kK0Short);
146             
147             event->AddV0(&vertex);
148             
149             nvtx++;
150         }
151     }
152     
153     Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx);
154     
155     return nvtx;
156 }
157
158
159
160
161
162
163
164
165
166
167
168
169
170