ATLAS Offline Software
MonitorChainConfiguration.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 logging.getLogger().info("Importing %s",__name__)
5 log = logging.getLogger(__name__)
6 
7 from TriggerMenuMT.HLT.Config.ChainConfigurationBase import ChainConfigurationBase
8 from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequenceCA, SelectionCA, InEventRecoCA
9 from AthenaConfiguration.ComponentFactory import CompFactory
10 from TrigGenericAlgs.TrigGenericAlgsConfig import TimeBurnerCfg, TimeBurnerHypoToolGen, L1CorrelationAlgCfg
11 from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
12 from L1TopoSimulation import L1TopoSimulationConfig as TopoSimConfig
13 from TrigHypoCommonTools.TrigHypoCommonTools import TrigGenericHypoToolFromDict
14 from TrigEDMConfig.TriggerEDM import recordable
15 from AthenaCommon.CFElements import seqAND
16 
17 #----------------------------------------------------------------
18 # fragments generating configuration will be functions in New JO,
19 # so let's make them functions already now
20 #----------------------------------------------------------------
21 def timeBurnerCfg(flags):
22  # Input maker - required by the framework, but inputs don't matter for TimeBurner
23  inputMaker = CompFactory.InputMakerForRoI("IM_TimeBurner",
24  RoITool=CompFactory.ViewCreatorInitialROITool(),
25  RoIs="TimeBurnerInputRoIs",
26  )
27  reco = InEventRecoCA('TimeBurner_reco',inputMaker=inputMaker)
28  # TimeBurner alg works as a reject-all hypo
29  selAcc = SelectionCA('TimeBurnerSequence')
30  selAcc.mergeReco(reco)
31  selAcc.addHypoAlgo(
32  TimeBurnerCfg(flags,
33  name="TimeBurnerHypo",
34  SleepTimeMillisec=200
35  )
36  )
37 
38  msca = MenuSequenceCA(flags, selAcc,
39  HypoToolGen=TimeBurnerHypoToolGen)
40  return msca
41 
43 
44  # Input maker for FS initial RoI
45  inputMaker = CompFactory.InputMakerForRoI("IM_L1TopoOnlineMonitor")
46  inputMaker.RoITool = CompFactory.ViewCreatorInitialROITool()
47  inputMaker.RoIs="L1TopoOnlineMonitorInputRoIs"
48 
49  reco = InEventRecoCA('L1TopoPhase1OnlineMonitor_reco',inputMaker=inputMaker)
50 
51  reco.addSequence(seqAND('L1TopoSimSeq'))
52  reco.merge(TopoSimConfig.L1TopoSimulationCfg(flags,doMonitoring=True,readMuCTPI=False,name="L1OnlineTopoSimulation"), sequenceName='L1TopoSimSeq')
53 
54  selAcc = SelectionCA("L1TopoOnlineMonitorSequence")
55  selAcc.mergeReco(reco)
56 
57  hypoAlg = TopoMonConfig.getL1TopoOnlineMonitorHypo(flags)
58  selAcc.addHypoAlgo(hypoAlg)
59 
60  return MenuSequenceCA(flags, selAcc,
61  HypoToolGen = TopoMonConfig.L1TopoOnlineMonitorHypoToolGen)
62 
63 
65  inputMaker = CompFactory.InputMakerForRoI("IM_MistimeMon",
66  RoITool = CompFactory.ViewCreatorInitialROITool(),
67  RoIs="MistimeMonInputRoIs",
68  )
69 
70  outputName = recordable("HLT_TrigCompositeMistimeJ400")
71  reco = InEventRecoCA('Mistime_reco',inputMaker=inputMaker)
72  recoAlg = L1CorrelationAlgCfg(flags, "MistimeMonj400", ItemList=['L1_J400','L1_gJ400p0ETA25'],
73  TrigCompositeWriteHandleKey=outputName, trigCompPassKey=outputName+".pass",
74  l1AKey=outputName+".l1a_type", otherTypeKey=outputName+".other_type",
75  beforeAfterKey=outputName+".beforeafterflag")
76  reco.addRecoAlgo(recoAlg)
77  selAcc = SelectionCA("MistimeMonSequence")
78  selAcc.mergeReco(reco)
79 
80  # Hypo to select on trig composite pass flag
81  hypoAlg = CompFactory.TrigGenericHypoAlg("MistimeMonJ400HypoAlg", TrigCompositeContainer=outputName)
82  selAcc.addHypoAlgo(hypoAlg)
83 
84  return MenuSequenceCA(flags, selAcc,
85  HypoToolGen = TrigGenericHypoToolFromDict)
86 
87 
88 #----------------------------------------------------------------
89 # Class to configure chain
90 #----------------------------------------------------------------
92 
93  def __init__(self, chainDict):
94  ChainConfigurationBase.__init__(self,chainDict)
95 
96  # ----------------------
97  # Assemble the chain depending on information from chainName
98  # ----------------------
99  def assembleChainImpl(self, flags):
100  chainSteps = []
101  log.debug("Assembling chain for %s", self.chainName)
102 
103  monTypeList = self.chainPart.get('monType')
104  if not monTypeList:
105  raise RuntimeError('No monType defined in chain ' + self.chainName)
106  if len(monTypeList) > 1:
107  raise RuntimeError('Multiple monType values defined in chain ' + self.chainName)
108  monType = monTypeList[0]
109 
110  if monType == 'timeburner':
111  chainSteps.append(self.getTimeBurnerStep(flags))
112  elif monType == 'l1topoPh1debug':
113  chainSteps.append(self.getL1TopoOnlineMonitorStep(flags))
114  elif monType == 'mistimemonj400':
115  chainSteps.append(self.getMistimeMonStep(flags))
116  else:
117  raise RuntimeError('Unexpected monType '+monType+' in MonitorChainConfiguration')
118 
119  return self.buildChain(chainSteps)
120 
121  # --------------------
122  # TimeBurner configuration
123  # --------------------
124  def getTimeBurnerStep(self, flags):
125  return self.getStep(flags, 'TimeBurner',[timeBurnerCfg])
126 
127  # --------------------
128  # L1TopoOnlineMonitor configuration
129  # --------------------
130  def getL1TopoOnlineMonitorStep(self, flags):
131 
132  sequenceCfg = L1TopoOnlineMonitorSequenceCfg
133  return self.getStep(flags, 'L1TopoOnlineMonitor',[sequenceCfg])
134 
135  # --------------------
136  # MistTimeMon configuration
137  # --------------------
138  def getMistimeMonStep(self, flags):
139  return self.getStep(flags, 'MistimeMon',[MistimeMonSequenceCfg])
grepfile.info
info
Definition: grepfile.py:38
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration
Definition: MonitorChainConfiguration.py:91
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration.assembleChainImpl
def assembleChainImpl(self, flags)
Definition: MonitorChainConfiguration.py:99
ChainConfigurationBase
Definition: ChainConfigurationBase.py:1
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MistimeMonSequenceCfg
def MistimeMonSequenceCfg(flags)
Definition: MonitorChainConfiguration.py:64
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration.getTimeBurnerStep
def getTimeBurnerStep(self, flags)
Definition: MonitorChainConfiguration.py:124
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration.getMistimeMonStep
def getMistimeMonStep(self, flags)
Definition: MonitorChainConfiguration.py:138
python.HLT.CalibCosmicMon.MonitorChainConfiguration.timeBurnerCfg
def timeBurnerCfg(flags)
Definition: MonitorChainConfiguration.py:21
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration.getL1TopoOnlineMonitorStep
def getL1TopoOnlineMonitorStep(self, flags)
Definition: MonitorChainConfiguration.py:130
python.TrigGenericAlgsConfig.L1CorrelationAlgCfg
def L1CorrelationAlgCfg(flags, name, **kwargs)
Definition: TrigGenericAlgsConfig.py:45
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:30
python.HLT.CalibCosmicMon.MonitorChainConfiguration.L1TopoOnlineMonitorSequenceCfg
def L1TopoOnlineMonitorSequenceCfg(flags)
Definition: MonitorChainConfiguration.py:42
python.TrigGenericAlgsConfig.TimeBurnerCfg
def TimeBurnerCfg(flags, name="TimeBurner", **kwargs)
Definition: TrigGenericAlgsConfig.py:10
python.HLT.CalibCosmicMon.MonitorChainConfiguration.MonitorChainConfiguration.__init__
def __init__(self, chainDict)
Definition: MonitorChainConfiguration.py:93