ATLAS Offline Software
Loading...
Searching...
No Matches
L0MuonS1RPCConfig.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
8
9def TruthMuonCfg(flags):
10 result = ComponentAccumulator()
11
12 from MuonTruthAlgsR4.MuonTruthAlgsConfig import MuonTruthAlgsCfg
13 result.merge(MuonTruthAlgsCfg(flags, useSDO=True, recoAssoc = False))
14
15 return result
16
17def L0MuonRPCSimCfg(flags, name = "L0MuonRPCSim", **kwargs):
18
19 result = ComponentAccumulator()
20 result.merge(TruthMuonCfg(flags))
21
22 alg = CompFactory.L0Muon.RPCSimulation(name = name, **kwargs)
23
24 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
25 monTool = GenericMonitoringTool(flags, 'MonTool')
26 monTool.HistPath = 'L0MuonRPCSim'
27 monTool.defineHistogram('track_input_eta', path='EXPERT', type='TH1F', title=';#eta_{#mu}^{truth};Muons', xbins=50, xmin=-3, xmax=3)
28
29 alg.MonTool = monTool
30 from MuonConfig.MuonConfigUtils import setupHistSvcCfg
31 result.merge(setupHistSvcCfg(flags, outFile=f"{name}.root", outStream="EXPERT"))
32
33
34 result.addEventAlgo(alg)
35 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
36 result.merge(ActsGeometryContextAlgCfg(flags))
37
38 return result
39
40
41if __name__ == "__main__":
42 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser
43 from MuonConfig.MuonConfigUtils import executeTest
44 parser = SetupArgParser()
45 parser.set_defaults(inputFile= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/myRDO.R3.pool.root"])
46 parser.set_defaults(nEvents = 20)
47
48 args = parser.parse_args()
49 from AthenaConfiguration.AllConfigFlags import initConfigFlags
50 flags = initConfigFlags()
51 flags.Common.MsgSuppression = False
52
53 flags, acc = setupGeoR4TestCfg(args, flags)
54 from AthenaCommon.Constants import DEBUG
55
56 from MuonConfig.MuonByteStreamCnvTestConfig import RpcRdoToRpcDigitCfg
57 acc.merge(RpcRdoToRpcDigitCfg(flags))
58
59 from xAODTruthCnv.xAODTruthCnvConfig import GEN_EVNT2xAODCfg
60 acc.merge(GEN_EVNT2xAODCfg(flags,name="GEN_EVNT2xAOD",AODContainerName="TruthEvent"))
61
62 # example simulation alg
63 acc.merge(L0MuonRPCSimCfg(flags,
64 name = "L0MuonRPCSim",
65 OutputLevel = DEBUG))
66
67 executeTest(acc)
68
L0MuonRPCSimCfg(flags, name="L0MuonRPCSim", **kwargs)