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")
27from AthenaConfiguration.TestDefaults
import defaultGeometryTags
28parser.add_argument(
"--geometrytag",default=defaultGeometryTags.RUN4, type=str,
29 help=
"The geometry tag to use")
30parser.add_argument(
"--inputfile",
31 default=
"MaterialStepCollection.root",
32 help=
"The input material step file to use")
33args = parser.parse_args()
36print(
"----MaterialMapping for ITk geometry----")
38print(
"Using Geometry Tag: "+args.geometrytag)
40 print(
"...overridden by local Geometry Xml files")
41print(
"Input File:"+args.inputfile)
43 print(
"Running complete detector")
45 print(
"Running with: {}".format(
", ".join(args.detectors)))
48flags = initConfigFlags()
49flags.IOVDb.DBConnection = f
'sqlite://;schema={flags.ITk.trackingGeometry.localDatabaseName};dbname=OFLP200'
53if os.path.exists(
'./PoolFileCatalog.xml') :
54 print(
'[!] PoolFileCatalog exists in the run directory (may use old PFN!)')
55 print(
'[>] Deleting it now !')
56 os.remove(
'./PoolFileCatalog.xml')
58flags.Input.isMC =
True
61flags.Input.Files = glob.glob(args.inputfile)
64 flags.ITk.Geometry.AllLocal =
True
66from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
67detectors = args.detectors
if 'detectors' in args
and args.detectors
else [
'ITkPixel',
'ITkStrip',
'HGTD']
68detectors.append(
'Bpipe')
69setupDetectorFlags(flags, detectors, toggle_geometry=
True)
71flags.GeoModel.AtlasVersion = args.geometrytag
72flags.IOVDb.GlobalTag =
"OFLCOND-SIM-00-00-00"
73flags.GeoModel.Align.Dynamic =
False
74flags.TrackingGeometry.MaterialSource =
"None"
76flags.Detector.GeometryCalo =
False
77flags.Detector.GeometryMuon =
False
80flags.Concurrency.NumThreads = 1
81flags.Concurrency.NumConcurrentEvents = 1
83log.debug(
'Lock config flags now.')
86from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
87cfg=MainServicesCfg(flags)
90if args.verboseAccumulators:
91 cfg.printConfig(withDetails=
True)
92if args.verboseStoreGate:
93 cfg.getService(
"StoreGateSvc").Dump =
True
95log.debug(
'Dumping of ConfigFlags now.')
98from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
99cfg.merge(PoolReadCfg(flags))
101from TrkDetDescrAlgs.TrkDetDescrAlgsConfig
import ITkMaterialMappingCfg
102cfg.merge(ITkMaterialMappingCfg(flags,
103 name=
"ITkMaterialMapping"))
105cfg.printConfig(withDetails =
True, summariseProps =
True)
107events = args.maxEvents
110cfg.run(maxEvents=events)
void print(char *figname, TCanvas *c1)