ATLAS Offline Software
Loading...
Searching...
No Matches
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
21
22// C/C++
23#include <vector>
24
25// Local
34
36{
37 public:
38
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
64 void setEventID(uint32_t event, uint32_t lumi,
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
127unsigned getTrigMonEventVersion();
128
129// Include template code: specialization of member templates
131
132CLASS_DEF( TrigMonEvent , 243892660 , 1 )
133
134#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
unsigned getTrigMonEventVersion()
std::vector< float > & getVarVal()
std::vector< uint32_t > & getVarKey()
void addWord(uint32_t word)
std::vector< uint16_t > m_l1
std::vector< T >::const_iterator end() const
uint32_t m_bxid
unsigned int size() const
std::vector< uint32_t > & getChain()
uint32_t getLumi() const
uint32_t getNanoSec() const
void setEventID(uint32_t event, uint32_t lumi, uint32_t bxid, uint32_t run, uint32_t sec, uint32_t nsec)
bool getKey(uint32_t &key, float var) const
uint32_t getSec() const
const std::vector< TrigMonROB > & getROBVec() const
std::vector< TrigMonSeq > m_seq
const std::vector< uint32_t > & getWord() const
void setTimer(float timer)
const std::vector< TrigMonChain > getChains() const
std::vector< uint32_t > m_var_key
uint32_t m_sec
uint32_t m_lumi
std::vector< uint16_t > & getL1Item()
void addVar(uint32_t key, float var)
const std::vector< TrigMonTE > & getTEVec() const
static std::string getType()
const std::vector< TrigMonRoi > & getRoiVec() const
const std::vector< float > & getVarVal() const
std::vector< uint32_t > m_hlt
uint32_t getEvent() const
std::vector< TrigMonROB > m_rob
std::vector< uint32_t > m_word
bool add(const T &obj)
std::vector< float > m_var_val
std::vector< uint32_t > & getWord()
std::vector< TrigMonTE > m_te
uint32_t m_run
float getTimer() const
const std::vector< uint32_t > & getVarKey() const
friend class TrigMonEventCnv_p1
const std::vector< uint16_t > & getL1Item() const
std::vector< T > & getVec()
const std::vector< T > & getVec() const
uint32_t getBunchId() const
const std::vector< uint32_t > & getChain() const
uint32_t m_nsec
const T & at(unsigned int i) const
uint32_t getRun() const
const std::vector< TrigMonSeq > & getSeqVec() const
const std::vector< TrigMonL1Item > getL1Items() const
const std::vector< TrigMonVar > getVar() const
uint32_t m_event
std::vector< TrigMonRoi > m_roi
std::vector< T >::const_iterator begin() const
Definition run.py:1