ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
HLT::Chain Class Reference

#include <Chain.h>

Collaboration diagram for HLT::Chain:

Public Member Functions

 Chain (uint32_t serialData)
 constructor from serialized data More...
 
 Chain (const TrigConf::HLTChain *configChain)
 
 ~Chain ()
 
const TrigConf::HLTChaingetConfigChain () const
 get underlying ConfigChain More...
 
bool chainPassedRaw () const
 
bool chainPassed () const
 
bool isPassedThrough () const
 is chain passed through ? More...
 
bool isPrescaled () const
 is chain prescaled ? More...
 
bool isResurrected () const
 is chain resurrected ? More...
 
float prescaleFactor () const
 get prescale factor More...
 
float passThroughFactor () const
 get pass-through factor More...
 
unsigned int getChainCounter () const
 return the unique identifier of this Chain (uint) More...
 
const std::string & getChainName () const
 return the Chain name (string) More...
 
const std::string & getLowerChainName () const
 return the Chain name (string) More...
 
int getEBAfterStep () const
 get EB_after_step
More...
 
std::vector< size_t > getLegMultiplicities () const
 get per leg multiplicity (Run3 only) More...
 
bool nextStepAfterEB () const
 return whether next step requires EB (-1 means no EB called) More...
 
bool isMerged () const
 
unsigned int getChainHashId () const
 < return whether is a merged L2+EF chain More...
 
HLT::ErrorCode getErrorCode () const
 return this Chain's most severe error code (from execution) More...
 
int getChainStep () const
 return the current step of execution More...
 
template<class stream >
void print (stream &os) const
 templated print stream method so that one can simply write std::cout << myChain << std::endl; or with the Gaudi Msg stram msgStram << myChain << ... More...
 
ErrorCode serialize (std::vector< uint32_t > &output) const
 serialize this Chain into the given vector of uint's More...
 
ErrorCode deserialize (uint32_t chainWord)
 deserialize this Chain from given vector of uint's More...
 
ErrorCode setDecisions (bool passedraw, bool passedthrough, bool prescaled, bool resurrected)
 set bool decisions directly More...
 
ChainStatus getStatus () const
 return Chain status More...
 
bool reset ()
 restes the bits to the basic state More...
 

Static Public Member Functions

static unsigned int inquireChainCounter (uint32_t chainWord)
 unpack chain counter from the serialized word More...
 

Protected Member Functions

void setStatus (ChainStatus s)
 

Protected Attributes

const TrigConf::HLTChainm_configChain
 underlying Config Chain
More...
 
unsigned int m_chain_counter
 chain counter from configuration (copied here for speed) More...
 
ErrorCode m_errorCode
 most severe error code of execution
More...
 
bool m_passedRaw
 
bool m_passThrough
 Flagged as "passedThrough" for this event ? More...
 
bool m_prescaled
 Flagged as "prescaled" for this event ? More...
 
bool m_resurrected
 flag to mar that chain was originally prescalled but is reexecuted More...
 
int m_currentStep
 Current step of this chain. More...
 

Private Attributes

ChainStatus m_status
 Chain status, enum {ChainInvalid, ConfigOnlyChain, ChainOK }. More...
 

Detailed Description

This class represents one chain of signatures, i.e. one signature for each step. The HLT::Chain class also holds information about its status, including prescales, pass-throughs etc.

Author
Till Eifert Till..nosp@m.Eife.nosp@m.rt@ce.nosp@m.rn.c.nosp@m.h
Nicolas Berger Nicol.nosp@m.as.B.nosp@m.erger.nosp@m.@cer.nosp@m.n.ch
Tomasz Bold Tomas.nosp@m.z.Bo.nosp@m.ld@ce.nosp@m.rn.c.nosp@m.h - U. of California - Irvine

Definition at line 63 of file Chain.h.

Constructor & Destructor Documentation

◆ Chain() [1/2]

Chain::Chain ( uint32_t  serialData)

constructor from serialized data

Definition at line 27 of file Chain.cxx.

28  : m_configChain(0) {
29  reset();
30  deserialize(serialData);
32 }

◆ Chain() [2/2]

Chain::Chain ( const TrigConf::HLTChain configChain)

Definition at line 34 of file Chain.cxx.

35  : m_configChain(configChain)
36  , m_chain_counter{0}
37 {
38  if (configChain)
40 
41  reset();
43 }

◆ ~Chain()

HLT::Chain::~Chain ( )
inline

