Effective C++ warnings
[u/mrichter/AliRoot.git] / TOF / AliTOFtrack.cxx
CommitLineData
74ea065c 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 **************************************************************************/
74ea065c 15
0e46b9ae 16/* $Id$ */
d3c7bfac 17
0e46b9ae 18/////////////////////////////////////////////////////////////////////////////
19// //
20// AliTOFtrack class //
21// //
22// Authors: Bologna-CERN-ITEP-Salerno Group //
23// //
24// Description: class for handling ESD extracted tracks for TOF matching. //
25// //
26/////////////////////////////////////////////////////////////////////////////
d3c7bfac 27
74ea065c 28#include "AliESDtrack.h"
0e46b9ae 29#include "AliLog.h"
74ea065c 30
655e379f 31#include "AliTOFGeometryV5.h"
0e46b9ae 32#include "AliTOFGeometry.h"
d3c7bfac 33#include "AliTOFtrack.h"
34
74ea065c 35ClassImp(AliTOFtrack)
36
37//_____________________________________________________________________________
655e379f 38AliTOFtrack::AliTOFtrack() :
39 AliKalmanTrack(),
40 fSeedInd(-1),
41 fSeedLab(-1),
42 fAlpha(0),
43 fX(0),
44 fY(0),
45 fZ(0),
46 fE(0),
47 fT(0),
48 fC(0),
49 fCyy(0),
50 fCzy(0),
51 fCzz(0),
52 fCey(0),
53 fCez(0),
54 fCee(0),
55 fCty(0),
56 fCtz(0),
57 fCte(0),
58 fCtt(0),
59 fCcy(0),
60 fCcz(0),
61 fCce(0),
62 fCct(0),
63 fCcc(0),
64 fTOFgeometry(0x0)
65 {
66}//_____________________________________________________________________________
67AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) : AliKalmanTrack(t),
68 fSeedInd(-1),
69 fSeedLab(-1),
70 fAlpha(0),
71 fX(0),
72 fY(0),
73 fZ(0),
74 fE(0),
75 fT(0),
76 fC(0),
77 fCyy(0),
78 fCzy(0),
79 fCzz(0),
80 fCey(0),
81 fCez(0),
82 fCee(0),
83 fCty(0),
84 fCtz(0),
85 fCte(0),
86 fCtt(0),
87 fCcy(0),
88 fCcz(0),
89 fCce(0),
90 fCct(0),
91 fCcc(0),
92 fTOFgeometry(0x0)
93 {
74ea065c 94 //
95 // Copy constructor.
96 //
97
98 SetSeedIndex(t.GetSeedIndex());
99 SetLabel(t.GetLabel());
100 fSeedLab=t.GetSeedLabel();
101 SetChi2(t.GetChi2());
102
103 fAlpha=t.fAlpha;
104 fX=t.fX;
105
106 fY=t.fY; fZ=t.fZ; fE=t.fE; fT=t.fT; fC=t.fC;
107
108 fCyy=t.fCyy;
109 fCzy=t.fCzy; fCzz=t.fCzz;
110 fCey=t.fCey; fCez=t.fCez; fCee=t.fCee;
111 fCty=t.fCty; fCtz=t.fCtz; fCte=t.fCte; fCtt=t.fCtt;
112 fCcy=t.fCcy; fCcz=t.fCcz; fCce=t.fCce; fCct=t.fCct; fCcc=t.fCcc;
113
655e379f 114 fTOFgeometry = new AliTOFGeometryV5();
74ea065c 115
116}
117
118//_____________________________________________________________________________
655e379f 119AliTOFtrack::AliTOFtrack(const AliESDtrack& t):
120 AliKalmanTrack(),
121 fSeedInd(-1),
122 fSeedLab(-1),
123 fAlpha(0),
124 fX(0),
125 fY(0),
126 fZ(0),
127 fE(0),
128 fT(0),
129 fC(0),
130 fCyy(0),
131 fCzy(0),
132 fCzz(0),
133 fCey(0),
134 fCez(0),
135 fCee(0),
136 fCty(0),
137 fCtz(0),
138 fCte(0),
139 fCtt(0),
140 fCcy(0),
141 fCcz(0),
142 fCce(0),
143 fCct(0),
144 fCcc(0),
145 fTOFgeometry(0x0)
146 {
74ea065c 147 //
148 // Constructor from AliESDtrack
149 //
150
655e379f 151 fTOFgeometry = new AliTOFGeometryV5();
d3c7bfac 152
74ea065c 153 SetSeedIndex(-1);
154 SetLabel(t.GetLabel());
155 SetChi2(0.);
156 SetMass(t.GetMass());
157
158 fAlpha = t.GetAlpha();
159 if (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
160 else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
161 Double_t x, p[5]; t.GetExternalParameters(x,p);
162
163 fX=x;
164
74ea065c 165 fY=p[0];
c84a5e9e 166 fZ=p[1]; SaveLocalConvConst();
167 fT=p[3]; x=GetLocalConvConst();
74ea065c 168 fC=p[4]/x;
169 fE=fC*fX - p[2];
170
171 //Conversion of the covariance matrix
172 Double_t c[15]; t.GetExternalCovariance(c);
173
174 c[10]/=x; c[11]/=x; c[12]/=x; c[13]/=x; c[14]/=x*x;
175
176 Double_t c22=fX*fX*c[14] - 2*fX*c[12] + c[5];
177 Double_t c32=fX*c[13] - c[8];
178 Double_t c20=fX*c[10] - c[3], c21=fX*c[11] - c[4], c42=fX*c[14] - c[12];
179
180 fCyy=c[0 ];
181 fCzy=c[1 ]; fCzz=c[2 ];
182 fCey=c20; fCez=c21; fCee=c22;
183 fCty=c[6 ]; fCtz=c[7 ]; fCte=c32; fCtt=c[9 ];
184 fCcy=c[10]; fCcz=c[11]; fCce=c42; fCct=c[13]; fCcc=c[14];
185
186 if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
187 StartTimeIntegral();
188 Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
189 SetIntegratedLength(t.GetIntegratedLength());
190
191
192}
7aeeaf38 193
194//____________________________________________________________________________
195AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &source)
196{
197 // ass. op.
198
199 this->fTOFgeometry=source.fTOFgeometry;
200 return *this;
201
202}
203
74ea065c 204//____________________________________________________________________________
205void AliTOFtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
206 //
207 // This function returns external TOF track representation
208 //
209 xr=fX;
210 x[0]=GetY();
211 x[1]=GetZ();
212 x[2]=GetSnp();
213 x[3]=GetTgl();
214 x[4]=Get1Pt();
215}
216
217//_____________________________________________________________________________
218void AliTOFtrack::GetExternalCovariance(Double_t cc[15]) const {
219 //
220 // This function returns external representation of the covriance matrix.
221 //
c84a5e9e 222 Double_t a=GetLocalConvConst();
74ea065c 223 Double_t c22=fX*fX*fCcc-2*fX*fCce+fCee;
224 Double_t c32=fX*fCct-fCte;
225 Double_t c20=fX*fCcy-fCey, c21=fX*fCcz-fCez, c42=fX*fCcc-fCce;
226
227 cc[0 ]=fCyy;
228 cc[1 ]=fCzy; cc[2 ]=fCzz;
229 cc[3 ]=c20; cc[4 ]=c21; cc[5 ]=c22;
230 cc[6 ]=fCty; cc[7 ]=fCtz; cc[8 ]=c32; cc[9 ]=fCtt;
231 cc[10]=fCcy*a; cc[11]=fCcz*a; cc[12]=c42*a; cc[13]=fCct*a; cc[14]=fCcc*a*a;
232
233}
234
235
236//_____________________________________________________________________________
237void AliTOFtrack::GetCovariance(Double_t cc[15]) const {
2c770f53 238 //
239 // Returns the covariance matrix.
240 //
74ea065c 241
242 cc[0]=fCyy;
243 cc[1]=fCzy; cc[2]=fCzz;
244 cc[3]=fCey; cc[4]=fCez; cc[5]=fCee;
245 cc[6]=fCcy; cc[7]=fCcz; cc[8]=fCce; cc[9]=fCcc;
246 cc[10]=fCty; cc[11]=fCtz; cc[12]=fCte; cc[13]=fCct; cc[14]=fCtt;
247
248}
249
250
251//_____________________________________________________________________________
252Int_t AliTOFtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
253{
254 // Propagates a track of particle with mass=pm to a reference plane
255 // defined by x=xk through media of density=rho and radiationLength=x0
256
257 if (xk == fX) return 1;
258
259 if (TMath::Abs(fC*xk - fE) >= 0.90000) {
260 return 0;
261 }
c84a5e9e 262 Double_t lcc=GetLocalConvConst();
74ea065c 263
264 // track Length measurement [SR, GSI, 17.02.2003]
265
266 Double_t oldX = fX, oldY = fY, oldZ = fZ;
267
268 Double_t x1=fX, x2=x1+(xk-x1), dx=x2-x1, y1=fY, z1=fZ;
269 Double_t c1=fC*x1 - fE;
270 if((c1*c1) > 1){
271 return 0;}
272 Double_t r1=sqrt(1.- c1*c1);
273 Double_t c2=fC*x2 - fE;
274 if((c2*c2) > 1) {
275 return 0;
276 }
277 Double_t r2=sqrt(1.- c2*c2);
278
279 fY += dx*(c1+c2)/(r1+r2);
280 fZ += dx*(c1+c2)/(c1*r2 + c2*r1)*fT;
281
282 //f = F - 1
283 Double_t rr=r1+r2, cc=c1+c2, xx=x1+x2;
284 Double_t f02=-dx*(2*rr + cc*(c1/r1 + c2/r2))/(rr*rr);
285 Double_t f04= dx*(rr*xx + cc*(c1*x1/r1+c2*x2/r2))/(rr*rr);
286 Double_t cr=c1*r2+c2*r1;
287 Double_t f12=-dx*fT*(2*cr + cc*(c2*c1/r1-r1 + c1*c2/r2-r2))/(cr*cr);
288 Double_t f13= dx*cc/cr;
289 Double_t f14=dx*fT*(cr*xx-cc*(r1*x2-c2*c1*x1/r1+r2*x1-c1*c2*x2/r2))/(cr*cr);
290
291 //b = C*ft
292 Double_t b00=f02*fCey + f04*fCcy, b01=f12*fCey + f14*fCcy + f13*fCty;
293 Double_t b10=f02*fCez + f04*fCcz, b11=f12*fCez + f14*fCcz + f13*fCtz;
294 Double_t b20=f02*fCee + f04*fCce, b21=f12*fCee + f14*fCce + f13*fCte;
295 Double_t b30=f02*fCte + f04*fCct, b31=f12*fCte + f14*fCct + f13*fCtt;
296 Double_t b40=f02*fCce + f04*fCcc, b41=f12*fCce + f14*fCcc + f13*fCct;
297
298 //a = f*b = f*C*ft
299 Double_t a00=f02*b20+f04*b40,a01=f02*b21+f04*b41,a11=f12*b21+f14*b41+f13*b31;
300
301 //F*C*Ft = C + (a + b + bt)
302 fCyy += a00 + 2*b00;
303 fCzy += a01 + b01 + b10;
304 fCey += b20;
305 fCty += b30;
306 fCcy += b40;
307 fCzz += a11 + 2*b11;
308 fCez += b21;
309 fCtz += b31;
310 fCcz += b41;
311
312 fX=x2;
313
c84a5e9e 314 //Change of the magnetic field *************
315 SaveLocalConvConst();
316 cc=fC;
317 fC*=lcc/GetLocalConvConst();
318 fE+=fX*(fC-cc);
319
74ea065c 320 //Multiple scattering ******************
321 Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-fY)*(y1-fY)+(z1-fZ)*(z1-fZ));
322 Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
323 Double_t beta2=p2/(p2 + GetMass()*GetMass());
324 Double_t theta2=14.1*14.1/(beta2*p2*1e6)*d/x0*rho;
325
326 Double_t ey=fC*fX - fE, ez=fT;
327 Double_t xz=fC*ez, zz1=ez*ez+1, xy=fE+ey;
328
329 fCee += (2*ey*ez*ez*fE+1-ey*ey+ez*ez+fE*fE*ez*ez)*theta2;
330 fCte += ez*zz1*xy*theta2;
331 fCtt += zz1*zz1*theta2;
332 fCce += xz*ez*xy*theta2;
333 fCct += xz*zz1*theta2;
334 fCcc += xz*xz*theta2;
335 /*
336 Double_t dc22 = (1-ey*ey+xz*xz*fX*fX)*theta2;
337 Double_t dc32 = (xz*fX*zz1)*theta2;
338 Double_t dc33 = (zz1*zz1)*theta2;
339 Double_t dc42 = (xz*fX*xz)*theta2;
340 Double_t dc43 = (zz1*xz)*theta2;
341 Double_t dc44 = (xz*xz)*theta2;
342 fCee += dc22;
343 fCte += dc32;
344 fCtt += dc33;
345 fCce += dc42;
346 fCct += dc43;
347 fCcc += dc44;
348 */
349 //Energy losses************************
350 if((5940*beta2/(1-beta2+1e-10) - beta2) < 0){return 0;}
351
352 Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2+1e-10)) - beta2)*d*rho;
983ebc4f 353 //
354 // suspicious part - think about it ?
355 Double_t kinE = TMath::Sqrt(p2);
356 if (dE>0.8*kinE) dE = 0.8*kinE; //
357 if (dE<0) dE = 0.0; // not valid region for Bethe bloch
358 //
359 //
74ea065c 360 if (x1 < x2) dE=-dE;
361 cc=fC;
362 fC*=(1.- sqrt(p2+GetMass()*GetMass())/p2*dE);
363 fE+=fX*(fC-cc);
364
365 // track time measurement [SR, GSI 17.02.2002]
366 if (x1 < x2)
367 if (IsStartedTimeIntegral()) {
368 Double_t l2 = (fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY) + (fZ-oldZ)*(fZ-oldZ);
369 AddTimeStep(TMath::Sqrt(l2));
370 }
371
372 return 1;
373}
374
375//_____________________________________________________________________________
376Int_t AliTOFtrack::PropagateToInnerTOF( Bool_t holes)
377{
378 // Propagates a track of particle with mass=pm to a reference plane
379 // defined by x=xk through media of density=rho and radiationLength=x0
380
381
d3c7bfac 382 Double_t ymax=fTOFgeometry->RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
74ea065c 383 Bool_t skip = kFALSE;
d3c7bfac 384 Double_t y=GetYat(fTOFgeometry->RinTOF(),skip);
74ea065c 385 if(skip){
386 return 0;
387 }
388 if (y > ymax) {
2c770f53 389 if (!Rotate(AliTOFGeometry::GetAlpha())) {
74ea065c 390 return 0;
391 }
392 } else if (y <-ymax) {
2c770f53 393 if (!Rotate(-AliTOFGeometry::GetAlpha())) {
74ea065c 394 return 0;
395 }
396 }
397
398
2c770f53 399 Double_t x = GetX();
74ea065c 400 Int_t nsteps=Int_t((370.-x)/0.5); // 0.5 cm Steps
401 for (Int_t istep=0;istep<nsteps;istep++){
402 Float_t xp = x+istep*0.5;
403 Double_t param[2];
2c770f53 404 GetPropagationParameters(holes,param);
405 PropagateTo(xp,param[0],param[1]);
74ea065c 406
407 }
408
d3c7bfac 409 if(!PropagateTo(fTOFgeometry->RinTOF()))return 0;
74ea065c 410
411 return 1;
412
413}
414
415//_____________________________________________________________________________
416Int_t AliTOFtrack::Rotate(Double_t alpha)
417{
418 // Rotates track parameters in R*phi plane
419
420
421 fAlpha += alpha;
422 if (fAlpha<-TMath::Pi()) fAlpha += 2*TMath::Pi();
423 if (fAlpha>=TMath::Pi()) fAlpha -= 2*TMath::Pi();
424
425 Double_t x1=fX, y1=fY;
426 Double_t ca=cos(alpha), sa=sin(alpha);
427 Double_t r1=fC*fX - fE;
428
429 fX = x1*ca + y1*sa;
430 fY =-x1*sa + y1*ca;
431 if((r1*r1) > 1) return 0;
432 fE=fE*ca + (fC*y1 + sqrt(1.- r1*r1))*sa;
433
434 Double_t r2=fC*fX - fE;
435 if (TMath::Abs(r2) >= 0.90000) {
d076c8d5 436 AliWarning("Rotation failed !");
74ea065c 437 return 0;
438 }
439
440 if((r2*r2) > 1) return 0;
441 Double_t y0=fY + sqrt(1.- r2*r2)/fC;
442 if ((fY-y0)*fC >= 0.) {
d076c8d5 443 AliWarning("Rotation failed !!!");
74ea065c 444 return 0;
445 }
446
447 //f = F - 1
448 Double_t f00=ca-1, f24=(y1 - r1*x1/sqrt(1.- r1*r1))*sa,
449 f20=fC*sa, f22=(ca + sa*r1/sqrt(1.- r1*r1))-1;
450
451 //b = C*ft
452 Double_t b00=fCyy*f00, b02=fCyy*f20+fCcy*f24+fCey*f22;
453 Double_t b10=fCzy*f00, b12=fCzy*f20+fCcz*f24+fCez*f22;
454 Double_t b20=fCey*f00, b22=fCey*f20+fCce*f24+fCee*f22;
455 Double_t b30=fCty*f00, b32=fCty*f20+fCct*f24+fCte*f22;
456 Double_t b40=fCcy*f00, b42=fCcy*f20+fCcc*f24+fCce*f22;
457
458 //a = f*b = f*C*ft
459 Double_t a00=f00*b00, a02=f00*b02, a22=f20*b02+f24*b42+f22*b22;
460
461 //F*C*Ft = C + (a + b + bt)
462 fCyy += a00 + 2*b00;
463 fCzy += b10;
464 fCey += a02+b20+b02;
465 fCty += b30;
466 fCcy += b40;
467 fCez += b12;
468 fCte += b32;
469 fCee += a22 + 2*b22;
470 fCce += b42;
471
472 return 1;
473}
474
2c770f53 475//_________________________________________________________________________
4668c628 476Double_t AliTOFtrack::GetYat(Double_t xk, Bool_t & skip) const {
2c770f53 477//-----------------------------------------------------------------
478// This function calculates the Y-coordinate of a track at the plane x=xk.
479// Needed for matching with the TOF (I.Belikov)
480//-----------------------------------------------------------------
481 skip=kFALSE;
482 Double_t c1=fC*fX - fE, r1=TMath::Sqrt(TMath::Abs(1.- c1*c1));
483 Double_t c2=fC*xk - fE, r2=TMath::Sqrt(TMath::Abs(1.- c2*c2));
484 if( ((1.- c2*c2)<0) || ((1.- c1*c1)<0) ) skip=kTRUE;
485 return fY + (xk-fX)*(c1+c2)/(r1+r2);
486}
74ea065c 487//_________________________________________________________________________
488void AliTOFtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const
489{
490 // Returns reconstructed track momentum in the global system.
491
492 Double_t pt=TMath::Abs(GetPt()); // GeV/c
493 Double_t r=fC*fX-fE;
494
495 Double_t y0;
496 if(r > 1) { py = pt; px = 0; }
497 else if(r < -1) { py = -pt; px = 0; }
498 else {
499 y0=fY + sqrt(1.- r*r)/fC;
500 px=-pt*(fY-y0)*fC; //cos(phi);
501 py=-pt*(fE-fX*fC); //sin(phi);
502 }
503 pz=pt*fT;
504 Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha);
505 py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha);
506 px=tmp;
507
508}
509
510//_________________________________________________________________________
511void AliTOFtrack::GetGlobalXYZ(Double_t& x, Double_t& y, Double_t& z) const
512{
513 // Returns reconstructed track coordinates in the global system.
514
515 x = fX; y = fY; z = fZ;
516 Double_t tmp=x*TMath::Cos(fAlpha) - y*TMath::Sin(fAlpha);
517 y=x*TMath::Sin(fAlpha) + y*TMath::Cos(fAlpha);
518 x=tmp;
519
520}
521
522//_________________________________________________________________________
523void AliTOFtrack::ResetCovariance() {
524 //
525 // Resets covariance matrix
526 //
527
528 fCyy*=10.;
529 fCzy=0.; fCzz*=10.;
530 fCey=0.; fCez=0.; fCee*=10.;
531 fCty=0.; fCtz=0.; fCte=0.; fCtt*=10.;
532 fCcy=0.; fCcz=0.; fCce=0.; fCct=0.; fCcc*=10.;
533}
534
535
536//_________________________________________________________________________
537void AliTOFtrack::ResetCovariance(Float_t mult) {
538 //
539 // Resets covariance matrix
540 //
541
542 fCyy*=mult;
543 fCzy*=0.; fCzz*=mult;
544 fCey*=0.; fCez*=0.; fCee*=mult;
545 fCty*=0.; fCtz*=0.; fCte*=0.; fCtt*=mult;
546 fCcy*=0.; fCcz*=0.; fCce*=0.; fCct*=0.; fCcc*=mult;
547}
548
549//_____________________________________________________________________________
550Int_t AliTOFtrack::Compare(const TObject *o) const {
551 //-----------------------------------------------------------------
552 // This function compares tracks according to the their curvature
553 //-----------------------------------------------------------------
554 AliTOFtrack *t=(AliTOFtrack*)o;
555 Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
556 Double_t c =GetSigmaY2()*GetSigmaZ2();
557 if (c>co) return 1;
558 else if (c<co) return -1;
559 return 0;
560}
561
562//_____________________________________________________________________________
563void AliTOFtrack::GetPropagationParameters(Bool_t holes, Double_t *param) {
564
2c770f53 565 //Get average medium density, x0 while propagating the track
566
567 //For TRD holes description
74ea065c 568
569 Double_t thetamin = (90.-31.1) * TMath::Pi()/180.;
570 Double_t thetamax = (90.+31.1) * TMath::Pi()/180.;
571
572 Double_t zmin = -55.;
573 Double_t zmax = 55.;
574
2c770f53 575 // Detector inner/outer radii
74ea065c 576 Double_t rTPC = 261.53;
577 Double_t rTPCTRD = 294.5;
578 Double_t rTRD = 369.1;
579
2c770f53 580 // Medium parameters
74ea065c 581 Double_t x0TPC = 40.;
582 Double_t rhoTPC =0.06124;
583
584 Double_t x0Air = 36.66;
585 Double_t rhoAir =1.2931e-3;
586
587 Double_t x0TRD = 171.7;
588 Double_t rhoTRD =0.33;
589
2c770f53 590 Int_t isec = GetSector();
74ea065c 591 Double_t xtr,ytr,ztr;
2c770f53 592 GetGlobalXYZ(xtr,ytr,ztr);
74ea065c 593 Float_t thetatr = TMath::ATan2(TMath::Sqrt(xtr*xtr+ytr*ytr),ztr);
594
595 if(holes){
596 if (isec == 0 || isec == 1 || isec == 2 ) {
597 if( thetatr>=thetamin && thetatr<=thetamax){
598 x0TRD= x0Air;
599 rhoTRD = rhoAir;
600 }
601 }
602 if (isec == 11 || isec == 12 || isec == 13 || isec == 14 || isec == 15 ) {
603 if( ztr>=zmin && ztr<=zmax){
604 x0TRD= x0Air;
605 rhoTRD = rhoAir;
606 }
607 }
608 }
609
2c770f53 610 if(GetX() <= rTPC)
74ea065c 611 {param[0]=x0TPC;param[1]=rhoTPC;}
2c770f53 612 else if(GetX() > rTPC && GetX() < rTPCTRD)
74ea065c 613 {param[0]=x0Air;param[1]=rhoAir;}
2c770f53 614 else if(GetX() >= rTPCTRD && GetX() < rTRD)
74ea065c 615 {param[0]=x0TRD;param[1]=rhoTRD;}
2c770f53 616 else if(GetX() >= rTRD )
74ea065c 617 {param[0]=x0Air;param[1]=rhoAir;}
74ea065c 618}