Commit dc77f3f4 authored by Robert Langenberg's avatar Robert Langenberg
Browse files

add TRT, Muon and SCT dependencies to config. ITk config still missing

parent 4ac440de
......@@ -88,8 +88,25 @@ if DetFlags.SCT_on() and ((not DetFlags.simulate.SCT_on()) or DetFlags.overlay.S
condSeq += SCT_AlignCondAlg(name = "SCT_AlignCondAlg",
UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders())
if not hasattr(condSeq, "SCT_DetectorElementCondAlg"):
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
PixelAlignStore = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if DetFlags.Muon_on():
MuonMgrKey = "MuonDetectorManager"
if DetFlags.TRT_on():
TRT_DetEltKey = "TRT_DetElementContainer"
if DetFlags.pixel_on():
PixelAlignStore = "PixelAlignmentStore"
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_DetectorElementCondAlg
condSeq += SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg")
condSeq += SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg",
MuonManagerKey = MuonMgrKey,
TRT_DetEltContKey = TRT_DetEltKey,
PixelAlignmentStore = PixelAlignStore)
if DetFlags.pixel_on() and ((not DetFlags.simulate.pixel_on()) or DetFlags.overlay.pixel_on()):
if not hasattr(condSeq, "PixelAlignCondAlg"):
......@@ -99,6 +116,23 @@ if DetFlags.pixel_on() and ((not DetFlags.simulate.pixel_on()) or DetFlags.overl
condSeq += PixelAlignCondAlg(name = "PixelAlignCondAlg",
UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders())
if not hasattr(condSeq, "PixelDetectorElementCondAlg"):
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
SCTAlignStore = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if DetFlags.Muon_on():
MuonMgrKey = "MuonDetectorManager"
if DetFlags.TRT_on():
TRT_DetEltKey = "TRT_DetElementContainer"
if DetFlags.SCT_on():
SCTAlignStore = "SCTAlignmentStore"
from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDetectorElementCondAlg
condSeq += PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")
condSeq += PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg",
MuonManagerKey = MuonMgrKey,
TRT_DetEltContKey = TRT_DetEltKey,
SCTAlignmentStore = SCTAlignStore)
......@@ -66,10 +66,28 @@ if DetFlags.SCT_on():
if not hasattr(condSeq, "SCT_AlignCondAlg"):
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_AlignCondAlg
condSeq += SCT_AlignCondAlg(name = "SCT_AlignCondAlg",
UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders())
UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders()
)
if not hasattr(condSeq, "SCT_DetectorElementCondAlg"):
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
PixelAlignStore = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if DetFlags.Muon_on():
MuonMgrKey = "MuonDetectorManager"
if DetFlags.TRT_on():
TRT_DetEltKey = "TRT_DetElementContainer"
if DetFlags.pixel_on():
PixelAlignStore = "PixelAlignmentStore"
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_DetectorElementCondAlg
condSeq += SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg")
condSeq += SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg",
MuonManagerKey = MuonMgrKey,
TRT_DetEltContKey = TRT_DetEltKey,
PixelAlignmentStore = PixelAlignStore)
if DetFlags.pixel_on():
if not hasattr(condSeq, "PixelAlignCondAlg"):
......@@ -77,6 +95,22 @@ if DetFlags.pixel_on():
condSeq += PixelAlignCondAlg(name = "PixelAlignCondAlg",
UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders())
if not hasattr(condSeq, "PixelDetectorElementCondAlg"):
from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDetectorElementCondAlg
condSeq += PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
SCTAlignStore = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if DetFlags.Muon_on():
MuonMgrKey = "MuonDetectorManager"
if DetFlags.TRT_on():
TRT_DetEltKey = "TRT_DetElementContainer"
if DetFlags.SCT_on():
SCTAlignStore = "SCTAlignmentStore"
from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDetectorElementCondAlg
condSeq += PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg",
MuonManagerKey = MuonMgrKey,
TRT_DetEltContKey = TRT_DetEltKey,
SCTAlignmentStore = SCTAlignStore)
\ No newline at end of file
......@@ -444,6 +444,24 @@ def PixelDetectorElementCondAlgCfg(flags, name="PixelDetectorElementCondAlg", **
"""Return a ComponentAccumulator with configured PixelDetectorElementCondAlg"""
acc = ComponentAccumulator()
acc.merge(PixelAlignCondAlgCfg(flags))
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
SCTAlignStoreKey = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if flags.Detector.GeometryMuon:
MuonMgrKey = "MuonDetectorManager"
if flags.Detector.GeometryTRT:
TRT_DetEltKey = "TRT_DetElementContainer"
if flags.Detector.GeometryPixel:
SCTAlignStoreKey = "SCTAlignmentStore"
kwargs.setdefault("MuonManagerKey", MuonMgrKey)
kwargs.setdefault("TRT_DetEltContKey", TRT_DetEltKey)
kwargs.setdefault("SCTAlignmentStore", SCTAlignStoreKey)
kwargs.setdefault("PixelAlignmentStore", "PixelAlignmentStore")
kwargs.setdefault("WriteKey", "PixelDetectorElementCollection")
acc.addCondAlgo(CompFactory.PixelDetectorElementCondAlg(name, **kwargs))
......
......@@ -37,8 +37,15 @@ StatusCode PixelDetectorElementCondAlg::initialize()
ATH_CHECK(detStore()->retrieve(m_detManager, m_detManagerName));
// used only if they exist
ATH_CHECK(m_trtDetElContKey.initialize());
ATH_CHECK(m_muonManagerKey.initialize());
if(not m_trtDetElContKey.empty()){
ATH_CHECK(m_trtDetElContKey.initialize());
}
if(not m_muonManagerKey.empty()){
ATH_CHECK(m_muonManagerKey.initialize());
}
if(not m_SCT_readKey.empty()){
ATH_CHECK(m_SCT_readKey.initialize());
}
return StatusCode::SUCCESS;
}
......@@ -78,23 +85,29 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const
// Add dependency for IOV range
writeHandle.addDependency(readHandle);
// Additional dependencies for IOV range to limit lifetime to TrackingGeometry lifetime
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{m_muonManagerKey, ctx};
if(*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else{
ATH_MSG_INFO("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
if (not m_muonManagerKey.empty()){
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{m_muonManagerKey, ctx};
if (*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else {
ATH_MSG_WARNING("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
}
}
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{m_trtDetElContKey, ctx};
if(*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else{
ATH_MSG_INFO("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
if (not m_trtDetElContKey.empty()){
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{m_trtDetElContKey, ctx};
if (*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else {
ATH_MSG_WARNING("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
}
}
SG::ReadCondHandle<GeoAlignmentStore> sctDependency{m_SCT_readKey, ctx};
if(*sctDependency != nullptr){
writeHandle.addDependency(sctDependency);
} else{
ATH_MSG_INFO("SCT AlignmentStore not found, ignoring SCT for PixelDetElement lifetime");
if (not m_SCT_readKey.empty()){
SG::ReadCondHandle<GeoAlignmentStore> sctDependency{m_SCT_readKey, ctx};
if (*sctDependency != nullptr){
writeHandle.addDependency(sctDependency);
} else {
ATH_MSG_WARNING("SCT AlignmentStore not found, ignoring SCT for PixelDetElement lifetime");
}
}
// ____________ Update writeCdo using readCdo ____________
......
......@@ -36,8 +36,15 @@ StatusCode SCT_DetectorElementCondAlg::initialize()
ATH_CHECK(detStore()->retrieve(m_detManager, m_detManagerName));
// used only if they exist
ATH_CHECK(m_trtDetElContKey.initialize());
ATH_CHECK(m_muonManagerKey.initialize());
if(not m_trtDetElContKey.empty()){
ATH_CHECK(m_trtDetElContKey.initialize());
}
if(not m_muonManagerKey.empty()){
ATH_CHECK(m_muonManagerKey.initialize());
}
if(not m_pixelReadKey.empty()){
ATH_CHECK(m_pixelReadKey.initialize());
}
return StatusCode::SUCCESS;
}
......@@ -77,23 +84,29 @@ StatusCode SCT_DetectorElementCondAlg::execute(const EventContext& ctx) const
// Add dependency
writeHandle.addDependency(readHandle);
// Additional dependencies for IOV range to limit lifetime to TrackingGeometry lifetime
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{m_muonManagerKey, ctx};
if(*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else{
ATH_MSG_INFO("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
if (not m_muonManagerKey.empty()){
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{m_muonManagerKey, ctx};
if (*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else {
ATH_MSG_WARNING("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
}
}
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{m_trtDetElContKey, ctx};
if(*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else{
ATH_MSG_INFO("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
if (not m_trtDetElContKey.empty()){
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{m_trtDetElContKey, ctx};
if (*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else {
ATH_MSG_WARNING("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
}
}
SG::ReadCondHandle<GeoAlignmentStore> pixelDependency{m_pixelReadKey, ctx};
if(*pixelDependency != nullptr){
writeHandle.addDependency(pixelDependency);
} else{
ATH_MSG_INFO("Pixel AlignmentStore not found, ignoring Pixel for SCT_DetElement lifetime");
if (not m_pixelReadKey.empty()){
SG::ReadCondHandle<GeoAlignmentStore> pixelDependency{m_pixelReadKey, ctx};
if (*pixelDependency != nullptr){
writeHandle.addDependency(pixelDependency);
} else {
ATH_MSG_WARNING("Pixel AlignmentStore not found, ignoring Pixels for SCT_DetElement lifetime");
}
}
// ____________ Update writeCdo using readCdo ____________
......
......@@ -3,6 +3,7 @@
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
def PixelGeometryCfg( flags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
......@@ -36,11 +37,6 @@ def PixelGeometryCfg( flags ):
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align"))
if flags.Common.Project != "AthSimulation": # Protection for AthSimulation builds
if flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay:
PixelAlignCondAlg=CompFactory.PixelAlignCondAlg
pixelAlignCondAlg = PixelAlignCondAlg(name = "PixelAlignCondAlg",
UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic)
acc.addCondAlgo(pixelAlignCondAlg)
PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg
pixelDetectorElementCondAlg = PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")
acc.addCondAlgo(pixelDetectorElementCondAlg)
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
acc.merge(PixelDetectorElementCondAlgCfg(flags))
return acc
......@@ -3,6 +3,7 @@
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
def SCT_GeometryCfg( flags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
......@@ -31,7 +32,32 @@ def SCT_GeometryCfg( flags ):
sctAlignCondAlg = SCT_AlignCondAlg(name = "SCT_AlignCondAlg",
UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic)
acc.addCondAlgo(sctAlignCondAlg)
SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
sctDetectorElementCondAlg = SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg")
acc.addCondAlgo(sctDetectorElementCondAlg)
acc.merge(SCT_DetectorElementCondAlgCfg(flags))
return acc
def SCT_DetectorElementCondAlgCfg(flags, name = "SCT_DetectorElementCondAlg", **kwargs):
# set up dependencies to limit IOV Range for athena MT
MuonMgrKey = ""
TRT_DetEltKey = ""
PixelAlignStore = ""
# To avoid setting up conditions algorithms in the right order, only set up for athena MT
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
if flags.Detector.GeometryMuon:
MuonMgrKey = "MuonDetectorManager"
if flags.Detector.GeometryTRT:
TRT_DetEltKey = "TRT_DetElementContainer"
if flags.Detector.GeometryPixel:
PixelAlignStoreKey = "PixelAlignmentStore"
kwargs.setdefault("MuonManagerKey", MuonMgrKey)
kwargs.setdefault("TRT_DetEltContKey", TRT_DetEltKey)
kwargs.setdefault("PixelAlignmentStore", PixelAlignStoreKey)
SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
sctDetectorElementCondAlg = SCT_DetectorElementCondAlg(name, **kwargs)
acc = ComponentAccumulator()
acc.addCondAlgo(sctDetectorElementCondAlg)
return acc
\ No newline at end of file
......@@ -49,16 +49,17 @@ def tmpSetupTrackServices(inputFlags):
PixelAlignCondAlg=CompFactory.PixelAlignCondAlg
result.addCondAlgo(PixelAlignCondAlg(name = "PixelAlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg
result.addCondAlgo(PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg"))
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
result.merge(PixelDetectorElementCondAlgCfg(inputFlags))
#Setup SCT conditions
SCT_AlignCondAlg=CompFactory.SCT_AlignCondAlg
result.addCondAlgo(SCT_AlignCondAlg(name = "SCT_AlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
result.addCondAlgo(SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg"))
from SCT_GeoModel.SCT_GeoModelConfig import SCT_DetectorElementCondAlgCfg
result.merge(SCT_DetectorElementCondAlgCfg(inputFlags))
GeometryDBSvc=CompFactory.GeometryDBSvc
result.addService(GeometryDBSvc("InDetGeometryDBSvc"))
......
......@@ -59,16 +59,16 @@ def PFCfg(inputFlags,**kwargs):
#Setup Pixel conditions
PixelAlignCondAlg=CompFactory.PixelAlignCondAlg
result.addCondAlgo(PixelAlignCondAlg(name = "PixelAlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg
result.addCondAlgo(PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg"))
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
result.merge(PixelDetectorElementCondAlgCfg(inputFlags))
#Setup SCT conditions
SCT_AlignCondAlg=CompFactory.SCT_AlignCondAlg
result.addCondAlgo(SCT_AlignCondAlg(name = "SCT_AlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
result.addCondAlgo(SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg"))
from SCT_GeoModel.SCT_GeoModelConfig import SCT_DetectorElementCondAlgCfg
result.merge(SCT_DetectorElementCondAlgCfg(inputFlags))
GeometryDBSvc=CompFactory.GeometryDBSvc
result.addService(GeometryDBSvc("InDetGeometryDBSvc"))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment