]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDkink.cxx
Additional ESD data members related to TRD tracking quality (M.Ivanov)
[u/mrichter/AliRoot.git] / STEER / AliESDkink.cxx
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 /* $Id$ */
17
18 //-------------------------------------------------------------------------
19 //    Origin: Marian Ivanov marian.ivanov@cern.ch
20 //-------------------------------------------------------------------------
21
22 #include <Riostream.h>
23 #include <TMath.h>
24 #include <TPDGCode.h>
25 #include "AliESDkink.h"
26 #include "AliHelix.h"
27
28
29 ClassImp(AliESDkink)
30
31 AliESDkink::AliESDkink(){
32   //
33   //Dafault constructor
34   //
35   fDist1  =-1;
36   fDist2  =-1;
37   fRr     =-1;
38   for (Int_t i=0;i<12;i++) fStatus[i]=0;
39   fRow0   =-1;
40   for (Int_t i=0;i<2;i++)
41     for (Int_t j=0;j<2;j++){
42       fTPCdensity[i][j]=-1;
43       fTPCdensity2[i][j]=-1;
44     }
45   fTPCncls[0]=0;
46   fTPCncls[1]=0;
47 }
48
49 void AliESDkink::SetMother(const AliExternalTrackParam & pmother)  {
50   //
51   // set mother
52   //
53   fParamMother   = pmother;
54 }
55
56 void AliESDkink::SetDaughter(const AliExternalTrackParam & pdaughter){
57   //
58   //set daughter
59   //
60   fParamDaughter = pdaughter;
61
62 }
63   
64 void  AliESDkink::Update()
65 {
66   //
67   // updates Kink Info
68   //
69   Float_t distance2=1000;
70   //
71   AliHelix dhelix1(fParamDaughter);
72   AliHelix mhelix(fParamMother);    
73   //
74   //find intersection linear
75   //
76   Double_t phase[2][2],radius[2];
77   Double_t delta1=10000,delta2=10000;  
78   Int_t points=0;
79   /*
80     Float_t distance1=0;
81   Int_t  points = dhelix1.GetRPHIintersections(mhelix, phase, radius,200);
82   
83   if (points>0){
84     dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
85   }
86   if (points==2){    
87     dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
88   }
89   distance1 = TMath::Min(delta1,delta2);
90   */
91   //
92   //find intersection parabolic
93   //
94   points = dhelix1.GetRPHIintersections(mhelix, phase, radius,7);
95
96   delta1=10000,delta2=10000;  
97   Double_t d1=1000.,d2=10000.;
98   if (points>0){
99     dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1,6);
100     //    dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
101     Double_t xd[3],xm[3];
102     dhelix1.Evaluate(phase[0][0],xd);
103     mhelix.Evaluate(phase[0][1],xm);
104     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]);
105   }
106   if (points==2){    
107     dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2,6);
108     //dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
109     Double_t xd[3],xm[3];
110     dhelix1.Evaluate(phase[1][0],xd);
111     mhelix.Evaluate(phase[1][1],xm);
112     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]);
113   }
114   //
115   distance2 = TMath::Min(delta1,delta2);
116   if (delta1<delta2){
117     //get V0 info
118     //    dhelix1.Evaluate(phase[0][0],fXr);
119     Double_t xd[3],xm[3];
120     dhelix1.Evaluate(phase[0][0],xd);
121     mhelix.Evaluate(phase[0][1], xm);
122     fXr[0] = 0.5*(xd[0]+xm[0]);
123     fXr[1] = 0.5*(xd[1]+xm[1]);
124     fXr[2] = 0.5*(xd[2]+xm[2]);
125     //
126     dhelix1.GetMomentum(phase[0][0],fPdr);
127     mhelix.GetMomentum(phase[0][1],fPm);
128     dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fAngle);
129     //fRr = TMath::Sqrt(radius[0]);
130     fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
131   }
132   else{
133     //dhelix1.Evaluate(phase[1][0],fXr);
134     Double_t xd[3],xm[3];
135     dhelix1.Evaluate(phase[1][0],xd);
136     mhelix.Evaluate(phase[1][1], xm);
137     fXr[0] = 0.5*(xd[0]+xm[0]);
138     fXr[1] = 0.5*(xd[1]+xm[1]);
139     fXr[2] = 0.5*(xd[2]+xm[2]);
140     //
141     dhelix1.GetMomentum(phase[1][0], fPdr);
142     mhelix.GetMomentum(phase[1][1], fPm);
143     dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fAngle);
144     //    fRr = TMath::Sqrt(radius[1]); 
145     fRr = TMath::Sqrt(fXr[0]*fXr[0]+fXr[1]*fXr[1]);
146   }
147   fDist1 = TMath::Sqrt(TMath::Min(d1,d2));
148   fDist2 = TMath::Sqrt(distance2);      
149   //            
150   //
151
152 }
153
154  
155 Float_t AliESDkink::GetTPCDensityFactor() const
156 {
157   //
158   //
159   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)); 
160 }
161
162 Float_t AliESDkink::GetQt() const
163 {
164   Float_t dmomentum = TMath::Sqrt(fPdr[0]*fPdr[0]+fPdr[1]*fPdr[1]+fPdr[2]*fPdr[2]);
165   return TMath::Sin(fAngle[2])*dmomentum;
166 }