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
25 #if !defined(__CINT__) || defined(__MAKECINT__)
36 #include "TStopwatch.h"
37 #include "TParticle.h"
40 #include "TGeometry.h"
41 #include "TPolyLine3D.h"
46 #include "AliSimDigits.h"
47 #include "AliTPCParam.h"
49 #include "AliTPCLoader.h"
50 #include "AliDetector.h"
51 #include "AliTrackReference.h"
52 #include "AliTPCParamSR.h"
53 #include "AliTracker.h"
56 #include "AliTrackPointArray.h"
59 #include "AliGenKinkInfo.h"
64 ClassImp(AliGenKinkInfo)
68 /////////////////////////////////////////////////////////////////////////////////
70 AliGenKinkInfo::AliGenKinkInfo():
71 fMCd(), //info about daughter particle - second particle for V0
72 fMCm(), //info about mother particle - first particle for V0
73 fMCDist1(0), //info about closest distance according closest MC - linear DCA
74 fMCDist2(0), //info about closest distance parabolic DCA
75 fMCRr(0), // rec position of the vertex
76 fMCR(0) //exact r position of the vertex
79 // default constructor
81 for (Int_t i=0;i<3;i++){
88 for (Int_t i=0; i<2; i++) {
94 void AliGenKinkInfo::Update()
98 // some redundancy - faster acces to the values in analysis code
100 fMCPd[0] = fMCd.GetParticle().Px();
101 fMCPd[1] = fMCd.GetParticle().Py();
102 fMCPd[2] = fMCd.GetParticle().Pz();
103 fMCPd[3] = fMCd.GetParticle().P();
105 fMCX[0] = fMCd.GetParticle().Vx();
106 fMCX[1] = fMCd.GetParticle().Vy();
107 fMCX[2] = fMCd.GetParticle().Vz();
108 fMCR = TMath::Sqrt( fMCX[0]*fMCX[0]+fMCX[1]*fMCX[1]);
110 fPdg[0] = fMCd.GetParticle().GetPdgCode();
111 fPdg[1] = fMCm.GetParticle().GetPdgCode();
113 fLab[0] = fMCd.GetParticle().GetUniqueID();
114 fLab[1] = fMCm.GetParticle().GetUniqueID();
118 Double_t x1[3],p1[3];
119 TParticle& pdaughter = fMCd.GetParticle();
120 x1[0] = pdaughter.Vx();
121 x1[1] = pdaughter.Vy();
122 x1[2] = pdaughter.Vz();
123 p1[0] = pdaughter.Px();
124 p1[1] = pdaughter.Py();
125 p1[2] = pdaughter.Pz();
126 Double_t sign = (pdaughter.GetPDG()->Charge()>0)? -1:1;
127 AliHelix dhelix1(x1,p1,sign);
130 Double_t x2[3],p2[3];
132 TParticle& pmother = fMCm.GetParticle();
133 x2[0] = pmother.Vx();
134 x2[1] = pmother.Vy();
135 x2[2] = pmother.Vz();
136 p2[0] = pmother.Px();
137 p2[1] = pmother.Py();
138 p2[2] = pmother.Pz();
140 const AliTrackReference & pdecay = fMCm.GetTRdecay();
148 sign = (pmother.GetPDG()->Charge()>0) ? -1:1;
149 AliHelix mhelix(x2,p2,sign);
154 //find intersection linear
156 Double_t distance1, distance2;
157 Double_t phase[2][2],radius[2];
158 Int_t points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
159 Double_t delta1=10000,delta2=10000;
161 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
162 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
163 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
166 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
167 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
168 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
170 distance1 = TMath::Min(delta1,delta2);
172 //find intersection parabolic
174 points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
175 delta1=10000,delta2=10000;
178 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
181 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
184 distance2 = TMath::Min(delta1,delta2);
188 dhelix1.Evaluate(phase[0][0],fMCXr);
189 dhelix1.GetMomentum(phase[0][0],fMCPdr);
190 mhelix.GetMomentum(phase[0][1],fMCPm);
191 dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fMCAngle);
192 fMCRr = TMath::Sqrt(radius[0]);
195 dhelix1.Evaluate(phase[1][0],fMCXr);
196 dhelix1.GetMomentum(phase[1][0],fMCPdr);
197 mhelix.GetMomentum(phase[1][1],fMCPm);
198 dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fMCAngle);
199 fMCRr = TMath::Sqrt(radius[1]);
203 fMCDist1 = TMath::Sqrt(distance1);
204 fMCDist2 = TMath::Sqrt(distance2);
209 Float_t AliGenKinkInfo::GetQt(){
212 Float_t momentumd = TMath::Sqrt(fMCPd[0]*fMCPd[0]+fMCPd[1]*fMCPd[1]+fMCPd[2]*fMCPd[2]);
213 return TMath::Sin(fMCAngle[2])*momentumd;