]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Application of alignment objects based on the list of modules present in the geometry...
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Sep 2008 17:47:57 +0000 (17:47 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Sep 2008 17:47:57 +0000 (17:47 +0000)
STEER/AliGeomManager.cxx
STEER/AliGeomManager.h
STEER/AliReconstruction.cxx

index a2fde10fb2b4c9b72daf563ae5b7b5a2d99816b2..e021cdeffec7e9ab4f01087b3e900e52ee8d2c91 100644 (file)
@@ -1491,6 +1491,65 @@ void AliGeomManager::CheckOverlapsOverPNs(Double_t threshold)
   delete overlaps;
 }
 
+//_____________________________________________________________________________
+Bool_t AliGeomManager::IsModuleInGeom(const char* module)
+{
+  // Return true if the module passed as argument is present in the current geometry
+  //
+  
+  TString subdet(module);
+
+  if(subdet==TString("ACORDE"))
+  {
+      if(fgGeometry->GetAlignableEntry("ACORDE/Array1")) return kTRUE;
+  }else if(subdet==TString("EMCAL"))
+  {
+      if(fgGeometry->GetAlignableEntry("EMCAL/FullSupermodule0") || fgGeometry->GetAlignableEntry("EMCAL/CosmicTestSupermodule0")) return kTRUE;
+  }else if(subdet==TString("FMD"))
+  {
+      if(fgGeometry->GetAlignableEntry("FMD/FMD1_T")) return kTRUE;
+  }else if(subdet==TString("HMPID"))
+  {
+      if(fgGeometry->GetAlignableEntry("/HMPID/Chamber0")) return kTRUE;
+  }else if(subdet==TString("ITS"))
+  {
+      if(fgGeometry->GetAlignableEntry("ITS")) return kTRUE;
+  }else if(subdet==TString("MUON"))
+  {
+      if(fgGeometry->GetAlignableEntry("/MUON/GM0")) return kTRUE;
+  }else if(subdet==TString("PMD"))
+  {
+      if(fgGeometry->GetAlignableEntry("PMD/Sector1")) return kTRUE;
+  }else if(subdet==TString("PHOS"))
+  {
+      if(fgGeometry->GetAlignableEntry("PHOS/Cradle0")) return kTRUE;
+  }else if(subdet==TString("T0"))
+  {
+      if(fgGeometry->GetAlignableEntry("/ALIC_1/0STR_1")) return kTRUE;
+  }else if(subdet==TString("TRD"))
+  {
+      if(fgGeometry->GetAlignableEntry("TRD/sm00")) return kTRUE;
+  }else if(subdet==TString("TPC"))
+  {
+      if(fgGeometry->GetAlignableEntry("TPC/EndcapA/Sector1/InnerChamber")) return kTRUE;
+  }else if(subdet==TString("TOF"))
+  {
+      if(fgGeometry->GetAlignableEntry("TOF/sm00/strip01")) return kTRUE;
+  }else if(subdet==TString("VZERO"))
+  {
+      if(fgGeometry->GetAlignableEntry("VZERO/V0C")) return kTRUE;
+  }else if(subdet==TString("ZDC"))
+  {
+      if(fgGeometry->GetAlignableEntry("ZDC/NeutronZDC_C")) return kTRUE;
+  }else if(subdet==TString("FRAME"))
+  {
+      if(fgGeometry->GetAlignableEntry("FRAME/Sector0")) return kTRUE;
+  }else
+      AliErrorClass(Form("%s is not a valid ALICE module name",module));
+
+  return kFALSE;
+}
+
 //_____________________________________________________________________________
 Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
 {
index 4b23dbd1be667e01de71287c0904abd5d469f21d..366cc455832cbfd5e5bd741e85a93c743dca0bb8 100644 (file)
@@ -96,6 +96,7 @@ public:
   static Bool_t         ApplyAlignObjsFromCDB(const char* AlDetsList);
   static Bool_t         LoadAlignObjsFromCDBSingleDet(const char* detName, TObjArray& alignObjArray);
   static Bool_t         CheckSymNamesLUT(const char* detsToBeChecked);
+  static Bool_t         IsModuleInGeom(const char* module);
 
   ~AliGeomManager();
 
index b6949721272b77e5d1a72ea16cf2ca003001de03..0cb33dcead42d18bbb0fc3f72d54eaa1ae4abcb3 100644 (file)
@@ -704,11 +704,16 @@ Bool_t AliReconstruction::MisalignGeometry(const TString& detectors)
     TString loadAlObjsListOfDets = "";
     
     for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
-      if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
-      loadAlObjsListOfDets += fgkDetectorName[iDet];
-      loadAlObjsListOfDets += " ";
+      if(!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+      if(fgkDetectorName[iDet]=="HLT") continue;
+      if(AliGeomManager::IsModuleInGeom(fgkDetectorName[iDet]))
+      {
+       loadAlObjsListOfDets += fgkDetectorName[iDet];
+       loadAlObjsListOfDets += " ";
+      }
     } // end loop over detectors
-    loadAlObjsListOfDets.Prepend("GRP "); //add alignment objects for non-sensitive modules
+    if(AliGeomManager::IsModuleInGeom("FRAME"))
+      loadAlObjsListOfDets.Prepend("GRP "); //add alignment objects for non-sensitive modules
     AliGeomManager::ApplyAlignObjsFromCDB(loadAlObjsListOfDets.Data());
     AliCDBManager::Instance()->UnloadFromCache("*/Align/*");
   }else{
@@ -923,7 +928,6 @@ Bool_t AliReconstruction::InitGRP() {
     fFillESD = MatchDetectorList(fFillESD,detMask);
     fQADetectors = MatchDetectorList(fQADetectors,detMask);
     fLoadCDB = MatchDetectorList(fLoadCDB,detMask);
-    fLoadAlignData = MatchDetectorList(fLoadAlignData,detMask);
   }
 
   AliInfo("===================================================================================");
@@ -1165,12 +1169,6 @@ void AliReconstruction::Begin(TTree *)
     AliSysInfo::AddStamp("CheckGeom");
   }
 
-  if (!InitGRP()) {
-    Abort("InitGRP", TSelector::kAbortProcess);
-    return;
-  }
-  AliSysInfo::AddStamp("InitGRP");
-
   if (!MisalignGeometry(fLoadAlignData)) {
     Abort("MisalignGeometry", TSelector::kAbortProcess);
     return;
@@ -1178,6 +1176,12 @@ void AliReconstruction::Begin(TTree *)
   AliCDBManager::Instance()->UnloadFromCache("GRP/Geometry/Data");
   AliSysInfo::AddStamp("MisalignGeom");
 
+  if (!InitGRP()) {
+    Abort("InitGRP", TSelector::kAbortProcess);
+    return;
+  }
+  AliSysInfo::AddStamp("InitGRP");
+
   if (!LoadCDB()) {
     Abort("LoadCDB", TSelector::kAbortProcess);
     return;