ATLAS Offline Software
PixelConditionsSummaryConfig.py
Go to the documentation of this file.
1 """Define a function to configure PixelConditionsSummaryCfg
2 
3 Copyright (C) 2002-2023 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
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 not flags.Overlay.DataOverlay and flags.Input.Format is Format.BS)
26  kwargs.setdefault("UseByteStreamFEI3", not flags.Input.isMC and not flags.Overlay.DataOverlay and flags.Input.Format is Format.BS)
27 
28  if flags.InDet.usePixelDCS:
29  pixel_states_active = [ 'READY', 'ON' ] # 'UNKNOWN', 'TRANSITION', 'UNDEFINED', 'DISABLED', 'LOCKED_OUT', 'OFF' states should be masked.
30 
31  kwargs.setdefault("IsActiveStates", pixel_states_active)
32  kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ])
33 
34  from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
35  acc.merge(PixelDetectorElementCondAlgCfg(flags))
36  kwargs.setdefault( "PixelDetEleCollKey", "PixelDetectorElementCollection")
37 
38  acc.setPrivateTools(CompFactory.PixelConditionsSummaryTool(name=name + "Tool", **kwargs))
39  return acc
40 
41 def PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg(flags,name = "PixelConditionsSummaryToolNoByteStreamErrorsAcriveOnly", **kwargs) :
42  kwargs.setdefault("ActiveOnly", True)
43  kwargs.setdefault("UseByteStreamFEI4", False)
44  kwargs.setdefault("UseByteStreamFEI3", False)
45  kwargs.setdefault("UseByteStreamRD53", False)
46  return PixelConditionsSummaryCfg(flags, name, **kwargs)
47 
48 def PixelActiveDetectorElementStatusToolCfg(flags,name = "PixelActiveDetectorElementStatusTool",**kwargs) :
49  acc = ComponentAccumulator()
50  kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] )
51  acc.setPrivateTools( CompFactory.PixelActiveDetectorElementStatusTool(name, **kwargs) )
52  return acc
53 
54 def PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusTool",**kwargs) :
55  acc = ComponentAccumulator()
56  if not flags.Input.isMC and not flags.Overlay.DataOverlay and flags.Input.Format is Format.BS :
57  kwargs.setdefault("PixelByteStreamErrs", "PixelByteStreamErrs")
58  kwargs.setdefault("UseByteStreamFEI4", True)
59  kwargs.setdefault("UseByteStreamFEI3", True)
60  kwargs.setdefault("ActiveOnly", False)
61  acc.setPrivateTools( CompFactory.PixelByteStreamErrorDetectorElementStatusTool(name, **kwargs) )
62  else :
63  kwargs.pop("ActiveOnly",False)
64  acc.setPrivateTools( CompFactory.PixelDetectorElementStatusCloneTool(name, **kwargs) )
65  return acc
66 
67 def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusToolActiveOnly",**kwargs) :
68  kwargs.setdefault("ActiveOnly", True)
69  return PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name, **kwargs )
PixelConditionsSummaryConfig.PixelActiveDetectorElementStatusToolCfg
def PixelActiveDetectorElementStatusToolCfg(flags, name="PixelActiveDetectorElementStatusTool", **kwargs)
Definition: PixelConditionsSummaryConfig.py:48
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:54
PixelConditionsConfig.PixelDetectorElementCondAlgCfg
def PixelDetectorElementCondAlgCfg(flags, name="PixelDetectorElementCondAlg", **kwargs)
Definition: PixelConditionsConfig.py:228
PixelConditionsSummaryConfig.PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg
def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name="PixelByteStreamErrorDetectorElementStatusToolActiveOnly", **kwargs)
Definition: PixelConditionsSummaryConfig.py:67
python.PixelReadoutGeometryConfig.PixelReadoutManagerCfg
def PixelReadoutManagerCfg(flags, name="PixelReadoutManager", **kwargs)
Definition: PixelReadoutGeometryConfig.py:6
PixelConditionsSummaryConfig.PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg
def PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg(flags, name="PixelConditionsSummaryToolNoByteStreamErrorsAcriveOnly", **kwargs)
Definition: PixelConditionsSummaryConfig.py:41