6 Run material validation for ACTS tracking geometry
9 from AthenaCommon.Logging
import log
10 from argparse
import ArgumentParser
11 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
14 parser = ArgumentParser(
"RunActsMaterialValidation.py")
15 parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
16 help=
"Specify the list of detectors")
17 parser.add_argument(
"-M",
"--material", required=
True, type=str,
18 help=
"The geometry file material source. It can be \"Default\", a path to a local JSON file or \"None\"")
19 parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
20 help=
"Use local geometry Xml files")
21 parser.add_argument(
"-V",
"--verboseAccumulators", default=
False,
23 help=
"Print full details of the AlgSequence")
24 parser.add_argument(
"-S",
"--verboseStoreGate", default=
False,
26 help=
"Dump the StoreGate(s) each event iteration")
27 parser.add_argument(
"--maxEvents",default=10, type=int,
28 help=
"The number of events to run. 0 skips execution")
29 parser.add_argument(
"--geometrytag",default=
"ATLAS-P2-RUN4-04-00-00", type=str,
30 help=
"The geometry tag to use")
32 args = parser.parse_args()
35 print(
"----Material Validation for ACTS Tracking Geometry----")
37 print(
"Using Geometry Tag: "+args.geometrytag)
39 print(
"...overridden by local Geometry Xml files")
40 if not args.detectors:
41 print(
"Running complete detector")
48 flags.Input.isMC =
True
50 flags.Input.Files = []
53 flags.ITk.Geometry.AllLocal =
True
55 flags.GeoModel.AtlasVersion = args.geometrytag
57 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorsFromList
58 detectors = args.detectors
if 'detectors' in args
and args.detectors
else [
'ITkPixel',
'ITkStrip',
'HGTD']
59 detectors.append(
'Bpipe')
62 flags.IOVDb.GlobalTag =
"OFLCOND-SIM-00-00-00"
63 flags.GeoModel.Align.Dynamic =
False
64 flags.Acts.TrackingGeometry.MaterialSource = args.material
65 if flags.Acts.TrackingGeometry.MaterialSource !=
"Default":
66 flags.Acts.TrackingGeometry.MaterialCalibrationFolder =
"."
68 flags.Detector.GeometryCalo =
False
69 flags.Detector.GeometryMuon =
False
72 flags.Concurrency.NumThreads = 1
73 flags.Concurrency.NumConcurrentEvents = 1
75 log.debug(
'Lock config flags now.')
78 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
82 if args.verboseAccumulators:
83 cfg.printConfig(withDetails=
True)
84 if args.verboseStoreGate:
85 cfg.getService(
"StoreGateSvc").Dump =
True
87 log.debug(
'Dumping of ConfigFlags now.')
90 from ActsConfig.ActsGeometryConfig
import ActsExtrapolationToolCfg
92 "ActsExtrapolationTool",
93 InteractionMultiScatering =
True,
94 InteractionEloss =
True,
95 InteractionRecord =
True))
97 from ActsConfig.ActsGeometryConfig
import ActsExtrapolationAlgCfg
99 "ActsExtrapolationAlg",
100 NParticlesPerEvent=
int(1e4),
103 WriteMaterialTracks =
True,
104 ExtrapolationTool=extrapol))
106 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
109 cfg.printConfig(withDetails =
True, summariseProps =
True)
111 cfg.run(maxEvents=args.maxEvents)