ATLAS Offline Software
Loading...
Searching...
No Matches
Chain.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5/**********************************************************************************
6 * @Project: HLT SteeringEvent
7 * @Package: TrigSteeringEvent
8 * @class : Chain
9 *
10 * @brief chain of signatures
11 *
12 * @author Till Eifert <Till.Eifert@cern.ch> - U. of Geneva, Switzerland
13 * @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
14 * moved from TrigSteering package
15 *
16 * File and Version Information:
17 **********************************************************************************/
18
19#ifndef TRIGSTEERINGEVENT_CHAIN_H
20#define TRIGSTEERINGEVENT_CHAIN_H
21
24
25#ifdef XAOD_STANDALONE
28#endif
29#ifndef XAOD_STANDALONE
30#include "GaudiKernel/MsgStream.h"
32#endif
33
34#include <vector>
35#include <stdint.h>
36#include <string>
37#include <iomanip>
38#include <iosfwd>
39
40class MsgStream;
41
42
43namespace HLT {
44
45 static const std::string no_config = "no config";
46
47 // taht is for backward compatibility of TDT, once new TDT will be available it can be removed from steering
49
60 class Chain
61 {
62
63 public:
64
65
66 //Chain( const std::vector<uint32_t>& serialData ); //!< constructor from serialized data
67
68 Chain( uint32_t serialData );
69
70 Chain(const TrigConf::HLTChain* configChain);
71
73
74
76
77
78 bool chainPassedRaw() const { return m_passedRaw; }
79 bool chainPassed() const;
80
81
82 bool isPassedThrough() const { return m_passThrough; }
83 bool isPrescaled() const { return m_prescaled; }
84 bool isResurrected() const { return m_resurrected; }
85
86 // For Lvl Converters
87
88 float prescaleFactor() const { return (m_configChain ? m_configChain->prescale() : -1.); }
89 float passThroughFactor() const { return (m_configChain ? m_configChain->pass_through() : -1.); }
90 unsigned int getChainCounter() const { return m_chain_counter; }
91 const std::string& getChainName() const { return (m_configChain ? m_configChain->chain_name(): no_config); }
92 const std::string& getLowerChainName() const { return (m_configChain ? m_configChain->lower_chain_name(): no_config); }
93 int getEBAfterStep() const { return (m_configChain ? m_configChain->EB_after_step() : -1.); }
94 std::vector<size_t> getLegMultiplicities() const { return (m_configChain ? m_configChain->leg_multiplicities() : std::vector<size_t>()); }
95 bool nextStepAfterEB() const { return ((getChainStep()+1) > getEBAfterStep()) && (getEBAfterStep()>0.); }
96 bool isMerged() const { return (m_configChain ? (m_configChain->level()=="HLT") : false);};
97
98 unsigned int getChainHashId() const { return (m_configChain ? m_configChain->chain_hash_id() : 0); }
100 int getChainStep() const { return m_currentStep; }
101
102
108 template <class stream>
109 void print(stream& os) const
110 {
111 os << "Counter = " << std::setw(4) <<getChainCounter()
112 << " success (raw) = " << chainPassedRaw()
113 << " EBstep = " << getEBAfterStep()
114 << " pass-through = " << isPassedThrough()
115 << " prescaled = " << isPrescaled()
116 << " rerun = " << isResurrected()
117 << " lastActiveStep = " << getChainStep()
118 << " name = " << std::setw(35) << getChainName()
119 << " EC = "<< strErrorCode(getErrorCode()) ;
120 }
121
122 ErrorCode serialize( std::vector<uint32_t>& output ) const;
123
124 ErrorCode deserialize(uint32_t chainWord);
125
126 ErrorCode setDecisions(bool passedraw, bool passedthrough, bool prescaled, bool resurrected);
127
128
129 static unsigned int inquireChainCounter(uint32_t chainWord);
130
131 ChainStatus getStatus() const { return m_status; }
132
133 bool reset();
134
135 protected:
136
137
139
141 unsigned int m_chain_counter;
148
149 private:
151
152 };
153
154
158MsgStream& operator << (MsgStream&, const Chain&);
159std::ostream& operator << (std::ostream&, const Chain&);
160
161} // end of namespace
162
163
164#endif
This class represents one chain of signatures, i.e.
Definition Chain.h:61
bool m_prescaled
Flagged as "prescaled" for this event ?
Definition Chain.h:145
bool m_passedRaw
Definition Chain.h:143
int getEBAfterStep() const
get EB_after_step
Definition Chain.h:93
void setStatus(ChainStatus s)
Definition Chain.h:138
bool isMerged() const
Definition Chain.h:96
ChainStatus m_status
Chain status, enum {ChainInvalid, ConfigOnlyChain, ChainOK }.
Definition Chain.h:150
Chain(uint32_t serialData)
constructor from serialized data
Definition Chain.cxx:27
ErrorCode m_errorCode
most severe error code of execution
Definition Chain.h:142
int m_currentStep
Current step of this chain.
Definition Chain.h:147
bool m_resurrected
flag to mar that chain was originally prescalled but is reexecuted
Definition Chain.h:146
bool chainPassed() const
Definition Chain.cxx:46
const TrigConf::HLTChain * getConfigChain() const
get underlying ConfigChain
Definition Chain.h:75
float passThroughFactor() const
get pass-through factor
Definition Chain.h:89
HLT::ErrorCode getErrorCode() const
return this Chain's most severe error code (from execution)
Definition Chain.h:99
bool nextStepAfterEB() const
return whether next step requires EB (-1 means no EB called)
Definition Chain.h:95
static unsigned int inquireChainCounter(uint32_t chainWord)
unpack chain counter from the serialized word
Definition Chain.cxx:123
const TrigConf::HLTChain * m_configChain
underlying Config Chain
Definition Chain.h:140
ErrorCode deserialize(uint32_t chainWord)
deserialize this Chain from given vector of uint's
Definition Chain.cxx:101
unsigned int getChainCounter() const
return the unique identifier of this Chain (uint)
Definition Chain.h:90
bool reset()
restes the bits to the basic state
Definition Chain.cxx:127
unsigned int getChainHashId() const
< return whether is a merged L2+EF chain
Definition Chain.h:98
float prescaleFactor() const
get prescale factor
Definition Chain.h:88
~Chain()
Definition Chain.h:72
std::vector< size_t > getLegMultiplicities() const
get per leg multiplicity (Run3 only)
Definition Chain.h:94
void print(stream &os) const
templated print stream method so that one can simply write std::cout << myChain << std::endl; or with...
Definition Chain.h:109
int getChainStep() const
return the current step of execution
Definition Chain.h:100
bool isPassedThrough() const
is chain passed through ?
Definition Chain.h:82
bool isPrescaled() const
is chain prescaled ?
Definition Chain.h:83
ErrorCode serialize(std::vector< uint32_t > &output) const
serialize this Chain into the given vector of uint's
Definition Chain.cxx:52
ErrorCode setDecisions(bool passedraw, bool passedthrough, bool prescaled, bool resurrected)
set bool decisions directly
Definition Chain.cxx:85
const std::string & getLowerChainName() const
return the Chain name (string)
Definition Chain.h:92
ChainStatus getStatus() const
return Chain status
Definition Chain.h:131
unsigned int m_chain_counter
chain counter from configuration (copied here for speed)
Definition Chain.h:141
bool m_passThrough
Flagged as "passedThrough" for this event ?
Definition Chain.h:144
const std::string & getChainName() const
return the Chain name (string)
Definition Chain.h:91
bool isResurrected() const
is chain resurrected ?
Definition Chain.h:84
bool chainPassedRaw() const
Definition Chain.h:78
HLT chain configuration information.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
ChainStatus
Definition Chain.h:48
@ ChainInvalid
Definition Chain.h:48
@ ConfigOnlyChain
Definition Chain.h:48
@ ChainOK
Definition Chain.h:48
std::string strErrorCode(const ErrorCode code)
Definition Enums.cxx:99
static const std::string no_config
Definition Chain.h:45
const FeatureContainerInit< FEATURE, CONTAINER > RegisterFeatureContainerTypes< FEATURE, CONTAINER >::s
MsgStream & operator<<(MsgStream &m, const Navigation &nav)