ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
TrigMonEvent Class Reference

#include <TrigMonEvent.h>

Collaboration diagram for TrigMonEvent:

Public Member Functions

 TrigMonEvent ()
 
 ~TrigMonEvent ()
 
template<class T >
std::vector< T >::const_iterator begin () const
 
template<class T >
std::vector< T >::const_iterator end () const
 
template<class T >
unsigned int size () const
 
template<class T >
const T & at (unsigned int i) const
 
template<class T >
std::vector< T > & getVec ()
 
template<class T >
const std::vector< T > & getVec () const
 
template<class T >
bool add (const T &obj)
 
const std::vector< TrigMonROB > & getROBVec () const
 
const std::vector< TrigMonRoi > & getRoiVec () const
 
const std::vector< TrigMonSeq > & getSeqVec () const
 
const std::vector< TrigMonTE > & getTEVec () const
 
void clear ()
 
void setEventID (uint32_t event, uint32_t lumi, uint32_t bxid, uint32_t run, uint32_t sec, uint32_t nsec)
 
void setTimer (float timer)
 
void addWord (uint32_t word)
 
std::vector< uint16_t > & getL1Item ()
 
std::vector< uint32_t > & getChain ()
 
std::vector< uint32_t > & getWord ()
 
std::vector< uint32_t > & getVarKey ()
 
std::vector< float > & getVarVal ()
 
uint32_t getEvent () const
 
uint32_t getLumi () const
 
uint32_t getBunchId () const
 
uint32_t getRun () const
 
uint32_t getSec () const
 
uint32_t getNanoSec () const
 
float getTimer () const
 
void addVar (uint32_t key, float var)
 
bool getVar (uint32_t key, float &var) const
 
bool getKey (uint32_t &key, float var) const
 
const std::vector< TrigMonL1ItemgetL1Items () const
 
const std::vector< TrigMonChaingetChains () const
 
const std::vector< TrigMonVargetVar () const
 
const std::vector< uint16_t > & getL1Item () const
 
const std::vector< uint32_t > & getChain () const
 
const std::vector< uint32_t > & getWord () const
 
const std::vector< uint32_t > & getVarKey () const
 
const std::vector< float > & getVarVal () const
 

Static Public Member Functions

static std::string getType ()
 

Private Attributes

uint32_t m_event
 
uint32_t m_lumi
 
uint32_t m_bxid
 
uint32_t m_run
 
uint32_t m_sec
 
uint32_t m_nsec
 
std::vector< uint32_t > m_word
 
std::vector< TrigMonROBm_rob
 
std::vector< TrigMonRoim_roi
 
std::vector< TrigMonSeqm_seq
 
std::vector< TrigMonTEm_te
 
std::vector< uint16_t > m_l1
 
std::vector< uint32_t > m_hlt
 
std::vector< uint32_t > m_var_key
 
std::vector< float > m_var_val
 

Friends

class TrigMonEventCnv_p1
 

Detailed Description

Definition at line 35 of file TrigMonEvent.h.

Constructor & Destructor Documentation

◆ TrigMonEvent()

TrigMonEvent::TrigMonEvent ( )

Definition at line 31 of file TrigMonEvent.cxx.

32  :m_event(0),
33  m_lumi(0),
34  m_bxid(0),
35  m_run(0),
36  m_sec(0),
37  m_nsec(0)
38 {
39 }

◆ ~TrigMonEvent()

TrigMonEvent::~TrigMonEvent ( )
inline

Definition at line 40 of file TrigMonEvent.h.

40 {}

Member Function Documentation

◆ add()

template<class T >
bool TrigMonEvent::add ( const T &  obj)

◆ addVar()

void TrigMonEvent::addVar ( uint32_t  key,
float  var 
)

Definition at line 139 of file TrigMonEvent.cxx.

140 {
141  //
142  // Add new variable
143  //
144  m_var_key.push_back(key);
145  m_var_val.push_back(var);
146 }

◆ addWord()

void TrigMonEvent::addWord ( uint32_t  word)
inline

Definition at line 69 of file TrigMonEvent.h.

69 { m_word.push_back(word); }

◆ at()

template<class T >
const T& TrigMonEvent::at ( unsigned int  i) const

◆ begin()

template<class T >
std::vector<T>::const_iterator TrigMonEvent::begin ( ) const

◆ clear()

void TrigMonEvent::clear ( )

Definition at line 42 of file TrigMonEvent.cxx.

