ATLAS Offline Software
TTL1OverlayConfig.py
Go to the documentation of this file.
1 """Define functions for TTL1 Overlay with ComponentAccumulator
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 from LArDigitization.LArDigitizationConfig import LArOverlayTriggerDigitizationBasicCfg
10 from TileSimAlgs.TileHitToTTL1Config import TileHitToTTL1Cfg
11 
12 
13 def LArTTL1OverlayCfg(flags, name="LArTTL1Overlay", **kwargs):
14  """LArTTL1Overlay configuration using ComponentAccumulator"""
15  acc = ComponentAccumulator()
17 
18  kwargs.setdefault("BkgEmTTL1Key", f"{flags.Overlay.BkgPrefix}LArTTL1EM")
19  kwargs.setdefault("SignalEmTTL1Key", f"{flags.Overlay.SigPrefix}LArTTL1EM")
20  kwargs.setdefault("OutputEmTTL1Key", "LArTTL1EM")
21 
22  kwargs.setdefault("BkgHadTTL1Key", f"{flags.Overlay.BkgPrefix}LArTTL1HAD")
23  kwargs.setdefault("SignalHadTTL1Key", f"{flags.Overlay.SigPrefix}LArTTL1HAD")
24  kwargs.setdefault("OutputHadTTL1Key", "LArTTL1HAD")
25 
26  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
27  acc.merge(SGInputLoaderCfg(flags, [
28  f'LArTTL1Container#{kwargs["BkgEmTTL1Key"]}',
29  f'LArTTL1Container#{kwargs["BkgHadTTL1Key"]}',
30  ]))
31 
32  acc.addEventAlgo(CompFactory.LVL1.LArTTL1Overlay(name, **kwargs))
33 
34  if flags.Output.doWriteRDO:
35  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
36  acc.merge(OutputStreamCfg(flags, streamName='RDO', ItemList=[
37  'LArTTL1Container#LArTTL1EM',
38  'LArTTL1Container#LArTTL1HAD',
39  ]))
40 
41  if flags.Output.doWriteRDO_SGNL:
42  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
43  acc.merge(OutputStreamCfg(flags, streamName='RDO_SGNL', ItemList=[
44  f'LArTTL1Container#{flags.Overlay.SigPrefix}LArTTL1EM',
45  f'LArTTL1Container#{flags.Overlay.SigPrefix}LArTTL1HAD',
46  ]))
47 
48  return acc
49 
50 
51 def TileTTL1OverlayCfg(flags, name="TileTTL1Overlay", **kwargs):
52  """TileTTL1Overlay configuration using ComponentAccumulator"""
53  acc = ComponentAccumulator()
54  acc.merge(TileHitToTTL1Cfg(flags))
55 
56  kwargs.setdefault("BkgTileTTL1Key", f"{flags.Overlay.BkgPrefix}TileTTL1Cnt")
57  kwargs.setdefault("SignalTileTTL1Key", f"{flags.Overlay.SigPrefix}TileTTL1Cnt")
58  kwargs.setdefault("OutputTileTTL1Key", "TileTTL1Cnt")
59  inputs = [f'TileTTL1Container#{kwargs["BkgTileTTL1Key"]}']
60 
61  if flags.Detector.EnableMBTS:
62  kwargs.setdefault("BkgTileMBTSTTL1Key", f"{flags.Overlay.BkgPrefix}TileTTL1MBTS")
63  kwargs.setdefault("SignalTileMBTSTTL1Key", f"{flags.Overlay.SigPrefix}TileTTL1MBTS")
64  kwargs.setdefault("OutputTileMBTSTTL1Key", "TileTTL1MBTS")
65  inputs.append(f'TileTTL1Container#{kwargs["BkgTileMBTSTTL1Key"]}')
66  else:
67  kwargs.setdefault("BkgTileMBTSTTL1Key", "")
68  kwargs.setdefault("SignalTileMBTSTTL1Key", "")
69  kwargs.setdefault("OutputTileMBTSTTL1Key", "")
70 
71  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
72  acc.merge(SGInputLoaderCfg(flags, inputs))
73 
74  acc.addEventAlgo(CompFactory.LVL1.TileTTL1Overlay(name, **kwargs))
75 
76  if flags.Output.doWriteRDO:
77  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
78  acc.merge(OutputStreamCfg(flags, streamName='RDO', ItemList=[
79  'TileTTL1Container#TileTTL1Cnt',
80  ]))
81  if flags.Detector.EnableMBTS:
82  acc.merge(OutputStreamCfg(flags, streamName='RDO', ItemList=[
83  'TileTTL1Container#TileTTL1MBTS',
84  ]))
85 
86  if flags.Output.doWriteRDO_SGNL:
87  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
88  acc.merge(OutputStreamCfg(flags, streamName='RDO_SGNL', ItemList=[
89  f'TileTTL1Container#{flags.Overlay.SigPrefix}TileTTL1Cnt',
90  ]))
91  if flags.Detector.EnableMBTS:
92  acc.merge(OutputStreamCfg(flags, streamName='RDO_SGNL', ItemList=[
93  f'TileTTL1Container#{flags.Overlay.SigPrefix}TileTTL1MBTS',
94  ]))
95 
96  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
TTL1OverlayConfig.LArTTL1OverlayCfg
def LArTTL1OverlayCfg(flags, name="LArTTL1Overlay", **kwargs)
Definition: TTL1OverlayConfig.py:13
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
TTL1OverlayConfig.TileTTL1OverlayCfg
def TileTTL1OverlayCfg(flags, name="TileTTL1Overlay", **kwargs)
Definition: TTL1OverlayConfig.py:51
python.LArDigitizationConfig.LArOverlayTriggerDigitizationBasicCfg
def LArOverlayTriggerDigitizationBasicCfg(flags, **kwargs)
Definition: LArDigitizationConfig.py:385
TileHitToTTL1Config.TileHitToTTL1Cfg
def TileHitToTTL1Cfg(flags, **kwargs)
Definition: TileHitToTTL1Config.py:11