ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
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  };

Constructor & Destructor Documentation

◆ TrigMonSeq() [1/3]

TrigMonSeq::TrigMonSeq ( )

Definition at line 25 of file TrigMonSeq.cxx.

26  :m_encoded(0x0)
27 {
28 }

◆ 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.

38  :m_encoded(chn.getEncodedId())
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
46  m_var_key.push_back(LARGE_INDEX_SEQ_LOCATION);
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 }

◆ ~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); }

◆ 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  //
82  m_encoded |= value;
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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

Friends And Related Function Documentation

◆ 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:
test_athena_ntuple_filter.seq
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
Definition: test_athena_ntuple_filter.py:18
beamspotman.r
def r
Definition: beamspotman.py:676
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
TrigMonAlg::isCached
bool isCached() const
Definition: TrigMonAlg.cxx:136
TrigMonSeq::kUnknown
@ kUnknown
Definition: TrigMonSeq.h:32
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TrigMonSeq::kStart
@ kStart
Definition: TrigMonSeq.h:34
TrigMonSeq::getSeqIndex
uint16_t getSeqIndex() const
Definition: TrigMonSeq.cxx:143
TrigMonAlg::getRoiId
uint8_t getRoiId(unsigned int i=0) const
Definition: TrigMonAlg.cxx:116
TrigConfChain::getEncodedId
uint16_t getEncodedId() const
Definition: TrigConfChain.cxx:151
TrigMonAlg::getNRoi
uint8_t getNRoi() const
Definition: TrigMonAlg.cxx:107
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
TrigMonSeq::kPrevious
@ kPrevious
Definition: TrigMonSeq.h:36
TrigMonSeq::isInitial
bool isInitial() const
Definition: TrigMonSeq.cxx:86
athena.value
value
Definition: athena.py:124
TrigMonAlg::elapsed
double elapsed() const
Definition: TrigMonAlg.h:57
TrigMonSeq::kAlreadyExecuted
@ kAlreadyExecuted
Definition: TrigMonSeq.h:35
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
TrigMonTimer::getSec
uint32_t getSec() const
Definition: TrigMonTimer.cxx:61
TrigMonSeq::m_var_key
std::vector< uint16_t > m_var_key
Definition: TrigMonSeq.h:77
TrigMonSeq::isExecuted
bool isExecuted() const
Definition: TrigMonSeq.cxx:95
TrigMonSeq::kInitial
@ kInitial
Definition: TrigMonSeq.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigMonAlg::stop
const TrigMonTimer stop() const
Definition: TrigMonAlg.cxx:167
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConfAlg
Definition: TrigConfAlg.h:25
TrigMonVar
Definition: TrigMonVar.h:59
Trig::getCounterFromEncodedId
uint16_t getCounterFromEncodedId(uint16_t encoded)
Definition: TrigConfChain.h:158
SeqBits::shiftIndex
const uint32_t shiftIndex
Definition: TrigMonSeq.cxx:17
TrigConfSeq::getIndex
uint16_t getIndex() const
Definition: TrigConfSeq.h:42
TrigMonTimer::getMicroSec
uint32_t getMicroSec() const
Definition: TrigMonTimer.cxx:68
TrigConfAlg::getName
const std::string & getName() const
Definition: TrigConfAlg.h:39
TrigMonSeq::getChnEncodedId
uint16_t getChnEncodedId() const
Definition: TrigMonSeq.cxx:134
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonSeq::m_var_val
std::vector< float > m_var_val
Definition: TrigMonSeq.h:78
TrigMonAlg::isCalled
bool isCalled() const
Definition: TrigMonAlg.cxx:145
TrigMonSeq::m_encoded
uint32_t m_encoded
Definition: TrigMonSeq.h:75
SeqBits::maskLow16
const uint32_t maskLow16
Definition: TrigMonSeq.cxx:15
TrigMonSeq::getSeqTimer
float getSeqTimer() const
Definition: TrigMonSeq.cxx:170
TrigMonAlg::start
const TrigMonTimer start() const
Definition: TrigMonAlg.cxx:154
Trig::getLevelFromEncodedId
uint16_t getLevelFromEncodedId(uint16_t encoded)
Definition: TrigConfChain.h:161
TrigMonSeq::m_alg
std::vector< TrigMonAlg > m_alg
Definition: TrigMonSeq.h:76
TrigConfSeq::getName
const std::string & getName() const
Definition: TrigConfSeq.h:44
SeqBits::maskIndex
const uint32_t maskIndex
Definition: TrigMonSeq.cxx:16
TrigMonAlg::getPosition
uint8_t getPosition() const
Definition: TrigMonAlg.cxx:98
TrigMonAlg
Summary of single agorithm execution. Algorithm is identified by position within parent sequence....
Definition: TrigMonAlg.h:30
TrigMonSeq::isAlreadyExecuted
bool isAlreadyExecuted() const
Definition: TrigMonSeq.cxx:104
TrigConfSeq::getAlg
const TrigConfAlg & getAlg(unsigned int pos) const
Definition: TrigConfSeq.cxx:44
TrigMonSeq::isPrevious
bool isPrevious() const
Definition: TrigMonSeq.cxx:113
TrigMonSeq::getAlgTimer
double getAlgTimer() const
Definition: TrigMonSeq.cxx:156