]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackHit.cxx
- Class description on 5 lines (Coding conventions)
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackHit.cxx
index ef569b7ba87e63e938c1b5a8be8c45523197289a..88c62550d72f9512579d9e3eb05c8e811f4bc6cc 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.5  2000/07/20 12:45:27  gosset
-New "EventReconstructor..." structure,
-       hopefully more adapted to tree/streamer.
-"AliMUONEventReconstructor::RemoveDoubleTracks"
-       to keep only one track among similar ones.
-
-Revision 1.4  2000/07/18 16:04:06  gosset
-AliMUONEventReconstructor package:
-* a few minor modifications and more comments
-* a few corrections
-  * right sign for Z of raw clusters
-  * right loop over chambers inside station
-  * symmetrized covariance matrix for measurements (TrackChi2MCS)
-  * right sign of charge in extrapolation (ExtrapToZ)
-  * right zEndAbsorber for Branson correction below 3 degrees
-* use of TVirtualFitter instead of TMinuit for AliMUONTrack::Fit
-* no parameter for AliMUONTrack::Fit() but more fit parameters in Track object
-
-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:49  morsch
-Code from MUON-dev joined
-
-Revision 1.1.2.3  2000/06/12 10:11:45  morsch
-Dummy copy constructor and assignment operator added
-
-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$ */
+
+///////////////////////////////////////////////////////
+//
+// Reconstructed track hit
+// in
+// ALICE
+// dimuon
+// spectrometer
 //
-// Reconstructed track hit in ALICE dimuon spectrometer
-//__________________________________________________________________________
+///////////////////////////////////////////////////////
 
 #include "AliMUONTrackHit.h" 
-
 #include "AliMUONHitForRec.h" 
+#include "AliLog.h" 
 
 ClassImp(AliMUONTrackHit) // Class implementation in ROOT context
 
+  //__________________________________________________________________________
+AliMUONTrackHit::AliMUONTrackHit()
+  : TObject()
+{
+/// Default constructor
+
+  fHitForRecPtr = 0;
+  fNextTrackHitWithSameHitForRec = 0;
+  fPrevTrackHitWithSameHitForRec = 0;
+}
+  //__________________________________________________________________________
+AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& theMUONTrackHit)
+  :  TObject(theMUONTrackHit)
+{
+/// Copy constructor
+
+  fTrackParam                    =  theMUONTrackHit.fTrackParam;
+  fHitForRecPtr                  =  theMUONTrackHit.fHitForRecPtr;
+  fNextTrackHitWithSameHitForRec =  theMUONTrackHit.fNextTrackHitWithSameHitForRec;
+  fPrevTrackHitWithSameHitForRec =  theMUONTrackHit.fPrevTrackHitWithSameHitForRec;
+}
+  //__________________________________________________________________________
+AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& theMUONTrackHit)
+{
+/// Assignment operator
+
+  // check assignement to self
+  if (this == &theMUONTrackHit)
+    return *this;
+
+  // base class assignement
+  TObject::operator=(theMUONTrackHit);
+
+  fTrackParam                    =  theMUONTrackHit.fTrackParam;
+  fHitForRecPtr                  =  theMUONTrackHit.fHitForRecPtr;
+  fNextTrackHitWithSameHitForRec = theMUONTrackHit.fNextTrackHitWithSameHitForRec;
+  fPrevTrackHitWithSameHitForRec = theMUONTrackHit.fPrevTrackHitWithSameHitForRec;
+
+  return *this;
+
+}
   //__________________________________________________________________________
 AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
 {
-  // Constructor from the HitForRec pointed to by "Hit"
+/// Constructor from the HitForRec pointed to by "Hit"
+
   fHitForRecPtr = Hit; // pointer to HitForRec
   // links from/to HitForRec
   if (Hit->GetNTrackHits() == 0) {
@@ -79,27 +91,13 @@ AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
   fNextTrackHitWithSameHitForRec = NULL;
   Hit->SetNTrackHits(Hit->GetNTrackHits() + 1);
 }
-
-  //__________________________________________________________________________
-AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit)
-{
-// Dummy copy constructor
-}
-
-  //__________________________________________________________________________
-AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit)
-{
-// Dummy assignment operator
-    return *this;
-}
-
-
   //__________________________________________________________________________
 AliMUONTrackHit::~AliMUONTrackHit()
 {
-  // Destructor
-  // Update links between HitForRec's and TrackHit's
-  // connected to the current TrackHit being removed.
+/// Destructor
+/// Update links between HitForRec's and TrackHit's
+/// connected to the current TrackHit being removed.
+
   AliMUONHitForRec *hit = fHitForRecPtr; // pointer to HitForRec
   // remove current TrackHit in HitForRec links
   if (this == hit->GetFirstTrackHitPtr())
@@ -123,12 +121,13 @@ AliMUONTrackHit::~AliMUONTrackHit()
   //__________________________________________________________________________
 Int_t AliMUONTrackHit::Compare(const TObject* TrackHit) const
 {
-  // "Compare" function to sort with increasing Z.
-  // Returns -1 (0, +1) if Z of current TrackHit
-  // is smaller than (equal to, larger than) Z of TrackHit
+/// "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() <
-      ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return(-1);
+      ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return(1);
   else if (fHitForRecPtr->GetZ() ==
           ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return( 0);
-  else return(+1);
+  else return(-1);
 }