ATLAS Offline Software
MuonHoughTransformTesterConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
7 def MuonHoughTransformTesterCfg(flags, name = "MuonHoughTransformTester", **kwargs):
8  result = ComponentAccumulator()
9  containerNames = []
10 
11  if flags.Input.isMC:
12  if flags.Detector.EnableMDT: containerNames+=["xMdtSimHits"]
13  if flags.Detector.EnableMM: containerNames+=["xMmSimHits"]
14  if flags.Detector.EnableRPC: containerNames+=["xRpcSimHits"]
15  if flags.Detector.EnableTGC: containerNames+=["xTgcSimHits"]
16  if flags.Detector.EnablesTGC: containerNames+=["xStgcSimHits"]
17  kwargs.setdefault("SimHitKeys", containerNames)
18  theAlg = CompFactory.MuonValR4.MuonHoughTransformTester(name, **kwargs)
19 
20  result.addEventAlgo(theAlg, primary=True)
21  return result
22 
23 if __name__=="__main__":
24  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest,setupHistSvcCfg
25  parser = SetupArgParser()
26  parser.set_defaults(nEvents = -1)
27  parser.set_defaults(noMM=True)
28  parser.set_defaults(noSTGC=True)
29  #parser.set_defaults(condTag="CONDBR2-BLKPA-2023-02")
30  parser.set_defaults(inputFile=[
31  #"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/TCT_Run3/data22_13p6TeV.00431493.physics_Main.daq.RAW._lb0525._SFO-16._0001.data"
32  "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/R4SimHits.pool.root"
33  ])
34  parser.set_defaults(eventPrintoutLevel = 500)
35  parser.add_argument("--displayFailedSeeds",
36  help="Saves the hits of failed seeds in a pdf", action='store_true', default = False)
37  parser.add_argument("--displayGoodSeeds",
38  help="Saves the hits of failed seeds in a pdf", action='store_true', default = False)
39 
40 
41  args = parser.parse_args()
42  flags, cfg = setupGeoR4TestCfg(args)
43 
44  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
45  # from PerfMonVTune.PerfMonVTuneConfig import VTuneProfilerServiceCfg
46  cfg.merge(setupHistSvcCfg(flags,out_file=args.outRootFile,
47  out_stream="MuonEtaHoughTransformTest"))
48 
49  if flags.Input.isMC:
50  from xAODMuonSimHitCnv.MuonSimHitCnvCfg import MuonSimHitToMeasurementCfg
51  cfg.merge(MuonSimHitToMeasurementCfg(flags))
52  else:
53  from MuonConfig.MuonBytestreamDecodeConfig import MuonByteStreamDecodersCfg
54  cfg.merge(MuonByteStreamDecodersCfg(flags))
55  from MuonConfig.MuonRdoDecodeConfig import MuonRDOtoPRDConvertorsCfg
56  cfg.merge(MuonRDOtoPRDConvertorsCfg(flags))
57  from MuonSpacePointFormation.SpacePointFormationConfig import MuonSpacePointFormationCfg
58  cfg.merge(MuonSpacePointFormationCfg(flags))
59 
60  from MuonPatternRecognitionAlgs.MuonHoughTransformAlgConfig import MuonPatternRecognitionCfg
61  cfg.merge(MuonPatternRecognitionCfg(flags))
62 
63  cfg.merge(MuonHoughTransformTesterCfg(flags,
64  drawDisplayFailed =args.displayFailedSeeds,
65  drawDisplaySuccss = args.displayGoodSeeds))
66  cfg.merge(PerfMonMTSvcCfg(flags))
67  # cfg.merge(VTuneProfilerServiceCfg(flags, ProfiledAlgs=["MuonHoughTransformAlg"]))
68 
69  # output spam reduction
70  cfg.getService("AthenaHiveEventLoopMgr").EventPrintoutInterval=500
71 
72 
73  executeTest(cfg, args.nEvents)
74 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MuonSimHitCnvCfg.MuonSimHitToMeasurementCfg
def MuonSimHitToMeasurementCfg(flags)
Configuration snippet to go from xAOD::MuonSimHit to xAOD::MuonPrepData
Definition: MuonSimHitCnvCfg.py:146
python.testGeoModel.executeTest
def executeTest(cfg, num_events=1)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:188
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, setupSimJob=False)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:99
python.testGeoModel.setupHistSvcCfg
def setupHistSvcCfg(flags, out_file="MdtGeoDump.root", out_stream="GEOMODELTESTER")
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:54
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
MuonHoughTransformTesterConfig.MuonHoughTransformTesterCfg
def MuonHoughTransformTesterCfg(flags, name="MuonHoughTransformTester", **kwargs)
Definition: MuonHoughTransformTesterConfig.py:7
MuonHoughTransformAlgConfig.MuonPatternRecognitionCfg
def MuonPatternRecognitionCfg(flags)
Definition: MuonHoughTransformAlgConfig.py:25
python.MuonRdoDecodeConfig.MuonRDOtoPRDConvertorsCfg
def MuonRDOtoPRDConvertorsCfg(flags)
Definition: MuonRdoDecodeConfig.py:307
SpacePointFormationConfig.MuonSpacePointFormationCfg
def MuonSpacePointFormationCfg(flags)
Definition: SpacePointFormationConfig.py:20
python.MuonBytestreamDecodeConfig.MuonByteStreamDecodersCfg
def MuonByteStreamDecodersCfg(flags)
Definition: MuonBytestreamDecodeConfig.py:400