Definition at line 75 of file Chain.h.

75 {}

Member Function Documentation

◆ chainPassed()

bool Chain::chainPassed ( ) const

Definition at line 46 of file Chain.cxx.

46  {
47  return (chainPassedRaw() && (!isPrescaled()) && (!isResurrected())) || isPassedThrough();
48 }

◆ chainPassedRaw()

bool HLT::Chain::chainPassedRaw ( ) const
inline

Definition at line 81 of file Chain.h.

81 { return m_passedRaw; }

◆ deserialize()

HLT::ErrorCode Chain::deserialize ( uint32_t  chainWord)

deserialize this Chain from given vector of uint's

Definition at line 101 of file Chain.cxx.

102 {
103  m_status = ChainOK;
104  m_passedRaw = chainWord & (0x1);
105  m_passThrough = chainWord & (0x4);
106  m_prescaled = chainWord & (0x2);
107  m_resurrected = chainWord & (0x200);
108 
109  m_currentStep = ( chainWord >> 3) & 0x0000003f;
110  m_chain_counter = ( chainWord >> (3+7)) & 0x0000ffff;
111  m_errorCode = static_cast<HLT::ErrorCode>(( chainWord >> (3+7+16)) & 0x0000003f);
112  /*
113  // Put m_currentStep signatures in the vector
114  for (unsigned int i = 0; i < static_cast<unsigned int>(m_currentStep); i++) m_signatures.push_back(0);
115 
116  // if chain didn't pass, add one more signature...
117  if (!(chainWord & (0x1))) m_signatures.push_back(0);
118  */
119 
120  return HLT::OK;
121 }

◆ getChainCounter()

unsigned int HLT::Chain::getChainCounter ( ) const
inline

return the unique identifier of this Chain (uint)

Definition at line 93 of file Chain.h.

◆ getChainHashId()

unsigned int HLT::Chain::getChainHashId ( ) const
inline

< return whether is a merged L2+EF chain

return the Chain name's hash ID

Definition at line 101 of file Chain.h.

◆ getChainName()

const std::string& HLT::Chain::getChainName ( ) const
inline

return the Chain name (string)

Definition at line 94 of file Chain.h.

◆ getChainStep()

int HLT::Chain::getChainStep ( ) const
inline

return the current step of execution

Definition at line 103 of file Chain.h.

◆ getConfigChain()

const TrigConf::HLTChain* HLT::Chain::getConfigChain ( ) const
inline

get underlying ConfigChain

Definition at line 78 of file Chain.h.

◆ getEBAfterStep()

int HLT::Chain::getEBAfterStep ( ) const
inline

get EB_after_step

Definition at line 96 of file Chain.h.

◆ getErrorCode()

HLT::ErrorCode HLT::Chain::getErrorCode ( ) const
inline

return this Chain's most severe error code (from execution)

Definition at line 102 of file Chain.h.

◆ getLegMultiplicities()

std::vector<size_t> HLT::Chain::getLegMultiplicities ( ) const
inline

get per leg multiplicity (Run3 only)

Definition at line 97 of file Chain.h.

◆ getLowerChainName()

const std::string& HLT::Chain::getLowerChainName ( ) const
inline

return the Chain name (string)

Definition at line 95 of file Chain.h.

◆ getStatus()

ChainStatus HLT::Chain::getStatus ( ) const
inline

return Chain status

Definition at line 134 of file Chain.h.

◆ inquireChainCounter()

unsigned int HLT::Chain::inquireChainCounter ( uint32_t  chainWord)
static

unpack chain counter from the serialized word

Definition at line 123 of file Chain.cxx.

123  {
124  return ( chainWord >> (3+7)) & 0x0000ffff;
125 }

◆ isMerged()

bool HLT::Chain::isMerged ( ) const
inline

Definition at line 99 of file Chain.h.

99 { return (m_configChain ? (m_configChain->level()=="HLT") : false);};

◆ isPassedThrough()

bool HLT::Chain::isPassedThrough ( ) const
inline

is chain passed through ?

Definition at line 85 of file Chain.h.

◆ isPrescaled()

bool HLT::Chain::isPrescaled ( ) const
inline

is chain prescaled ?

Definition at line 86 of file Chain.h.

◆ isResurrected()

bool HLT::Chain::isResurrected ( ) const
inline

is chain resurrected ?

Definition at line 87 of file Chain.h.

◆ nextStepAfterEB()

bool HLT::Chain::nextStepAfterEB ( ) const
inline

