7from argparse
import ArgumentParser
8from AthenaCommon.Logging
import log
9from AthenaConfiguration.AllConfigFlags
import initConfigFlags
10from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
13parser = ArgumentParser(
"RunMaterialValidation.py")
14parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
15 help=
"Specify the list of detectors")
16parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
17 help=
"Use local geometry Xml files")
18parser.add_argument(
"--geoModelSqLiteFile", default =
"", help=
"Read geometry from sqlite file")
19parser.add_argument(
"-V",
"--verboseAccumulators", default=
False,
21 help=
"Print full details of the AlgSequence")
22parser.add_argument(
"-S",
"--verboseStoreGate", default=
False,
24 help=
"Dump the StoreGate(s) each event iteration")
25parser.add_argument(
"--maxEvents",default=10, type=int,
26 help=
"The number of events to run. 0 skips execution")
27parser.add_argument(
"--skipEvents",default=0, type=int,
28 help=
"The number of events to skip")
29from AthenaConfiguration.TestDefaults
import defaultGeometryTags
30parser.add_argument(
"--geometrytag",default=defaultGeometryTags.RUN4, type=str,
31 help=
"The geometry tag to use")
35args = parser.parse_args()
39print(
"----RunMaterialValidation for ITk geometry----")
41print(
"Using Geometry Tag: "+args.geometrytag)
43 print(
"...overridden by local Geometry Xml files")
45 print(
"Running complete detector")
47 print(
"Running with: {}".format(
", ".join(args.detectors)))
51flags = initConfigFlags()
53 flags.ITk.Geometry.AllLocal =
True
57flags.GeoModel.AtlasVersion = args.geometrytag
58flags.IOVDb.GlobalTag =
"OFLCOND-SIM-00-00-00"
59flags.GeoModel.Align.Dynamic =
False
62flags.Concurrency.NumThreads = 1
63flags.Concurrency.NumConcurrentEvents = 1
65from AthenaConfiguration.DetectorConfigFlags
import getEnabledDetectors, setupDetectorFlags
66from AthenaConfiguration.AutoConfigFlags
import getDefaultDetectors
68if args.geoModelSqLiteFile:
69 flags.GeoModel.SQLiteDB =
True
70 flags.GeoModel.SQLiteDBFullPath = args.geoModelSqLiteFile
72 from AthenaConfiguration.Enums
import LHCPeriod
73 flags.GeoModel.Run = LHCPeriod.Run4
75 defaultDetectors = [
'ITkPixel',
'ITkStrip']
76 detectors = args.detectors
if 'detectors' in args
and args.detectors
else defaultDetectors
77 detectors.append(
'Bpipe')
78 setupDetectorFlags(flags, detectors, toggle_geometry=
True)
80flags.Acts.TrackingGeometry.UseBlueprint =
True
82flags.Exec.SkipEvents = args.skipEvents
84log.debug(
'Lock config flags now.')
88acc = MainServicesCfg(flags)
91if args.verboseAccumulators:
92 acc.printConfig(withDetails=
True)
93if args.verboseStoreGate:
94 acc.getService(
"StoreGateSvc").Dump =
True
96log.debug(
'Dumping of ConfigFlags now.')
99from ActsConfig.ActsMaterialConfig
import MaterialValidationCfg
100acc.merge(MaterialValidationCfg(flags,
102 MaterialTrackCollectionKey=
"OutputMaterialTracks"))
104acc.printConfig(withDetails =
True, summariseProps =
True)
106acc.run(maxEvents=args.maxEvents)
void print(char *figname, TCanvas *c1)