]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentation.cxx
Updated list of MUON libraries
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentation.cxx
index 5a51ee0aefa8f06a42e87444ee4b1503cb001803..5b891c7ad4b59db632d8d3dc2e4972a57dbfac82 100644 (file)
 
 // $Id$
 //
+// ----------------------------
 // Class AliMUONSegmentation
 // ----------------------------
 // Manager class for geometry construction via geometry builders.
-//
 // Author: Ivana Hrivnacova, IPN Orsay
 
 #include <iostream>
 #include "AliMUONSegmentation.h"
 #include "AliMUONVGeometryDESegmentation.h"
 #include "AliMUONGeometrySegmentation.h"
-#include "AliMUONGeometryDEIndexing.h"
-#include "AliLog.h"
+\
+#include "AliMpVSegmentation.h"
+#include "AliMpDEManager.h"
 
+#include "AliLog.h"
 
+/// \cond CLASSIMP
 ClassImp(AliMUONSegmentation)
+/// \endcond
  
 //______________________________________________________________________________
 AliMUONSegmentation::AliMUONSegmentation(Int_t nofModules)
@@ -70,15 +74,6 @@ AliMUONSegmentation::AliMUONSegmentation()
   AliDebug(1, Form("default (empty) ctor this = %p", this));
 } 
 
-//______________________________________________________________________________
-AliMUONSegmentation::AliMUONSegmentation(const AliMUONSegmentation& right) 
-  : TObject(right) 
-{  
-/// Copy constructor (not implemented)
-
-  AliFatal("Copy constructor not provided.");
-}
-
 //______________________________________________________________________________
 AliMUONSegmentation::~AliMUONSegmentation()
 {
@@ -91,18 +86,35 @@ AliMUONSegmentation::~AliMUONSegmentation()
   delete fModuleSegmentations[1];
 }
 
-//______________________________________________________________________________
-AliMUONSegmentation& 
-AliMUONSegmentation::operator=(const AliMUONSegmentation& right)
+//
+// private functions
+//
+
+//_____________________________________________________________________________
+AliMUONGeometrySegmentation* 
+AliMUONSegmentation::GetModuleSegmentation(
+                        Int_t moduleId, Int_t cathod, Bool_t warn) const
 {
-/// Assignement operator (not implemented)
+/// Return the geometry module segmentation specified by moduleId
 
-  // check assignement to self
-  if (this == &right) return *this;
+  if (cathod < 0 || cathod >= 2) {
+    if (warn) {
+      AliWarningStream() 
+        << "Cathod: " << cathod << " outside limits" << std::endl;
+    }                   
+    return 0;  
+  }  
 
-  AliFatal("Assignement operator not provided.");
-    
-  return *this;  
+  if (moduleId < 0 || moduleId >= fModuleSegmentations[cathod]->GetEntriesFast()) {
+    if (warn) {
+      AliWarningStream() 
+        << "Index: " << moduleId << " outside limits" << std::endl;
+    }                   
+    return 0;  
+  }  
+
+  return (AliMUONGeometrySegmentation*) 
+            fModuleSegmentations[cathod]->At(moduleId);
 }    
 
 //
@@ -111,7 +123,7 @@ AliMUONSegmentation::operator=(const AliMUONSegmentation& right)
 
 //_____________________________________________________________________________
 void AliMUONSegmentation::AddDESegmentation(
-                             AliMUONVGeometryDESegmentation* segmentation)
+                                AliMUONVGeometryDESegmentation* segmentation)
 {
 /// Add the DE segmentation to the array
 
@@ -155,33 +167,6 @@ void  AliMUONSegmentation::Init()
   }  
 }
                            
-//_____________________________________________________________________________
-AliMUONGeometrySegmentation* 
-AliMUONSegmentation::GetModuleSegmentation(
-                        Int_t moduleId, Int_t cathod, Bool_t warn) const
-{
-/// Return the geometry module specified by moduleId
-
-  if (cathod < 0 || cathod >= 2) {
-    if (warn) {
-      AliWarningStream() 
-        << "Cathod: " << cathod << " outside limits" << std::endl;
-    }                   
-    return 0;  
-  }  
-
-  if (moduleId < 0 || moduleId >= fModuleSegmentations[cathod]->GetEntriesFast()) {
-    if (warn) {
-      AliWarningStream() 
-        << "Index: " << moduleId << " outside limits" << std::endl;
-    }                   
-    return 0;  
-  }  
-
-  return (AliMUONGeometrySegmentation*) 
-            fModuleSegmentations[cathod]->At(moduleId);
-}    
-
 //_____________________________________________________________________________
 AliMUONGeometrySegmentation* 
 AliMUONSegmentation::GetModuleSegmentationByDEId(
@@ -190,7 +175,7 @@ AliMUONSegmentation::GetModuleSegmentationByDEId(
 /// Return the geometry module specified by detElemId/cathod
 
   // Get moduleId 
-  Int_t moduleId = AliMUONGeometryDEIndexing::GetModuleId(detElemId);
+  Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId);
 
   return GetModuleSegmentation(moduleId, cathod, warn);
 }    
@@ -208,35 +193,19 @@ AliMUONSegmentation::GetDESegmentation(
     
   if ( !moduleSegmentation ) return 0; 
   
-  return moduleSegmentation->GetDESegmentation(detElemId);
-}    
-
-//_____________________________________________________________________________
-const AliMpVSegmentation*
-AliMUONSegmentation::GetMpSegmentation(
-                     Int_t detElemId, Int_t cathod, Bool_t warn) const
-{                   
-/// Return the mapping segmentation specified by detElemId/cathod
-
-
-  // Get DE segmentation 
-  const AliMUONVGeometryDESegmentation* kdeSegmentation
-    = GetDESegmentation(detElemId, cathod, warn);
-    
-  if ( !kdeSegmentation ) return 0; 
-  
-  return kdeSegmentation->GetMpSegmentation();
+  return moduleSegmentation->GetDESegmentation(detElemId, warn);
 }    
 
 //_____________________________________________________________________________
 Bool_t 
 AliMUONSegmentation::HasDE(Int_t detElemId, Int_t cathod) const
 {
-  // Get geometry segmentation 
-  AliMUONGeometrySegmentation* moduleSegmentation
-    = GetModuleSegmentationByDEId(detElemId, cathod, false);
+/// Return true if segmentation for detElemId and cathod is defined.
+
+  const AliMUONVGeometryDESegmentation* kdeSegmentation
+    = GetDESegmentation(detElemId, cathod, false);
     
-  return ( moduleSegmentation != 0 ); 
+  return ( kdeSegmentation != 0 ); 
   
 }
 
@@ -244,8 +213,8 @@ AliMUONSegmentation::HasDE(Int_t detElemId, Int_t cathod) const
 TString 
 AliMUONSegmentation::GetDEName(Int_t detElemId, Int_t cathod) const
 {
+/// Get detection element name 
 
-  // Get geometry segmentation 
   AliMUONGeometrySegmentation* moduleSegmentation
     = GetModuleSegmentationByDEId(detElemId, cathod, true);