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 
13  from MuonTruthAlgsR4.MuonTruthAlgsConfig import TruthSegmentMakerCfg, TruthSegmentToTruthPartAssocCfg, SdoMultiTruthMakerCfg
14  from MuonConfig.MuonTruthAlgsConfig import TruthMuonMakerAlgCfg, MuonTruthHitCountsAlgCfg
15  result.merge(TruthMuonMakerAlgCfg(flags))
16  result.merge(MuonTruthHitCountsAlgCfg(flags))
17  result.merge(TruthSegmentToTruthPartAssocCfg(flags))
18  result.merge(TruthSegmentMakerCfg(flags))
19  result.merge(TruthSegmentToTruthPartAssocCfg(flags))
20  result.merge(SdoMultiTruthMakerCfg(flags, useSDO=True))
21 
22 
23  return result
24 def L0MuonRPCSimCfg(flags, name = "L0MuonRPCSim", **kwargs):
25 
26  result = ComponentAccumulator()
27  result.merge(TruthMuonCfg(flags))
28 
29  alg = CompFactory.L0Muon.RPCSimulation(name = name, **kwargs)
30 
31  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
32  monTool = GenericMonitoringTool(flags, 'MonTool')
33  monTool.HistPath = 'L0MuonRPCSim'
34  monTool.defineHistogram('track_input_eta', path='EXPERT', type='TH1F', title=';#eta_{#mu}^{truth};Muons', xbins=50, xmin=-3, xmax=3)
35 
36  alg.MonTool = monTool
37  from MuonGeoModelTestR4.testGeoModel import setupHistSvcCfg
38  result.merge(setupHistSvcCfg(flags, outFile=f"{name}.root", outStream="EXPERT"))
39 
40 
41  result.addEventAlgo(alg)
42  from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
43  result.merge(ActsGeometryContextAlgCfg(flags))
44 
45  return result
46 
47 
48 if __name__ == "__main__":
49  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest
50  parser = SetupArgParser()
51  parser.set_defaults(inputFile= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/myRDO.R3.pool.root"])
52  parser.set_defaults(nEvents = 20)
53 
54  args = parser.parse_args()
55  from AthenaConfiguration.AllConfigFlags import initConfigFlags
56  flags = initConfigFlags()
57  flags.Common.MsgSuppression = False
58 
59  flags, acc = setupGeoR4TestCfg(args, flags)
60  from AthenaCommon.Constants import DEBUG
61 
62  from MuonConfig.MuonByteStreamCnvTestConfig import RpcRdoToRpcDigitCfg
63  acc.merge(RpcRdoToRpcDigitCfg(flags))
64 
65  from xAODTruthCnv.xAODTruthCnvConfig import GEN_EVNT2xAODCfg
66  acc.merge(GEN_EVNT2xAODCfg(flags,name="GEN_EVNT2xAOD",AODContainerName="TruthEvent"))
67 
68  # example simulation alg
69  acc.merge(L0MuonRPCSimCfg(flags,
70  name = "L0MuonRPCSim",
71  OutputLevel = DEBUG))
72 
73  executeTest(acc)
74 
MuonTruthAlgsConfig.TruthSegmentMakerCfg
def TruthSegmentMakerCfg(flags, name="TruthSegmentMakerAlg", **kwargs)
Definition: MuonPhaseII/MuonPatternRecognition/MuonTruthAlgsR4/python/MuonTruthAlgsConfig.py:7
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
L0MuonS1RPCConfig.TruthMuonCfg
def TruthMuonCfg(flags)
Definition: L0MuonS1RPCConfig.py:9
MuonTruthAlgsConfig.SdoMultiTruthMakerCfg
def SdoMultiTruthMakerCfg(flags, useSDO=False)
Definition: MuonPhaseII/MuonPatternRecognition/MuonTruthAlgsR4/python/MuonTruthAlgsConfig.py:97
MuonByteStreamCnvTestConfig.RpcRdoToRpcDigitCfg
def RpcRdoToRpcDigitCfg(flags, name="RpcRdoToRpcDigitAlg", **kwargs)
Definition: MuonByteStreamCnvTestConfig.py:44
GenericMonitoringTool
Definition: GenericMonitoringTool.h:53
testGeoModel.setupHistSvcCfg
def setupHistSvcCfg(flags, outFile="MdtGeoDump.root", outStream="GEOMODELTESTER")
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:55
MuonTruthAlgsConfig.TruthSegmentToTruthPartAssocCfg
def TruthSegmentToTruthPartAssocCfg(flags, name="MuonTruthSegmentToTruthAssocAlg", **kwargs)
Definition: MuonPhaseII/MuonPatternRecognition/MuonTruthAlgsR4/python/MuonTruthAlgsConfig.py:141
xAODTruthCnvConfig.GEN_EVNT2xAODCfg
def GEN_EVNT2xAODCfg(flags, name="GEN_EVNT2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:5
testGeoModel.executeTest
def executeTest(cfg)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:227
MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:126
AlignmentAlgsConfig.ActsGeometryContextAlgCfg
def ActsGeometryContextAlgCfg(flags, name="GeometryContextAlg", **kwargs)
Setup the Geometry context algorithm.
Definition: AlignmentAlgsConfig.py:125
Constants
some useful constants -------------------------------------------------—
L0MuonS1RPCConfig.L0MuonRPCSimCfg
def L0MuonRPCSimCfg(flags, name="L0MuonRPCSim", **kwargs)
Definition: L0MuonS1RPCConfig.py:24
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
MuonTruthAlgsConfig.MuonTruthHitCountsAlgCfg
def MuonTruthHitCountsAlgCfg(flags, name="MuonTruthHitSummaryAlg", **kwargs)
Definition: MuonConfig/python/MuonTruthAlgsConfig.py:49
MuonTruthAlgsConfig.TruthMuonMakerAlgCfg
def TruthMuonMakerAlgCfg(flags, name="TruthMuonMakerAlg", **kwargs)
Definition: MuonConfig/python/MuonTruthAlgsConfig.py:28