]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackHit.cxx
Patch for the division par zero in fQ[1]. To be investigated
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackHit.cxx
index 024cf118daeeba93cd2a2ecad082271155c8ef97..56042c00452261957c380c75a0d08ecfc4bee363 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.2  2000/06/15 07:58:49  morsch
-Code from MUON-dev joined
+/* $Id$ */
 
-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++
-*/
-
-//__________________________________________________________________________
+///////////////////////////////////////////////////////
 //
-// Reconstructed track hit in ALICE dimuon spectrometer
-//__________________________________________________________________________
-
-#include "AliMUONTrackHit.h" 
+// Reconstructed track hit
+// in
+// ALICE
+// dimuon
+// spectrometer
+//
+///////////////////////////////////////////////////////
 
 #include "AliMUONHitForRec.h" 
+#include "AliMUONTrackHit.h" 
 
 ClassImp(AliMUONTrackHit) // Class implementation in ROOT context
 
@@ -59,13 +49,14 @@ AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
   Hit->SetNTrackHits(Hit->GetNTrackHits() + 1);
 }
 
-
-AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit)
+  //__________________________________________________________________________
+AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit):TObject(MUONTrackHit)
 {
 // Dummy copy constructor
 }
 
-AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit)
+  //__________________________________________________________________________
+AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& /*MUONTrackHit*/)
 {
 // Dummy assignment operator
     return *this;
@@ -73,7 +64,33 @@ AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit
 
 
   //__________________________________________________________________________
-Int_t AliMUONTrackHit::Compare(TObject* TrackHit)
+AliMUONTrackHit::~AliMUONTrackHit()
+{
+  // 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())
+    hit->SetFirstTrackHitPtr(fNextTrackHitWithSameHitForRec); // if first
+  if (this == hit->GetLastTrackHitPtr())
+    hit->SetLastTrackHitPtr(fPrevTrackHitWithSameHitForRec); // if last
+  hit->SetNTrackHits(hit->GetNTrackHits() - 1); // decrement NTrackHits of hit
+  // update link to next TrackHit of previous TrackHit
+  if (fPrevTrackHitWithSameHitForRec != NULL)
+    fPrevTrackHitWithSameHitForRec->
+      SetNextTrackHitWithSameHitForRec(fNextTrackHitWithSameHitForRec);
+  // update link to previous TrackHit of next TrackHit
+  if (fNextTrackHitWithSameHitForRec)
+    fNextTrackHitWithSameHitForRec->
+      SetPrevTrackHitWithSameHitForRec(fPrevTrackHitWithSameHitForRec);
+  // to be checked thoroughly !!!!
+  // with Root counter of AliMUONTrackHit objects,
+  // with loop over all these links after the update
+}
+
+  //__________________________________________________________________________
+Int_t AliMUONTrackHit::Compare(const TObject* TrackHit) const
 {
   // "Compare" function to sort with increasing Z.
   // Returns -1 (0, +1) if Z of current TrackHit