return whether next step requires EB (-1 means no EB called)

Definition at line 98 of file Chain.h.

◆ passThroughFactor()

float HLT::Chain::passThroughFactor ( ) const
inline

get pass-through factor

Definition at line 92 of file Chain.h.

◆ prescaleFactor()

float HLT::Chain::prescaleFactor ( ) const
inline

get prescale factor

Definition at line 91 of file Chain.h.

◆ print()

template<class stream >
void HLT::Chain::print ( stream &  os) const
inline

templated print stream method so that one can simply write std::cout << myChain << std::endl; or with the Gaudi Msg stram msgStram << myChain << ...

Definition at line 112 of file Chain.h.

113  {
114  os << "Counter = " << std::setw(4) <<getChainCounter()
115  << " success (raw) = " << chainPassedRaw()
116  << " EBstep = " << getEBAfterStep()
117  << " pass-through = " << isPassedThrough()
118  << " prescaled = " << isPrescaled()
119  << " rerun = " << isResurrected()
120  << " lastActiveStep = " << getChainStep()
121  << " name = " << std::setw(35) << getChainName()
122  << " EC = "<< strErrorCode(getErrorCode()) ;
123  }

◆ reset()

bool HLT::Chain::reset ( )

restes the bits to the basic state

Definition at line 127 of file Chain.cxx.

127  {
128  m_errorCode = HLT::OK;
129  m_passedRaw = false;
130  m_passThrough = false;
131  m_prescaled = false;
132  m_resurrected = false;
133  m_currentStep = 0;
134  return true;
135 }

◆ serialize()

HLT::ErrorCode Chain::serialize ( std::vector< uint32_t > &  output) const

serialize this Chain into the given vector of uint's

Definition at line 52 of file Chain.cxx.

53 {
54  // Chain serialized structure: 1 word per Chain
55  // 1 bit: active ? (before prescale and passThrough)
56  // 1 bit: prescaled ?
57  // 1 bit: passedThrough ?
58  // 7 bit: last active step => [0,127]
59  // 16 bit: chainCounter => [0,65535]
60  // 6 bit: ErrorCode => [0,63]
61 
62  // serialize data: first 3 bits for Active, Prescaled, passThrough bits
63  uint32_t chainWord = 0;
64  if (chainPassedRaw()) chainWord |= 0x1;
65  if (isPrescaled()) chainWord |= 0x2;
66  if (isPassedThrough()) chainWord |= 0x4;
67 
68  // next, 6 bits for the last active step (64 steps)
69  chainWord |= ((m_currentStep & 0x0000003f) << 3);
70 
71 
72  if ( isResurrected()) chainWord |= 0x200;
73 
74  // next, 16 bits for the chain counter
75  chainWord |= ((getChainCounter() & 0x0000ffff) << (3+6+1));
76 
77  // next, 6 bits for the errorCode
78  chainWord |= ((m_errorCode & 0x0000003f) << (3+6+1+16));
79 
80  output.push_back(chainWord);
81 
82  return HLT::OK;
83 }

◆ setDecisions()

HLT::ErrorCode Chain::setDecisions ( bool  passedraw,
bool  passedthrough,
bool  prescaled,
bool  resurrected 
)

set bool decisions directly

Definition at line 85 of file Chain.cxx.

86 {
87  m_status = ChainOK;
88  m_passedRaw = passedraw;
89  m_passThrough = passedthrough;
90  m_prescaled = prescaled;
91  m_resurrected = resurrected;
92 
93  // can't deduce the following
94  // m_currentStep = 0; // can't deduce
95  // m_chain_counter = ( chainWord >> (3+7)) & 0x0000ffff;
96  // m_errorCode = static_cast<HLT::ErrorCode>(( chainWord >> (3+7+16)) & 0x0000003f);
97  return HLT::OK;
98 }

◆ setStatus()

void HLT::Chain::setStatus ( ChainStatus  s)
inlineprotected

Definition at line 141 of file Chain.h.

141 { m_status = s; }

Member Data Documentation

◆ m_chain_counter

unsigned int HLT::Chain::m_chain_counter
protected

chain counter from configuration (copied here for speed)

Definition at line 144 of file Chain.h.

◆ m_configChain

const TrigConf::HLTChain* HLT::Chain::m_configChain
protected

underlying Config Chain

Definition at line 143 of file Chain.h.

◆ m_currentStep

int HLT::Chain::m_currentStep
protected

Current step of this chain.

