]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrackParam.cxx
new class AliMUONLoader
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackParam.cxx
CommitLineData
a9e2aefa 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
88cb7938 16/* $Id$ */
a9e2aefa 17
3831f268 18///////////////////////////////////////////////////
19//
20// Track parameters
21// in
22// ALICE
23// dimuon
24// spectrometer
a9e2aefa 25//
3831f268 26///////////////////////////////////////////////////
a9e2aefa 27
70479d0e 28#include <Riostream.h>
a9e2aefa 29
30#include "AliCallf77.h"
3831f268 31#include "AliMUON.h"
a9e2aefa 32#include "AliMUONTrackParam.h"
3831f268 33#include "AliMUONChamber.h"
a9e2aefa 34#include "AliRun.h"
94de3818 35#include "AliMagF.h"
a9e2aefa 36
37ClassImp(AliMUONTrackParam) // Class implementation in ROOT context
38
a6f03ddb 39 // A few calls in Fortran or from Fortran (extrap.F).
40 // Needed, instead of calls to Geant subroutines,
41 // because double precision is necessary for track fit converging with Minuit.
42 // The "extrap" functions should be translated into C++ ????
a9e2aefa 43#ifndef WIN32
a6f03ddb 44# define extrap_onestep_helix extrap_onestep_helix_
45# define extrap_onestep_helix3 extrap_onestep_helix3_
46# define extrap_onestep_rungekutta extrap_onestep_rungekutta_
47# define gufld_double gufld_double_
a9e2aefa 48#else
a6f03ddb 49# define extrap_onestep_helix EXTRAP_ONESTEP_HELIX
50# define extrap_onestep_helix3 EXTRAP_ONESTEP_HELIX3
51# define extrap_onestep_rungekutta EXTRAP_ONESTEP_RUNGEKUTTA
52# define gufld_double GUFLD_DOUBLE
a9e2aefa 53#endif
54
a6f03ddb 55extern "C" {
56 void type_of_call extrap_onestep_helix
57 (Double_t &Charge, Double_t &StepLength, Double_t *VGeant3, Double_t *VGeant3New);
58
59 void type_of_call extrap_onestep_helix3
60 (Double_t &Field, Double_t &StepLength, Double_t *VGeant3, Double_t *VGeant3New);
61
62 void type_of_call extrap_onestep_rungekutta
63 (Double_t &Charge, Double_t &StepLength, Double_t *VGeant3, Double_t *VGeant3New);
64
65 void type_of_call gufld_double(Double_t *Position, Double_t *Field) {
66 // interface to "gAlice->Field()->Field" for arguments in double precision
67 Float_t x[3], b[3];
68 x[0] = Position[0]; x[1] = Position[1]; x[2] = Position[2];
69 gAlice->Field()->Field(x, b);
70 Field[0] = b[0]; Field[1] = b[1]; Field[2] = b[2];
71 }
a9e2aefa 72}
73
a9e2aefa 74 //__________________________________________________________________________
75void AliMUONTrackParam::ExtrapToZ(Double_t Z)
76{
77 // Track parameter extrapolation to the plane at "Z".
78 // On return, the track parameters resulting from the extrapolation
79 // replace the current track parameters.
a9e2aefa 80 if (this->fZ == Z) return; // nothing to be done if same Z
81 Double_t forwardBackward; // +1 if forward, -1 if backward
82 if (Z > this->fZ) forwardBackward = 1.0;
83 else forwardBackward = -1.0;
a6f03ddb 84 Double_t vGeant3[7], vGeant3New[7]; // 7 in parameter ????
a9e2aefa 85 Int_t iGeant3, stepNumber;
86 Int_t maxStepNumber = 5000; // in parameter ????
87 // For safety: return kTRUE or kFALSE ????
a6f03ddb 88 // Parameter vector for calling EXTRAP_ONESTEP
a9e2aefa 89 SetGeant3Parameters(vGeant3, forwardBackward);
956019b6 90 // sign of charge (sign of fInverseBendingMomentum if forward motion)
a6f03ddb 91 // must be changed if backward extrapolation
956019b6 92 Double_t chargeExtrap = forwardBackward *
93 TMath::Sign(Double_t(1.0), this->fInverseBendingMomentum);
a9e2aefa 94 Double_t stepLength = 6.0; // in parameter ????
95 // Extrapolation loop
96 stepNumber = 0;
97 while (((forwardBackward * (vGeant3[2] - Z)) <= 0.0) &&
98 (stepNumber < maxStepNumber)) {
99 stepNumber++;
a6f03ddb 100 // Option for switching between helix and Runge-Kutta ????
101 // extrap_onestep_rungekutta(chargeExtrap, stepLength, vGeant3, vGeant3New);
102 extrap_onestep_helix(chargeExtrap, stepLength, vGeant3, vGeant3New);
a9e2aefa 103 if ((forwardBackward * (vGeant3New[2] - Z)) > 0.0) break; // one is beyond Z
104 // better use TArray ????
105 for (iGeant3 = 0; iGeant3 < 7; iGeant3++)
106 {vGeant3[iGeant3] = vGeant3New[iGeant3];}
107 }
108 // check maxStepNumber ????
a9e2aefa 109 // Interpolation back to exact Z (2nd order)
110 // should be in function ???? using TArray ????
111 Double_t dZ12 = vGeant3New[2] - vGeant3[2]; // 1->2
112 Double_t dZ1i = Z - vGeant3[2]; // 1-i
113 Double_t dZi2 = vGeant3New[2] - Z; // i->2
114 Double_t xPrime = (vGeant3New[0] - vGeant3[0]) / dZ12;
115 Double_t xSecond =
116 ((vGeant3New[3] / vGeant3New[5]) - (vGeant3[3] / vGeant3[5])) / dZ12;
117 Double_t yPrime = (vGeant3New[1] - vGeant3[1]) / dZ12;
118 Double_t ySecond =
119 ((vGeant3New[4] / vGeant3New[5]) - (vGeant3[4] / vGeant3[5])) / dZ12;
120 vGeant3[0] = vGeant3[0] + xPrime * dZ1i - 0.5 * xSecond * dZ1i * dZi2; // X
121 vGeant3[1] = vGeant3[1] + yPrime * dZ1i - 0.5 * ySecond * dZ1i * dZi2; // Y
122 vGeant3[2] = Z; // Z
123 Double_t xPrimeI = xPrime - 0.5 * xSecond * (dZi2 - dZ1i);
124 Double_t yPrimeI = yPrime - 0.5 * ySecond * (dZi2 - dZ1i);
956019b6 125 // (PX, PY, PZ)/PTOT assuming forward motion
a9e2aefa 126 vGeant3[5] =
127 1.0 / TMath::Sqrt(1.0 + xPrimeI * xPrimeI + yPrimeI * yPrimeI); // PZ/PTOT
128 vGeant3[3] = xPrimeI * vGeant3[5]; // PX/PTOT
129 vGeant3[4] = yPrimeI * vGeant3[5]; // PY/PTOT
956019b6 130 // Track parameters from Geant3 parameters,
131 // with charge back for forward motion
132 GetFromGeant3Parameters(vGeant3, chargeExtrap * forwardBackward);
a9e2aefa 133}
134
135 //__________________________________________________________________________
136void AliMUONTrackParam::SetGeant3Parameters(Double_t *VGeant3, Double_t ForwardBackward)
137{
138 // Set vector of Geant3 parameters pointed to by "VGeant3"
139 // from track parameters in current AliMUONTrackParam.
140 // Since AliMUONTrackParam is only geometry, one uses "ForwardBackward"
141 // to know whether the particle is going forward (+1) or backward (-1).
142 VGeant3[0] = this->fNonBendingCoor; // X
143 VGeant3[1] = this->fBendingCoor; // Y
144 VGeant3[2] = this->fZ; // Z
145 Double_t pYZ = TMath::Abs(1.0 / this->fInverseBendingMomentum);
146 Double_t pZ =
147 pYZ / TMath::Sqrt(1.0 + this->fBendingSlope * this->fBendingSlope);
148 VGeant3[6] =
149 TMath::Sqrt(pYZ * pYZ +
150 pZ * pZ * this->fNonBendingSlope * this->fNonBendingSlope); // PTOT
151 VGeant3[5] = ForwardBackward * pZ / VGeant3[6]; // PZ/PTOT
152 VGeant3[3] = this->fNonBendingSlope * VGeant3[5]; // PX/PTOT
153 VGeant3[4] = this->fBendingSlope * VGeant3[5]; // PY/PTOT
154}
155
156 //__________________________________________________________________________
157void AliMUONTrackParam::GetFromGeant3Parameters(Double_t *VGeant3, Double_t Charge)
158{
159 // Get track parameters in current AliMUONTrackParam
956019b6 160 // from Geant3 parameters pointed to by "VGeant3",
161 // assumed to be calculated for forward motion in Z.
a9e2aefa 162 // "InverseBendingMomentum" is signed with "Charge".
163 this->fNonBendingCoor = VGeant3[0]; // X
164 this->fBendingCoor = VGeant3[1]; // Y
165 this->fZ = VGeant3[2]; // Z
166 Double_t pYZ = VGeant3[6] * TMath::Sqrt(1.0 - VGeant3[3] * VGeant3[3]);
167 this->fInverseBendingMomentum = Charge / pYZ;
168 this->fBendingSlope = VGeant3[4] / VGeant3[5];
169 this->fNonBendingSlope = VGeant3[3] / VGeant3[5];
170}
171
172 //__________________________________________________________________________
173void AliMUONTrackParam::ExtrapToStation(Int_t Station, AliMUONTrackParam *TrackParam)
174{
175 // Track parameters extrapolated from current track parameters ("this")
176 // to both chambers of the station(0..) "Station"
177 // are returned in the array (dimension 2) of track parameters
178 // pointed to by "TrackParam" (index 0 and 1 for first and second chambers).
179 Double_t extZ[2], z1, z2;
ecfa008b 180 Int_t i1 = -1, i2 = -1; // = -1 to avoid compilation warnings
a9e2aefa 181 AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
182 // range of Station to be checked ????
183 z1 = (&(pMUON->Chamber(2 * Station)))->Z(); // Z of first chamber
184 z2 = (&(pMUON->Chamber(2 * Station + 1)))->Z(); // Z of second chamber
185 // First and second Z to extrapolate at
186 if ((z1 > this->fZ) && (z2 > this->fZ)) {i1 = 0; i2 = 1;}
187 else if ((z1 < this->fZ) && (z2 < this->fZ)) {i1 = 1; i2 = 0;}
188 else {
189 cout << "ERROR in AliMUONTrackParam::CreateExtrapSegmentInStation" << endl;
190 cout << "Starting Z (" << this->fZ << ") in between z1 (" << z1 <<
191 ") and z2 (" << z2 << ") of station(0..) " << Station << endl;
192 }
193 extZ[i1] = z1;
194 extZ[i2] = z2;
195 // copy of track parameters
196 TrackParam[i1] = *this;
197 // first extrapolation
198 (&(TrackParam[i1]))->ExtrapToZ(extZ[0]);
199 TrackParam[i2] = TrackParam[i1];
200 // second extrapolation
201 (&(TrackParam[i2]))->ExtrapToZ(extZ[1]);
202 return;
203}
204
04b5ea16 205 //__________________________________________________________________________
206void AliMUONTrackParam::ExtrapToVertex()
207{
208 // Extrapolation to the vertex.
209 // Returns the track parameters resulting from the extrapolation,
210 // in the current TrackParam.
956019b6 211 // Changes parameters according to Branson correction through the absorber
04b5ea16 212
213 Double_t zAbsorber = 503.0; // to be coherent with the Geant absorber geometry !!!!
214 // Extrapolates track parameters upstream to the "Z" end of the front absorber
b45fd22b 215 ExtrapToZ(zAbsorber); // !!!
04b5ea16 216 // Makes Branson correction (multiple scattering + energy loss)
217 BransonCorrection();
b45fd22b 218 // Makes a simple magnetic field correction through the absorber
219 FieldCorrection(zAbsorber);
04b5ea16 220}
221
43af2cb6 222
223// Keep this version for future developments
04b5ea16 224 //__________________________________________________________________________
43af2cb6 225// void AliMUONTrackParam::BransonCorrection()
226// {
227// // Branson correction of track parameters
228// // the entry parameters have to be calculated at the end of the absorber
229// Double_t zEndAbsorber, zBP, xBP, yBP;
230// Double_t pYZ, pX, pY, pZ, pTotal, xEndAbsorber, yEndAbsorber, radiusEndAbsorber2, pT, theta;
231// Int_t sign;
232// // Would it be possible to calculate all that from Geant configuration ????
233// // and to get the Branson parameters from a function in ABSO module ????
234// // with an eventual contribution from other detectors like START ????
235// // Radiation lengths outer part theta > 3 degres
236// static Double_t x01[9] = { 18.8, // C (cm)
237// 10.397, // Concrete (cm)
238// 0.56, // Plomb (cm)
239// 47.26, // Polyethylene (cm)
240// 0.56, // Plomb (cm)
241// 47.26, // Polyethylene (cm)
242// 0.56, // Plomb (cm)
243// 47.26, // Polyethylene (cm)
244// 0.56 }; // Plomb (cm)
245// // inner part theta < 3 degres
246// static Double_t x02[3] = { 18.8, // C (cm)
247// 10.397, // Concrete (cm)
248// 0.35 }; // W (cm)
249// // z positions of the materials inside the absober outer part theta > 3 degres
250// static Double_t z1[10] = { 90, 315, 467, 472, 477, 482, 487, 492, 497, 502 };
251// // inner part theta < 3 degres
252// static Double_t z2[4] = { 90, 315, 467, 503 };
253// static Bool_t first = kTRUE;
254// static Double_t zBP1, zBP2, rLimit;
255// // Calculates z positions of the Branson's planes: zBP1 for outer part and zBP2 for inner part (only at the first call)
256// if (first) {
257// first = kFALSE;
258// Double_t aNBP = 0.0;
259// Double_t aDBP = 0.0;
260// Int_t iBound;
261
262// for (iBound = 0; iBound < 9; iBound++) {
263// aNBP = aNBP +
264// (z1[iBound+1] * z1[iBound+1] * z1[iBound+1] -
265// z1[iBound] * z1[iBound] * z1[iBound] ) / x01[iBound];
266// aDBP = aDBP +
267// (z1[iBound+1] * z1[iBound+1] - z1[iBound] * z1[iBound] ) / x01[iBound];
268// }
269// zBP1 = (2.0 * aNBP) / (3.0 * aDBP);
270// aNBP = 0.0;
271// aDBP = 0.0;
272// for (iBound = 0; iBound < 3; iBound++) {
273// aNBP = aNBP +
274// (z2[iBound+1] * z2[iBound+1] * z2[iBound+1] -
275// z2[iBound] * z2[iBound ] * z2[iBound] ) / x02[iBound];
276// aDBP = aDBP +
277// (z2[iBound+1] * z2[iBound+1] - z2[iBound] * z2[iBound]) / x02[iBound];
278// }
279// zBP2 = (2.0 * aNBP) / (3.0 * aDBP);
280// rLimit = z2[3] * TMath::Tan(3.0 * (TMath::Pi()) / 180.);
281// }
282
283// pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
284// sign = 1;
285// if (fInverseBendingMomentum < 0) sign = -1;
286// pZ = pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));
287// pX = pZ * fNonBendingSlope;
288// pY = pZ * fBendingSlope;
289// pTotal = TMath::Sqrt(pYZ *pYZ + pX * pX);
290// xEndAbsorber = fNonBendingCoor;
291// yEndAbsorber = fBendingCoor;
292// radiusEndAbsorber2 = xEndAbsorber * xEndAbsorber + yEndAbsorber * yEndAbsorber;
293
294// if (radiusEndAbsorber2 > rLimit*rLimit) {
295// zEndAbsorber = z1[9];
296// zBP = zBP1;
297// } else {
298// zEndAbsorber = z2[3];
299// zBP = zBP2;
300// }
301
302// xBP = xEndAbsorber - (pX / pZ) * (zEndAbsorber - zBP);
303// yBP = yEndAbsorber - (pY / pZ) * (zEndAbsorber - zBP);
304
305// // new parameters after Branson and energy loss corrections
306// pZ = pTotal * zBP / TMath::Sqrt(xBP * xBP + yBP * yBP + zBP * zBP);
307// pX = pZ * xBP / zBP;
308// pY = pZ * yBP / zBP;
309// fBendingSlope = pY / pZ;
310// fNonBendingSlope = pX / pZ;
311
312// pT = TMath::Sqrt(pX * pX + pY * pY);
313// theta = TMath::ATan2(pT, pZ);
314// pTotal =
315// TotalMomentumEnergyLoss(rLimit, pTotal, theta, xEndAbsorber, yEndAbsorber);
316
317// fInverseBendingMomentum = (sign / pTotal) *
318// TMath::Sqrt(1.0 +
319// fBendingSlope * fBendingSlope +
320// fNonBendingSlope * fNonBendingSlope) /
321// TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope);
322
323// // vertex position at (0,0,0)
324// // should be taken from vertex measurement ???
325// fBendingCoor = 0.0;
326// fNonBendingCoor = 0;
327// fZ= 0;
328// }
329
04b5ea16 330void AliMUONTrackParam::BransonCorrection()
331{
332 // Branson correction of track parameters
333 // the entry parameters have to be calculated at the end of the absorber
43af2cb6 334 // simplified version: the z positions of Branson's planes are no longer calculated
335 // but are given as inputs. One can use the macros MUONTestAbso.C and DrawTestAbso.C
336 // to test this correction.
04b5ea16 337 // Would it be possible to calculate all that from Geant configuration ????
956019b6 338 // and to get the Branson parameters from a function in ABSO module ????
339 // with an eventual contribution from other detectors like START ????
43af2cb6 340 Double_t zBP, xBP, yBP;
341 Double_t pYZ, pX, pY, pZ, pTotal, xEndAbsorber, yEndAbsorber, radiusEndAbsorber2, pT, theta;
342 Int_t sign;
04b5ea16 343 static Bool_t first = kTRUE;
b45fd22b 344 static Double_t zBP1, zBP2, rLimit, thetaLimit, zEndAbsorber;
43af2cb6 345 // zBP1 for outer part and zBP2 for inner part (only at the first call)
04b5ea16 346 if (first) {
347 first = kFALSE;
43af2cb6 348
349 zEndAbsorber = 503;
b45fd22b 350 thetaLimit = 3.0 * (TMath::Pi()) / 180.;
351 rLimit = zEndAbsorber * TMath::Tan(thetaLimit);
352 zBP1 = 450; // values close to those calculated with EvalAbso.C
43af2cb6 353 zBP2 = 480;
04b5ea16 354 }
355
356 pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
357 sign = 1;
358 if (fInverseBendingMomentum < 0) sign = -1;
359 pZ = pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));
360 pX = pZ * fNonBendingSlope;
361 pY = pZ * fBendingSlope;
362 pTotal = TMath::Sqrt(pYZ *pYZ + pX * pX);
363 xEndAbsorber = fNonBendingCoor;
364 yEndAbsorber = fBendingCoor;
365 radiusEndAbsorber2 = xEndAbsorber * xEndAbsorber + yEndAbsorber * yEndAbsorber;
366
367 if (radiusEndAbsorber2 > rLimit*rLimit) {
04b5ea16 368 zBP = zBP1;
369 } else {
04b5ea16 370 zBP = zBP2;
371 }
372
373 xBP = xEndAbsorber - (pX / pZ) * (zEndAbsorber - zBP);
374 yBP = yEndAbsorber - (pY / pZ) * (zEndAbsorber - zBP);
375
376 // new parameters after Branson and energy loss corrections
b45fd22b 377// Float_t zSmear = zBP - gRandom->Gaus(0.,2.); // !!! possible smearing of Z vertex position
378 Float_t zSmear = zBP;
379
380 pZ = pTotal * zSmear / TMath::Sqrt(xBP * xBP + yBP * yBP + zSmear * zSmear);
381 pX = pZ * xBP / zSmear;
382 pY = pZ * yBP / zSmear;
04b5ea16 383 fBendingSlope = pY / pZ;
384 fNonBendingSlope = pX / pZ;
385
386 pT = TMath::Sqrt(pX * pX + pY * pY);
387 theta = TMath::ATan2(pT, pZ);
b45fd22b 388 pTotal = TotalMomentumEnergyLoss(thetaLimit, pTotal, theta);
04b5ea16 389
390 fInverseBendingMomentum = (sign / pTotal) *
391 TMath::Sqrt(1.0 +
392 fBendingSlope * fBendingSlope +
393 fNonBendingSlope * fNonBendingSlope) /
394 TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope);
395
396 // vertex position at (0,0,0)
397 // should be taken from vertex measurement ???
398 fBendingCoor = 0.0;
399 fNonBendingCoor = 0;
400 fZ= 0;
401}
b45fd22b 402
04b5ea16 403 //__________________________________________________________________________
b45fd22b 404Double_t AliMUONTrackParam::TotalMomentumEnergyLoss(Double_t thetaLimit, Double_t pTotal, Double_t theta)
04b5ea16 405{
406 // Returns the total momentum corrected from energy loss in the front absorber
43af2cb6 407 // One can use the macros MUONTestAbso.C and DrawTestAbso.C
408 // to test this correction.
b45fd22b 409 // Momentum energy loss behaviour evaluated with the simulation of single muons (april 2002)
04b5ea16 410 Double_t deltaP, pTotalCorrected;
411
b45fd22b 412 // Parametrization to be redone according to change of absorber material ????
956019b6 413 // See remark in function BransonCorrection !!!!
04b5ea16 414 // The name is not so good, and there are many arguments !!!!
b45fd22b 415 if (theta < thetaLimit ) {
416 if (pTotal < 20) {
417 deltaP = 2.5938 + 0.0570 * pTotal - 0.001151 * pTotal * pTotal;
04b5ea16 418 } else {
b45fd22b 419 deltaP = 3.0714 + 0.011767 *pTotal;
04b5ea16 420 }
421 } else {
b45fd22b 422 if (pTotal < 20) {
423 deltaP = 2.1207 + 0.05478 * pTotal - 0.00145079 * pTotal * pTotal;
04b5ea16 424 } else {
b45fd22b 425 deltaP = 2.6069 + 0.0051705 * pTotal;
04b5ea16 426 }
427 }
428 pTotalCorrected = pTotal + deltaP / TMath::Cos(theta);
429 return pTotalCorrected;
430}
431
b45fd22b 432 //__________________________________________________________________________
433void AliMUONTrackParam::FieldCorrection(Double_t Z)
434{
435 //
436 // Correction of the effect of the magnetic field in the absorber
437 // Assume a constant field along Z axis.
438
439 Float_t b[3],x[3];
440 Double_t bZ;
441 Double_t pYZ,pX,pY,pZ,pT;
442 Double_t pXNew,pYNew;
443 Double_t c;
444
445 pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
446 c = TMath::Sign(1.0,fInverseBendingMomentum); // particle charge
447
448 pZ = pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));
449 pX = pZ * fNonBendingSlope;
450 pY = pZ * fBendingSlope;
451 pT = TMath::Sqrt(pX*pX+pY*pY);
452
453 if (pZ <= 0) return;
454 x[2] = Z/2;
455 x[0] = x[2]*fNonBendingSlope;
456 x[1] = x[2]*fBendingSlope;
457
458 // Take magn. field value at position x.
459 gAlice->Field()->Field(x, b);
460 bZ = b[2];
461
462 // Transverse momentum rotation
463 // Parameterized with the study of DeltaPhi = phiReco - phiGen as a function of pZ.
464 Double_t phiShift = c*0.436*0.0003*bZ*Z/pZ;
465
466 // Rotate momentum around Z axis.
467 pXNew = pX*TMath::Cos(phiShift) - pY*TMath::Sin(phiShift);
468 pYNew = pX*TMath::Sin(phiShift) + pY*TMath::Cos(phiShift);
469
470 fBendingSlope = pYNew / pZ;
471 fNonBendingSlope = pXNew / pZ;
472
473 fInverseBendingMomentum = c / TMath::Sqrt(pYNew*pYNew+pZ*pZ);
474
475}