ATLAS Offline Software
Loading...
Searching...
No Matches
Chain.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#pragma once
6/**********************************************************************************
7 * @Project: HLT SteeringEvent
8 * @Package: TrigSteeringEvent
9 * @class : Chain
10 *
11 * @brief chain of signatures
12 *
13 * @author Till Eifert <Till.Eifert@cern.ch> - U. of Geneva, Switzerland
14 * @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
15 * moved from TrigSteering package
16 *
17 * File and Version Information:
18 **********************************************************************************/
19
20#ifndef TRIGSTEERINGEVENT_CHAIN_H
21#define TRIGSTEERINGEVENT_CHAIN_H
22
23#include <vector>
24#include <stdint.h>
25#include <iomanip>
26
29
30#ifdef XAOD_STANDALONE
33#endif
34#ifndef XAOD_STANDALONE
35#include "GaudiKernel/MsgStream.h"
37#endif
38
39//#include "TrigSteeringEvent/GenericResult.h"
40
41#include <iosfwd>
42
43class MsgStream;
44
45
46namespace HLT {
47
48 static const std::string no_config = "no config";
49
50 // taht is for backward compatibility of TDT, once new TDT will be available it can be removed from steering
52
63 class Chain
64 {
65
66 public:
67
68
69 //Chain( const std::vector<uint32_t>& serialData ); //!< constructor from serialized data
70
71 Chain( uint32_t serialData );
72
73 Chain(const TrigConf::HLTChain* configChain);
74
76
77
79
80
81 bool chainPassedRaw() const { return m_passedRaw; }
82 bool chainPassed() const;
83
84
85 bool isPassedThrough() const { return m_passThrough; }
86 bool isPrescaled() const { return m_prescaled; }
87 bool isResurrected() const { return m_resurrected; }
88
89 // For Lvl Converters
90
91 float prescaleFactor() const { return (m_configChain ? m_configChain->prescale() : -1.); }
92 float passThroughFactor() const { return (m_configChain ? m_configChain->pass_through() : -1.); }
93 unsigned int getChainCounter() const { return m_chain_counter; }
94 const std::string& getChainName() const { return (m_configChain ? m_configChain->chain_name(): no_config); }
95 const std::string& getLowerChainName() const { return (m_configChain ? m_configChain->lower_chain_name(): no_config); }
96 int getEBAfterStep() const { return (m_configChain ? m_configChain->EB_after_step() : -1.); }
97 std::vector<size_t> getLegMultiplicities() const { return (m_configChain ? m_configChain->leg_multiplicities() : std::vector<size_t>()); }
98 bool nextStepAfterEB() const { return ((getChainStep()+1) > getEBAfterStep()) && (getEBAfterStep()>0.); }
99 bool isMerged() const { return (m_configChain ? (m_configChain->level()=="HLT") : false);};
100
101 unsigned int getChainHashId() const { return (m_configChain ? m_configChain->chain_hash_id() : 0); }
103 int getChainStep() const { return m_currentStep; }
104
105
111 template <class stream>
112 void print(stream& os) const
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 }
124
125 ErrorCode serialize( std::vector<uint32_t>& output ) const;
126
127 ErrorCode deserialize(uint32_t chainWord);
128
129 ErrorCode setDecisions(bool passedraw, bool passedthrough, bool prescaled, bool resurrected);
130
131
132 static unsigned int inquireChainCounter(uint32_t chainWord);
133
134 ChainStatus getStatus() const { return m_status; }
135
136 bool reset();
137
138 protected:
139
140
142
144 unsigned int m_chain_counter;
151
152 private:
154
155 };
156
157
161MsgStream& operator << (MsgStream&, const Chain&);
162std::ostream& operator << (std::ostream&, const Chain&);
163
164} // end of namespace
165
166
167#endif
This class represents one chain of signatures, i.e.
Definition Chain.h:64
bool m_prescaled
Flagged as "prescaled" for this event ?
Definition Chain.h:148
bool m_passedRaw
Definition Chain.h:146
int getEBAfterStep() const
get EB_after_step
Definition Chain.h:96
void setStatus(ChainStatus s)
Definition Chain.h:141
bool isMerged() const
Definition Chain.h:99
ChainStatus m_status
Chain status, enum {ChainInvalid, ConfigOnlyChain, ChainOK }.
Definition Chain.h:153
Chain(uint32_t serialData)
constructor from serialized data
Definition Chain.cxx:27
ErrorCode m_errorCode
most severe error code of execution
Definition Chain.h:145
int m_currentStep
Current step of this chain.
Definition Chain.h:150
bool m_resurrected
flag to mar that chain was originally prescalled but is reexecuted
Definition Chain.h:149
bool chainPassed() const
Definition Chain.cxx:46
const TrigConf::HLTChain * getConfigChain() const
get underlying ConfigChain
Definition Chain.h:78
float passThroughFactor() const
get pass-through factor
Definition Chain.h:92
HLT::ErrorCode getErrorCode() const
return this Chain's most severe error code (from execution)
Definition Chain.h:102
bool nextStepAfterEB() const
return whether next step requires EB (-1 means no EB called)
Definition Chain.h:98
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:143
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:93
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:101
float prescaleFactor() const
get prescale factor
Definition Chain.h:91
~Chain()
Definition Chain.h:75
std::vector< size_t > getLegMultiplicities() const
get per leg multiplicity (Run3 only)
Definition Chain.h:97
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:112
int getChainStep() const
return the current step of execution
Definition Chain.h:103
bool isPassedThrough() const
is chain passed through ?
Definition Chain.h:85
bool isPrescaled() const
is chain prescaled ?
Definition Chain.h:86
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:95
ChainStatus getStatus() const
return Chain status
Definition Chain.h:134
unsigned int m_chain_counter
chain counter from configuration (copied here for speed)
Definition Chain.h:144
bool m_passThrough
Flagged as "passedThrough" for this event ?
Definition Chain.h:147
const std::string & getChainName() const
return the Chain name (string)
Definition Chain.h:94
bool isResurrected() const
is chain resurrected ?
Definition Chain.h:87
bool chainPassedRaw() const
Definition Chain.h:81
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:51
@ ChainInvalid
Definition Chain.h:51
@ ConfigOnlyChain
Definition Chain.h:51
@ ChainOK
Definition Chain.h:51
std::string strErrorCode(const ErrorCode code)
Definition Enums.cxx:99
static const std::string no_config
Definition Chain.h:48
const FeatureContainerInit< FEATURE, CONTAINER > RegisterFeatureContainerTypes< FEATURE, CONTAINER >::s
MsgStream & operator<<(MsgStream &m, const Navigation &nav)