Chain Steps

Last update: 30 Sep 2024 [History] [Edit]

The Chain step

The HTL execution is splitted into decision steps, each providing the OR of the decision steps of all chains: if at least one chain has passed the step, the execution continue to the next one.

Each Chain then functions as a list of ChainSteps, and multiple chains can share the same step. The Menu alignment takes care of ensuring that the step execution is scheduled only once.

A step for a single-leg chain is made of a single MenuSequence, while for a combined chain it is made of multiple MenuSequences, one per leg.

In the control-flow, a step for a chain is always bookended by a single Filter Algorithm and a single ComboHypo algorithm, which checks the pass status of all of the legs of the chain together. In-between these may be multiple reconstruction sequencers and Hypo algorithms, depending on the number of legs the chain has.

The ChainStep is defined in MenuComponents.py and this is the default interface:

ChainStep(self, name,  SequenceGens = None, chainDicts = None, comboHypoCfg = ComboHypoCfg, comboToolConfs = None, isEmpty = False, createsGhostLegs = False):

These are the parameters:

  • name: identifier of the step algorithm content (used critically in the ControlFlow because it gives name to the FilterAlgorithm); steps with the same name can exist with the same algorithms, but different ChainDict (see note below)
  • SequenceGens: list of functions to generate the step MenuSequences
  • chainDicts: list of ChainDicts of the step legs (one entry per leg). Exception for jet steps, which have the full ChainDict of the chain because combinations are handled internally
  • comboHypoCfg: the function to generate the comboHypo configuration (default is a generic ComboHypo)
  • comboToolConfs: ComboHypoTools, if different from the default
  • isEmpty: flag to identify empty steps (needed for the alignment)

tip The ChainStep is a container to group the information of a step in a specific chain. Since it contains the chain-dictionaries of the legs, there can be more instances of steps with the same name, that is owned by different chains. This means that a ChainStep is not shared between chains. During the Control Flow creation, these multiple ChainStep instances are merged, so that it will result in a single AthSequencer containing the step sequences, for which the HypoAlg and the ComboHypo will have tools corresponding to each Chain.

The MenuSequences are generated only when createSequences() is called, which is done only once in the job, during the createDataFlow. This means that multiple ChainStep instances may result in a single AthSequencer in the Control Flow, for which the HypoAlg and ComboHypo would have tools corresponding to each Chain

The Menu sequence

The MenuSequence class groups the reco sequences with the Hypo algorithm and its HypoTools. It is defined in MenuComponents.py and this is the default interface:

MenuSequence(flags, selectionCA, HypoToolGen,  globalRecoCA=None)

It contains the generator functions of the configurations of all the algorithms and sequences for the execution of the chain-leg. The reco section and the HypoAlg are collected in the selectionCA passed as parameter.

tip Each MenuSequence is identified by a unique name, which is inherited from the HypoAlg name. Multiple chains can use the same MenuSequence (so sharing all its algorithms), including it in different ChainSteps. Gaudi steering is able to avoid multiple executions of the same algorithm, and in principle a MenuSequence can appear also in different step positions.

All algorithms and sequences are represented as AlgNode objects.
The AlgNode is a Node with a Gaudi algorithm/sequence configuration as content. The Node is a base class containing input and output links, useful to connect the elements in the dataflow as a graph. For an AlgNode the connections are the DataHandles of the algorithm. Each class of algorithms usefull for the dataflow have their representation as AlgNode (for example InputMakerAlgNode, HypoAlgNode, FilterAlgNode….)

Each MenuSequence owns these elements :

  • InputMakerAlgNode, for InputMaker/EventViewCreator
  • AthSequencer Node, the top sequence of the selectionCA
  • globalRecoCA, a CA for algorithms that run globally
  • HypoAlgNode, for the HypoaAlg algorithm
  • HypoToolGen, the function to generate the HypoTools.

The MenuSequence class is able to create its internal dataflow within the sequence (in the __init, it connects the InputMaker and the HypoAlg) and to connect the InputMaker to the step FilterAlg (connectToFilter).

For alignment purpose, an EmptyMenuSequence class also exists, which emulates a reco sequence with no HypoAlg. It contains an InputMaker and an empty sequence, used for merging, to follow the same MenuSequence behaviour.

How to read the logfile