Definition at line 150 of file Chain.h.

◆ m_errorCode

ErrorCode HLT::Chain::m_errorCode
protected

most severe error code of execution

Definition at line 145 of file Chain.h.

◆ m_passedRaw

bool HLT::Chain::m_passedRaw
protected

Definition at line 146 of file Chain.h.

◆ m_passThrough

bool HLT::Chain::m_passThrough
protected

Flagged as "passedThrough" for this event ?

Definition at line 147 of file Chain.h.

◆ m_prescaled

bool HLT::Chain::m_prescaled
protected

Flagged as "prescaled" for this event ?

Definition at line 148 of file Chain.h.

◆ m_resurrected

bool HLT::Chain::m_resurrected
protected

flag to mar that chain was originally prescalled but is reexecuted

Definition at line 149 of file Chain.h.

◆ m_status

ChainStatus HLT::Chain::m_status
private

Chain status, enum {ChainInvalid, ConfigOnlyChain, ChainOK }.

Definition at line 153 of file Chain.h.


The documentation for this class was generated from the following files:
HLT::Chain::getChainCounter
unsigned int getChainCounter() const
return the unique identifier of this Chain (uint)
Definition: Chain.h:93
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
HLT::Chain::getEBAfterStep
int getEBAfterStep() const
get EB_after_step
Definition: Chain.h:96
TrigConf::HLTChain::level
const std::string & level() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:75
HLT::Chain::reset
bool reset()
restes the bits to the basic state
Definition: Chain.cxx:127
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
HLT::Chain::deserialize
ErrorCode deserialize(uint32_t chainWord)
deserialize this Chain from given vector of uint's
Definition: Chain.cxx:101
HLT::ErrorCode
The definition of error codes in HLT. This is a class (note; before was simple enum) to enable safer ...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:80
HLT::ChainInvalid
@ ChainInvalid
Definition: Chain.h:51
HLT::Chain::m_passedRaw
bool m_passedRaw
Definition: Chain.h:146
HLT::Chain::m_prescaled
bool m_prescaled
Flagged as "prescaled" for this event ?
Definition: Chain.h:148
HLT::Chain::isPrescaled
bool isPrescaled() const
is chain prescaled ?
Definition: Chain.h:86
HLT::strErrorCode
std::string strErrorCode(const ErrorCode code)
Definition: Enums.cxx:99
TrigConf::HLTChain::chain_counter
int chain_counter() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:73
HLT::ChainOK
@ ChainOK
Definition: Chain.h:51
HLT::Chain::m_currentStep
int m_currentStep
Current step of this chain.
Definition: Chain.h:150
HLT::Chain::m_chain_counter
unsigned int m_chain_counter
chain counter from configuration (copied here for speed)
Definition: Chain.h:144
HLT::Chain::getChainStep
int getChainStep() const
return the current step of execution
Definition: Chain.h:103
HLT::Chain::getErrorCode
HLT::ErrorCode getErrorCode() const
return this Chain's most severe error code (from execution)
Definition: Chain.h:102
HLT::Chain::setStatus
void setStatus(ChainStatus s)
Definition: Chain.h:141
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
merge.output
output
Definition: merge.py:17
HLT::Chain::isResurrected
bool isResurrected() const
is chain resurrected ?
Definition: Chain.h:87
HLT::Chain::m_resurrected
bool m_resurrected
flag to mar that chain was originally prescalled but is reexecuted
Definition: Chain.h:149
HLT::Chain::m_passThrough
bool m_passThrough
Flagged as "passedThrough" for this event ?
Definition: Chain.h:147
HLT::Chain::m_errorCode
ErrorCode m_errorCode
most severe error code of execution
Definition: Chain.h:145
HLT::Chain::getChainName
const std::string & getChainName() const
return the Chain name (string)
Definition: Chain.h:94
HLT::ConfigOnlyChain
@ ConfigOnlyChain
Definition: Chain.h:51
HLT::Chain::m_configChain
const TrigConf::HLTChain * m_configChain
underlying Config Chain
Definition: Chain.h:143
HLT::Chain::chainPassedRaw
bool chainPassedRaw() const
Definition: Chain.h:81
HLT::Chain::m_status
ChainStatus m_status
Chain status, enum {ChainInvalid, ConfigOnlyChain, ChainOK }.
Definition: Chain.h:153
HLT::Chain::isPassedThrough
bool isPassedThrough() const
is chain passed through ?
Definition: Chain.h:85