6 if __name__==
'__main__':
12 parser = argparse.ArgumentParser(description =
'', add_help =
False)
13 parser = argparse.ArgumentParser()
19 parser.add_argument(
'-i',
'--inputFiles', action=
'store', dest=
'inputFiles', required =
False,
20 help =
"Comma-separated list of input files (alias for --filesInput)")
22 parser.add_argument(
'-o',
'--outputFile', action=
'store', dest=
'outputFile', required =
False,
23 default =
'TrigEgammaMonitorOutput.root',
24 help =
"Histogram output.")
26 parser.add_argument(
'--nov',
'--numberOfEvents', action=
'store', dest=
'numberOfEvents', required =
False,
28 help =
"The number of events to run.")
34 parser.add_argument(
'--pidConfigPath', action=
'store', required =
False,
35 type=str, default=
'ElectronPhotonSelectorTools/trigger/rel22_20210611',
36 help =
"Electron Likelihood and Photon CB config path to use in emulated precision step.")
38 parser.add_argument(
'--dnnConfigPath', action=
'store', required =
False,
39 type=str, default=
'ElectronPhotonSelectorTools/offline/mc16_20210430',
40 help =
"Electron DNN config path to use in emulated precision step.")
42 parser.add_argument(
'--ringerConfigPath', action=
'store', required =
False,
43 type=str, default=
'RingerSelectorTools/TrigL2_20210702_r4',
44 help =
"Electron ringer config path to use in emulated fast calo step.")
48 parser.add_argument(
'--preExec', help=
'Code to execute before locking configs', default=
None)
49 parser.add_argument(
'--postExec', help=
'Code to execute after setup', default=
None)
50 parser.add_argument(
'--emulate', help=
'emulate the HLT e/g sequence', action=
'store_true')
51 parser.add_argument(
'--debug', help=
'debug mode', action=
'store_true')
58 args = parser.parse_args()
64 from PyUtils.Helpers
import ROOT6Setup
68 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
71 if args.inputFiles
is not None:
72 flags.Input.Files = args.inputFiles.split(
',')
73 flags.Input.isMC =
True
74 flags.Output.HISTFileName = args.outputFile
79 from AthenaMonitoring.DQConfigFlags
import allSteeringFlagsOff
86 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
87 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
94 from TrigEgammaEmulationTool.TrigEgammaEmulationToolConfigMT
import TrigEgammaEmulationToolConfig
95 emulator = TrigEgammaEmulationToolConfig(flags,
"EgammaEmulation")
98 emulator.PhotonCBConfigFilePath = args.pidConfigPath
99 emulator.ElectronLHConfigFilePath = args.pidConfigPath
100 emulator.ElectronCBConfigFilePath = args.pidConfigPath
101 emulator.ElectronDNNConfigFilePath = args.dnnConfigPath
102 emulator.FastCaloConfigFilePath = args.ringerConfigPath
108 from TrigEgammaMonitoring.TrigEgammaMonitorAlgorithm
import TrigEgammaMonConfig
110 cfg.merge(trigEgammaMonitorAcc)
119 trigEgammaMonitorAcc.getEventAlgo(
'EgammaEmulation').OutputLevel = 2
123 cfg.printConfig(withDetails=
False)
124 sc = cfg.run(args.numberOfEvents)
126 sys.exit(0
if sc.isSuccess()
else 1)