**************************************************************************/
// $Id$
-//
-// -------------------------------------
+
+//-----------------------------------------------------------------------------
// Class AliMUONGeometryModuleTransformer
// -------------------------------------
// Class for definition of the detector module transformations
// Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
#include "AliMUONGeometryModuleTransformer.h"
#include "AliMUONGeometryDetElement.h"
-#include "AliMUONGeometryStore.h"
+
+#include "AliMpExMap.h"
#include "AliLog.h"
#include <TArrayI.h>
#include <Riostream.h>
+using std::endl;
/// \cond CLASSIMP
ClassImp(AliMUONGeometryModuleTransformer)
/// \endcond
-const TString AliMUONGeometryModuleTransformer::fgkModuleNamePrefix = "GM";
+//
+// static methods
+//
+
+//______________________________________________________________________________
+const TString& AliMUONGeometryModuleTransformer::GetModuleNamePrefix()
+{
+ /// Geometry module name prefix
+ static const TString kModuleNamePrefix = "GM";
+ return kModuleNamePrefix;
+}
+
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetModuleName(Int_t moduleId)
+{
+/// Return the module name for given moduleId
+
+ TString moduleName(GetModuleNamePrefix());
+ moduleName += moduleId;
+ return moduleName;
+}
+
+//
+// ctor, dtor
+//
//______________________________________________________________________________
AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleId)
: TObject(),
fModuleId(moduleId),
- fModuleName(),
+ fModuleName(GetModuleName(moduleId)),
fVolumePath(),
fTransformation(0),
fDetElements(0)
fTransformation = new TGeoHMatrix("");
// Det elements transformation stores
- fDetElements = new AliMUONGeometryStore(true);
-
- // Compose module name
- fModuleName = fgkModuleNamePrefix;
- fModuleName += moduleId;
+ fDetElements = new AliMpExMap;
}
//______________________________________________________________________________
-AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
+AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(TRootIOCtor* /*ioCtor*/)
: TObject(),
fModuleId(0),
fModuleName(),
fTransformation(0),
fDetElements(0)
{
-/// Default constructor
+/// Root IO constructor
}
std::string volPath = fVolumePath.Data();
std::string::size_type first = volPath.rfind('/');
- volPath = volPath.substr(0, first);
+ if ( first != std::string::npos )
+ volPath = volPath.substr(0, first);
std::string::size_type next = volPath.rfind('/')+1;
std::string::size_type last = volPath.rfind('_');
// Get detection element
AliMUONGeometryDetElement* detElement
- = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId, warn);
+ = (AliMUONGeometryDetElement*) fDetElements->GetValue(detElemId);
if (!detElement) {
if (warn)