ATLAS Offline Software
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 
6 Dump ACTS tracking geometry.
7 
8 """
9 from AthenaCommon.Logging import log
10 from argparse import ArgumentParser
11 from AthenaConfiguration.AllConfigFlags import initConfigFlags
12 
13 # Argument parsing
14 parser = ArgumentParser("RunActsWriteTrackingGeometry.py")
15 parser.add_argument("detectors", metavar="detectors", type=str, nargs="*",
16  help="Specify the list of detectors")
17 parser.add_argument("--localgeo", default=False, action="store_true",
18  help="Use local geometry Xml files")
19 parser.add_argument("-V", "--verboseAccumulators", default=False,
20  action="store_true",
21  help="Print full details of the AlgSequence")
22 parser.add_argument("-S", "--verboseStoreGate", default=False,
23  action="store_true",
24  help="Dump the StoreGate(s) each event iteration")
25 parser.add_argument("--geometrytag",default="ATLAS-P2-RUN4-03-00-00", type=str,
26  help="The geometry tag to use")
27 args = parser.parse_args()
28 
29 # Some info about the job
30 print("----Dumping ACTS Tracking Geometry----")
31 print()
32 print("Using Geometry Tag: "+args.geometrytag)
33 if args.localgeo:
34  print("...overridden by local Geometry Xml files")
35 if not args.detectors:
36  print("Running complete detector")
37 else:
38  print("Running with: {}".format(", ".join(args.detectors)))
39 print()
40 
41 flags = initConfigFlags()
42 
43 flags.Input.isMC = True
44 flags.Input.Files = []
45 
46 if args.localgeo:
47  flags.ITk.Geometry.AllLocal = True
48 
49 from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
50 detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip', 'HGTD']
51 detectors.append('Bpipe') # always run with beam pipe
52 setupDetectorsFromList(flags, detectors, toggle_geometry=True)
53 
54 flags.GeoModel.AtlasVersion = args.geometrytag
55 flags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
56 flags.GeoModel.Align.Dynamic = False
57 flags.Acts.TrackingGeometry.MaterialSource = "None"
58 
59 flags.Detector.GeometryCalo = False
60 flags.Detector.GeometryMuon = False
61 
62 # This should run serially for the moment.
63 flags.Concurrency.NumThreads = 1
64 flags.Concurrency.NumConcurrentEvents = 1
65 
66 flags.dump()
67 
68 log.debug('Lock config flags now.')
69 flags.lock()
70 
71 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
72 cfg=MainServicesCfg(flags)
73 
74 
75 if args.verboseAccumulators:
76  cfg.printConfig(withDetails=True)
77 if args.verboseStoreGate:
78  cfg.getService("StoreGateSvc").Dump = True
79 
80 log.debug('Dumping of ConfigFlags now.')
81 flags.dump()
82 
83 from ActsConfig.ActsGeometryConfig import ActsAlignmentCondAlgCfg
84 cfg.merge(ActsAlignmentCondAlgCfg(flags,
85  name="ActsAlignmentCondAlg"))
86 
87 from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
88 cfg.merge(ActsWriteTrackingGeometryCfg(flags,
89  name="ActsWriteTrackingGeometry"))
90 
91 from AthenaConfiguration.FPEAndCoreDumpConfig import FPEAndCoreDumpCfg
92 cfg.merge(FPEAndCoreDumpCfg(flags))
93 
94 cfg.printConfig(withDetails = True, summariseProps = True)
95 
96 cfg.run(1)
vtune_athena.format
format
Definition: vtune_athena.py:14
python.FPEAndCoreDumpConfig.FPEAndCoreDumpCfg
def FPEAndCoreDumpCfg(flags)
Definition: FPEAndCoreDumpConfig.py:11
python.DetectorConfigFlags.setupDetectorsFromList
def setupDetectorsFromList(flags, detectors, toggle_geometry=False, validate_only=False)
Definition: DetectorConfigFlags.py:354
ActsGeometryConfig.ActsWriteTrackingGeometryCfg
ComponentAccumulator ActsWriteTrackingGeometryCfg(flags, str name="ActsWriteTrackingGeometry", **kwargs)
Definition: ActsGeometryConfig.py:183
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70