ATLAS Offline Software
Loading...
Searching...
No Matches
RunActsWriteTrackingGeometry.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3"""
4Dump the ACTS tracking geometry to a file.
5"""
6
7from AthenaCommon.Logging import log
8from argparse import ArgumentParser
9from AthenaConfiguration.AllConfigFlags import initConfigFlags
10
11parser = ArgumentParser("RunActsWriteTrackingGeometry.py")
12parser.add_argument(
13 "-V",
14 "--verboseAccumulators",
15 default=False,
16 action="store_true",
17 help="Print full details of the AlgSequence",
18)
19parser.add_argument(
20 "-S",
21 "--verboseStoreGate",
22 default=False,
23 action="store_true",
24 help="Dump the StoreGate(s) each event iteration",
25)
26parser.add_argument(
27 "--geometrytag",
28 default="",
29 type=str,
30 help="The geometry tag to use. If not specified, the default RUN4 tag will be used.",
31)
32parser.add_argument(
33 "--dumpMaterialJson",
34 default=False,
35 action="store_true",
36 help="Also dump the material assigned to the geometry to a Json material map",
37)
38args = parser.parse_args()
39
40flags = initConfigFlags()
41
42flags.Input.isMC = True
43flags.Input.Files = []
44
45from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultConditionsTags
46
47flags.GeoModel.AtlasVersion = args.geometrytag if args.geometrytag else defaultGeometryTags.RUN4
48flags.IOVDb.GlobalTag = defaultConditionsTags.RUN4_MC
49
50flags.Detector.GeometryBpipe = False
51flags.Detector.GeometryHGTD = False
52flags.Detector.GeometryITkPixel = False
53flags.Detector.GeometryITkStrip = False
54flags.Detector.GeometryCalo = False
55from MuonGeoModelTestR4.testGeoModel import MuonPhaseIITestDefaults
56flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R4
57flags.GeoModel.SQLiteDB = False
58flags.Detector.GeometryMuon = False
59flags.Muon.trackGeometryMaterialMap="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/material-maps.root"
60
61flags.GeoModel.Align.Dynamic = False
62flags.Acts.TrackingGeometry.UseBlueprint = True
63flags.Acts.TrackingGeometry.KeepGoingOnMaterialMergeFailure = True
64flags.Acts.TrackingGeometry.ITkHgtdMaterialSource = "Default"
65flags.Acts.TrackingGeometry.ITkHgtdMaterialSource = "material-maps-itk-hgtd-ATLAS-P2-RUN4-05-00-00.json"
66flags.Acts.TrackingGeometry.ITkHgtdMaterialMapPath = "."
67
68# Geometry dump runs serially
69flags.Concurrency.NumThreads = 1
70flags.Concurrency.NumConcurrentEvents = 1
71
72flags.lock()
73flags.dump()
74
75log.debug("Lock config flags now.")
76
77from AthenaConfiguration.MainServicesConfig import MainServicesCfg
78
79cfg = MainServicesCfg(flags)
80
81if args.verboseAccumulators:
82 cfg.printConfig(withDetails=True)
83if args.verboseStoreGate:
84 cfg.getService("StoreGateSvc").Dump = True
85
86from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
87
88cfg.merge(ActsWriteTrackingGeometryCfg(flags, name="ActsWriteTrackingGeometry"))
89if args.dumpMaterialJson:
90 from ActsConfig.ActsMaterialConfig import MaterialJsonDumpCfg
91 cfg.merge(MaterialJsonDumpCfg(flags, FileName="material-maps"))
92
93
94cfg.printConfig(withDetails=True, summariseProps=True)
95
96cfg.run(1)