ATLAS Offline Software
TrigMonTE.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_TE_H
6 #define TRIGMON_TE_H
7 
15 // Framework
16 #include "AthenaKernel/CLASS_DEF.h"
17 
18 // C/C++
19 #include <iostream>
20 #include <stdint.h>
21 #include <vector>
22 
23 // Local
26 
27 class TrigMonTE
28 {
29  public:
30 
31  enum Type {
32  kELEM = 0, // Regular TE in navigation tree (default)
33  kINIT = 1, // Initial TE
34  kROI = 2, // RoI TE attached to initial TE
35  kL1TH = 3 // L1 threshold TE attached to ROI TE
36  };
37  enum State {
38  activeState = 0x010000, // Active/inactive state of TE
39  errorState = 0x020000, // There was an error in algorithms dealing with this TE
40  terminalNode = 0x040000, // Node is terminal (no more TriggerElement are seeded by it)
41  outputL2Node = 0x080000, // This is output TE of passed or passedRaw L2 chain
42  outputEFNode = 0x100000, // This is output TE of passed or passedRaw EF chain
43  topologicalTE = 0x200000 // Topological TE (more than 1 parent)
44  };
45 
46  TrigMonTE();
49 
50  void addChildIndex (uint16_t index) { m_child.push_back(index); }
51  void addParentIndex(uint16_t index) { m_parent.push_back(index); }
52 
53  void addRoiId(uint8_t roiid) { m_roi.push_back(roiid); }
54  void addClid (uint32_t clid) { m_clid.push_back(clid); }
55 
56  void addVar(const TrigMonVar &var);
57 
58  void setType (Type type);
59  void addState(State state);
60 
61  void clearIndexes() { m_child.clear(); m_parent.clear(); }
62  void clearClids() { m_clid.clear(); }
63 
64  uint32_t getId() const { return m_id; }
65  uint16_t getIndex() const;
66  Type getType() const;
67 
68  bool getActiveState() const { return m_encoded & activeState; }
69  bool getErrorState() const { return m_encoded & errorState; }
70  bool isTerminalNode() const { return m_encoded & terminalNode; }
71  bool isOutputL2Node() const { return m_encoded & outputL2Node; }
72  bool isOutputEFNode() const { return m_encoded & outputEFNode; }
73  bool isTopologicalTE() const { return m_encoded & topologicalTE; }
74 
75  const std::vector<uint16_t>& getChildIndex() const { return m_child; }
76  const std::vector<uint16_t>& getParentIndex() const { return m_parent; }
77 
78  const std::vector<uint8_t>& getRoiId() const { return m_roi; }
79  const std::vector<uint32_t>& getClid() const { return m_clid; }
80 
81  const std::vector<TrigMonVar> getVar() const;
82  const std::vector<uint16_t>& getVarKey() const { return m_var_key; }
83  const std::vector<float>& getVarVal() const { return m_var_val; }
84 
85  void print(std::ostream &os = std::cout);
86 
87  private:
88  friend class TrigMonTECnv_p1;
89 
90  uint32_t m_id; // Trigger element id
91  uint32_t m_encoded; // Encoded word (see below)
92 
93  std::vector<uint16_t> m_child; // Index of child (successor) TEs
94  std::vector<uint16_t> m_parent; // Index of parent (predecessors) TEs
95  std::vector<uint8_t> m_roi; // RoiId of seeding roi(s)
96  std::vector<uint32_t> m_clid; // Clids of attached features
97 
98  std::vector<uint16_t> m_var_key; // Variable key
99  std::vector<float> m_var_val; // Variable value
100 };
101 
102 std::string str(const TrigMonTE &);
103 
104 //
105 // m_encoded: low 16 bits store index
106 //
107 // m_encoded: top 16 bits store State and Type enums
108 //
109 // state [s] 6 bits
110 // type [t] 2 bits
111 // free [f] 8 bits
112 //
113 
114 //
115 // Global comparison operators
116 //
117 inline bool operator==(const TrigMonTE &lhs, const TrigMonTE &rhs) {
118  return lhs.getId() == rhs.getId();
119 }
120 inline bool operator <(const TrigMonTE &lhs, const TrigMonTE &rhs) {
121  return lhs.getId() < rhs.getId();
122 }
123 
124 inline bool operator==(const TrigMonTE &te, const TrigConfSeq &seq) {
125  return te.getId() == seq.getId();
126 }
127 inline bool operator==(const TrigConfSeq &seq, const TrigMonTE &te) {
128  return te.getId() == seq.getId();
129 }
130 
131 CLASS_DEF( TrigMonTE , 233333104 , 1 )
132 
133 #endif
TrigMonTE::addChildIndex
void addChildIndex(uint16_t index)
Definition: TrigMonTE.h:50
test_athena_ntuple_filter.seq
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
Definition: test_athena_ntuple_filter.py:18
operator<
bool operator<(const TrigMonTE &lhs, const TrigMonTE &rhs)
Definition: TrigMonTE.h:120
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
operator==
bool operator==(const TrigMonTE &lhs, const TrigMonTE &rhs)
Definition: TrigMonTE.h:117
TrigMonTE::addRoiId
void addRoiId(uint8_t roiid)
Definition: TrigMonTE.h:53
TrigMonTE::getParentIndex
const std::vector< uint16_t > & getParentIndex() const
Definition: TrigMonTE.h:76
TrigMonTE::print
void print(std::ostream &os=std::cout)
Definition: TrigMonTE.cxx:118
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
TrigMonTE::clearIndexes
void clearIndexes()
Definition: TrigMonTE.h:61
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
TrigMonTE::kINIT
@ kINIT
Definition: TrigMonTE.h:33
TrigMonVar.h
TrigMonTE::TrigMonTE
TrigMonTE()
Definition: TrigMonTE.cxx:23
TrigMonTE::getClid
const std::vector< uint32_t > & getClid() const
Definition: TrigMonTE.h:79
TrigMonTE::clearClids
void clearClids()
Definition: TrigMonTE.h:62
TrigMonTE::addState
void addState(State state)
Definition: TrigMonTE.cxx:58
TrigMonTE::m_id
uint32_t m_id
Definition: TrigMonTE.h:90
TrigMonTE::isOutputL2Node
bool isOutputL2Node() const
Definition: TrigMonTE.h:71
TrigMonTE::m_clid
std::vector< uint32_t > m_clid
Definition: TrigMonTE.h:96
TrigMonTE::outputEFNode
@ outputEFNode
Definition: TrigMonTE.h:42
TrigMonTE::getType
Type getType() const
Definition: TrigMonTE.cxx:67
TrigMonTE::addVar
void addVar(const TrigMonVar &var)
Definition: TrigMonTE.cxx:37
str
std::string str(const TrigMonTE &)
Definition: TrigMonTE.cxx:124
TrigMonTE::isTopologicalTE
bool isTopologicalTE() const
Definition: TrigMonTE.h:73
TrigMonTE::isOutputEFNode
bool isOutputEFNode() const
Definition: TrigMonTE.h:72
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigMonTECnv_p1
Definition: TrigMonTECnv_p1.h:16
TrigConfSeq.h
TrigMonTE::activeState
@ activeState
Definition: TrigMonTE.h:38
TrigConfSeq
Definition: TrigConfSeq.h:29
TrigMonTE::getChildIndex
const std::vector< uint16_t > & getChildIndex() const
Definition: TrigMonTE.h:75
TrigMonTE::kELEM
@ kELEM
Definition: TrigMonTE.h:32
TrigMonVar
Definition: TrigMonVar.h:59
TrigMonTE::getIndex
uint16_t getIndex() const
Definition: TrigMonTE.cxx:87
TrigMonTE::m_encoded
uint32_t m_encoded
Definition: TrigMonTE.h:91
TrigMonTE
Summary of one trigger element from navigation tree.
Definition: TrigMonTE.h:28
TrigMonTE::State
State
Definition: TrigMonTE.h:37
TrigMonTE::getVar
const std::vector< TrigMonVar > getVar() const
Definition: TrigMonTE.cxx:96
TrigMonTE::getId
uint32_t getId() const
Definition: TrigMonTE.h:64
TrigMonTE::kROI
@ kROI
Definition: TrigMonTE.h:34
xAODType
Definition: ObjectType.h:13
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonTE::errorState
@ errorState
Definition: TrigMonTE.h:39
TrigMonTE::m_var_key
std::vector< uint16_t > m_var_key
Definition: TrigMonTE.h:98
TrigMonTE::getVarKey
const std::vector< uint16_t > & getVarKey() const
Definition: TrigMonTE.h:82
TrigMonTE::getErrorState
bool getErrorState() const
Definition: TrigMonTE.h:69
TrigMonTE::getRoiId
const std::vector< uint8_t > & getRoiId() const
Definition: TrigMonTE.h:78
TrigMonTE::kL1TH
@ kL1TH
Definition: TrigMonTE.h:35
TrigMonTE::getVarVal
const std::vector< float > & getVarVal() const
Definition: TrigMonTE.h:83
TrigMonTE::~TrigMonTE
~TrigMonTE()
Definition: TrigMonTE.h:48
TrigMonTE::isTerminalNode
bool isTerminalNode() const
Definition: TrigMonTE.h:70
TrigMonTE::addClid
void addClid(uint32_t clid)
Definition: TrigMonTE.h:54
TrigMonTE::addParentIndex
void addParentIndex(uint16_t index)
Definition: TrigMonTE.h:51
TrigMonTE::topologicalTE
@ topologicalTE
Definition: TrigMonTE.h:43
TrigMonTE::setType
void setType(Type type)
Definition: TrigMonTE.cxx:49
TrigMonTE::getActiveState
bool getActiveState() const
Definition: TrigMonTE.h:68
TrigMonTE::m_child
std::vector< uint16_t > m_child
Definition: TrigMonTE.h:93
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
TrigMonTE::outputL2Node
@ outputL2Node
Definition: TrigMonTE.h:41
TrigMonTE::m_var_val
std::vector< float > m_var_val
Definition: TrigMonTE.h:99
TrigMonTE::terminalNode
@ terminalNode
Definition: TrigMonTE.h:40
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonTE::m_roi
std::vector< uint8_t > m_roi
Definition: TrigMonTE.h:95
TrigMonTE::m_parent
std::vector< uint16_t > m_parent
Definition: TrigMonTE.h:94