43 {
44  //
45  // Erase all event data
46  //
47  m_event = 0;
48  m_lumi = 0;
49  m_bxid = 0;
50  m_run = 0;
51  m_sec = 0;
52  m_nsec = 0;
53 
54  m_word.clear();
55  m_rob.clear();
56  m_roi.clear();
57  m_seq.clear();
58  m_te.clear();
59  m_l1.clear();
60  m_hlt.clear();
61  m_var_key.clear();
62  m_var_val.clear();
63 }

◆ end()

template<class T >
std::vector<T>::const_iterator TrigMonEvent::end ( ) const

◆ getBunchId()

uint32_t TrigMonEvent::getBunchId ( ) const

Definition at line 133 of file TrigMonEvent.cxx.

134 {
136 }

◆ getChain() [1/2]

std::vector<uint32_t>& TrigMonEvent::getChain ( )
inline

Definition at line 72 of file TrigMonEvent.h.

72 { return m_hlt; }

◆ getChain() [2/2]

const std::vector<uint32_t>& TrigMonEvent::getChain ( ) const
inline

Definition at line 94 of file TrigMonEvent.h.

94 { return m_hlt; }

◆ getChains()

const std::vector< TrigMonChain > TrigMonEvent::getChains ( ) const

Definition at line 205 of file TrigMonEvent.cxx.

206 {
207  //
208  // Build variables on a fly and return vector by value
209  //
210  std::vector<TrigMonChain> chvec;
211 
212  //
213  // Iterate over chains
214  //
215  chvec.reserve(m_hlt.size());
216 
217  for(unsigned int i = 0; i < m_hlt.size(); ++i) {
218  chvec.push_back(TrigMonChain(m_hlt[i]));
219  }
220 
221  return chvec;
222 }

◆ getEvent()

uint32_t TrigMonEvent::getEvent ( ) const
inline

Definition at line 77 of file TrigMonEvent.h.

77 { return m_event; }

◆ getKey()

bool TrigMonEvent::getKey ( uint32_t &  key,
float  var 
) const

Definition at line 167 of file TrigMonEvent.cxx.

168 {
169  //
170  // Get int variable
171  //
172  if(m_var_val.size() != m_var_key.size()) return false;
173 
174  for(unsigned int i = 0; i < m_var_val.size(); ++i) {
175  if(var == m_var_val[i]) {
176  key = m_var_key[i];
177  return true;
178  }
179  }
180 
181  return false;
182 }

◆ getL1Item() [1/2]

std::vector<uint16_t>& TrigMonEvent::getL1Item ( )
inline

Definition at line 71 of file TrigMonEvent.h.

71 { return m_l1; }

◆ getL1Item() [2/2]

const std::vector<uint16_t>& TrigMonEvent::getL1Item ( ) const
inline

Definition at line 93 of file TrigMonEvent.h.

93 { return m_l1; }

◆ getL1Items()

const std::vector< TrigMonL1Item > TrigMonEvent::getL1Items ( ) const

Definition at line 185 of file TrigMonEvent.cxx.

186 {
187  //
188  // Build variables on a fly and return vector by value
189  //
190  std::vector<TrigMonL1Item> l1vec;
191 
192  //
193  // Iterate over encoded items
194  //
195  l1vec.reserve(m_l1.size());
196 
197  for(unsigned int i = 0; i < m_l1.size(); ++i) {
198  l1vec.push_back(TrigMonL1Item(m_l1[i]));
199  }
200 
201  return l1vec;
202 }

◆ getLumi()

uint32_t TrigMonEvent::getLumi ( ) const

Definition at line 127 of file TrigMonEvent.cxx.

128 {
129  return (m_lumi & EventBits::maskLumi);
130 }

◆ getNanoSec()

uint32_t TrigMonEvent::getNanoSec ( ) const
inline

Definition at line 82 of file TrigMonEvent.h.

82 { return m_nsec; }

◆ getROBVec()

const std::vector<TrigMonROB>& TrigMonEvent::getROBVec ( ) const
inline

Definition at line 57 of file TrigMonEvent.h.

57 { return m_rob; }

◆ getRoiVec()

const std::vector<TrigMonRoi>& TrigMonEvent::getRoiVec ( ) const
inline

Definition at line 58 of file TrigMonEvent.h.

58 { return m_roi; }

◆ getRun()

uint32_t TrigMonEvent::getRun ( ) const
inline

Definition at line 80 of file TrigMonEvent.h.

80 { return m_run; }

◆ getSec()

uint32_t TrigMonEvent::getSec ( ) const
inline

Definition at line 81 of file TrigMonEvent.h.

81 { return m_sec; }

◆ getSeqVec()

const std::vector<TrigMonSeq>& TrigMonEvent::getSeqVec ( ) const
inline

Definition at line 59 of file TrigMonEvent.h.

59 { return m_seq; }

◆ getTEVec()

