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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////
20 Origin: marian.ivanov@cern.ch
21 Container classes with MC infomation for V0
26 #if !defined(__CINT__) || defined(__MAKECINT__)
37 #include "TStopwatch.h"
38 #include "TParticle.h"
41 #include "TGeometry.h"
42 #include "TPolyLine3D.h"
47 #include "AliSimDigits.h"
48 #include "AliTPCParam.h"
50 #include "AliTPCLoader.h"
51 #include "AliDetector.h"
52 #include "AliTrackReference.h"
53 #include "AliTPCParamSR.h"
54 #include "AliTracker.h"
57 #include "AliTrackPointArray.h"
60 #include "AliGenV0Info.h"
64 ClassImp(AliGenV0Info)
70 /////////////////////////////////////////////////////////////////////////////////
71 AliGenV0Info::AliGenV0Info():
72 fMCd(), //info about daughter particle -
73 fMCm(), //info about mother particle - first particle for V0
74 fMotherP(), //particle info about mother particle
75 fMCDist1(0), //info about closest distance according closest MC - linear DCA
76 fMCDist2(0), //info about closest distance parabolic DCA
77 fMCRr(0), // rec position of the vertex
78 fMCR(0), //exact r position of the vertex
79 fInvMass(0), //reconstructed invariant mass -
80 fPointAngleFi(0), //point angle fi
81 fPointAngleTh(0), //point angle theta
82 fPointAngle(0) //point angle full
84 for (Int_t i=0;i<3; i++){
93 for (Int_t i=0; i<2;i++){
99 void AliGenV0Info::Update(Float_t vertex[3])
102 // Update information - calculates derived variables
105 fMCPd[0] = fMCd.GetParticle().Px();
106 fMCPd[1] = fMCd.GetParticle().Py();
107 fMCPd[2] = fMCd.GetParticle().Pz();
108 fMCPd[3] = fMCd.GetParticle().P();
110 fMCX[0] = fMCd.GetParticle().Vx();
111 fMCX[1] = fMCd.GetParticle().Vy();
112 fMCX[2] = fMCd.GetParticle().Vz();
113 fMCR = TMath::Sqrt( fMCX[0]*fMCX[0]+fMCX[1]*fMCX[1]);
115 fPdg[0] = fMCd.GetParticle().GetPdgCode();
116 fPdg[1] = fMCm.GetParticle().GetPdgCode();
118 fLab[0] = fMCd.GetParticle().GetUniqueID();
119 fLab[1] = fMCm.GetParticle().GetUniqueID();
123 Double_t x1[3],p1[3];
124 TParticle& pdaughter = fMCd.GetParticle();
125 x1[0] = pdaughter.Vx();
126 x1[1] = pdaughter.Vy();
127 x1[2] = pdaughter.Vz();
128 p1[0] = pdaughter.Px();
129 p1[1] = pdaughter.Py();
130 p1[2] = pdaughter.Pz();
131 Double_t sign = (pdaughter.GetPDG()->Charge()>0)? -1:1;
132 AliHelix dhelix1(x1,p1,sign);
135 Double_t x2[3],p2[3];
137 TParticle& pmother = fMCm.GetParticle();
138 x2[0] = pmother.Vx();
139 x2[1] = pmother.Vy();
140 x2[2] = pmother.Vz();
141 p2[0] = pmother.Px();
142 p2[1] = pmother.Py();
143 p2[2] = pmother.Pz();
146 sign = (pmother.GetPDG()->Charge()>0) ? -1:1;
147 AliHelix mhelix(x2,p2,sign);
152 //find intersection linear
154 Double_t distance1, distance2;
155 Double_t phase[2][2],radius[2];
156 Int_t points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
157 Double_t delta1=10000,delta2=10000;
159 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
160 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
161 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
168 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
169 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
170 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
172 distance1 = TMath::Min(delta1,delta2);
174 //find intersection parabolic
176 points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
177 delta1=10000,delta2=10000;
180 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
183 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
186 distance2 = TMath::Min(delta1,delta2);
190 dhelix1.Evaluate(phase[0][0],fMCXr);
191 dhelix1.GetMomentum(phase[0][0],fMCPdr);
192 mhelix.GetMomentum(phase[0][1],fMCPm);
193 dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fMCAngle);
194 fMCRr = TMath::Sqrt(radius[0]);
197 dhelix1.Evaluate(phase[1][0],fMCXr);
198 dhelix1.GetMomentum(phase[1][0],fMCPdr);
199 mhelix.GetMomentum(phase[1][1],fMCPm);
200 dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fMCAngle);
201 fMCRr = TMath::Sqrt(radius[1]);
205 fMCDist1 = TMath::Sqrt(distance1);
206 fMCDist2 = TMath::Sqrt(distance2);
210 Float_t v[3] = {fMCXr[0]-vertex[0],fMCXr[1]-vertex[1],fMCXr[2]-vertex[2]};
211 //Float_t v[3] = {fMCXr[0],fMCXr[1],fMCXr[2]};
212 Float_t p[3] = {fMCPdr[0]+fMCPm[0], fMCPdr[1]+fMCPm[1],fMCPdr[2]+fMCPm[2]};
213 Float_t vnorm2 = v[0]*v[0]+v[1]*v[1];
214 Float_t vnorm3 = TMath::Sqrt(v[2]*v[2]+vnorm2);
215 vnorm2 = TMath::Sqrt(vnorm2);
216 Float_t pnorm2 = p[0]*p[0]+p[1]*p[1];
217 Float_t pnorm3 = TMath::Sqrt(p[2]*p[2]+pnorm2);
218 pnorm2 = TMath::Sqrt(pnorm2);
220 fPointAngleFi = (v[0]*p[0]+v[1]*p[1])/(vnorm2*pnorm2);
221 fPointAngleTh = (v[2]*p[2]+vnorm2*pnorm2)/(vnorm3*pnorm3);
222 fPointAngle = (v[0]*p[0]+v[1]*p[1]+v[2]*p[2])/(vnorm3*pnorm3);
223 Double_t mass1 = fMCd.GetMass();
224 Double_t mass2 = fMCm.GetMass();
227 Double_t e1 = TMath::Sqrt(mass1*mass1+
231 Double_t e2 = TMath::Sqrt(mass2*mass2+
237 (fMCPm[0]+fMCPd[0])*(fMCPm[0]+fMCPd[0])+
238 (fMCPm[1]+fMCPd[1])*(fMCPm[1]+fMCPd[1])+
239 (fMCPm[2]+fMCPd[2])*(fMCPm[2]+fMCPd[2]);
241 // fInvMass = TMath::Sqrt((e1+e2)*(e1+e2)-fInvMass);
242 fInvMass = (e1+e2)*(e1+e2)-fInvMass;
243 if (fInvMass>0) fInvMass = TMath::Sqrt(fInvMass);