]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHitMapA1.cxx
Adding name as attribute and GetModuleName() method;
[u/mrichter/AliRoot.git] / MUON / AliMUONHitMapA1.cxx
index d15a6630e94e4c0b2ad41d19bf486977b50dcc46..a202a71a349edafeb3935d331175ff60ffc97cb6 100644 (file)
 
 /* $Id$ */
 
+// -----------------------
+// Class AliMUONHitMapA1
+// -----------------------
+// Implements AliHitMap as a 1-dim array
+// ...
+
 #include "AliMUONHitMapA1.h"
 #include "AliMUONDigit.h"
 
 ClassImp(AliMUONHitMapA1)
 
 AliMUONHitMapA1::AliMUONHitMapA1()
-  : AliHitMap()
+  : AliHitMap(),
+    fNpx(0),
+    fNpy(0),
+    fDigits(0),
+    fMaxIndex(0),
+    fHitMap(0)
 {
-    // Default constructor
-    fNpx          = 0;
-    fNpy          = 0;
-    fMaxIndex     = 0;
-    
-    fHitMap       = 0;
-    fDigits       = 0;
+/// Default constructor
 }
 
 //________________________________________________________________________________
 AliMUONHitMapA1::AliMUONHitMapA1(Int_t npx, Int_t npy, TObjArray* dig)
-  : AliHitMap()
+  : AliHitMap(),
+    fNpx(npx),
+    fNpy(npy),
+    fDigits(dig),
+    fMaxIndex(2*(fNpx+1)*2*(fNpy+1)+2*fNpy),
+    fHitMap(new Int_t[fMaxIndex])
 {
-// Constructor with new segmentation
-/*
-    fNpx  = seg->Npx(idDE)+1;
-    fNpy  = seg->Npy(idDE)+1;
-*/
-    fNpx = npx;
-    fNpy = npy;
-    fMaxIndex=2*(fNpx+1)*2*(fNpy+1)+2*fNpy;
-    
-    fHitMap = new Int_t[fMaxIndex];
-    fDigits =  dig;
+/// Standard constructor
     Clear();
 }
-//______________________________________________________________
-AliMUONHitMapA1::AliMUONHitMapA1(const AliMUONHitMapA1 & hitMap)
-  : AliHitMap(hitMap)
-{
-// Protected copy constructor
-
-  AliFatal("Not implemented.");
-}
 //_________________________________
 AliMUONHitMapA1::~AliMUONHitMapA1()
 {
-// Destructor
+/// Destructor
     if (fHitMap) delete[] fHitMap;
 }
 //______________________________________
 void AliMUONHitMapA1::Clear(const char *)
 {
-// Clear hitmap
+/// Clear hitmap
     memset(fHitMap,0,sizeof(int)*fMaxIndex);
 }
 //___________________________________________________
 Bool_t AliMUONHitMapA1::ValidateHit(Int_t ix, Int_t iy)
 {
-    //
-    // Check if pad coordinates are within boundaries
-    //
+/// Check if pad coordinates are within boundaries
+
 //    printf("\n Validate %d %d %d %d", ix, iy, fNpx, fNpy);
     
     return (TMath::Abs(ix) <= fNpx && TMath::Abs(iy) <= fNpy); 
@@ -87,7 +78,7 @@ Bool_t AliMUONHitMapA1::ValidateHit(Int_t ix, Int_t iy)
 //_________________________________________________________
 Int_t AliMUONHitMapA1::CheckedIndex(Int_t ix, Int_t iy) const
 {
-// Return checked indices ix, iy
+/// Return checked indices ix, iy
     Int_t index=2*fNpy*(ix+fNpx)+(iy+fNpy);
     if ( index < 0 || index >= fMaxIndex ) {
         AliWarning(Form("index outside array ix %d iy %d MaxIndex %d index %d Npx %d Npy %d",
@@ -100,7 +91,7 @@ Int_t AliMUONHitMapA1::CheckedIndex(Int_t ix, Int_t iy) const
 //_____________________________
 void  AliMUONHitMapA1::FillHits()
 {
-// Fill hits from digits list  
+/// Fill hits from digits list  
     Int_t ndigits = fDigits->GetEntriesFast();
     //printf("\n Filling hits into HitMap\n");
     //printf("FindRawClusters -- ndigits %d \n",ndigits);
@@ -114,43 +105,45 @@ void  AliMUONHitMapA1::FillHits()
 //___________________________________________________________
 void  AliMUONHitMapA1::SetHit(Int_t ix, Int_t iy, Int_t idigit)
 {
-// Assign digit to hit cell ix,iy
+/// Assign digit to hit cell ix,iy
+
 //    fHitMap[kMaxNpady*(ix+fNpx)+(iy+fNpy)]=idigit+1;
     fHitMap[CheckedIndex(ix, iy)]=idigit+1;
 }
 //_______________________________________________
 void AliMUONHitMapA1::DeleteHit(Int_t ix, Int_t iy)
 {
-// Delete hit at cell ix,iy
+/// Delete hit at cell ix,iy
+
 //    fHitMap[kMaxNpady*(ix+fNpx)+(iy+fNpy)]=0;
     fHitMap[CheckedIndex(ix, iy)]=0;
 }
 //_____________________________________________
 void AliMUONHitMapA1::FlagHit(Int_t ix, Int_t iy)
 {
-// Flag hit as used
+/// Flag hit as used
     fHitMap[CheckedIndex(ix, iy)]=
        -TMath::Abs(fHitMap[CheckedIndex(ix, iy)]);
 }
 //________________________________________________________
 Int_t AliMUONHitMapA1::GetHitIndex(Int_t ix, Int_t iy) const
 {
-// Get absolute value of contents of hit cell ix,iy
+/// Get absolute value of contents of hit cell ix,iy
     return TMath::Abs(fHitMap[CheckedIndex(ix, iy)])-1;
 }
 //_______________________________________________________
 TObject* AliMUONHitMapA1::GetHit(Int_t ix, Int_t iy) const
 {
-    // Get pointer to object at hit cell ix, iy
-    // Force crash if index does not exist ! (Manu)
+/// Get pointer to object at hit cell ix, iy
+/// Force crash if index does not exist ! (Manu)
     Int_t index=GetHitIndex(ix,iy);
     return (index <0) ? 0 : fDigits->UncheckedAt(GetHitIndex(ix,iy));
 }
 //_________________________________________________
 FlagType AliMUONHitMapA1::TestHit(Int_t ix, Int_t iy)
 {
-// Check if hit cell is empty, used or unused
-//
+/// Check if hit cell is empty, used or unused
+
     Int_t index = CheckedIndex(ix, iy);
     if (index<0 || index >= fMaxIndex) return kEmpty;
 
@@ -163,19 +156,3 @@ FlagType AliMUONHitMapA1::TestHit(Int_t ix, Int_t iy)
        return kUnused;
     }
 }
-//________________________________________________________________________
-AliMUONHitMapA1 & AliMUONHitMapA1::operator = (const AliMUONHitMapA1 & rhs) 
-{
-// Protected assignement operator
-
-  if (this == &rhs) return *this;
-
-  AliFatal( "Not implemented.");
-    
-  return *this;  
-}
-
-
-
-
-