]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHitForRec.cxx
Redesigning Original tracking classes (Philippe Pillot)
[u/mrichter/AliRoot.git] / MUON / AliMUONHitForRec.cxx
index 946599ca34e3c1b631216fb522bbdfab4dd3b170..90542b4695e0b4150c8a15b242a9733353681cda 100644 (file)
 #include "AliMUONHit.h"
 #include "AliMUONConstants.h"
 #include "AliLog.h"
+#include "Riostream.h"
 
 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 
   //__________________________________________________________________________
 AliMUONHitForRec::AliMUONHitForRec()
-  : TObject()
+  : TObject(),
+    fBendingCoor(0.),
+    fNonBendingCoor(0.),
+    fZ(0.),
+    fBendingReso2(0.),
+    fNonBendingReso2(0.),
+    fChamberNumber(0),
+    fDetElemId(0),
+    fHitNumber(0),
+    fTTRTrack(0),
+    fTrackRefSignal(0),
+    fIndexOfFirstSegment(0),
+    fNSegments(0),
+    fNTrackHits(0)
 {
 /// Default Constructor
  
-    fFirstTrackHitPtr = 0;
-    fLastTrackHitPtr = 0;
 }
 
   //__________________________________________________________________________
 AliMUONHitForRec::AliMUONHitForRec(AliTrackReference* theGhit)
-  : TObject()
+  : TObject(),
+    fBendingCoor(theGhit->Y()),
+    fNonBendingCoor(theGhit->X()),
+    fZ(theGhit->Z()),
+    fBendingReso2(0.),
+    fNonBendingReso2(0.),
+    fChamberNumber(0),
+    fDetElemId(0),
+    fHitNumber(0),
+    fTTRTrack(0),
+    fTrackRefSignal(0),
+    fIndexOfFirstSegment(-1),
+    fNSegments(0),
+    fNTrackHits(0)
 {
 /// Constructor for AliMUONHitForRec from a track ref. hit.
 /// Fills the bending, non bending, and Z coordinates,
@@ -50,20 +75,12 @@ AliMUONHitForRec::AliMUONHitForRec(AliTrackReference* theGhit)
 /// 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; ?????????
   fDetElemId = theGhit->UserId();
   if (fDetElemId) fChamberNumber = fDetElemId / 100 - 1;
   else fChamberNumber = AliMUONConstants::ChamberNumber(fZ);
   // other fields will be updated in
-  // AliMUONEventReconstructor::NewHitForRecFromTrackRef,
-  // except the following ones
-  fIndexOfFirstSegment = -1;
-  fNSegments = 0;
-  fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
-  fNTrackHits = 0;
+  // AliMUONEventReconstructor::NewHitForRecFromTrackRef
   return;
 }
 
@@ -85,47 +102,48 @@ AliMUONHitForRec::AliMUONHitForRec(AliTrackReference* theGhit)
 
   //__________________________________________________________________________
 AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* theRawCluster)
-  : TObject()
+  : TObject(),
+    fBendingCoor(theRawCluster->GetY(0)),
+    fNonBendingCoor(theRawCluster->GetX(0)),
+    fZ(0.),
+    fBendingReso2(0.),
+    fNonBendingReso2(0.),
+    fChamberNumber(0),
+    fDetElemId(theRawCluster->GetDetElemId()),
+    fHitNumber(0),
+    fTTRTrack(-1),
+    fTrackRefSignal(-1),
+    fIndexOfFirstSegment(-1),
+    fNSegments(0),
+    fNTrackHits(0)
 {
 /// 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
-  fTTRTrack = -1;
-  fTrackRefSignal = -1;
-  fIndexOfFirstSegment = -1;
-  fNSegments = 0;
-  fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
-  fNTrackHits = 0;
   return;
 }
 
   //__________________________________________________________________________
 AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& theMUONHitForRec)
-  :  TObject(theMUONHitForRec)
+  : TObject(theMUONHitForRec),
+    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),
+    fNTrackHits(theMUONHitForRec.fNTrackHits)
 {
 /// Copy constructor
 
-  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;
 }
 
   //__________________________________________________________________________
@@ -145,8 +163,6 @@ AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& theMUONHi
   fTrackRefSignal = theMUONHitForRec.fTrackRefSignal;
   fIndexOfFirstSegment = theMUONHitForRec.fIndexOfFirstSegment;
   fNSegments = theMUONHitForRec.fNSegments;
-  fFirstTrackHitPtr = theMUONHitForRec.fFirstTrackHitPtr;
-  fLastTrackHitPtr = theMUONHitForRec.fLastTrackHitPtr;
   fNTrackHits = theMUONHitForRec.fNTrackHits;
   return *this;
 }
@@ -204,3 +220,22 @@ Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* hitForR
   chi2 = chi2 + normDiff;
   return chi2;
 }
+
+//______________________________________________________________________________
+void
+AliMUONHitForRec::Print(Option_t* /*opt*/) const
+{
+/// Printing
+
+  cout << "<AliMUONHitForRec> Coordinates (B,NB,Z) = (" 
+  << setw(8) << setprecision(5) << fBendingCoor
+  << "," << setw(8) << setprecision(5) << fNonBendingCoor << "," 
+  << setw(8) << setprecision(5) << fZ << ") "
+  << "Reso (B,NB)=(" << setw(8) << setprecision(5) << TMath::Sqrt(fBendingReso2) 
+  << "," << setw(8) << setprecision(5) << TMath::Sqrt(fNonBendingReso2)
+  << ") " 
+  << "Number " << setw(3) << fHitNumber 
+  << " within chamber " << setw(3) <<fChamberNumber 
+  << " DE " << setw(4) << fDetElemId
+  << endl;
+}