ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMonRoi.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGMON_ROI_H
6#define TRIGMON_ROI_H
7
8/*
9 @author Rustem Ospanov
10 @date July 2009
11
12 @brief Compact copy of TrigRoIDescriptor.
13*/
14
15// Framework
17
18// C/C++
19#include <stdint.h>
20#include <vector>
21
22// Local
24
26{
27 public:
28
29 enum Type {
30 kNone = 0,
31 kMuon = 1,
32 kEmTau = 2,
33 kJet = 3,
34 kJetEt = 4,
36 };
37
38 TrigMonRoi();
39 explicit TrigMonRoi(unsigned int roi_word);
41
42 void setType(Type type);
43 void addWord(unsigned int word) { m_word.push_back(word); }
44
45 void setRoiId(unsigned int id);
46 void setNL1th(unsigned int lt);
47
48 void setEtaPhi (float eta, float phi);
49 void setRoIArea(float eta_width, float phi_width);
50
51 void addVar(const TrigMonVar &var);
52
53 uint32_t getRoiWord() const { return m_word[0]; }
54
55 Type getRoiType() const;
56 uint32_t getRoiId() const;
57 uint8_t getNL1th() const;
58
59 float getEta() const;
60 float getPhi() const;
61 float getRoIArea() const;
62
63 std::vector<uint32_t>& getWord() { return m_word; }
64 std::vector<uint16_t>& getVarKey() { return m_var_key; }
65 std::vector<float>& getVarVal() { return m_var_val; }
66
67 const std::vector<uint32_t>& getWord() const { return m_word; }
68 const std::vector<uint16_t>& getVarKey() const { return m_var_key; }
69 const std::vector<float>& getVarVal() const { return m_var_val; }
70 float getVarVal( const uint32_t key ) const;
71 const std::vector<TrigMonVar> getVar() const;
72
73 void print(std::ostream &os = std::cout);
74
75 private:
76
77 std::vector<uint32_t> m_word; // Encoded RoIWord and other data
78 std::vector<uint16_t> m_var_key; // Variable key
79 std::vector<float> m_var_val; // Variable value
80};
81
82std::string str(const TrigMonRoi &);
83
84namespace Trig
85{
86 //
87 // Roi id for special two cases when RoiId is not available
88 //
89 inline uint8_t getRoiId_Unknown() { return 255; }
90 inline uint8_t getRoiId_JetEt() { return 254; }
91 inline uint8_t getRoiId_Energy() { return 253; }
92}
93
94//
95// m_word[0] = L1 hardware RoI word
96//
97// m_word[1] = encoded word, if set it stores:
98// 8 bits: 0- 8 [i] RoiId assigned by HLT
99// 4 bits: 9-12 [t] RoiType assigned by HLT
100// 8 bits: 13-20 [l] number of L1 thresholds activated by HLT
101// 12 bits: 21-32 [f] free
102//
103// m_encoded = [pppppppppppp][llllllll][tttt][rrrrrrrr]
104//
105// In 2012 data, we add one more variable to record full RoI Id
106// m_word[2] = RoI Id
107//
108
109//
110// Inlined global comparison operators
111//
112inline bool operator==(const TrigMonRoi &lhs, const TrigMonRoi &rhs) {
113 return lhs.getRoiWord() == rhs.getRoiWord();
114}
115inline bool operator <(const TrigMonRoi &lhs, const TrigMonRoi &rhs) {
116 return lhs.getRoiWord() < rhs.getRoiWord();
117}
118
119inline bool operator==(const TrigMonRoi &roi, unsigned int word) {
120 return roi.getRoiWord() == word;
121}
122inline bool operator==(unsigned int word, const TrigMonRoi &roi) {
123 return word == roi.getRoiWord();
124}
125
126CLASS_DEF( TrigMonRoi , 125550248 , 1 )
127
128#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
bool operator<(const TrigMonRoi &lhs, const TrigMonRoi &rhs)
Definition TrigMonRoi.h:115
bool operator==(const TrigMonRoi &lhs, const TrigMonRoi &rhs)
Definition TrigMonRoi.h:112
std::vector< float > m_var_val
Definition TrigMonRoi.h:79
void setRoiId(unsigned int id)
uint8_t getNL1th() const
uint32_t getRoiId() const
std::vector< uint16_t > & getVarKey()
Definition TrigMonRoi.h:64
const std::vector< float > & getVarVal() const
Definition TrigMonRoi.h:69
float getEta() const
TrigMonRoi(unsigned int roi_word)
float getPhi() const
std::vector< uint32_t > m_word
Definition TrigMonRoi.h:77
std::vector< uint16_t > m_var_key
Definition TrigMonRoi.h:78
float getRoIArea() const
const std::vector< TrigMonVar > getVar() const
void setNL1th(unsigned int lt)
std::vector< uint32_t > & getWord()
Definition TrigMonRoi.h:63
uint32_t getRoiWord() const
Definition TrigMonRoi.h:53
const std::vector< uint32_t > & getWord() const
Definition TrigMonRoi.h:67
void setEtaPhi(float eta, float phi)
void print(std::ostream &os=std::cout)
const std::vector< uint16_t > & getVarKey() const
Definition TrigMonRoi.h:68
std::vector< float > & getVarVal()
Definition TrigMonRoi.h:65
Type getRoiType() const
void setRoIArea(float eta_width, float phi_width)
void addVar(const TrigMonVar &var)
void setType(Type type)
void addWord(unsigned int word)
Definition TrigMonRoi.h:43
The common trigger namespace for trigger analysis tools.
uint8_t getRoiId_Energy()
Definition TrigMonRoi.h:91
uint8_t getRoiId_JetEt()
Definition TrigMonRoi.h:90
uint8_t getRoiId_Unknown()
Definition TrigMonRoi.h:89