ATLAS Offline Software
Loading...
Searching...
No Matches
testMuonTrackingGeometry.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4
5def MuonTrackingGeometryTestCfg(flags, name = "TrackingGeometryTest", **kwargs):
6
7 result = ComponentAccumulator()
8
9 from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
10 result.merge(GEN_AOD2xAODCfg(flags))
11
12 from MuonTruthAlgsR4.MuonTruthAlgsConfig import MuonTruthAlgsCfg
13 result.merge(MuonTruthAlgsCfg(flags, useSDO = False))
14
15 result.getEventAlgo("MuonTruthSegmentMaker").useOnlyMuonHits = False
16 result.getEventAlgo("TruthMuonMakerAlg").pdgIds=[13,998,999]
17
18 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometrySvcCfg
19 result.merge(ActsTrackingGeometrySvcCfg(flags))
20
21 from MuonTrackFindingAlgs.TrackFindingConfig import MSExtrapolatorCfg
22 kwargs.setdefault("ExtrapolationTool", result.popToolsAndMerge(MSExtrapolatorCfg(flags)))
23 the_alg = CompFactory.MuonValR4.TrackingGeometryTest(name, **kwargs)
24 result.addEventAlgo(the_alg, primary = True)
25
26 return result
27
28if __name__ == "__main__":
29
30 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
31 from MuonConfig.MuonConfigUtils import executeTest, setupHistSvcCfg
32 parser = SetupArgParser()
33 parser.set_defaults(outRootFile="MuonNavigationTestR4_Gen3Geometry.root")
34 parser.set_defaults(inputFile=MuonPhaseIITestDefaults.HITS_PG_R4)
35 parser.set_defaults(nEvents=10)
36 parser.set_defaults(defaultGeoFile="RUN4")
37 parser.add_argument("--gen3", action="store_true", help="Use Gen3 geometry + construction")
38 parser.add_argument("--objout", action="store_true", help="Obj output of the tracking geometry")
39 args = parser.parse_args()
40
41 from AthenaConfiguration.AllConfigFlags import initConfigFlags
42 flags = initConfigFlags()
43
44 flags.PerfMon.doFullMonMT = True
45 flags.Acts.TrackingGeometry.UseBlueprint = args.gen3
46 flags.Acts.TrackingGeometry.ObjDebugOutput = args.objout
47
48 flags, cfg = setupGeoR4TestCfg(args,flags)
49 cfg.merge(setupHistSvcCfg(flags, outFile=args.outRootFile, outStream="MuonNavigationTestGen3R4"))
50 from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
51 cfg.merge(AtlasFieldCacheCondAlgCfg(flags))
52
53 cfg.merge(MuonTrackingGeometryTestCfg(flags))
54
55 executeTest(cfg)
MuonTrackingGeometryTestCfg(flags, name="TrackingGeometryTest", **kwargs)