ATLAS Offline Software
Loading...
Searching...
No Matches
RunMaterialValidationITk.py
Go to the documentation of this file.
1#!/usr/bin/env python
2"""
3
4Run material validation to check material maps for tracking geometry.
5
6"""
7
8from AthenaCommon.Logging import log
9from argparse import ArgumentParser
10from AthenaConfiguration.AllConfigFlags import initConfigFlags
11flags = initConfigFlags()
12
13# Argument parsing
14parser = ArgumentParser("RunMaterialValidationITk.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,
20 action="store_true",
21 help="Print full details of the AlgSequence")
22parser.add_argument("-S", "--verboseStoreGate", default=False,
23 action="store_true",
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("--noLocalMaterial", action="store_true", default=False,
31 help="Do NOT use local material maps")
32args = parser.parse_args()
33
34# Some info about the job
35print("----MaterialValidation for ITk geometry----")
36print()
37print("Using Geometry Tag: "+args.geometrytag)
38if args.localgeo:
39 print("...overridden by local Geometry Xml files")
40print()
41
42flags.Input.isMC = True
43flags.Input.Files = []
44
45if args.localgeo:
46 flags.ITk.Geometry.AllLocal = True
47
48flags.GeoModel.AtlasVersion = args.geometrytag
49flags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
50flags.GeoModel.Align.Dynamic = False
51flags.TrackingGeometry.MaterialSource = "COOL"
52
53from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
54detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip', 'HGTD']
55detectors.append('Bpipe') # always run with beam pipe
56setupDetectorFlags(flags, detectors, toggle_geometry=True)
57
58flags.Detector.GeometryCalo = False
59flags.Detector.GeometryMuon = False
60
61# This should run serially for the moment.
62flags.Concurrency.NumThreads = 1
63flags.Concurrency.NumConcurrentEvents = 1
64
65if not args.noLocalMaterial:
66 flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps=True
67 LocalDataBaseName = flags.ITk.trackingGeometry.localDatabaseName
68 flags.IOVDb.DBConnection='sqlite://;schema='+LocalDataBaseName+';dbname=OFLP200'
69
70log.debug('Lock config flags now.')
71flags.lock()
72
73from AthenaConfiguration.MainServicesConfig import MainServicesCfg
74cfg=MainServicesCfg(flags)
75
76
77if args.verboseAccumulators:
78 cfg.printConfig(withDetails=True)
79if args.verboseStoreGate:
80 cfg.getService("StoreGateSvc").Dump = True
81
82log.debug('Dumping of flags now.')
83flags.dump()
84
85from TrkDetDescrAlgs.TrkDetDescrAlgsConfig import MaterialValidationCfg
86cfg.merge(MaterialValidationCfg(flags))
87
88cfg.printConfig(withDetails = True, summariseProps = True)
89
90
91cfg.run(maxEvents=args.maxEvents)
92
void print(char *figname, TCanvas *c1)