ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMonSeq Class Reference

#include <TrigMonSeq.h>

Collaboration diagram for TrigMonSeq:

Public Types

enum  State {
  kUnknown = 0x0 , kInitial = 0x010000 , kStart = 0x020000 , kAlreadyExecuted = 0x040000 ,
  kPrevious = 0x080000
}

Public Member Functions

 TrigMonSeq ()
 TrigMonSeq (uint32_t encoded)
 TrigMonSeq (const TrigConfChain &chn, const TrigConfSeq &seq)
 ~TrigMonSeq ()
void addAlg (const TrigMonAlg &alg)
void addVar (const TrigMonVar &var)
void addTimer (float timer)
void addState (State value)
bool isInitial () const
bool isExecuted () const
bool isAlreadyExecuted () const
bool isPrevious () const
uint16_t getLevel () const
uint16_t getChnCounter () const
uint16_t getChnEncodedId () const
uint16_t getSeqIndex () const
uint32_t getEncoded () const
float getSeqTimer () const
double getAlgTimer () const
std::vector< TrigMonAlg > & getAlg ()
const std::vector< TrigMonAlg > & getAlg () const
const std::vector< TrigMonVargetVar () const
const std::vector< uint16_t > & getVarKey () const
const std::vector< float > & getVarVal () const
void print (const TrigConfSeq &confg, std::ostream &os=std::cout) const

Private Attributes

uint32_t m_encoded
std::vector< TrigMonAlgm_alg
std::vector< uint16_t > m_var_key
std::vector< float > m_var_val

Friends

class TrigMonSeqCnv_p1

Detailed Description

Definition at line 27 of file TrigMonSeq.h.

Member Enumeration Documentation

◆ State

Enumerator
kUnknown 
kInitial 
kStart 
kAlreadyExecuted 
kPrevious 

Definition at line 31 of file TrigMonSeq.h.

31 {
32 kUnknown = 0x0, // Default state
33 kInitial = 0x010000, // Initialization of sequence execution
34 kStart = 0x020000, // Start running algorithms
35 kAlreadyExecuted = 0x040000, // Sequence (TE) was cached
36 kPrevious = 0x080000 // Sequence was executed by other sequence
37 };
@ kAlreadyExecuted
Definition TrigMonSeq.h:35

Constructor & Destructor Documentation

◆ TrigMonSeq() [1/3]

TrigMonSeq::TrigMonSeq ( )

Definition at line 25 of file TrigMonSeq.cxx.

26 :m_encoded(0x0)
27{
28}
uint32_t m_encoded
Definition TrigMonSeq.h:75

◆ TrigMonSeq() [2/3]

TrigMonSeq::TrigMonSeq ( uint32_t encoded)
explicit

Definition at line 31 of file TrigMonSeq.cxx.

32 :m_encoded(encoded)
33{
34}

◆ TrigMonSeq() [3/3]

TrigMonSeq::TrigMonSeq ( const TrigConfChain & chn,
const TrigConfSeq & seq )

Definition at line 37 of file TrigMonSeq.cxx.

39{
40 //
41 // Encoded index into
42 //
43 const uint32_t index = seq.getIndex();
44 if(index >= 4096) {
45 // EDM limitation workaround with big run-2 menus
47 m_var_val.push_back((float) index); // This is not going to get so large that we'll loose info in a float
48 }
49 else {
51 }
52}
static const uint16_t LARGE_INDEX_SEQ_LOCATION
uint16_t getEncodedId() const
std::vector< uint16_t > m_var_key
Definition TrigMonSeq.h:77
std::vector< float > m_var_val
Definition TrigMonSeq.h:78
str index
Definition DeMoScan.py:362
const uint32_t shiftIndex
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
setEventNumber uint32_t

◆ ~TrigMonSeq()

TrigMonSeq::~TrigMonSeq ( )
inline

Definition at line 42 of file TrigMonSeq.h.

42{}

Member Function Documentation

◆ addAlg()

void TrigMonSeq::addAlg ( const TrigMonAlg & alg)
inline

Definition at line 44 of file TrigMonSeq.h.

44{ m_alg.push_back(alg); }
std::vector< TrigMonAlg > m_alg
Definition TrigMonSeq.h:76

◆ addState()

void TrigMonSeq::addState ( State value)

Definition at line 77 of file TrigMonSeq.cxx.

78{
79 //
80 // Make OR with State enum value (already at correct bit position)
81 //
83}

◆ addTimer()

void TrigMonSeq::addTimer ( float timer)

Definition at line 67 of file TrigMonSeq.cxx.

68{
69 //
70 // Add sequence timer at key = 0
71 //
72 m_var_key.push_back(0);
73 m_var_val.push_back(timer);
74}

◆ addVar()

void TrigMonSeq::addVar ( const TrigMonVar & var)

