]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryModuleTransformer.cxx
Completing commit 45100 - .h file was missing
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryModuleTransformer.cxx
index c0425032fc413050a0ecb386a060fe949c716494..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" 
@@ -40,11 +41,21 @@ ClassImp(AliMUONGeometryModuleTransformer)
 
 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(),
+   fModuleName(GetModuleName(moduleId)),
    fVolumePath(),
    fTransformation(0),
    fDetElements(0)
@@ -55,16 +66,12 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleI
   fTransformation = new TGeoHMatrix("");
 
   // Det elements transformation stores
-  fDetElements = new AliMpExMap(true);
-  
-  // Compose module name
-  fModuleName = fgkModuleNamePrefix;
-  fModuleName += moduleId;
+  fDetElements = new AliMpExMap;
 }
 
 
 //______________________________________________________________________________
-AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
+AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(TRootIOCtor* /*ioCtor*/)
  : TObject(),
    fModuleId(0),
    fModuleName(),
@@ -72,7 +79,7 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
    fTransformation(0),
    fDetElements(0)
 {
-/// Default constructor
+/// Root IO constructor
 }
 
 
@@ -183,7 +190,8 @@ TString AliMUONGeometryModuleTransformer::GetMotherVolumeName() const
   
   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('_');