ATLAS Offline Software
TileDigitizationConfig.py
Go to the documentation of this file.
1 """Combined Tile Digitization functions
2 
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.Enums import ProductionStep
7 from AthenaConfiguration.Enums import LHCPeriod
8 from TileConfiguration.TileConfigFlags import TileRunType
9 
11  """Return ComponentAccumulator with standard Tile Trigger Digitization configuration"""
12 
13  from TileSimAlgs.TileHitToTTL1Config import TileHitToTTL1OutputCfg
14  acc = TileHitToTTL1OutputCfg(flags)
15 
16  if flags.GeoModel.Run > LHCPeriod.Run1:
17  from TileSimAlgs.TileMuonReceiverConfig import TilePulseForTileMuonReceiverOutputCfg
18  acc.merge( TilePulseForTileMuonReceiverOutputCfg(flags) )
19 
20  from TileSimAlgs.TileMuonReceiverDecisionConfig import TileMuonReceiverDecisionOutputCfg
21  acc.merge( TileMuonReceiverDecisionOutputCfg(flags) )
22 
23  from TileL2Algs.TileL2Config import TileRawChannelToL2OutputCfg
24  acc.merge( TileRawChannelToL2OutputCfg(flags, streamName = 'RDO') )
25 
26  return acc
27 
28 
30  """Return ComponentAccumulator with Overlay Tile Trigger Digitization configuration"""
31  acc = ComponentAccumulator()
32 
33  if flags.GeoModel.Run > LHCPeriod.Run1:
34  from TileSimAlgs.TileMuonReceiverConfig import TilePulseForTileMuonReceiverOutputCfg
35  acc.merge( TilePulseForTileMuonReceiverOutputCfg(flags) )
36 
37  from TileSimAlgs.TileMuonReceiverDecisionConfig import TileMuonReceiverDecisionOutputCfg
38  acc.merge( TileMuonReceiverDecisionOutputCfg(flags) )
39 
40  from TileL2Algs.TileL2Config import TileRawChannelToL2OutputCfg
41  acc.merge( TileRawChannelToL2OutputCfg(flags, streamName = 'RDO') )
42 
43  return acc
44 
45 
47  """Return ComponentAccumulator with standard Tile Digitization configuration"""
48 
49  from TileSimAlgs.TileDigitsMakerConfig import TileDigitsMakerOutputCfg
50  acc = TileDigitsMakerOutputCfg(flags)
51 
52  if flags.Common.ProductionStep != ProductionStep.PileUpPresampling and flags.Output.doWriteRDO:
53  from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerOutputCfg
54  acc.merge( TileRawChannelMakerOutputCfg(flags, streamName = 'RDO') )
55  else:
56  from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerCfg
57  acc.merge( TileRawChannelMakerCfg(flags) )
58 
59  if flags.Digitization.EnableCaloHSTruthRecoInputs:
60  if flags.Output.doWriteRDO:
61  from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerDigiHSTruthOutputCfg
62  acc.merge( TileRawChannelMakerDigiHSTruthOutputCfg(flags, streamName = 'RDO') )
63  else:
64  from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerDigiHSTruthCfg
65  acc.merge( TileRawChannelMakerDigiHSTruthCfg(flags) )
66 
67  return acc
68 
69 
70 
71 if __name__ == "__main__":
72 
73  from AthenaConfiguration.AllConfigFlags import initConfigFlags
74  from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultTestFiles
75  from AthenaCommon.Logging import log
76  from AthenaCommon.Constants import DEBUG
77 
78  # Test setup
79  log.setLevel(DEBUG)
80 
81  flags = initConfigFlags()
82  flags.Input.Files = defaultTestFiles.HITS_RUN2
83  flags.Tile.RunType = TileRunType.PHY
84  flags.Output.RDOFileName = 'myRDO-TileDigitization.pool.root'
85  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_MC
86  flags.Digitization.PileUp = False
87 
88  flags.fillFromArgs()
89 
90  flags.lock()
91  flags.dump()
92 
93  # Construct our accumulator to run
94  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
95  acc = MainServicesCfg(flags)
96 
97  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
98  acc.merge(PoolReadCfg(flags))
99 
100  if 'EventInfo' not in flags.Input.Collections:
101  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
102  acc.merge(EventInfoCnvAlgCfg(flags,
103  inputKey='McEventInfo',
104  outputKey='EventInfo'))
105 
106  acc.merge( TileDigitizationCfg(flags) )
107  acc.merge( TileTriggerDigitizationCfg(flags) )
108 
109  acc.printConfig(withDetails = True, summariseProps = True)
110  acc.store( open('TileDigitization.pkl','wb') )
111 
112  sc = acc.run(maxEvents=3)
113  # Success should be 0
114  import sys
115  sys.exit(not sc.isSuccess())
TileMuonReceiverConfig.TilePulseForTileMuonReceiverOutputCfg
def TilePulseForTileMuonReceiverOutputCfg(flags, **kwargs)
Definition: TileMuonReceiverConfig.py:93
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TileRawChannelMakerConfig.TileRawChannelMakerOutputCfg
def TileRawChannelMakerOutputCfg(flags, streamName='ESD', **kwargs)
Definition: TileRawChannelMakerConfig.py:131
TileDigitizationConfig.TileTriggerDigitizationCfg
def TileTriggerDigitizationCfg(flags)
Definition: TileDigitizationConfig.py:10
TileMuonReceiverDecisionConfig.TileMuonReceiverDecisionOutputCfg
def TileMuonReceiverDecisionOutputCfg(flags, **kwargs)
Definition: TileMuonReceiverDecisionConfig.py:48
TileL2Config.TileRawChannelToL2OutputCfg
def TileRawChannelToL2OutputCfg(flags, streamName='RDO', **kwargs)
Definition: TileL2Config.py:72
TileDigitizationConfig.TileOverlayTriggerDigitizationCfg
def TileOverlayTriggerDigitizationCfg(flags)
Definition: TileDigitizationConfig.py:29
TileRawChannelMakerConfig.TileRawChannelMakerDigiHSTruthCfg
def TileRawChannelMakerDigiHSTruthCfg(flags, **kwargs)
Definition: TileRawChannelMakerConfig.py:89
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:252
Constants
some useful constants -------------------------------------------------—
TileDigitsMakerConfig.TileDigitsMakerOutputCfg
def TileDigitsMakerOutputCfg(flags, **kwargs)
Definition: TileDigitsMakerConfig.py:116
TileDigitizationConfig.TileDigitizationCfg
def TileDigitizationCfg(flags)
Definition: TileDigitizationConfig.py:46
Trk::open
@ open
Definition: BinningType.h:40
TileHitToTTL1Config.TileHitToTTL1OutputCfg
def TileHitToTTL1OutputCfg(flags, **kwargs)
Definition: TileHitToTTL1Config.py:115
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileRawChannelMakerConfig.TileRawChannelMakerDigiHSTruthOutputCfg
def TileRawChannelMakerDigiHSTruthOutputCfg(flags, streamName='ESD', **kwargs)
Definition: TileRawChannelMakerConfig.py:145
TileRawChannelMakerConfig.TileRawChannelMakerCfg
def TileRawChannelMakerCfg(flags, **kwargs)
Definition: TileRawChannelMakerConfig.py:10
python.xAODEventInfoCnvConfig.EventInfoCnvAlgCfg
def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg", inputKey="McEventInfo", outputKey="EventInfo", disableBeamSpot=False, **kwargs)
Definition: xAODEventInfoCnvConfig.py:11
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69