const std::vector<TrigMonTE>& TrigMonEvent::getTEVec ( ) const
inline

Definition at line 60 of file TrigMonEvent.h.

60 { return m_te; }

◆ getTimer()

float TrigMonEvent::getTimer ( ) const

Definition at line 118 of file TrigMonEvent.cxx.

119 {
120  //
121  // Read timer stored as m_bxid variable
122  //
123  return static_cast<float>(m_bxid)/10.0;
124 }

◆ getType()

static std::string TrigMonEvent::getType ( )
inlinestatic

Definition at line 42 of file TrigMonEvent.h.

42 { return "TrigMonEvent"; }

◆ getVar() [1/2]

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

Definition at line 225 of file TrigMonEvent.cxx.

226 {
227  //
228  // Build variables on a fly and return vector by value
229  //
230  std::vector<TrigMonVar> var;
231 
232  if(m_var_key.size() == m_var_val.size()) {
233  //
234  // Iterate over keys abd values
235  //
236  var.reserve(m_var_key.size());
237 
238  for(unsigned int i = 0; i < m_var_key.size(); ++i) {
239  var.push_back(TrigMonVar(m_var_key[i], m_var_val[i]));
240  }
241  }
242 
243  return var;
244 }

◆ getVar() [2/2]

bool TrigMonEvent::getVar ( uint32_t  key,
float &  var 
) const

Definition at line 149 of file TrigMonEvent.cxx.

150 {
151  //
152  // Get float variable
153  //
154  if(m_var_val.size() != m_var_key.size()) return false;
155 
156  for(unsigned int i = 0; i < m_var_key.size(); ++i) {
157  if(key == m_var_key[i]) {
158  var = m_var_val[i];
159  return true;
160  }
161  }
162 
163  return false;
164 }

◆ getVarKey() [1/2]

std::vector<uint32_t>& TrigMonEvent::getVarKey ( )
inline

Definition at line 74 of file TrigMonEvent.h.

74 { return m_var_key; }

◆ getVarKey() [2/2]

const std::vector<uint32_t>& TrigMonEvent::getVarKey ( ) const
inline

Definition at line 97 of file TrigMonEvent.h.

97 { return m_var_key; }

◆ getVarVal() [1/2]

std::vector<float>& TrigMonEvent::getVarVal ( )
inline

Definition at line 75 of file TrigMonEvent.h.

75 { return m_var_val; }

◆ getVarVal() [2/2]

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

Definition at line 98 of file TrigMonEvent.h.

98 { return m_var_val; }

◆ getVec() [1/2]

template<class T >
std::vector<T>& TrigMonEvent::getVec ( )

◆ getVec() [2/2]

template<class T >
const std::vector<T>& TrigMonEvent::getVec ( ) const

◆ getWord() [1/2]

std::vector<uint32_t>& TrigMonEvent::getWord ( )
inline

Definition at line 73 of file TrigMonEvent.h.

73 { return m_word; }

◆ getWord() [2/2]

const std::vector<uint32_t>& TrigMonEvent::getWord ( ) const
inline

Definition at line 95 of file TrigMonEvent.h.

95 { return m_word; }

◆ setEventID()

void TrigMonEvent::setEventID ( uint32_t  event,
uint32_t  lumi,
uint32_t  bxid,
uint32_t  run,
uint32_t  sec,
uint32_t  nsec 
)

Definition at line 66 of file TrigMonEvent.cxx.

72 {
73  //
74  // Fill EventID data
75  //
76  m_event = event;
77  m_run = run;
78  m_sec = sec;
79  m_nsec = nsec;
80 
81  //
82  // Pack luminosity block and bunch crossing id into m_lumi variable
83  //
84  m_lumi = 0;
86  m_lumi |= bxid << EventBits::shftBxid;
87 
88  /*
89  cout << "TrigMonEvent::setEventID -"
90  << " lumi=" << lumi << "=" << getLumi()
91  << " bxid=" << bxid << "=" << getBunchId() << endl;
92  */
93 }

◆ setTimer()

void TrigMonEvent::setTimer ( float  timer)

Definition at line 96 of file TrigMonEvent.cxx.

97 {
98  //
99  // Convert timer to int with 0.1ms precision and 4.0e5s maximum: stored in m_bxid variable
100  //
101  timer *= 10.0;
102 
103  if(timer > 4.0e9) timer = 4.0e9;
104 
105  const float timerI = std::floor(timer);
106 
107  if(timer - timerI > 0.499) {
108  timer = timerI + 1;
109  }
110  else {
111  timer = timerI;
112  }
113 
114  m_bxid = static_cast<uint32_t>(timer);
115 }

◆ size()

