X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONGeometryModuleTransformer.cxx;h=544255d72d615ec2f8d863b661fed59a702fc792;hb=084cc73397ebd2a451e4ead3b5b650fbae0ea8d0;hp=c0425032fc413050a0ecb386a060fe949c716494;hpb=fa66b479d99d9183b54b9a555ad62096ff71760b;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONGeometryModuleTransformer.cxx b/MUON/AliMUONGeometryModuleTransformer.cxx index c0425032fc4..544255d72d6 100644 --- a/MUON/AliMUONGeometryModuleTransformer.cxx +++ b/MUON/AliMUONGeometryModuleTransformer.cxx @@ -14,12 +14,13 @@ **************************************************************************/ // $Id$ -// -// ------------------------------------- + +//----------------------------------------------------------------------------- // Class AliMUONGeometryModuleTransformer // ------------------------------------- // Class for definition of the detector module transformations // Author: Ivana Hrivnacova, IPN Orsay +//----------------------------------------------------------------------------- #include "AliMUONGeometryModuleTransformer.h" #include "AliMUONGeometryDetElement.h" @@ -34,17 +35,42 @@ #include #include +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) @@ -55,16 +81,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 +94,7 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer() fTransformation(0), fDetElements(0) { -/// Default constructor +/// Root IO constructor } @@ -183,7 +205,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('_');