]> 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 bedb7e346a5f6454139377fefc067bf57bc93998..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 "AliMUONGeometryStore.h"
-
+\
 #include "AliMpVSegmentation.h"
+#include "AliMpDEManager.h"
 
 #include "AliLog.h"
 
-
+/// \cond CLASSIMP
 ClassImp(AliMUONSegmentation)
+/// \endcond
  
 //______________________________________________________________________________
 AliMUONSegmentation::AliMUONSegmentation(Int_t nofModules)
   : TObject(),
-    fMpSegmentations(0),
     fDESegmentations(0)
 {
 /// Standard constructor
 
-  // Create array for mapping segmentations
-  fMpSegmentations = new TObjArray();
-  fMpSegmentations->SetOwner(kTRUE);
-
   // Create array for DE segmentations
   fDESegmentations = new TObjArray();
   fDESegmentations->SetOwner(kTRUE);
@@ -68,7 +64,6 @@ AliMUONSegmentation::AliMUONSegmentation(Int_t nofModules)
 //______________________________________________________________________________
 AliMUONSegmentation::AliMUONSegmentation() 
   : TObject(),
-    fMpSegmentations(0),
     fDESegmentations(0)
 {
 /// Default constructor
@@ -79,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()
 {
@@ -95,45 +81,46 @@ AliMUONSegmentation::~AliMUONSegmentation()
 
   AliDebug(1, Form("dtor this = %p", this));
 
-  delete fMpSegmentations;
   delete fDESegmentations;
   delete fModuleSegmentations[0];
   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);
 }    
 
 //
 // public functions
 //
 
-//_____________________________________________________________________________
-void AliMUONSegmentation::AddMpSegmentation(AliMpVSegmentation* segmentation)
-{
-/// Add the mapping segmentation to the array if not present
-
-  Bool_t isPresent = false;
-  for (Int_t i=0; i<fMpSegmentations->GetEntries(); i++) 
-    if ( (AliMpVSegmentation*)fMpSegmentations->At(i) == segmentation ) {
-      isPresent = true;
-      break;
-    }  
-
-  if (!isPresent) fMpSegmentations->Add(segmentation);
-}
-
 //_____________________________________________________________________________
 void AliMUONSegmentation::AddDESegmentation(
                                 AliMUONVGeometryDESegmentation* segmentation)
@@ -141,16 +128,6 @@ void AliMUONSegmentation::AddDESegmentation(
 /// Add the DE segmentation to the array
 
   fDESegmentations->Add(segmentation);
-  
-  // Deregister the mapping segmentation contained in DE segmentation
-  // from fMpSegmentations, if present
-  const AliMpVSegmentation* kmpSeg = segmentation->GetMpSegmentation();
-  
-  for (Int_t i=0; i<fMpSegmentations->GetEntries(); i++) 
-    if ( (const AliMpVSegmentation*)fMpSegmentations->At(i) == kmpSeg ) {
-      fMpSegmentations->RemoveAt(i);
-      break;
-    }  
 }
 
 //_____________________________________________________________________________
@@ -190,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(
@@ -225,7 +175,7 @@ AliMUONSegmentation::GetModuleSegmentationByDEId(
 /// Return the geometry module specified by detElemId/cathod
 
   // Get moduleId 
-  Int_t moduleId = AliMUONGeometryStore::GetModuleId(detElemId);
+  Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId);
 
   return GetModuleSegmentation(moduleId, cathod, warn);
 }    
@@ -246,28 +196,12 @@ AliMUONSegmentation::GetDESegmentation(
   return moduleSegmentation->GetDESegmentation(detElemId, warn);
 }    
 
-//_____________________________________________________________________________
-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();
-}    
-
 //_____________________________________________________________________________
 Bool_t 
 AliMUONSegmentation::HasDE(Int_t detElemId, Int_t cathod) const
 {
-  // Get DE segmentation 
+/// Return true if segmentation for detElemId and cathod is defined.
+
   const AliMUONVGeometryDESegmentation* kdeSegmentation
     = GetDESegmentation(detElemId, cathod, false);
     
@@ -279,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);