]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackParam.cxx
Optional geometry without CPV
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackParam.cxx
index e41ce1724fb7049289920f5fdc4f96219ffbeb36..cf86ff5939f22f50fd94834c565c01085d3b68ce 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.1.2.3  2000/06/09 21:03:09  morsch
-Make includes consistent with new file structure.
+/* $Id$ */
 
-Revision 1.1.2.2  2000/06/09 12:58:05  gosset
-Removed comment beginnings in Log sections of .cxx files
-Suppressed most violations of coding rules
-
-Revision 1.1.2.1  2000/06/07 14:44:53  gosset
-Addition of files for track reconstruction in C++
-*/
-
-//__________________________________________________________________________
+///////////////////////////////////////////////////
+//
+// Track parameters
+// in
+// ALICE
+// dimuon
+// spectrometer
 //
-// Track parameters in ALICE dimuon spectrometer
-//__________________________________________________________________________
+///////////////////////////////////////////////////
 
-#include <iostream.h>
+#include <Riostream.h>
+#include <TMatrixD.h>
 
-#include "AliCallf77.h" 
-#include "AliMUON.h" 
-#include "AliMUONHitForRec.h" 
-#include "AliMUONSegment.h" 
-#include "AliMUONTrackParam.h" 
-#include "AliMUONChamber.h" 
-#include "AliRun.h" 
+#include "AliMUONTrackParam.h"
+#include "AliESDMuonTrack.h"
+#include "AliLog.h"
+#include "AliMUONHitForRec.h"
 
+/// \cond CLASSIMP
 ClassImp(AliMUONTrackParam) // Class implementation in ROOT context
+/// \endcond
+
+  //_________________________________________________________________________
+AliMUONTrackParam::AliMUONTrackParam()
+  : TObject(),
+    fNonBendingCoor(0.),
+    fNonBendingSlope(0.),
+    fBendingCoor(0.),
+    fBendingSlope(0.),
+    fInverseBendingMomentum(0.),
+    fZ(0.),
+    fCovariances(0x0),
+    fHitForRecPtr(0x0)
+{
+  /// Constructor
+}
 
-#ifndef WIN32 
-# define reco_ghelix reco_ghelix_
-#else 
-# define reco_ghelix RECO_GHELIX
-#endif 
-
-extern "C"
-{
-void type_of_call reco_ghelix(Double_t &Charge, Double_t &StepLength, Double_t *VGeant3, Double_t *VGeant3New);
-}
-
-// Inline functions for Get and Set: inline removed because it does not work !!!!
-Double_t AliMUONTrackParam::GetInverseBendingMomentum(void) {
-  // Get fInverseBendingMomentum
-  return fInverseBendingMomentum;}
-void AliMUONTrackParam::SetInverseBendingMomentum(Double_t InverseBendingMomentum) {
-  // Set fInverseBendingMomentum
-  fInverseBendingMomentum = InverseBendingMomentum;}
-Double_t AliMUONTrackParam::GetBendingSlope(void) {
-  // Get fBendingSlope
-  return fBendingSlope;}
-void AliMUONTrackParam::SetBendingSlope(Double_t BendingSlope) {
-  // Set fBendingSlope
-  fBendingSlope = BendingSlope;}
-Double_t AliMUONTrackParam::GetNonBendingSlope(void) {
-  // Get fNonBendingSlope
-  return fNonBendingSlope;}
-void AliMUONTrackParam::SetNonBendingSlope(Double_t NonBendingSlope) {
-  // Set fNonBendingSlope
-  fNonBendingSlope = NonBendingSlope;}
-Double_t AliMUONTrackParam::GetZ(void) {
-  // Get fZ
-  return fZ;}
-void AliMUONTrackParam::SetZ(Double_t Z) {
-  // Set fZ
-  fZ = Z;}
-Double_t AliMUONTrackParam::GetBendingCoor(void) {
-  // Get fBendingCoor
-  return fBendingCoor;}
-void AliMUONTrackParam::SetBendingCoor(Double_t BendingCoor) {
-  // Set fBendingCoor
-  fBendingCoor = BendingCoor;}
-Double_t AliMUONTrackParam::GetNonBendingCoor(void) {
-  // Get fNonBendingCoor
-  return fNonBendingCoor;}
-void AliMUONTrackParam::SetNonBendingCoor(Double_t NonBendingCoor) {
-  // Set fNonBendingCoor
-  fNonBendingCoor = NonBendingCoor;}
+  //_________________________________________________________________________
+AliMUONTrackParam::AliMUONTrackParam(const AliMUONTrackParam& theMUONTrackParam)
+  : TObject(theMUONTrackParam),
+    fNonBendingCoor(theMUONTrackParam.fNonBendingCoor),
+    fNonBendingSlope(theMUONTrackParam.fNonBendingSlope),
+    fBendingCoor(theMUONTrackParam.fBendingCoor),
+    fBendingSlope(theMUONTrackParam.fBendingSlope),
+    fInverseBendingMomentum(theMUONTrackParam.fInverseBendingMomentum), 
+    fZ(theMUONTrackParam.fZ),
+    fCovariances(0x0),
+    fHitForRecPtr(theMUONTrackParam.fHitForRecPtr)
+{
+  /// Copy constructor
+  if (theMUONTrackParam.fCovariances) fCovariances = new TMatrixD(*(theMUONTrackParam.fCovariances));
+}
+
+  //_________________________________________________________________________
+AliMUONTrackParam& AliMUONTrackParam::operator=(const AliMUONTrackParam& theMUONTrackParam)
+{
+  /// Asignment operator
+  if (this == &theMUONTrackParam)
+    return *this;
+
+  // base class assignement
+  TObject::operator=(theMUONTrackParam);
+
+  fNonBendingCoor              =  theMUONTrackParam.fNonBendingCoor;
+  fNonBendingSlope             =  theMUONTrackParam.fNonBendingSlope; 
+  fBendingCoor                 =  theMUONTrackParam.fBendingCoor; 
+  fBendingSlope                =  theMUONTrackParam.fBendingSlope; 
+  fInverseBendingMomentum      =  theMUONTrackParam.fInverseBendingMomentum; 
+  fZ                           =  theMUONTrackParam.fZ; 
+  
+  if (theMUONTrackParam.fCovariances) {
+    if (fCovariances) *fCovariances = *(theMUONTrackParam.fCovariances);
+    else fCovariances = new TMatrixD(*(theMUONTrackParam.fCovariances));
+  } else if (fCovariances) {
+    delete fCovariances;
+    fCovariances = 0x0;
+  }
+  
+  return *this;
+}
 
   //__________________________________________________________________________
