gdata
Loading...
Searching...
No Matches
gIntegralPayload.h
Go to the documentation of this file.
1#pragma once
2
20#include "glogger.h"
21#include <vector>
22
37{
38public:
53 GIntegralPayload(int c, int s, int ch, int q, int t, std::shared_ptr<GLogger> logger)
54 : log(logger), crate(c), slot(s), channel(ch), charge(q), time(t) {
55 log->debug(CONSTRUCTOR, "GIntegralPayload crate ", crate, " slot ", slot, " channel ", channel, " charge ",
56 charge, " time ", time);
57 }
58
67 log->debug(DESTRUCTOR, "GIntegralPayload crate ", crate, " slot ", slot, " channel ", channel, " charge ",
68 charge, " time ", time);
69 }
70
87 [[nodiscard]] std::vector<int> getPayload() const {
88 std::vector<int> payload;
89 payload.push_back(crate);
90 payload.push_back(slot);
91 payload.push_back(channel);
92 payload.push_back(charge);
93 payload.push_back(time);
94 return payload;
95 }
96
97private:
98 std::shared_ptr<GLogger> log;
99 int crate;
100 int slot;
101 int channel;
102 int charge;
103 int time;
104};
void debug(debug_type type, Args &&... args) const
CONSTRUCTOR
DESTRUCTOR
Stores one integrated readout payload sample.
GIntegralPayload(int c, int s, int ch, int q, int t, std::shared_ptr< GLogger > logger)
Construct an integral payload.
~GIntegralPayload()
Destructor.
std::vector< int > getPayload() const
Exports the payload as a fixed-order vector of integers.