Set of statistic counters for QuickDaq environment. More...
#include <QuickDaqStats.h>
Public Types | |
enum | daqStat { kNMessage = 0, kNNop, kNHit, kNHitPileup, kNHitOverflow, kNHitNx0, kNHitNx1, kNHitNx2, kNHitNx3, kNEpoch, kNEpochWithMiss, kNMissedHit, kNSync0, kNSync1, kNAux0, kNaux1, kNAux2, kNAux3, kNAuxOverflow, kNSysMesNxParErr0, kNSysMesNxParErr1, kNSysMesNxParErr2, kNSysMesNxParErr3, kNSysMesSyncParErr0, kNSysMesSyncParErr1, kNSysMesDaqRes, kNSysMesFifoReset, kNSysMesOther, kNEpoch2, kNGet4Hit, kNGet4Event, kNOther, kDimDaqStat } |
Names for statistic counter indices. More... | |
enum | plevel { kPrintAll = 0, kPrintNonZero, kPrintError } |
Names for print levels. More... | |
Public Member Functions | |
QuickDaqStats () | |
Constructor, clears all counters. | |
QuickDaqStats (const QuickDaqStats &obj) | |
Copy constructor. | |
virtual | ~QuickDaqStats () |
void | clear () |
Clear all counters. | |
void | increment (roc::Message &msg) |
Increment counters according to the contents of data. | |
double | errorCount () const |
Returns number of nXYTER and sync parity errors. | |
double | operator[] (int ind) const |
Returns counter with index ind. | |
QuickDaqStats & | operator= (const QuickDaqStats &rhs) |
Assignment operator. | |
QuickDaqStats & | operator- (const QuickDaqStats &rhs) |
Subtraction operator. | |
QuickDaqStats & | operator* (double rhs) |
Multiplication operator. | |
void | print (std::ostream &os, double dtime=0., int lvl=kPrintNonZero) const |
Print contents of counters to stream os. | |
Static Public Member Functions | |
static const char * | counterName (int ind) |
Returns name for counter with index ind (or "" if undefined). | |
Protected Attributes | |
std::vector< double > | fStats |
statistic counters | |
Private Member Functions | |
void | inc (int ind) |
Increment counter with index ind. |
Set of statistic counters for QuickDaq environment.
Definition at line 18 of file QuickDaqStats.h.
Names for statistic counter indices.
Definition at line 25 of file QuickDaqStats.h.
Names for print levels.
kPrintAll |
print all stats counters |
kPrintNonZero |
print only non-zero counters |
kPrintError |
print only error counters |
Definition at line 62 of file QuickDaqStats.h.
nxyter::QuickDaqStats::QuickDaqStats | ( | ) |
Constructor, clears all counters.
Definition at line 22 of file QuickDaqStats.cxx.
nxyter::QuickDaqStats::QuickDaqStats | ( | const QuickDaqStats & | obj | ) |
Copy constructor.
Definition at line 30 of file QuickDaqStats.cxx.
nxyter::QuickDaqStats::~QuickDaqStats | ( | ) | [virtual] |
Definition at line 37 of file QuickDaqStats.cxx.
void nxyter::QuickDaqStats::clear | ( | ) |
Clear all counters.
Definition at line 44 of file QuickDaqStats.cxx.
References fStats.
Referenced by nxyter::QuickDaq::startRun().
const char * nxyter::QuickDaqStats::counterName | ( | int | ind | ) | [static] |
Returns name for counter with index ind (or "" if undefined).
Definition at line 272 of file QuickDaqStats.cxx.
References kNAux0, kNaux1, kNAux2, kNAux3, kNAuxOverflow, kNEpoch, kNEpoch2, kNEpochWithMiss, kNGet4Event, kNGet4Hit, kNHit, kNHitNx0, kNHitNx1, kNHitNx2, kNHitNx3, kNHitOverflow, kNHitPileup, kNMessage, kNMissedHit, kNNop, kNOther, kNSync0, kNSync1, kNSysMesDaqRes, kNSysMesFifoReset, kNSysMesNxParErr0, kNSysMesNxParErr1, kNSysMesNxParErr2, kNSysMesNxParErr3, kNSysMesOther, kNSysMesSyncParErr0, and kNSysMesSyncParErr1.
Referenced by print().
double nxyter::QuickDaqStats::errorCount | ( | ) | const |
Returns number of nXYTER and sync parity errors.
Definition at line 136 of file QuickDaqStats.cxx.
References fStats, and kNSysMesNxParErr0.
Referenced by nxyter::FebUtil::acquireTestTriggerData().
void nxyter::QuickDaqStats::inc | ( | int | ind | ) | [inline, private] |
Increment counter with index ind.
Definition at line 88 of file QuickDaqStats.h.
References fStats.
Referenced by increment().
void nxyter::QuickDaqStats::increment | ( | roc::Message & | msg | ) |
Increment counters according to the contents of data.
Definition at line 52 of file QuickDaqStats.cxx.
References fStats, roc::Message::getAuxChNum(), roc::Message::getAuxOverflow(), roc::Message::getEpochMissed(), roc::Message::getMessageType(), roc::Message::getNxNumber(), roc::Message::getNxOverflow(), roc::Message::getNxPileup(), roc::Message::getSyncChNum(), roc::Message::getSysMesType(), inc(), kNAux0, kNAuxOverflow, kNEpoch, kNEpoch2, kNEpochWithMiss, kNGet4Event, kNGet4Hit, kNHit, kNHitNx0, kNHitOverflow, kNHitPileup, kNMessage, kNNop, kNOther, kNSync0, kNSysMesDaqRes, kNSysMesFifoReset, kNSysMesNxParErr0, kNSysMesOther, kNSysMesSyncParErr0, roc::MSG_AUX, roc::MSG_EPOCH, roc::MSG_EPOCH2, roc::MSG_GET4, roc::MSG_HIT, roc::MSG_NOP, roc::MSG_SYNC, roc::MSG_SYS, roc::SYSMSG_DAQ_RESUME, roc::SYSMSG_FIFO_RESET, roc::SYSMSG_GET4_EVENT, roc::SYSMSG_NX_PARITY, and roc::SYSMSG_SYNC_PARITY.
Referenced by nxyter::QuickDaq::testRun().
nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator* | ( | double | rhs | ) |
nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator- | ( | const QuickDaqStats & | rhs | ) |
nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator= | ( | const QuickDaqStats & | rhs | ) |
double nxyter::QuickDaqStats::operator[] | ( | int | ind | ) | const |
Returns counter with index ind.
ind | index of counter to be returned |
Definition at line 152 of file QuickDaqStats.cxx.
References fStats, and kDimDaqStat.
void nxyter::QuickDaqStats::print | ( | std::ostream & | os, | |
double | dtime = 0. , |
|||
int | lvl = kPrintNonZero | |||
) | const |
Print contents of counters to stream os.
Prints the statistic counters to os. If dtime is greater than zero, also the count rates normalized to the run time dtime (in sec) are given in Hz or kHz. The argument lvl determines whether all, only non-zero, or only non-zero error counters are printed.
os | output stream | |
dtime | delta time (in sec), if larger zero also rates are shown | |
lvl | print level, choices are:
A listing with lvl = kPrintAll will look like Stat( 0) messages received : 4708 Stat( 1) nop messages : 0 Stat( 2) nXYTER hits received : 4640 Stat( 3) hits with pileup : 0 Stat( 4) hits with overflow : 0 Stat( 5) hits on nx:0 : 4640 Stat( 9) epoch markers : 57 Stat(10) epochs with missed hits : 0 Stat(11) missed hits (low bound) : 0 Stat(12) sync0 messages : 8 Stat(13) sync1 messages : 0 Stat(14) aux0 messages : 0 Stat(15) aux1 messages : 0 Stat(16) aux2 messages : 0 Stat(17) aux3 messages : 0 Stat(18) aux with pileup : 0 Stat(19) nx:0 parity errors : 1 <== ERRORS!! Stat(20) nx:1 parity errors : 0 Stat(21) nx:2 parity errors : 0 Stat(22) nx:3 parity errors : 0 Stat(23) sync0 parity errors : 2 <== ERRORS!! Stat(24) sync1 parity errors : 0 Stat(25) daq resume messages : 0 Stat(26) fifo reset messages : 1 Stat(27) other system messages : 3 Stat(28) other message types : 0 |
Definition at line 230 of file QuickDaqStats.cxx.
References counterName(), fStats, kNSysMesSyncParErr1, kPrintAll, kPrintError, and kPrintNonZero.
Referenced by nxyter::FebUtil::acquireTestTriggerData().
std::vector<double> nxyter::QuickDaqStats::fStats [protected] |
statistic counters
Definition at line 20 of file QuickDaqStats.h.
Referenced by clear(), errorCount(), inc(), increment(), operator*(), operator-(), operator=(), operator[](), and print().