]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryModuleTransformer.cxx
bug fixed
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryModuleTransformer.cxx
index ee9a94592c56395b1b6410cb628d8e471e286086..2f9bf0ffabee3732db4fa2e9676f068519018896 100644 (file)
  **************************************************************************/
 
 // $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>
 
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometryModuleTransformer)
+/// \endcond
+
+const TString AliMUONGeometryModuleTransformer::fgkModuleNamePrefix = "GM";
+
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetModuleName(Int_t moduleId)
+{
+/// Return the module name for given moduleId
+
+  TString moduleName(fgkModuleNamePrefix);
+  moduleName += moduleId;
+  return moduleName;
+}   
 
 //______________________________________________________________________________
 AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleId)
  : TObject(),
    fModuleId(moduleId),
+   fModuleName(GetModuleName(moduleId)),
    fVolumePath(),
    fTransformation(0),
    fDetElements(0)
@@ -49,32 +66,23 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleI
   fTransformation = new TGeoHMatrix("");
 
   // Det elements transformation stores
-  fDetElements = new AliMUONGeometryStore(true);
+  fDetElements = new AliMpExMap;
 }
 
 
 //______________________________________________________________________________
-AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
+AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(TRootIOCtor* /*ioCtor*/)
  : TObject(),
    fModuleId(0),
+   fModuleName(),
    fVolumePath(),
    fTransformation(0),
    fDetElements(0)
 {
-/// Default constructor
+/// Root IO constructor
 }
 
 
-//______________________________________________________________________________
-AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(
-                                    const AliMUONGeometryModuleTransformer& rhs)
-  : TObject(rhs)
-{
-/// Protected copy constructor
-
-  AliFatal("Copy constructor is not implemented.");
-}
-
 //______________________________________________________________________________
 AliMUONGeometryModuleTransformer::~AliMUONGeometryModuleTransformer() 
 {
@@ -84,21 +92,6 @@ AliMUONGeometryModuleTransformer::~AliMUONGeometryModuleTransformer()
   delete fDetElements;
 }
 
-//______________________________________________________________________________
-AliMUONGeometryModuleTransformer& 
-AliMUONGeometryModuleTransformer::operator = (
-                                    const AliMUONGeometryModuleTransformer& rhs) 
-{
-/// Protected assignement operator
-
-  // check assignement to self
-  if (this == &rhs) return *this;
-
-  AliFatal("Assignment operator is not implemented.");
-    
-  return *this;  
-}
-
 //
 // public methods
 //
@@ -193,11 +186,12 @@ TString AliMUONGeometryModuleTransformer::GetVolumeName() const
 //______________________________________________________________________________
 TString AliMUONGeometryModuleTransformer::GetMotherVolumeName() const
 { 
-/// Extract volume name from the path
+/// Extract mother volume name from the path
   
   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('_');
@@ -210,11 +204,11 @@ AliMUONGeometryDetElement*
 AliMUONGeometryModuleTransformer::GetDetElement(Int_t detElemId, Bool_t warn) const
 {
 /// Return the detection element specified by detElemId.
-/// Give error if detection element is not defined.
+/// Give error if detection element is not defined and warn is true.
 
    // Get detection element
    AliMUONGeometryDetElement* detElement
-     = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId, warn);
+     = (AliMUONGeometryDetElement*) fDetElements->GetValue(detElemId);
 
    if (!detElement) {
      if (warn)