-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.
-  // Use "reco_ghelix" which should be replaced by something else !!!!
-  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;
-  else forwardBackward = -1.0;
-  Double_t temp, vGeant3[7], vGeant3New[7]; // 7 in parameter ????
-  Int_t iGeant3, stepNumber;
-  Int_t maxStepNumber = 5000; // in parameter ????
-  // For safety: return kTRUE or kFALSE ????
-  // Parameter vector for calling GHELIX in Geant3
-  SetGeant3Parameters(vGeant3, forwardBackward);
-  // For use of reco_ghelix...: invert X and Y, PX/PTOT and PY/PTOT !!!!
-  temp = vGeant3[0]; vGeant3[0] = vGeant3[1]; vGeant3[1] = temp;
-  temp = vGeant3[3]; vGeant3[3] = vGeant3[4]; vGeant3[4] = temp;
-  // charge must be changed with momentum for backward motion
-  Double_t charge =
-    forwardBackward * TMath::Sign(Double_t(1.0), this->fInverseBendingMomentum);
-  Double_t stepLength = 6.0; // in parameter ????
-  // Extrapolation loop
-  stepNumber = 0;
-  while (((forwardBackward * (vGeant3[2] - Z)) <= 0.0) &&
-        (stepNumber < maxStepNumber)) {
-    stepNumber++;
-    // call Geant3 "ghelix" subroutine through a copy in "reco_muon.F":
-    // the true function should be called, but how ???? and remove prototyping ...
-    reco_ghelix(charge, stepLength, vGeant3, vGeant3New);
-    if ((forwardBackward * (vGeant3New[2] - Z)) > 0.0) break; // one is beyond Z
-    // better use TArray ????
-    for (iGeant3 = 0; iGeant3 < 7; iGeant3++)
-      {vGeant3[iGeant3] = vGeant3New[iGeant3];}
+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
+  DeleteCovariances();
+}
+
+  //__________________________________________________________________________
+void AliMUONTrackParam::SetTrackParam(AliMUONTrackParam& theMUONTrackParam)
+{
+  /// Set track parameters from "TrackParam" leaving pointer to fHitForRecPtr and parameter covariances unchanged
+  fNonBendingCoor              =  theMUONTrackParam.fNonBendingCoor;
+  fNonBendingSlope             =  theMUONTrackParam.fNonBendingSlope; 
+  fBendingCoor                 =  theMUONTrackParam.fBendingCoor; 
+  fBendingSlope                =  theMUONTrackParam.fBendingSlope; 
+  fInverseBendingMomentum      =  theMUONTrackParam.fInverseBendingMomentum; 
+  fZ                           =  theMUONTrackParam.fZ; 
+}
+
+  //__________________________________________________________________________
+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("fHitForRecPtr == NULL");
+  return fHitForRecPtr;
+}
+
+  //__________________________________________________________________________
+void AliMUONTrackParam::SetHitForRecPtr(AliMUONHitForRec* hitForRec)
+{
+/// set pointeur to associated HitForRec and update the number of TrackHit's connected to it
+  fHitForRecPtr = hitForRec;
+  fHitForRecPtr->SetNTrackHits(fHitForRecPtr->GetNTrackHits() + 1); // increment NTrackHits of hit
+}
+
+  //_________________________________________________________________________
+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);
+}
+
+  //__________________________________________________________________________
+Double_t AliMUONTrackParam::Px() const
+{
+  /// return px from track paramaters
+  Double_t pYZ, pZ, pX;
+  pYZ = 0;
+  if (  TMath::Abs(fInverseBendingMomentum) > 0 )
+    pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
+  pZ = -pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));  // spectro. (z<0)
+  pX = pZ * fNonBendingSlope; 
+  return pX;
+}
+
+  //__________________________________________________________________________
+Double_t AliMUONTrackParam::Py() const
+{
+  /// return px from track paramaters
+  Double_t pYZ, pZ, pY;
+  pYZ = 0;
+  if (  TMath::Abs(fInverseBendingMomentum) > 0 )
+    pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
+  pZ = -pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));  // spectro. (z<0)
+  pY = pZ * fBendingSlope; 
+  return pY;
+}
+
+  //__________________________________________________________________________
+Double_t AliMUONTrackParam::Pz() const
+{
+  /// return px from track paramaters
+  Double_t pYZ, pZ;
+  pYZ = 0;
+  if (  TMath::Abs(fInverseBendingMomentum) > 0 )
+    pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
+  pZ = -pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));  // spectro. (z<0)
+  return pZ;
+}
+
+  //__________________________________________________________________________
+Double_t AliMUONTrackParam::P() const
+{
+  /// return p from track paramaters
+  Double_t  pYZ, pZ, p;
+  pYZ = 0;
+  if (  TMath::Abs(fInverseBendingMomentum) > 0 )
+    pYZ = TMath::Abs(1.0 / fInverseBendingMomentum);
+  pZ = -pYZ / (TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope));  // spectro. (z<0)
+  p = TMath::Abs(pZ) * 
+    TMath::Sqrt(1.0 + fBendingSlope * fBendingSlope + fNonBendingSlope * fNonBendingSlope);
+  return p;
+  
+}
+
+  //__________________________________________________________________________
+TMatrixD* AliMUONTrackParam::GetCovariances()
+{
+  /// Return the covariance matrix (create it before if needed)
+  if (!fCovariances) {
+    fCovariances = new TMatrixD(5,5);
+    (*fCovariances) = 0;
   }
-  // check maxStepNumber ????
-  // For use of reco_ghelix...:
-  // invert back X and Y, PX/PTOT and PY/PTOT, both for vGeant3 and vGeant3New !!!!
-  temp = vGeant3[0]; vGeant3[0] = vGeant3[1]; vGeant3[1] = temp;
-  temp = vGeant3New[0]; vGeant3New[0] = vGeant3New[1]; vGeant3New[1] = temp;
-  temp = vGeant3[3]; vGeant3[3] = vGeant3[4]; vGeant3[4] = temp;
-  temp = vGeant3New[3]; vGeant3New[3] = vGeant3New[4]; vGeant3New[4] = temp;
-  // 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);
-  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
-  // Track parameters from Geant3 parameters
-  GetFromGeant3Parameters(vGeant3, charge);
+  return fCovariances;
+  }
+
+  //__________________________________________________________________________
+void AliMUONTrackParam::SetCovariances(TMatrixD* covariances)
+{
+  /// Set the covariance matrix
+  if (covariances == fCovariances) return; // nothing to be done
+  if (fCovariances) *fCovariances = *covariances;
+  else fCovariances = new TMatrixD(*covariances);
 }
 
   //__________________________________________________________________________
