From 8cb26cdfc500dd7f9fc6e9e4106c20ccfa57befd Mon Sep 17 00:00:00 2001 From: rgrosso Date: Mon, 8 Sep 2008 17:47:57 +0000 Subject: [PATCH] Application of alignment objects based on the list of modules present in the geometry, built by means of the alignable entries --- STEER/AliGeomManager.cxx | 59 +++++++++++++++++++++++++++++++++++++ STEER/AliGeomManager.h | 1 + STEER/AliReconstruction.cxx | 26 +++++++++------- 3 files changed, 75 insertions(+), 11 deletions(-) diff --git a/STEER/AliGeomManager.cxx b/STEER/AliGeomManager.cxx index a2fde10fb2b..e021cdeffec 100644 --- a/STEER/AliGeomManager.cxx +++ b/STEER/AliGeomManager.cxx @@ -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) { diff --git a/STEER/AliGeomManager.h b/STEER/AliGeomManager.h index 4b23dbd1be6..366cc455832 100644 --- a/STEER/AliGeomManager.h +++ b/STEER/AliGeomManager.h @@ -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(); diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index b6949721272..0cb33dcead4 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -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; -- 2.43.0