4from AthenaConfiguration.ComponentFactory
import CompFactory
5from AthenaConfiguration.AllConfigFlags
import initConfigFlags
6from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
9from AthenaCommon.Logging
import logging
12if __name__ ==
"__main__":
13 logger = logging.getLogger(
"runPU1Suppression")
14 logger.setLevel(DEBUG)
16 parser = argparse.ArgumentParser(
"Run PU1 suppression algorithm")
17 parser.add_argument(
"-n",
"--nevent", type=int, default=-1, help=
"Number of events to run over")
18 parser.add_argument(
"--input", required=
True, help=
"Path to test input file containing 256-bit TOBs, handles both hex and binary")
19 parser.add_argument(
"--rho", required=
True, help=
"Path to rho file")
20 args = parser.parse_args()
24 flags = initConfigFlags()
25 flags.Exec.MaxEvents = args.nevent
26 flags.Concurrency.NumThreads = 1
27 flags.Concurrency.NumConcurrentEvents = 1
29 flags.Trigger.doLVL1 =
True
30 flags.Trigger.enableL1CaloPhase1 =
True
31 flags.Trigger.EDMVersion = 3
32 flags.GeoModel.AtlasVersion =
"ATLAS-R3S-2021-03-01-00"
37 acc = MainServicesCfg(flags)
39 testbench = CompFactory.GlobalSim.PU1SuppTestBenchAlg(
"PU1SuppTestBenchAlg")
40 testbench.TestsFileName = args.input
41 testbench.RhoFileName = args.rho
42 testbench.OutputLevel = DEBUG
43 acc.addEventAlgo(testbench)
47 from GlobalSimAlgCfg_PU1_suppression
import GlobalSimulationAlgCfg
48 acc.merge(GlobalSimulationAlgCfg(flags))
50 if acc.run().isFailure():