// $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)
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()
{
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);
}
//
//_____________________________________________________________________________
void AliMUONSegmentation::AddDESegmentation(
- AliMUONVGeometryDESegmentation* segmentation)
+ AliMUONVGeometryDESegmentation* segmentation)
{
/// Add the DE segmentation to the array
}
}
-//_____________________________________________________________________________
-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(
/// 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);
}
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 );
}
TString
AliMUONSegmentation::GetDEName(Int_t detElemId, Int_t cathod) const
{
+/// Get detection element name
- // Get geometry segmentation
AliMUONGeometrySegmentation* moduleSegmentation
= GetModuleSegmentationByDEId(detElemId, cathod, true);