Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
Loading...
Searching...
No Matches

One decoded CoMPASS event, with header-bit and status-flag accessors. More...

#include <BinaryUtils.hpp>

Public Types

enum  WaveformCode : UChar_t {
  INPUT = 1 , RC_CR = 2 , RC_CR2 = 3 , TRAPEZOID = 4 ,
  BASELINE = 5 , THRESHOLD = 6 , CFD = 7 , TRAPEZOID_BASELINE = 8 ,
  FAST_TRIANGLE = 33 , SMOOTHED_INPUT = 41
}
 Which CoMPASS processing stage a stored waveform came from. More...

Public Member Functions

Bool_t hasEnergyCh () const
 Whether the record carries an uncalibrated energy (header bit 0).
Bool_t hasEnergyCal () const
 Whether the record carries a calibrated energy (header bit 1).
Bool_t hasEnergyShort () const
 Whether the record carries a short-gate energy (header bit 2).
Bool_t hasWaveform () const
 Whether the record carries waveform samples (header bit 3).
UChar_t getControlBits () const
 The four header control bits as a nibble.
Bool_t hasDeadtime () const
 Deadtime occurred before this event.
Bool_t hasTimestampRollover () const
 The timestamp counter rolled over.
Bool_t hasTimestampResetExt () const
 An external timestamp reset was applied.
Bool_t isFakeEvent () const
 Synthetic event inserted by the acquisition.
Bool_t hasMemoryFull () const
 Board memory was full.
Bool_t hasTriggerLost () const
 At least one trigger was lost.
Bool_t hasNTriggersLost () const
 The lost-trigger count field is present.
Bool_t hasSaturation () const
 The input saturated within the integration gate.
Bool_t has1024Triggers () const
 1024 triggers have been counted.
Bool_t isFirstAfterBusy () const
 First event after a busy period.
Bool_t isInputSaturating () const
 The input is currently saturating.
Bool_t hasNTriggersCounted () const
 The counted-trigger field is present.
Bool_t isNotMatchedTimeFilter () const
 The event failed the coincidence time filter.
Bool_t hasFineTimestamp () const
 A fine timestamp is available.
Bool_t isPileup () const
 Pileup was detected.
Bool_t hasPLLLockLoss () const
 The PLL lost lock.
Bool_t isOverTemperature () const
 The board reported over-temperature.
Bool_t isADCShutdown () const
 The ADC shut down.
TString getWaveformCodeName () const
 Human-readable name for waveform_code.
std::vector< TString > getActiveFlags () const
 Names of every status flag currently set in flags.
void Print () const
 Print the whole event to stdout.
void PrintHeader () const
 Print the header fields to stdout.
void PrintFlags () const
 Print the active status flags to stdout.
void PrintWaveform () const
 Print the waveform samples to stdout.
 CoMPASSData ()
 Construct with all fields zeroed.
virtual ~CoMPASSData ()

Public Attributes

UShort_t header
 Global header word; says which fields are valid.
UShort_t board
 Digitiser board id.
UShort_t channel
 Channel index on that board.
ULong64_t timestamp
 Acquisition timestamp, in picoseconds.
UShort_t energy_ch
 Energy in ADC channel units; valid if hasEnergyCh().
Double_t energy_cal
 Calibrated energy; valid if hasEnergyCal().
UShort_t energy_short_ch
 Short-gate energy; valid if hasEnergyShort().
UInt_t flags
 Status bits; see the flag constants above.
UChar_t waveform_code
 Processing stage of samples; see WaveformCode.
UInt_t num_samples
 Length of samples.
TArrayS samples
 Waveform samples; valid if hasWaveform().

Static Public Attributes

