5 Run material mapping for tracking geometry.
6 Uses as MaterialStepsCollections as input.
9 from AthenaCommon.Logging
import log
10 from argparse
import ArgumentParser
11 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
14 parser = ArgumentParser(
"RunMaterialMappingITk.py")
15 parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
16 help=
"Specify the list of detectors")
17 parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
18 help=
"Use local geometry Xml files")
19 parser.add_argument(
"-V",
"--verboseAccumulators", default=
False,
21 help=
"Print full details of the AlgSequence")
22 parser.add_argument(
"-S",
"--verboseStoreGate", default=
False,
24 help=
"Dump the StoreGate(s) each event iteration")
25 parser.add_argument(
"--maxEvents",default=10, type=int,
26 help=
"The number of events to run. 0 skips execution")
27 parser.add_argument(
"--geometrytag",default=
"ATLAS-P2-RUN4-03-00-00", type=str,
28 help=
"The geometry tag to use")
29 parser.add_argument(
"--inputfile",
30 default=
"MaterialStepCollection.root",
31 help=
"The input material step file to use")
32 args = parser.parse_args()
35 print(
"----MaterialMapping for ITk geometry----")
37 print(
"Using Geometry Tag: "+args.geometrytag)
39 print(
"...overridden by local Geometry Xml files")
40 print(
"Input File:"+args.inputfile)
41 if not args.detectors:
42 print(
"Running complete detector")
48 flags.IOVDb.DBConnection = f
'sqlite://;schema={flags.ITk.trackingGeometry.localDatabaseName};dbname=OFLP200'
52 if os.path.exists(
'./PoolFileCatalog.xml') :
53 print(
'[!] PoolFileCatalog exists in the run directory (may use old PFN!)')
54 print(
'[>] Deleting it now !')
55 os.remove(
'./PoolFileCatalog.xml')
57 flags.Input.isMC =
True
60 flags.Input.Files = glob.glob(args.inputfile)
63 flags.ITk.Geometry.AllLocal =
True
65 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
66 detectors = args.detectors
if 'detectors' in args
and args.detectors
else [
'ITkPixel',
'ITkStrip',
'HGTD']
67 detectors.append(
'Bpipe')
70 flags.GeoModel.AtlasVersion = args.geometrytag
71 flags.IOVDb.GlobalTag =
"OFLCOND-SIM-00-00-00"
72 flags.GeoModel.Align.Dynamic =
False
73 flags.TrackingGeometry.MaterialSource =
"None"
75 flags.Detector.GeometryCalo =
False
76 flags.Detector.GeometryMuon =
False
79 flags.Concurrency.NumThreads = 1
80 flags.Concurrency.NumConcurrentEvents = 1
82 log.debug(
'Lock config flags now.')
85 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
89 if args.verboseAccumulators:
90 cfg.printConfig(withDetails=
True)
91 if args.verboseStoreGate:
92 cfg.getService(
"StoreGateSvc").Dump =
True
94 log.debug(
'Dumping of ConfigFlags now.')
97 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
100 from TrkDetDescrAlgs.TrkDetDescrAlgsConfig
import ITkMaterialMappingCfg
102 name=
"ITkMaterialMapping"))
104 cfg.printConfig(withDetails =
True, summariseProps =
True)
106 events = args.maxEvents
109 cfg.run(maxEvents=events)