]>
Commit | Line | Data |
---|---|---|
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 | // Implementation of the ITS track class | |
18 | // | |
19 | // Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch | |
20 | // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch | |
21 | //------------------------------------------------------------------------- | |
22 | ||
23 | /* $Id$ */ | |
24 | ||
25 | #include <TMatrixD.h> | |
26 | ||
27 | #include <TMath.h> | |
28 | ||
29 | #include "AliCluster.h" | |
30 | #include "AliESDtrack.h" | |
31 | #include "AliITSgeomTGeo.h" | |
32 | #include "AliITStrackMI.h" | |
33 | ||
34 | ClassImp(AliITStrackMI) | |
35 | ||
36 | const Int_t kWARN=5; | |
37 | ||
38 | //____________________________________________________________________________ | |
39 | AliITStrackMI::AliITStrackMI():AliITStrackV2(), | |
40 | fNUsed(0), | |
41 | fNSkipped(0), | |
42 | fNDeadZone(0), | |
43 | fDeadZoneProbability(0), | |
44 | fReconstructed(kFALSE), | |
45 | fExpQ(40), | |
46 | fChi22(0), | |
47 | fdEdxMismatch(0), | |
48 | fConstrain(kFALSE), | |
49 | fGoldV0(kFALSE) | |
50 | { | |
51 | //constructor | |
52 | for(Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fClIndex[i]=-1; | |
53 | for(Int_t i=0; i<6; i++) { fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000;} | |
54 | for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fChi2MIP[i]=0;} | |
55 | fD[0]=0; fD[1]=0; | |
56 | fDnorm[0]=0; fDnorm[1]=0; | |
57 | } | |
58 | ||
59 | //____________________________________________________________________________ | |
60 | AliITStrackMI::AliITStrackMI(AliESDtrack& t,Bool_t c) throw (const Char_t *) : | |
61 | AliITStrackV2(t,c), | |
62 | fNUsed(0), | |
63 | fNSkipped(0), | |
64 | fNDeadZone(0), | |
65 | fDeadZoneProbability(0), | |
66 | fReconstructed(kFALSE), | |
67 | fExpQ(40), | |
68 | fChi22(0), | |
69 | fdEdxMismatch(0), | |
70 | fConstrain(kFALSE), | |
71 | fGoldV0(kFALSE) { | |
72 | //------------------------------------------------------------------ | |
73 | // Conversion ESD track -> ITS track. | |
74 | // If c==kTRUE, create the ITS track out of the constrained params. | |
75 | //------------------------------------------------------------------ | |
76 | for(Int_t i=0; i<6; i++) {fClIndex[i]=-1; fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000;} | |
77 | for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0;fChi2MIP[i]=0;} | |
78 | fD[0]=0; fD[1]=0; | |
79 | fDnorm[0]=0; fDnorm[1]=0; | |
80 | //if (!Invariant()) throw "AliITStrackV2: conversion failed !\n"; | |
81 | ||
82 | } | |
83 | ||
84 | //____________________________________________________________________________ | |
85 | AliITStrackMI::AliITStrackMI(const AliITStrackMI& t) : AliITStrackV2(t), | |
86 | fNUsed(t.fNUsed), | |
87 | fNSkipped(t.fNSkipped), | |
88 | fNDeadZone(t.fNDeadZone), | |
89 | fDeadZoneProbability(t.fDeadZoneProbability), | |
90 | fReconstructed(t.fReconstructed), | |
91 | fExpQ(t.fExpQ), | |
92 | fChi22(t.fChi22), | |
93 | fdEdxMismatch(t.fdEdxMismatch), | |
94 | fConstrain(t.fConstrain), | |
95 | fGoldV0(t.fGoldV0) { | |
96 | //------------------------------------------------------------------ | |
97 | //Copy constructor | |
98 | //------------------------------------------------------------------ | |
99 | fLab = t.fLab; | |
100 | fFakeRatio = t.fFakeRatio; | |
101 | ||
102 | fD[0]=t.fD[0]; fD[1]=t.fD[1]; | |
103 | fDnorm[0] = t.fDnorm[0]; fDnorm[1]=t.fDnorm[1]; | |
104 | for(Int_t i=0; i<6; i++) { | |
105 | fClIndex[i]= t.fClIndex[i]; fNy[i]=t.fNy[i]; fNz[i]=t.fNz[i]; fNormQ[i]=t.fNormQ[i]; fNormChi2[i] = t.fNormChi2[i]; | |
106 | } | |
107 | for(Int_t i=0; i<12; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i]; | |
108 | fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i];fChi2MIP[i]=t.fChi2MIP[i];} | |
109 | //memcpy(fDy,t.fDy,6*sizeof(Float_t)); | |
110 | //memcpy(fDz,t.fDz,6*sizeof(Float_t)); | |
111 | //memcpy(fSigmaY,t.fSigmaY,6*sizeof(Float_t)); | |
112 | //memcpy(fSigmaZ,t.fSigmaZ,6*sizeof(Float_t)); | |
113 | //memcpy(fChi2MIP,t.fChi2MIP,12*sizeof(Float_t)); | |
114 | } | |
115 | ||
116 | //_____________________________________________________________________________ | |
117 | Int_t AliITStrackMI::Compare(const TObject *o) const { | |
118 | //----------------------------------------------------------------- | |
119 | // This function compares tracks according to the their curvature | |
120 | //----------------------------------------------------------------- | |
121 | AliITStrackMI *t=(AliITStrackMI*)o; | |
122 | //Double_t co=TMath::Abs(t->Get1Pt()); | |
123 | //Double_t c =TMath::Abs(Get1Pt()); | |
124 | Double_t co=t->GetSigmaY2()*t->GetSigmaZ2()*(0.5+TMath::Sqrt(0.5*t->fD[0]*t->fD[0]+t->fD[1]*t->fD[1])); | |
125 | Double_t c =GetSigmaY2()*GetSigmaZ2()*(0.5+TMath::Sqrt(0.5*fD[0]*fD[0]+fD[1]*fD[1])); | |
126 | if (c>co) return 1; | |
127 | else if (c<co) return -1; | |
128 | return 0; | |
129 | } | |
130 | ||
131 | ||
132 | Double_t AliITStrackMI::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz) const | |
133 | { | |
134 | //----------------------------------------------------------------- | |
135 | // This function calculates a predicted chi2 increment. | |
136 | //----------------------------------------------------------------- | |
137 | Double_t p[2]={cy, cz}; | |
138 | Double_t cov[3]={cerry*cerry, 0., cerrz*cerrz}; | |
139 | return AliExternalTrackParam::GetPredictedChi2(p,cov); | |
140 | } | |
141 | ||
142 | //____________________________________________________________________________ | |
143 | Int_t AliITStrackMI::CorrectForMaterial(Double_t d, Double_t x0) { | |
144 | //------------------------------------------------------------------ | |
145 | //This function corrects the track parameters for crossed material | |
146 | //------------------------------------------------------------------ | |
147 | //d=x0=0.; | |
148 | ||
149 | Double_t p2=(1.+ GetTgl()*GetTgl())/(GetSigned1Pt()*GetSigned1Pt()); | |
150 | Double_t et = p2 + GetMass()*GetMass(); | |
151 | Double_t beta2=p2/et; | |
152 | et = sqrt(et); | |
153 | d*=TMath::Sqrt((1.+ GetTgl()*GetTgl())/(1.- GetSnp()*GetSnp())); | |
154 | ||
155 | //Multiple scattering****************** | |
156 | if (d!=0) { | |
157 | Double_t theta2=14.1*14.1/(beta2*p2*1e6)*TMath::Abs(d); | |
158 | //Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*TMath::Abs(d)*9.36*2.33; | |
159 | Cov(5) += theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl()); | |
160 | Cov(9) += theta2*(1. + GetTgl()*GetTgl())*(1. + GetTgl()*GetTgl()); | |
161 | Cov(13)+= theta2*GetTgl()*GetSigned1Pt()*(1. + GetTgl()*GetTgl()); | |
162 | Cov(14)+= theta2*GetTgl()*GetSigned1Pt()*GetTgl()*GetSigned1Pt(); | |
163 | } | |
164 | ||
165 | //Energy losses************************ | |
166 | if (x0!=0.) { | |
167 | d*=x0; | |
168 | // Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2)*d; | |
169 | //Double_t dE=0; | |
170 | Double_t dE = 0.265*0.153e-3*(39.2-55.6*beta2+28.7*beta2*beta2+27.41/beta2)*d; | |
171 | //if (beta2/(1-beta2)>3.5*3.5){ | |
172 | // dE=0.153e-3/beta2*(log(3.5*5940)+0.5*log(beta2/(1-beta2)) - beta2)*d; | |
173 | //} | |
174 | //else{ | |
175 | // dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2)*d; | |
176 | // dE+=0.06e-3/(beta2*beta2)*d; | |
177 | //} | |
178 | ||
179 | Par(4)*=(1.- et/p2*dE); | |
180 | Double_t delta44 = (dE*GetSigned1Pt()*et/p2); | |
181 | delta44*=delta44; | |
182 | Cov(14)+= delta44/400.; | |
183 | } | |
184 | ||
185 | if (!Invariant()) return 0; | |
186 | ||
187 | return 1; | |
188 | } | |
189 | ||
190 | //____________________________________________________________________________ | |
191 | Bool_t AliITStrackMI::UpdateMI(const AliCluster *c, Double_t chi2, Int_t index) { | |
192 | //------------------------------------------------------------------ | |
193 | //This function updates track parameters | |
194 | //------------------------------------------------------------------ | |
195 | Double_t dy=c->GetY() - GetY(), dz=c->GetZ() - GetZ(); | |
196 | Int_t layer = (index & 0xf0000000) >> 28; | |
197 | fDy[layer] = dy; | |
198 | fDz[layer] = dz; | |
199 | fSigmaY[layer] = TMath::Sqrt(c->GetSigmaY2()+GetSigmaY2()); | |
200 | fSigmaZ[layer] = TMath::Sqrt(c->GetSigmaZ2()+GetSigmaZ2()); | |
201 | ||
202 | return Update(c,chi2,index); | |
203 | } | |
204 | ||
205 | Int_t AliITStrackMI::GetProlongationFast(Double_t alp, Double_t xk,Double_t &y, Double_t &z) | |
206 | { | |
207 | //----------------------------------------------------------------------------- | |
208 | //get fast prolongation | |
209 | //----------------------------------------------------------------------------- | |
210 | Double_t ca=TMath::Cos(alp-GetAlpha()), sa=TMath::Sin(alp-GetAlpha()); | |
211 | Double_t cf=TMath::Sqrt(1.- GetSnp()*GetSnp()); | |
212 | // **** rotation ********************** | |
213 | y= -GetX()*sa + GetY()*ca; | |
214 | // **** translation ****************** | |
215 | Double_t dx = xk- GetX()*ca - GetY()*sa; | |
216 | Double_t f1=GetSnp()*ca - cf*sa, f2=f1 + GetC()*dx; | |
217 | if (TMath::Abs(f2) >= 0.9999) { | |
218 | return 0; | |
219 | } | |
220 | Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2); | |
221 | y += dx*(f1+f2)/(r1+r2); | |
222 | z = GetZ()+dx*(f1+f2)/(f1*r2 + f2*r1)*GetTgl(); | |
223 | return 1; | |
224 | } | |
225 | ||
226 | ||
227 | Bool_t AliITStrackMI::IsGoldPrimary() | |
228 | { | |
229 | // | |
230 | // Indicates gold pimary track | |
231 | // | |
232 | Bool_t isGold=kTRUE; | |
233 | if (!fConstrain) return kFALSE; // | |
234 | if (fNDeadZone+fNDeadZone<5.5) isGold = kFALSE; // short track | |
235 | // | |
236 | if (fChi2/Float_t(fN)>2.){ | |
237 | if (fChi2MIP[0]+fNUsed>3.5) isGold = kFALSE; | |
238 | } | |
239 | if (fChi2MIP[2]>4.5) isGold = kFALSE; //back propagation chi2 | |
240 | // | |
241 | if (fDnorm[0]>0&&fDnorm[1]>0){ | |
242 | const Float_t distcut2 =2.5*2.5; //normalize distance cut | |
243 | Float_t dist2 = fD[0]*fD[0]/(fDnorm[0]*fDnorm[0])+fD[1]*fD[1]/(fDnorm[1]*fDnorm[1]); //normalize distance to the vertex (pools) | |
244 | if (dist2>distcut2) isGold = kFALSE; | |
245 | } | |
246 | return isGold; | |
247 | } |