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="", type=str,
26 help="The geometry tag to use. If not specified, the default RUN4 tag will be used.")
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
46from AthenaConfiguration.TestDefaults import defaultGeometryTags
47flags.GeoModel.AtlasVersion = args.geometrytag if args.geometrytag else defaultGeometryTags.RUN4
48
49if args.localgeo:
50 flags.ITk.Geometry.AllLocal = True
51
52flags.Acts.TrackingGeometry.UseBlueprint = True
53flags.Acts.TrackingGeometry.KeepGoingOnMaterialMergeFailure = True
54
55if args.detectors:
56 from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
57 detectors = args.detectors
58 detectors.append('Bpipe') # always run with beam pipe
59 setupDetectorsFromList(flags, detectors, toggle_geometry=True)
60else:
61 flags.Detector.GeometryBpipe = True
62 flags.Detector.GeometryHGTD = True
63 flags.Detector.GeometryITkPixel = True
64 flags.Detector.GeometryITkStrip = False
65
66flags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
67flags.GeoModel.Align.Dynamic = False
68flags.Acts.TrackingGeometry.MaterialSource = "None"
69
70flags.Detector.GeometryCalo = False
71flags.Detector.GeometryMuon = False
72
73# This should run serially for the moment.
74flags.Concurrency.NumThreads = 1
75flags.Concurrency.NumConcurrentEvents = 1
76
77flags.dump()
78
79log.debug('Lock config flags now.')
80flags.lock()
81
82from AthenaConfiguration.MainServicesConfig import MainServicesCfg
83cfg = MainServicesCfg(flags)
84
85
86if args.verboseAccumulators:
87 cfg.printConfig(withDetails=True)
88if args.verboseStoreGate:
89 cfg.getService("StoreGateSvc").Dump = True
90
91log.debug('Dumping of ConfigFlags now.')
92flags.dump()
93
94from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
95cfg.merge(ActsWriteTrackingGeometryCfg(flags,
96 name="ActsWriteTrackingGeometry"))
97
98from AthenaConfiguration.FPEAndCoreDumpConfig import FPEAndCoreDumpCfg
99cfg.merge(FPEAndCoreDumpCfg(flags))
100
101cfg.printConfig(withDetails = True, summariseProps = True)
102
103cfg.run(1)
void print(char *figname, TCanvas *c1)