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 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // Origin: Marian Ivanov marian.ivanov@cern.ch
20 //-------------------------------------------------------------------------
22 #include <Riostream.h>
25 #include "AliESDkink.h"
31 AliESDkink::AliESDkink(){
60 fTPCdensity2[0][0]=-1;
61 fTPCdensity2[0][1]=-1;
62 fTPCdensity2[1][0]=-1;
63 fTPCdensity2[1][1]=-1;
74 void AliESDkink::SetMother(const AliExternalTrackParam & pmother) {
78 fParamMother = pmother;
81 void AliESDkink::SetDaughter(const AliExternalTrackParam & pdaughter){
85 fParamDaughter = pdaughter;
89 void AliESDkink::Update()
94 Float_t distance1,distance2;
96 AliHelix dhelix1(fParamDaughter);
97 AliHelix mhelix(fParamMother);
99 //find intersection linear
101 Double_t phase[2][2],radius[2];
102 Int_t points = dhelix1.GetRPHIintersections(mhelix, phase, radius,200);
103 Double_t delta1=10000,delta2=10000;
106 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
107 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
108 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
111 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
112 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
113 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
115 distance1 = TMath::Min(delta1,delta2);
117 //find intersection parabolic
119 points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
120 delta1=10000,delta2=10000;
121 Double_t d1=1000.,d2=10000.;
123 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
124 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
125 Double_t xd[3],xm[3];
126 dhelix1.Evaluate(phase[0][0],xd);
127 mhelix.Evaluate(phase[0][1],xm);
128 d1 = (xd[0]-xm[0])*(xd[0]-xm[0])+(xd[1]-xm[1])*(xd[1]-xm[1])+(xd[2]-xm[2])*(xd[2]-xm[2]);
131 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
132 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
133 Double_t xd[3],xm[3];
134 dhelix1.Evaluate(phase[1][0],xd);
135 mhelix.Evaluate(phase[1][1],xm);
136 d2 = (xd[0]-xm[0])*(xd[0]-xm[0])+(xd[1]-xm[1])*(xd[1]-xm[1])+(xd[2]-xm[2])*(xd[2]-xm[2]);
139 distance2 = TMath::Min(delta1,delta2);
142 // dhelix1.Evaluate(phase[0][0],fXr);
143 Double_t xd[3],xm[3];
144 dhelix1.Evaluate(phase[0][0],xd);
145 mhelix.Evaluate(phase[0][1], xm);
146 fXr[0] = 0.5*(xd[0]+xm[0]);
147 fXr[1] = 0.5*(xd[1]+xm[1]);
148 fXr[2] = 0.5*(xd[2]+xm[2]);
150 dhelix1.GetMomentum(phase[0][0],fPdr);
151 mhelix.GetMomentum(phase[0][1],fPm);
152 dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fAngle);
153 //fRr = TMath::Sqrt(radius[0]);
154 fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
157 //dhelix1.Evaluate(phase[1][0],fXr);
158 Double_t xd[3],xm[3];
159 dhelix1.Evaluate(phase[1][0],xd);
160 mhelix.Evaluate(phase[1][1], xm);
161 fXr[0] = 0.5*(xd[0]+xm[0]);
162 fXr[1] = 0.5*(xd[1]+xm[1]);
163 fXr[2] = 0.5*(xd[2]+xm[2]);
165 dhelix1.GetMomentum(phase[1][0], fPdr);
166 mhelix.GetMomentum(phase[1][1], fPm);
167 dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fAngle);
168 // fRr = TMath::Sqrt(radius[1]);
169 fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
171 fDist1 = TMath::Sqrt(TMath::Min(d1,d2));
172 fDist2 = TMath::Sqrt(distance2);
179 Float_t AliESDkink::GetTPCDensityFactor() const
183 return fTPCdensity[0][0]+fTPCdensity[1][1]-TMath::Max(fTPCdensity[0][1],Float_t(0.0))-TMath::Max(fTPCdensity[1][0],Float_t(0.0));
186 Float_t AliESDkink::GetQt() const
188 Float_t dmomentum = TMath::Sqrt(fPdr[0]*fPdr[0]+fPdr[1]*fPdr[1]+fPdr[2]*fPdr[2]);
189 return TMath::Sin(fAngle[2])*dmomentum;