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