]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHitForRec.cxx
Loading libraries needed for reading & decoding rawdata
[u/mrichter/AliRoot.git] / MUON / AliMUONHitForRec.cxx
index 1537a7d2463601c3a825fcbca46742a34761b65b..e40d6431e4eafee2112f9a30d6af6b3a39a16bb4 100644 (file)
 
 /* $Id$ */
 
-//__________________________________________________________________________
-//
+// ------------------------
+// Class AliMUONHitForRec
+// ------------------------
 // Hit for reconstruction in ALICE dimuon spectrometer
-//__________________________________________________________________________
+// Author: J. Gosset
 
+#include "AliTrackReference.h" 
 #include "AliMUONHitForRec.h" 
 #include "AliMUONRawCluster.h"
 #include "AliMUONHit.h"
+#include "AliMUONConstants.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 
@@ -30,28 +34,30 @@ ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 AliMUONHitForRec::AliMUONHitForRec()
   : TObject()
 {
- // Default Constructor
+/// Default Constructor
  
     fFirstTrackHitPtr = 0;
     fLastTrackHitPtr = 0;
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* theGhit)
+AliMUONHitForRec::AliMUONHitForRec(AliTrackReference* theGhit)
   : TObject()
 {
-  // Constructor for AliMUONHitForRec from a GEANT hit.
-  // Fills the bending, non bending, and Z coordinates,
-  // which are taken from the coordinates of the GEANT hit,
-  // the track number (GEANT and not TH),
-  // and the chamber number (0...).
+/// Constructor for AliMUONHitForRec from a track ref. hit.
+/// Fills the bending, non bending, and Z coordinates,
+/// which are taken from the coordinates of the track ref. hit,
+/// the track number (track ref. and not TH),
+/// and the chamber number (0...).
+
   fBendingCoor = theGhit->Y();
   fNonBendingCoor = theGhit->X();
   fZ = theGhit->Z();
   // fTrack = theGhit->fTrack; ?????????
-  fChamberNumber = theGhit->Chamber() - 1;
+  fChamberNumber = AliMUONConstants::ChamberNumber(fZ);
+  fDetElemId = 0;
   // other fields will be updated in
-  // AliMUONEventReconstructor::NewHitForRecFromGEANT,
+  // AliMUONEventReconstructor::NewHitForRecFromTrackRef,
   // except the following ones
   fIndexOfFirstSegment = -1;
   fNSegments = 0;
@@ -80,15 +86,17 @@ AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* theGhit)
 AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* theRawCluster)
   : TObject()
 {
-  // Constructor for AliMUONHitForRec from a raw cluster.
-  // Fills the bending and non bending coordinates.
+/// Constructor for AliMUONHitForRec from a raw cluster.
+/// Fills the bending and non bending coordinates.
+
   fNonBendingCoor = theRawCluster->GetX(0);
   fBendingCoor = theRawCluster->GetY(0);
+  fDetElemId = theRawCluster->GetDetElemId();
   // other fields will be updated in
   // AliMUONEventReconstructor::AddHitsForRecFromRawClusters,
   // except the following ones
-  fTHTrack = -1;
-  fGeantSignal = -1;
+  fTTRTrack = -1;
+  fTrackRefSignal = -1;
   fIndexOfFirstSegment = -1;
   fNSegments = 0;
   fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
@@ -97,24 +105,49 @@ AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* theRawCluster)
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& rhs)
-  : TObject(rhs)
+AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& theMUONHitForRec)
+  :  TObject(theMUONHitForRec)
 {
-// Protected copy constructor
+/// Copy constructor
 
-  Fatal("AliMUONHitForRec", "Not implemented.");
+  fBendingCoor = theMUONHitForRec.fBendingCoor;
+  fNonBendingCoor = theMUONHitForRec.fNonBendingCoor;
+  fZ = theMUONHitForRec.fZ;
+  fBendingReso2 = theMUONHitForRec.fBendingReso2;
+  fNonBendingReso2 = theMUONHitForRec.fNonBendingReso2;
+  fChamberNumber = theMUONHitForRec.fChamberNumber;
+  fDetElemId = theMUONHitForRec.fDetElemId;
+  fHitNumber = theMUONHitForRec.fHitNumber;
+  fTTRTrack = theMUONHitForRec.fTTRTrack;
+  fTrackRefSignal = theMUONHitForRec.fTrackRefSignal;
+  fIndexOfFirstSegment = theMUONHitForRec.fIndexOfFirstSegment;
+  fNSegments = theMUONHitForRec.fNSegments;
+  fFirstTrackHitPtr = theMUONHitForRec.fFirstTrackHitPtr;
+  fLastTrackHitPtr = theMUONHitForRec.fLastTrackHitPtr;
+  fNTrackHits = theMUONHitForRec.fNTrackHits;
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& rhs)
+AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& theMUONHitForRec)
 {
-// Protected assignement operator
-
-  if (this == &rhs) return *this;
+/// Assignment operator
 
-  Fatal("operator=", "Not implemented.");
-    
-  return *this;  
+  fBendingCoor = theMUONHitForRec.fBendingCoor;
+  fNonBendingCoor = theMUONHitForRec.fNonBendingCoor;
+  fZ = theMUONHitForRec.fZ;
+  fBendingReso2 = theMUONHitForRec.fBendingReso2;
+  fNonBendingReso2 = theMUONHitForRec.fNonBendingReso2;
+  fChamberNumber = theMUONHitForRec.fChamberNumber;
+  fDetElemId = theMUONHitForRec.fDetElemId;
+  fHitNumber = theMUONHitForRec.fHitNumber;
+  fTTRTrack = theMUONHitForRec.fTTRTrack;
+  fTrackRefSignal = theMUONHitForRec.fTrackRefSignal;
+  fIndexOfFirstSegment = theMUONHitForRec.fIndexOfFirstSegment;
+  fNSegments = theMUONHitForRec.fNSegments;
+  fFirstTrackHitPtr = theMUONHitForRec.fFirstTrackHitPtr;
+  fLastTrackHitPtr = theMUONHitForRec.fLastTrackHitPtr;
+  fNTrackHits = theMUONHitForRec.fNTrackHits;
+  return *this;
 }
   //__________________________________________________________________________
 /*AZ
@@ -131,9 +164,10 @@ Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
   //__________________________________________________________________________
 Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
 {
-  // "Compare" function to sort with decreasing Z-coordinate (spectro. MUON z<0).
-  // Returns 1 (0, -1) if Z-coordinate of current HitForRec
-  // is smaller than (equal to, larger than) Z-coordinate of Hit
+/// "Compare" function to sort with decreasing Z-coordinate (spectro. MUON z<0).
+/// Returns 1 (0, -1) if Z-coordinate of current HitForRec
+/// is smaller than (equal to, larger than) Z-coordinate of Hit
+
   if (fZ <  ((AliMUONHitForRec*)Hit)->fZ) return(1);
   else if (fZ == ((AliMUONHitForRec*)Hit)->fZ) return( 0);
   else return(-1);
@@ -142,15 +176,16 @@ Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
   //__________________________________________________________________________
 Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* hitForRec, Double_t Sigma2Cut) const
 {
-  // Calculate the normalized Chi2 between the current hitForRec (this)
-  // and the hitForRec pointed to by "hitForRec",
-  // i.e. the square deviations between the coordinates,
-  // in both the bending and the non bending plane,
-  // divided by the variance of the same quantities and by "Sigma2Cut".
-  // Returns 3 if none of the 2 quantities is OK,
-  // something smaller than or equal to 2 otherwise.
-  // Would it be more correct to use a real chi square
-  // including the non diagonal term ????
+/// Calculate the normalized Chi2 between the current hitForRec (this)
+/// and the hitForRec pointed to by "hitForRec",
+/// i.e. the square deviations between the coordinates,
+/// in both the bending and the non bending plane,
+/// divided by the variance of the same quantities and by "Sigma2Cut".
+/// Returns 3 if none of the 2 quantities is OK,
+/// something smaller than or equal to 2 otherwise.
+/// Would it be more correct to use a real chi square
+/// including the non diagonal term ????
+
   Double_t chi2, chi2Max, diff, normDiff;
   chi2 = 0.0;
   chi2Max = 3.0;