ATLAS Offline Software
TrigMonConfig.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_CONFIG_H
6 #define TRIGMON_CONFIG_H
7 
16 // Framework
17 #include "AthenaKernel/CLASS_DEF.h"
19 
20 // C/C++
21 #include <vector>
22 
23 // Local
27 
29 {
30  public:
31 
32  TrigMonConfig();
34 
35  static std::string getType() { return "TrigMonConfig"; }
36 
37  template<class T> typename std::vector<T>::const_iterator begin() const;
38  template<class T> typename std::vector<T>::const_iterator end() const;
39 
40  template<class T> bool add(const T &obj);
41 
42  template<class T> std::vector<T>& getVec();
43 
44  template<class T> const std::vector<T>& getVec() const;
45 
46  template<class T> unsigned int size() const;
47 
48  template<class T> const T& at(unsigned int i) const;
49 
50  template<class T> typename std::vector<TrigConfChain>::const_iterator findChain(const T& key) const;
51  template<class T> typename std::vector<TrigConfSeq>::const_iterator findSeq(const T& key) const;
52 
53  template<class T> typename std::vector<TrigConfChain>::iterator findChainIter(const T& key);
54  template<class T> typename std::vector<TrigConfSeq>::iterator findSeqIter(const T& key);
55 
56  // Additional overloads callable from python.
57  const std::vector<TrigConfChain>& getChainVec() const { return m_chain; }
58  const std::vector<TrigConfSeq>& getSeqVec() const { return m_seq; }
59 
60  void clear();
61  void clearStrings();
62  void processConfig ATLAS_NOT_THREAD_SAFE ();
63 
65  uint32_t sec, uint32_t nsec);
66 
67  void setTriggerKeys(uint32_t master_key, uint32_t lv1_ps_key, uint32_t hlt_ps_key);
68 
69  void addValue(const std::string &key, const std::string &val);
70 
71  std::vector<std::string>& getVarName() { return m_var_name; }
72  std::vector<uint32_t>& getVarId() { return m_var_id; }
73  std::vector<std::string>& getPairKey() { return m_pair_key; }
74  std::vector<std::string>& getPairVal() { return m_pair_val; }
75 
76  uint32_t getEvent() const { return m_event; }
77  uint32_t getLumi() const { return m_lumi; }
78  uint32_t getRun() const { return m_run; }
79  uint32_t getSec() const { return m_sec; }
80  uint32_t getNanoSec() const { return m_nsec; }
81 
82  uint32_t getMasterKey() const { return m_master_key; }
85 
86  bool keyExists(const std::string &key) const;
87  bool readValue(const std::string &key, std::string &val) const;
88 
89  uint32_t getId (const std::string &name, const std::string &key) const;
90  uint16_t getEncodedId(const std::string &name, const std::string &key) const;
91  const std::string getName (uint32_t id, const std::string &key) const;
92 
93  const std::vector<TrigConfVar> getConfVar() const;
94 
95  const std::vector<std::string>& getVarName() const { return m_var_name; }
96  const std::vector<uint32_t>& getVarId() const { return m_var_id; }
97 
98  const std::vector<std::string>& getPairKey() const { return m_pair_key; }
99  const std::vector<std::string>& getPairVal() const { return m_pair_val; }
100 
101  private:
102 
103  // These variables are filled from EventID object
104  uint32_t m_event; // Event number
105  uint32_t m_lumi; // Lumi block
106  uint32_t m_run; // Run number
107  uint32_t m_sec; // Event second
108  uint32_t m_nsec; // Event ns
109 
110  // Trigger configuration keys
111  uint32_t m_master_key; // Configuration key (SMK)
112  uint32_t m_hlt_ps_key; // HLT prescale key
113  uint32_t m_lv1_ps_key; // L1 prescale key
114 
115  std::vector<TrigConfChain> m_chain; // Chain configuration
116  std::vector<TrigConfSeq> m_seq; // Sequence configuration
117 
118  std::vector<std::string> m_var_name; // Variable configuration: (name, id) pairs
119  std::vector<uint32_t> m_var_id; // Variable configuration: (name, id) pairs
120 
121  std::vector<std::string> m_pair_key; // Key for string pairs
122  std::vector<std::string> m_pair_val; // Value for string pairs
123 };
124 
125 // Include template code: specialization of member templates
127 
128 CLASS_DEF( TrigMonConfig , 253562967 , 1 )
129 
130 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigMonConfig::getPairKey
std::vector< std::string > & getPairKey()
Definition: TrigMonConfig.h:73
TrigMonConfig::getVarName
std::vector< std::string > & getVarName()
Definition: TrigMonConfig.h:71
TrigMonConfig::~TrigMonConfig
~TrigMonConfig()
Definition: TrigMonConfig.h:33
TrigMonConfig::m_nsec
uint32_t m_nsec
Definition: TrigMonConfig.h:108
TrigMonConfig::m_hlt_ps_key
uint32_t m_hlt_ps_key
Definition: TrigMonConfig.h:112
TrigMonConfig::findChain
std::vector< TrigConfChain >::const_iterator findChain(const T &key) const
TrigMonConfig::m_run
uint32_t m_run
Definition: TrigMonConfig.h:106
TrigMonConfig::m_pair_key
std::vector< std::string > m_pair_key
Definition: TrigMonConfig.h:121
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigMonConfig::ATLAS_NOT_THREAD_SAFE
void processConfig ATLAS_NOT_THREAD_SAFE()
TrigMonConfig::m_seq
std::vector< TrigConfSeq > m_seq
Definition: TrigMonConfig.h:116
TrigMonConfig::getLV1PrescaleKey
uint32_t getLV1PrescaleKey() const
Definition: TrigMonConfig.h:84
TrigConfVar.h
TrigMonConfig::size
unsigned int size() const
TrigMonConfig::getVarId
const std::vector< uint32_t > & getVarId() const
Definition: TrigMonConfig.h:96
TrigMonConfig::m_chain
std::vector< TrigConfChain > m_chain
Definition: TrigMonConfig.h:115
TrigMonConfig::getEncodedId
uint16_t getEncodedId(const std::string &name, const std::string &key) const
Definition: TrigMonConfig.cxx:215
TrigMonConfig::findSeq
std::vector< TrigConfSeq >::const_iterator findSeq(const T &key) const
TrigMonConfig::m_var_name
std::vector< std::string > m_var_name
Definition: TrigMonConfig.h:118
TrigMonConfig::getSec
uint32_t getSec() const
Definition: TrigMonConfig.h:79
TrigMonConfig::TrigMonConfig
TrigMonConfig()
Definition: TrigMonConfig.cxx:13
TrigMonConfig::getChainVec
const std::vector< TrigConfChain > & getChainVec() const
Definition: TrigMonConfig.h:57
TrigMonConfig::setTriggerKeys
void setTriggerKeys(uint32_t master_key, uint32_t lv1_ps_key, uint32_t hlt_ps_key)
Definition: TrigMonConfig.cxx:102
TrigMonConfig::m_event
uint32_t m_event
Definition: TrigMonConfig.h:104
TrigMonConfig::getConfVar
const std::vector< TrigConfVar > getConfVar() const
Definition: TrigMonConfig.cxx:291
TrigMonConfig::m_pair_val
std::vector< std::string > m_pair_val
Definition: TrigMonConfig.h:122
TrigMonConfig::findSeqIter
std::vector< TrigConfSeq >::iterator findSeqIter(const T &key)
TrigMonConfig::setEventID
void setEventID(uint32_t event, uint32_t lumi, uint32_t run, uint32_t sec, uint32_t nsec)
Definition: TrigMonConfig.cxx:85
TrigMonConfig::clearStrings
void clearStrings()
Definition: TrigMonConfig.cxx:50
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
TrigMonConfig::getLumi
uint32_t getLumi() const
Definition: TrigMonConfig.h:77
TrigMonConfig::getVarName
const std::vector< std::string > & getVarName() const
Definition: TrigMonConfig.h:95
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigMonConfig::getRun
uint32_t getRun() const
Definition: TrigMonConfig.h:78
TrigConfSeq.h
TrigConfChain.h
TrigMonConfig::add
bool add(const T &obj)
TrigMonConfig::getPairVal
std::vector< std::string > & getPairVal()
Definition: TrigMonConfig.h:74
TrigMonConfig::getSeqVec
const std::vector< TrigConfSeq > & getSeqVec() const
Definition: TrigMonConfig.h:58
TrigMonConfig::getName
const std::string getName(uint32_t id, const std::string &key) const
Definition: TrigMonConfig.cxx:239
TrigMonConfig::getPairKey
const std::vector< std::string > & getPairKey() const
Definition: TrigMonConfig.h:98
TrigMonConfig::m_master_key
uint32_t m_master_key
Definition: TrigMonConfig.h:111
run
Definition: run.py:1
TrigMonConfig::getId
uint32_t getId(const std::string &name, const std::string &key) const
Definition: TrigMonConfig.cxx:166
TrigMonConfig::end
std::vector< T >::const_iterator end() const
TrigMonConfig::getVec
const std::vector< T > & getVec() const
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigMonConfig::addValue
void addValue(const std::string &key, const std::string &val)
Definition: TrigMonConfig.cxx:115
TrigMonConfig
This class holds encoded ids for monitoring objects and helps to map these objects to trigger configu...
Definition: TrigMonConfig.h:29
TrigMonConfig::getPairVal
const std::vector< std::string > & getPairVal() const
Definition: TrigMonConfig.h:99
TrigMonConfig::m_sec
uint32_t m_sec
Definition: TrigMonConfig.h:107
TrigMonConfig::begin
std::vector< T >::const_iterator begin() const
TrigMonConfig::m_var_id
std::vector< uint32_t > m_var_id
Definition: TrigMonConfig.h:119
TrigMonConfig::getEvent
uint32_t getEvent() const
Definition: TrigMonConfig.h:76
TrigMonConfig::getMasterKey
uint32_t getMasterKey() const
Definition: TrigMonConfig.h:82
lumiFormat.lumi
lumi
Definition: lumiFormat.py:113
TrigMonConfig::at
const T & at(unsigned int i) const
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
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
TrigMonConfig::keyExists
bool keyExists(const std::string &key) const
Definition: TrigMonConfig.cxx:125
TrigMonConfig::clear
void clear()
Definition: TrigMonConfig.cxx:26
TrigMonConfig::getHLTPrescaleKey
uint32_t getHLTPrescaleKey() const
Definition: TrigMonConfig.h:83
TrigMonConfig::m_lv1_ps_key
uint32_t m_lv1_ps_key
Definition: TrigMonConfig.h:113
TrigMonConfig::findChainIter
std::vector< TrigConfChain >::iterator findChainIter(const T &key)
TrigMonConfig::m_lumi
uint32_t m_lumi
Definition: TrigMonConfig.h:105
TrigMonConfig::readValue
bool readValue(const std::string &key, std::string &val) const
Definition: TrigMonConfig.cxx:145
TrigMonConfig::getVec
std::vector< T > & getVec()
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:135
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonConfig::getNanoSec
uint32_t getNanoSec() const
Definition: TrigMonConfig.h:80
TrigMonConfig::getVarId
std::vector< uint32_t > & getVarId()
Definition: TrigMonConfig.h:72
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TrigMonConfig::getType
static std::string getType()
Definition: TrigMonConfig.h:35
TrigMonConfig.icc
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37