#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;
//______________________________________________________________________________
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
//______________________________________________________________________________
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);
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);
//______________________________________________________________________________
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();
}
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);
}