NSCL DDAS
12.1-001
Support for XIA DDAS at FRIB
|
Generate scaler data from run statistics. More...
#include <CMyScaler.h>
Classes | |
struct | _Counters |
Count raw and accepted triggers. More... | |
struct | _Statistics |
Statistics are counters for cumulative and per-run triggers. More... | |
Public Types | |
typedef struct CMyScaler::_Counters | Counters |
Count raw and accepted triggers. More... | |
typedef struct CMyScaler::_Statistics | Statistics |
Statistics are counters for cumulative and per-run triggers. More... | |
Public Member Functions | |
CMyScaler (unsigned short mod, unsigned short crate) | |
Constructor. More... | |
~CMyScaler () | |
Destructor. More... | |
virtual void | initialize () |
Zero the per-run statistics and counters. More... | |
virtual std::vector< uint32_t > | read () |
Read scalar data from a module. More... | |
virtual void | clear () |
Cannot clear with Pixies. Does nothing. More... | |
virtual void | disable () |
Disable. Scalars do not need to be disabled at the end of a run. More... | |
virtual unsigned int | size () |
Return the size of the scaler data. More... | |
const Statistics & | getStatistics () const |
Get the run statistics. More... | |
Generate scaler data from run statistics.
Generates scaler information from the run statistics read from the module(s). A DDAS module with N channels has a scalar bank of 2N + 1 values. The first value in index zero (0) for that module is used to store the crate ID, which is read from the cfgPixie16.txt file. The crate ID value is reported on stdout when the modules are booted e.g. when running a readout code: "Scalers know crate ID = <myID>". Following the ID are N pairs of channel scaler data corresponding to the number of observed (input) and accepted (output) fast triggers since the last scaler read.
For example, a 16-channel module scalar bank has the format:
scaler[0] = crateID scaler[1] = input[0] scaler[2] = output[0] scaler[3] = input[1] scaler[4] = output[1] ... scaler[31] = input[15] scaler[32] = output[15]
where input[0] and output[0] refer to the observed and accepted triggers seen by channel 0 on the module.
typedef struct CMyScaler::_Counters CMyScaler::Counters |
Count raw and accepted triggers.
typedef struct CMyScaler::_Statistics CMyScaler::Statistics |
Statistics are counters for cumulative and per-run triggers.
CMyScaler::CMyScaler | ( | unsigned short | mod, |
unsigned short | crate | ||
) |
Constructor.
mod | The module number. |
crate | The crate ID where the module resides. |
CMyScaler::~CMyScaler | ( | ) |
Destructor.
|
inlinevirtual |
Cannot clear with Pixies. Does nothing.
|
inlinevirtual |
Disable. Scalars do not need to be disabled at the end of a run.
|
inline |
Get the run statistics.
|
virtual |
Zero the per-run statistics and counters.
|
virtual |
Read scalar data from a module.
Now we need to calculate the # of events from the last read of the scalers. NSCL scaler buffers just expect the # events since the last read. However, Pixie-16 statistics cannot be cleared, so we need to do some math and store the counts from our previous read.
Input counts (IC) and rate (ICR) are fast triggers. Output counts (OC) and rate (OCR) are accepted triggers.
|
inlinevirtual |
Return the size of the scaler data.