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>
29 #include "AliESDtrack.h"
30 #include "AliV0vertexer.h"
32 ClassImp(AliV0vertexer)
34 Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
35 //--------------------------------------------------------------------
36 //This function reconstructs V0 vertices
37 //--------------------------------------------------------------------
39 Int_t nentr=event->GetNumberOfTracks();
40 Double_t b=event->GetMagneticField();
42 if (nentr<2) return 0;
47 Int_t nneg=0, npos=0, nvtx=0;
50 for (i=0; i<nentr; i++) {
51 AliESDtrack *esdTrack=event->GetTrack(i);
52 UInt_t status=esdTrack->GetStatus();
53 UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
54 AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
56 if ((status&AliESDtrack::kITSrefit)==0)
57 if (flags!=status) continue;
59 Double_t d=esdTrack->GetD(fX,fY,b);
60 if (TMath::Abs(d)<fDPmin) continue;
61 if (TMath::Abs(d)>fRmax) continue;
63 if (esdTrack->GetSign() < 0.) neg[nneg++]=i;
68 for (i=0; i<nneg; i++) {
70 AliESDtrack *ntrk=event->GetTrack(nidx);
72 for (Int_t k=0; k<npos; k++) {
74 AliESDtrack *ptrk=event->GetTrack(pidx);
76 if (TMath::Abs(ntrk->GetD(fX,fY,b))<fDNmin)
77 if (TMath::Abs(ptrk->GetD(fX,fY,b))<fDNmin) continue;
79 Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
80 if (dca > fDCAmax) continue;
81 if ((xn+xp) > 2*fRmax) continue;
82 if ((xn+xp) < 2*fRmin) continue;
84 AliExternalTrackParam nt(*ntrk), pt(*ptrk);
85 Bool_t corrected=kFALSE;
86 if ((nt.GetX() > 3.) && (xn < 3.)) {
87 //correct for the beam pipe material
90 if ((pt.GetX() > 3.) && (xp < 3.)) {
91 //correct for the beam pipe material
95 dca=nt.GetDCA(&pt,b,xn,xp);
96 if (dca > fDCAmax) continue;
97 if ((xn+xp) > 2*fRmax) continue;
98 if ((xn+xp) < 2*fRmin) continue;
101 nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
103 AliESDv0 vertex(nt,nidx,pt,pidx);
104 if (vertex.GetChi2V0() > fChi2max) continue;
106 if (vertex.GetV0CosineOfPointingAngle(fX,fY,fZ) < fCPAmax) continue;
107 vertex.SetDcaV0Daughters(dca);
109 event->AddV0(&vertex);
115 Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx);