lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Eb::CubeConfigDgram Class Reference

ResultDgram that stores a ResultType in the monitor buffer number word, a bin count in the auxdata field, and NUL-terminated JSON text appended to its payload. More...

#include <CubeConfigDgram.hh>

Inherits Pds::Eb::ResultDgram.

Public Member Functions

 CubeConfigDgram (const Pds::EbDgram &dgram, unsigned id)
 Construct as ResultDgram(dgram, id).
 
void resultType (char *rtype)
 Store Cube if rtype is the string Cube, Window if it is Window, otherwise Base, in the monitor buffer number word.
 
void bins (unsigned nbins)
 Store nbins in the auxdata field (24 bits).
 
void appendJson (char *json)
 Append the string json, including its terminating NUL, to the Xtc payload (Xtc::alloc() without an end check).
 
ResultType resultType () const
 Return the monitor buffer number word cast to ResultType.
 
unsigned bins () const
 Return the auxdata field (the bin count set by bins(unsigned)).
 
char * json () const
 Return a pointer to the payload bytes just after the ResultDgram fields, which is where the first appendJson() call places its text.
 
- Public Member Functions inherited from Pds::Eb::ResultDgram
 ResultDgram (const Pds::EbDgram &dgram, unsigned id)
 Copy the pulse ID and transition header of dgram, use a new Xtc of TypeId::Data (version 0) with source Src(id, Level::Event), zero both words, and add their size to the Xtc extent.
 
void prescale (bool value)
 Set or clear the prescale bit (bit 0) of the result word.
 
void persist (bool value)
 Set or clear the persist bit (bit 1) of the result word.
 
void monitor (uint32_t value)
 Set the monitor field (MAX_MRQS bits starting at bit 2) of the result word to value, masked to the field width.
 
void auxdata (uint32_t value)
 Set the auxdata field (bits 31-8) of the result word to value, masked to 24 bits.
 
bool prescale () const
 Return true if the prescale bit (bit 0) is set.
 
bool persist () const
 Return true if the persist bit (bit 1) is set.
 
uint32_t monitor () const
 Return the monitor field (MAX_MRQS bits starting at bit 2), shifted down.
 
uint32_t auxdata () const
 Return the auxdata field (bits 31-8), shifted down.
 
uint32_t data () const
 Return the whole 32-bit result word.
 
void monBufNo (uint32_t monBufNo_)
 Set the monitor buffer number word (CubeConfigDgram stores its ResultType in this word).
 
uint32_t monBufNo () const
 Return the monitor buffer number word.
 
- Public Member Functions inherited from Pds::EbDgram
 EbDgram (const PulseId &pulseId, const Dgram &dgram)
 Construct from the pulse ID of pulseId (control bits dropped) and a copy of dgram.
 
 EbDgram (const TimingHeader &th, const XtcData::Src src, uint32_t envRogMask)
 Construct from a timing header: pulse ID (control bits dropped), time, env set to the control bits in bits 31-24 plus th.env masked by envRogMask, and an empty Parent Xtc with source src.
 
void setEOL () const
 Set bit 62 of the pulse ID word, marking the last entry of a batch (callable on const objects).
 
bool isEOL () const
 Return true if bit 62 of the pulse ID word is set.
 
bool keepRaw () const
 Return bit 22 of env.
 
- Public Member Functions inherited from Pds::PulseId
 PulseId (uint64_t value)
 Store value as the whole 64-bit word, control bits included.
 
uint64_t pulseId () const
 Return the low 56 bits of the word (the pulse ID without the control bits).
 
- Public Member Functions inherited from XtcData::Dgram
 Dgram ()
 Default constructor; header fields are uninitialized and xtc is default-constructed (damage 0, extent 0).
 
 Dgram (const Transition &transition_)
 Copy the header from transition_; xtc is default-constructed (damage 0, extent 0).
 
 Dgram (const Transition &transition_, const Xtc &xtc_)
 Copy the header from transition_ and copy-construct xtc from xtc_.
 
- Public Member Functions inherited from XtcData::Transition
 Transition ()
 Default constructor; fields are left uninitialized as in TransitionBase().
 
 Transition (Type type_, TransitionId::Value tid_, const TimeStamp &time_, uint32_t env_)
 Forward all arguments to TransitionBase(type_, tid_, time_, env_).
 
unsigned control () const
 Return env bits 31:24.
 
TransitionId::Value service () const
 Return env bits 27:24 as a TransitionId::Value.
 
Type type () const
 Return env bits 29:28 as a Type.
 
bool isEvent () const
 Return true if service() is TransitionId::L1Accept.
 
bool isExtended () const
 Return true if env bit 16 is set and isEvent() is false.
 
- Public Member Functions inherited from XtcData::TransitionBase
 TransitionBase ()
 Default constructor; time and env are left uninitialized.
 
 TransitionBase (Type type_, TransitionId::Value tid_, const TimeStamp &time_, uint32_t env_)
 Set time to time_ and env to (type_<<28)|(tid_<<24)|(env_&0xffffff).
 
uint16_t readoutGroups () const
 Return the low 16 bits of env.
 

Additional Inherited Members

- Public Types inherited from XtcData::TransitionBase
enum  Type { Event = 0 , Occurrence = 1 , Marker = 2 }
 Transition type; Transition::type() reads it from env bits 29:28. More...
 
enum  { NumberOfTypes = 3 }
 Count of Type values. More...
 
- Public Attributes inherited from XtcData::Dgram
Xtc xtc
 Top-level Xtc container.
 
- Public Attributes inherited from XtcData::TransitionBase
TimeStamp time
 Datagram timestamp.
 
uint32_t env
 Packed word: type, transition id and 24 low bits (layout in the class description).
 
- Static Public Attributes inherited from XtcData::Dgram
static const unsigned MaxSize = 0x1000000
 0x1000000. Inferred from the name to be a maximum datagram size in bytes; not enforced in this header.
 
- Protected Attributes inherited from Pds::PulseId
uint64_t _pulseIdAndControl
 

Detailed Description

ResultDgram that stores a ResultType in the monitor buffer number word, a bin count in the auxdata field, and NUL-terminated JSON text appended to its payload.

Constructor & Destructor Documentation

◆ CubeConfigDgram()

Pds::Eb::CubeConfigDgram::CubeConfigDgram ( const Pds::EbDgram &  dgram,
unsigned  id 
)
inline

Construct as ResultDgram(dgram, id).

Member Function Documentation

◆ appendJson()

void Pds::Eb::CubeConfigDgram::appendJson ( char *  json)

Append the string json, including its terminating NUL, to the Xtc payload (Xtc::alloc() without an end check).

◆ bins() [1/2]

unsigned Pds::Eb::CubeConfigDgram::bins ( ) const
inline

Return the auxdata field (the bin count set by bins(unsigned)).

◆ bins() [2/2]

void Pds::Eb::CubeConfigDgram::bins ( unsigned  nbins)
inline

Store nbins in the auxdata field (24 bits).

◆ json()

char * Pds::Eb::CubeConfigDgram::json ( ) const
inline

Return a pointer to the payload bytes just after the ResultDgram fields, which is where the first appendJson() call places its text.

◆ resultType() [1/2]

ResultType Pds::Eb::CubeConfigDgram::resultType ( ) const
inline

Return the monitor buffer number word cast to ResultType.

◆ resultType() [2/2]

void Pds::Eb::CubeConfigDgram::resultType ( char *  rtype)

Store Cube if rtype is the string Cube, Window if it is Window, otherwise Base, in the monitor buffer number word.


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