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 from AthenaCommon.Constants import VERBOSE
5 
6 def MuonDetectorNavTestCfg(flags, name = "MuonDetectorNavTest", **kwargs):
7  result = ComponentAccumulator()
8  containerNames = []
9  if flags.Detector.EnableMDT:
10  containerNames+=["xMdtSimHits"]
11  if flags.Detector.EnableMM:
12  containerNames+=["xMmSimHits"]
13  if flags.Detector.EnableRPC:
14  containerNames+=["xRpcSimHits"]
15  if flags.Detector.EnableTGC:
16  containerNames+=["xTgcSimHits"]
17  if flags.Detector.EnablesTGC:
18  containerNames+=["xStgcSimHits"]
19  kwargs.setdefault("SimHitKeys", containerNames)
20 
21  the_alg = CompFactory.ActsTrk.MuonDetectorNavTest(name, **kwargs)
22  result.addEventAlgo(the_alg, primary = True)
23  return result
24 
25 if __name__=="__main__":
26  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest,setupHistSvcCfg
27  parser = SetupArgParser()
28  parser.set_defaults(inputFile=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/R3SimHits.pool.root"])
29  parser.set_defaults(outRootFile="MuonNavigationTestR4.root")
30  parser.set_defaults(nEvents=10)
31  parser.add_argument("--dumpDetector", help="Save dump detector visualization", action='store_true', default=False )
32  parser.add_argument("--dumpPassive", help="Save detector visualization", action='store_true', default=False )
33  parser.add_argument("--dumpDetectorVolumes", help="Save detector visualization", action='store_true', default=False )
34  parser.add_argument("--noSensitives", help="Do not use sensitive detectors", action='store_true', default=False )
35  parser.add_argument("--dumpMaterialSurfaces", help="Save material surfaces visualization", action='store_true', default=False )
36 
37 
38  args = parser.parse_args()
39  from AthenaConfiguration.AllConfigFlags import initConfigFlags
40  flags = initConfigFlags()
41  flags.PerfMon.doFullMonMT = True
42  flags, cfg = setupGeoR4TestCfg(args,flags)
43 
44  cfg.merge(setupHistSvcCfg(flags, outFile=args.outRootFile, outStream="MuonNavigationTestR4"))
45  from ActsGeometry.DetectorVolumeSvcCfg import DetectorVolumeSvcCfg
46  cfg.merge(DetectorVolumeSvcCfg(flags))
47  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
48  cfg.merge(AtlasFieldCacheCondAlgCfg(flags))
49  cfg.merge(MuonDetectorNavTestCfg(flags, OutputLevel=VERBOSE))
50  cfg.getPublicTool("MuonDetectorBuilderTool").dumpDetector = args.dumpDetector
51  cfg.getPublicTool("MuonDetectorBuilderTool").dumpPassive = args.dumpPassive
52  cfg.getPublicTool("MuonDetectorBuilderTool").dumpDetectorVolumes = args.dumpDetectorVolumes
53  cfg.getPublicTool("MuonDetectorBuilderTool").BuildSensitives = not args.noSensitives
54  cfg.getPublicTool("MuonDetectorBuilderTool").dumpMaterialSurfaces = args.dumpMaterialSurfaces
55  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:192
python.testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:103
Constants
some useful constants -------------------------------------------------—
DetectorVolumeSvcCfg
Definition: DetectorVolumeSvcCfg.py:1
testMuonDetector.MuonDetectorNavTestCfg
def MuonDetectorNavTestCfg(flags, name="MuonDetectorNavTest", **kwargs)
Definition: testMuonDetector.py:6
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8