Definition at line 55 of file TrigMonSeq.cxx.

56{
57 //
58 // Store variable as int and float, reserve 0-9 keys
59 //
60 if(var.getKey() > 9) {
61 m_var_key.push_back(var.getKey());
62 m_var_val.push_back(var.getData());
63 }
64}

◆ getAlg() [1/2]

std::vector< TrigMonAlg > & TrigMonSeq::getAlg ( )
inline

Definition at line 63 of file TrigMonSeq.h.

63{ return m_alg; }

◆ getAlg() [2/2]

const std::vector< TrigMonAlg > & TrigMonSeq::getAlg ( ) const
inline

Definition at line 64 of file TrigMonSeq.h.

64{ return m_alg; }

◆ getAlgTimer()

double TrigMonSeq::getAlgTimer ( ) const

Definition at line 156 of file TrigMonSeq.cxx.

157{
158 //
159 // Explicit loop over timers to get total time measures by algorithms
160 //
161 if(m_alg.empty()) return 0.0;
162
163 double timer_sum = 0.0;
164 for(unsigned int i = 0; i < m_alg.size(); ++i) timer_sum += m_alg[i].getTimer();
165
166 return timer_sum;
167}

◆ getChnCounter()

uint16_t TrigMonSeq::getChnCounter ( ) const

Definition at line 128 of file TrigMonSeq.cxx.

129{
131}
uint16_t getChnEncodedId() const
uint16_t getCounterFromEncodedId(uint16_t encoded)

◆ getChnEncodedId()

uint16_t TrigMonSeq::getChnEncodedId ( ) const

Definition at line 134 of file TrigMonSeq.cxx.

135{
136 //
137 // Mask out low 16 bits and return encoded chain id
138 //
139 return (m_encoded & SeqBits::maskLow16);
140}
const uint32_t maskLow16

◆ getEncoded()

uint32_t TrigMonSeq::getEncoded ( ) const
inline

Definition at line 58 of file TrigMonSeq.h.

58{ return m_encoded; }

◆ getLevel()

uint16_t TrigMonSeq::getLevel ( ) const

Definition at line 122 of file TrigMonSeq.cxx.

123{
125}
uint16_t getLevelFromEncodedId(uint16_t encoded)

◆ getSeqIndex()

uint16_t TrigMonSeq::getSeqIndex ( ) const

Definition at line 143 of file TrigMonSeq.cxx.

144{
145 //
146 // Mask out SEQ State enum bits and return index
147 //
148 // Check it's not stored in the hack way first
149 for (uint32_t i=0; i < m_var_key.size(); ++i) {
150 if (m_var_key.at(i) == LARGE_INDEX_SEQ_LOCATION) return (uint16_t) m_var_val.at(i);
151 }
153}
const uint32_t maskIndex

◆ getSeqTimer()

float TrigMonSeq::getSeqTimer ( ) const

Definition at line 170 of file TrigMonSeq.cxx.

171{
172 //
173 // Get sequence timer which is stored at key=0
174 //
175
176 if(m_var_key.size() == m_var_val.size()) {
177 //
178 // Look for key == 0
179 //
180 for(unsigned int i = 0; i < m_var_key.size(); ++i) {
181 if(m_var_key[i] == 0) return m_var_val[i];
182 }
183 }
184
185 return 0.0;
186}

◆ getVar()

const std::vector< TrigMonVar > TrigMonSeq::getVar ( ) const

Definition at line 189 of file TrigMonSeq.cxx.

190{
191 //
192 // Build variables on a fly and return vector by value
193 //
194 std::vector<TrigMonVar> var;
195
196 if(m_var_key.size() == m_var_val.size()) {
197 //
198 // Iterate over keys abd values
199 //
200 var.reserve(m_var_key.size());
201
202 for(unsigned int i = 0; i < m_var_key.size(); ++i) {
203 if(m_var_key[i] != 0) {
204 var.push_back(TrigMonVar(m_var_key[i], m_var_val[i]));
205 }
206 }
207 }
208
209 return var;
210}

◆ getVarKey()

const std::vector< uint16_t > & TrigMonSeq::getVarKey ( ) const
inline

Definition at line 67 of file TrigMonSeq.h.

67{ return m_var_key; }

◆ getVarVal()

const std::vector< float > & TrigMonSeq::getVarVal ( ) const
inline

Definition at line 68 of file TrigMonSeq.h.

68{ return m_var_val; }

◆ isAlreadyExecuted()

bool TrigMonSeq::isAlreadyExecuted ( ) const

Definition at line 104 of file TrigMonSeq.cxx.

105{
106 //
107 // Check value of SEQ State enum
108 //
109 return (m_encoded & kAlreadyExecuted);
110}

◆ isExecuted()

bool TrigMonSeq::isExecuted ( ) const

Definition at line 95 of file TrigMonSeq.cxx.

