pflib v3.9.4-7-gb2e7f4f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::packing::MultiSampleECONDEventPacket Class Reference

Unpack an event that has potentially more than one sample collected from a single ECOND. More...

#include <MultiSampleECONDEventPacket.h>

Collaboration diagram for pflib::packing::MultiSampleECONDEventPacket:
[legend]

Public Member Functions

const ECONDEventPacketsoi () const
 get the sample of interest
 
 MultiSampleECONDEventPacket (int n_links)
 constructor defining how many links are connected to this ECOND
 
void from (std::span< uint32_t > data, bool expect_ldmx_ror_header=false)
 unpack the given data into this structure
 
Readerread (Reader &r)
 read into this structure from the input Reader
 
void to_csv (std::ofstream &f) const
 write out all of the samples into the input CSV file
 

Public Attributes

std::size_t i_soi
 Corruption bits.
 
int econd_id
 ID for this econ.
 
int contrib_id
 contributor ID
 
int subsys_id
 subsystem ID
 
uint64_t timestamp
 timestamp from RoR
 
std::vector< ECONDEventPacketsamples
 samples from ECOND stored in order of transmission
 

Static Public Attributes

static const std::string to_csv_header
 header string if using to_csv
 

Private Attributes

mutable::pflib::logging::logger the_log_ {::pflib::logging::get("decoding")}
 handle to logging source
 
int n_links_
 number of links connected to the ECOND
 

Detailed Description

Unpack an event that has potentially more than one sample collected from a single ECOND.

See also
ECONDEventPacket for how a single sample from a single ECOND is unpacked.
Note
This unpacking is not well tested and may change depending on how the firmware/software progresses. The current draft was written using TargetFiberless::read_event as a reference.

Member Function Documentation

◆ from()

void pflib::packing::MultiSampleECONDEventPacket::from ( std::span< uint32_t > data,
bool expect_ldmx_ror_header = false )

unpack the given data into this structure

the ldmx ror header inserts 4 32-bit words (16 bytes) of the form

0xA5 | 8b contrib | 8b subsys | 8b VERS = 0 32b 0 64b timestamp

The software emulation adds another header before the ECOND packet, which looks like

4b vers | 10b ECON ID | 5b il1a | S | 0 | 8b length

  • vers is the format version
  • ECOND ID is what it was configured in the software to be
  • il1a is the index of the sample relative to this event
  • S signals if this is the sample of interest (1) or not (0)
  • length is the total length of this link subpacket NOT including this

◆ read()

Reader & pflib::packing::MultiSampleECONDEventPacket::read ( Reader & r)

read into this structure from the input Reader

DANGER Without signal header/trailer words, this assumes that the data stream is word aligned and we aren't starting on the wrong word.

◆ to_csv()

void pflib::packing::MultiSampleECONDEventPacket::to_csv ( std::ofstream & f) const

write out all of the samples into the input CSV file

The columns of the output CSV are

timestamp,orbit,bx,event,i_link,channel,i_sample,Tp,Tc,adc_tm1,adc,tot,toa
uint64_t timestamp
timestamp from RoR
Definition MultiSampleECONDEventPacket.h:43

Member Data Documentation

◆ i_soi

std::size_t pflib::packing::MultiSampleECONDEventPacket::i_soi

Corruption bits.

Index Description
0 full packet header flag mismatch

std::array<bool, 1> corruption; index of the sample of interest (SOI)

◆ to_csv_header

const std::string pflib::packing::MultiSampleECONDEventPacket::to_csv_header
static
Initial value:
=
"timestamp,orbit,bx,event,i_link,channel,i_sample,Tp,Tc,adc_tm1,adc,tot,"
"toa"

header string if using to_csv


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