]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryStore.cxx
- Revised comments and adapted them for Doxygen
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryStore.cxx
index b449d3548ec0b82ad380a91709d3c8f970dc5ca2..58a23cdaa2869293a51f9127d105883675141355 100644 (file)
 #include "AliLog.h"
 
 #include "AliMUONGeometryStore.h"
-#include "AliMUONVGeometryDEIndexing.h"
 
+const Int_t AliMUONGeometryStore::fgkInitSize = 100;
+const Int_t AliMUONGeometryStore::fgkCoefficient = 100;
+
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometryStore)
+/// \endcond
 
-const Int_t AliMUONGeometryStore::fgkInitSize = 100;
+//
+// static methods
+//
 
 //______________________________________________________________________________
-AliMUONGeometryStore::AliMUONGeometryStore(
-                                   AliMUONVGeometryDEIndexing* indexing,
-                                  Bool_t isOwner)
+Int_t AliMUONGeometryStore::GetModuleId(Int_t detElemId)
+{
+/// Get module Id from detection element Id
+
+  return detElemId/fgkCoefficient - 1;
+}  
+
+//
+// Constructor/destructor
+//
+
+//______________________________________________________________________________
+AliMUONGeometryStore::AliMUONGeometryStore(Bool_t isOwner)
  : TObject(),
-   fObjects(fgkInitSize),
-   fDEIndexing(indexing)
+   fObjects(fgkInitSize)
 { 
-// Standard constructor
+/// Standard constructor
   
   fObjects.SetOwner(isOwner);
   for (Int_t i=0; i<fgkInitSize; i++) fObjects[i] = 0;
@@ -52,37 +67,29 @@ AliMUONGeometryStore::AliMUONGeometryStore(
 //______________________________________________________________________________
 AliMUONGeometryStore::AliMUONGeometryStore()
  : TObject(),
-   fObjects(),
-   fDEIndexing(0)
-{
-// Default constructor
-}
-
-//______________________________________________________________________________
-AliMUONGeometryStore::AliMUONGeometryStore(
-                                   const AliMUONGeometryStore& rhs)
-  : TObject(rhs)
+   fObjects()
 {
-  AliFatal("Copy constructor is not implemented.");
+/// Default constructor
 }
 
 //______________________________________________________________________________
 AliMUONGeometryStore::~AliMUONGeometryStore() 
 {
+/// Destructor
 
 }
 
+//
+// private methods
+//
+
 //______________________________________________________________________________
-AliMUONGeometryStore& 
-AliMUONGeometryStore::operator = (const AliMUONGeometryStore& rhs) 
+Int_t AliMUONGeometryStore::GetDEIndex(Int_t detElemId) const
 {
-  // check assignement to self
-  if (this == &rhs) return *this;
+/// Return the index of detector element specified by detElemId
 
-  AliFatal("Assignment operator is not implemented.");
-    
-  return *this;  
-}
+  return detElemId - detElemId/fgkCoefficient*fgkCoefficient;
+ }  
 
 //
 // public methods
@@ -91,15 +98,11 @@ AliMUONGeometryStore::operator = (const AliMUONGeometryStore& rhs)
 //______________________________________________________________________________
 void AliMUONGeometryStore::Add(Int_t objectId, TObject* object)
 {
-// Add detection element in the array
-// if detection element with the same Id is not yet present. 
-// ---
+/// Add detection element in the array
+/// if detection element with the same Id is not yet present. 
  
-  //cout << ".. adding " << objectId 
-  //     << " index: " << fDEIndexing->GetDetElementIndex(objectId) << endl;
-
   // Expand array if the init size has been reached
-  Int_t index = fDEIndexing->GetDetElementIndex(objectId);
+  Int_t index = GetDEIndex(objectId);
   while ( index >= fObjects.GetSize() ) {
     Int_t size = fObjects.GetSize();
     fObjects.Expand(size + fgkInitSize);
@@ -117,10 +120,9 @@ void AliMUONGeometryStore::Add(Int_t objectId, TObject* object)
 TObject* 
 AliMUONGeometryStore::Get(Int_t objectId, Bool_t warn) const
 {
-// Returns transformation for the specified detector element Id
-// ---
+/// Return the object for the specified detector element Id
 
-  Int_t index = fDEIndexing->GetDetElementIndex(objectId);
+  Int_t index = GetDEIndex(objectId);
   
   if ( index >= 0 && index < fObjects.GetEntriesFast() )
     return (TObject*) fObjects.At(index);
@@ -133,7 +135,8 @@ AliMUONGeometryStore::Get(Int_t objectId, Bool_t warn) const
 //______________________________________________________________________________
 Int_t  AliMUONGeometryStore::GetNofEntries() const
 {
-// Add check if the array is already filled
+/// Return number of entries.
+/// \todo Add check if the array is already filled
 
   return fObjects.GetEntriesFast();
 }  
@@ -143,8 +146,8 @@ Int_t  AliMUONGeometryStore::GetNofEntries() const
 TObject* 
 AliMUONGeometryStore::GetEntry(Int_t index) const
 {
-//
-// Add check if the array is already filled
+/// Return entry at specified index.
+/// \todo Add check if the array is already filled
   
   return (TObject*) fObjects.At(index);
 }