6 #ifndef H_DETECTOREVENT
7 #define H_DETECTOREVENT
50 using group_type = int16_t;
51 using coord_type = int16_t;
71 return det1.time < det2.time;
80 return det1.time > det2.time;
89 return det1.coord < det2.coord;
96 FLAG_OVERRANGE = 1 << 1,
97 FLAG_UNDERRANGE = 1 << 2,
98 FLAG_OVERFLOW = 1 << 3,
99 FLAG_UNDERFLOW = 1 << 4,
102 FLAG_INVALID = 1 << 15
108 void markPileup() noexcept {
flags |= FLAG_PILEUP; }
109 void markOverrange() noexcept {
flags |= FLAG_OVERRANGE; }
110 void markUnderrange()noexcept {
flags |= FLAG_UNDERRANGE; }
111 void markOverflow() noexcept {
flags |= FLAG_OVERFLOW; }
112 void markUnderflow() noexcept {
flags |= FLAG_UNDERFLOW; }
113 void markVeto() noexcept {
flags |= FLAG_VETO; }
114 void markFail() noexcept {
flags |= FLAG_FAIL; }
115 void markInvalid() noexcept {
flags |= FLAG_INVALID; }
117 bool pileup() const noexcept {
return flags & FLAG_PILEUP; }
118 bool overrange() const noexcept {
return flags & FLAG_OVERRANGE; }
119 bool underrange() const noexcept {
return flags & FLAG_UNDERRANGE; }
120 bool overflow() const noexcept {
return flags & FLAG_OVERFLOW; }
121 bool underflow() const noexcept {
return flags & FLAG_UNDERFLOW; }
122 bool fail() const noexcept {
return flags & FLAG_FAIL; }
123 bool veto() const noexcept {
return flags & FLAG_VETO; }
124 bool good() const noexcept {
return flags == 0; }
134 explicit operator bool()
const {
return !
invalid(); }
140 uint16_t
flags{FLAG_INVALID};
152 #if POTTU_ENABLE_TRACES
153 std::vector<uint16_t> trace;
163 DetectorEvent::group_type group;
171 return det.group == group;
178 DetectorEvent::group_type group;
179 DetectorEvent::coord_type coord;
187 return det.group == group && det.coord == coord;
219 DetectorEvent::group_type group;
229 return det.group == group && det.e >= eLow && det.e < eHigh;
Event containing event information of one daq channel.
Definition: DetectorEvent.hpp:47
bool invalid() const noexcept
Checks if the detector event is marked invalid.
Definition: DetectorEvent.hpp:128
flags
Flag values used in the bitmask field flags.
Definition: DetectorEvent.hpp:94
static DetectorEvent createInvalid()
Creates a new detector event.
Definition: DetectorEvent.hpp:62
Defines the raw low level dataitems used in tdr datastreams and files.
Definition: mainpage.dox:6
Functor to compare DetectorEvent instances based on coord field (as std::greater<>).
Definition: DetectorEvent.hpp:87
Functor to compare DetectorEvent instances based on time field (as std::greater<>).
Definition: DetectorEvent.hpp:78
Functor to compare DetectorEvent instances based on time field (as std::less<>).
Definition: DetectorEvent.hpp:69
Detector event operation which extracts adc value.
Definition: DetectorEvent.hpp:251
double operator()(const DetectorEvent &det) const noexcept
Extract the adc value from a DetectorEvent.
Definition: DetectorEvent.hpp:257
Detector event operation which extracts energy.
Definition: DetectorEvent.hpp:237
double operator()(const DetectorEvent &det) const noexcept
Extract the energy from a DetectorEvent.
Definition: DetectorEvent.hpp:243
Detector event filter for DAQ channel.
Definition: DetectorEvent.hpp:194
bool operator()(const DetectorEvent &det) const noexcept
Tests if event passes the filter.
Definition: DetectorEvent.hpp:202
Detector event filter for detector group and coordinate.
Definition: DetectorEvent.hpp:177
bool operator()(const DetectorEvent &det) const noexcept
Tests if event passes the filter.
Definition: DetectorEvent.hpp:186
Detector event filter for group index and energy.
Definition: DetectorEvent.hpp:218
bool operator()(const DetectorEvent &det) const noexcept
Tests if event passes the filter.
Definition: DetectorEvent.hpp:228
Detector event filter for detector group.
Definition: DetectorEvent.hpp:162
bool operator()(const DetectorEvent &det) const noexcept
Tests if event passes the filter.
Definition: DetectorEvent.hpp:170