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")
27parser.add_argument("--geometrytag",default="ATLAS-P2-RUN4-03-00-00", type=str,
28 help="The geometry tag to use")
29parser.add_argument("--noLocalMaterial", action="store_true", default=False,
30 help="Do NOT use local material maps")
31args = parser.parse_args()
32
33# Some info about the job
34print("----MaterialValidation for ITk geometry----")
35print()
36print("Using Geometry Tag: "+args.geometrytag)
37if args.localgeo:
38 print("...overridden by local Geometry Xml files")
39print()
40
41flags.Input.isMC = True
42flags.Input.Files = []
43
44if args.localgeo:
45 flags.ITk.Geometry.AllLocal = True
46
47flags.GeoModel.AtlasVersion = args.geometrytag
48flags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
49flags.GeoModel.Align.Dynamic = False
50flags.TrackingGeometry.MaterialSource = "COOL"
51
52from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
53detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip', 'HGTD']
54detectors.append('Bpipe') # always run with beam pipe
55setupDetectorFlags(flags, detectors, toggle_geometry=True)
56
57flags.Detector.GeometryCalo = False
58flags.Detector.GeometryMuon = False
59
60# This should run serially for the moment.
61flags.Concurrency.NumThreads = 1
62flags.Concurrency.NumConcurrentEvents = 1
63
64if not args.noLocalMaterial:
65 flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps=True
66 LocalDataBaseName = flags.ITk.trackingGeometry.localDatabaseName
67 flags.IOVDb.DBConnection='sqlite://;schema='+LocalDataBaseName+';dbname=OFLP200'
68
69log.debug('Lock config flags now.')
70flags.lock()
71
72from AthenaConfiguration.MainServicesConfig import MainServicesCfg
73cfg=MainServicesCfg(flags)
74
75
76if args.verboseAccumulators:
77 cfg.printConfig(withDetails=True)
78if args.verboseStoreGate:
79 cfg.getService("StoreGateSvc").Dump = True
80
81log.debug('Dumping of flags now.')
82flags.dump()
83
84from TrkDetDescrAlgs.TrkDetDescrAlgsConfig import MaterialValidationCfg
85cfg.merge(MaterialValidationCfg(flags))
86
87cfg.printConfig(withDetails = True, summariseProps = True)
88
89
90cfg.run(maxEvents=args.maxEvents)
91
void print(char *figname, TCanvas *c1)