ATLAS Offline Software
Loading...
Searching...
No Matches
RunActsWriteTrackingGeometry.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#!/usr/bin/env python
4"""
5
6Dumping ACTS tracking geometry
7
8"""
9from AthenaCommon.Logging import log
10from argparse import ArgumentParser
11from AthenaConfiguration.AllConfigFlags import initConfigFlags
12
13# Argument parsing
14parser = ArgumentParser("RunActsWriteTrackingGeometry.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("--geometrytag",default="ATLAS-P2-RUN4-04-00-00", type=str,
26 help="The geometry tag to use")
27args = parser.parse_args()
28
29# Some info about the job
30print("----Dumping ACTS Tracking Geometry----")
31print()
32print("Using Geometry Tag: "+args.geometrytag)
33if args.localgeo:
34 print("...overridden by local Geometry Xml files")
35if not args.detectors:
36 print("Running complete detector")
37else:
38 print("Running with: {}".format(", ".join(args.detectors)))
39print()
40
41flags = initConfigFlags()
42
43flags.Input.isMC = True
44flags.Input.Files = []
45
46if args.localgeo:
47 flags.ITk.Geometry.AllLocal = True
48
49flags.GeoModel.AtlasVersion = args.geometrytag
50
51from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
52detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip', 'HGTD']
53detectors.append('Bpipe') # always run with beam pipe
54setupDetectorsFromList(flags, detectors, toggle_geometry=True)
55
56flags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
57flags.GeoModel.Align.Dynamic = False
58flags.Acts.TrackingGeometry.MaterialSource = "None"
59
60flags.Detector.GeometryCalo = False
61flags.Detector.GeometryMuon = False
62
63# This should run serially for the moment.
64flags.Concurrency.NumThreads = 1
65flags.Concurrency.NumConcurrentEvents = 1
66
67flags.dump()
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 ConfigFlags now.')
82flags.dump()
83
84from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
85cfg.merge(ActsWriteTrackingGeometryCfg(flags,
86 name="ActsWriteTrackingGeometry"))
87
88from AthenaConfiguration.FPEAndCoreDumpConfig import FPEAndCoreDumpCfg
89cfg.merge(FPEAndCoreDumpCfg(flags))
90
91cfg.printConfig(withDetails = True, summariseProps = True)
92
93cfg.run(1)
void print(char *figname, TCanvas *c1)