]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliESDRecV0Info.cxx
Call to InputEventHandler for local and proof.
[u/mrichter/AliRoot.git] / PWG1 / AliESDRecV0Info.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
17 ///////////////////////////////////////////////////////////////////////////////
18 //                                                                           //
19 //                                                                           //
20 //  Comparison class for V0 information                                      //
21 //  responsible: 
22 //  marian.ivanov@cern.ch                                                    //
23 //
24 //
25
26  
27
28
29
30 #include <stdio.h>
31 #include <string.h>
32 //ROOT includes
33 #include "Rtypes.h"
34 //
35 //ALIROOT includes
36 //
37 #include "AliESDtrack.h"
38 #include "AliTPCParam.h"
39 #include "AliTrackReference.h"
40 #include "AliTPCParamSR.h"
41 #include "AliESD.h"
42 #include "AliESDfriend.h"
43 #include "AliESDtrack.h"
44 #include "AliTPCseed.h"
45 #include "AliITStrackMI.h"
46 #include "AliTRDtrack.h"
47 #include "AliHelix.h"
48 #include "AliESDVertex.h"
49 #include "AliExternalTrackParam.h"
50 #include "AliESDkink.h"
51 #include "AliESDv0.h"
52 #include "AliV0.h"
53 //
54 #include "AliTreeDraw.h"
55 #include "AliMCInfo.h"
56 #include "AliGenKinkInfo.h"
57 #include "AliGenV0Info.h"
58
59
60 #include "AliESDRecV0Info.h"
61
62
63
64 ClassImp(AliESDRecV0Info)
65
66
67
68
69
70 void  AliESDRecV0Info::Update(Float_t vertex[3])
71
72
73   if ( (fT1.fStatus[1]>0)&& (fT2.fStatus[1]>0)){
74     Float_t distance1,distance2;
75     Double_t xx[3],pp[3];
76     //
77     Double_t xd[3],pd[3],signd;
78     Double_t xm[3],pm[3],signm;
79     //
80     //
81     if (fT1.fITSOn&&fT2.fITSOn){
82       for (Int_t i=0;i<3;i++){
83         xd[i] = fT2.fITSinR1[i];
84         pd[i] = fT2.fITSinP1[i];
85         xm[i] = fT1.fITSinR1[i];
86         pm[i] = fT1.fITSinP1[i];
87       }
88     }
89     else{
90       
91       for (Int_t i=0;i<3;i++){
92         xd[i] = fT2.fTPCinR1[i];
93         pd[i] = fT2.fTPCinP1[i];
94         xm[i] = fT1.fTPCinR1[i];
95         pm[i] = fT1.fTPCinP1[i];
96       }
97     }
98     //
99     //
100     signd =  fT2.fSign<0 ? -1:1;
101     signm =  fT1.fSign<0 ? -1:1;
102
103     AliHelix dhelix1(xd,pd,signd);
104     dhelix1.GetMomentum(0,pp,0);
105     dhelix1.Evaluate(0,xx);      
106     // 
107     //  Double_t x2[3],p2[3];
108     //            
109     AliHelix mhelix(xm,pm,signm);    
110     //
111     //find intersection linear
112     //
113     Double_t phase[2][2],radius[2];
114     Int_t  points = dhelix1.GetRPHIintersections(mhelix, phase, radius,200);
115     Double_t delta1=10000,delta2=10000;  
116
117     if (points==1){
118       fRs[0] = TMath::Sqrt(radius[0]);
119       fRs[1] = TMath::Sqrt(radius[0]);
120     }
121     if (points==2){
122       fRs[0] =TMath::Min(TMath::Sqrt(radius[0]),TMath::Sqrt(radius[1]));
123       fRs[1] =TMath::Max(TMath::Sqrt(radius[0]),TMath::Sqrt(radius[1]));
124     }
125     
126     if (points>0){
127       dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
128       dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
129       dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
130     }
131     if (points==2){    
132       dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
133       dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
134       dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
135     }
136     if (points==1){
137       fRs[0] = TMath::Sqrt(radius[0]);
138       fRs[1] = TMath::Sqrt(radius[0]);
139       fDistMinR = delta1;
140     }
141     if (points==2){
142       if (radius[0]<radius[1]){
143         fRs[0] = TMath::Sqrt(radius[0]);
144         fRs[1] = TMath::Sqrt(radius[1]);
145         fDistMinR = delta1;
146       }
147       else{
148         fRs[0] = TMath::Sqrt(radius[1]);
149         fRs[1] = TMath::Sqrt(radius[0]);
150         fDistMinR = delta2;
151       }
152     }
153     //
154     //
155     distance1 = TMath::Min(delta1,delta2);
156     //
157     //find intersection parabolic
158     //
159     points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
160     delta1=10000,delta2=10000;  
161     
162     if (points>0){
163       dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
164     }
165     if (points==2){    
166       dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
167     }
168     
169     distance2 = TMath::Min(delta1,delta2);
170     if (distance2>100) fDist2 =100;
171     return;
172     if (delta1<delta2){
173       //get V0 info
174       dhelix1.Evaluate(phase[0][0],fXr);
175       dhelix1.GetMomentum(phase[0][0],fPdr);
176       mhelix.GetMomentum(phase[0][1],fPm);
177       dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fAngle);
178       fRr = TMath::Sqrt(radius[0]);
179     }
180     else{
181       dhelix1.Evaluate(phase[1][0],fXr);
182       dhelix1.GetMomentum(phase[1][0], fPdr);
183       mhelix.GetMomentum(phase[1][1], fPm);
184       dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fAngle);
185       fRr = TMath::Sqrt(radius[1]);
186     }
187     fDist1 = TMath::Sqrt(distance1);
188     fDist2 = TMath::Sqrt(distance2);      
189     
190     if (fDist2<10.5){
191       Double_t x,alpha,param[5],cov[15];
192       //
193       fT1.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
194       fT1.GetESDtrack()->GetInnerExternalCovariance(cov);
195       AliExternalTrackParam paramm(x,alpha,param,cov);
196       //
197       fT2.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
198       fT2.GetESDtrack()->GetInnerExternalCovariance(cov);
199       AliExternalTrackParam paramd(x,alpha,param,cov);
200     }    
201     //            
202     //   
203     
204     Float_t v[3] = {fXr[0]-vertex[0],fXr[1]-vertex[1],fXr[2]-vertex[2]};
205     Float_t p[3] = {fPdr[0]+fPm[0], fPdr[1]+fPm[1],fPdr[2]+fPm[2]};
206     
207     Float_t vnorm2 = v[0]*v[0]+v[1]*v[1];
208     Float_t vnorm3 = TMath::Sqrt(v[2]*v[2]+vnorm2);
209     vnorm2 = TMath::Sqrt(vnorm2);
210     Float_t pnorm2 = p[0]*p[0]+p[1]*p[1];
211     Float_t pnorm3 = TMath::Sqrt(p[2]*p[2]+pnorm2);
212     pnorm2 = TMath::Sqrt(pnorm2);
213     
214     fPointAngleFi = (v[0]*p[0]+v[1]*p[1])/(vnorm2*pnorm2);
215     fPointAngleTh = (v[2]*p[2]+vnorm2*pnorm2)/(vnorm3*pnorm3);  
216     fPointAngle   = (v[0]*p[0]+v[1]*p[1]+v[2]*p[2])/(vnorm3*pnorm3);
217   }
218 }
219