]>
Commit | Line | Data |
---|---|---|
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 | |
8859d205 | 20 | // Origin: Iouri Belikov, IPHC, Strasbourg, Jouri.Belikov@cern.ch |
c7bafca9 | 21 | //------------------------------------------------------------------------- |
c028b974 | 22 | |
23 | ||
c7bafca9 | 24 | #include <TObjArray.h> |
25 | #include <TTree.h> | |
26 | ||
af885e0f | 27 | #include "AliESDEvent.h" |
c7bafca9 | 28 | #include "AliESDv0.h" |
29 | #include "AliESDtrack.h" | |
30 | #include "AliV0vertexer.h" | |
faffd83e | 31 | #include "AliESDVertex.h" |
c7bafca9 | 32 | |
33 | ClassImp(AliV0vertexer) | |
34 | ||
5e4ff34d | 35 | |
36 | //A set of very loose cuts | |
e82eee7e | 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 | |
46be1d8a | 41 | Double_t AliV0vertexer::fgCPAmin=0.99; //min cosine of V0's pointing angle |
e82eee7e | 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 | |
5e4ff34d | 44 | |
af885e0f | 45 | Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) { |
c7bafca9 | 46 | //-------------------------------------------------------------------- |
47 | //This function reconstructs V0 vertices | |
48 | //-------------------------------------------------------------------- | |
8859d205 | 49 | |
8859d205 | 50 | const AliESDVertex *vtxT3D=event->GetPrimaryVertex(); |
51 | ||
69c49ae1 | 52 | Double_t xPrimaryVertex=vtxT3D->GetXv(); |
53 | Double_t yPrimaryVertex=vtxT3D->GetYv(); | |
54 | Double_t zPrimaryVertex=vtxT3D->GetZv(); | |
c7bafca9 | 55 | |
56 | Int_t nentr=event->GetNumberOfTracks(); | |
57 | Double_t b=event->GetMagneticField(); | |
58 | ||
da46f3ca | 59 | if (nentr<2) return 0; |
60 | ||
1684b2ce | 61 | TArrayI neg(nentr); |
62 | TArrayI pos(nentr); | |
c7bafca9 | 63 | |
64 | Int_t nneg=0, npos=0, nvtx=0; | |
65 | ||
66 | Int_t i; | |
67 | for (i=0; i<nentr; i++) { | |
68 | AliESDtrack *esdTrack=event->GetTrack(i); | |
46be1d8a | 69 | ULong_t status=esdTrack->GetStatus(); |
c7bafca9 | 70 | |
71 | if ((status&AliESDtrack::kITSrefit)==0) | |
46be1d8a | 72 | if ((status&AliESDtrack::kTPCrefit)==0) continue; |
c7bafca9 | 73 | |
8859d205 | 74 | Double_t d=esdTrack->GetD(xPrimaryVertex,yPrimaryVertex,b); |
c7bafca9 | 75 | if (TMath::Abs(d)<fDPmin) continue; |
76 | if (TMath::Abs(d)>fRmax) continue; | |
77 | ||
78 | if (esdTrack->GetSign() < 0.) neg[nneg++]=i; | |
79 | else pos[npos++]=i; | |
80 | } | |
81 | ||
82 | ||
83 | for (i=0; i<nneg; i++) { | |
84 | Int_t nidx=neg[i]; | |
85 | AliESDtrack *ntrk=event->GetTrack(nidx); | |
86 | ||
87 | for (Int_t k=0; k<npos; k++) { | |
88 | Int_t pidx=pos[k]; | |
89 | AliESDtrack *ptrk=event->GetTrack(pidx); | |
90 | ||
8859d205 | 91 | if (TMath::Abs(ntrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin) |
92 | if (TMath::Abs(ptrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin) continue; | |
c7bafca9 | 93 | |
94 | Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp); | |
95 | if (dca > fDCAmax) continue; | |
96 | if ((xn+xp) > 2*fRmax) continue; | |
97 | if ((xn+xp) < 2*fRmin) continue; | |
98 | ||
99 | AliExternalTrackParam nt(*ntrk), pt(*ptrk); | |
100 | Bool_t corrected=kFALSE; | |
101 | if ((nt.GetX() > 3.) && (xn < 3.)) { | |
102 | //correct for the beam pipe material | |
103 | corrected=kTRUE; | |
104 | } | |
105 | if ((pt.GetX() > 3.) && (xp < 3.)) { | |
106 | //correct for the beam pipe material | |
107 | corrected=kTRUE; | |
108 | } | |
109 | if (corrected) { | |
110 | dca=nt.GetDCA(&pt,b,xn,xp); | |
111 | if (dca > fDCAmax) continue; | |
112 | if ((xn+xp) > 2*fRmax) continue; | |
113 | if ((xn+xp) < 2*fRmin) continue; | |
114 | } | |
115 | ||
116 | nt.PropagateTo(xn,b); pt.PropagateTo(xp,b); | |
117 | ||
118 | AliESDv0 vertex(nt,nidx,pt,pidx); | |
c028b974 | 119 | if (vertex.GetChi2V0() > fChi2max) continue; |
c7bafca9 | 120 | |
8859d205 | 121 | Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex); |
46be1d8a | 122 | if (cpa < fCPAmin) continue; |
c028b974 | 123 | vertex.SetDcaV0Daughters(dca); |
b75d63a7 | 124 | vertex.SetV0CosineOfPointingAngle(cpa); |
125 | vertex.ChangeMassHypothesis(kK0Short); | |
c7bafca9 | 126 | |
127 | event->AddV0(&vertex); | |
128 | ||
129 | nvtx++; | |
130 | } | |
131 | } | |
132 | ||
133 | Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx); | |
134 | ||
da46f3ca | 135 | return nvtx; |
c7bafca9 | 136 | } |
137 | ||
138 | ||
139 | ||
140 | ||
141 | ||
142 | ||
143 | ||
144 | ||
145 | ||
146 | ||
147 | ||
148 | ||
149 | ||
150 |