ATLAS Offline Software
L0MuonMDTConfig.py
Go to the documentation of this file.
1 #Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 from AthenaCommon.Logging import logging
6 _log = logging.getLogger(__name__)
7 
8 def L0MuonMDTSimCfg(flags, name = "L0MuonMDTSim", **kwargs):
9 
10  result = ComponentAccumulator()
11 
12  alg = CompFactory.L0Muon.MDTSimulation(name = name, **kwargs)
13 
14  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
15  monTool = GenericMonitoringTool(flags, 'MonTool')
16  monTool.HistPath = 'L0MuonMDTSim'
17  monTool.defineHistogram('track_input_eta', path='EXPERT', type='TH1F', title=';#eta_{#mu}^{truth};Muons', xbins=50, xmin=-3, xmax=3)
18 
19  alg.MonTool = monTool
20  from MuonConfig.MuonConfigUtils import setupHistSvcCfg
21  result.merge(setupHistSvcCfg(flags, outFile = f"{name}.root", outStream="EXPERT"))
22  result.addEventAlgo(alg)
23  return result
24 
25 
26 if __name__ == "__main__":
27  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser
28  from MuonConfig.MuonConfigUtils import executeTest
29  parser = SetupArgParser()
30  parser.set_defaults(inputFile= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/myRDO.R3.pool.root"])
31  parser.set_defaults(nEvents = 20)
32  args = parser.parse_args()
33  from AthenaConfiguration.AllConfigFlags import initConfigFlags
34  flags = initConfigFlags()
35  flags.Common.MsgSuppression = False
36 
37  flags, acc = setupGeoR4TestCfg(args, flags)
38  from AthenaCommon.Constants import DEBUG
39 
40  from MuonConfig.MuonByteStreamCnvTestConfig import MdtRdoToMdtDigitCfg
41  acc.merge(MdtRdoToMdtDigitCfg(flags))
42  # example simulation alg
43  acc.merge(L0MuonMDTSimCfg(flags,
44  name = "L0MuonMDTSim",
45  OutputLevel = DEBUG))
46 
47  executeTest(acc)
48 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MuonByteStreamCnvTestConfig.MdtRdoToMdtDigitCfg
def MdtRdoToMdtDigitCfg(flags, name="MdtRdoToMdtDigitAlg", **kwargs)
Definition: MuonByteStreamCnvTestConfig.py:20
GenericMonitoringTool
Definition: GenericMonitoringTool.h:51
MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:145
Constants
some useful constants -------------------------------------------------—
MuonConfigUtils.executeTest
def executeTest(cfg)
Definition: MuonConfigUtils.py:19
L0MuonMDTConfig.L0MuonMDTSimCfg
def L0MuonMDTSimCfg(flags, name="L0MuonMDTSim", **kwargs)
Definition: L0MuonMDTConfig.py:8
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