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-2025 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.Overlay.DataOverlay and
24 flags.Common.ProductionStep is not ProductionStep.MinbiasPreprocessing and
25 not flags.Overlay.ByteStream):
26 from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
27 acc.merge(SGInputLoaderCfg(flags, ["IDCInDetBSErrContainer#PixelByteStreamErrs"]))
28
29 if flags.InDet.usePixelDCS:
30 pixel_states_active = [ 'READY', 'ON' ] # 'UNKNOWN', 'TRANSITION', 'UNDEFINED', 'DISABLED', 'LOCKED_OUT', 'OFF' states should be masked.
31 if flags.InDet.useHVActiveStates:
32 pixel_states_active = [ 'READY', 'ON', 'UNDEFINED' ] # 'UNKNOWN', 'TRANSITION', 'DISABLED', 'LOCKED_OUT', 'OFF' states should be masked.
33
34 kwargs.setdefault("IsActiveStates", pixel_states_active)
35 kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ])
36
37 from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementCondAlgCfg
38 acc.merge(PixelDetectorElementCondAlgCfg(flags))
39 kwargs.setdefault( "PixelDetEleCollKey", "PixelDetectorElementCollection")
40
41 acc.setPrivateTools(CompFactory.PixelConditionsSummaryTool(name=name + "Tool", **kwargs))
42 return acc
43
44def PixelConditionsSummaryToolNoByteStreamErrorsActiveOnlyCfg(flags,name = "PixelConditionsSummaryToolNoByteStreamErrorsAcriveOnly", **kwargs) :
45 kwargs.setdefault("ActiveOnly", True)
46 kwargs.setdefault("UseByteStreamFEI4", False)
47 kwargs.setdefault("UseByteStreamFEI3", False)
48 kwargs.setdefault("UseByteStreamRD53", False)
49 return PixelConditionsSummaryCfg(flags, name, **kwargs)
50
51def PixelActiveDetectorElementStatusToolCfg(flags,name = "PixelActiveDetectorElementStatusTool",**kwargs) :
52 acc = ComponentAccumulator()
53 kwargs.setdefault("IsActiveStatus", [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] )
54 acc.setPrivateTools( CompFactory.PixelActiveDetectorElementStatusTool(name, **kwargs) )
55 return acc
56
57def PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusTool",**kwargs) :
58 acc = ComponentAccumulator()
59 if (not flags.Input.isMC and flags.Input.Format is Format.BS) or flags.Overlay.DataOverlay:
60 kwargs.setdefault("PixelByteStreamErrs", "PixelByteStreamErrs")
61 kwargs.setdefault("UseByteStreamFEI4", True)
62 kwargs.setdefault("UseByteStreamFEI3", True)
63 kwargs.setdefault("ActiveOnly", False)
64 acc.setPrivateTools( CompFactory.PixelByteStreamErrorDetectorElementStatusTool(name, **kwargs) )
65 else :
66 kwargs.pop("ActiveOnly",False)
67 acc.setPrivateTools( CompFactory.PixelDetectorElementStatusCloneTool(name, **kwargs) )
68 return acc
69
70def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusToolActiveOnly",**kwargs) :
71 kwargs.setdefault("ActiveOnly", True)
72 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)