1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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, IReS, Strasbourg, Jouri.Belikov@cern.ch
21 //-------------------------------------------------------------------------
24 #include <TObjArray.h>
27 #include "AliESDEvent.h"
29 #include "AliESDtrack.h"
30 #include "AliV0vertexer.h"
31 #include "AliESDVertex.h"
33 ClassImp(AliV0vertexer)
36 //A set of very loose cuts
37 Double_t AliV0vertexer::fgChi2max=33.; //max chi2
38 Double_t AliV0vertexer::fgDNmin=0.05; //min imp parameter for the 1st daughter
39 Double_t AliV0vertexer::fgDPmin=0.05; //min imp parameter for the 2nd daughter
40 Double_t AliV0vertexer::fgDCAmax=0.5; //max DCA between the daughter tracks
41 Double_t AliV0vertexer::fgCPAmin=0.99; //min cosine of V0's pointing angle
42 Double_t AliV0vertexer::fgRmin=0.2; //min radius of the fiducial volume
43 Double_t AliV0vertexer::fgRmax=100.; //max radius of the fiducial volume
45 Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
46 //--------------------------------------------------------------------
47 //This function reconstructs V0 vertices
48 //--------------------------------------------------------------------
49 const AliESDVertex *vtx=event->GetVertex();
50 Double_t xv=vtx->GetXv(), yv=vtx->GetYv(), zv=vtx->GetZv();
52 Int_t nentr=event->GetNumberOfTracks();
53 Double_t b=event->GetMagneticField();
55 if (nentr<2) return 0;
60 Int_t nneg=0, npos=0, nvtx=0;
63 for (i=0; i<nentr; i++) {
64 AliESDtrack *esdTrack=event->GetTrack(i);
65 ULong_t status=esdTrack->GetStatus();
67 if ((status&AliESDtrack::kITSrefit)==0)
68 if ((status&AliESDtrack::kTPCrefit)==0) continue;
70 Double_t d=esdTrack->GetD(xv,yv,b);
71 if (TMath::Abs(d)<fDPmin) continue;
72 if (TMath::Abs(d)>fRmax) continue;
74 if (esdTrack->GetSign() < 0.) neg[nneg++]=i;
79 for (i=0; i<nneg; i++) {
81 AliESDtrack *ntrk=event->GetTrack(nidx);
83 for (Int_t k=0; k<npos; k++) {
85 AliESDtrack *ptrk=event->GetTrack(pidx);
87 if (TMath::Abs(ntrk->GetD(xv,yv,b))<fDNmin)
88 if (TMath::Abs(ptrk->GetD(xv,yv,b))<fDNmin) continue;
90 Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
91 if (dca > fDCAmax) continue;
92 if ((xn+xp) > 2*fRmax) continue;
93 if ((xn+xp) < 2*fRmin) continue;
95 AliExternalTrackParam nt(*ntrk), pt(*ptrk);
96 Bool_t corrected=kFALSE;
97 if ((nt.GetX() > 3.) && (xn < 3.)) {
98 //correct for the beam pipe material
101 if ((pt.GetX() > 3.) && (xp < 3.)) {
102 //correct for the beam pipe material
106 dca=nt.GetDCA(&pt,b,xn,xp);
107 if (dca > fDCAmax) continue;
108 if ((xn+xp) > 2*fRmax) continue;
109 if ((xn+xp) < 2*fRmin) continue;
112 nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
114 AliESDv0 vertex(nt,nidx,pt,pidx);
115 if (vertex.GetChi2V0() > fChi2max) continue;
117 Float_t cpa=vertex.GetV0CosineOfPointingAngle(xv,yv,zv);
118 if (cpa < fCPAmin) continue;
119 vertex.SetDcaV0Daughters(dca);
120 vertex.SetV0CosineOfPointingAngle(cpa);
121 vertex.ChangeMassHypothesis(kK0Short);
123 event->AddV0(&vertex);
129 Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx);