11#ifndef ALICEO2_EMCAL_TRUDataHandler_H
12#define ALICEO2_EMCAL_TRUDataHandler_H
64 const char*
what() const noexcept final
66 return mMessage.data();
93 checkPatchIndex(
index);
99 void setFired(
bool fired) { mL0Fired = fired; }
121 checkPatchIndex(
index);
122 return mPatchTimes[
index] < UCHAR_MAX;
131 checkPatchIndex(
index);
132 return mPatchTimes[
index];
139 for (
int ipatch = 0; ipatch < mPatchTimes.size(); ipatch++) {
158 void checkPatchIndex(
unsigned int index)
const
160 if (
index >= mPatchTimes.size()) {
161 throw PatchIndexException(
index);
165 std::array<uint8_t, o2::emcal::TriggerMappingV2::PATCHESINTRU> mPatchTimes;
166 bool mL0Fired =
false;
168 int8_t mTRUIndex = -1;
182std::ostream&
operator<<(std::ostream&
stream,
const TRUDataHandler::PatchIndexException& error);
Handler of errors related to invalid trigger patch IDs.
void printStream(std::ostream &stream) const
Print error on output stream.
~PatchIndexException() noexcept final=default
Destructor.
int8_t getIndex() const
Get patch index raising the exception.
const char * what() const noexcept final
Access Error message.
Helper class to handle decoded TRU data during the reconstruction.
void setL0time(int l0time)
Set the L0 time of the TRU.
bool hasPatch(unsigned int index) const
Check whehther the patch at the given index has fired.
uint8_t getPatchTime(unsigned int index) const
Get the trigger time of the trigger patch at a given index.
void setPatch(unsigned int index, unsigned int time)
Set reconstructed trigger patch.
bool isFired() const
Check whether the TRU was fired (at least one patch above threshold)
int getTRUIndex() const
Get the index of the TRU in global (STU) index schemes.
~TRUDataHandler()=default
Destructor.
void setFired(bool fired)
Mark TRU as fired (containing at least one patch above threshold)
bool hasAnyPatch() const
Check whether the TRU has any patch fired.
void printStream(std::ostream &stream) const
Print TRU information to an output stream.
TRUDataHandler()
Constructor.
void reset()
Reset handler.
void setTRUIndex(int index)
Set the index of the TRU (in global STU indexing scheme)
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.