Commit d6c70d2a authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch...

Merge branch 'reduce_IOVRange_of_SiDetElementCollections_to_TrackingGeometry_IOVRange' into 'master'

ATLASRECTS-6523 Part II: Reduce IOV Range for SiDetElements to match TrackingGeometry

See merge request atlas/athena!45539
parents e0cfb887 c72094d1
......@@ -1177,7 +1177,7 @@ def conf2toConfigurable( comp, indent="", parent="", suppressDupes=False ):
setattr(clone, pname, alreadySetProperties[pname])
try:
updatedPropValue = __listHelperToList(newConf2Instance._descriptors[pname].semantics.merge( getattr(newConf2Instance, pname), getattr(clone, pname)))
except TypeError:
except (TypeError, ValueError):
err_message = f"Failed merging new config value ({getattr(newConf2Instance, pname)}) and old config value ({getattr(clone, pname)}) for the ({pname}) property of {existingConfigurableInstance.getFullJobOptName() } ({newConf2Instance.getFullJobOptName()}) old (new)."
_log.fatal( err_message )
raise ConfigurationError(err_message)
......
......@@ -20,6 +20,12 @@ def getNewConfigFlags():
ConfigFlags.GeoModel.AtlasVersion = jobproperties.Global.DetDescrVersion()
ConfigFlags.GeoModel.Align.Dynamic = InDetGeometryFlags.useDynamicAlignFolders()
# Concurrency
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
ConfigFlags.Concurrency.NumProcs = jp.ConcurrencyFlags.NumProcs()
ConfigFlags.Concurrency.NumThreads = jp.ConcurrencyFlags.NumThreads()
# Let's build a map whose key is new flagname, and whose value is old flagname.
geom_flag_map = {}
# Geometry - InnerDetector
......
......@@ -101,4 +101,3 @@ if DetFlags.pixel_on() and ((not DetFlags.simulate.pixel_on()) or DetFlags.overl
if not hasattr(condSeq, "PixelDetectorElementCondAlg"):
from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDetectorElementCondAlg
condSeq += PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")
......@@ -11,7 +11,7 @@ find_package( CORAL COMPONENTS CoralBase )
atlas_add_component( PixelConditionsAlgorithms
src/*.h src/*.cxx src/components/*.cxx
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${CLHEP_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities CommissionEvent DetDescrConditions GaudiKernel GeoModelUtilities GeoPrimitives Identifier InDetCondTools InDetIdentifier InDetReadoutGeometry PathResolver PixelConditionsData PixelReadoutGeometry StoreGateLib TrkGeometry TrkSurfaces )
LINK_LIBRARIES ${CLHEP_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities CommissionEvent DetDescrConditions GaudiKernel GeoModelUtilities GeoPrimitives Identifier InDetCondTools InDetIdentifier InDetReadoutGeometry PathResolver PixelConditionsData PixelReadoutGeometry StoreGateLib TrkGeometry TrkSurfaces MuonReadoutGeometry TRT_ReadoutGeometry)
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
......@@ -437,9 +437,19 @@ def PixelDetectorElementCondAlgCfg(flags, name="PixelDetectorElementCondAlg", **
"""Return a ComponentAccumulator with configured PixelDetectorElementCondAlg"""
acc = ComponentAccumulator()
acc.merge(PixelAlignCondAlgCfg(flags))
kwargs.setdefault("PixelAlignmentStore", "PixelAlignmentStore")
kwargs.setdefault("WriteKey", "PixelDetectorElementCollection")
acc.addCondAlgo(CompFactory.PixelDetectorElementCondAlg(name, **kwargs))
def merge_lists(a, b):
a.extend([item for item in b if item not in a])
return a
alg=CompFactory.PixelDetectorElementCondAlg(name, **kwargs)
alg._descriptors['MuonManagerKey'].semantics.merge = merge_lists
alg._descriptors['TRT_DetEltContKey'].semantics.merge = merge_lists
alg._descriptors['SCTAlignmentStore'].semantics.merge = merge_lists
acc.addCondAlgo(alg)
return acc
def PixelDistortionAlgCfg(flags, name="PixelDistortionAlg", **kwargs):
......
......@@ -36,6 +36,11 @@ StatusCode PixelDetectorElementCondAlg::initialize()
// We need the detector manager
ATH_CHECK(detStore()->retrieve(m_detManager, m_detManagerName));
// used only if they exist
ATH_CHECK(m_trtDetElContKey.initialize());
ATH_CHECK(m_muonManagerKey.initialize());
ATH_CHECK(m_SCT_readKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -62,7 +67,6 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const
// ____________ Construct new Write Cond Object ____________
std::unique_ptr<InDetDD::SiDetectorElementCollection> writeCdo{std::make_unique<InDetDD::SiDetectorElementCollection>()};
EventIDRange rangeW;
// ____________ Get Read Cond Object ____________
SG::ReadCondHandle<GeoAlignmentStore> readHandle{m_readKey, ctx};
......@@ -72,10 +76,32 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const
return StatusCode::FAILURE;
}
// Define validity of the output cond object and record it
if (not readHandle.range(rangeW)) {
ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key());
return StatusCode::FAILURE;
// Add dependency for IOV range
writeHandle.addDependency(readHandle);
// Additional dependencies for IOV range to limit lifetime to TrackingGeometry lifetime
for (const SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> &key :m_muonManagerKey ) {
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{key, ctx};
if (*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else {
ATH_MSG_WARNING("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
}
}
for (const SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> &key :m_trtDetElContKey ) {
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{key, ctx};
if (*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else {
ATH_MSG_WARNING("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
}
}
for (const SG::ReadCondHandleKey<GeoAlignmentStore> &key :m_SCT_readKey ) {
SG::ReadCondHandle<GeoAlignmentStore> sctDependency{key, ctx};
if (*sctDependency != nullptr){
writeHandle.addDependency(sctDependency);
} else {
ATH_MSG_WARNING("SCT AlignmentStore not found, ignoring SCT for PixelDetElement lifetime");
}
}
// ____________ Update writeCdo using readCdo ____________
......@@ -120,15 +146,14 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const
// Record WriteCondHandle
const std::size_t size{writeCdo->size()};
if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) {
if (writeHandle.record(std::move(writeCdo)).isFailure()) {
ATH_MSG_FATAL("Could not record " << writeHandle.key()
<< " with EventRange " << rangeW
<< " with EventRange " << writeHandle.getRange()
<< " into Conditions Store");
return StatusCode::FAILURE;
}
ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << rangeW
ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << writeHandle.getRange()
<< " with size of " << size << " into Conditions Store");
return StatusCode::SUCCESS;
}
......@@ -14,9 +14,14 @@
#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteCondHandleKey.h"
#include "StoreGate/CondHandleKeyArray.h"
#include "GaudiKernel/ICondSvc.h"
//dependencies to limit lifetime of SiDetElColl for TrackingGeometry
#include "MuonReadoutGeometry/MuonDetectorManager.h"
#include "TRT_ReadoutGeometry/TRT_DetElementContainer.h"
namespace InDetDD {
class PixelDetectorManager;
}
......@@ -39,6 +44,15 @@ class PixelDetectorElementCondAlg : public AthReentrantAlgorithm
SG::WriteCondHandleKey<InDetDD::SiDetectorElementCollection> m_writeKey
{this, "WriteKey", "PixelDetectorElementCollection", "Key of output SiDetectorElementCollection for Pixel"};
// The DetElement Collection must have a life time <= the Tracking Geometry due to DetElt-> Surface -> Layer connection,
// which is why we intersect with the IOV Ranges from the TG's dependencies.
SG::ReadCondHandleKeyArray<MuonGM::MuonDetectorManager> m_muonManagerKey
{this, "MuonManagerKey", {}, "MuonManager ReadKey for IOV Range intersection"};
SG::ReadCondHandleKeyArray<InDetDD::TRT_DetElementContainer> m_trtDetElContKey
{this, "TRT_DetEltContKey", {}, "TRT ReadKey for IOV Range intersection"};
SG::ReadCondHandleKeyArray<GeoAlignmentStore> m_SCT_readKey
{this, "SCTAlignmentStore", {}, "SCTAlignmentStore ReadKey for IOV Range intersection "};
ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"};
StringProperty m_detManagerName{this, "DetManagerName", "Pixel", "Name of the DeterctorManager to retrieve"};
......
......@@ -11,7 +11,7 @@ atlas_add_component( SCT_ConditionsAlgorithms
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps StoreGateLib Identifier DetDescrConditions GeoModelUtilities GeoPrimitives GaudiKernel SCT_ConditionsData SCT_CablingLib AthenaPoolUtilities InDetConditionsSummaryService InDetIdentifier InDetReadoutGeometry SCT_ReadoutGeometry TrkGeometry TrkSurfaces SCT_ConditionsToolsLib )
LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps StoreGateLib Identifier DetDescrConditions GeoModelUtilities GeoPrimitives GaudiKernel SCT_ConditionsData SCT_CablingLib AthenaPoolUtilities InDetConditionsSummaryService InDetIdentifier InDetReadoutGeometry SCT_ReadoutGeometry TrkGeometry TrkSurfaces SCT_ConditionsToolsLib MuonReadoutGeometry TRT_ReadoutGeometry)
atlas_add_test( TestCalibChipRead
SCRIPT athena.py --threads=5 SCT_ConditionsAlgorithms/testCalibChipRead.py
......
......@@ -35,6 +35,11 @@ StatusCode SCT_DetectorElementCondAlg::initialize()
ATH_CHECK(m_condSvc->regHandle(this, m_writeKey));
ATH_CHECK(detStore()->retrieve(m_detManager, m_detManagerName));
// used only if they exist
ATH_CHECK(m_trtDetElContKey.initialize());
ATH_CHECK(m_muonManagerKey.initialize());
ATH_CHECK(m_pixelReadKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -72,6 +77,31 @@ StatusCode SCT_DetectorElementCondAlg::execute(const EventContext& ctx) const
// Add dependency
writeHandle.addDependency(readHandle);
// Additional dependencies for IOV range to limit lifetime to TrackingGeometry lifetime
for (const SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> &key :m_muonManagerKey ) {
SG::ReadCondHandle<MuonGM::MuonDetectorManager> muonDependency{key, ctx};
if (*muonDependency != nullptr){
writeHandle.addDependency(muonDependency);
} else {
ATH_MSG_WARNING("MuonManager not found, ignoring Muons for PixelDetElement lifetime");
}
}
for (const SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> &key :m_trtDetElContKey ) {
SG::ReadCondHandle<InDetDD::TRT_DetElementContainer> trtDependency{key, ctx};
if (*trtDependency != nullptr){
writeHandle.addDependency(trtDependency);
} else {
ATH_MSG_WARNING("TRT DetEls not found, ignoring TRT for PixelDetElement lifetime");
}
}
for (const SG::ReadCondHandleKey<GeoAlignmentStore> &key :m_pixelReadKey ) {
SG::ReadCondHandle<GeoAlignmentStore> pixelDependency{key, 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 ____________
std::map<const InDetDD::SiDetectorElement*, const InDetDD::SiDetectorElement*> oldToNewMap;
......
......@@ -14,9 +14,14 @@
#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteCondHandleKey.h"
#include "StoreGate/CondHandleKeyArray.h"
#include "GaudiKernel/ICondSvc.h"
//dependencies to limit lifetime of SiDetElColl for TrackingGeometry
#include "MuonReadoutGeometry/MuonDetectorManager.h"
#include "TRT_ReadoutGeometry/TRT_DetElementContainer.h"
namespace InDetDD {
class SCT_DetectorManager;
}
......@@ -37,6 +42,15 @@ class SCT_DetectorElementCondAlg : public AthReentrantAlgorithm
SG::ReadCondHandleKey<GeoAlignmentStore> m_readKey;
SG::WriteCondHandleKey<InDetDD::SiDetectorElementCollection> m_writeKey{this, "WriteKey", "SCT_DetectorElementCollection", "Key of output SiDetectorElementCollection for SCT"};
// The DetElement Collection must have a life time <= the Tracking Geometry due to DetElt-> Surface -> Layer connection,
// which is why we intersect with the IOV Ranges from the TG's dependencies.
SG::ReadCondHandleKeyArray<MuonGM::MuonDetectorManager> m_muonManagerKey
{this, "MuonManagerKey", {}, "MuonManager ReadKey for IOV Range intersection"};
SG::ReadCondHandleKeyArray<InDetDD::TRT_DetElementContainer> m_trtDetElContKey
{this, "TRT_DetEltContKey", {}, "TRT ReadKey for IOV Range intersection"};
SG::ReadCondHandleKeyArray<GeoAlignmentStore> m_pixelReadKey
{this, "PixelAlignmentStore", {}, "PixelAlignmentStore ReadKey for IOV Range intersection"};
ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"};
std::string m_detManagerName;
const InDetDD::SCT_DetectorManager* m_detManager{nullptr};
......
......@@ -36,11 +36,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,20 @@ 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):
def merge_lists(a, b):
a.extend([item for item in b if item not in a])
return a
SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
sctDetectorElementCondAlg = SCT_DetectorElementCondAlg(name, **kwargs)
acc = ComponentAccumulator()
sctDetectorElementCondAlg._descriptors['MuonManagerKey'].semantics.merge = merge_lists
sctDetectorElementCondAlg._descriptors['TRT_DetEltContKey'].semantics.merge = merge_lists
sctDetectorElementCondAlg._descriptors['PixelAlignmentStore'].semantics.merge = merge_lists
acc.addCondAlgo(sctDetectorElementCondAlg)
return acc
......@@ -2,6 +2,7 @@
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from AthenaConfiguration.AutoConfigFlags import DetDescrInfo
from AthenaConfiguration.Enums import ProductionStep
import re
# Some comments from Ed about existing flags
......@@ -126,6 +127,9 @@ def createMuonConfigFlags():
mcf.addFlag("Muon.MuonTrigger", False)
mcf.addFlag("Muon.SAMuonTrigger", False)
mcf.addFlag("Muon.enableAlignment",lambda flags: (flags.Common.Project != 'AthSimulation' \
and (flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay)))
# TODO - add configuration for above
return mcf
......
......@@ -33,9 +33,7 @@ def MuonDetectorToolCfg(flags):
from MuonGeoModel.MMPassivationFlag import MMPassivationFlag
detTool.passivationWidthMM = MMPassivationFlag.correction
enableAlignment = flags.Common.Project != 'AthSimulation' \
and (flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay)
if enableAlignment:
if flags.Muon.enableAlignment:
# Condition DB is needed only if A-lines or B-lines are requested
if not (not flags.Muon.Align.UseALines and flags.Muon.Align.UseBLines=='none'):
detTool.UseConditionDb = 1
......@@ -182,9 +180,7 @@ def MuonGeoModelCfg(flags, forceDisableAlignment=False):
detTool.FillCacheInitTime = 0 # We do not need to fill cache for the MuonGeoModel MuonDetectorTool, just for the condAlg
gms.DetectorTools += [ detTool ]
enableAlignment = flags.Common.Project != 'AthSimulation' \
and (flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay)
if enableAlignment and not forceDisableAlignment:
if flags.Muon.enableAlignment and not forceDisableAlignment:
acc.merge(MuonDetectorCondAlgCfg(flags))
acc.merge(MuonIdHelperSvcCfg(flags)) # This line can be removed once the configuration methods for all 258 components which directly use this service are updated!!
......
......@@ -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"))
......
......@@ -20,6 +20,18 @@ from AthenaCommon.DetFlags import DetFlags
#################################################################################
# Material for the Geometry comes from COOL or local database
#################################################################################
def modifyCondAlg(the_name, **props) :
from AthenaCommon.AlgSequence import AlgSequence
from AthenaCommon.AlgSequence import AthSequencer
cond_seq=AthSequencer("AthCondSeq")
for seq in [AlgSequence(),cond_seq] :
if hasattr(seq,the_name) :
alg = getattr(seq,the_name)
print('Modified %s' % the_name)
for k,v in props.items() :
setattr(alg,k,v)
print (alg)
return
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
......@@ -73,7 +85,25 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
# and give it to the Geometry Builder
AtlasGeometryBuilder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder
#
# artifical dependencies to Si-DetectorElement conditions algs to ensure that
# the IOV is identical to the IOV of the tracking geoemtry
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 0:
MuonManagerKey = ['MuonDetectorManager'] if (DetFlags.Muon_on() and not DetFlags.writeRDOPool.Muon_on()) else []
TRT_DetEltKey = ["TRT_DetElementContainer"] if DetFlags.TRT_on() else []
SCTAlignStore = ["SCTAlignmentStore"] if DetFlags.SCT_on() else []
PixelAlignStore = ["PixelAlignmentStore"] if DetFlags.pixel_on() else []
modifyCondAlg('SCT_DetectorElementCondAlg', MuonManagerKey = MuonManagerKey,
TRT_DetEltContKey = TRT_DetEltKey,
PixelAlignmentStore = PixelAlignStore)
modifyCondAlg('PixelDetectorElementCondAlg', MuonManagerKey = MuonManagerKey,
TRT_DetEltContKey = TRT_DetEltKey,
SCTAlignmentStore = SCTAlignStore)
# (Calo)
if DetFlags.Calo_on() :
from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
......@@ -96,7 +126,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
MuonTrackingGeometryBuilderCond.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
# and give it to the Geometry Builder
AtlasGeometryBuilder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilderCond
# processors
AtlasGeometryProcessors = []
......
......@@ -78,6 +78,14 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc,
binnings += [ PixelLayerBinning ]
colors += [ 3 ]
# add artifical dependencies to Pixel DetectorElement conditions algs to ensure that the IOV
# is identical to the IOV of the tracking geoemtry cond alg
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
result.merge(PixelDetectorElementCondAlgCfg(flags,
MuonManagerKey = ["MuonDetectorManager"] if flags.Muon.enableAlignment and flags.Concurrency.NumThreads > 0 else [],
TRT_DetEltContKey = ["TRT_DetElementContainer"] if flags.Detector.GeometryTRT and flags.Concurrency.NumThreads > 0 else [],
SCTAlignmentStore = ["SCTAlignmentStore"] if flags.Detector.GeometrySCT and flags.Concurrency.NumThreads > 0 else []))
if flags.Detector.GeometrySCT:
# for SCT DetectorElement conditions data :
from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
......@@ -113,6 +121,13 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc,
binnings += [ SCT_LayerBinning ]
colors += [ 4 ]
from SCT_GeoModel.SCT_GeoModelConfig import SCT_DetectorElementCondAlgCfg
result.merge(SCT_DetectorElementCondAlgCfg(flags,
MuonManagerKey = ["MuonDetectorManager"] if flags.Muon.enableAlignment and flags.Concurrency.NumThreads > 0 else [],
TRT_DetEltContKey = ["TRT_DetElementContainer"] if flags.Detector.GeometryTRT and flags.Concurrency.NumThreads > 0 else [],
PixelAlignmentStore = ["PixelAlignmentStore"] if flags.Detector.GeometryPixel and flags.Concurrency.NumThreads > 0 else []))
if flags.Detector.GeometryTRT:
# for TRT DetectorElement conditions data :
from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
......
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