CoMPASS status flag bits, as found in #flags.
static const UInt_t DEADTIME_OCCURRED = 0x1
static const UInt_t TIMESTAMP_ROLLOVER = 0x2
static const UInt_t TIMESTAMP_RESET_EXT = 0x4
static const UInt_t FAKE_EVENT = 0x8
static const UInt_t MEMORY_FULL = 0x10
static const UInt_t TRIGGER_LOST = 0x20
static const UInt_t N_TRIGGERS_LOST = 0x40
static const UInt_t SATURATION_IN_GATE = 0x80
static const UInt_t TRIGGERS_1024_COUNTED = 0x100
static const UInt_t FIRST_AFTER_BUSY = 0x200
static const UInt_t INPUT_SATURATING = 0x400
static const UInt_t N_TRIGGERS_COUNTED = 0x800
static const UInt_t NOT_MATCHED_TIMEFILTER = 0x1000
static const UInt_t FINE_TIMESTAMP = 0x4000
static const UInt_t PILEUP = 0x8000
static const UInt_t PLL_LOCK_LOSS = 0x80000
static const UInt_t OVER_TEMPERATURE = 0x100000
static const UInt_t ADC_SHUTDOWN = 0x200000

Detailed Description

One decoded CoMPASS event, with header-bit and status-flag accessors.

Which fields carry meaningful values is dictated by the file's global header, mirrored into header. Test it with hasEnergyCh() and friends before reading the corresponding member.

Definition at line 126 of file BinaryUtils.hpp.

Member Enumeration Documentation

◆ WaveformCode

enum CoMPASSData::WaveformCode : UChar_t

Which CoMPASS processing stage a stored waveform came from.

Enumerator
INPUT 
RC_CR 
RC_CR2 
TRAPEZOID 
BASELINE 
THRESHOLD 
CFD 
TRAPEZOID_BASELINE 
FAST_TRIANGLE 
SMOOTHED_INPUT 

Definition at line 129 of file BinaryUtils.hpp.

Constructor & Destructor Documentation

◆ CoMPASSData()

CoMPASSData::CoMPASSData ( )

Construct with all fields zeroed.

Definition at line 4 of file BinaryUtils.cpp.

◆ ~CoMPASSData()

virtual CoMPASSData::~CoMPASSData ( )
inlinevirtual

Definition at line 244 of file BinaryUtils.hpp.

Member Function Documentation

◆ getActiveFlags()

std::vector< TString > CoMPASSData::getActiveFlags ( ) const

Names of every status flag currently set in flags.

Definition at line 40 of file BinaryUtils.cpp.

Referenced by PrintFlags().

◆ getControlBits()

UChar_t CoMPASSData::getControlBits ( ) const
inline

The four header control bits as a nibble.

Definition at line 185 of file BinaryUtils.hpp.

◆ getWaveformCodeName()

TString CoMPASSData::getWaveformCodeName ( ) const

Human-readable name for waveform_code.

Returns
The WaveformCode name, or a placeholder if unrecognised.

Definition at line 13 of file BinaryUtils.cpp.

Referenced by PrintWaveform().

◆ has1024Triggers()

Bool_t CoMPASSData::has1024Triggers ( ) const
inline

1024 triggers have been counted.

Definition at line 204 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasDeadtime()

Bool_t CoMPASSData::hasDeadtime ( ) const
inline

Deadtime occurred before this event.

Definition at line 188 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasEnergyCal()

Bool_t CoMPASSData::hasEnergyCal ( ) const
inline

Whether the record carries a calibrated energy (header bit 1).

Definition at line 179 of file BinaryUtils.hpp.

Referenced by Print(), and PrintHeader().

◆ hasEnergyCh()

Bool_t CoMPASSData::hasEnergyCh ( ) const
inline

Whether the record carries an uncalibrated energy (header bit 0).

Definition at line 177 of file BinaryUtils.hpp.

Referenced by Print(), and PrintHeader().

◆ hasEnergyShort()

Bool_t CoMPASSData::hasEnergyShort ( ) const
inline

Whether the record carries a short-gate energy (header bit 2).

Definition at line 181 of file BinaryUtils.hpp.

Referenced by Print(), and PrintHeader().

◆ hasFineTimestamp()

Bool_t CoMPASSData::hasFineTimestamp ( ) const
inline

A fine timestamp is available.

Definition at line 216 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasMemoryFull()

Bool_t CoMPASSData::hasMemoryFull ( ) const
inline

Board memory was full.

Definition at line 196 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasNTriggersCounted()

Bool_t CoMPASSData::hasNTriggersCounted ( ) const
inline

The counted-trigger field is present.

Definition at line 210 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasNTriggersLost()

Bool_t CoMPASSData::hasNTriggersLost ( ) const
inline

The lost-trigger count field is present.

Definition at line 200 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasPLLLockLoss()

Bool_t CoMPASSData::hasPLLLockLoss ( ) const
inline

The PLL lost lock.

Definition at line 220 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasSaturation()

Bool_t CoMPASSData::hasSaturation ( ) const
inline

The input saturated within the integration gate.

Definition at line 202 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasTimestampResetExt()

Bool_t CoMPASSData::hasTimestampResetExt ( ) const
inline

An external timestamp reset was applied.

Definition at line 192 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasTimestampRollover()

Bool_t CoMPASSData::hasTimestampRollover ( ) const
inline

The timestamp counter rolled over.

Definition at line 190 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasTriggerLost()

Bool_t CoMPASSData::hasTriggerLost ( ) const
inline

At least one trigger was lost.

Definition at line 198 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ hasWaveform()

Bool_t CoMPASSData::hasWaveform ( ) const
inline

Whether the record carries waveform samples (header bit 3).

Definition at line 183 of file BinaryUtils.hpp.

Referenced by PrintHeader(), and PrintWaveform().

◆ isADCShutdown()

Bool_t CoMPASSData::isADCShutdown ( ) const
inline

The ADC shut down.

Definition at line 224 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isFakeEvent()

Bool_t CoMPASSData::isFakeEvent ( ) const
inline

Synthetic event inserted by the acquisition.

Definition at line 194 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isFirstAfterBusy()

Bool_t CoMPASSData::isFirstAfterBusy ( ) const
inline

First event after a busy period.

Definition at line 206 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isInputSaturating()

Bool_t CoMPASSData::isInputSaturating ( ) const
inline

The input is currently saturating.

Definition at line 208 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isNotMatchedTimeFilter()

Bool_t CoMPASSData::isNotMatchedTimeFilter ( ) const
inline

The event failed the coincidence time filter.

Definition at line 212 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isOverTemperature()

Bool_t CoMPASSData::isOverTemperature ( ) const
inline

The board reported over-temperature.

Definition at line 222 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ isPileup()

Bool_t CoMPASSData::isPileup ( ) const
inline

Pileup was detected.

Definition at line 218 of file BinaryUtils.hpp.

Referenced by getActiveFlags().

◆ Print()

void CoMPASSData::Print ( ) const

Print the whole event to stdout.

Print the whole event to stdout.

Print the block to stdout.

Definition at line 132 of file BinaryUtils.cpp.

◆ PrintFlags()

void CoMPASSData::PrintFlags ( ) const

Print the active status flags to stdout.

Definition at line 100 of file BinaryUtils.cpp.

Referenced by Print().

◆ PrintHeader()

void CoMPASSData::PrintHeader ( ) const

Print the header fields to stdout.

Definition at line 83 of file BinaryUtils.cpp.

Referenced by Print().

◆ PrintWaveform()

void CoMPASSData::PrintWaveform ( ) const

Print the waveform samples to stdout.

Definition at line 116 of file BinaryUtils.cpp.

Referenced by Print().

Member Data Documentation

◆ ADC_SHUTDOWN

const UInt_t CoMPASSData::ADC_SHUTDOWN = 0x200000
static

Definition at line 161 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and isADCShutdown().

◆ board

UShort_t CoMPASSData::board

Digitiser board id.

Definition at line 165 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), and InitUtils::ConvertCoMPASSBinToROOT().

◆ channel

UShort_t CoMPASSData::channel

Channel index on that board.

Definition at line 166 of file BinaryUtils.hpp.

Referenced by CoMPASSData().

◆ DEADTIME_OCCURRED

const UInt_t CoMPASSData::DEADTIME_OCCURRED = 0x1
static

Definition at line 144 of file BinaryUtils.hpp.

Referenced by hasDeadtime().

◆ energy_cal

Double_t CoMPASSData::energy_cal

Calibrated energy; valid if hasEnergyCal().

Definition at line 169 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), and Print().

◆ energy_ch

UShort_t CoMPASSData::energy_ch

Energy in ADC channel units; valid if hasEnergyCh().

Definition at line 168 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), and Print().

◆ energy_short_ch

UShort_t CoMPASSData::energy_short_ch

Short-gate energy; valid if hasEnergyShort().

Definition at line 170 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), and Print().

◆ FAKE_EVENT

const UInt_t CoMPASSData::FAKE_EVENT = 0x8
static

