ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDecision_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include <algorithm>
7#include <climits>
8
9// xAOD include(s):
11
12// Local include(s):
14
15namespace xAOD {
16
21
23 //
24 // Implementation of the trigger configuration key accessors
25 //
26
28 smk, setSMK )
29
30 //
32
34 //
35 // Implementation of the LVL1 result accessors
36 //
37
39 bgCode, setBGCode )
41 tav, setTAV )
43 tap, setTAP )
45 tbp, setTBP )
46
47 //
49
51 //
52 // Implementation of the HLT result accessors
53 //
54
56 lvl2ErrorBits, setLVL2ErrorBits )
58 efErrorBits, setEFErrorBits )
59
61 lvl2Truncated, setLVL2Truncated )
63 efTruncated, setEFTruncated )
64
66 lvl2PassedPhysics, setLVL2PassedPhysics )
68 efPassedPhysics, setEFPassedPhysics )
69
71 lvl2PassedRaw, setLVL2PassedRaw )
73 efPassedRaw, setEFPassedRaw )
74
76 lvl2PassedThrough, setLVL2PassedThrough )
78 efPassedThrough, setEFPassedThrough )
79
81 lvl2Prescaled, setLVL2Prescaled )
83 efPrescaled, setEFPrescaled )
84
86 lvl2Resurrected, setLVL2Resurrected )
88 efResurrected, setEFResurrected )
89
90 //
92
93} // namespace xAOD
94
96void writeBits(std::ostream& s, const std::vector< uint32_t >& input) {
97 for (size_t i = 0; i < input.size(); ++i) {
98 const uint32_t entry = input.at(i);
99 const size_t bits = CHAR_BIT * sizeof( entry ); // This is expected to be 32 bits per entry in the vector
100 for (size_t bit = 0; bit < bits; ++bit) {
101 // Examine a single bit and, if 1, print its numeric position within the vector of uint32's.
102 if (entry & (1ul << bit)) s << ((bits * i) + bit) << " ";
103 }
104 }
105 s << std::endl;
106}
107
108
109namespace xAOD {
110
111std::ostream& operator<<(std::ostream& s, const xAOD::TrigDecision_v1& td) {
112 s << "xAODTrigDecision Object: SMK=" << td.smk() << " BGCode=" << (size_t)td.bgCode() << std::endl;
113 s << " L1 Before Prescale: ";
114 writeBits(s, td.tbp());
115 s << " L1 After Prescale: ";
116 writeBits(s, td.tap());
117 s << " L1 After Veto: ";
118 writeBits(s, td.tav());
119 s << " Error Bits: L2Err=" << td.lvl2ErrorBits() << " L2Truncated=" << td.lvl2Truncated();
120 s << " EF/HLTErr=" << td.efErrorBits() << " EF/HLTTruncated=" << td.efTruncated() << std::endl;
121 // Run 1
122 bool r1 = false;
123 if (!td.lvl2Prescaled().empty() || !td.lvl2PassedPhysics().empty() || !td.lvl2PassedRaw().empty()
124 || !td.lvl2Resurrected().empty() || !td.lvl2PassedThrough().empty() ) {
125 r1 = true;
126 s << " L2 Prescaled: ";
127 writeBits(s, td.lvl2Prescaled());
128 s << " L2 Passed Physics: ";
130 s << " L2 Passed Raw: ";
131 writeBits(s, td.lvl2PassedRaw());
132 s << " L2 Resurrected/Rerun: ";
133 writeBits(s, td.lvl2Resurrected());
134 s << " L2 Passedthrough: ";
136 } else {
137 s << " No L2 Bits" << std::endl;
138 }
139 const std::string level = (r1 ? " EF" : " HLT");
140 if (!td.efPrescaled().empty() || !td.efPassedPhysics().empty() || !td.efPassedRaw().empty()
141 || !td.efResurrected().empty() || !td.efPassedThrough().empty() ) { // Run 1: EF, Runs 2, 3: HLT
142 s << level << " Prescaled: ";
143 writeBits(s, td.efPrescaled());
144 s << level << " Passed Physics: ";
145 writeBits(s, td.efPassedPhysics());
146 s << level << " Passed Raw: ";
147 writeBits(s, td.efPassedRaw());
148 s << level << " Resurrected/Rerun: ";
149 writeBits(s, td.efResurrected());
150 s << level << " Passedthrough: ";
151 writeBits(s, td.efPassedThrough());
152 } else {
153 s << " No EF/HLT Bits" << std::endl;
154 }
155 return s;
156}
157
158
159} // namespace xAOD
160
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
void writeBits(std::ostream &s, const std::vector< uint32_t > &input)
Prints space separated positions of set bits from input bitset stored in vector.
AuxElement()
Default constructor.
STL class.
Interface to the raw trigger decision information of the event.
const std::vector< uint32_t > & efPrescaled() const
Get the EF prescaled bits.
bool lvl2Truncated() const
Is the LVL2 result truncated?
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
uint32_t smk() const
Get the Super Master Key describing this object.
const std::vector< uint32_t > & lvl2PassedPhysics() const
Get the LVL2 physics decision bits.
const std::vector< uint32_t > & lvl2PassedRaw() const
Get the LVL2 passed-raw bits.
const std::vector< uint32_t > & efPassedThrough() const
Get the EF pass-through bits.
const std::vector< uint32_t > & lvl2PassedThrough() const
Get the LVL2 pass-through bits.
bool efTruncated() const
Is the EF result truncated?
const std::vector< uint32_t > & lvl2Resurrected() const
Get the LVL2 resurrected bits.
const std::vector< uint32_t > & efPassedPhysics() const
Get the EF physics decision bits.
const std::vector< uint32_t > & lvl2Prescaled() const
Get the LVL2 prescaled bits.
const std::vector< uint32_t > & tap() const
Get the Trigger After Prescale bits.
const std::vector< uint32_t > & efPassedRaw() const
Get the EF passed-raw bits.
char bgCode() const
Get the bunch group code of the current event.
const std::vector< uint32_t > & tbp() const
Get the Trigger Before Prescale bits.
const std::vector< uint32_t > & efResurrected() const
Get the EF resurrected bits.
TrigDecision_v1()
Default constructor.
uint32_t efErrorBits() const
Get a summary of all errors that happened during the EF execution.
uint32_t lvl2ErrorBits() const
Get a summary of all errors that happened during the LVL2 execution.
Forward declaration.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw setLVL2PassedThrough lvl2Prescaled
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics lvl2PassedRaw
setBGCode tap
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw setLVL2PassedThrough setLVL2Prescaled lvl2Resurrected
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated lvl2PassedPhysics
setBGCode setTAP lvl2ErrorBits
setEventNumber uint32_t
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw lvl2PassedThrough
setBGCode setTAP setLVL2ErrorBits lvl2Truncated