]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometry.cxx
Separating run-dependent mapping data from data, which are not
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometry.cxx
index fe053704b0ef1f32c8be5b83f235b46f11768506..f7727aef855762c0959d7d85612ac604db0a0cd5 100644 (file)
  **************************************************************************/
 
 // $Id$
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMUONGeometry
 // ----------------------------
 // Manager class for geometry construction via geometry builders.
-//
 // Author: Ivana Hrivnacova, IPN Orsay
-
-#include <iostream>
-
-#include <TObjArray.h>
-#include <Riostream.h>
-#include <TSystem.h>
+//-----------------------------------------------------------------------------
 
 #include "AliMUONGeometry.h"
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONGeometryModule.h"
-#include "AliMUONGeometrySVMap.h"
-#include "AliMUONGeometryDEIndexing.h"
+#include "AliMUONStringIntMap.h"
+
+#include "AliMpDEManager.h"
+
 #include "AliLog.h"
 
+#include <TObjArray.h>
+#include <Riostream.h>
+#include <TSystem.h>
+
+#include <iostream>
 
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometry)
+/// \endcond
  
 //______________________________________________________________________________
 AliMUONGeometry::AliMUONGeometry(Bool_t isOwner)
@@ -51,7 +55,8 @@ AliMUONGeometry::AliMUONGeometry(Bool_t isOwner)
   fModules->SetOwner(isOwner);
   
   // Geometry parametrisation
-  fTransformer = new AliMUONGeometryTransformer(false);  
+  fTransformer = new AliMUONGeometryTransformer();
+  fTransformer->SetOwner(false); 
 }
 
 //______________________________________________________________________________
@@ -63,15 +68,6 @@ AliMUONGeometry::AliMUONGeometry()
 /// Default constructor
 } 
 
-//______________________________________________________________________________
-AliMUONGeometry::AliMUONGeometry(const AliMUONGeometry& right) 
-  : TObject(right) 
-{  
-/// Copy constructor (not implemented)
-
-  AliFatal("Copy constructor not provided.");
-}
-
 //______________________________________________________________________________
 AliMUONGeometry::~AliMUONGeometry()
 {
@@ -81,20 +77,6 @@ AliMUONGeometry::~AliMUONGeometry()
   delete fTransformer;
 }
 
-//______________________________________________________________________________
-AliMUONGeometry& 
-AliMUONGeometry::operator=(const AliMUONGeometry& right)
-{
-/// Assignement operator (not implemented)
-
-  // check assignement to self
-  if (this == &right) return *this;
-
-  AliFatal("Assignement operator not provided.");
-    
-  return *this;  
-}    
-
 //
 // private methods
 //
@@ -103,8 +85,7 @@ AliMUONGeometry::operator=(const AliMUONGeometry& right)
 TString  AliMUONGeometry::ComposePath(const TString& volName, 
                                        Int_t copyNo) const
 {
-// Compose path from given volName and copyNo
-// ---
+/// Compose path from given volName and copyNo
 
   TString path(volName);
   path += ".";
@@ -117,12 +98,10 @@ TString  AliMUONGeometry::ComposePath(const TString& volName,
 void AliMUONGeometry::FillData3(const TString& sensVolumePath, 
                                 Int_t detElemId)
 {
-// Fill the mapping of the sensitive volume path to the detection element.
-// ---
+/// Fill the mapping of the sensitive volume path to the detection element.
 
   // Module Id
-  Int_t moduleId 
-    = AliMUONGeometryDEIndexing::GetModuleId(detElemId);
+  Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId);
     
   // Get module
   AliMUONGeometryModule* module 
@@ -136,7 +115,7 @@ void AliMUONGeometry::FillData3(const TString& sensVolumePath,
   }    
     
   // Get module sensitive volumes map
-  AliMUONGeometrySVMap* svMap = module->GetSVMap();     
+  AliMUONStringIntMap* svMap = module->GetSVMap();     
 
   // Map the sensitive volume to detection element
   svMap->Add(sensVolumePath, detElemId); 
@@ -145,9 +124,8 @@ void AliMUONGeometry::FillData3(const TString& sensVolumePath,
 //______________________________________________________________________________
 TString  AliMUONGeometry::ReadData3(ifstream& in)
 {
-// Reads SV maps from a file
-// Returns true, if reading finished correctly.
-// ---
+/// Read SV maps from a file.
+/// Return true, if reading finished correctly.
 
   TString key("SV");
   while ( key == TString("SV") ) {
@@ -176,17 +154,16 @@ TString  AliMUONGeometry::ReadData3(ifstream& in)
 //______________________________________________________________________________
 void AliMUONGeometry::WriteData3(ofstream& out) const
 {
-// Writes association of sensitive volumes and detection elements
-// from the sensitive volume map
-// ---
+/// Write association of sensitive volumes and detection elements
+/// from the sensitive volume map
 
   for (Int_t i=0; i<fModules->GetEntriesFast(); i++) {
     AliMUONGeometryModule* geometry 
       = (AliMUONGeometryModule*)fModules->At(i);
-    AliMUONGeometrySVMap* svMap
+    AliMUONStringIntMap* svMap
       = geometry->GetSVMap();
 
-    svMap->WriteMap(out);
+    svMap->Print("SV", out);
     out << endl;  
   }    
 }
@@ -198,7 +175,7 @@ void AliMUONGeometry::WriteData3(ofstream& out) const
 //_____________________________________________________________________________
 void AliMUONGeometry::AddModule(AliMUONGeometryModule* module)
 {
-/// Add the geometrymodule to the array
+/// Add the geometry module to the array
 
   fModules->Add(module);
 
@@ -210,9 +187,8 @@ void AliMUONGeometry::AddModule(AliMUONGeometryModule* module)
 Bool_t  
 AliMUONGeometry::ReadSVMap(const TString& fileName)
 {
-// Reads the sensitive volume maps from a file
-// Returns true, if reading finished correctly.
-// ---
+/// Read the sensitive volume maps from a file.
+/// Return true, if reading finished correctly.
 
   // No reading
   // if builder is not associated with any geometry module
@@ -249,9 +225,8 @@ AliMUONGeometry::ReadSVMap(const TString& fileName)
 Bool_t  
 AliMUONGeometry::WriteSVMap(const TString& fileName) const
 {
-// Writes sensitive volume map into a file
-// Returns true, if writing finished correctly.
-// ---
+/// Write sensitive volume map into a file.
+/// Return true, if writing finished correctly.
 
   // No writing
   // if builder is not associated with any geometry module
@@ -298,10 +273,10 @@ AliMUONGeometry::GetModule(Int_t index, Bool_t warn) const
 const AliMUONGeometryModule* 
 AliMUONGeometry::GetModuleByDEId(Int_t detElemId, Bool_t warn) const
 {
-/// Return the geometry module specified by index
+/// Return the geometry module specified by detElemId
 
   // Get module index
-  Int_t index = AliMUONGeometryDEIndexing::GetModuleId(detElemId);
+  Int_t index = AliMpDEManager::GetGeomModuleId(detElemId);
 
   return GetModule(index, warn);
 }