template<class T >
unsigned int TrigMonEvent::size ( ) const

Friends And Related Function Documentation

◆ TrigMonEventCnv_p1

friend class TrigMonEventCnv_p1
friend

Definition at line 101 of file TrigMonEvent.h.

Member Data Documentation

◆ m_bxid

uint32_t TrigMonEvent::m_bxid
private

Definition at line 106 of file TrigMonEvent.h.

◆ m_event

uint32_t TrigMonEvent::m_event
private

Definition at line 104 of file TrigMonEvent.h.

◆ m_hlt

std::vector<uint32_t> TrigMonEvent::m_hlt
private

Definition at line 120 of file TrigMonEvent.h.

◆ m_l1

std::vector<uint16_t> TrigMonEvent::m_l1
private

Definition at line 119 of file TrigMonEvent.h.

◆ m_lumi

uint32_t TrigMonEvent::m_lumi
private

Definition at line 105 of file TrigMonEvent.h.

◆ m_nsec

uint32_t TrigMonEvent::m_nsec
private

Definition at line 109 of file TrigMonEvent.h.

◆ m_rob

std::vector<TrigMonROB> TrigMonEvent::m_rob
private

Definition at line 113 of file TrigMonEvent.h.

◆ m_roi

std::vector<TrigMonRoi> TrigMonEvent::m_roi
private

Definition at line 114 of file TrigMonEvent.h.

◆ m_run

uint32_t TrigMonEvent::m_run
private

Definition at line 107 of file TrigMonEvent.h.

◆ m_sec

uint32_t TrigMonEvent::m_sec
private

Definition at line 108 of file TrigMonEvent.h.

◆ m_seq

std::vector<TrigMonSeq> TrigMonEvent::m_seq
private

Definition at line 115 of file TrigMonEvent.h.

◆ m_te

std::vector<TrigMonTE> TrigMonEvent::m_te
private

Definition at line 116 of file TrigMonEvent.h.

◆ m_var_key

std::vector<uint32_t> TrigMonEvent::m_var_key
private

Definition at line 123 of file TrigMonEvent.h.

◆ m_var_val

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

Definition at line 124 of file TrigMonEvent.h.

◆ m_word

std::vector<uint32_t> TrigMonEvent::m_word
private

Definition at line 110 of file TrigMonEvent.h.


The documentation for this class was generated from the following files:
TrigMonEvent::m_nsec
uint32_t m_nsec
Definition: TrigMonEvent.h:109
TrigMonEvent::m_lumi
uint32_t m_lumi
Definition: TrigMonEvent.h:105
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
TrigMonEvent::m_event
uint32_t m_event
Definition: TrigMonEvent.h:104
TrigMonEvent::m_hlt
std::vector< uint32_t > m_hlt
Definition: TrigMonEvent.h:120
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigMonEvent::m_bxid
uint32_t m_bxid
Definition: TrigMonEvent.h:106
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
TrigMonEvent::m_word
std::vector< uint32_t > m_word
Definition: TrigMonEvent.h:110
TrigMonEvent::m_var_key
std::vector< uint32_t > m_var_key
Definition: TrigMonEvent.h:123
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
TrigMonEvent::m_rob
std::vector< TrigMonROB > m_rob
Definition: TrigMonEvent.h:113
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigMonVar
Definition: TrigMonVar.h:59
EventBits::shftBxid
const uint32_t shftBxid
Definition: TrigMonEvent.cxx:16
TrigMonEvent::m_run
uint32_t m_run
Definition: TrigMonEvent.h:107
TrigMonEvent::m_roi
std::vector< TrigMonRoi > m_roi
Definition: TrigMonEvent.h:114
TrigMonEvent::m_l1
std::vector< uint16_t > m_l1
Definition: TrigMonEvent.h:119
EventBits::maskLumi
const uint32_t maskLumi
Definition: TrigMonEvent.cxx:14
TrigMonEvent::m_te
std::vector< TrigMonTE > m_te
Definition: TrigMonEvent.h:116
EventBits::maskBxid
const uint32_t maskBxid
Definition: TrigMonEvent.cxx:15
TrigMonEvent::m_sec
uint32_t m_sec
Definition: TrigMonEvent.h:108
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
TrigMonChain
Summary of chain decisions.
Definition: TrigMonChain.h:26
TrigMonL1Item
Encoded L1 decision for one item.
Definition: TrigMonL1Item.h:25
TrigMonEvent::m_seq
std::vector< TrigMonSeq > m_seq
Definition: TrigMonEvent.h:115
TrigMonEvent::m_var_val
std::vector< float > m_var_val
Definition: TrigMonEvent.h:124
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37