]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryModuleTransformer.cxx
Comments for Doxygen
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryModuleTransformer.cxx
index 8a0c6ddc7fa615c6056dfa0cb963483dc5899ee5..c0425032fc413050a0ecb386a060fe949c716494 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 "AliMpExMap.h"        
+
+#include "AliLog.h"    
+
 #include <TVirtualMC.h>
 #include <TGeoMatrix.h>
 #include <TObjArray.h>
 #include <TArrayI.h>
 #include <Riostream.h>
 
-#include "AliLog.h"    
-
-#include "AliMUONGeometryModuleTransformer.h"
-#include "AliMUONGeometryDetElement.h" 
-#include "AliMUONGeometryStore.h"      
-
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometryModuleTransformer)
+/// \endcond
+
+const TString AliMUONGeometryModuleTransformer::fgkModuleNamePrefix = "GM";
 
 //______________________________________________________________________________
 AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleId)
  : TObject(),
    fModuleId(moduleId),
+   fModuleName(),
+   fVolumePath(),
    fTransformation(0),
    fDetElements(0)
 {
 /// Standard constructor
 
   // Chamber transformation
-  fTransformation = new TGeoCombiTrans("");
+  fTransformation = new TGeoHMatrix("");
 
   // Det elements transformation stores
-  fDetElements = new AliMUONGeometryStore(true);
+  fDetElements = new AliMpExMap(true);
+  
+  // Compose module name
+  fModuleName = fgkModuleNamePrefix;
+  fModuleName += moduleId;
 }
 
 
@@ -56,6 +67,8 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleI
 AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
  : TObject(),
    fModuleId(0),
+   fModuleName(),
+   fVolumePath(),
    fTransformation(0),
    fDetElements(0)
 {
@@ -63,16 +76,6 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
 }
 
 
-//______________________________________________________________________________
-AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(
-                                    const AliMUONGeometryModuleTransformer& rhs)
-  : TObject(rhs)
-{
-/// Protected copy constructor
-
-  AliFatal("Copy constructor is not implemented.");
-}
-
 //______________________________________________________________________________
 AliMUONGeometryModuleTransformer::~AliMUONGeometryModuleTransformer() 
 {
@@ -82,21 +85,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
 //
@@ -169,23 +157,50 @@ void  AliMUONGeometryModuleTransformer::Local2Global(Int_t detElemId,
 
 //______________________________________________________________________________
 void  AliMUONGeometryModuleTransformer::SetTransformation(
-                                           const TGeoCombiTrans& transform)
+                                           const TGeoHMatrix& transform)
 {
 /// Set the module position wrt world.
 
   *fTransformation = transform;
 }  
 
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetVolumeName() const
+{ 
+/// Extract volume name from the path
+  
+  std::string volPath = fVolumePath.Data();
+  std::string::size_type first = volPath.rfind('/')+1;
+  std::string::size_type last = volPath.rfind('_');
+  
+  return volPath.substr(first, last-first );
+}
+
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetMotherVolumeName() const
+{ 
+/// Extract mother volume name from the path
+  
+  std::string volPath = fVolumePath.Data();
+  std::string::size_type first = volPath.rfind('/');
+  volPath = volPath.substr(0, first);
+
+  std::string::size_type next = volPath.rfind('/')+1;
+  std::string::size_type last = volPath.rfind('_');
+  
+  return volPath.substr(next, last-next );
+}
+
 //______________________________________________________________________________
 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)