NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Classes | Public Types | Public Member Functions | List of all members
CMyScaler Class Reference

Generate scaler data from run statistics. More...

#include <CMyScaler.h>

Inheritance diagram for CMyScaler:
Inheritance graph
[legend]
Collaboration diagram for CMyScaler:
Collaboration graph
[legend]

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 StatisticsgetStatistics () const
 Get the run statistics. More...
 

Detailed Description

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.

Note
(ASC 9/4/24): Based on the DDAS scaler class originally written by H. Crawford.

Member Typedef Documentation

◆ Counters

Count raw and accepted triggers.

◆ Statistics

Statistics are counters for cumulative and per-run triggers.

Constructor & Destructor Documentation

◆ CMyScaler()

CMyScaler::CMyScaler ( unsigned short  mod,
unsigned short  crate 
)

Constructor.

Parameters
modThe module number.
crateThe crate ID where the module resides.

◆ ~CMyScaler()

CMyScaler::~CMyScaler ( )

Destructor.

Member Function Documentation

◆ clear()

virtual void CMyScaler::clear ( )
inlinevirtual

Cannot clear with Pixies. Does nothing.

◆ disable()

virtual void CMyScaler::disable ( )
inlinevirtual

Disable. Scalars do not need to be disabled at the end of a run.

◆ getStatistics()

const Statistics& CMyScaler::getStatistics ( ) const
inline

Get the run statistics.

Returns
Reference to the statistics storage object.

◆ initialize()

void CMyScaler::initialize ( )
virtual

Zero the per-run statistics and counters.

◆ read()

std::vector< uint32_t > CMyScaler::read ( )
virtual

Read scalar data from a module.

Returns
Vector of scalar data for a single 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.

◆ size()

virtual unsigned int CMyScaler::size ( )
inlinevirtual

Return the size of the scaler data.

Returns
Always 32 (only for 16-channel cards!)

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