-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).
-  VGeant3[0] = this->fNonBendingCoor; // X
-  VGeant3[1] = this->fBendingCoor; // Y
-  VGeant3[2] = this->fZ; // Z
-  Double_t pYZ = TMath::Abs(1.0 / this->fInverseBendingMomentum);
-  Double_t pZ =
-    pYZ / TMath::Sqrt(1.0 + this->fBendingSlope * this->fBendingSlope);
-  VGeant3[6] =
-    TMath::Sqrt(pYZ * pYZ +
-               pZ * pZ * this->fNonBendingSlope * this->fNonBendingSlope); // PTOT
-  VGeant3[5] = ForwardBackward * pZ / VGeant3[6]; // PZ/PTOT
-  VGeant3[3] = this->fNonBendingSlope * VGeant3[5]; // PX/PTOT
-  VGeant3[4] = this->fBendingSlope * VGeant3[5]; // PY/PTOT
+void AliMUONTrackParam::SetCovariances(Double_t matrix[5][5])
+{
+  /// Set the covariance matrix
+  if (fCovariances) fCovariances->SetMatrixArray(&(matrix[0][0]));
+  else fCovariances = new TMatrixD(5,5,&(matrix[0][0]));
 }
 
   //__________________________________________________________________________
-void AliMUONTrackParam::GetFromGeant3Parameters(Double_t *VGeant3, Double_t Charge)
+void AliMUONTrackParam::SetVariances(Double_t matrix[5][5])
 {
-  // Get track parameters in current AliMUONTrackParam
-  // from Geant3 parameters pointed to by "VGeant3".
-  // "InverseBendingMomentum" is signed with "Charge".
-  this->fNonBendingCoor = VGeant3[0]; // X
-  this->fBendingCoor = VGeant3[1]; // Y
-  this->fZ = VGeant3[2]; // Z
-  Double_t pYZ = VGeant3[6] * TMath::Sqrt(1.0 - VGeant3[3] * VGeant3[3]);
-  this->fInverseBendingMomentum = Charge / pYZ;
-  this->fBendingSlope = VGeant3[4] / VGeant3[5];
-  this->fNonBendingSlope = VGeant3[3] / VGeant3[5];
+  /// Set the diagonal terms of the covariance matrix (variances)
+  if (!fCovariances) fCovariances = new TMatrixD(5,5);
+  (*fCovariances) = 0;
+  for (Int_t i=0; i<5; i++) (*fCovariances)(i,i) = matrix[i][i];
 }
 
   //__________________________________________________________________________
