ATLAS Offline Software
PixelConditionsSummaryConfig.py
Go to the documentation of this file.
1 """Define a function to configure PixelConditionsSummaryCfg
2 
3 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
6 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 from AthenaConfiguration.Enums import Format, ProductionStep
9 
10 from PixelConditionsAlgorithms.PixelConditionsConfig import (
11  PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, PixelDeadMapCondAlgCfg
12 )
13 from PixelReadoutGeometry.PixelReadoutGeometryConfig import PixelReadoutManagerCfg
14 
15 
16 @AccumulatorCache
17 def PixelConditionsSummaryCfg(flags, name="PixelConditionsSummary", **kwargs):
18  """Return configured ComponentAccumulator with tool for Pixel Conditions"""
19  acc = PixelReadoutManagerCfg(flags)
20  acc.merge(PixelDCSCondStateAlgCfg(flags))
21  acc.merge(PixelDCSCondStatusAlgCfg(flags))
22  acc.merge(PixelDeadMapCondAlgCfg(flags))
23 
24  kwargs.setdefault("PixelReadoutManager", acc.getPrimary())
25  kwargs.setdefault("UseByteStreamFEI4", (not flags.Input.isMC and flags.Input.Format is Format.BS) or flags.Overlay.DataOverlay)
26  kwargs.setdefault("UseByteStreamFEI3", (not flags.Input.isMC and flags.Input.Format is Format.BS) or flags.Overlay.DataOverlay)
27  if (flags.Overlay.DataOverlay and
28  flags.Common.ProductionStep is not ProductionStep.MinbiasPreprocessing and
29  not flags.Overlay.ByteStream):
30  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
31  acc.merge(SGInputLoaderCfg(flags, ["IDCInDetBSErrContainer#PixelByteStreamErrs"]))
32 
33  if flags.InDet.usePixelDCS:
34  pixel_states_active = [ 'READY', 'ON' ] # 'UNKNOWN', 'TRANSITION', 'UNDEFINED', 'DISABLED', 'LOCKED_OUT', 'OFF' states should be masked.
35 
36  kwargs.setdefault("IsActiveStates", pixel_states_active)
37  kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ])
38 
39  from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
40  acc.merge(PixelDetectorElementCondAlgCfg(flags))
41  kwargs.setdefault( "PixelDetEleCollKey", "PixelDetectorElementCollection")
42 
43  acc.setPrivateTools(CompFactory.PixelConditionsSummaryTool(name=name + "Tool", **kwargs))
44  return acc
45 
46 def PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg(flags,name = "PixelConditionsSummaryToolNoByteStreamErrorsAcriveOnly", **kwargs) :
47  kwargs.setdefault("ActiveOnly", True)
48  kwargs.setdefault("UseByteStreamFEI4", False)
49  kwargs.setdefault("UseByteStreamFEI3", False)
50  kwargs.setdefault("UseByteStreamRD53", False)
51  return PixelConditionsSummaryCfg(flags, name, **kwargs)
52 
53 def PixelActiveDetectorElementStatusToolCfg(flags,name = "PixelActiveDetectorElementStatusTool",**kwargs) :
54  acc = ComponentAccumulator()
55  kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] )
56  acc.setPrivateTools( CompFactory.PixelActiveDetectorElementStatusTool(name, **kwargs) )
57  return acc
58 
59 def PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusTool",**kwargs) :
60  acc = ComponentAccumulator()
61  if (not flags.Input.isMC and flags.Input.Format is Format.BS) or flags.Overlay.DataOverlay:
62  kwargs.setdefault("PixelByteStreamErrs", "PixelByteStreamErrs")
63  kwargs.setdefault("UseByteStreamFEI4", True)
64  kwargs.setdefault("UseByteStreamFEI3", True)
65  kwargs.setdefault("ActiveOnly", False)
66  acc.setPrivateTools( CompFactory.PixelByteStreamErrorDetectorElementStatusTool(name, **kwargs) )
67  else :
68  kwargs.pop("ActiveOnly",False)
69  acc.setPrivateTools( CompFactory.PixelDetectorElementStatusCloneTool(name, **kwargs) )
70  return acc
71 
72 def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusToolActiveOnly",**kwargs) :
73  kwargs.setdefault("ActiveOnly", True)
74  return PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name, **kwargs )
PixelConditionsSummaryConfig.PixelActiveDetectorElementStatusToolCfg
def PixelActiveDetectorElementStatusToolCfg(flags, name="PixelActiveDetectorElementStatusTool", **kwargs)
Definition: PixelConditionsSummaryConfig.py:53
PixelConditionsConfig.PixelDCSCondStateAlgCfg
def PixelDCSCondStateAlgCfg(flags, name="PixelDCSCondStateAlg", **kwargs)
Definition: PixelConditionsConfig.py:177
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
PixelConditionsConfig.PixelDCSCondStatusAlgCfg
def PixelDCSCondStatusAlgCfg(flags, name="PixelDCSCondStatusAlg", **kwargs)
Definition: PixelConditionsConfig.py:189
PixelConditionsSummaryConfig.PixelConditionsSummaryCfg
def PixelConditionsSummaryCfg(flags, name="PixelConditionsSummary", **kwargs)
Definition: PixelConditionsSummaryConfig.py:17
PixelConditionsConfig.PixelDeadMapCondAlgCfg
def PixelDeadMapCondAlgCfg(flags, name="PixelDeadMapCondAlg", **kwargs)
Definition: PixelConditionsConfig.py:215
PixelConditionsSummaryConfig.PixelByteStreamErrorDetectorElementStatusToolCfg
def PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name="PixelByteStreamErrorDetectorElementStatusTool", **kwargs)
Definition: PixelConditionsSummaryConfig.py:59
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
PixelConditionsConfig.PixelDetectorElementCondAlgCfg
def PixelDetectorElementCondAlgCfg(flags, name="PixelDetectorElementCondAlg", **kwargs)
Definition: PixelConditionsConfig.py:231
PixelConditionsSummaryConfig.PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg
def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name="PixelByteStreamErrorDetectorElementStatusToolActiveOnly", **kwargs)
Definition: PixelConditionsSummaryConfig.py:72
python.PixelReadoutGeometryConfig.PixelReadoutManagerCfg
def PixelReadoutManagerCfg(flags, name="PixelReadoutManager", **kwargs)
Definition: PixelReadoutGeometryConfig.py:6
PixelConditionsSummaryConfig.PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg
def PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg(flags, name="PixelConditionsSummaryToolNoByteStreamErrorsAcriveOnly", **kwargs)
Definition: PixelConditionsSummaryConfig.py:46