ATLAS Offline Software
Loading...
Searching...
No Matches
L0MuonMDTConfig.py
Go to the documentation of this file.
1#Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentFactory import CompFactory
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4
5from AthenaCommon.Logging import logging
6_log = logging.getLogger(__name__)
7
8def 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
26if __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
L0MuonMDTSimCfg(flags, name="L0MuonMDTSim", **kwargs)