1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////
29 ///////////////////////////////////////////////////
31 #include "AliMUONTrackExtrap.h"
32 #include "AliMUONTrackParam.h"
33 #include "AliMUONConstants.h"
37 #include <Riostream.h>
40 #include <TGeoManager.h>
43 ClassImp(AliMUONTrackExtrap) // Class implementation in ROOT context
46 const AliMagF* AliMUONTrackExtrap::fgkField = 0x0;
47 const Bool_t AliMUONTrackExtrap::fgkUseHelix = kFALSE;
48 const Int_t AliMUONTrackExtrap::fgkMaxStepNumber = 5000;
49 const Double_t AliMUONTrackExtrap::fgkHelixStepLength = 6.;
50 const Double_t AliMUONTrackExtrap::fgkRungeKuttaMaxResidue = 0.002;
52 //__________________________________________________________________________
53 Double_t AliMUONTrackExtrap::GetImpactParamFromBendingMomentum(Double_t bendingMomentum)
55 /// Returns impact parameter at vertex in bending plane (cm),
56 /// from the signed bending momentum "BendingMomentum" in bending plane (GeV/c),
57 /// using simple values for dipole magnetic field.
58 /// The sign of "BendingMomentum" is the sign of the charge.
60 if (bendingMomentum == 0.) return 1.e10;
62 Double_t simpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
63 Double_t simpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
64 Float_t b[3], x[3] = {0.,0.,(Float_t) simpleBPosition};
65 if (fgkField) fgkField->Field(x,b);
67 cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
70 Double_t simpleBValue = (Double_t) b[0];
72 return (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / bendingMomentum);
75 //__________________________________________________________________________
76 Double_t AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(Double_t impactParam)
78 /// Returns signed bending momentum in bending plane (GeV/c),
79 /// the sign being the sign of the charge for particles moving forward in Z,
80 /// from the impact parameter "ImpactParam" at vertex in bending plane (cm),
81 /// using simple values for dipole magnetic field.
83 if (impactParam == 0.) return 1.e10;
85 Double_t simpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
86 Double_t simpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
87 Float_t b[3], x[3] = {0.,0.,(Float_t) simpleBPosition};
88 if (fgkField) fgkField->Field(x,b);
90 cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
93 Double_t simpleBValue = (Double_t) b[0];
95 return (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / impactParam);
98 //__________________________________________________________________________
99 void AliMUONTrackExtrap::ExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd)
101 /// Interface to track parameter extrapolation to the plane at "Z" using Helix or Rungekutta algorithm.
102 /// On return, the track parameters resulting from the extrapolation are updated in trackParam.
103 if (fgkUseHelix) AliMUONTrackExtrap::ExtrapToZHelix(trackParam,zEnd);
104 else AliMUONTrackExtrap::ExtrapToZRungekutta(trackParam,zEnd);
107 //__________________________________________________________________________
108 void AliMUONTrackExtrap::ExtrapToZHelix(AliMUONTrackParam* trackParam, Double_t zEnd)
110 /// Track parameter extrapolation to the plane at "Z" using Helix algorithm.
111 /// On return, the track parameters resulting from the extrapolation are updated in trackParam.
112 if (trackParam->GetZ() == zEnd) return; // nothing to be done if same Z
113 Double_t forwardBackward; // +1 if forward, -1 if backward
114 if (zEnd < trackParam->GetZ()) forwardBackward = 1.0; // spectro. z<0
115 else forwardBackward = -1.0;
116 Double_t v3[7], v3New[7]; // 7 in parameter ????
117 Int_t i3, stepNumber;
118 // For safety: return kTRUE or kFALSE ????
119 // Parameter vector for calling EXTRAP_ONESTEP
120 ConvertTrackParamForExtrap(trackParam, forwardBackward, v3);
121 // sign of charge (sign of fInverseBendingMomentum if forward motion)
122 // must be changed if backward extrapolation
123 Double_t chargeExtrap = forwardBackward * TMath::Sign(Double_t(1.0), trackParam->GetInverseBendingMomentum());
124 // Extrapolation loop
126 while (((-forwardBackward * (v3[2] - zEnd)) <= 0.0) && (stepNumber < fgkMaxStepNumber)) { // spectro. z<0
128 ExtrapOneStepHelix(chargeExtrap, fgkHelixStepLength, v3, v3New);
129 if ((-forwardBackward * (v3New[2] - zEnd)) > 0.0) break; // one is beyond Z spectro. z<0
130 // better use TArray ????
131 for (i3 = 0; i3 < 7; i3++) {v3[i3] = v3New[i3];}
133 // check fgkMaxStepNumber ????
134 // Interpolation back to exact Z (2nd order)
135 // should be in function ???? using TArray ????
136 Double_t dZ12 = v3New[2] - v3[2]; // 1->2
137 if (TMath::Abs(dZ12) > 0) {
138 Double_t dZ1i = zEnd - v3[2]; // 1-i
139 Double_t dZi2 = v3New[2] - zEnd; // i->2
140 Double_t xPrime = (v3New[0] - v3[0]) / dZ12;
141 Double_t xSecond = ((v3New[3] / v3New[5]) - (v3[3] / v3[5])) / dZ12;
142 Double_t yPrime = (v3New[1] - v3[1]) / dZ12;
143 Double_t ySecond = ((v3New[4] / v3New[5]) - (v3[4] / v3[5])) / dZ12;
144 v3[0] = v3[0] + xPrime * dZ1i - 0.5 * xSecond * dZ1i * dZi2; // X
145 v3[1] = v3[1] + yPrime * dZ1i - 0.5 * ySecond * dZ1i * dZi2; // Y
147 Double_t xPrimeI = xPrime - 0.5 * xSecond * (dZi2 - dZ1i);
148 Double_t yPrimeI = yPrime - 0.5 * ySecond * (dZi2 - dZ1i);
149 // (PX, PY, PZ)/PTOT assuming forward motion
150 v3[5] = 1.0 / TMath::Sqrt(1.0 + xPrimeI * xPrimeI + yPrimeI * yPrimeI); // PZ/PTOT
151 v3[3] = xPrimeI * v3[5]; // PX/PTOT
152 v3[4] = yPrimeI * v3[5]; // PY/PTOT
154 cout<<"W-AliMUONTrackExtrap::ExtrapToZHelix: Extrap. to Z not reached, Z = "<<zEnd<<endl;
156 // Recover track parameters (charge back for forward motion)
157 RecoverTrackParam(v3, chargeExtrap * forwardBackward, trackParam);
160 //__________________________________________________________________________
161 void AliMUONTrackExtrap::ExtrapToZRungekutta(AliMUONTrackParam* trackParam, Double_t zEnd)
163 /// Track parameter extrapolation to the plane at "Z" using Rungekutta algorithm.
164 /// On return, the track parameters resulting from the extrapolation are updated in trackParam.
165 if (trackParam->GetZ() == zEnd) return; // nothing to be done if same Z
166 Double_t forwardBackward; // +1 if forward, -1 if backward
167 if (zEnd < trackParam->GetZ()) forwardBackward = 1.0; // spectro. z<0
168 else forwardBackward = -1.0;
169 // sign of charge (sign of fInverseBendingMomentum if forward motion)
170 // must be changed if backward extrapolation
171 Double_t chargeExtrap = forwardBackward * TMath::Sign(Double_t(1.0), trackParam->GetInverseBendingMomentum());
172 Double_t v3[7], v3New[7];
174 Int_t stepNumber = 0;
176 // Extrapolation loop (until within tolerance)
177 Double_t residue = zEnd - trackParam->GetZ();
178 while (TMath::Abs(residue) > fgkRungeKuttaMaxResidue && stepNumber <= fgkMaxStepNumber) {
179 dZ = zEnd - trackParam->GetZ();
180 // step lenght assuming linear trajectory
181 step = dZ * TMath::Sqrt(1.0 + trackParam->GetBendingSlope()*trackParam->GetBendingSlope() +
182 trackParam->GetNonBendingSlope()*trackParam->GetNonBendingSlope());
183 ConvertTrackParamForExtrap(trackParam, forwardBackward, v3);
184 do { // reduce step lenght while zEnd oversteped
185 if (stepNumber > fgkMaxStepNumber) {
186 cout<<"W-AliMUONTrackExtrap::ExtrapToZRungekutta: Too many trials: "<<stepNumber<<endl;
190 step = TMath::Abs(step);
191 AliMUONTrackExtrap::ExtrapOneStepRungekutta(chargeExtrap,step,v3,v3New);
192 residue = zEnd - v3New[2];
193 step *= dZ/(v3New[2]-trackParam->GetZ());
194 } while (residue*dZ < 0 && TMath::Abs(residue) > fgkRungeKuttaMaxResidue);
195 RecoverTrackParam(v3New, chargeExtrap * forwardBackward, trackParam);
198 // terminate the extropolation with a straight line up to the exact "zEnd" value
199 trackParam->SetNonBendingCoor(trackParam->GetNonBendingCoor() + residue * trackParam->GetNonBendingSlope());
200 trackParam->SetBendingCoor(trackParam->GetBendingCoor() + residue * trackParam->GetBendingSlope());
201 trackParam->SetZ(zEnd);
204 //__________________________________________________________________________
205 void AliMUONTrackExtrap::ConvertTrackParamForExtrap(AliMUONTrackParam* trackParam, Double_t forwardBackward, Double_t *v3)
207 /// Set vector of Geant3 parameters pointed to by "v3" from track parameters in trackParam.
208 /// Since AliMUONTrackParam is only geometry, one uses "forwardBackward"
209 /// to know whether the particle is going forward (+1) or backward (-1).
210 v3[0] = trackParam->GetNonBendingCoor(); // X
211 v3[1] = trackParam->GetBendingCoor(); // Y
212 v3[2] = trackParam->GetZ(); // Z
213 Double_t pYZ = TMath::Abs(1.0 / trackParam->GetInverseBendingMomentum());
214 Double_t pZ = pYZ / TMath::Sqrt(1.0 + trackParam->GetBendingSlope() * trackParam->GetBendingSlope());
215 v3[6] = TMath::Sqrt(pYZ * pYZ + pZ * pZ * trackParam->GetNonBendingSlope() * trackParam->GetNonBendingSlope()); // PTOT
216 v3[5] = -forwardBackward * pZ / v3[6]; // PZ/PTOT spectro. z<0
217 v3[3] = trackParam->GetNonBendingSlope() * v3[5]; // PX/PTOT
218 v3[4] = trackParam->GetBendingSlope() * v3[5]; // PY/PTOT
221 //__________________________________________________________________________
222 void AliMUONTrackExtrap::RecoverTrackParam(Double_t *v3, Double_t charge, AliMUONTrackParam* trackParam)
224 /// Set track parameters in trackParam from Geant3 parameters pointed to by "v3",
225 /// assumed to be calculated for forward motion in Z.
226 /// "InverseBendingMomentum" is signed with "charge".
227 trackParam->SetNonBendingCoor(v3[0]); // X
228 trackParam->SetBendingCoor(v3[1]); // Y
229 trackParam->SetZ(v3[2]); // Z
230 Double_t pYZ = v3[6] * TMath::Sqrt(1.0 - v3[3] * v3[3]);
231 trackParam->SetInverseBendingMomentum(charge/pYZ);
232 trackParam->SetBendingSlope(v3[4]/v3[5]);
233 trackParam->SetNonBendingSlope(v3[3]/v3[5]);
236 //__________________________________________________________________________
237 void AliMUONTrackExtrap::ExtrapToZCov(AliMUONTrackParam* trackParam, Double_t zEnd)
239 /// Track parameters and their covariances extrapolated to the plane at "zEnd".
240 /// On return, results from the extrapolation are updated in trackParam.
242 if (trackParam->GetZ() == zEnd) return; // nothing to be done if same z
244 // Save the actual track parameters
245 AliMUONTrackParam trackParamSave(*trackParam);
246 Double_t nonBendingCoor = trackParamSave.GetNonBendingCoor();
247 Double_t nonBendingSlope = trackParamSave.GetNonBendingSlope();
248 Double_t bendingCoor = trackParamSave.GetBendingCoor();
249 Double_t bendingSlope = trackParamSave.GetBendingSlope();
250 Double_t inverseBendingMomentum = trackParamSave.GetInverseBendingMomentum();
251 Double_t zBegin = trackParamSave.GetZ();
253 // Extrapolate track parameters to "zEnd"
254 ExtrapToZ(trackParam,zEnd);
255 Double_t extrapNonBendingCoor = trackParam->GetNonBendingCoor();
256 Double_t extrapNonBendingSlope = trackParam->GetNonBendingSlope();
257 Double_t extrapBendingCoor = trackParam->GetBendingCoor();
258 Double_t extrapBendingSlope = trackParam->GetBendingSlope();
259 Double_t extrapInverseBendingMomentum = trackParam->GetInverseBendingMomentum();
261 // Get the pointer to the parameter covariance matrix
262 if (!trackParam->CovariancesExist()) {
263 //cout<<"W-AliMUONTrackExtrap::ExtrapToZCov: track parameter covariance matrix does not exist"<<endl;
264 //cout<<" -> nothing to extrapolate !!"<<endl;
267 TMatrixD* paramCov = trackParam->GetCovariances();
269 // Calculate the jacobian related to the track parameters extrapolation to "zEnd"
273 for (Int_t i=0; i<5; i++) {
274 // Skip jacobian calculation for parameters with no associated error
275 if ((*paramCov)(i,i) == 0.) continue;
276 // Small variation of parameter i only
277 for (Int_t j=0; j<5; j++) {
279 dParam[j] = TMath::Sqrt((*paramCov)(i,i));
280 if (j == 4) dParam[j] *= TMath::Sign(1.,-inverseBendingMomentum); // variation always in the same direction
281 } else dParam[j] = 0.;
283 // Set new parameters
284 trackParamSave.SetNonBendingCoor (nonBendingCoor + dParam[0]);
285 trackParamSave.SetNonBendingSlope (nonBendingSlope + dParam[1]);
286 trackParamSave.SetBendingCoor (bendingCoor + dParam[2]);
287 trackParamSave.SetBendingSlope (bendingSlope + dParam[3]);
288 trackParamSave.SetInverseBendingMomentum(inverseBendingMomentum + dParam[4]);
289 trackParamSave.SetZ (zBegin);
290 // Extrapolate new track parameters to "zEnd"
291 ExtrapToZ(&trackParamSave,zEnd);
292 // Calculate the jacobian
293 jacob(0,i) = (trackParamSave.GetNonBendingCoor() - extrapNonBendingCoor ) / dParam[i];
294 jacob(1,i) = (trackParamSave.GetNonBendingSlope() - extrapNonBendingSlope ) / dParam[i];
295 jacob(2,i) = (trackParamSave.GetBendingCoor() - extrapBendingCoor ) / dParam[i];
296 jacob(3,i) = (trackParamSave.GetBendingSlope() - extrapBendingSlope ) / dParam[i];
297 jacob(4,i) = (trackParamSave.GetInverseBendingMomentum() - extrapInverseBendingMomentum) / dParam[i];
300 // Extrapolate track parameter covariances to "zEnd"
301 TMatrixD tmp((*paramCov),TMatrixD::kMultTranspose,jacob);
302 (*paramCov) = TMatrixD(jacob,TMatrixD::kMult,tmp);
306 //__________________________________________________________________________
307 void AliMUONTrackExtrap::ExtrapToStation(AliMUONTrackParam* trackParamIn, Int_t station, AliMUONTrackParam *trackParamOut)
309 /// Track parameters extrapolated from "trackParamIn" to both chambers of the station(0..) "station"
310 /// are returned in the array (dimension 2) of track parameters pointed to by "TrackParamOut"
311 /// (index 0 and 1 for first and second chambers).
312 Double_t extZ[2], z1, z2;
313 Int_t i1 = -1, i2 = -1; // = -1 to avoid compilation warnings
314 // range of station to be checked ????
315 z1 = AliMUONConstants::DefaultChamberZ(2 * station);
316 z2 = AliMUONConstants::DefaultChamberZ(2 * station + 1);
317 // First and second Z to extrapolate at
318 if ((z1 > trackParamIn->GetZ()) && (z2 > trackParamIn->GetZ())) {i1 = 0; i2 = 1;}
319 else if ((z1 < trackParamIn->GetZ()) && (z2 < trackParamIn->GetZ())) {i1 = 1; i2 = 0;}
321 cout<<"E-AliMUONTrackExtrap::ExtrapToStation: Starting Z ("<<trackParamIn->GetZ()
322 <<") in between z1 ("<<z1<<") and z2 ("<<z2<<") of station(0..)"<<station<<endl;
327 // copy of track parameters
328 trackParamOut[i1] = *trackParamIn;
329 // first extrapolation
330 ExtrapToZ(&(trackParamOut[i1]),extZ[0]);
331 trackParamOut[i2] = trackParamOut[i1];
332 // second extrapolation
333 ExtrapToZ(&(trackParamOut[i2]),extZ[1]);
337 //__________________________________________________________________________
338 void AliMUONTrackExtrap::ExtrapToVertexUncorrected(AliMUONTrackParam* trackParam, Double_t zVtx)
340 /// Extrapolation to the vertex (at the z position "zVtx") without Branson and energy loss corrections.
341 /// Returns the track parameters resulting from the extrapolation in the current TrackParam.
342 /// Include multiple Coulomb scattering effects in trackParam covariances.
344 if (trackParam->GetZ() == zVtx) return; // nothing to be done if already at vertex
346 if (trackParam->GetZ() > zVtx) { // spectro. (z<0)
347 cout<<"W-AliMUONTrackExtrap::ExtrapToVertexUncorrected: Starting Z ("<<trackParam->GetZ()
348 <<") upstream the vertex (zVtx = "<<zVtx<<")"<<endl;
352 // Check whether the geometry is available and get absorber boundaries
354 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: no TGeo"<<endl;
357 TGeoNode *absNode = gGeoManager->GetVolume("ALIC")->GetNode("ABSM_1");
359 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: failed to get absorber node"<<endl;
362 Double_t zAbsBeg, zAbsEnd;
363 absNode->GetVolume()->GetShape()->GetAxisRange(3,zAbsBeg,zAbsEnd);
364 const Double_t *absPos = absNode->GetMatrix()->GetTranslation();
365 zAbsBeg = absPos[2] - zAbsBeg; // spectro. (z<0)
366 zAbsEnd = absPos[2] - zAbsEnd; // spectro. (z<0)
368 // Check the vertex position relatively to the absorber
369 if (zVtx < zAbsBeg && zVtx > zAbsEnd) { // spectro. (z<0)
370 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Ending Z ("<<zVtx
371 <<") inside the front absorber ("<<zAbsBeg<<","<<zAbsEnd<<")"<<endl;
372 } else if (zVtx < zAbsEnd ) { // spectro. (z<0)
373 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Ending Z ("<<zVtx
374 <<") downstream the front absorber (zAbsorberEnd = "<<zAbsEnd<<")"<<endl;
375 ExtrapToZCov(trackParam,zVtx);
379 // Check the track position relatively to the absorber and extrapolate track parameters to the end of the absorber if needed
380 if (trackParam->GetZ() > zAbsBeg) { // spectro. (z<0)
381 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<<trackParam->GetZ()
382 <<") upstream the front absorber (zAbsorberBegin = "<<zAbsBeg<<")"<<endl;
383 ExtrapToZCov(trackParam,zVtx);
385 } else if (trackParam->GetZ() > zAbsEnd) { // spectro. (z<0)
386 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<<trackParam->GetZ()
387 <<") inside the front absorber ("<<zAbsBeg<<","<<zAbsEnd<<")"<<endl;
389 ExtrapToZCov(trackParam,zAbsEnd);
392 // Then add MCS effect in absorber to the parameters covariances
393 AliMUONTrackParam trackParamIn(*trackParam);
394 ExtrapToZ(&trackParamIn, TMath::Min(zVtx, zAbsBeg));
395 Double_t trackXYZIn[3];
396 trackXYZIn[0] = trackParamIn.GetNonBendingCoor();
397 trackXYZIn[1] = trackParamIn.GetBendingCoor();
398 trackXYZIn[2] = trackParamIn.GetZ();
399 Double_t trackXYZOut[3];
400 trackXYZOut[0] = trackParam->GetNonBendingCoor();
401 trackXYZOut[1] = trackParam->GetBendingCoor();
402 trackXYZOut[2] = trackParam->GetZ();
403 Double_t pathLength = 0.;
407 Double_t meanRho = 0.;
408 GetAbsorberCorrectionParam(trackXYZIn,trackXYZOut,pathLength,f0,f1,f2,meanRho);
409 AddMCSEffectInAbsorber(trackParam,pathLength,f0,f1,f2);
411 // finally go to the vertex
412 ExtrapToZCov(trackParam,zVtx);
416 //__________________________________________________________________________
417 void AliMUONTrackExtrap::AddMCSEffectInAbsorber(AliMUONTrackParam* param, Double_t pathLength, Double_t f0, Double_t f1, Double_t f2)
419 /// Add to the track parameter covariances the effects of multiple Coulomb scattering
420 /// at the end of the front absorber using the absorber correction parameters
422 // absorber related covariance parameters
423 Double_t bendingSlope = param->GetBendingSlope();
424 Double_t nonBendingSlope = param->GetNonBendingSlope();
425 Double_t inverseBendingMomentum = param->GetInverseBendingMomentum();
426 Double_t alpha2 = 0.0136 * 0.0136 * inverseBendingMomentum * inverseBendingMomentum * (1.0 + bendingSlope * bendingSlope) /
427 (1.0 + bendingSlope *bendingSlope + nonBendingSlope * nonBendingSlope); // velocity = 1
428 Double_t varCoor = alpha2 * (pathLength * pathLength * f0 - 2. * pathLength * f1 + f2);
429 Double_t covCorrSlope = alpha2 * (pathLength * f0 - f1);
430 Double_t varSlop = alpha2 * f0;
432 TMatrixD* paramCov = param->GetCovariances();
434 (*paramCov)(0,0) += varCoor; (*paramCov)(0,1) += covCorrSlope;
435 (*paramCov)(1,0) += covCorrSlope; (*paramCov)(1,1) += varSlop;
437 (*paramCov)(2,2) += varCoor; (*paramCov)(2,3) += covCorrSlope;
438 (*paramCov)(3,2) += covCorrSlope; (*paramCov)(3,3) += varSlop;
442 //__________________________________________________________________________
443 void AliMUONTrackExtrap::GetAbsorberCorrectionParam(Double_t trackXYZIn[3], Double_t trackXYZOut[3], Double_t &pathLength,
444 Double_t &f0, Double_t &f1, Double_t &f2, Double_t &meanRho)
446 /// Parameters used to correct for Multiple Coulomb Scattering and energy loss in absorber
447 /// Calculated assuming a linear propagation between track positions trackXYZIn and trackXYZOut
448 // pathLength: path length between trackXYZIn and trackXYZOut (cm)
449 // f0: 0th moment of z calculated with the inverse radiation-length distribution
450 // f1: 1st moment of z calculated with the inverse radiation-length distribution
451 // f2: 2nd moment of z calculated with the inverse radiation-length distribution
452 // meanRho: average density of crossed material (g/cm3)
454 // Reset absorber's parameters
461 // Check whether the geometry is available
463 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: no TGeo"<<endl;
467 // Initialize starting point and direction
468 pathLength = TMath::Sqrt((trackXYZOut[0] - trackXYZIn[0])*(trackXYZOut[0] - trackXYZIn[0])+
469 (trackXYZOut[1] - trackXYZIn[1])*(trackXYZOut[1] - trackXYZIn[1])+
470 (trackXYZOut[2] - trackXYZIn[2])*(trackXYZOut[2] - trackXYZIn[2]));
471 if (pathLength < TGeoShape::Tolerance()) return;
473 b[0] = (trackXYZOut[0] - trackXYZIn[0]) / pathLength;
474 b[1] = (trackXYZOut[1] - trackXYZIn[1]) / pathLength;
475 b[2] = (trackXYZOut[2] - trackXYZIn[2]) / pathLength;
476 TGeoNode *currentnode = gGeoManager->InitTrack(trackXYZIn, b);
478 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: start point out of geometry"<<endl;
482 // loop over absorber slices and calculate absorber's parameters
483 Double_t rho = 0.; // material density (g/cm3)
484 Double_t x0 = 0.; // radiation-length (cm-1)
485 Double_t localPathLength = 0;
486 Double_t remainingPathLength = pathLength;
487 Double_t zB = trackXYZIn[2];
488 Double_t zE, dzB, dzE;
490 // Get material properties
491 TGeoMaterial *material = currentnode->GetVolume()->GetMedium()->GetMaterial();
492 rho = material->GetDensity();
493 x0 = material->GetRadLen();
494 if (!material->IsMixture()) x0 /= rho; // different normalization in the modeler for mixture
496 // Get path length within this material
497 gGeoManager->FindNextBoundary(remainingPathLength);
498 localPathLength = gGeoManager->GetStep() + 1.e-6;
499 // Check if boundary within remaining path length. If so, make sure to cross the boundary to prepare the next step
500 if (localPathLength >= remainingPathLength) localPathLength = remainingPathLength;
502 currentnode = gGeoManager->Step();
504 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: navigation failed"<<endl;
505 f0 = f1 = f2 = meanRho = 0.;
508 if (!gGeoManager->IsEntering()) {
509 // make another small step to try to enter in new absorber slice
510 gGeoManager->SetStep(0.001);
511 currentnode = gGeoManager->Step();
512 if (!gGeoManager->IsEntering() || !currentnode) {
513 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: navigation failed"<<endl;
514 f0 = f1 = f2 = meanRho = 0.;
517 localPathLength += 0.001;
521 // calculate absorber's parameters
522 zE = b[2] * localPathLength + zB;
523 dzB = zB - trackXYZIn[2];
524 dzE = zE - trackXYZIn[2];
525 f0 += localPathLength / x0;
526 f1 += (dzE*dzE - dzB*dzB) / b[2] / b[2] / x0 / 2.;
527 f2 += (dzE*dzE*dzE - dzB*dzB*dzB) / b[2] / b[2] / b[2] / x0 / 3.;
528 meanRho += localPathLength * rho;
532 remainingPathLength -= localPathLength;
533 } while (remainingPathLength > TGeoShape::Tolerance());
535 meanRho /= pathLength;
538 //__________________________________________________________________________
539 void AliMUONTrackExtrap::AddMCSEffect(AliMUONTrackParam *param, Double_t dZ, Double_t x0)
541 /// Add to the track parameter covariances the effects of multiple Coulomb scattering
542 /// through a material of thickness "dZ" and of radiation length "x0"
543 /// assuming linear propagation and using the small angle approximation.
545 Double_t bendingSlope = param->GetBendingSlope();
546 Double_t nonBendingSlope = param->GetNonBendingSlope();
547 Double_t inverseTotalMomentum2 = param->GetInverseBendingMomentum() * param->GetInverseBendingMomentum() *
548 (1.0 + bendingSlope * bendingSlope) /
549 (1.0 + bendingSlope *bendingSlope + nonBendingSlope * nonBendingSlope);
550 // Path length in the material
551 Double_t pathLength = TMath::Abs(dZ) * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
552 Double_t pathLength2 = pathLength * pathLength;
553 // relativistic velocity
555 // Angular dispersion square of the track (variance) in a plane perpendicular to the trajectory
556 Double_t theta02 = 0.0136 / velo * (1 + 0.038 * TMath::Log(pathLength/x0));
557 theta02 *= theta02 * inverseTotalMomentum2 * pathLength / x0;
559 // Add effects of multiple Coulomb scattering in track parameter covariances
560 TMatrixD* paramCov = param->GetCovariances();
561 Double_t varCoor = pathLength2 * theta02 / 3.;
562 Double_t varSlop = theta02;
563 Double_t covCorrSlope = pathLength * theta02 / 2.;
565 (*paramCov)(0,0) += varCoor; (*paramCov)(0,1) += covCorrSlope;
566 (*paramCov)(1,0) += covCorrSlope; (*paramCov)(1,1) += varSlop;
568 (*paramCov)(2,2) += varCoor; (*paramCov)(2,3) += covCorrSlope;
569 (*paramCov)(3,2) += covCorrSlope; (*paramCov)(3,3) += varSlop;
573 //__________________________________________________________________________
574 void AliMUONTrackExtrap::ExtrapToVertex(AliMUONTrackParam* trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx)
576 /// Extrapolation to the vertex.
577 /// Returns the track parameters resulting from the extrapolation in the current TrackParam.
578 /// Changes parameters according to Branson correction through the absorber and energy loss
580 if (trackParam->GetZ() == zVtx) return; // nothing to be done if already at vertex
582 if (trackParam->GetZ() > zVtx) { // spectro. (z<0)
583 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<<trackParam->GetZ()
584 <<") upstream the vertex (zVtx = "<<zVtx<<")"<<endl;
588 // Check whether the geometry is available and get absorber boundaries
590 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: no TGeo"<<endl;
593 TGeoNode *absNode = gGeoManager->GetVolume("ALIC")->GetNode("ABSM_1");
595 cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: failed to get absorber node"<<endl;
598 Double_t zAbsBeg, zAbsEnd;
599 absNode->GetVolume()->GetShape()->GetAxisRange(3,zAbsBeg,zAbsEnd);
600 const Double_t *absPos = absNode->GetMatrix()->GetTranslation();
601 zAbsBeg = absPos[2] - zAbsBeg; // spectro. (z<0)
602 zAbsEnd = absPos[2] - zAbsEnd; // spectro. (z<0)
604 // Check the vertex position relatively to the absorber
605 if (zVtx < zAbsBeg && zVtx > zAbsEnd) { // spectro. (z<0)
606 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Ending Z ("<<zVtx
607 <<") inside the front absorber ("<<zAbsBeg<<","<<zAbsEnd<<")"<<endl;
608 } else if (zVtx < zAbsEnd ) { // spectro. (z<0)
609 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Ending Z ("<<zVtx
610 <<") downstream the front absorber (zAbsorberEnd = "<<zAbsEnd<<")"<<endl;
611 ExtrapToZ(trackParam,zVtx);
615 // Check the track position relatively to the absorber and extrapolate track parameters to the end of the absorber if needed
616 if (trackParam->GetZ() > zAbsBeg) { // spectro. (z<0)
617 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<<trackParam->GetZ()
618 <<") upstream the front absorber (zAbsorberBegin = "<<zAbsBeg<<")"<<endl;
619 ExtrapToZ(trackParam,zVtx);
621 } else if (trackParam->GetZ() > zAbsEnd) { // spectro. (z<0)
622 cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<<trackParam->GetZ()
623 <<") inside the front absorber ("<<zAbsBeg<<","<<zAbsEnd<<")"<<endl;
625 ExtrapToZ(trackParam,zAbsEnd);
628 // Get absorber correction parameters assuming linear propagation from vertex to the track position
629 Double_t trackXYZOut[3];
630 trackXYZOut[0] = trackParam->GetNonBendingCoor();
631 trackXYZOut[1] = trackParam->GetBendingCoor();
632 trackXYZOut[2] = trackParam->GetZ();
633 Double_t trackXYZIn[3];
634 trackXYZIn[2] = TMath::Min(zVtx, zAbsBeg); // spectro. (z<0)
635 trackXYZIn[0] = trackXYZOut[0] + (xVtx - trackXYZOut[0]) / (zVtx - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
636 trackXYZIn[1] = trackXYZOut[1] + (yVtx - trackXYZOut[1]) / (zVtx - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
637 Double_t pathLength = 0.;
641 Double_t meanRho = 0.;
642 GetAbsorberCorrectionParam(trackXYZIn,trackXYZOut,pathLength,f0,f1,f2,meanRho);
644 // Calculate energy loss
645 Double_t pTot = trackParam->P();
646 Double_t charge = TMath::Sign(Double_t(1.0), trackParam->GetInverseBendingMomentum());
647 Double_t deltaP = TotalMomentumEnergyLoss(pTot,pathLength,meanRho);
649 // Correct for half of energy loss
650 pTot += 0.5 * deltaP;
652 // Position of the Branson plane (spectro. (z<0))
653 Double_t zB = (f1>0.) ? trackXYZIn[2] - f2/f1 : 0.;
655 // Get track position in the Branson plane corrected for magnetic field effect
656 ExtrapToZ(trackParam,zVtx);
657 Double_t xB = trackParam->GetNonBendingCoor() + (zB - zVtx) * trackParam->GetNonBendingSlope();
658 Double_t yB = trackParam->GetBendingCoor() + (zB - zVtx) * trackParam->GetBendingSlope();
660 // Get track slopes corrected for multiple scattering (spectro. (z<0))
661 Double_t nonBendingSlope = (zB<0.) ? (xB - xVtx) / (zB - zVtx) : trackParam->GetNonBendingSlope();
662 Double_t bendingSlope = (zB<0.) ? (yB - yVtx) / (zB - zVtx) : trackParam->GetBendingSlope();
664 // Correct for second half of energy loss
665 pTot += 0.5 * deltaP;
667 // Set track parameters at vertex
668 trackParam->SetNonBendingCoor(xVtx);
669 trackParam->SetBendingCoor(yVtx);
670 trackParam->SetZ(zVtx);
671 trackParam->SetNonBendingSlope(nonBendingSlope);
672 trackParam->SetBendingSlope(bendingSlope);
673 trackParam->SetInverseBendingMomentum(charge / pTot *
674 TMath::Sqrt(1.0 + nonBendingSlope*nonBendingSlope + bendingSlope*bendingSlope) /
675 TMath::Sqrt(1.0 + bendingSlope*bendingSlope));
679 //__________________________________________________________________________
680 Double_t AliMUONTrackExtrap::TotalMomentumEnergyLoss(Double_t pTotal, Double_t pathLength, Double_t rho)
682 /// Returns the total momentum energy loss in the front absorber
683 Double_t muMass = 0.10566;
684 Double_t p2=pTotal*pTotal;
685 Double_t beta2=p2/(p2 + muMass*muMass);
686 Double_t dE=ApproximateBetheBloch(beta2)*pathLength*rho;
691 //__________________________________________________________________________
692 Double_t AliMUONTrackExtrap::ApproximateBetheBloch(Double_t beta2) {
693 //------------------------------------------------------------------
694 // This is an approximation of the Bethe-Bloch formula with
695 // the density effect taken into account at beta*gamma > 3.5
696 // (the approximation is reasonable only for solid materials)
697 //------------------------------------------------------------------
698 if (beta2/(1-beta2)>3.5*3.5)
699 return 0.153e-3/beta2*(log(3.5*5940)+0.5*log(beta2/(1-beta2)) - beta2);
701 return 0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2);
704 //__________________________________________________________________________
705 void AliMUONTrackExtrap::ExtrapOneStepHelix(Double_t charge, Double_t step, Double_t *vect, Double_t *vout)
707 /// ******************************************************************
709 /// * Performs the tracking of one step in a magnetic field *
710 /// * The trajectory is assumed to be a helix in a constant field *
711 /// * taken at the mid point of the step. *
714 /// * STEP =arc length of the step asked *
715 /// * VECT =input vector (position,direction cos and momentum) *
716 /// * CHARGE= electric charge of the particle *
718 /// * VOUT = same as VECT after completion of the step *
720 /// * ==>Called by : <USER>, GUSWIM *
721 /// * Author m.hansroul ********* *
722 /// * modified s.egli, s.v.levonian *
723 /// * modified v.perevoztchikov
725 /// ******************************************************************
727 // modif: everything in double precision
729 Double_t xyz[3], h[4], hxp[3];
730 Double_t h2xy, hp, rho, tet;
731 Double_t sint, sintt, tsint, cos1t;
732 Double_t f1, f2, f3, f4, f5, f6;
737 const Int_t kipx = 3;
738 const Int_t kipy = 4;
739 const Int_t kipz = 5;
740 const Int_t kipp = 6;
742 const Double_t kec = 2.9979251e-4;
744 // ------------------------------------------------------------------
746 // units are kgauss,centimeters,gev/c
748 vout[kipp] = vect[kipp];
749 if (TMath::Abs(charge) < 0.00001) {
750 for (Int_t i = 0; i < 3; i++) {
751 vout[i] = vect[i] + step * vect[i+3];
752 vout[i+3] = vect[i+3];
756 xyz[0] = vect[kix] + 0.5 * step * vect[kipx];
757 xyz[1] = vect[kiy] + 0.5 * step * vect[kipy];
758 xyz[2] = vect[kiz] + 0.5 * step * vect[kipz];
760 //cmodif: call gufld (xyz, h) changed into:
763 h2xy = h[0]*h[0] + h[1]*h[1];
764 h[3] = h[2]*h[2]+ h2xy;
766 for (Int_t i = 0; i < 3; i++) {
767 vout[i] = vect[i] + step * vect[i+3];
768 vout[i+3] = vect[i+3];
772 if (h2xy < 1.e-12*h[3]) {
773 ExtrapOneStepHelix3(charge*h[2], step, vect, vout);
776 h[3] = TMath::Sqrt(h[3]);
782 hxp[0] = h[1]*vect[kipz] - h[2]*vect[kipy];
783 hxp[1] = h[2]*vect[kipx] - h[0]*vect[kipz];
784 hxp[2] = h[0]*vect[kipy] - h[1]*vect[kipx];
786 hp = h[0]*vect[kipx] + h[1]*vect[kipy] + h[2]*vect[kipz];
788 rho = -charge*h[3]/vect[kipp];
791 if (TMath::Abs(tet) > 0.15) {
792 sint = TMath::Sin(tet);
794 tsint = (tet-sint)/tet;
795 cos1t = 2.*(TMath::Sin(0.5*tet))*(TMath::Sin(0.5*tet))/tet;
798 sintt = (1. - tsint);
805 f3 = step * tsint * hp;
808 f6 = tet * cos1t * hp;
810 vout[kix] = vect[kix] + f1*vect[kipx] + f2*hxp[0] + f3*h[0];
811 vout[kiy] = vect[kiy] + f1*vect[kipy] + f2*hxp[1] + f3*h[1];
812 vout[kiz] = vect[kiz] + f1*vect[kipz] + f2*hxp[2] + f3*h[2];
814 vout[kipx] = vect[kipx] + f4*vect[kipx] + f5*hxp[0] + f6*h[0];
815 vout[kipy] = vect[kipy] + f4*vect[kipy] + f5*hxp[1] + f6*h[1];
816 vout[kipz] = vect[kipz] + f4*vect[kipz] + f5*hxp[2] + f6*h[2];
821 //__________________________________________________________________________
822 void AliMUONTrackExtrap::ExtrapOneStepHelix3(Double_t field, Double_t step, Double_t *vect, Double_t *vout)
824 /// ******************************************************************
826 /// * Tracking routine in a constant field oriented *
828 /// * Tracking is performed with a conventional *
829 /// * helix step method *
831 /// * ==>Called by : <USER>, GUSWIM *
832 /// * Authors R.Brun, M.Hansroul ********* *
833 /// * Rewritten V.Perevoztchikov
835 /// ******************************************************************
838 Double_t h4, hp, rho, tet;
839 Double_t sint, sintt, tsint, cos1t;
840 Double_t f1, f2, f3, f4, f5, f6;
845 const Int_t kipx = 3;
846 const Int_t kipy = 4;
847 const Int_t kipz = 5;
848 const Int_t kipp = 6;
850 const Double_t kec = 2.9979251e-4;
853 // ------------------------------------------------------------------
855 // units are kgauss,centimeters,gev/c
857 vout[kipp] = vect[kipp];
860 hxp[0] = - vect[kipy];
861 hxp[1] = + vect[kipx];
865 rho = -h4/vect[kipp];
867 if (TMath::Abs(tet) > 0.15) {
868 sint = TMath::Sin(tet);
870 tsint = (tet-sint)/tet;
871 cos1t = 2.* TMath::Sin(0.5*tet) * TMath::Sin(0.5*tet)/tet;
874 sintt = (1. - tsint);
881 f3 = step * tsint * hp;
884 f6 = tet * cos1t * hp;
886 vout[kix] = vect[kix] + f1*vect[kipx] + f2*hxp[0];
887 vout[kiy] = vect[kiy] + f1*vect[kipy] + f2*hxp[1];
888 vout[kiz] = vect[kiz] + f1*vect[kipz] + f3;
890 vout[kipx] = vect[kipx] + f4*vect[kipx] + f5*hxp[0];
891 vout[kipy] = vect[kipy] + f4*vect[kipy] + f5*hxp[1];
892 vout[kipz] = vect[kipz] + f4*vect[kipz] + f6;
897 //__________________________________________________________________________
898 void AliMUONTrackExtrap::ExtrapOneStepRungekutta(Double_t charge, Double_t step, Double_t* vect, Double_t* vout)
900 /// ******************************************************************
902 /// * Runge-Kutta method for tracking a particle through a magnetic *
903 /// * field. Uses Nystroem algorithm (See Handbook Nat. Bur. of *
904 /// * Standards, procedure 25.5.20) *
906 /// * Input parameters *
907 /// * CHARGE Particle charge *
908 /// * STEP Step size *
909 /// * VECT Initial co-ords,direction cosines,momentum *
910 /// * Output parameters *
911 /// * VOUT Output co-ords,direction cosines,momentum *
912 /// * User routine called *
913 /// * CALL GUFLD(X,F) *
915 /// * ==>Called by : <USER>, GUSWIM *
916 /// * Authors R.Brun, M.Hansroul ********* *
917 /// * V.Perevoztchikov (CUT STEP implementation) *
920 /// ******************************************************************
922 Double_t h2, h4, f[4];
923 Double_t xyzt[3], a, b, c, ph,ph2;
924 Double_t secxs[4],secys[4],seczs[4],hxp[3];
925 Double_t g1, g2, g3, g4, g5, g6, ang2, dxt, dyt, dzt;
926 Double_t est, at, bt, ct, cba;
927 Double_t f1, f2, f3, f4, rho, tet, hnorm, hp, rho1, sint, cost;
937 Double_t maxit = 1992;
938 Double_t maxcut = 11;
940 const Double_t kdlt = 1e-4;
941 const Double_t kdlt32 = kdlt/32.;
942 const Double_t kthird = 1./3.;
943 const Double_t khalf = 0.5;
944 const Double_t kec = 2.9979251e-4;
946 const Double_t kpisqua = 9.86960440109;
950 const Int_t kipx = 3;
951 const Int_t kipy = 4;
952 const Int_t kipz = 5;
955 // *. ------------------------------------------------------------------
957 // * this constant is for units cm,gev/c and kgauss
961 for(Int_t j = 0; j < 7; j++)
964 Double_t pinv = kec * charge / vect[6];
972 if (TMath::Abs(h) > TMath::Abs(rest)) h = rest;
973 //cmodif: call gufld(vout,f) changed into:
978 // * start of integration
991 secxs[0] = (b * f[2] - c * f[1]) * ph2;
992 secys[0] = (c * f[0] - a * f[2]) * ph2;
993 seczs[0] = (a * f[1] - b * f[0]) * ph2;
994 ang2 = (secxs[0]*secxs[0] + secys[0]*secys[0] + seczs[0]*seczs[0]);
995 if (ang2 > kpisqua) break;
997 dxt = h2 * a + h4 * secxs[0];
998 dyt = h2 * b + h4 * secys[0];
999 dzt = h2 * c + h4 * seczs[0];
1004 // * second intermediate point
1007 est = TMath::Abs(dxt) + TMath::Abs(dyt) + TMath::Abs(dzt);
1009 if (ncut++ > maxcut) break;
1018 //cmodif: call gufld(xyzt,f) changed into:
1025 secxs[1] = (bt * f[2] - ct * f[1]) * ph2;
1026 secys[1] = (ct * f[0] - at * f[2]) * ph2;
1027 seczs[1] = (at * f[1] - bt * f[0]) * ph2;
1031 secxs[2] = (bt * f[2] - ct * f[1]) * ph2;
1032 secys[2] = (ct * f[0] - at * f[2]) * ph2;
1033 seczs[2] = (at * f[1] - bt * f[0]) * ph2;
1034 dxt = h * (a + secxs[2]);
1035 dyt = h * (b + secys[2]);
1036 dzt = h * (c + seczs[2]);
1040 at = a + 2.*secxs[2];
1041 bt = b + 2.*secys[2];
1042 ct = c + 2.*seczs[2];
1044 est = TMath::Abs(dxt)+TMath::Abs(dyt)+TMath::Abs(dzt);
1045 if (est > 2.*TMath::Abs(h)) {
1046 if (ncut++ > maxcut) break;
1055 //cmodif: call gufld(xyzt,f) changed into:
1058 z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * kthird) * h;
1059 y = y + (b + (secys[0] + secys[1] + secys[2]) * kthird) * h;
1060 x = x + (a + (secxs[0] + secxs[1] + secxs[2]) * kthird) * h;
1062 secxs[3] = (bt*f[2] - ct*f[1])* ph2;
1063 secys[3] = (ct*f[0] - at*f[2])* ph2;
1064 seczs[3] = (at*f[1] - bt*f[0])* ph2;
1065 a = a+(secxs[0]+secxs[3]+2. * (secxs[1]+secxs[2])) * kthird;
1066 b = b+(secys[0]+secys[3]+2. * (secys[1]+secys[2])) * kthird;
1067 c = c+(seczs[0]+seczs[3]+2. * (seczs[1]+seczs[2])) * kthird;
1069 est = TMath::Abs(secxs[0]+secxs[3] - (secxs[1]+secxs[2]))
1070 + TMath::Abs(secys[0]+secys[3] - (secys[1]+secys[2]))
1071 + TMath::Abs(seczs[0]+seczs[3] - (seczs[1]+seczs[2]));
1073 if (est > kdlt && TMath::Abs(h) > 1.e-4) {
1074 if (ncut++ > maxcut) break;
1080 // * if too many iterations, go to helix
1081 if (iter++ > maxit) break;
1086 cba = 1./ TMath::Sqrt(a*a + b*b + c*c);
1094 if (step < 0.) rest = -rest;
1095 if (rest < 1.e-5*TMath::Abs(step)) return;
1099 // angle too big, use helix
1104 f4 = TMath::Sqrt(f1*f1+f2*f2+f3*f3);
1113 hxp[0] = f2*vect[kipz] - f3*vect[kipy];
1114 hxp[1] = f3*vect[kipx] - f1*vect[kipz];
1115 hxp[2] = f1*vect[kipy] - f2*vect[kipx];
1117 hp = f1*vect[kipx] + f2*vect[kipy] + f3*vect[kipz];
1120 sint = TMath::Sin(tet);
1121 cost = 2.*TMath::Sin(khalf*tet)*TMath::Sin(khalf*tet);
1125 g3 = (tet-sint) * hp*rho1;
1130 vout[kix] = vect[kix] + g1*vect[kipx] + g2*hxp[0] + g3*f1;
1131 vout[kiy] = vect[kiy] + g1*vect[kipy] + g2*hxp[1] + g3*f2;
1132 vout[kiz] = vect[kiz] + g1*vect[kipz] + g2*hxp[2] + g3*f3;
1134 vout[kipx] = vect[kipx] + g4*vect[kipx] + g5*hxp[0] + g6*f1;
1135 vout[kipy] = vect[kipy] + g4*vect[kipy] + g5*hxp[1] + g6*f2;
1136 vout[kipz] = vect[kipz] + g4*vect[kipz] + g5*hxp[2] + g6*f3;
1141 //___________________________________________________________
1142 void AliMUONTrackExtrap::GetField(Double_t *Position, Double_t *Field)
1144 /// interface for arguments in double precision (Why ? ChF)
1147 x[0] = Position[0]; x[1] = Position[1]; x[2] = Position[2];
1149 if (fgkField) fgkField->Field(x,b);
1151 cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
1155 Field[0] = b[0]; Field[1] = b[1]; Field[2] = b[2];