McStas Readout Master 0.3.3
Loading...
Searching...
No Matches
Readout Class Reference

Runtime-streaming readout generator used by the legacy Readout components. More...

#include <ReadoutClass.h>

Public Member Functions

 Readout (std::string IpAddress, const int UDPPort, const int TCPPort, const int Type=0x34, efu_time p=efu_time(1), efu_time t=efu_time())
 
void addReadout (uint8_t Ring, uint8_t FEN, double tof, double weight, const void *data)
 Add a weighted readout: draws n ~ Poisson(weight) and buffers the event n times (weight <= 0 is a noise event, sent once); a full buffer is transmitted and a new packet started automatically.
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const void *data)
 Add a single readout with an explicit event time.
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const CAEN_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const TTLMonitor_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const CDT_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const VMM3_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const BM0_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const BM2_readout_t *data)
 
void addReadout (uint8_t Ring, uint8_t FEN, efu_time t, const BMI_readout_t *data)
 
int send ()
 Transmit the current data buffer.
 
void setPulseTime (uint32_t PHI, uint32_t PLO, uint32_t PPHI, uint32_t PPLO)
 Update the pulse and previous pulse times (high/low pairs).
 
void update_time ()
 Advance the reference (pulse) time to now, flushing the buffer and starting a new packet; keeps (now - prev) within the 5-period window required by the ESS CAEN EFUs.
 
std::pair< uint32_t, uint32_t > lastPulseTime () const
 
std::pair< uint32_t, uint32_t > prevPulseTime () const
 
std::pair< uint32_t, uint32_t > lastEventTime () const
 
void newPacket ()
 Initialize a new packet with no readouts.
 
int command_shutdown () const
 Tell the remote EFU to shut down via its TCP command port.
 
int verbose (const Verbosity v)
 Set verbosity via enum.
 
int verbose (const int v)
 
void dump_to (const std::string &filename, const std::string &dataset_name="events")
 Also store every added readout to a legacy flat HDF5 file (see Writer).
 
void enable_network ()
 
void disable_network ()
 
void set_random_seed (const uint32_t seed)
 
int random_poisson (const double mean)
 

Detailed Description

Runtime-streaming readout generator used by the legacy Readout components.

Buffers ESS readout packets and sends them over UDP to one EFU while the simulation runs. The weighted addReadout() draws n ~ Poisson(weight) and sends the event that many times (weight <= 0 marks a noise event, sent exactly once); it can also mirror every stored record to a legacy flat HDF5 file via dump_to(). The replay path uses Sender instead.

Definition at line 33 of file ReadoutClass.h.

Constructor & Destructor Documentation

◆ Readout()

Readout::Readout ( std::string  IpAddress,
const int  UDPPort,
const int  TCPPort,
const int  Type = 0x34,
efu_time  p = efu_time(1),
efu_time  t = efu_time() 
)
inline

Definition at line 35 of file ReadoutClass.h.

◆ ~Readout()

Readout::~Readout ( )
inline

Definition at line 57 of file ReadoutClass.h.

Member Function Documentation

◆ disable_network()

void Readout::disable_network ( )
inline

Definition at line 130 of file ReadoutClass.h.

◆ enable_network()

void Readout::enable_network ( )
inline

Definition at line 129 of file ReadoutClass.h.

◆ random_poisson()

int Readout::random_poisson ( const double  mean)
inline

Definition at line 136 of file ReadoutClass.h.

◆ set_random_seed()

void Readout::set_random_seed ( const uint32_t  seed)
inline

Definition at line 132 of file ReadoutClass.h.

◆ update_time()

void Readout::update_time ( )
inline

Advance the reference (pulse) time to now, flushing the buffer and starting a new packet; keeps (now - prev) within the 5-period window required by the ESS CAEN EFUs.

Definition at line 86 of file ReadoutClass.h.

References newPacket(), send(), and setPulseTime().

◆ verbose() [1/2]

int Readout::verbose ( const int  v)
inline

Definition at line 124 of file ReadoutClass.h.

◆ verbose() [2/2]

int Readout::verbose ( const Verbosity  v)
inline

Set verbosity via enum.

Definition at line 113 of file ReadoutClass.h.


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