ATLAS Offline Software
TrigMonEvent.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMON_EVENT_H
6 #define TRIGMON_EVENT_H
7 
8 /*
9  @author Rustem Ospanov
10  @date July 2009
11 
12  @brief Summary of trigger data for single event.
13  Class holds monitoring data in vectors by value.
14  Some of functions are implemented via partial specialization
15  of member function templates to save on repeating function
16  declarations.
17 */
18 
19 // Framework
20 #include "AthenaKernel/CLASS_DEF.h"
21 
22 // C/C++
23 #include <vector>
24 
25 // Local
34 
36 {
37  public:
38 
39  TrigMonEvent();
41 
42  static std::string getType() { return "TrigMonEvent"; }
43 
44  template<class T> typename std::vector<T>::const_iterator begin() const;
45  template<class T> typename std::vector<T>::const_iterator end() const;
46 
47  template<class T> unsigned int size() const;
48 
49  template<class T> const T& at(unsigned int i) const;
50 
51  template<class T> std::vector<T>& getVec();
52  template<class T> const std::vector<T>& getVec() const;
53 
54  template<class T> bool add(const T &obj);
55 
56  // Additional overloads callable from python.
57  const std::vector<TrigMonROB>& getROBVec() const { return m_rob; }
58  const std::vector<TrigMonRoi>& getRoiVec() const { return m_roi; }
59  const std::vector<TrigMonSeq>& getSeqVec() const { return m_seq; }
60  const std::vector<TrigMonTE>& getTEVec() const { return m_te; }
61 
62  void clear();
63 
65  uint32_t bxid, uint32_t run,
66  uint32_t sec, uint32_t nsec);
67 
68  void setTimer(float timer);
69  void addWord(uint32_t word) { m_word.push_back(word); }
70 
71  std::vector<uint16_t>& getL1Item() { return m_l1; }
72  std::vector<uint32_t>& getChain() { return m_hlt; }
73  std::vector<uint32_t>& getWord() { return m_word; }
74  std::vector<uint32_t>& getVarKey() { return m_var_key; }
75  std::vector<float>& getVarVal() { return m_var_val; }
76 
77  uint32_t getEvent() const { return m_event; }
78  uint32_t getLumi() const;
79  uint32_t getBunchId() const;
80  uint32_t getRun() const { return m_run; }
81  uint32_t getSec() const { return m_sec; }
82  uint32_t getNanoSec() const { return m_nsec; }
83  float getTimer() const;
84 
85  void addVar(uint32_t key, float var);
86  bool getVar(uint32_t key, float &var) const;
87  bool getKey(uint32_t &key, float var) const;
88 
89  const std::vector<TrigMonL1Item> getL1Items() const;
90  const std::vector<TrigMonChain> getChains() const;
91  const std::vector<TrigMonVar> getVar() const;
92 
93  const std::vector<uint16_t>& getL1Item() const { return m_l1; }
94  const std::vector<uint32_t>& getChain() const { return m_hlt; }
95  const std::vector<uint32_t>& getWord() const { return m_word; }
96 
97  const std::vector<uint32_t>& getVarKey() const { return m_var_key; }
98  const std::vector<float>& getVarVal() const { return m_var_val; }
99 
100  private:
101  friend class TrigMonEventCnv_p1;
102 
103  // These variables are copied from EventID
104  uint32_t m_event; // Event number
105  uint32_t m_lumi; // Lumi block (low 16 bits) and bunch crossing id (high 16 bits)
106  uint32_t m_bxid; // Actually stores total event processing time
107  uint32_t m_run; // Run number
108  uint32_t m_sec; // Event second
109  uint32_t m_nsec; // Event ns
110  std::vector<uint32_t> m_word; // Additional payload
111 
112  // Monitoring data - not all vectors are filled
113  std::vector<TrigMonROB> m_rob; // ROB data requests
114  std::vector<TrigMonRoi> m_roi; // RoI descriptors
115  std::vector<TrigMonSeq> m_seq; // Sequence and algorithm execution timers
116  std::vector<TrigMonTE> m_te; // Trigger elements summary
117 
118  // L1 and HLT decisions
119  std::vector<uint16_t> m_l1; // Encoded TrigMonL1Item
120  std::vector<uint32_t> m_hlt; // Encoded TrigMonChain
121 
122  // Variables stored as int, float pairs
123  std::vector<uint32_t> m_var_key; // Variable key
124  std::vector<float> m_var_val; // Variable value
125 };
126 
127 unsigned getTrigMonEventVersion();
128 
129 // Include template code: specialization of member templates
131 
132 CLASS_DEF( TrigMonEvent , 243892660 , 1 )
133 
134 #endif
TrigMonEvent::m_nsec
uint32_t m_nsec
Definition: TrigMonEvent.h:109
TrigMonEvent::m_lumi
uint32_t m_lumi
Definition: TrigMonEvent.h:105
TrigMonEvent::add
bool add(const T &obj)
TrigMonL1Item.h
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
TrigMonEvent::m_event
uint32_t m_event
Definition: TrigMonEvent.h:104
TrigMonEvent::getVarKey
const std::vector< uint32_t > & getVarKey() const
Definition: TrigMonEvent.h:97
TrigMonEvent::getRoiVec
const std::vector< TrigMonRoi > & getRoiVec() const
Definition: TrigMonEvent.h:58
TrigMonROB.h
TrigMonEvent::getType
static std::string getType()
Definition: TrigMonEvent.h:42
TrigMonEvent::TrigMonEvent
TrigMonEvent()
Definition: TrigMonEvent.cxx:31
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
TrigMonEvent::at
const T & at(unsigned int i) const
TrigMonEvent::getEvent
uint32_t getEvent() const
Definition: TrigMonEvent.h:77
TrigMonVar.h
TrigMonEvent::begin
std::vector< T >::const_iterator begin() const
TrigMonChain.h
TrigMonEvent::m_word
std::vector< uint32_t > m_word
Definition: TrigMonEvent.h:110
TrigMonEvent::clear
void clear()
Definition: TrigMonEvent.cxx:42
TrigMonEvent::m_var_key
std::vector< uint32_t > m_var_key
Definition: TrigMonEvent.h:123
TrigMonEvent::~TrigMonEvent
~TrigMonEvent()
Definition: TrigMonEvent.h:40
TrigMonEvent::getChain
std::vector< uint32_t > & getChain()
Definition: TrigMonEvent.h:72
TrigMonEvent::getWord
std::vector< uint32_t > & getWord()
Definition: TrigMonEvent.h:73
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
TrigMonEvent::getTimer
float getTimer() const
Definition: TrigMonEvent.cxx:118
TrigMonEvent::getVec
const std::vector< T > & getVec() const
TrigMonEvent::getBunchId
uint32_t getBunchId() const
Definition: TrigMonEvent.cxx:133
TrigMonSeq.h
TrigMonEvent::getKey
bool getKey(uint32_t &key, float var) const
Definition: TrigMonEvent.cxx:167
TrigMonEvent::getChains
const std::vector< TrigMonChain > getChains() const
Definition: TrigMonEvent.cxx:205
TrigMonEvent::getVarVal
const std::vector< float > & getVarVal() const
Definition: TrigMonEvent.h:98
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigMonEvent::getSec
uint32_t getSec() const
Definition: TrigMonEvent.h:81
TrigMonEvent::addWord
void addWord(uint32_t word)
Definition: TrigMonEvent.h:69
TrigMonEvent::getVarKey
std::vector< uint32_t > & getVarKey()
Definition: TrigMonEvent.h:74
TrigMonEvent::getL1Item
const std::vector< uint16_t > & getL1Item() const
Definition: TrigMonEvent.h:93
getTrigMonEventVersion
unsigned getTrigMonEventVersion()
Definition: TrigMonEvent.cxx:26
run
Definition: run.py:1
TrigMonEvent::setEventID
void setEventID(uint32_t event, uint32_t lumi, uint32_t bxid, uint32_t run, uint32_t sec, uint32_t nsec)
Definition: TrigMonEvent.cxx:66
TrigMonEvent::addVar
void addVar(uint32_t key, float var)
Definition: TrigMonEvent.cxx:139
TrigMonEvent
Definition: TrigMonEvent.h:36
TrigMonEvent::m_run
uint32_t m_run
Definition: TrigMonEvent.h:107
TrigMonEvent::m_roi
std::vector< TrigMonRoi > m_roi
Definition: TrigMonEvent.h:114
TrigMonAlg.h
TrigMonEvent::getRun
uint32_t getRun() const
Definition: TrigMonEvent.h:80
TrigMonEvent::end
std::vector< T >::const_iterator end() const
TrigMonEvent::getL1Items
const std::vector< TrigMonL1Item > getL1Items() const
Definition: TrigMonEvent.cxx:185
TrigMonEvent.icc
TrigMonEvent::getROBVec
const std::vector< TrigMonROB > & getROBVec() const
Definition: TrigMonEvent.h:57
TrigMonEvent::m_l1
std::vector< uint16_t > m_l1
Definition: TrigMonEvent.h:119
TrigMonRoi.h
TrigMonEvent::m_te
std::vector< TrigMonTE > m_te
Definition: TrigMonEvent.h:116
TrigMonEvent::m_sec
uint32_t m_sec
Definition: TrigMonEvent.h:108
TrigMonEvent::getLumi
uint32_t getLumi() const
Definition: TrigMonEvent.cxx:127
TrigMonEventCnv_p1
Definition: TrigMonEventCnv_p1.h:24
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TrigMonEvent::getVar
const std::vector< TrigMonVar > getVar() const
Definition: TrigMonEvent.cxx:225
TrigMonTE.h
TrigMonEvent::getNanoSec
uint32_t getNanoSec() const
Definition: TrigMonEvent.h:82
TrigMonEvent::m_seq
std::vector< TrigMonSeq > m_seq
Definition: TrigMonEvent.h:115
TrigMonEvent::getVec
std::vector< T > & getVec()
TrigMonEvent::getChain
const std::vector< uint32_t > & getChain() const
Definition: TrigMonEvent.h:94
TrigMonEvent::getVarVal
std::vector< float > & getVarVal()
Definition: TrigMonEvent.h:75
TrigMonEvent::m_var_val
std::vector< float > m_var_val
Definition: TrigMonEvent.h:124
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TrigMonEvent::getL1Item
std::vector< uint16_t > & getL1Item()
Definition: TrigMonEvent.h:71
TrigMonEvent::getSeqVec
const std::vector< TrigMonSeq > & getSeqVec() const
Definition: TrigMonEvent.h:59
TrigMonEvent::getTEVec
const std::vector< TrigMonTE > & getTEVec() const
Definition: TrigMonEvent.h:60
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonEvent::size
unsigned int size() const
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrigMonEvent::setTimer
void setTimer(float timer)
Definition: TrigMonEvent.cxx:96
TrigMonEvent::getWord
const std::vector< uint32_t > & getWord() const
Definition: TrigMonEvent.h:95