]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In CreateGeometry..() - added check for consistency of detElemId and moduleId
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Oct 2006 09:29:39 +0000 (09:29 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Oct 2006 09:29:39 +0000 (09:29 +0000)
(as this relation is now hardwired in AliMpDEManager)

MUON/AliMUONGeometryBuilder.cxx

index e11326f69c2249e6ef828e3a1a5aeab34a48e3ff..fb02b36a03f88f8ea7e7f635fada766465787a2e 100644 (file)
 #include "AliMUONGeometryEnvelope.h"   
 #include "AliMUONGeometryEnvelopeStore.h"
 #include "AliMUONGeometryDetElement.h"
-#include "AliMUONGeometryStore.h"
 #include "AliMUONGeometryConstituent.h"
 
+#include "AliMpDEManager.h"
+
 #include "AliModule.h"
 #include "AliLog.h"
 #include "AliRun.h"
@@ -281,6 +282,20 @@ void AliMUONGeometryBuilder::CreateGeometryWithTGeo()
         AliMUONGeometryEnvelope* env 
          = (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
          
+       // Check consistency of detElemId and module Id
+       if ( env->GetUniqueID() > 0 && 
+            AliMpDEManager::GetGeomModuleId(env->GetUniqueID()) 
+            != geometry->GetModuleId() ) {
+            
+         AliErrorStream() 
+           << "Detection element " << env->GetUniqueID() 
+           << " is being placed in geometry module " << geometry->GetModuleId()
+           << " but should go in " 
+           << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+           <<  endl;
+         AliFatal("Inconsistent IDs");
+       }          
+         
         const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
         const char* only = "ONLY";
         if (env->IsMANY()) only = "MANY";
@@ -378,6 +393,20 @@ void AliMUONGeometryBuilder::CreateGeometryWithoutTGeo()
         AliMUONGeometryEnvelope* env 
          = (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
          
+       // Check consistency of detElemId and module Id
+       if ( env->GetUniqueID() > 0 && 
+            AliMpDEManager::GetGeomModuleId(env->GetUniqueID()) 
+            != geometry->GetModuleId() ) {
+            
+         AliErrorStream() 
+           << "Detection element " << env->GetUniqueID() 
+           << " is being placed in geometry module " << geometry->GetModuleId()
+           << " but should go in " 
+           << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+           <<  endl;
+         AliFatal("Inconsistent IDs");
+       }          
+         
         const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
         const char* only = "ONLY";
         if (env->IsMANY()) only = "MANY";
@@ -540,7 +569,7 @@ void AliMUONGeometryBuilder::InitGeometry(const TString& svmapFileName)
 
   // Read sensitive volume map from a file
   fGeometry->ReadSVMap(svmapFileName);
-      
+
   // Set the chamber (sensitive region) GEANT identifier
   //
   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {