]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryTransformer.cxx
Adding first version of trigger LUT handling to Shuttle
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryTransformer.cxx
index 4555490685f7bac7eb630b554df1bcef7e514657..8adc968006791fea25567978b74f58a716a2fafa 100644 (file)
  **************************************************************************/
 
 // $Id$
-//
-// ----------------------------
+
+//-----------------------------------------------------------------------------
 // Class AliMUONGeometryTransformer
 // ----------------------------
 // Top container class for geometry transformations
 // Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
 
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONGeometryModuleTransformer.h"
@@ -29,6 +30,7 @@
 #include "AliMpDEManager.h"
 #include "AliMpConstants.h"
 #include "AliMpExMap.h"
+#include "AliMpCDB.h"
 
 #include "AliLog.h"
 #include "AliAlignObjMatrix.h"
@@ -88,6 +90,20 @@ AliMUONGeometryTransformer::~AliMUONGeometryTransformer()
 // private methods
 //
 
+//_____________________________________________________________________________
+Bool_t AliMUONGeometryTransformer::LoadMapping() const
+{
+/// Load mapping from CDB
+
+  if ( ! AliMpCDB::LoadMpSegmentation() ) 
+  {
+    AliFatal("Could not access mapping from OCDB !");
+    return false;
+  }
+  
+  return true;
+}  
+
 //_____________________________________________________________________________
 AliMUONGeometryModuleTransformer* 
 AliMUONGeometryTransformer::GetModuleTransformerNonConst(
@@ -329,7 +345,7 @@ AliMUONGeometryTransformer::LoadTransformations()
     
     // Set matrix from physical node
     TGeoHMatrix* matrix = AliGeomManager::GetMatrix(symname);
-    if ( !matrix ) {
+    if ( ! matrix ) {
       AliErrorStream() << "Geometry module matrix not found." << endl;
       return false;
     }  
@@ -347,7 +363,7 @@ AliMUONGeometryTransformer::LoadTransformations()
     
       // Set global matrix from physical node
       TGeoHMatrix* globalMatrix = AliGeomManager::GetMatrix(symname);
-      if ( !matrix ) {
+      if ( ! globalMatrix ) {
         AliErrorStream() << "Detection element matrix not found." << endl;
         return false;
       }  
@@ -641,6 +657,8 @@ void AliMUONGeometryTransformer::CreateModules()
 /// Create modules and their detection elements using info from mapping;
 /// but do not fill matrices
 
+  // Load mapping as its info is used to define modules & DEs
+  LoadMapping();
 
   // Loop over geometry module
   for (Int_t moduleId = 0; moduleId < AliMpConstants::NofGeomModules(); ++moduleId ) {