1#ifndef __JDAQSUMMARYFRAME__
2#define __JDAQSUMMARYFRAME__
76 return getValue(numberOfHits * 1.0e9 / frameTime_ns);
91 return std::numeric_limits<JRate_t>::max();
124 else if (
value == std::numeric_limits<JRate_t>::max())
140 return (
int) std::numeric_limits<JRate_t>::max() + 1;
150 static const double*
getData(
const double factor = 1.0)
159 buffer.push_back(
get_rate(i - 0.5) * factor);
164 return buffer.data();
193 void setValue(
const int numberOfHits,
const double frameTime_ns)
268 return (
value != 0 &&
value != std::numeric_limits<JRate_t>::max());
382 vector<int> counter(numeric_limits<JPMT_t>::max(), 0);
384 int n = input.
size();
387 ++counter[i->getPMT()];
400 int n = input.
size();
403 if (i->getT() > limit[i->getPMT()]) {
404 limit[i->getPMT()] = i->getT();
411 data[i].
setValue((
double) counter[i] * 1.0e9 / (
double) limit[i]);
427 if (tdc >= 0 && tdc < NUMBER_OF_PMTS)
442 if (tdc >= 0 && tdc < NUMBER_OF_PMTS)
468 double getRate(
const int tdc,
const double factor = 1.0)
const
481 double getWeight(
const int tdc,
const double factor = 1.0)
const
493 void setRate(
const int tdc,
const double rate_Hz)
525 if (first[i] != second[i]) {
549 return !(first == second);
KM3NeT DAQ constants, bit handling, etc.
Interface for binary input.
Interface for binary output.
bool testFIFOStatus() const
Test FIFO status.
const JDAQFrameStatus & getDAQFrameStatus() const
Get DAQ frame status.
static const JDAQFrameStatus & getInstance()
Get reference to unique instance of this class object.
bool testHighRateVeto() const
Test high-rate veto status.
const_iterator begin() const
unsigned int JTDC_t
leading edge [ns]
unsigned char JPMT_t
PMT channel in FPGA.
int getModuleID() const
Get module identifier.
const JDAQModuleIdentifier & getModuleIdentifier() const
Get Module identifier.
Data storage class for rate measurement of one PMT.
static JRate_t getValue(const int numberOfHits, const double frameTime_ns)
Get value.
JDAQRate & div(const double factor)
Scale rate.
double getRate() const
Get count rate.
static double get_rate(const double value)
Get count rate.
JDAQRate & mul(const double factor)
Scale rate.
static JRate_t getValue(const double rate_Hz)
Get value.
JDAQRate()
Default constructor.
double getWeight() const
Get weight.
static double getRate(const JRate_t value)
Get count rate.
static int getN()
Get number of bins.
static const double * getData(const double factor=1.0)
Get abscissa values.
void setValue(const double rate_Hz)
Set value.
void setValue(const int numberOfHits, const double frameTime_ns)
Set value.
static double getMinimalRate()
Get minimal rate (below this, value is set to zero)
JRate_t getValue() const
Get value.
static const double getFactor()
Get conversion factor.
static double getMaximalRate()
Get maximal rate (above this, value is set to maximum)
static double getWeight(const JRate_t value)
Get weight.
bool is_valid() const
Check validity of rate.
Data storage class for rate measurements of all PMTs in one module.
JDAQSummaryFrame(const JDAQModuleIdentifier &id)
Constructor.
friend JWriter & operator<<(JWriter &, const JDAQSummaryFrame &)
Write DAQ summary frame to output.
JDAQRate & operator[](const int tdc)
Get DAQ rate of given PMT.
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
JRate_t getValue(const int tdc) const
Get value.
static int ROOT_IO_VERSION
Streamer version of JDAQSummaryslice as obtained from ROOT file.
JDAQSummaryFrame(const JDAQSuperFrame &input)
Constructor.
void setRate(const int tdc, const double rate_Hz)
Set count rate.
double getWeight(const int tdc, const double factor=1.0) const
Get weight.
JDAQRate data[NUMBER_OF_PMTS]
friend JReader & operator>>(JReader &, JDAQSummaryFrame &)
Read DAQ summary frame from input.
ClassDefNV(JDAQSummaryFrame, 2)
JDAQSummaryFrame()
Default constructor.
JDAQRate::JRate_t JRate_t
const JDAQRate & operator[](const int tdc) const
Get DAQ rate of given PMT.
Data frame of one optical module.
bool operator==(const Head &first, const Head &second)
Equal operator.
bool operator!=(const JTag &first, const JTag &second)
Not equal operator for JTag.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
size_t getSizeof< JDAQSummaryFrame >()
Get size of type.
Auxiliary class for TDC constraints.