4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
7 from argparse
import ArgumentParser
9 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
10 from AthenaConfiguration.Enums
import ProductionStep
13 parser = ArgumentParser(
"RunRDOAnalysis.py")
14 parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
15 help=
"Specify the list of detectors")
16 parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
17 help=
"Use local geometry XML files")
18 parser.add_argument(
"-n",
"--maxEvents", default=-1, type=int,
19 help=
"The number of events to run. -1 runs all events.")
20 parser.add_argument(
"-i",
"--input",
21 help=
"The input RDO file to use")
22 parser.add_argument(
"-p",
"--presampling", default=
False, action=
"store_true",
23 help=
"Run on presampling RDO")
24 args = parser.parse_args()
28 print(
"----RDOAnalysis----")
31 print(
"Using local Geometry XML files")
32 print(f
"Input file: {args.input}")
33 if not args.detectors:
34 print(
"Running complete detector")
41 flags.Input.Files = [args.input]
43 flags.ITk.Geometry.AllLocal =
True
45 flags.Common.ProductionStep = ProductionStep.PileUpPresampling
46 flags.Output.HISTFileName =
'RDOAnalysis.root'
48 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
54 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
56 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
58 from RDOAnalysis.RDOAnalysisConfig
import RDOAnalysisCfg
62 sc = acc.run(maxEvents=args.maxEvents)
65 sys.exit(
not sc.isSuccess())