Skip to content
Snippets Groups Projects

Draft: PLR Digitization Implementation

Closed Deion Elgin Fellers requested to merge dfellers/athena:master-PlrDigitization into master
Files
24
"""Define functions to configure Pixel conditions algorithms
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline
def PLRConfigCondAlgCfg(flags, name="PLRConfigCondAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelConfigCondAlg for PLR"""
kwargs.setdefault("WriteKey", "PLRModuleData")
# This one has the highest chance of premature divergence so just take the default Pixel for now
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg
return PixelConfigCondAlgCfg(flags, name, **kwargs)
def PLRAlignCondAlgCfg(flags, name="PLRAlignCondAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelAlignCondAlg for ITk"""
acc = ComponentAccumulator()
if flags.GeoModel.Align.Dynamic:
raise RuntimeError("Dynamic alignment not supported for ITk yet")
else:
acc.merge(addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Align", "/Indet/Align", className="AlignableTransformContainer"))
kwargs.setdefault("DetManagerName", "PLR")
kwargs.setdefault("UseDynamicAlignFolders", flags.GeoModel.Align.Dynamic)
kwargs.setdefault("ReadKeyStatic", "/Indet/Align")
# kwargs.setdefault("ReadKeyDynamicL1", "/Indet/AlignL1/ID")
# kwargs.setdefault("ReadKeyDynamicL2", "/Indet/AlignL2/PIX")
# kwargs.setdefault("ReadKeyDynamicL3", "/Indet/AlignL3")
kwargs.setdefault("ReadKeyIBLDist", "")
kwargs.setdefault("WriteKey", "PLRAlignmentStore")
acc.addCondAlgo(CompFactory.PixelAlignCondAlg(name, **kwargs))
return acc
def PLRChargeCalibCondAlgCfg(flags, name="PLRChargeCalibCondAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelChargeCalibCondAlg for ITk"""
acc = ComponentAccumulator()
acc.merge(PLRConfigCondAlgCfg(flags))
acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixCalib", "/PIXEL/PixCalib", className="CondAttrListCollection"))
from PLRGeoModelXml.PLRGeoModelConfig import PLRReadoutGeometryCfg
acc.merge(PLRReadoutGeometryCfg(flags))
kwargs.setdefault("isPLR", True)
kwargs.setdefault("PixelDetEleCollKey", "PLRDetectorElementCollection")
kwargs.setdefault("PixelModuleData", "PLRModuleData")
kwargs.setdefault("ReadKey", "") # TODO: enable when ready
kwargs.setdefault("WriteKey", "PLRChargeCalibCondData")
acc.addCondAlgo(CompFactory.PixelChargeCalibCondAlg(name, **kwargs))
return acc
def PLRDCSCondHVAlgCfg(flags, name="PLRDCSCondHVAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelDCSCondHVAlg for ITk"""
acc = ComponentAccumulator()
acc.merge(PLRConfigCondAlgCfg(flags))
if flags.Common.isOnline:
kwargs.update( ReadKey="/PIXEL/HLT/DCS/HV")
acc.merge(addFolders(flags, kwargs["ReadKey"], "PIXEL_ONL", className="CondAttrListCollection"))
else:
# kwargs.update( ReadKey="/PIXEL/DCS/HV")
# acc.merge(addFolders(flags, kwargs["ReadKey"], "DCS_OFL", className="CondAttrListCollection"))
kwargs.update(ReadKey="") # disable for ITk for now
kwargs.setdefault("PixelModuleData", "PLRModuleData")
kwargs.setdefault("WriteKey", "PLRDCSHVCondData")
acc.addCondAlgo(CompFactory.PixelDCSCondHVAlg(name, **kwargs))
return acc
def PLRDCSCondTempAlgCfg(flags, name="PLRDCSCondTempAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelDCSCondTempAlg for ITk"""
acc = ComponentAccumulator()
acc.merge(PLRConfigCondAlgCfg(flags))
if flags.Common.isOnline:
kwargs.setdefault("ReadKey", "/PIXEL/HLT/DCS/TEMPERATURE")
acc.merge(addFolders(flags, kwargs["ReadKey"], "PIXEL_ONL", className="CondAttrListCollection"))
else:
kwargs.setdefault("ReadKey", "/PIXEL/DCS/TEMPERATURE")
acc.merge(addFolders(flags, kwargs["ReadKey"], "DCS_OFL", className="CondAttrListCollection"))
kwargs.setdefault("PixelModuleData", "PLRModuleData")
kwargs.setdefault("WriteKey", "PLRDCSTempCondData")
acc.addCondAlgo(CompFactory.PixelDCSCondTempAlg(name, **kwargs))
return acc
def PLRDetectorElementCondAlgCfg(flags, name="PLRDetectorElementCondAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelDetectorElementCondAlg for ITk"""
acc = ComponentAccumulator()
acc.merge(PLRAlignCondAlgCfg(flags))
kwargs.setdefault("DetManagerName", "PLR")
kwargs.setdefault("PixelAlignmentStore", "PLRAlignmentStore")
kwargs.setdefault("WriteKey", "PLRDetectorElementCollection")
acc.addCondAlgo(CompFactory.PixelDetectorElementCondAlg(name, **kwargs))
return acc
def PLRDistortionAlgCfg(flags, name="PLRDistortionAlg", **kwargs):
"""Return a ComponentAccumulator with configured PixelDistortionAlg for ITk"""
acc = ComponentAccumulator()
acc.merge(PLRConfigCondAlgCfg(flags))
acc.merge(addFoldersSplitOnline(flags,"INDET", "/Indet/Onl/PixelDist", "/Indet/PixelDist", className="DetCondCFloat"))
kwargs.setdefault("PixelModuleData", "PLRModuleData")
kwargs.setdefault("ReadKey", "/Indet/PixelDist")
kwargs.setdefault("WriteKey", "PLRDistortionData")
acc.addCondAlgo(CompFactory.PixelDistortionAlg(name, **kwargs))
return acc
Loading