ATLAS Offline Software
L0MuonS1RPCConfig.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 
9 def 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 
17 def 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 
41 if __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 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
L0MuonS1RPCConfig.TruthMuonCfg
def TruthMuonCfg(flags)
Definition: L0MuonS1RPCConfig.py:9
MuonByteStreamCnvTestConfig.RpcRdoToRpcDigitCfg
def RpcRdoToRpcDigitCfg(flags, name="RpcRdoToRpcDigitAlg", **kwargs)
Definition: MuonByteStreamCnvTestConfig.py:44
GenericMonitoringTool
Definition: GenericMonitoringTool.h:51
xAODTruthCnvConfig.GEN_EVNT2xAODCfg
def GEN_EVNT2xAODCfg(flags, name="GEN_EVNT2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:5
MuonTruthAlgsConfig.MuonTruthAlgsCfg
def MuonTruthAlgsCfg(flags)
Definition: MuonConfig/python/MuonTruthAlgsConfig.py:99
MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:145
AlignmentAlgsConfig.ActsGeometryContextAlgCfg
def ActsGeometryContextAlgCfg(flags, name="GeometryContextAlg", **kwargs)
Setup the Geometry context algorithm.
Definition: AlignmentAlgsConfig.py:109
Constants
some useful constants -------------------------------------------------—
MuonConfigUtils.executeTest
def executeTest(cfg)
Definition: MuonConfigUtils.py:19
L0MuonS1RPCConfig.L0MuonRPCSimCfg
def L0MuonRPCSimCfg(flags, name="L0MuonRPCSim", **kwargs)
Definition: L0MuonS1RPCConfig.py:17
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