ATLAS Offline Software
L1CaloFEXSimCfg.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaCommon.Logging import logging
7 
8 def ReadSCellFromPoolFileCfg(flags, key='SCell'):
9  '''Configure reading SCell container from a Pool file like RDO or ESD'''
10  acc = ComponentAccumulator()
11 
12  # Ensure SCell container is in the input file
13  # TODO this needs to be uncommented once all MC files used in tests contain SCells
14  # e.g. test_trig_mc_v1DevHI_build.py
15  # assert key in flags.Input.Collections or not flags.Input.Collections, 'MC input file is required to contain SCell container'
16 
17  # Need geometry and conditions for the SCell converter from POOL
18  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
19  acc.merge(LArGMCfg(flags))
20 
21  return acc
22 
23 
24 def ReadSCellFromByteStreamCfg(flags, key='SCell', SCmask=True):
26 
27  # Geometry, conditions and cabling setup
28  from TileGeoModel.TileGMConfig import TileGMCfg
29  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
30  from LArCabling.LArCablingConfig import LArLATOMEMappingCfg
31  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
32  from LArCellRec.LArRAWtoSuperCellConfig import LArRAWtoSuperCellCfg
33  acc.merge(TileGMCfg(flags))
34  acc.merge(LArGMCfg(flags))
35  acc.merge(LArLATOMEMappingCfg(flags))
36  acc.merge(LArOnOffIdMappingSCCfg(flags))
37 
38  # Conversion from ByteStream to LArRawSCContainer
39  decoderTool = CompFactory.LArLATOMEDecoder('LArLATOMEDecoder', ProtectSourceId = True)
40  decoderAlg = CompFactory.LArRawSCDataReadingAlg('LArRawSCDataReadingAlg', LATOMEDecoder=decoderTool)
41  acc.addEventAlgo(decoderAlg)
42 
43  acc.merge(LArRAWtoSuperCellCfg(flags,mask=SCmask, SCellContainerOut=key) )
44 
45  return acc
46 
47 def eFEXTOBEtToolCfg(flags):
48  """
49  Configure the eFEX TOB Et Tool which recalculates isolation variables
50  The tool requires eTowers as inputs (add eTowerMaker algorithm)
51  """
52  acc = ComponentAccumulator()
53 
54  # had to comment this out for now, because it causes a clash with the eTowerMakerFromEfexTowers algorithm
55  # if that gets scheduled
56  #eTowerMakerAlg = CompFactory.LVL1.eTowerMakerFromSuperCells('eTowerMakerFromSuperCells')
57  #acc.addEventAlgo(eTowerMakerAlg)
58 
59  eFEXTOBEtTool = CompFactory.LVL1.eFEXTOBEtTool
60  acc.setPrivateTools(eFEXTOBEtTool())
61 
62  return acc
63 
65  '''Configuration to provide TriggerTowers as input to the Fex simulation'''
66  from AthenaConfiguration.Enums import Format
67  if flags.Input.Format is Format.POOL:
68  # For POOL files produce TT with R2TTMaker
69  from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMakerCfg
70  return Run2TriggerTowerMakerCfg(flags)
71  else:
72  # For RAW decode TT from ByteStream
73  from TrigT1CaloByteStream.LVL1CaloRun2ByteStreamConfig import LVL1CaloRun2ReadBSCfg
74  return LVL1CaloRun2ReadBSCfg(flags)
75 
76 
77 def L1CaloFEXSimCfg(flags, eFexTowerInputs = ["L1_eFexDataTowers","L1_eFexEmulatedTowers"],deadMaterialCorrections=True, outputSuffix="", simulateAltTau=False):
78  from AthenaConfiguration.Enums import Format
79 
80  if not simulateAltTau and flags.DQ.Environment == "tier0":
81  simulateAltTau = True # require alt RoI at tier0 while validating new BDT alg against heuristic
82 
83  acc = ComponentAccumulator()
84 
85  log = logging.getLogger('L1CaloFEXSimCfg')
86 
87 
88  # Configure SCell inputs
89  sCellType = flags.Trigger.L1.L1CaloSuperCellContainerName
90  if flags.Input.Format is Format.POOL:
91  # Read SCell directly from input RDO file unless not necessary
92  if 'L1_eFexEmulatedTowers' in eFexTowerInputs and "L1_eFexEmulatedTowers" not in flags.Input.Collections:
93  acc.merge(ReadSCellFromPoolFileCfg(flags,sCellType))
94  if flags.Input.isMC:
95  # wont have eFexDataTowers available so remove that if it appears in input list
96  eFexTowerInputs = [l for l in eFexTowerInputs if l != "L1_eFexDataTowers"]
97  else:
98  from AthenaConfiguration.Enums import LHCPeriod
99  if flags.GeoModel.Run is LHCPeriod.Run2:
100  # Run-2 data inputs, emulate SCells
101  from TrigT1CaloFexPerf.EmulationConfig import emulateSC_Cfg
102  acc.merge(emulateSC_Cfg(flags))
103  else:
104  # Run-3+ data inputs, decode SCells from ByteStream if needed
105  if 'L1_eFexEmulatedTowers' in eFexTowerInputs and "L1_eFexEmulatedTowers" not in flags.Input.Collections:
106  acc.merge(ReadSCellFromByteStreamCfg(flags,key=sCellType))
107 
108  # Need also TriggerTowers as input .. so reconstruct if not in input collections already
109  if "xAODTriggerTowers" not in flags.Input.Collections:
110  acc.merge(TriggerTowersInputCfg(flags))
111 
112  if 'L1_eFexEmulatedTowers' in eFexTowerInputs and "L1_eFexEmulatedTowers" not in flags.Input.Collections:
113  acc.addEventAlgo( CompFactory.LVL1.eFexTowerBuilder("L1_eFexEmulatedTowers",CaloCellContainerReadKey=sCellType,ApplyMasking=not flags.Input.isMC) ) # builds the emulated towers to use as secondary input to eTowerMaker - name has to match what it gets called in other places to avoid conflict
114 
115  if flags.Trigger.L1.doeFex:
116  if eFexTowerInputs==[]:
117  # no input specified, so use the old eTowerMaker
118  eFEXInputs = CompFactory.LVL1.eTowerMakerFromSuperCells('eTowerMakerFromSuperCells',
119  eSuperCellTowerMapperTool = CompFactory.LVL1.eSuperCellTowerMapper('eSuperCellTowerMapper', SCell=sCellType))
120  else:
121  # if primary is DataTowers, check that caloInputs are enabled (if data towers not already available). If it isn't then skip this
122  if (not flags.Trigger.L1.doCaloInputs) and eFexTowerInputs[0] == "L1_eFexDataTowers" and ("L1_eFexDataTowers" not in flags.Input.Collections):
123  if len(eFexTowerInputs)==1:
124  log.fatal("Requested L1_eFexDataTowers but Trigger.L1.doCaloInputs is False, but not secondary collection given")
125  import sys
126  sys.exit(1)
127  log.warning("Requested L1_eFexDataTowers but Trigger.L1.doCaloInputs is False, falling back to secondary")
128  eFexTowerInputs[0] = eFexTowerInputs[1]
129  eFexTowerInputs[1] = ""
130  eFEXInputs = CompFactory.LVL1.eTowerMakerFromEfexTowers('eTowerMakerFromEfexTowers')
131  eFEXInputs.InputTowers = eFexTowerInputs[0]
132  eFEXInputs.SecondaryInputTowers = eFexTowerInputs[1] if len(eFexTowerInputs) > 1 else ""
133 
134  eFEX = CompFactory.LVL1.eFEXDriver('eFEXDriver')
135  eFEX.eFEXSysSimTool = CompFactory.LVL1.eFEXSysSim('eFEXSysSimTool')
136  eFEX.eFEXSysSimTool.eFEXSimTool = CompFactory.LVL1.eFEXSim('eFEXSimTool')
137  eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool = CompFactory.LVL1.eFEXFPGA('eFEXFPGATool')
138  eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXegAlgoTool = CompFactory.LVL1.eFEXegAlgo('eFEXegAlgoTool',dmCorr=deadMaterialCorrections) # only dmCorrections in data for now
139  eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXtauAlgoTool = CompFactory.LVL1.eFEXtauAlgo("eFEXtauAlgo")
140  # To dump supercells as a decorator to the tau TOB, set
141  # eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXtauAlgoTool.DumpSuperCells = True
142  # and/or
143  # eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXtauBDTAlgoTool.DumpSuperCells = True
144  eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXtauBDTAlgoTool = CompFactory.LVL1.eFEXtauBDTAlgo("eFEXtauBDTAlgo", BDTJsonConfigPath="bdt_config_v16.json")
145  # load noise cuts and dm corrections when running on data
146  from IOVDbSvc.IOVDbSvcConfig import addFolders#, addFoldersSplitOnline
147 
148  acc.merge(addFolders(flags,"/TRIGGER/L1Calo/V1/Calibration/EfexNoiseCuts","TRIGGER_OFL" if flags.Input.isMC else "TRIGGER_ONL",className="CondAttrListCollection"))
149  eFEXInputs.NoiseCutsKey = "/TRIGGER/L1Calo/V1/Calibration/EfexNoiseCuts"
150  acc.merge(addFolders(flags,"/TRIGGER/L1Calo/V1/Calibration/EfexEnergyCalib","TRIGGER_OFL" if flags.Input.isMC else "TRIGGER_ONL",className="CondAttrListCollection")) # dmCorr from DB!
151  eFEX.eFEXSysSimTool.eFEXSimTool.eFEXFPGATool.eFEXegAlgoTool.DMCorrectionsKey = "/TRIGGER/L1Calo/V1/Calibration/EfexEnergyCalib"
152 
153  acc.addEventAlgo(eFEXInputs)
154  acc.addEventAlgo(eFEX)
155 
156  if simulateAltTau:
157  eFEX.eFEXSysSimTool.Key_eFexAltTauOutputContainer="L1_eTauRoIAlt"
158  eFEX.eFEXSysSimTool.Key_eFexAltTauxTOBOutputContainer="L1_eTauxRoIAlt"
159 
160 
161  if flags.Trigger.L1.dojFex:
162 
163  if flags.Input.Format is not Format.POOL:
164  from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import jFexInputByteStreamToolCfg
165  inputjFexTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(flags, 'jFexInputBSDecoderTool'))
166 
167  maybeMissingRobs = []
168  decoderTools = []
169 
170  for module_id in inputjFexTool.ROBIDs:
171  maybeMissingRobs.append(module_id)
172 
173  decoderTools += [inputjFexTool]
174  decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder", DecoderTools=[inputjFexTool], MaybeMissingROBs=maybeMissingRobs)
175  acc.addEventAlgo(decoderAlg)
176 
177  if "L1_jFexEmulatedTowers" not in flags.Input.Collections:
178  from L1CaloFEXAlgos.FexEmulatedTowersConfig import jFexEmulatedTowersCfg
179  acc.merge(jFexEmulatedTowersCfg(flags))
180 
181  from L1CaloFEXCond.L1CaloFEXCondConfig import jFexDBConfig
182  acc.merge(jFexDBConfig(flags))
183 
184  jFEXInputs = CompFactory.LVL1.jTowerMakerFromJfexTowers('jTowerMakerFromJfexTowers')
185  jFEXInputs.IsMC = flags.Input.isMC
186  jFEXInputs.jSuperCellTowerMapperTool = CompFactory.LVL1.jSuperCellTowerMapper('jSuperCellTowerMapper', SCell=sCellType)
187  jFEXInputs.jSuperCellTowerMapperTool.SCellMasking = not flags.Input.isMC
188  jFEX = CompFactory.LVL1.jFEXDriver('jFEXDriver')
189  jFEX.jFEXSysSimTool = CompFactory.LVL1.jFEXSysSim('jFEXSysSimTool')
190  acc.addEventAlgo(jFEXInputs)
191  acc.addEventAlgo(jFEX)
192 
193  # database reading in MC
194  jFEXCondAlg = acc.getCondAlgo("jFEXCondAlgo")
195  jFEXCondAlg.IsMC = flags.Input.isMC
196  jFEXFormTOBsTool = CompFactory.LVL1.jFEXFormTOBs('jFEXFormTOBs')
197  jFEXFormTOBsTool.IsMC = flags.Input.isMC
198 
199  if flags.Trigger.L1.dogFex:
200 
201  if flags.Input.Format is not Format.POOL:
202  from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import gFexInputByteStreamToolCfg
203  inputgFexTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(flags, 'gFexInputBSDecoderTool'))
204 
205  maybeMissingRobs = []
206  decoderTools = []
207 
208  for module_id in inputgFexTool.ROBIDs:
209  maybeMissingRobs.append(module_id)
210 
211  decoderTools += [inputgFexTool]
212  decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder", DecoderTools=[inputgFexTool], MaybeMissingROBs=maybeMissingRobs)
213  acc.addEventAlgo(decoderAlg)
214 
215  gFEXInputs = CompFactory.LVL1.gTowerMakerFromGfexTowers('gTowerMakerFromGfexTowers')
216  gFEXInputs.IsMC = flags.Input.isMC
217  gFEXInputs.gSuperCellTowerMapperTool = CompFactory.LVL1.gSuperCellTowerMapper('gSuperCellTowerMapper', SCell=sCellType)
218  gFEXInputs.gSuperCellTowerMapperTool.SCellMasking = not flags.Input.isMC
219 
220  gFEXInputs50 = CompFactory.LVL1.gTowerMakerFromGfexTowers('gTowerMakerFromGfexTowers50')
221  gFEXInputs50.InputDataTowers = "L1_gFexDataTowers50"
222  gFEXInputs50.MyGTowers = "gTower50Container"
223  gFEXInputs50.IsMC = flags.Input.isMC
224  gFEXInputs50.gSuperCellTowerMapperTool = CompFactory.LVL1.gSuperCellTowerMapper('gSuperCellTowerMapper50', SCell=sCellType)
225  gFEXInputs50.gSuperCellTowerMapperTool.SCellMasking = not flags.Input.isMC
226 
227  gFEX = CompFactory.LVL1.gFEXDriver('gFEXDriver')
228  gFEX.gFEXSysSimTool = CompFactory.LVL1.gFEXSysSim('gFEXSysSimTool')
229  acc.addEventAlgo(gFEXInputs)
230  acc.addEventAlgo(gFEXInputs50)
231  acc.addEventAlgo(gFEX)
232 
233  if flags.Trigger.doHLT:
234  # This will be the case when the offline simulation is actually being run as part of MC
235  # as opposed to running another pass of the simulation on either an MC or data file (e.g in DAOD)
236  # Check the RoI EDM containers are registered in HLT outputs
237  from TrigEDMConfig.TriggerEDM import recordable
238  def check(key):
239  assert key==recordable(key), f'recordable() check failed for {key}'
240  if flags.Trigger.L1.doeFex:
241  check(eFEX.eFEXSysSimTool.Key_eFexEMOutputContainer)
242  check(eFEX.eFEXSysSimTool.Key_eFexTauOutputContainer)
243  if (simulateAltTau):
244  check(eFEX.eFEXSysSimTool.Key_eFexAltTauOutputContainer)
245  if flags.Trigger.L1.dojFex:
246  check(jFEX.jFEXSysSimTool.Key_jFexSRJetOutputContainer)
247  check(jFEX.jFEXSysSimTool.Key_jFexLRJetOutputContainer)
248  check(jFEX.jFEXSysSimTool.Key_jFexTauOutputContainer)
249  check(jFEX.jFEXSysSimTool.Key_jFexSumETOutputContainer)
250  check(jFEX.jFEXSysSimTool.Key_jFexMETOutputContainer)
251  check(jFEX.jFEXSysSimTool.Key_jFexFwdElOutputContainer)
252  if flags.Trigger.L1.dogFex:
253  check(gFEX.gFEXSysSimTool.Key_gFexSRJetOutputContainer)
254  check(gFEX.gFEXSysSimTool.Key_gFexLRJetOutputContainer)
255  check(gFEX.gFEXSysSimTool.Key_gFexRhoOutputContainer)
256  check(gFEX.gFEXSysSimTool.Key_gScalarEJwojOutputContainer)
257  check(gFEX.gFEXSysSimTool.Key_gMETComponentsJwojOutputContainer)
258  check(gFEX.gFEXSysSimTool.Key_gMHTComponentsJwojOutputContainer)
259  check(gFEX.gFEXSysSimTool.Key_gMSTComponentsJwojOutputContainer)
260  check(gFEX.gFEXSysSimTool.Key_gMETComponentsNoiseCutOutputContainer)
261  check(gFEX.gFEXSysSimTool.Key_gMETComponentsRmsOutputContainer)
262  check(gFEX.gFEXSysSimTool.Key_gScalarENoiseCutOutputContainer)
263  check(gFEX.gFEXSysSimTool.Key_gScalarERmsOutputContainer)
264  else:
265  # Rename outputs for monitoring resimulation to avoid clash with standard SG keys
266  def getSimHandle(key):
267  """
268  Add 'Sim' to the standard handle path and include user-specified suffix
269  """
270  key += outputSuffix
271  if not key.endswith("Sim"): key += "Sim"
272  return key
273 
274  if flags.Trigger.L1.doeFex:
275  eFEX.eFEXSysSimTool.Key_eFexEMOutputContainer=getSimHandle("L1_eEMRoI")
276  eFEX.eFEXSysSimTool.Key_eFexTauOutputContainer=getSimHandle("L1_eTauRoI")
277  eFEX.eFEXSysSimTool.Key_eFexEMxTOBOutputContainer=getSimHandle("L1_eEMxRoI")
278  eFEX.eFEXSysSimTool.Key_eFexTauxTOBOutputContainer=getSimHandle("L1_eTauxRoI")
279  if simulateAltTau:
280  eFEX.eFEXSysSimTool.Key_eFexAltTauOutputContainer=getSimHandle("L1_eTauRoIAlt")
281  eFEX.eFEXSysSimTool.Key_eFexAltTauxTOBOutputContainer=getSimHandle("L1_eTauxRoIAlt")
282 
283  if flags.Trigger.L1.dojFex:
284  jFEX.jFEXSysSimTool.Key_jFexSRJetOutputContainer=getSimHandle("L1_jFexSRJetRoI")
285  jFEX.jFEXSysSimTool.Key_jFexLRJetOutputContainer=getSimHandle("L1_jFexLRJetRoI")
286  jFEX.jFEXSysSimTool.Key_jFexTauOutputContainer=getSimHandle("L1_jFexTauRoI")
287  jFEX.jFEXSysSimTool.Key_jFexSumETOutputContainer=getSimHandle("L1_jFexSumETRoI")
288  jFEX.jFEXSysSimTool.Key_jFexMETOutputContainer=getSimHandle("L1_jFexMETRoI")
289  jFEX.jFEXSysSimTool.Key_jFexFwdElOutputContainer=getSimHandle("L1_jFexFwdElRoI")
290  jFEX.jFEXSysSimTool.Key_xTobOutKey_jJ=getSimHandle("L1_jFexSRJetxRoI")
291  jFEX.jFEXSysSimTool.Key_xTobOutKey_jLJ=getSimHandle("L1_jFexLRJetxRoI")
292  jFEX.jFEXSysSimTool.Key_xTobOutKey_jTau=getSimHandle("L1_jFexTauxRoI")
293  jFEX.jFEXSysSimTool.Key_xTobOutKey_jEM=getSimHandle("L1_jFexFwdElxRoI")
294  if flags.Trigger.L1.dogFex:
295  gFEX.gFEXSysSimTool.Key_gFexSRJetOutputContainer=getSimHandle("L1_gFexSRJetRoI")
296  gFEX.gFEXSysSimTool.Key_gFexLRJetOutputContainer=getSimHandle("L1_gFexLRJetRoI")
297  gFEX.gFEXSysSimTool.Key_gFexRhoOutputContainer=getSimHandle("L1_gFexRhoRoI")
298  gFEX.gFEXSysSimTool.Key_gScalarEJwojOutputContainer=getSimHandle("L1_gScalarEJwoj")
299  gFEX.gFEXSysSimTool.Key_gMETComponentsJwojOutputContainer=getSimHandle("L1_gMETComponentsJwoj")
300  gFEX.gFEXSysSimTool.Key_gMHTComponentsJwojOutputContainer=getSimHandle("L1_gMHTComponentsJwoj")
301  gFEX.gFEXSysSimTool.Key_gMSTComponentsJwojOutputContainer=getSimHandle("L1_gMSTComponentsJwoj")
302  gFEX.gFEXSysSimTool.Key_gMETComponentsNoiseCutOutputContainer=getSimHandle("L1_gMETComponentsNoiseCut")
303  gFEX.gFEXSysSimTool.Key_gMETComponentsRmsOutputContainer=getSimHandle("L1_gMETComponentsRms")
304  gFEX.gFEXSysSimTool.Key_gScalarENoiseCutOutputContainer=getSimHandle("L1_gScalarENoiseCut")
305  gFEX.gFEXSysSimTool.Key_gScalarERmsOutputContainer=getSimHandle("L1_gScalarERms")
306 
307  return acc
308 
309 
310 if __name__ == '__main__':
311 
314  import argparse
315  p = argparse.ArgumentParser()
316  p.add_argument('-i', '--input',
317  metavar='KEY',
318  default='ttbar',
319  help='Key of the input from TrigValInputs to be used, default=%(default)s')
320  p.add_argument('-e', '--execute',
321  action='store_true',
322  help='After building the configuration, also process a few events')
323  p.add_argument('-n', '--nevents',
324  metavar='N',
325  type=int,
326  default=25,
327  help='Number of events to process if --execute is used, default=%(default)s')
328  p.add_argument('-d', '--efexdebug',
329  action='store_true',
330  help='Activate DEBUG mode for eFEX driver .. this option is required by a unit test')
331 
332  args = p.parse_args()
333 
334 
337  from AthenaConfiguration.AllConfigFlags import initConfigFlags
338  from TrigValTools.TrigValSteering import Input
339  import os
340 
341  flags = initConfigFlags()
342  flags.Common.isOnline = True
343  flags.Input.Files = [args.input] if os.path.isfile(args.input) else Input.get_input(args.input).paths
344  if not flags.Input.isMC:
345  from AthenaConfiguration.TestDefaults import defaultGeometryTags
346  flags.GeoModel.AtlasVersion = defaultGeometryTags.autoconfigure(flags)
347  from AthenaConfiguration.Enums import LHCPeriod
348  flags.IOVDb.GlobalTag = 'CONDBR2-HLTP-2023-01' if flags.GeoModel.Run is LHCPeriod.Run3 else 'CONDBR2-HLTP-2018-04'
349  else:
350  flags.IOVDb.GlobalTag = 'OFLCOND-MC23-SDR-RUN3-05'
351  flags.Output.AODFileName = 'AOD.pool.root'
352  flags.Exec.MaxEvents = args.nevents
353  flags.Concurrency.NumThreads = 1
354  flags.Concurrency.NumConcurrentEvents = 1
355  flags.Scheduler.ShowDataDeps = True
356  flags.Scheduler.CheckDependencies = True
357  flags.Scheduler.ShowDataFlow = True
358  flags.Trigger.EDMVersion = 3
359  flags.Trigger.doLVL1 = True
360  flags.Trigger.enableL1CaloPhase1 = True
361  flags.Trigger.triggerConfig = 'FILE'
362 
363  # Enable only calo for this test
364  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
365  setupDetectorFlags(flags, ['LAr','Tile','MBTS'], toggle_geometry=True)
366 
367  flags.lock()
368 
369 
372  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
373  acc = MainServicesCfg(flags)
374 
375  from AthenaConfiguration.Enums import Format
376  if flags.Input.Format == Format.POOL:
377  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
378  acc.merge(PoolReadCfg(flags))
379  else:
380  from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
381  acc.merge(ByteStreamReadCfg(flags))
382 
383  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, generateL1Menu, createL1PrescalesFileFromMenu
384  generateL1Menu(flags)
386  acc.merge(L1ConfigSvcCfg(flags))
387 
388  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
389  FexEDMList = [
390  'xAOD::eFexEMRoIContainer#L1_eEMRoI','xAOD::eFexEMRoIAuxContainer#L1_eEMRoIAux.',
391  'xAOD::eFexTauRoIContainer#L1_eTauRoI','xAOD::eFexTauRoIAuxContainer#L1_eTauRoIAux.',
392  'xAOD::jFexTauRoIContainer#L1_jFexTauRoI','xAOD::jFexTauRoIAuxContainer#L1_jFexTauRoIAux.',
393  'xAOD::jFexSRJetRoIContainer#L1_jFexSRJetRoI','xAOD::jFexSRJetRoIAuxContainer#L1_jFexSRJetRoIAux.',
394  'xAOD::jFexLRJetRoIContainer#L1_jFexLRJetRoI','xAOD::jFexLRJetRoIAuxContainer#L1_jFexLRJetRoIAux.',
395  'xAOD::jFexMETRoIContainer#L1_jFexMETRoI','xAOD::jFexMETRoIAuxContainer#L1_jFexMETRoIAux.',
396  'xAOD::jFexSumETRoIContainer#L1_jFexSumETRoI','xAOD::jFexSumETRoIAuxContainer#L1_jFexSumETRoIAux.',
397  'xAOD::gFexJetRoIContainer#L1_gFexSRJetRoI','xAOD::gFexJetRoIAuxContainer#L1_gFexSRJetRoIAux.',
398  'xAOD::gFexJetRoIContainer#L1_gFexLRJetRoI','xAOD::gFexJetRoIAuxContainer#L1_gFexLRJetRoIAux.',
399  'xAOD::gFexJetRoIContainer#L1_gFexRhoRoI','xAOD::gFexJetRoIAuxContainer#L1_gFexRhoRoIAux.',
400  'xAOD::gFexGlobalRoIContainer#L1_gScalarEJwoj','xAOD::gFexGlobalRoIAuxContainer#L1_gScalarEJwojAux.',
401  'xAOD::gFexGlobalRoIContainer#L1_gMETComponentsJwoj','xAOD::gFexGlobalRoIAuxContainer#L1_gMETComponentsJwojAux.',
402  'xAOD::gFexGlobalRoIContainer#L1_gMHTComponentsJwoj','xAOD::gFexGlobalRoIAuxContainer#L1_gMHTComponentsJwojAux.',
403  'xAOD::gFexGlobalRoIContainer#L1_gMSTComponentsJwoj','xAOD::gFexGlobalRoIAuxContainer#L1_gMSTComponentsJwojAux.',
404  'xAOD::gFexGlobalRoIContainer#L1_gMETComponentsNoiseCut','xAOD::gFexGlobalRoIAuxContainer#L1_gMETComponentsNoiseCutAux.',
405  'xAOD::gFexGlobalRoIContainer#L1_gMETComponentsRms','xAOD::gFexGlobalRoIAuxContainer#L1_gMETComponentsRmsAux.',
406  'xAOD::gFexGlobalRoIContainer#L1_gScalarENoiseCut','xAOD::gFexGlobalRoIAuxContainer#L1_gScalarENoiseCutAux.',
407  'xAOD::gFexGlobalRoIContainer#L1_gScalarERms','xAOD::gFexGlobalRoIAuxContainer#L1_gScalarERmsAux.',
408 
409  ]
410  acc.merge(OutputStreamCfg(flags, 'AOD', ItemList=FexEDMList))
411 
412 
415  acc.merge(L1CaloFEXSimCfg(flags))
416  if args.efexdebug:
417  from AthenaCommon.Constants import DEBUG
418  acc.getEventAlgo("eFEXDriver").OutputLevel = DEBUG
419 
420 
423  with open("L1Sim.pkl", "wb") as f:
424  acc.store(f)
425  f.close()
426 
427  if args.execute:
428  sc = acc.run()
429  if sc.isFailure():
430  exit(1)
L1CaloFEXSimCfg.ReadSCellFromByteStreamCfg
def ReadSCellFromByteStreamCfg(flags, key='SCell', SCmask=True)
Definition: L1CaloFEXSimCfg.py:24
L1CaloFEXCondConfig.jFexDBConfig
def jFexDBConfig(flags, name="jFEXCondAlgo")
Definition: L1CaloFEXCondConfig.py:8
L1CaloFEXSimCfg.TriggerTowersInputCfg
def TriggerTowersInputCfg(flags)
Definition: L1CaloFEXSimCfg.py:64
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
FEXReprocessingRun3.getSimHandle
def getSimHandle(key)
Definition: FEXReprocessingRun3.py:87
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
LArRAWtoSuperCellConfig.LArRAWtoSuperCellCfg
def LArRAWtoSuperCellCfg(flags, name="LArRAWtoSuperCell", mask=True, SCellContainerOut="", SCIn="", doReco=False, bcidShift=0)
Definition: LArRAWtoSuperCellConfig.py:8
python.TrigConfigSvcCfg.createL1PrescalesFileFromMenu
def createL1PrescalesFileFromMenu(flags)
Definition: TrigConfigSvcCfg.py:165
python.TrigConfigSvcCfg.generateL1Menu
def generateL1Menu(flags)
Definition: TrigConfigSvcCfg.py:184
L1CaloFEXSimCfg.L1CaloFEXSimCfg
def L1CaloFEXSimCfg(flags, eFexTowerInputs=["L1_eFexDataTowers","L1_eFexEmulatedTowers"], deadMaterialCorrections=True, outputSuffix="", simulateAltTau=False)
Definition: L1CaloFEXSimCfg.py:77
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
LVL1CaloRun2ByteStreamConfig.LVL1CaloRun2ReadBSCfg
def LVL1CaloRun2ReadBSCfg(flags, forRoIBResultToxAOD=False)
Definition: LVL1CaloRun2ByteStreamConfig.py:121
L1CaloFEXByteStreamConfig.jFexInputByteStreamToolCfg
def jFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:232
LArCablingConfig.LArLATOMEMappingCfg
def LArLATOMEMappingCfg(configFlags)
Definition: LArCablingConfig.py:95
python.EmulationConfig.emulateSC_Cfg
def emulateSC_Cfg(flags, CellsIn="SeedLessFS")
Definition: EmulationConfig.py:3
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Constants
some useful constants -------------------------------------------------—
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
calibdata.exit
exit
Definition: calibdata.py:236
L1CaloFEXSimCfg.eFEXTOBEtToolCfg
def eFEXTOBEtToolCfg(flags)
Definition: L1CaloFEXSimCfg.py:47
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.DetectorConfigFlags.setupDetectorFlags
def setupDetectorFlags(flags, custom_list=None, use_metadata=False, toggle_geometry=False, validate_only=False, keep_beampipe=False)
Definition: DetectorConfigFlags.py:286
L1CaloFEXSimCfg.ReadSCellFromPoolFileCfg
def ReadSCellFromPoolFileCfg(flags, key='SCell')
Definition: L1CaloFEXSimCfg.py:8
L1CaloFEXByteStreamConfig.gFexInputByteStreamToolCfg
def gFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:275
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:208
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:198
Trk::open
@ open
Definition: BinningType.h:40
TrigT1CaloSimRun2Config.Run2TriggerTowerMakerCfg
def Run2TriggerTowerMakerCfg(flags, name='Run2TriggerTowerMaker25ns')
Definition: TrigT1CaloSimRun2Config.py:61
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
FexEmulatedTowersConfig.jFexEmulatedTowersCfg
def jFexEmulatedTowersCfg(flags, name="jFexEmulatedTowerMaker", writeKey="L1_jFexEmulatedTowers")
Definition: FexEmulatedTowersConfig.py:9
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:30
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
L1CaloFEXSimCfg
Definition: L1CaloFEXSimCfg.py:1
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7