Definition at line 147 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and isFakeEvent().

◆ FINE_TIMESTAMP

const UInt_t CoMPASSData::FINE_TIMESTAMP = 0x4000
static

Definition at line 157 of file BinaryUtils.hpp.

Referenced by hasFineTimestamp().

◆ FIRST_AFTER_BUSY

const UInt_t CoMPASSData::FIRST_AFTER_BUSY = 0x200
static

Definition at line 153 of file BinaryUtils.hpp.

Referenced by isFirstAfterBusy().

◆ flags

◆ header

UShort_t CoMPASSData::header

Global header word; says which fields are valid.

Definition at line 164 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), getControlBits(), hasEnergyCal(), hasEnergyCh(), hasEnergyShort(), hasWaveform(), and PrintHeader().

◆ INPUT_SATURATING

const UInt_t CoMPASSData::INPUT_SATURATING = 0x400
static

Definition at line 154 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and isInputSaturating().

◆ MEMORY_FULL

const UInt_t CoMPASSData::MEMORY_FULL = 0x10
static

Definition at line 148 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and hasMemoryFull().

◆ N_TRIGGERS_COUNTED

const UInt_t CoMPASSData::N_TRIGGERS_COUNTED = 0x800
static

Definition at line 155 of file BinaryUtils.hpp.

Referenced by hasNTriggersCounted().

◆ N_TRIGGERS_LOST

const UInt_t CoMPASSData::N_TRIGGERS_LOST = 0x40
static

Definition at line 150 of file BinaryUtils.hpp.

Referenced by hasNTriggersLost().

◆ NOT_MATCHED_TIMEFILTER

const UInt_t CoMPASSData::NOT_MATCHED_TIMEFILTER = 0x1000
static

Definition at line 156 of file BinaryUtils.hpp.

Referenced by isNotMatchedTimeFilter().

◆ num_samples

UInt_t CoMPASSData::num_samples

Length of samples.

Definition at line 173 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), and PrintWaveform().

◆ OVER_TEMPERATURE

const UInt_t CoMPASSData::OVER_TEMPERATURE = 0x100000
static

Definition at line 160 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and isOverTemperature().

◆ PILEUP

const UInt_t CoMPASSData::PILEUP = 0x8000
static

Definition at line 158 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and isPileup().

◆ PLL_LOCK_LOSS

const UInt_t CoMPASSData::PLL_LOCK_LOSS = 0x80000
static

Definition at line 159 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and hasPLLLockLoss().

◆ samples

TArrayS CoMPASSData::samples

Waveform samples; valid if hasWaveform().

Definition at line 174 of file BinaryUtils.hpp.

Referenced by PrintWaveform().

◆ SATURATION_IN_GATE

const UInt_t CoMPASSData::SATURATION_IN_GATE = 0x80
static

Definition at line 151 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and hasSaturation().

◆ timestamp

ULong64_t CoMPASSData::timestamp

Acquisition timestamp, in picoseconds.

Definition at line 167 of file BinaryUtils.hpp.

Referenced by CoMPASSData().

◆ TIMESTAMP_RESET_EXT

const UInt_t CoMPASSData::TIMESTAMP_RESET_EXT = 0x4
static

Definition at line 146 of file BinaryUtils.hpp.

Referenced by hasTimestampResetExt().

◆ TIMESTAMP_ROLLOVER

const UInt_t CoMPASSData::TIMESTAMP_ROLLOVER = 0x2
static

Definition at line 145 of file BinaryUtils.hpp.

Referenced by hasTimestampRollover().

◆ TRIGGER_LOST

const UInt_t CoMPASSData::TRIGGER_LOST = 0x20
static

Definition at line 149 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertCoMPASSBinToROOT(), and hasTriggerLost().

◆ TRIGGERS_1024_COUNTED

const UInt_t CoMPASSData::TRIGGERS_1024_COUNTED = 0x100
static

Definition at line 152 of file BinaryUtils.hpp.

Referenced by has1024Triggers().

◆ waveform_code

UChar_t CoMPASSData::waveform_code

Processing stage of samples; see WaveformCode.

Definition at line 172 of file BinaryUtils.hpp.

Referenced by CoMPASSData(), getWaveformCodeName(), and PrintWaveform().


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