ATLAS Offline Software
Loading...
Searching...
No Matches
runPU1Suppression.py
Go to the documentation of this file.
2# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3#
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaConfiguration.AllConfigFlags import initConfigFlags
6from AthenaConfiguration.MainServicesConfig import MainServicesCfg
7
8import argparse
9from AthenaCommon.Logging import logging
10from AthenaCommon.Constants import DEBUG
11
12if __name__ == "__main__":
13 logger = logging.getLogger("runPU1Suppression")
14 logger.setLevel(DEBUG)
15
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()
21
22
23
24 flags = initConfigFlags()
25 flags.Exec.MaxEvents = args.nevent
26 flags.Concurrency.NumThreads = 1
27 flags.Concurrency.NumConcurrentEvents = 1
28
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"
33
34 flags.lock()
35 flags.dump()
36
37 acc = MainServicesCfg(flags)
38
39 testbench = CompFactory.GlobalSim.PU1SuppTestBenchAlg("PU1SuppTestBenchAlg")
40 testbench.TestsFileName = args.input
41 testbench.RhoFileName = args.rho
42 testbench.OutputLevel = DEBUG
43 acc.addEventAlgo(testbench)
44
45
46 # Simulation logic
47 from GlobalSimAlgCfg_PU1_suppression import GlobalSimulationAlgCfg
48 acc.merge(GlobalSimulationAlgCfg(flags))
49
50 if acc.run().isFailure():
51 import sys
52 sys.exit(1)