Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions

nxyter::QuickDaqStats Class Reference

Set of statistic counters for QuickDaq environment. More...

#include <QuickDaqStats.h>

Collaboration diagram for nxyter::QuickDaqStats:
Collaboration graph
[legend]

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.
QuickDaqStatsoperator= (const QuickDaqStats &rhs)
 Assignment operator.
QuickDaqStatsoperator- (const QuickDaqStats &rhs)
 Subtraction operator.
QuickDaqStatsoperator* (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.

Detailed Description

Set of statistic counters for QuickDaq environment.

Definition at line 18 of file QuickDaqStats.h.


Member Enumeration Documentation

Names for statistic counter indices.

Enumerator:
kNMessage 

messages received

kNNop 

nop messages

kNHit 

nXYTER hits received

kNHitPileup 

hits with pileup

kNHitOverflow 

hits with overflow

kNHitNx0 

hits on nx:0

kNHitNx1 

hits on nx:1

kNHitNx2 

hits on nx:2

kNHitNx3 

hits on nx:3

kNEpoch 

epoch markers

kNEpochWithMiss 

epochs with missed hits

kNMissedHit 

missed hits (low bound)

kNSync0 

sync0 messages

kNSync1 

sync1 messages

kNAux0 

aux0 messages

kNaux1 

aux1 messages

kNAux2 

aux2 messages

kNAux3 

aux3 messages

kNAuxOverflow 

aux with pileup

kNSysMesNxParErr0 

nx:0 parity errors

kNSysMesNxParErr1 

nx:1 parity errors

kNSysMesNxParErr2 

nx:2 parity errors

kNSysMesNxParErr3 

nx:3 parity errors

kNSysMesSyncParErr0 

sync0 parity errors

kNSysMesSyncParErr1 

sync1 parity errors

kNSysMesDaqRes 

daq resume messages

kNSysMesFifoReset 

fifo reset messages

kNSysMesOther 

other system messages

kNEpoch2 

Get4 epoch markers.

kNGet4Hit 

Get4 hit message.

kNGet4Event 

Get4 event sys message.

kNOther 

other message types

kDimDaqStat 

dimension = highest index + 1

Definition at line 25 of file QuickDaqStats.h.

Names for print levels.

Enumerator:
kPrintAll 

print all stats counters

kPrintNonZero 

print only non-zero counters

kPrintError 

print only error counters

Definition at line 62 of file QuickDaqStats.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
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  ) 
nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator* ( double  rhs  ) 

Multiplication operator.

Definition at line 177 of file QuickDaqStats.cxx.

References fStats.

nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator- ( const QuickDaqStats rhs  ) 

Subtraction operator.

Definition at line 168 of file QuickDaqStats.cxx.

References fStats.

nxyter::QuickDaqStats & nxyter::QuickDaqStats::operator= ( const QuickDaqStats rhs  ) 

Assignment operator.

Definition at line 160 of file QuickDaqStats.cxx.

References fStats.

double nxyter::QuickDaqStats::operator[] ( int  ind  )  const

Returns counter with index ind.

Parameters:
ind index of counter to be returned
Returns:
counter with index ind, or 0. if ind is out of range

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.

Parameters:
os output stream
dtime delta time (in sec), if larger zero also rates are shown
lvl print level, choices are:

  • kPrintAll all counters are shown
  • kPrintNonZero only non-zero counters are shown, the first, the "messages received", is shown even when zero.
  • kPrintError only non-zero error counters are shown

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().


Field Documentation

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().


The documentation for this class was generated from the following files: