//
///////////////////////////////////////////////////
-#include <Riostream.h>
+//#include <Riostream.h>
#include "AliMUON.h"
#include "AliMUONTrackParam.h"
-#include "AliMUONChamber.h"
-#include "AliRun.h"
+#include "AliMUONConstants.h"
+#include "AliESDMuonTrack.h"
#include "AliMagF.h"
#include "AliLog.h"
+#include "AliTracker.h"
+#include "AliMUONHitForRec.h"
ClassImp(AliMUONTrackParam) // Class implementation in ROOT context
//_________________________________________________________________________
AliMUONTrackParam::AliMUONTrackParam()
- : TObject()
+ : TObject(),
+ fInverseBendingMomentum(0.),
+ fBendingSlope(0.),
+ fNonBendingSlope(0.),
+ fZ(0.),
+ fBendingCoor(0.),
+ fNonBendingCoor(0.),
+ fkField(0x0),
+ fHitForRecPtr(0x0)
{
-// Constructor
-
- fInverseBendingMomentum = 0;
- fBendingSlope = 0;
- fNonBendingSlope = 0;
- fZ = 0;
- fBendingCoor = 0;
- fNonBendingCoor = 0;
+/// Constructor
+ // get field from outside
+ fkField = AliTracker::GetFieldMap();
+ if (!fkField) AliFatal("No field available");
}
//_________________________________________________________________________
-AliMUONTrackParam&
-AliMUONTrackParam::operator=(const AliMUONTrackParam& theMUONTrackParam)
+AliMUONTrackParam::AliMUONTrackParam(const AliMUONTrackParam& theMUONTrackParam)
+ : TObject(theMUONTrackParam),
+ fInverseBendingMomentum(theMUONTrackParam.fInverseBendingMomentum),
+ fBendingSlope(theMUONTrackParam.fBendingSlope),
+ fNonBendingSlope(theMUONTrackParam.fNonBendingSlope),
+ fZ(theMUONTrackParam.fZ),
+ fBendingCoor(theMUONTrackParam.fBendingCoor),
+ fNonBendingCoor(theMUONTrackParam.fNonBendingCoor),
+ fkField(theMUONTrackParam.fkField),
+ fHitForRecPtr(theMUONTrackParam.fHitForRecPtr)
+{
+ /// Copy constructor
+}
+
+ //_________________________________________________________________________
+AliMUONTrackParam& AliMUONTrackParam::operator=(const AliMUONTrackParam& theMUONTrackParam)
{
+ /// Asignment operator
if (this == &theMUONTrackParam)
return *this;
fZ = theMUONTrackParam.fZ;
fBendingCoor = theMUONTrackParam.fBendingCoor;
fNonBendingCoor = theMUONTrackParam.fNonBendingCoor;
+ fkField = theMUONTrackParam.fkField;
+ fHitForRecPtr = theMUONTrackParam.fHitForRecPtr;
return *this;
}
- //_________________________________________________________________________
-AliMUONTrackParam::AliMUONTrackParam(const AliMUONTrackParam& theMUONTrackParam)
- : TObject(theMUONTrackParam)
+
+ //__________________________________________________________________________
+AliMUONTrackParam::~AliMUONTrackParam()
{
+/// Destructor
+/// Update the number of TrackHit's connected to the attached HitForRec if any
+ if (fHitForRecPtr) fHitForRecPtr->SetNTrackHits(fHitForRecPtr->GetNTrackHits() - 1); // decrement NTrackHits of hit
+}
+
+ //__________________________________________________________________________
+void AliMUONTrackParam::SetTrackParam(AliMUONTrackParam& theMUONTrackParam)
+{
+ /// Set track parameters from "TrackParam" leaving pointer to fHitForRecPtr unchanged
fInverseBendingMomentum = theMUONTrackParam.fInverseBendingMomentum;
fBendingSlope = theMUONTrackParam.fBendingSlope;
fNonBendingSlope = theMUONTrackParam.fNonBendingSlope;
fZ = theMUONTrackParam.fZ;
fBendingCoor = theMUONTrackParam.fBendingCoor;
fNonBendingCoor = theMUONTrackParam.fNonBendingCoor;
+
+}
+
+ //__________________________________________________________________________
+AliMUONHitForRec* AliMUONTrackParam::GetHitForRecPtr(void) const
+{
+/// return pointer to HitForRec attached to the current TrackParam
+/// this method should not be called when fHitForRecPtr == NULL
+ if (!fHitForRecPtr) AliWarning("AliMUONTrackParam::GetHitForRecPtr: fHitForRecPtr == NULL");
+ return fHitForRecPtr;
+}
+
+ //__________________________________________________________________________
+Int_t AliMUONTrackParam::Compare(const TObject* TrackParam) const
+{
+/// "Compare" function to sort with decreasing Z (spectro. muon Z <0).
+/// Returns 1 (0, -1) if Z of current TrackHit
+/// is smaller than (equal to, larger than) Z of TrackHit
+ if (fHitForRecPtr->GetZ() < ((AliMUONTrackParam*)TrackParam)->fHitForRecPtr->GetZ()) return(1);
+ else if (fHitForRecPtr->GetZ() == ((AliMUONTrackParam*)TrackParam)->fHitForRecPtr->GetZ()) return(0);
+ else return(-1);
+}
+
+ //_________________________________________________________________________
+void AliMUONTrackParam::GetParamFrom(const AliESDMuonTrack& esdMuonTrack)
+{
+ /// assigned value form ESD track.
+ fInverseBendingMomentum = esdMuonTrack.GetInverseBendingMomentum();
+ fBendingSlope = TMath::Tan(esdMuonTrack.GetThetaY());
+ fNonBendingSlope = TMath::Tan(esdMuonTrack.GetThetaX());
+ fZ = esdMuonTrack.GetZ();
+ fBendingCoor = esdMuonTrack.GetBendingCoor();
+ fNonBendingCoor = esdMuonTrack.GetNonBendingCoor();
+}
+
+ //_________________________________________________________________________
+void AliMUONTrackParam::SetParamFor(AliESDMuonTrack& esdMuonTrack)
+{
+ /// assigned value form ESD track.
+ esdMuonTrack.SetInverseBendingMomentum(fInverseBendingMomentum);
+ esdMuonTrack.SetThetaX(TMath::ATan(fNonBendingSlope));
+ esdMuonTrack.SetThetaY(TMath::ATan(fBendingSlope));
+ esdMuonTrack.SetZ(fZ);
+ esdMuonTrack.SetBendingCoor(fBendingCoor);
+ esdMuonTrack.SetNonBendingCoor(fNonBendingCoor);
}
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapToZ(Double_t Z)
{
- // Track parameter extrapolation to the plane at "Z".
- // On return, the track parameters resulting from the extrapolation
- // replace the current track parameters.
+ /// Track parameter extrapolation to the plane at "Z".
+ /// On return, the track parameters resulting from the extrapolation
+ /// replace the current track parameters.
if (this->fZ == Z) return; // nothing to be done if same Z
Double_t forwardBackward; // +1 if forward, -1 if backward
if (Z < this->fZ) forwardBackward = 1.0; // spectro. z<0
// Interpolation back to exact Z (2nd order)
// should be in function ???? using TArray ????
Double_t dZ12 = vGeant3New[2] - vGeant3[2]; // 1->2
- Double_t dZ1i = Z - vGeant3[2]; // 1-i
- Double_t dZi2 = vGeant3New[2] - Z; // i->2
- Double_t xPrime = (vGeant3New[0] - vGeant3[0]) / dZ12;
- Double_t xSecond =
- ((vGeant3New[3] / vGeant3New[5]) - (vGeant3[3] / vGeant3[5])) / dZ12;
- Double_t yPrime = (vGeant3New[1] - vGeant3[1]) / dZ12;
- Double_t ySecond =
- ((vGeant3New[4] / vGeant3New[5]) - (vGeant3[4] / vGeant3[5])) / dZ12;
- vGeant3[0] = vGeant3[0] + xPrime * dZ1i - 0.5 * xSecond * dZ1i * dZi2; // X
- vGeant3[1] = vGeant3[1] + yPrime * dZ1i - 0.5 * ySecond * dZ1i * dZi2; // Y
- vGeant3[2] = Z; // Z
- Double_t xPrimeI = xPrime - 0.5 * xSecond * (dZi2 - dZ1i);
- Double_t yPrimeI = yPrime - 0.5 * ySecond * (dZi2 - dZ1i);
- // (PX, PY, PZ)/PTOT assuming forward motion
- vGeant3[5] =
- 1.0 / TMath::Sqrt(1.0 + xPrimeI * xPrimeI + yPrimeI * yPrimeI); // PZ/PTOT
- vGeant3[3] = xPrimeI * vGeant3[5]; // PX/PTOT
- vGeant3[4] = yPrimeI * vGeant3[5]; // PY/PTOT
+ if (TMath::Abs(dZ12) > 0) {
+ Double_t dZ1i = Z - vGeant3[2]; // 1-i
+ Double_t dZi2 = vGeant3New[2] - Z; // i->2
+ Double_t xPrime = (vGeant3New[0] - vGeant3[0]) / dZ12;
+ Double_t xSecond =
+ ((vGeant3New[3] / vGeant3New[5]) - (vGeant3[3] / vGeant3[5])) / dZ12;
+ Double_t yPrime = (vGeant3New[1] - vGeant3[1]) / dZ12;
+ Double_t ySecond =
+ ((vGeant3New[4] / vGeant3New[5]) - (vGeant3[4] / vGeant3[5])) / dZ12;
+ vGeant3[0] = vGeant3[0] + xPrime * dZ1i - 0.5 * xSecond * dZ1i * dZi2; // X
+ vGeant3[1] = vGeant3[1] + yPrime * dZ1i - 0.5 * ySecond * dZ1i * dZi2; // Y
+ vGeant3[2] = Z; // Z
+ Double_t xPrimeI = xPrime - 0.5 * xSecond * (dZi2 - dZ1i);
+ Double_t yPrimeI = yPrime - 0.5 * ySecond * (dZi2 - dZ1i);
+ // (PX, PY, PZ)/PTOT assuming forward motion
+ vGeant3[5] =
+ 1.0 / TMath::Sqrt(1.0 + xPrimeI * xPrimeI + yPrimeI * yPrimeI); // PZ/PTOT
+ vGeant3[3] = xPrimeI * vGeant3[5]; // PX/PTOT
+ vGeant3[4] = yPrimeI * vGeant3[5]; // PY/PTOT
+ } else {
+ AliWarning(Form("Extrap. to Z not reached, Z = %f",Z));
+ }
// Track parameters from Geant3 parameters,
// with charge back for forward motion
GetFromGeant3Parameters(vGeant3, chargeExtrap * forwardBackward);
//__________________________________________________________________________
void AliMUONTrackParam::SetGeant3Parameters(Double_t *VGeant3, Double_t ForwardBackward)
{
- // Set vector of Geant3 parameters pointed to by "VGeant3"
- // from track parameters in current AliMUONTrackParam.
- // Since AliMUONTrackParam is only geometry, one uses "ForwardBackward"
- // to know whether the particle is going forward (+1) or backward (-1).
+ /// Set vector of Geant3 parameters pointed to by "VGeant3"
+ /// from track parameters in current AliMUONTrackParam.
+ /// Since AliMUONTrackParam is only geometry, one uses "ForwardBackward"
+ /// to know whether the particle is going forward (+1) or backward (-1).
VGeant3[0] = this->fNonBendingCoor; // X
VGeant3[1] = this->fBendingCoor; // Y
VGeant3[2] = this->fZ; // Z
//__________________________________________________________________________
void AliMUONTrackParam::GetFromGeant3Parameters(Double_t *VGeant3, Double_t Charge)
{
- // Get track parameters in current AliMUONTrackParam
- // from Geant3 parameters pointed to by "VGeant3",
- // assumed to be calculated for forward motion in Z.
- // "InverseBendingMomentum" is signed with "Charge".
+ /// Get track parameters in current AliMUONTrackParam
+ /// from Geant3 parameters pointed to by "VGeant3",
+ /// assumed to be calculated for forward motion in Z.
+ /// "InverseBendingMomentum" is signed with "Charge".
this->fNonBendingCoor = VGeant3[0]; // X
this->fBendingCoor = VGeant3[1]; // Y
this->fZ = VGeant3[2]; // Z
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapToStation(Int_t Station, AliMUONTrackParam *TrackParam)
{
- // Track parameters extrapolated from current track parameters ("this")
- // to both chambers of the station(0..) "Station"
- // are returned in the array (dimension 2) of track parameters
- // pointed to by "TrackParam" (index 0 and 1 for first and second chambers).
+ /// Track parameters extrapolated from current track parameters ("this")
+ /// to both chambers of the station(0..) "Station"
+ /// are returned in the array (dimension 2) of track parameters
+ /// pointed to by "TrackParam" (index 0 and 1 for first and second chambers).
Double_t extZ[2], z1, z2;
Int_t i1 = -1, i2 = -1; // = -1 to avoid compilation warnings
- AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
// range of Station to be checked ????
- z1 = (&(pMUON->Chamber(2 * Station)))->Z(); // Z of first chamber
- z2 = (&(pMUON->Chamber(2 * Station + 1)))->Z(); // Z of second chamber
+ z1 = AliMUONConstants::DefaultChamberZ(2 * Station);
+ z2 = AliMUONConstants::DefaultChamberZ(2 * Station + 1);
// First and second Z to extrapolate at
if ((z1 > this->fZ) && (z2 > this->fZ)) {i1 = 0; i2 = 1;}
else if ((z1 < this->fZ) && (z2 < this->fZ)) {i1 = 1; i2 = 0;}
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapToVertex(Double_t xVtx, Double_t yVtx, Double_t zVtx)
{
- // Extrapolation to the vertex.
- // Returns the track parameters resulting from the extrapolation,
- // in the current TrackParam.
- // Changes parameters according to Branson correction through the absorber
+ /// Extrapolation to the vertex.
+ /// Returns the track parameters resulting from the extrapolation in the current TrackParam.
+ /// Changes parameters according to Branson correction through the absorber
Double_t zAbsorber = -503.0; // to be coherent with the Geant absorber geometry !!!!
// spectro. (z<0)
void AliMUONTrackParam::BransonCorrection(Double_t xVtx,Double_t yVtx,Double_t zVtx)
{
- // Branson correction of track parameters
+ /// Branson correction of track parameters
// the entry parameters have to be calculated at the end of the absorber
// simplified version: the z positions of Branson's planes are no longer calculated
// but are given as inputs. One can use the macros MUONTestAbso.C and DrawTestAbso.C
// Would it be possible to calculate all that from Geant configuration ????
// and to get the Branson parameters from a function in ABSO module ????
// with an eventual contribution from other detectors like START ????
- //change to take into account the vertex postition (real, reconstruct,....)
+ // change to take into account the vertex postition (real, reconstruct,....)
Double_t zBP, xBP, yBP;
Double_t pYZ, pX, pY, pZ, pTotal, xEndAbsorber, yEndAbsorber, radiusEndAbsorber2, pT, theta;
//__________________________________________________________________________
Double_t AliMUONTrackParam::TotalMomentumEnergyLoss(Double_t thetaLimit, Double_t pTotal, Double_t theta)
{
- // Returns the total momentum corrected from energy loss in the front absorber
+ /// Returns the total momentum corrected from energy loss in the front absorber
// One can use the macros MUONTestAbso.C and DrawTestAbso.C
// to test this correction.
// Momentum energy loss behaviour evaluated with the simulation of single muons (april 2002)
} else {
deltaP = 3.0714 + 0.011767 *pTotal;
}
+ deltaP *= 0.75; // AZ
} else {
if (pTotal < 20) {
deltaP = 2.1207 + 0.05478 * pTotal - 0.00145079 * pTotal * pTotal;
} else {
deltaP = 2.6069 + 0.0051705 * pTotal;
}
+ deltaP *= 0.9; // AZ
}
pTotalCorrected = pTotal + deltaP / TMath::Cos(theta);
return pTotalCorrected;
//__________________________________________________________________________
void AliMUONTrackParam::FieldCorrection(Double_t Z)
{
- //
- // Correction of the effect of the magnetic field in the absorber
+ /// Correction of the effect of the magnetic field in the absorber
// Assume a constant field along Z axis.
-
Float_t b[3],x[3];
Double_t bZ;
Double_t pYZ,pX,pY,pZ,pT;
x[1] = x[2]*fBendingSlope;
// Take magn. field value at position x.
- gAlice->Field()->Field(x, b);
+ fkField->Field(x, b);
bZ = b[2];
// Transverse momentum rotation
}
//__________________________________________________________________________
-Double_t AliMUONTrackParam::Px()
+Double_t AliMUONTrackParam::Px() const
{
- // return px from track paramaters
+ /// return px from track paramaters
Double_t pYZ, pZ, pX;
pYZ = 0;
if ( TMath::Abs(fInverseBendingMomentum) > 0 )
return pX;
}
//__________________________________________________________________________
-Double_t AliMUONTrackParam::Py()
+Double_t AliMUONTrackParam::Py() const
{
- // return px from track paramaters
+ /// return px from track paramaters
Double_t pYZ, pZ, pY;
pYZ = 0;
if ( TMath::Abs(fInverseBendingMomentum) > 0 )
return pY;
}
//__________________________________________________________________________
-Double_t AliMUONTrackParam::Pz()
+Double_t AliMUONTrackParam::Pz() const
{
- // return px from track paramaters
+ /// return px from track paramaters
Double_t pYZ, pZ;
pYZ = 0;
if ( TMath::Abs(fInverseBendingMomentum) > 0 )
return pZ;
}
//__________________________________________________________________________
-Double_t AliMUONTrackParam::P()
+Double_t AliMUONTrackParam::P() const
{
- // return p from track paramaters
+ /// return p from track paramaters
Double_t pYZ, pZ, p;
pYZ = 0;
if ( TMath::Abs(fInverseBendingMomentum) > 0 )
}
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapOneStepHelix(Double_t charge, Double_t step,
- Double_t *vect, Double_t *vout)
+ Double_t *vect, Double_t *vout) const
{
-// ******************************************************************
-// * *
-// * Performs the tracking of one step in a magnetic field *
-// * The trajectory is assumed to be a helix in a constant field *
-// * taken at the mid point of the step. *
-// * Parameters: *
-// * input *
-// * STEP =arc length of the step asked *
-// * VECT =input vector (position,direction cos and momentum) *
-// * CHARGE= electric charge of the particle *
-// * output *
-// * VOUT = same as VECT after completion of the step *
-// * *
-// * ==>Called by : <USER>, GUSWIM *
-// * Author m.hansroul ********* *
-// * modified s.egli, s.v.levonian *
-// * modified v.perevoztchikov
-// * *
-// ******************************************************************
-//
+/// ******************************************************************
+/// * *
+/// * Performs the tracking of one step in a magnetic field *
+/// * The trajectory is assumed to be a helix in a constant field *
+/// * taken at the mid point of the step. *
+/// * Parameters: *
+/// * input *
+/// * STEP =arc length of the step asked *
+/// * VECT =input vector (position,direction cos and momentum) *
+/// * CHARGE= electric charge of the particle *
+/// * output *
+/// * VOUT = same as VECT after completion of the step *
+/// * *
+/// * ==>Called by : <USER>, GUSWIM *
+/// * Author m.hansroul ********* *
+/// * modified s.egli, s.v.levonian *
+/// * modified v.perevoztchikov
+/// * *
+/// ******************************************************************
// modif: everything in double precision
Double_t sint, sintt, tsint, cos1t;
Double_t f1, f2, f3, f4, f5, f6;
- const Int_t ix = 0;
- const Int_t iy = 1;
- const Int_t iz = 2;
- const Int_t ipx = 3;
- const Int_t ipy = 4;
- const Int_t ipz = 5;
- const Int_t ipp = 6;
+ const Int_t kix = 0;
+ const Int_t kiy = 1;
+ const Int_t kiz = 2;
+ const Int_t kipx = 3;
+ const Int_t kipy = 4;
+ const Int_t kipz = 5;
+ const Int_t kipp = 6;
- const Double_t ec = 2.9979251e-4;
+ const Double_t kec = 2.9979251e-4;
//
// ------------------------------------------------------------------
//
// units are kgauss,centimeters,gev/c
//
- vout[ipp] = vect[ipp];
+ vout[kipp] = vect[kipp];
if (TMath::Abs(charge) < 0.00001) {
for (Int_t i = 0; i < 3; i++) {
vout[i] = vect[i] + step * vect[i+3];
}
return;
}
- xyz[0] = vect[ix] + 0.5 * step * vect[ipx];
- xyz[1] = vect[iy] + 0.5 * step * vect[ipy];
- xyz[2] = vect[iz] + 0.5 * step * vect[ipz];
+ xyz[0] = vect[kix] + 0.5 * step * vect[kipx];
+ xyz[1] = vect[kiy] + 0.5 * step * vect[kipy];
+ xyz[2] = vect[kiz] + 0.5 * step * vect[kipz];
//cmodif: call gufld (xyz, h) changed into:
GetField (xyz, h);
h[0] /= h[3];
h[1] /= h[3];
h[2] /= h[3];
- h[3] *= ec;
+ h[3] *= kec;
- hxp[0] = h[1]*vect[ipz] - h[2]*vect[ipy];
- hxp[1] = h[2]*vect[ipx] - h[0]*vect[ipz];
- hxp[2] = h[0]*vect[ipy] - h[1]*vect[ipx];
+ hxp[0] = h[1]*vect[kipz] - h[2]*vect[kipy];
+ hxp[1] = h[2]*vect[kipx] - h[0]*vect[kipz];
+ hxp[2] = h[0]*vect[kipy] - h[1]*vect[kipx];
- hp = h[0]*vect[ipx] + h[1]*vect[ipy] + h[2]*vect[ipz];
+ hp = h[0]*vect[kipx] + h[1]*vect[kipy] + h[2]*vect[kipz];
- rho = -charge*h[3]/vect[ipp];
+ rho = -charge*h[3]/vect[kipp];
tet = rho * step;
if (TMath::Abs(tet) > 0.15) {
f5 = sint;
f6 = tet * cos1t * hp;
- vout[ix] = vect[ix] + f1*vect[ipx] + f2*hxp[0] + f3*h[0];
- vout[iy] = vect[iy] + f1*vect[ipy] + f2*hxp[1] + f3*h[1];
- vout[iz] = vect[iz] + f1*vect[ipz] + f2*hxp[2] + f3*h[2];
+ vout[kix] = vect[kix] + f1*vect[kipx] + f2*hxp[0] + f3*h[0];
+ vout[kiy] = vect[kiy] + f1*vect[kipy] + f2*hxp[1] + f3*h[1];
+ vout[kiz] = vect[kiz] + f1*vect[kipz] + f2*hxp[2] + f3*h[2];
- vout[ipx] = vect[ipx] + f4*vect[ipx] + f5*hxp[0] + f6*h[0];
- vout[ipy] = vect[ipy] + f4*vect[ipy] + f5*hxp[1] + f6*h[1];
- vout[ipz] = vect[ipz] + f4*vect[ipz] + f5*hxp[2] + f6*h[2];
+ vout[kipx] = vect[kipx] + f4*vect[kipx] + f5*hxp[0] + f6*h[0];
+ vout[kipy] = vect[kipy] + f4*vect[kipy] + f5*hxp[1] + f6*h[1];
+ vout[kipz] = vect[kipz] + f4*vect[kipz] + f5*hxp[2] + f6*h[2];
return;
}
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapOneStepHelix3(Double_t field, Double_t step,
- Double_t *vect, Double_t *vout)
+ Double_t *vect, Double_t *vout) const
{
-//
-// ******************************************************************
-// * *
-// * Tracking routine in a constant field oriented *
-// * along axis 3 *
-// * Tracking is performed with a conventional *
-// * helix step method *
-// * *
-// * ==>Called by : <USER>, GUSWIM *
-// * Authors R.Brun, M.Hansroul ********* *
-// * Rewritten V.Perevoztchikov
-// * *
-// ******************************************************************
-//
+/// ******************************************************************
+/// * *
+/// * Tracking routine in a constant field oriented *
+/// * along axis 3 *
+/// * Tracking is performed with a conventional *
+/// * helix step method *
+/// * *
+/// * ==>Called by : <USER>, GUSWIM *
+/// * Authors R.Brun, M.Hansroul ********* *
+/// * Rewritten V.Perevoztchikov
+/// * *
+/// ******************************************************************
Double_t hxp[3];
Double_t h4, hp, rho, tet;
Double_t sint, sintt, tsint, cos1t;
Double_t f1, f2, f3, f4, f5, f6;
- const Int_t ix = 0;
- const Int_t iy = 1;
- const Int_t iz = 2;
- const Int_t ipx = 3;
- const Int_t ipy = 4;
- const Int_t ipz = 5;
- const Int_t ipp = 6;
+ const Int_t kix = 0;
+ const Int_t kiy = 1;
+ const Int_t kiz = 2;
+ const Int_t kipx = 3;
+ const Int_t kipy = 4;
+ const Int_t kipz = 5;
+ const Int_t kipp = 6;
- const Double_t ec = 2.9979251e-4;
+ const Double_t kec = 2.9979251e-4;
//
// ------------------------------------------------------------------
//
// units are kgauss,centimeters,gev/c
//
- vout[ipp] = vect[ipp];
- h4 = field * ec;
+ vout[kipp] = vect[kipp];
+ h4 = field * kec;
- hxp[0] = - vect[ipy];
- hxp[1] = + vect[ipx];
+ hxp[0] = - vect[kipy];
+ hxp[1] = + vect[kipx];
- hp = vect[ipz];
+ hp = vect[kipz];
- rho = -h4/vect[ipp];
+ rho = -h4/vect[kipp];
tet = rho * step;
if (TMath::Abs(tet) > 0.15) {
sint = TMath::Sin(tet);
f5 = sint;
f6 = tet * cos1t * hp;
- vout[ix] = vect[ix] + f1*vect[ipx] + f2*hxp[0];
- vout[iy] = vect[iy] + f1*vect[ipy] + f2*hxp[1];
- vout[iz] = vect[iz] + f1*vect[ipz] + f3;
+ vout[kix] = vect[kix] + f1*vect[kipx] + f2*hxp[0];
+ vout[kiy] = vect[kiy] + f1*vect[kipy] + f2*hxp[1];
+ vout[kiz] = vect[kiz] + f1*vect[kipz] + f3;
- vout[ipx] = vect[ipx] + f4*vect[ipx] + f5*hxp[0];
- vout[ipy] = vect[ipy] + f4*vect[ipy] + f5*hxp[1];
- vout[ipz] = vect[ipz] + f4*vect[ipz] + f6;
+ vout[kipx] = vect[kipx] + f4*vect[kipx] + f5*hxp[0];
+ vout[kipy] = vect[kipy] + f4*vect[kipy] + f5*hxp[1];
+ vout[kipz] = vect[kipz] + f4*vect[kipz] + f6;
return;
}
//__________________________________________________________________________
void AliMUONTrackParam::ExtrapOneStepRungekutta(Double_t charge, Double_t step,
- Double_t* vect, Double_t* vout)
+ Double_t* vect, Double_t* vout) const
{
-//
-// ******************************************************************
-// * *
-// * Runge-Kutta method for tracking a particle through a magnetic *
-// * field. Uses Nystroem algorithm (See Handbook Nat. Bur. of *
-// * Standards, procedure 25.5.20) *
-// * *
-// * Input parameters *
-// * CHARGE Particle charge *
-// * STEP Step size *
-// * VECT Initial co-ords,direction cosines,momentum *
-// * Output parameters *
-// * VOUT Output co-ords,direction cosines,momentum *
-// * User routine called *
-// * CALL GUFLD(X,F) *
-// * *
-// * ==>Called by : <USER>, GUSWIM *
-// * Authors R.Brun, M.Hansroul ********* *
-// * V.Perevoztchikov (CUT STEP implementation) *
-// * *
-// * *
-// ******************************************************************
-//
+/// ******************************************************************
+/// * *
+/// * Runge-Kutta method for tracking a particle through a magnetic *
+/// * field. Uses Nystroem algorithm (See Handbook Nat. Bur. of *
+/// * Standards, procedure 25.5.20) *
+/// * *
+/// * Input parameters *
+/// * CHARGE Particle charge *
+/// * STEP Step size *
+/// * VECT Initial co-ords,direction cosines,momentum *
+/// * Output parameters *
+/// * VOUT Output co-ords,direction cosines,momentum *
+/// * User routine called *
+/// * CALL GUFLD(X,F) *
+/// * *
+/// * ==>Called by : <USER>, GUSWIM *
+/// * Authors R.Brun, M.Hansroul ********* *
+/// * V.Perevoztchikov (CUT STEP implementation) *
+/// * *
+/// * *
+/// ******************************************************************
Double_t h2, h4, f[4];
Double_t xyzt[3], a, b, c, ph,ph2;
Double_t maxit = 1992;
Double_t maxcut = 11;
- const Double_t dlt = 1e-4;
- const Double_t dlt32 = dlt/32.;
- const Double_t third = 1./3.;
- const Double_t half = 0.5;
- const Double_t ec = 2.9979251e-4;
-
- const Double_t pisqua = 9.86960440109;
- const Int_t ix = 0;
- const Int_t iy = 1;
- const Int_t iz = 2;
- const Int_t ipx = 3;
- const Int_t ipy = 4;
- const Int_t ipz = 5;
+ const Double_t kdlt = 1e-4;
+ const Double_t kdlt32 = kdlt/32.;
+ const Double_t kthird = 1./3.;
+ const Double_t khalf = 0.5;
+ const Double_t kec = 2.9979251e-4;
+
+ const Double_t kpisqua = 9.86960440109;
+ const Int_t kix = 0;
+ const Int_t kiy = 1;
+ const Int_t kiz = 2;
+ const Int_t kipx = 3;
+ const Int_t kipy = 4;
+ const Int_t kipz = 5;
// *.
// *. ------------------------------------------------------------------
for(Int_t j = 0; j < 7; j++)
vout[j] = vect[j];
- Double_t pinv = ec * charge / vect[6];
+ Double_t pinv = kec * charge / vect[6];
Double_t tl = 0.;
Double_t h = step;
Double_t rest;
b = vout[4];
c = vout[5];
- h2 = half * h;
- h4 = half * h2;
+ h2 = khalf * h;
+ h4 = khalf * h2;
ph = pinv * h;
- ph2 = half * ph;
+ ph2 = khalf * ph;
secxs[0] = (b * f[2] - c * f[1]) * ph2;
secys[0] = (c * f[0] - a * f[2]) * ph2;
seczs[0] = (a * f[1] - b * f[0]) * ph2;
ang2 = (secxs[0]*secxs[0] + secys[0]*secys[0] + seczs[0]*seczs[0]);
- if (ang2 > pisqua) break;
+ if (ang2 > kpisqua) break;
dxt = h2 * a + h4 * secxs[0];
dyt = h2 * b + h4 * secys[0];
est = TMath::Abs(dxt) + TMath::Abs(dyt) + TMath::Abs(dzt);
if (est > h) {
if (ncut++ > maxcut) break;
- h *= half;
+ h *= khalf;
continue;
}
est = TMath::Abs(dxt)+TMath::Abs(dyt)+TMath::Abs(dzt);
if (est > 2.*TMath::Abs(h)) {
if (ncut++ > maxcut) break;
- h *= half;
+ h *= khalf;
continue;
}
//cmodif: call gufld(xyzt,f) changed into:
GetField(xyzt,f);
- z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * third) * h;
- y = y + (b + (secys[0] + secys[1] + secys[2]) * third) * h;
- x = x + (a + (secxs[0] + secxs[1] + secxs[2]) * third) * h;
+ z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * kthird) * h;
+ y = y + (b + (secys[0] + secys[1] + secys[2]) * kthird) * h;
+ x = x + (a + (secxs[0] + secxs[1] + secxs[2]) * kthird) * h;
secxs[3] = (bt*f[2] - ct*f[1])* ph2;
secys[3] = (ct*f[0] - at*f[2])* ph2;
seczs[3] = (at*f[1] - bt*f[0])* ph2;
- a = a+(secxs[0]+secxs[3]+2. * (secxs[1]+secxs[2])) * third;
- b = b+(secys[0]+secys[3]+2. * (secys[1]+secys[2])) * third;
- c = c+(seczs[0]+seczs[3]+2. * (seczs[1]+seczs[2])) * third;
+ a = a+(secxs[0]+secxs[3]+2. * (secxs[1]+secxs[2])) * kthird;
+ b = b+(secys[0]+secys[3]+2. * (secys[1]+secys[2])) * kthird;
+ c = c+(seczs[0]+seczs[3]+2. * (seczs[1]+seczs[2])) * kthird;
est = TMath::Abs(secxs[0]+secxs[3] - (secxs[1]+secxs[2]))
+ TMath::Abs(secys[0]+secys[3] - (secys[1]+secys[2]))
+ TMath::Abs(seczs[0]+seczs[3] - (seczs[1]+seczs[2]));
- if (est > dlt && TMath::Abs(h) > 1.e-4) {
+ if (est > kdlt && TMath::Abs(h) > 1.e-4) {
if (ncut++ > maxcut) break;
- h *= half;
+ h *= khalf;
continue;
}
if (iter++ > maxit) break;
tl += h;
- if (est < dlt32)
+ if (est < kdlt32)
h *= 2.;
cba = 1./ TMath::Sqrt(a*a + b*b + c*c);
vout[0] = x;
f2 = f2*hnorm;
f3 = f3*hnorm;
- hxp[0] = f2*vect[ipz] - f3*vect[ipy];
- hxp[1] = f3*vect[ipx] - f1*vect[ipz];
- hxp[2] = f1*vect[ipy] - f2*vect[ipx];
+ hxp[0] = f2*vect[kipz] - f3*vect[kipy];
+ hxp[1] = f3*vect[kipx] - f1*vect[kipz];
+ hxp[2] = f1*vect[kipy] - f2*vect[kipx];
- hp = f1*vect[ipx] + f2*vect[ipy] + f3*vect[ipz];
+ hp = f1*vect[kipx] + f2*vect[kipy] + f3*vect[kipz];
rho1 = 1./rho;
sint = TMath::Sin(tet);
- cost = 2.*TMath::Sin(half*tet)*TMath::Sin(half*tet);
+ cost = 2.*TMath::Sin(khalf*tet)*TMath::Sin(khalf*tet);
g1 = sint*rho1;
g2 = cost*rho1;
g5 = sint;
g6 = cost * hp;
- vout[ix] = vect[ix] + g1*vect[ipx] + g2*hxp[0] + g3*f1;
- vout[iy] = vect[iy] + g1*vect[ipy] + g2*hxp[1] + g3*f2;
- vout[iz] = vect[iz] + g1*vect[ipz] + g2*hxp[2] + g3*f3;
+ vout[kix] = vect[kix] + g1*vect[kipx] + g2*hxp[0] + g3*f1;
+ vout[kiy] = vect[kiy] + g1*vect[kipy] + g2*hxp[1] + g3*f2;
+ vout[kiz] = vect[kiz] + g1*vect[kipz] + g2*hxp[2] + g3*f3;
- vout[ipx] = vect[ipx] + g4*vect[ipx] + g5*hxp[0] + g6*f1;
- vout[ipy] = vect[ipy] + g4*vect[ipy] + g5*hxp[1] + g6*f2;
- vout[ipz] = vect[ipz] + g4*vect[ipz] + g5*hxp[2] + g6*f3;
+ vout[kipx] = vect[kipx] + g4*vect[kipx] + g5*hxp[0] + g6*f1;
+ vout[kipy] = vect[kipy] + g4*vect[kipy] + g5*hxp[1] + g6*f2;
+ vout[kipz] = vect[kipz] + g4*vect[kipz] + g5*hxp[2] + g6*f3;
return;
}
//___________________________________________________________
- void AliMUONTrackParam::GetField(Double_t *Position, Double_t *Field)
+ void AliMUONTrackParam::GetField(Double_t *Position, Double_t *Field) const
{
- // interface to "gAlice->Field()->Field" for arguments in double precision
-
+ /// interface for arguments in double precision (Why ? ChF)
Float_t x[3], b[3];
x[0] = Position[0]; x[1] = Position[1]; x[2] = Position[2];
- gAlice->Field()->Field(x, b);
+ fkField->Field(x, b);
Field[0] = b[0]; Field[1] = b[1]; Field[2] = b[2];
return;
}
+//_____________________________________________-
+void AliMUONTrackParam::Print(Option_t* opt) const
+{
+ /// Printing TrackParam information
+ /// "full" option for printing all the information about the TrackParam
+ TString sopt(opt);
+ sopt.ToUpper();
+
+ if ( sopt.Contains("FULL") ) {
+ cout << "<AliMUONTrackParam> Bending P=" << setw(5) << setprecision(3) << 1./GetInverseBendingMomentum() <<
+ ", NonBendSlope=" << setw(5) << setprecision(3) << GetNonBendingSlope()*180./TMath::Pi() <<
+ ", BendSlope=" << setw(5) << setprecision(3) << GetBendingSlope()*180./TMath::Pi() <<
+ ", (x,y,z)_IP=(" << setw(5) << setprecision(3) << GetNonBendingCoor() <<
+ "," << setw(5) << setprecision(3) << GetBendingCoor() <<
+ "," << setw(5) << setprecision(3) << GetZ() <<
+ ") cm, (px,py,pz)=(" << setw(5) << setprecision(3) << Px() <<
+ "," << setw(5) << setprecision(3) << Py() <<
+ "," << setw(5) << setprecision(3) << Pz() << ") GeV/c" << endl;
+ }
+ else {
+ cout << "<AliMUONTrackParam>" << endl;
+ }
+
+}