4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
7 from argparse
import ArgumentParser
10 parser = ArgumentParser(
"HitAnalysis.py")
11 parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
12 help=
"Specify the list of detectors")
13 parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
14 help=
"Use local geometry XML files")
15 parser.add_argument(
"-n",
"--maxEvents", default=-1, type=int,
16 help=
"The number of events to run. -1 runs all events.")
17 parser.add_argument(
"-i",
"--input",
18 help=
"The input HITS file to use")
19 args = parser.parse_args()
23 print(
"----HitAnalysis----")
26 print(
"Using local Geometry XML files")
27 print(f
"Input file: {args.input}")
28 if not args.detectors:
29 print(
"Running complete detector")
35 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
36 from AthenaConfiguration.Enums
import ProductionStep
38 flags.Common.ProductionStep = ProductionStep.Simulation
39 flags.Input.Files = [args.input]
41 flags.ITk.Geometry.AllLocal =
True
42 flags.Output.HISTFileName =
'SiHitAnalysis.root'
43 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
48 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
50 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
52 from HitAnalysis.HitAnalysisConfig
import SiHitAnalysisCfg
56 sc = acc.run(maxEvents=args.maxEvents)
59 sys.exit(
not sc.isSuccess())