]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliV0vertexer.cxx
Shuttle getters and setters for main OCDB/Reference, local OCDB/Reference, temp
[u/mrichter/AliRoot.git] / STEER / AliV0vertexer.cxx
CommitLineData
c7bafca9 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, IReS, Strasbourg, Jouri.Belikov@cern.ch
21//-------------------------------------------------------------------------
c028b974 22
23
c7bafca9 24#include <TObjArray.h>
25#include <TTree.h>
26
27#include "AliESD.h"
28#include "AliESDv0.h"
29#include "AliESDtrack.h"
30#include "AliV0vertexer.h"
31
32ClassImp(AliV0vertexer)
33
5e4ff34d 34
35//A set of very loose cuts
e82eee7e 36Double_t AliV0vertexer::fgChi2max=33.; //max chi2
37Double_t AliV0vertexer::fgDNmin=0.05; //min imp parameter for the 1st daughter
38Double_t AliV0vertexer::fgDPmin=0.05; //min imp parameter for the 2nd daughter
39Double_t AliV0vertexer::fgDCAmax=0.5; //max DCA between the daughter tracks
40Double_t AliV0vertexer::fgCPAmax=0.99; //max cosine of V0's pointing angle
41Double_t AliV0vertexer::fgRmin=0.2; //min radius of the fiducial volume
42Double_t AliV0vertexer::fgRmax=100.; //max radius of the fiducial volume
5e4ff34d 43
c7bafca9 44Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
45 //--------------------------------------------------------------------
46 //This function reconstructs V0 vertices
47 //--------------------------------------------------------------------
5e4ff34d 48 const AliESDVertex *vtx=event->GetVertex();
49 Double_t xv=vtx->GetXv(), yv=vtx->GetYv(), zv=vtx->GetZv();
c7bafca9 50
51 Int_t nentr=event->GetNumberOfTracks();
52 Double_t b=event->GetMagneticField();
53
da46f3ca 54 if (nentr<2) return 0;
55
c7bafca9 56 TArrayI neg(nentr/2);
57 TArrayI pos(nentr/2);
58
59 Int_t nneg=0, npos=0, nvtx=0;
60
61 Int_t i;
62 for (i=0; i<nentr; i++) {
63 AliESDtrack *esdTrack=event->GetTrack(i);
64 UInt_t status=esdTrack->GetStatus();
65 UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
66 AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
67
68 if ((status&AliESDtrack::kITSrefit)==0)
69 if (flags!=status) continue;
70
5e4ff34d 71 Double_t d=esdTrack->GetD(xv,yv,b);
c7bafca9 72 if (TMath::Abs(d)<fDPmin) continue;
73 if (TMath::Abs(d)>fRmax) continue;
74
75 if (esdTrack->GetSign() < 0.) neg[nneg++]=i;
76 else pos[npos++]=i;
77 }
78
79
80 for (i=0; i<nneg; i++) {
81 Int_t nidx=neg[i];
82 AliESDtrack *ntrk=event->GetTrack(nidx);
83
84 for (Int_t k=0; k<npos; k++) {
85 Int_t pidx=pos[k];
86 AliESDtrack *ptrk=event->GetTrack(pidx);
87
5e4ff34d 88 if (TMath::Abs(ntrk->GetD(xv,yv,b))<fDNmin)
89 if (TMath::Abs(ptrk->GetD(xv,yv,b))<fDNmin) continue;
c7bafca9 90
91 Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
92 if (dca > fDCAmax) continue;
93 if ((xn+xp) > 2*fRmax) continue;
94 if ((xn+xp) < 2*fRmin) continue;
95
96 AliExternalTrackParam nt(*ntrk), pt(*ptrk);
97 Bool_t corrected=kFALSE;
98 if ((nt.GetX() > 3.) && (xn < 3.)) {
99 //correct for the beam pipe material
100 corrected=kTRUE;
101 }
102 if ((pt.GetX() > 3.) && (xp < 3.)) {
103 //correct for the beam pipe material
104 corrected=kTRUE;
105 }
106 if (corrected) {
107 dca=nt.GetDCA(&pt,b,xn,xp);
108 if (dca > fDCAmax) continue;
109 if ((xn+xp) > 2*fRmax) continue;
110 if ((xn+xp) < 2*fRmin) continue;
111 }
112
113 nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
114
115 AliESDv0 vertex(nt,nidx,pt,pidx);
c028b974 116 if (vertex.GetChi2V0() > fChi2max) continue;
c7bafca9 117
b75d63a7 118 Float_t cpa=vertex.GetV0CosineOfPointingAngle(xv,yv,zv);
119 if (cpa < fCPAmax) continue;
c028b974 120 vertex.SetDcaV0Daughters(dca);
b75d63a7 121 vertex.SetV0CosineOfPointingAngle(cpa);
122 vertex.ChangeMassHypothesis(kK0Short);
c7bafca9 123
124 event->AddV0(&vertex);
125
126 nvtx++;
127 }
128 }
129
130 Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx);
131
da46f3ca 132 return nvtx;
c7bafca9 133}
134
135
136
137
138
139
140
141
142
143
144
145
146
147