]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/AliESDRecKinkInfo.cxx
AliRecInfo file splitted to 3 classes (Marian)
[u/mrichter/AliRoot.git] / PWG1 / AliESDRecKinkInfo.cxx
CommitLineData
6fc428f0 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// Time Projection Chamber //
20// Comparison macro for reconstructed tracks - ESDs V0s //
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 "AliGenInfo.h"
56#include "AliESDRecKinkInfo.h"
57
58
59
60ClassImp(AliESDRecKinkInfo)
61
62
63
64
65
66////
67void AliESDRecKinkInfo::Update()
68{
69
70 if ( (fT1.fTPCOn)&& (fT2.fTPCOn)){
71 //
72 // IF BOTH RECONSTRUCTED
73 Float_t distance1,distance2;
74 Double_t xx[3],pp[3];
75 //
76 Double_t xd[3],pd[3],signd;
77 Double_t xm[3],pm[3],signm;
78 for (Int_t i=0;i<3;i++){
79 xd[i] = fT2.fTPCinR1[i];
80 pd[i] = fT2.fTPCinP1[i];
81 xm[i] = fT1.fTPCinR1[i];
82 pm[i] = fT1.fTPCinP1[i];
83 }
84 signd = fT2.fSign<0 ? -1:1;
85 signm = fT1.fSign<0 ? -1:1;
86
87 AliHelix dhelix1(xd,pd,signd);
88 dhelix1.GetMomentum(0,pp,0);
89 dhelix1.Evaluate(0,xx);
90 //
91 // Double_t x2[3],p2[3];
92 //
93 AliHelix mhelix(xm,pm,signm);
94 //
95 //find intersection linear
96 //
97 Double_t phase[2][2],radius[2];
98 Int_t points = dhelix1.GetRPHIintersections(mhelix, phase, radius,200);
99 Double_t delta1=10000,delta2=10000;
100
101 if (points==1){
102 fMinR = TMath::Sqrt(radius[0]);
103 }
104 if (points==2){
105 fMinR =TMath::Min(TMath::Sqrt(radius[0]),TMath::Sqrt(radius[1]));
106 }
107
108 if (points>0){
109 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
110 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
111 dhelix1.LinearDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
112 }
113 if (points==2){
114 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
115 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
116 dhelix1.LinearDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
117 }
118 if (points==1){
119 fMinR = TMath::Sqrt(radius[0]);
120 fDistMinR = delta1;
121 }
122 if (points==2){
123 if (radius[0]<radius[1]){
124 fMinR = TMath::Sqrt(radius[0]);
125 fDistMinR = delta1;
126 }
127 else{
128 fMinR = TMath::Sqrt(radius[1]);
129 fDistMinR = delta2;
130 }
131 }
132 //
133 //
134 distance1 = TMath::Min(delta1,delta2);
135 //
136 //find intersection parabolic
137 //
138 points = dhelix1.GetRPHIintersections(mhelix, phase, radius);
139 delta1=10000,delta2=10000;
140
141 if (points>0){
142 dhelix1.ParabolicDCA(mhelix,phase[0][0],phase[0][1],radius[0],delta1);
143 }
144 if (points==2){
145 dhelix1.ParabolicDCA(mhelix,phase[1][0],phase[1][1],radius[1],delta2);
146 }
147
148 distance2 = TMath::Min(delta1,delta2);
149 if (delta1<delta2){
150 //get V0 info
151 dhelix1.Evaluate(phase[0][0],fXr);
152 dhelix1.GetMomentum(phase[0][0],fPdr);
153 mhelix.GetMomentum(phase[0][1],fPm);
154 dhelix1.GetAngle(phase[0][0],mhelix,phase[0][1],fAngle);
155 fRr = TMath::Sqrt(radius[0]);
156 }
157 else{
158 dhelix1.Evaluate(phase[1][0],fXr);
159 dhelix1.GetMomentum(phase[1][0], fPdr);
160 mhelix.GetMomentum(phase[1][1], fPm);
161 dhelix1.GetAngle(phase[1][0],mhelix,phase[1][1],fAngle);
162 fRr = TMath::Sqrt(radius[1]);
163 }
164 fDist1 = TMath::Sqrt(distance1);
165 fDist2 = TMath::Sqrt(distance2);
166
167 if (fDist2<10.5){
168 Double_t x,alpha,param[5],cov[15];
169 //
170 fT1.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
171 fT1.GetESDtrack()->GetInnerExternalCovariance(cov);
172 AliExternalTrackParam paramm(x,alpha,param,cov);
173 //
174 fT2.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
175 fT2.GetESDtrack()->GetInnerExternalCovariance(cov);
176 AliExternalTrackParam paramd(x,alpha,param,cov);
177 /*
178 AliESDkink kink;
179 kink.Update(&paramm,&paramd);
180 // kink.Dump();
181 Double_t diff = kink.fRr-fRr;
182 Double_t diff2 = kink.fDist2-fDist2;
183 printf("Diff\t%f\t%f\n",diff,diff2);
184 */
185 }
186
187 //
188 //
189 }
190
191}
192