5Run material mapping for tracking geometry.
6Uses as MaterialStepsCollections as input.
9from AthenaCommon.Logging
import log
10from argparse
import ArgumentParser
11from AthenaConfiguration.AllConfigFlags
import initConfigFlags
14parser = ArgumentParser(
"RunMaterialMappingITk.py")
15parser.add_argument(
"detectors", metavar=
"detectors", type=str, nargs=
"*",
16 help=
"Specify the list of detectors")
17parser.add_argument(
"--localgeo", default=
False, action=
"store_true",
18 help=
"Use local geometry Xml files")
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(
"--geometrytag",default=
"ATLAS-P2-RUN4-03-00-00", type=str,
28 help=
"The geometry tag to use")
29parser.add_argument(
"--inputfile",
30 default=
"MaterialStepCollection.root",
31 help=
"The input material step file to use")
32args = parser.parse_args()
35print(
"----MaterialMapping for ITk geometry----")
37print(
"Using Geometry Tag: "+args.geometrytag)
39 print(
"...overridden by local Geometry Xml files")
40print(
"Input File:"+args.inputfile)
42 print(
"Running complete detector")
44 print(
"Running with: {}".format(
", ".join(args.detectors)))
47flags = initConfigFlags()
48flags.IOVDb.DBConnection = f
'sqlite://;schema={flags.ITk.trackingGeometry.localDatabaseName};dbname=OFLP200'
52if 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')
57flags.Input.isMC =
True
60flags.Input.Files = glob.glob(args.inputfile)
63 flags.ITk.Geometry.AllLocal =
True
65from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
66detectors = args.detectors
if 'detectors' in args
and args.detectors
else [
'ITkPixel',
'ITkStrip',
'HGTD']
67detectors.append(
'Bpipe')
68setupDetectorFlags(flags, detectors, toggle_geometry=
True)
70flags.GeoModel.AtlasVersion = args.geometrytag
71flags.IOVDb.GlobalTag =
"OFLCOND-SIM-00-00-00"
72flags.GeoModel.Align.Dynamic =
False
73flags.TrackingGeometry.MaterialSource =
"None"
75flags.Detector.GeometryCalo =
False
76flags.Detector.GeometryMuon =
False
79flags.Concurrency.NumThreads = 1
80flags.Concurrency.NumConcurrentEvents = 1
82log.debug(
'Lock config flags now.')
85from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
86cfg=MainServicesCfg(flags)
89if args.verboseAccumulators:
90 cfg.printConfig(withDetails=
True)
91if args.verboseStoreGate:
92 cfg.getService(
"StoreGateSvc").Dump =
True
94log.debug(
'Dumping of ConfigFlags now.')
97from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
98cfg.merge(PoolReadCfg(flags))
100from TrkDetDescrAlgs.TrkDetDescrAlgsConfig
import ITkMaterialMappingCfg
101cfg.merge(ITkMaterialMappingCfg(flags,
102 name=
"ITkMaterialMapping"))
104cfg.printConfig(withDetails =
True, summariseProps =
True)
106events = args.maxEvents
109cfg.run(maxEvents=events)
void print(char *figname, TCanvas *c1)