ATLAS Offline Software
testMuonDetector.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def MuonDetectorNavTestCfg(flags, name = "MuonDetectorNavTest", **kwargs):
6  result = ComponentAccumulator()
7  containerNames = []
8  if flags.Detector.EnableMDT:
9  containerNames+=["xMdtSimHits"]
10  if flags.Detector.EnableMM:
11  containerNames+=["xMmSimHits"]
12  if flags.Detector.EnableRPC:
13  containerNames+=["xRpcSimHits"]
14  if flags.Detector.EnableTGC:
15  containerNames+=["xTgcSimHits"]
16  if flags.Detector.EnablesTGC:
17  containerNames+=["xStgcSimHits"]
18  kwargs.setdefault("SimHitKeys", containerNames)
19 
20  the_alg = CompFactory.ActsTrk.MuonDetectorNavTest(name, **kwargs)
21  result.addEventAlgo(the_alg, primary = True)
22  return result
23 
24 if __name__=="__main__":
25  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest,setupHistSvcCfg
26  parser = SetupArgParser()
27  parser.set_defaults(inputFile=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/R3SimHits.pool.root"])
28  parser.set_defaults(outRootFile="MuonNavigationTestR4.root")
29  parser.set_defaults(nEvents=10)
30  parser.add_argument("--dumpDetector", help="Save dump detector visualization", action='store_true', default=False )
31  parser.add_argument("--dumpPassive", help="Save detector visualization", action='store_true', default=False )
32  parser.add_argument("--dumpDetectorVolumes", help="Save detector visualization", action='store_true', default=False )
33 
34 
35  args = parser.parse_args()
36  from AthenaConfiguration.AllConfigFlags import initConfigFlags
37  flags = initConfigFlags()
38  flags.PerfMon.doFullMonMT = True
39  flags, cfg = setupGeoR4TestCfg(args,flags)
40 
41  cfg.merge(setupHistSvcCfg(flags, outFile=args.outRootFile, outStream="MuonNavigationTestR4"))
42  from ActsGeometry.DetectorVolumeSvcCfg import DetectorVolumeSvcCfg
43  cfg.merge(DetectorVolumeSvcCfg(flags))
44  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
45  cfg.merge(AtlasFieldCacheCondAlgCfg(flags))
46  cfg.merge(MuonDetectorNavTestCfg(flags))
47  cfg.getPublicTool("MuonDetectorBuilderTool").dumpDetector = args.dumpDetector
48  cfg.getPublicTool("MuonDetectorBuilderTool").dumpPassive = args.dumpPassive
49  cfg.getPublicTool("MuonDetectorBuilderTool").dumpDetectorVolumes = args.dumpDetectorVolumes
50  executeTest(cfg)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.testGeoModel.setupHistSvcCfg
def setupHistSvcCfg(flags, outFile="MdtGeoDump.root", outStream="GEOMODELTESTER")
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:58
python.testGeoModel.executeTest
def executeTest(cfg)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:193
python.testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:103
DetectorVolumeSvcCfg
Definition: DetectorVolumeSvcCfg.py:1
testMuonDetector.MuonDetectorNavTestCfg
def MuonDetectorNavTestCfg(flags, name="MuonDetectorNavTest", **kwargs)
Definition: testMuonDetector.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8