]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHitForRec.cxx
Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / MUON / AliMUONHitForRec.cxx
index e1a4fc035aa778bb8c424fcadde97fc4189b1fa9..67f23a1a8f610ed71ef5c0f5fa747c3acdf977a5 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.4  2000/10/02 21:28:09  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.3  2000/06/25 13:06:39  hristov
-Inline functions moved from *.cxx to *.h files instead of forward declarations
-
-Revision 1.2  2000/06/15 07:58:48  morsch
-Code from MUON-dev joined
-
-Revision 1.1.2.4  2000/06/12 10:11:10  morsch
-Dummy copy constructor and assignment operator added
-
-Revision 1.1.2.3  2000/06/09 22:14:43  morsch
-Make includes consistent with new file naming.
-
-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++
-*/
+/* $Id$ */
 
 //__________________________________________________________________________
 //
@@ -44,25 +21,36 @@ Addition of files for track reconstruction in C++
 //__________________________________________________________________________
 
 #include "AliMUONHitForRec.h" 
-#include "AliMUONTrackParam.h" 
 #include "AliMUONRawCluster.h"
 #include "AliMUONHit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 
   //__________________________________________________________________________
-AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* Ghit)
+AliMUONHitForRec::AliMUONHitForRec()
+  : TObject()
+{
+ // Default Constructor
+    fFirstTrackHitPtr = 0;
+    fLastTrackHitPtr = 0;
+}
+
+  //__________________________________________________________________________
+AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* 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...).
-  fBendingCoor = Ghit->Y();
-  fNonBendingCoor = Ghit->X();
-  fZ = Ghit->Z();
-  // fTrack = Ghit->fTrack; ?????????
-  fChamberNumber = Ghit->Chamber() - 1;
+  fBendingCoor = theGhit->Y();
+  fNonBendingCoor = theGhit->X();
+  fZ = theGhit->Z();
+  // fTrack = theGhit->fTrack; ?????????
+  fChamberNumber = theGhit->Chamber() - 1;
   // other fields will be updated in
   // AliMUONEventReconstructor::NewHitForRecFromGEANT,
   // except the following ones
@@ -90,12 +78,13 @@ AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* Ghit)
 // }
 
   //__________________________________________________________________________
-AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* RawCluster)
+AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* theRawCluster)
+  : TObject()
 {
   // Constructor for AliMUONHitForRec from a raw cluster.
   // Fills the bending and non bending coordinates.
-  fNonBendingCoor = RawCluster->fX[0];
-  fBendingCoor = RawCluster->fY[0];
+  fNonBendingCoor = theRawCluster->GetX(0);
+  fBendingCoor = theRawCluster->GetY(0);
   // other fields will be updated in
   // AliMUONEventReconstructor::AddHitsForRecFromRawClusters,
   // except the following ones
@@ -108,18 +97,29 @@ AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* RawCluster)
   return;
 }
 
-AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& MUONHitForRec)
+  //__________________________________________________________________________
+AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& rhs)
+  : TObject(rhs)
 {
-// Dummy copy constructor
+// Protected copy constructor
+
+  AliFatal( "Not implemented.");
 }
 
-AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& MUONHitForRec)
+  //__________________________________________________________________________
+AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& rhs)
 {
-// Dummy assignment operator
-    return *this;
+// Protected assignement operator
+
+  if (this == &rhs) return *this;
+
+  AliFatal( "Not implemented.");
+    
+  return *this;  
 }
   //__________________________________________________________________________
-Int_t AliMUONHitForRec::Compare(TObject* Hit)
+/*AZ
+Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
 {
   // "Compare" function to sort with increasing chamber number.
   // Returns -1 (0, +1) if ChamberNumber of current HitForRec
@@ -128,12 +128,23 @@ Int_t AliMUONHitForRec::Compare(TObject* Hit)
   else if (fChamberNumber == ((AliMUONHitForRec*)Hit)->fChamberNumber) return( 0);
   else return(+1);
 }
+*/
+  //__________________________________________________________________________
+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
+  if (fZ <  ((AliMUONHitForRec*)Hit)->fZ) return(1);
+  else if (fZ == ((AliMUONHitForRec*)Hit)->fZ) return( 0);
+  else return(-1);
+}
 
   //__________________________________________________________________________
-Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* HitForRec, Double_t Sigma2Cut)
+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",
+  // 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".
@@ -145,15 +156,15 @@ Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* HitForR
   chi2 = 0.0;
   chi2Max = 3.0;
   // coordinate in bending plane
-  diff = this->fBendingCoor - HitForRec->fBendingCoor;
+  diff = fBendingCoor - hitForRec->fBendingCoor;
   normDiff = diff * diff /
-    (this->fBendingReso2 + HitForRec->fBendingReso2) / Sigma2Cut;
+    (fBendingReso2 + hitForRec->fBendingReso2) / Sigma2Cut;
   if (normDiff > 1.0) return chi2Max;
   chi2 = chi2 + normDiff;
   // coordinate in non bending plane
-  diff = this->fNonBendingCoor - HitForRec->fNonBendingCoor;
+  diff = fNonBendingCoor - hitForRec->fNonBendingCoor;
   normDiff = diff * diff /
-    (this->fNonBendingReso2 + HitForRec->fNonBendingReso2) / Sigma2Cut;
+    (fNonBendingReso2 + hitForRec->fNonBendingReso2) / Sigma2Cut;
   if (normDiff > 1.0) return chi2Max;
   chi2 = chi2 + normDiff;
   return chi2;