/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // $Id$ // // Class AliMUONGeometryStore // ------------------------------------- // The class contains the array of the detection elements, // which are sorted using the AliMUONVGeometryDEIndexing class. // The class provides fast access to detection element via DetElemId. // // Author: Ivana Hrivnacova, IPN Orsay #include #include #include "AliLog.h" #include "AliMUONGeometryStore.h" #include "AliMUONVGeometryDEIndexing.h" ClassImp(AliMUONGeometryStore) const Int_t AliMUONGeometryStore::fgkInitSize = 100; //______________________________________________________________________________ AliMUONGeometryStore::AliMUONGeometryStore( AliMUONVGeometryDEIndexing* indexing, Bool_t isOwner) : TObject(), fObjects(fgkInitSize), fDEIndexing(indexing) { // Standard constructor fObjects.SetOwner(isOwner); for (Int_t i=0; iGetDetElementIndex(objectId) << endl; // Expand array if the init size has been reached Int_t index = fDEIndexing->GetDetElementIndex(objectId); while ( index >= fObjects.GetSize() ) { Int_t size = fObjects.GetSize(); fObjects.Expand(size + fgkInitSize); for (Int_t i=size; iGetDetElementIndex(objectId); if ( index >= 0 && index < fObjects.GetEntriesFast() ) return (TObject*) fObjects.At(index); else { if (warn) AliWarning(Form("Index %d out of limits", index)); return 0; } } //______________________________________________________________________________ Int_t AliMUONGeometryStore::GetNofEntries() const { // 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 (TObject*) fObjects.At(index); }