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 # Allowing the pixel states bellow to reconstruct tracks
29 pixel_states_active = [ 'READY', 'ON', 'UNDEFINED', 'UNKNOWN', 'TRANSITION' ] # 23.06.2026 'DISABLED', 'LOCKED_OUT', 'OFF' states that 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
41def 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
48def 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
54def PixelByteStreamErrorDetectorElementStatusToolCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusTool",**kwargs) :
55 acc = ComponentAccumulator()
56 if (not flags.Input.isMC and flags.Input.Format is Format.BS) or flags.Overlay.DataOverlay:
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
67def PixelByteStreamErrorDetectorElementStatusToolActiveOnlyCfg(flags, name = "PixelByteStreamErrorDetectorElementStatusToolActiveOnly",**kwargs) :
68 kwargs.setdefault("ActiveOnly", True)
69 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)