96{
97 //
98 // Check value of SEQ State enum
99 //
100 return (m_encoded & kStart);
101}

◆ isInitial()

bool TrigMonSeq::isInitial ( ) const

Definition at line 86 of file TrigMonSeq.cxx.

87{
88 //
89 // Check value of SEQ State enum
90 //
91 return (m_encoded & kInitial);
92}

◆ isPrevious()

bool TrigMonSeq::isPrevious ( ) const

Definition at line 113 of file TrigMonSeq.cxx.

114{
115 //
116 // Check value of SEQ State enum
117 //
118 return (m_encoded & kPrevious);
119}

◆ print()

void TrigMonSeq::print ( const TrigConfSeq & confg,
std::ostream & os = std::cout ) const

Definition at line 213 of file TrigMonSeq.cxx.

214{
215 //
216 // Print payload
217 //
218 if(confg.getIndex() != getSeqIndex()) {
219 os << "TrigMonSeq::Print - error configuration does not match this sequence\n";
220 return;
221 }
222
223 std::stringstream st;
224
225 st << "TrigMonSeq: " << confg.getName()
226 << " isExecuted=" << int(isExecuted())
227 << " isAlreadyExecuted=" << int(isAlreadyExecuted())
228 << " isInitial=" << int(isInitial())
229 << " isPrevious=" << int(isPrevious()) << "\n"
230 << " t_seq-t_alg=" << getSeqTimer() << "-" << getAlgTimer() << "="
231 << getSeqTimer() - getAlgTimer()
232 << " SEQ contains " << m_alg.size() << " algorithm(s)"
233 << "\n";
234
235 unsigned int iwidth = 0;
236 for(unsigned int j = 0; j < m_alg.size(); ++j) {
237 const TrigMonAlg &alg_entry = m_alg[j];
238 const TrigConfAlg &alg_confg = confg.getAlg(alg_entry.getPosition());
239
240 iwidth = std::max<unsigned int>(iwidth, alg_confg.getName().size());
241 }
242
243 for(unsigned int j = 0; j < m_alg.size(); ++j) {
244 const TrigMonAlg &alg_entry = m_alg[j];
245 const TrigConfAlg &alg_confg = confg.getAlg(alg_entry.getPosition());
246
247 st << " " << std::setw(2) << std::setfill(' ') << std::right << j << ": "
248 << std::setw(iwidth) << std::left << alg_confg.getName()
249 << " isCached=" << int(alg_entry.isCached())
250 << " timer=" << alg_entry.elapsed()
251 << " RoiId=";
252
253 for(unsigned int r = 0; r < alg_entry.getNRoi(); ++r) {
254 st << static_cast<unsigned int>(alg_entry.getRoiId(r)) << " ";
255 }
256
257 if(alg_entry.isCalled()) {
258 st << " t1-t0="
259 << alg_entry.start().getSec() << "." << alg_entry.start().getMicroSec()
260 << "-"
261 << alg_entry.stop().getSec() << "." << alg_entry.stop().getMicroSec()
262 << "="
263 << alg_entry.elapsed();
264 }
265
266 st << "\n";
267 }
268
269 os << st.str();
270}
const std::string & getName() const
Definition TrigConfAlg.h:39
uint16_t getIndex() const
Definition TrigConfSeq.h:42
const TrigConfAlg & getAlg(unsigned int pos) const
const std::string & getName() const
Definition TrigConfSeq.h:44
uint8_t getNRoi() const
uint8_t getRoiId(unsigned int i=0) const
bool isCached() const
const TrigMonTimer stop() const
double elapsed() const
Definition TrigMonAlg.h:57
bool isCalled() const
const TrigMonTimer start() const
uint8_t getPosition() const
uint16_t getSeqIndex() const
bool isPrevious() const
double getAlgTimer() const
bool isExecuted() const
float getSeqTimer() const
bool isInitial() const
bool isAlreadyExecuted() const
uint32_t getSec() const
uint32_t getMicroSec() const
int r
Definition globals.cxx:22

◆ TrigMonSeqCnv_p1

friend class TrigMonSeqCnv_p1
friend

Definition at line 73 of file TrigMonSeq.h.

Member Data Documentation

◆ m_alg

std::vector<TrigMonAlg> TrigMonSeq::m_alg
private

Definition at line 76 of file TrigMonSeq.h.

◆ m_encoded

uint32_t TrigMonSeq::m_encoded
private

Definition at line 75 of file TrigMonSeq.h.

◆ m_var_key

std::vector<uint16_t> TrigMonSeq::m_var_key
private

Definition at line 77 of file TrigMonSeq.h.

◆ m_var_val

std::vector<float> TrigMonSeq::m_var_val
private

Definition at line 78 of file TrigMonSeq.h.


The documentation for this class was generated from the following files: