ATLAS Offline Software
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 
15 namespace xAOD {
16 
18  : SG::AuxElement() {
19 
20  }
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 
96 void 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 
109 namespace xAOD {
110 
111 std::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 
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::TrigDecision_v1::efPrescaled
const std::vector< uint32_t > & efPrescaled() const
Get the EF prescaled bits.
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::lvl2PassedPhysics
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated lvl2PassedPhysics
Definition: TrigDecision_v1.cxx:66
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::TrigDecision_v1::lvl2ErrorBits
uint32_t lvl2ErrorBits() const
Get a summary of all errors that happened during the LVL2 execution.
xAOD::lvl2PassedThrough
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw lvl2PassedThrough
Definition: TrigDecision_v1.cxx:76
xAOD::TrigDecision_v1::efResurrected
const std::vector< uint32_t > & efResurrected() const
Get the EF resurrected bits.
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RunEBWeightsComputation.smk
smk
Definition: RunEBWeightsComputation.py:86
xAOD::bgCode
bgCode
Definition: TrigDecision_v1.cxx:39
xAOD::lvl2Truncated
setBGCode setTAP setLVL2ErrorBits lvl2Truncated
Definition: TrigDecision_v1.cxx:61
xAOD::lvl2ErrorBits
setBGCode setTAP lvl2ErrorBits
Definition: TrigDecision_v1.cxx:56
xAOD::TrigDecision_v1::efPassedPhysics
const std::vector< uint32_t > & efPassedPhysics() const
Get the EF physics decision bits.
writeBits
void writeBits(std::ostream &s, const std::vector< uint32_t > &input)
Prints space separated positions of set bits from input bitset stored in vector.
Definition: TrigDecision_v1.cxx:96
xAOD::TrigDecision_v1::tav
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TrigDecision_v1::lvl2PassedPhysics
const std::vector< uint32_t > & lvl2PassedPhysics() const
Get the LVL2 physics decision bits.
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
xAOD::tap
setBGCode tap
Definition: TrigDecision_v1.cxx:43
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
xAOD::TrigDecision_v1::lvl2PassedThrough
const std::vector< uint32_t > & lvl2PassedThrough() const
Get the LVL2 pass-through bits.
xAOD::TrigDecision_v1::TrigDecision_v1
TrigDecision_v1()
Default constructor.
Definition: TrigDecision_v1.cxx:17
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::TrigDecision_v1::efPassedThrough
const std::vector< uint32_t > & efPassedThrough() const
Get the EF pass-through bits.
vector
Definition: MultiHisto.h:13
xAOD::TrigDecision_v1::efPassedRaw
const std::vector< uint32_t > & efPassedRaw() const
Get the EF passed-raw bits.
xAOD::TrigDecision_v1::lvl2Truncated
bool lvl2Truncated() const
Is the LVL2 result truncated?
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAOD::lvl2Prescaled
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw setLVL2PassedThrough lvl2Prescaled
Definition: TrigDecision_v1.cxx:81
TrigDecision_v1.h
xAOD::TrigDecision_v1::smk
uint32_t smk() const
Get the Super Master Key describing this object.
xAOD::TrigDecision_v1::tap
const std::vector< uint32_t > & tap() const
Get the Trigger After Prescale bits.
xAOD::TrigDecision_v1::bgCode
char bgCode() const
Get the bunch group code of the current event.
xAOD::TrigDecision_v1::efTruncated
bool efTruncated() const
Is the EF result truncated?
xAOD::TrigDecision_v1::lvl2Prescaled
const std::vector< uint32_t > & lvl2Prescaled() const
Get the LVL2 prescaled bits.
xAOD::TrigDecision_v1::efErrorBits
uint32_t efErrorBits() const
Get a summary of all errors that happened during the EF execution.
xAOD::TrigDecision_v1::tbp
const std::vector< uint32_t > & tbp() const
Get the Trigger Before Prescale bits.
xAOD::lvl2Resurrected
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics setLVL2PassedRaw setLVL2PassedThrough setLVL2Prescaled lvl2Resurrected
Definition: TrigDecision_v1.cxx:86
xAOD::lvl2PassedRaw
setBGCode setTAP setLVL2ErrorBits setLVL2Truncated setLVL2PassedPhysics lvl2PassedRaw
Definition: TrigDecision_v1.cxx:71
xAOD::TrigDecision_v1::lvl2Resurrected
const std::vector< uint32_t > & lvl2Resurrected() const
Get the LVL2 resurrected bits.
xAOD::TrigDecision_v1
Interface to the raw trigger decision information of the event.
Definition: TrigDecision_v1.h:44
xAOD::TrigDecision_v1::lvl2PassedRaw
const std::vector< uint32_t > & lvl2PassedRaw() const
Get the LVL2 passed-raw bits.
xAOD::operator<<
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
Definition: RDataSource.cxx:53
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27