ATLAS Offline Software
PLR_OverlayConfig.py
Go to the documentation of this file.
1 """Define methods to construct configured PLR overlay algorithms
2 
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 """
5 
6 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 
9 
10 def PLR_OverlayAlgCfg(flags, name="PLR_Overlay", **kwargs):
11  """Return a ComponentAccumulator for PLR Overlay algorithm"""
12  acc = ComponentAccumulator()
13 
14  kwargs.setdefault("BkgInputKey", f"{flags.Overlay.BkgPrefix}PLR_RDOs")
15  kwargs.setdefault("SignalInputKey", f"{flags.Overlay.SigPrefix}PLR_RDOs")
16  kwargs.setdefault("OutputKey", "PLR_RDOs")
17 
18  if not flags.Overlay.DataOverlay:
19  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
20  acc.merge(SGInputLoaderCfg(flags, [f'PixelRDO_Container#{kwargs["BkgInputKey"]}']))
21 
22  # Do PLR overlay
23  acc.addEventAlgo(CompFactory.PixelOverlay(name, **kwargs))
24 
25  # Setup output
26  if flags.Output.doWriteRDO:
27  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
28  acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[
29  "PixelRDO_Container#PLR_RDOs"
30  ]))
31 
32  if flags.Overlay.DataOverlay:
33  acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[
34  "IDCInDetBSErrContainer#PLR_ByteStreamErrs"
35  ]))
36 
37  if flags.Output.doWriteRDO_SGNL:
38  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
39  acc.merge(OutputStreamCfg(flags, "RDO_SGNL", ItemList=[
40  f"PixelRDO_Container#{flags.Overlay.SigPrefix}PLR_RDOs"
41  ]))
42 
43  return acc
44 
45 
46 def PLR_TruthOverlayCfg(flags, name="PLR_SDOOverlay", **kwargs):
47  """Return a ComponentAccumulator for the PLR SDO overlay algorithm"""
48  acc = ComponentAccumulator()
49 
50  # We do not need background PLR SDOs
51  kwargs.setdefault("BkgInputKey", "")
52 
53  kwargs.setdefault("SignalInputKey", f"{flags.Overlay.SigPrefix}PLR_SDO_Map")
54  kwargs.setdefault("OutputKey", "PLR_SDO_Map")
55 
56  # Do PLR truth overlay
57  acc.addEventAlgo(CompFactory.InDetSDOOverlay(name, **kwargs))
58 
59  # Setup output
60  if flags.Output.doWriteRDO:
61  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
62  acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[
63  "InDetSimDataCollection#PLR_SDO_Map"
64  ]))
65 
66  if flags.Output.doWriteRDO_SGNL:
67  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
68  acc.merge(OutputStreamCfg(flags, "RDO_SGNL", ItemList=[
69  f"InDetSimDataCollection#{flags.Overlay.SigPrefix}PLR_SDO_Map"
70  ]))
71 
72  return acc
73 
74 
75 def PLR_OverlayCfg(flags):
76  """Configure and return a ComponentAccumulator for PLR overlay"""
77  acc = ComponentAccumulator()
78 
79  # Add PLR overlay digitization algorithm
80  from PixelDigitization.PLR_DigitizationConfig import PLR_OverlayDigitizationBasicCfg
81  acc.merge(PLR_OverlayDigitizationBasicCfg(flags))
82  # Add PLR overlay algorithm
83  acc.merge(PLR_OverlayAlgCfg(flags))
84  # Add PLR truth overlay
85  if flags.Digitization.EnableTruth:
86  acc.merge(PLR_TruthOverlayCfg(flags))
87 
88  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
PLR_DigitizationConfig.PLR_OverlayDigitizationBasicCfg
def PLR_OverlayDigitizationBasicCfg(flags, **kwargs)
Definition: PLR_DigitizationConfig.py:224
PLR_OverlayConfig.PLR_TruthOverlayCfg
def PLR_TruthOverlayCfg(flags, name="PLR_SDOOverlay", **kwargs)
Definition: PLR_OverlayConfig.py:46
PLR_OverlayConfig.PLR_OverlayCfg
def PLR_OverlayCfg(flags)
Definition: PLR_OverlayConfig.py:75
PLR_OverlayConfig.PLR_OverlayAlgCfg
def PLR_OverlayAlgCfg(flags, name="PLR_Overlay", **kwargs)
Definition: PLR_OverlayConfig.py:10