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(){
40 fTPCdensity2[0][0]=-1;
41 fTPCdensity2[0][1]=-1;
45 void AliESDkink::SetMother(const AliExternalTrackParam & pmother) {
49 fParamMother = pmother;
52 void AliESDkink::SetDaughter(const AliExternalTrackParam & pdaughter){
56 fParamDaughter = pdaughter;
60 void AliESDkink::Update()
65 Float_t distance1,distance2;
67 AliHelix dhelix1(fParamDaughter);
68 AliHelix mhelix(fParamMother);
70 //find intersection linear
72 Double_t phase[2][2],radius[2];
73 Int_t points = dhelix1.GetRPHIintersections(mhelix, phase, radius,200);
74 Double_t delta1=10000,delta2=10000;
77 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
78 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
79 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
82 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
83 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
84 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
86 distance1 = TMath::Min(delta1,delta2);
88 //find intersection parabolic
90 points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
91 delta1=10000,delta2=10000;
92 Double_t d1=1000.,d2=10000.;
94 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
95 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
97 dhelix1.Evaluate(phase[0][0],xd);
98 mhelix.Evaluate(phase[0][1],xm);
99 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]);
102 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
103 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
104 Double_t xd[3],xm[3];
105 dhelix1.Evaluate(phase[1][0],xd);
106 mhelix.Evaluate(phase[1][1],xm);
107 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]);
110 distance2 = TMath::Min(delta1,delta2);
113 // dhelix1.Evaluate(phase[0][0],fXr);
114 Double_t xd[3],xm[3];
115 dhelix1.Evaluate(phase[0][0],xd);
116 mhelix.Evaluate(phase[0][1], xm);
117 fXr[0] = 0.5*(xd[0]+xm[0]);
118 fXr[1] = 0.5*(xd[1]+xm[1]);
119 fXr[2] = 0.5*(xd[2]+xm[2]);
121 dhelix1.GetMomentum(phase[0][0],fPdr);
122 mhelix.GetMomentum(phase[0][1],fPm);
123 dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fAngle);
124 //fRr = TMath::Sqrt(radius[0]);
125 fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
128 //dhelix1.Evaluate(phase[1][0],fXr);
129 Double_t xd[3],xm[3];
130 dhelix1.Evaluate(phase[1][0],xd);
131 mhelix.Evaluate(phase[1][1], xm);
132 fXr[0] = 0.5*(xd[0]+xm[0]);
133 fXr[1] = 0.5*(xd[1]+xm[1]);
134 fXr[2] = 0.5*(xd[2]+xm[2]);
136 dhelix1.GetMomentum(phase[1][0], fPdr);
137 mhelix.GetMomentum(phase[1][1], fPm);
138 dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fAngle);
139 // fRr = TMath::Sqrt(radius[1]);
140 fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
142 fDist1 = TMath::Sqrt(TMath::Min(d1,d2));
143 fDist2 = TMath::Sqrt(distance2);
150 Float_t AliESDkink::GetTPCDensityFactor() const
154 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));
157 Float_t AliESDkink::GetQt() const
159 Float_t dmomentum = TMath::Sqrt(fPdr[0]*fPdr[0]+fPdr[1]*fPdr[1]+fPdr[2]*fPdr[2]);
160 return TMath::Sin(fAngle[2])*dmomentum;