]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackParam.cxx
New option to select between the new and the old RCU trailer format
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackParam.cxx
index efdfc1915308608b7b548779acc4a7891d9c4f01..01beb2eb5aeb4ab252f73c457779fe65279b4e6b 100644 (file)
@@ -28,7 +28,7 @@
 //#include <Riostream.h>
 #include "AliMUON.h"
 #include "AliMUONTrackParam.h" 
-//#include "AliMUONChamber.h"
+#include "AliMUONConstants.h"
 #include "AliRun.h" 
 #include "AliMagF.h" 
 #include "AliLog.h" 
@@ -193,10 +193,9 @@ void AliMUONTrackParam::ExtrapToStation(Int_t Station, AliMUONTrackParam *TrackP
   // 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;}
@@ -441,12 +440,14 @@ Double_t AliMUONTrackParam::TotalMomentumEnergyLoss(Double_t thetaLimit, Double_
     } 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;
@@ -496,7 +497,7 @@ void AliMUONTrackParam::FieldCorrection(Double_t Z)
  
 }
   //__________________________________________________________________________
-Double_t AliMUONTrackParam::Px()
+Double_t AliMUONTrackParam::Px() const
 {
   // return px from track paramaters
   Double_t pYZ, pZ, pX;
@@ -508,7 +509,7 @@ Double_t AliMUONTrackParam::Px()
   return pX;
 }
   //__________________________________________________________________________
-Double_t AliMUONTrackParam::Py()
+Double_t AliMUONTrackParam::Py() const
 {
   // return px from track paramaters
   Double_t pYZ, pZ, pY;
@@ -520,7 +521,7 @@ Double_t AliMUONTrackParam::Py()
   return pY;
 }
   //__________________________________________________________________________
-Double_t AliMUONTrackParam::Pz()
+Double_t AliMUONTrackParam::Pz() const
 {
   // return px from track paramaters
   Double_t pYZ, pZ;
@@ -531,7 +532,7 @@ Double_t AliMUONTrackParam::Pz()
   return pZ;
 }
   //__________________________________________________________________________
-Double_t AliMUONTrackParam::P()
+Double_t AliMUONTrackParam::P() const
 {
   // return p from track paramaters
   Double_t  pYZ, pZ, p;
@@ -1001,3 +1002,29 @@ void AliMUONTrackParam::ExtrapOneStepRungekutta(Double_t charge, Double_t step,
 
     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;
+  }
+    
+}