]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegment.cxx
- Revised comments and adapted them for Doxygen
[u/mrichter/AliRoot.git] / MUON / AliMUONSegment.cxx
index 7609edc587b8aaf8ec1610e1354dcd240baacad4..d7e52f36476428dbfe2ebac99e3e2031acb6589c 100644 (file)
 //
 ///////////////////////////////////////////////////////////
 
+#include "AliMUONSegment.h" 
 #include "AliMUON.h"
-#include "AliMUONChamber.h" 
 #include "AliMUONHitForRec.h" 
-#include "AliMUONSegment.h" 
 #include "AliMUONTrackParam.h" 
 #include "AliRun.h" // for gAlice
+#include "AliLog.h" 
 
 ClassImp(AliMUONSegment) // Class implementation in ROOT context
 
   //__________________________________________________________________________
 AliMUONSegment::AliMUONSegment()
+  : TObject()
 {
   // Default constructor
   fHitForRecPtr1 = 0; // pointer to HitForRec in first chamber
@@ -56,12 +57,14 @@ AliMUONSegment::AliMUONSegment()
   fNonBendingCoorReso2 = 0.0; // Covariance(coordinate C1 in first chamber)
   fNonBendingSlopeReso2 = 0.0; // Covariance(slope)
   fNonBendingCoorSlopeReso2 = 0.0; // Covariance(C1,slope)
+  fZ = 0.0; // z in first plane
   fNonBendingImpact = 0.0; // Impact parameter in non bending plane
   fInTrack = kFALSE; // TRUE if segment belongs to one track
 }
 
   //__________________________________________________________________________
 AliMUONSegment::AliMUONSegment(AliMUONHitForRec* Hit1, AliMUONHitForRec* Hit2)
+  : TObject()
 {
   // Constructor for AliMUONSegment from two HitForRec's,
   // one, in the first chamber of the station, pointed to by "Hit1",
@@ -76,6 +79,7 @@ AliMUONSegment::AliMUONSegment(AliMUONHitForRec* Hit1, AliMUONHitForRec* Hit2)
   fHitForRecPtr1 = Hit1;
   fHitForRecPtr2 = Hit2;
   dz = Hit1->GetZ() - Hit2->GetZ();
+  fZ = Hit1->GetZ();
   // bending plane
   fBendingCoor = Hit1->GetBendingCoor();
   fBendingSlope = (fBendingCoor - Hit2->GetBendingCoor()) / dz;
@@ -97,15 +101,23 @@ AliMUONSegment::AliMUONSegment(AliMUONHitForRec* Hit1, AliMUONHitForRec* Hit2)
   return;
 }
 
-AliMUONSegment::AliMUONSegment (const AliMUONSegment& MUONSegment):TObject(MUONSegment)
+AliMUONSegment::AliMUONSegment (const AliMUONSegment& theMUONSegment)
+  : TObject(theMUONSegment)
 {
-// Dummy copy constructor
+// Protected copy constructor
+
+  AliFatal("Not implemented.");
 }
 
-AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& /*MUONSegment*/)
+AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& rhs)
 {
-// Dummy assignment operator
-    return *this;
+// Protected assignement operator
+
+  if (this == &rhs) return *this;
+
+  AliFatal("Not implemented.");
+    
+  return *this;  
 }
 
   //__________________________________________________________________________
@@ -123,7 +135,7 @@ Int_t AliMUONSegment::Compare(const TObject* Segment) const
 }
 
   //__________________________________________________________________________
-Double_t AliMUONSegment::NormalizedChi2WithSegment(AliMUONSegment* Segment, Double_t Sigma2Cut)
+Double_t AliMUONSegment::NormalizedChi2WithSegment(AliMUONSegment* Segment, Double_t Sigma2Cut) const
 {
   // Calculate the normalized Chi2 between the current Segment (this)
   // and the Segment pointed to by "Segment",
@@ -165,7 +177,7 @@ Double_t AliMUONSegment::NormalizedChi2WithSegment(AliMUONSegment* Segment, Doub
 }
 
   //__________________________________________________________________________
-AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t Station, Double_t MCSfactor)
+AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation ( Double_t z, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to station (0..) "Station".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -178,10 +190,9 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t St
   // The caller has the responsibility to delete this object.
   AliMUONSegment* extrapSegment = new AliMUONSegment(); // creates empty new segment
   // dZ from first hit of current Segment to first chamber of station "Station"
-  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  Double_t dZ =
-    (&(pMUON->Chamber(2 * Station)))->Z() - (this->fHitForRecPtr1)->GetZ();
+  Double_t dZ =  z - this->GetZ();
   // Data in bending plane
+  extrapSegment->fZ = z;
   //  coordinate
   extrapSegment->fBendingCoor = this->fBendingCoor + this->fBendingSlope * dZ;
   //  slope
@@ -209,7 +220,7 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t St
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber (Int_t Chamber, Double_t MCSfactor)
+AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber ( Double_t z, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to chamber(0..) "Chamber".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -220,10 +231,9 @@ AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber (Int_
   // The caller has the responsibility to delete this object.
   AliMUONHitForRec* extrapHitForRec = new AliMUONHitForRec(); // creates empty new HitForRec
   // dZ from first hit of current Segment to chamber
-  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  Double_t dZ =
-    (&(pMUON->Chamber(Chamber)))->Z() - (this->fHitForRecPtr1)->GetZ();
+  Double_t dZ = z - this->GetZ();
   // Data in bending plane
+  extrapHitForRec->SetZ(z);
   //  coordinate
   extrapHitForRec->SetBendingCoor(this->fBendingCoor + this->fBendingSlope * dZ);
   //  covariance, including multiple Coulomb scattering over dZ due to one chamber
@@ -309,6 +319,8 @@ void AliMUONSegment::UpdateFromStationTrackParam(AliMUONTrackParam *TrackParam,
   fNonBendingCoor = param0->GetNonBendingCoor(); // coordinate
   fNonBendingSlope = param0->GetNonBendingSlope(); // slope
 
+  fZ = param0->GetZ(); // z
+
   // Resolutions
   // cReso2 and sReso2 have to be subtracted here from the parametrization
   // because they are added in the functions "NormalizedChi2WithSegment"