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
31 result.addEventAlgo(alg)
32 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
33 result.merge(ActsGeometryContextAlgCfg(flags))
34
35 return result
36
37
38if __name__ == "__main__":
39 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
40 from MuonConfig.MuonConfigUtils import executeTest
41 parser = SetupArgParser()
42 parser.set_defaults(inputFile= MuonPhaseIITestDefaults.RDO_R3)
43 parser.set_defaults(nEvents = 20)
44
45 args = parser.parse_args()
46 from AthenaConfiguration.AllConfigFlags import initConfigFlags
47 flags = initConfigFlags()
48 flags.Common.MsgSuppression = False
49
50 flags, acc = setupGeoR4TestCfg(args, flags)
51 from AthenaCommon.Constants import DEBUG
52
53 from MuonConfig.MuonByteStreamCnvTestConfig import RpcRdoToRpcDigitCfg
54 acc.merge(RpcRdoToRpcDigitCfg(flags))
55
56 from DerivationFrameworkMCTruth.MCTruthCommonConfig import HepMCtoXAODTruthCfg
57 acc.merge(HepMCtoXAODTruthCfg(flags))
58
59 # example simulation alg
60 acc.merge(L0MuonRPCSimCfg(flags,
61 name = "L0MuonRPCSim",
62 OutputLevel = DEBUG))
63
64 from MuonConfig.MuonConfigUtils import setupHistSvcCfg
65 acc.merge(setupHistSvcCfg(flags, outFile="L0MuonRPCSim.root", outStream="EXPERT"))
66
67 executeTest(acc)
68
L0MuonRPCSimCfg(flags, name="L0MuonRPCSim", **kwargs)