The ATLAS trigger menu consists of several hundreds of trigger chains which are used during data taking. Each chain defines the selection criteria at the first and high-level trigger for one or several physics signatures.
The TriggerMenuMT package contains the Run 3 trigger menu and chain configuration and replaces the Run-2 TriggerMenu package. It’s designed to define the chains in terms of their names, streams, bandwidth and rate groups and other properties, to configure them in terms of steps and the sequences within the steps and to build the control flow.
General information about the menu group and and its organisation can be found on the TriggerMenuInformation twiki.
For more advanced information, please see the topic-specific guides under “Trigger Menu for Experts”.
There is quite some terminology connected to this topic which the following is supposed to clarify a bit . Some of this is based on the Trigger Glossary which contains many more definitions to look up. Only the ones relevant for this section will be defined below.
ChainStep
class. Each step is made of a list of MenuSequences
. Each menu sequence is executed on a single decision object, so single decision chains will only have one MenuSequence
per step. The division into steps allows further processing to be avoided if a (fast) negative decision is made in an earlier step. It also allows (event-wide) early rejection if there are no chains passing a given step.RoRSeqFilter
) which filters HLT decisions and impacts the Control Flow.InputMakerAlg
/EventViewCreatorAlg
: It inherits from InputMakerBase and starts the sequence, creates the collections for the first RecoAlg, propagates decisions to the HypoAlg; The EventViewCreator
, in addition, creates the EventViews.EventViewVerifier
may be necessary to propagate objects from EventvViews in the previous step. The sequencers are configured to form either an AND
or an OR
of the status of their children and return this as their own status. They can be configured in two ways, parallel or sequential, depending on the way the children are allowed to be executed. In the HLT Control Flow we have two main configurations: sequential AND
(seqAND
) and parallel OR
(parOR
). The seqAND
returns immediately upon any child returning False, and does not execute any remaining children.The TriggerMenuMT package is divided into two sub-directories:
L1
for L1 configuration details andHLT
for the HLT configuration of trigger chains.The generateMT
function in GenerateMenu.py
handles the generation of the menu configuration for L1 and HLT.
Description of LVL1 components - to follow.
The generation of the HLT trigger menu configuration can be summarised in the following steps:
Physics_pp_run3_v1.py
)
are read into a big list.DictFromChainName.py
.
SignatureDicts.py
.Chain
object which is defined in
MenuComponents.py
to contain the HLT chain name, the L1 item seeding the chain and a list of chain steps.makeHLTTree
function.
Chain
objects for combined chains will need to be handled, this still needs implementing in the control flow.The sections below contain a little more detail on the steps for developers.
The chain definition in a menu is based on a namedtuple
defined in
ChainDefInMenu.py
with some default values assigned. This is subject to changes, so please refer to the file for up-to-date information.
The chain name decoding has not changed w.r.t. the version implemented in Run 2 and is based on the same concept. The allowed values for each signature are defined in the
SignatureDicts.py
.
An example for a dictionary for a chain of type HLT_e3_etcut1step_L1EM3
is:
{ "L1item": "L1_EM3",
"chainCounter": 1,
"chainMultiplicities": ["1"],
"chainName": "HLT_e3_etcut1step_L1EM3",
"chainParts": [ { "IDinfo": "",
"L1item": "",
"L2IDAlg": "",
"addInfo": ["etcut1step"],
"caloInfo": "",
"chainPartName": "e3_etcut1step_L1EM3",
"etaRange": "0eta250",
"eventBuildType": "",
"extra": "",
"isoInfo": "",
"lhInfo": "",
"multiplicity": "1",
"signature": "Electron",
"threshold": "3",
"trigType": "e",
"trkInfo": ""}],
"groups": ["RATE:SingleElectron", "BW:Electron"],
"signature": "Electron",
"signatures": "",
"stream": ["Main"],
"topo": [],
"topoStartFrom": False }
Most information is extracted by the DictFromChainName
code from the chain name itself, e.g. the signature type, L1 item and the chainPart specific fields.
However some information needs to be specified in the definition of the chain, like e.g. the bandwidth and rate groups and merging strategy (not shown here as it’s a single electron chain). The chainParts key is a list of signature specific sub-directories which will contain more entries in case of multi-leg chains.
The dictionary keys can be chosen freely by each signature. Please make sure to remove obsolete strings. An explanation of the meaning of each sub-string can be found here - not yet setup- pointing to Run2 twiki.
Each signature has a subdirectory under TriggerMenuMT/python/HLT/. The structure of the signature code will be explained at hand of the muon signature. Within the directory, there are two files generally needed by the TriggerMenuMT framework:
generateMuonChainDefs.py
: The function generateChainConfigs(chainDict)
is called from the generateMT
and is defined in this file. It handles the forwarding of the dictionary to the MuonDef.py
to set up the steps as well as the above described cases of multiple muon chain dictionaries for specific chains.MuonDef.py
: The class MuonChainConfiguration
in this file is based on a base class
ChainConfigurationBase
which can be extended with functions from which most/all signatures can benefit.
Please feel free to add code to this class to reduce the lines in each signature specific code.
Within this class, the steps of the particular chain that is being configured, are set up.
This can be done in form of a dictionary to avoid the many if-elif-else
statements we had in the Run 2 code, e.g.
stepDictionary = {
"":(self.getmuFast(),self.getmuComb(),self.getmuEFSA(),self.getmuEFCB()),
"fast":[self.getmuFast()],
"Comb":[self.getmuFast(), self.getmuComb()],
"ivar":[self.getmuFast(), self.getmuComb(), self.getmuIso()],
"noL1":[self.getFSmuEFSA(), self.getFSmuEFCB()],
}
key = self.chainPart["extra"]+self.chainPart["isoInfo"]
steps=stepDictionary[key]
for step in steps:
chainSteps+=[step]
myChain = self.buildChain(chainSteps)
There can be additional files in the signature directory, in the muon example, we have additionally:
MuonSetup.py
: Setup of all the different algorithms that are needed to reconstruct muons (including data prepreparation, L2, and EF)MuonSequenceSetup.py
: Contains the various sequences needed in the steps, including the maker, hypo and hypo toolMuonMenuConfig.py
: Configuration for the L2 algorithms, which will be moved to be within the offline muon configuration code
Generally, these additional files should be kept to a minimum though.A very important remark to add here is that when sequences are being prepared, a check is required to see if they have been declared already via the RecoFragmentsPool.retrieve(XXXAthSequence, flags)
, which automatically checks if the same sequence has been already instantiated, and returns the link to it.
The control flow is then generated based on the Chain
object that was passed from the signature specific code containing the configuration of the chain steps. This happens in the function makeHLTTree
which is located in HLTCFConfig.py
and makes use of further functions in MenuComponents.py
To add a new trigger chain, please follow the steps outlined below. You will first need to get the steps ready in terms of algorithms before being able to add them as part of a trigger chain to to TriggerMenuMT. Sometimes you’ll be able to skip a step if e.g. the algorithms have been prepared already.
TrigL2CaloHypoAlgMT
TrigL2CaloHypoToolInc
TrigL2CaloHypoTool.py
Please not that there is a defined format required, for example TrigL2CaloHypoToolFromName( name, conf )
MuonMenuSequences.py
Make a function for any sequence creation and instantiate the algorithms follow this logic:
sequenceView = parOR(name, [alg or seq])
mysequence =seqAND(name, [alg or seq])
MenuSequence( Sequence = fastCaloAthSequence, Maker = fastCaloViewsMaker, Hypo = theFastCaloHypo, HypoToolGen = TrigL2CaloHypoToolFromName )
Once all the algorithms are set up and ready, you can add the chain in a menu. For triggers in development, this is
Dev_pp_run3_v1.py
ChainDefInMenu.py
SignatureDicts.py
MuonChainConfiguration.py
In order to add or activate a new signature to TriggerMenuMT, the procedure is:
chains
object. E.g. Dev_pp_run3_v1.py
chains["Awesome"] = [ ... ]
GenerateAwesomeChainDefs.py
in the folder Awesome
, as the slice is generated via this line
Photon
or Streaming
.Please refer to the section Testing of code changes in this guide.