11#define BOOST_TEST_MODULE Test EMCAL Reconstruction
12#define BOOST_TEST_MAIN
13#define BOOST_TEST_DYN_LINK
14#include <boost/test/unit_test.hpp>
58 for (
int iiter = 0; iiter < 100; iiter++) {
60 std::map<uint8_t, uint8_t> patchtimes;
62 while (patchtimes.size() < npatches_expect) {
64 if (patchtimes.find(patchindex) == patchtimes.end()) {
65 auto patchtime =
static_cast<int>(gRandom->Gaus(8, 1));
66 if (patchtime >= 12) {
69 patchtimes[patchindex] = patchtime;
73 iterhandler.
setFired(npatches_expect > 0);
74 for (
auto [patchindex, patchtime] : patchtimes) {
75 iterhandler.
setPatch(patchindex, patchtime);
81 auto hasPatch = patchtimes.find(ipatch) != patchtimes.end();
Handler of errors related to invalid trigger patch IDs.
Helper class to handle decoded TRU data during the reconstruction.
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)
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 reset()
Reset handler.
static constexpr unsigned int PATCHESINTRU
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())