ATLAS Offline Software
testMuonTrackingGeometry.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def MuonTrackingGeometryTestCfg(flags, name = "ActsMuonTrackingGeometryTest", **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 ActsTrackingGeometryToolCfg
19 
20  kwargs.setdefault("TrackingGeometryTool", result.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
21 
22  the_alg = CompFactory.ActsTrk.ActsMuonTrackingGeometryTest(name, **kwargs)
23  result.addEventAlgo(the_alg, primary = True)
24 
25  return result
26 
27 if __name__ == "__main__":
28 
29  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest, MuonPhaseIITestDefaults
30  from MuonConfig.MuonConfigUtils import setupHistSvcCfg
31  parser = SetupArgParser()
32  parser.set_defaults(outRootFile="MuonNavigationTestR4_Gen3Geometry.root")
33  parser.set_defaults(inputFile=MuonPhaseIITestDefaults.HITS_PG_R4)
34  parser.set_defaults(nEvents=10)
35  parser.set_defaults(defaultGeoFile="RUN4")
36  parser.add_argument("--gen3", action="store_true", help="Use Gen3 geometry + construction")
37  parser.add_argument("--objout", action="store_true", help="Obj output of the tracking geometry")
38  args = parser.parse_args()
39 
40  from AthenaConfiguration.AllConfigFlags import initConfigFlags
41  flags = initConfigFlags()
42 
43  flags.PerfMon.doFullMonMT = True
44  flags.Acts.TrackingGeometry.UseBlueprint = args.gen3
45  flags.Acts.TrackingGeometry.ObjDebugOutput = args.objout
46 
47  flags, cfg = setupGeoR4TestCfg(args,flags)
48  cfg.merge(setupHistSvcCfg(flags, outFile=args.outRootFile, outStream="MuonNavigationTestGen3R4"))
49  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
50  cfg.merge(AtlasFieldCacheCondAlgCfg(flags))
51  cfg.merge(MuonTrackingGeometryTestCfg(flags))
52 
53  executeTest(cfg)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
xAODTruthCnvConfig.GEN_AOD2xAODCfg
def GEN_AOD2xAODCfg(flags, name="GEN_AOD2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:22
MuonTruthAlgsConfig.MuonTruthAlgsCfg
def MuonTruthAlgsCfg(flags)
Definition: MuonConfig/python/MuonTruthAlgsConfig.py:99
MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:145
MuonConfigUtils.executeTest
def executeTest(cfg)
Definition: MuonConfigUtils.py:19
ActsGeometryConfig.ActsTrackingGeometryToolCfg
ComponentAccumulator ActsTrackingGeometryToolCfg(flags, str name="ActsTrackingGeometryTool")
Definition: ActsGeometryConfig.py:140
testMuonTrackingGeometry.MuonTrackingGeometryTestCfg
def MuonTrackingGeometryTestCfg(flags, name="ActsMuonTrackingGeometryTest", **kwargs)
Definition: testMuonTrackingGeometry.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
MuonConfigUtils.setupHistSvcCfg
def setupHistSvcCfg(flags, str outFile, str outStream)
Configuration snippet to setup the THistSvc.
Definition: MuonConfigUtils.py:5
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8