-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).
-  Double_t extZ[2], z1, z2;
-  Int_t i1, i2;
-  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
-  // 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;}
-  else {
-    cout << "ERROR in AliMUONTrackParam::CreateExtrapSegmentInStation" << endl;
-    cout << "Starting Z (" << this->fZ << ") in between z1 (" << z1 <<
-      ") and z2 (" << z2 << ") of station(0..) " << Station << endl;
+void AliMUONTrackParam::DeleteCovariances()
+{
+  /// Delete the covariance matrix
+  if (fCovariances) delete fCovariances;
+  fCovariances = 0x0;
+}
+
+  //__________________________________________________________________________
+void AliMUONTrackParam::EvalCovariances(AliMUONHitForRec* hit2)
+{
+  /// Evaluate covariances assuming the track is only a straight line
+  /// between the HitForRec attached to the current TrackParam and hit2.
+  /// Nothing can be done on fInverseBendingMomentum (-> 50% err).
+  
+  // Allocate memory if needed
+  if (!fCovariances) fCovariances = new TMatrixD(5,5);
+  
+  // Reset the covariance matrix
+  (*fCovariances) = 0;
+  
+  if (!fHitForRecPtr) {
+    AliWarning("fHitForRecPtr == NULL: cannot calculate TrackParam covariances");
+    return;
   }
-  extZ[i1] = z1;
-  extZ[i2] = z2;
-  // copy of track parameters
-  TrackParam[i1] = *this;
-  // first extrapolation
-  (&(TrackParam[i1]))->ExtrapToZ(extZ[0]);
-  TrackParam[i2] = TrackParam[i1];
-  // second extrapolation
-  (&(TrackParam[i2]))->ExtrapToZ(extZ[1]);
-  return;
+  
+  Double_t dz = fHitForRecPtr->GetZ() - hit2->GetZ();
+  
+  // Non bending plane
+  (*fCovariances)(0,0) = fHitForRecPtr->GetNonBendingReso2();
+  (*fCovariances)(0,1) = fHitForRecPtr->GetNonBendingReso2() / dz;
+  (*fCovariances)(1,0) = (*fCovariances)(0,1);
+  (*fCovariances)(1,1) = ( fHitForRecPtr->GetNonBendingReso2() + hit2->GetNonBendingReso2() ) / dz / dz;
+  // Bending plane
+  (*fCovariances)(2,2) = fHitForRecPtr->GetBendingReso2();
+  (*fCovariances)(2,3) = fHitForRecPtr->GetBendingReso2() / dz;
+  (*fCovariances)(3,2) = (*fCovariances)(2,3);
+  (*fCovariances)(3,3) = ( fHitForRecPtr->GetBendingReso2() + hit2->GetBendingReso2() ) / dz / dz;
+  // Inverse bending momentum
+  (*fCovariances)(4,4) = 0.5*fInverseBendingMomentum * 0.5*fInverseBendingMomentum; // error 50%
+  
 }
 
+  //__________________________________________________________________________
+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::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;
+  }
+    
+}