6 Run material mapping for ACTS tracking geometry
9 from AthenaCommon.Logging
import log
10 from argparse
import ArgumentParser
11 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
14 parser = ArgumentParser(
"RunActsMaterialMapping.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 is expected to be a path to a valid json file. You can produce one running RunActsWriteTrackingGeometry.py for the specific geometry tag")
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")
31 parser.add_argument(
"--inputfile",
32 default=
"MaterialStepCollection.root",
33 help=
"The input material step file to use")
34 args = parser.parse_args()
37 print(
"----Material Mapping for ACTS Tracking Geometry----")
39 print(
"Using Geometry Tag: "+args.geometrytag)
41 print(
"...overridden by local Geometry Xml files")
42 if not args.detectors:
43 print(
"Running complete detector")
50 flags.Input.isMC =
True
51 flags.Input.Files = []
54 flags.ITk.Geometry.AllLocal =
True
56 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 if args.material.find(
".json") == -1:
65 from AthenaConfiguration.ComponentAccumulator
import ConfigurationError
66 raise ConfigurationError(
"Invalid material source. It must be a json file!")
67 flags.Acts.TrackingGeometry.MaterialSource = args.material
68 flags.Acts.TrackingGeometry.MaterialCalibrationFolder =
"."
70 flags.Detector.GeometryCalo =
False
71 flags.Detector.GeometryMuon =
False
74 flags.Concurrency.NumThreads = 1
75 flags.Concurrency.NumConcurrentEvents = 1
78 FileList = glob.glob(args.inputfile)
79 flags.Input.Files = FileList
81 log.debug(
'Lock config flags now.')
84 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
88 if args.verboseAccumulators:
89 cfg.printConfig(withDetails=
True)
90 if args.verboseStoreGate:
91 cfg.getService(
"StoreGateSvc").Dump =
True
93 log.debug(
'Dumping of ConfigFlags now.')
96 from ActsConfig.ActsGeometryConfig
import ActsMaterialTrackWriterSvcCfg
98 "ActsMaterialTrackWriterSvc",
99 FilePath=
"MaterialTracks_mapping.root",
100 TreeName=
"material-tracks"))
102 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
105 from ActsConfig.ActsGeometryConfig
import ActsMaterialMappingCfg
110 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
113 cfg.printConfig(withDetails =
True, summariseProps =
True)
115 events = args.maxEvents
117 events = 100000000000
118 cfg.run(maxEvents=events)