ATLAS Offline Software
TrigT1MuctpiPhase1Config.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaCommon.Logging import logging
5 
6 #Muon RecRoiTools
7 from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import RPCRecRoiToolCfg, TGCRecRoiToolCfg
8 
9 def TrigThresholdDecisionToolCfg(flags, name="TrigThresholdDecisionTool", AODinput = False):
10  acc = ComponentAccumulator()
11  tool = CompFactory.getComp("LVL1::TrigThresholdDecisionTool")(name)
12  tool.RPCRecRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
13  tool.TGCRecRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
14 
15  # if we are running from an AOD.pool, we need the metadata service and load the L1 menu from that
16  if AODinput:
17  from TrigConfxAOD.TrigConfxAODConfig import getxAODConfigSvc
18  tool.TrigConfigSvc = acc.getPrimaryAndMerge(getxAODConfigSvc(flags))
19  tool.MenuFromxAOD = True
20 
21  acc.setPrivateTools(tool)
22  return acc
23 
24 
25 def MUCTPI_AthToolCfg(flags, name):
26  acc = ComponentAccumulator()
27  tool = CompFactory.getComp("LVL1MUCTPIPHASE1::MUCTPI_AthTool")(name)
28  tool.RPCRecRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
29  tool.TGCRecRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
30  tool.TrigThresholdDecisionTool = acc.popToolsAndMerge(TrigThresholdDecisionToolCfg(flags))
31  #tool.MUCTPI_xAODLocation = ["LVL1MuonRoIsBCm2", "LVL1MuonRoIsBCm1", "LVL1MuonRoIs", "LVL1MuonRoIsBCp1", "LVL1MuonRoIsBCp2"]
32  # Create a logger:
33  logger = logging.getLogger( "MUCTPI_AthTool" )
34 
35  # Set properties of the LUT overlap handling:
36  tool.OverlapStrategyName = flags.Trigger.MUCTPI.OverlapStrategy
37 
38  # Decide which LUT to use, based on which run we are simulating:
39  tool.LUTXMLFile = flags.Trigger.MUCTPI.LUTXMLFile
40  logger.info( "Configuring MuCTPI simulation with configuration file: %s", tool.LUTXMLFile )
41 
42  if flags.Trigger.doHLT:
43  # Check the RoI EDM containers are registered in HLT outputs
44  from TrigEDMConfig.TriggerEDM import recordable
45  for key in tool.MUCTPI_xAODLocation:
46  logger.info( "Configuring MuCTPI simulation with configuration outputs: %s", key )
47  assert key==recordable(key), f'recordable() check failed for {key}'
48  logger.info( "Configuring MuCTPI: post flags.Trigger.doHLT" )
49 
50  acc.setPrivateTools(tool)
51  return acc
52 
53 
54 def MUCTPI_AthAlgCfg(flags):
55  acc = ComponentAccumulator()
56  alg = CompFactory.getComp("LVL1MUCTPIPHASE1::MUCTPI_AthAlg")(name="MUCTPI_AthAlg")
57  alg.MUCTPI_AthTool = acc.popToolsAndMerge(MUCTPI_AthToolCfg(flags, name="MUCTPI_AthTool"))
58  acc.addEventAlgo(alg)
59  return acc
TrigT1MuonRecRoiToolConfig.RPCRecRoiToolCfg
def RPCRecRoiToolCfg(flags, name="RPCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrigT1MuctpiPhase1Config.MUCTPI_AthToolCfg
def MUCTPI_AthToolCfg(flags, name)
Definition: TrigT1MuctpiPhase1Config.py:25
TrigConfxAODConfig.getxAODConfigSvc
def getxAODConfigSvc(flags)
Definition: TrigConfxAODConfig.py:5
python.TrigT1MuctpiPhase1Config.TrigThresholdDecisionToolCfg
def TrigThresholdDecisionToolCfg(flags, name="TrigThresholdDecisionTool", AODinput=False)
Definition: TrigT1MuctpiPhase1Config.py:9
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:37
TrigT1MuonRecRoiToolConfig.TGCRecRoiToolCfg
def TGCRecRoiToolCfg(flags, name="TGCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:18
python.TrigT1MuctpiPhase1Config.MUCTPI_AthAlgCfg
def MUCTPI_AthAlgCfg(flags)
Definition: TrigT1MuctpiPhase1Config.py:54