pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::packing::ECONDEventPacket Class Reference

Single ECON-D event packet. More...

#include <ECONDEventPacket.h>

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

Public Member Functions

 ECONDEventPacket (std::size_t n_links)
 Construct an event packet with the number of eRx "links".
 
int adc_cm0 (int i_link) const
 get ADC readout from common mode 0 of input link
 
int adc_cm1 (int i_link) const
 get ADC readout from common mode 1 of input link
 
Sample channel (int i_link, int i_ch) const
 get channel Sample from a link
 
Sample calib (int i_link) const
 get calib Sample from a link half
 
void from (std::span< uint32_t > data)
 parse into the packet from the passed data span
 
void to_csv (std::ofstream &f) const
 write current packet into a CSV
 

Public Attributes

std::array< bool, 4 > corruption
 storage of corruption bits
 
std::vector< DAQLinkFramelinks
 storage of unpacked link data
 

Static Public Attributes

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

Private Member Functions

std::size_t unpack_link_subpacket (std::span< uint32_t > data, DAQLinkFrame &link, bool passthrough)
 Unpack a eRx ("link") subpacket from the ECOND event into a DAQLinkFrame.
 

Private Attributes

mutable::pflib::logging::logger the_log_ {::pflib::logging::get("decoding")}
 handle to logging source
 

Detailed Description

Single ECON-D event packet.

The ECON-D is the CONcentrator mezzanine for the Data path and it has many different configuration modes. The two most important to us for decoding are

  1. "Pass Through" mode - all 37 sample words are copied from the link, the link headers from the ROC are overwritten by ECOND link headers
  2. "Regular" mode - the ECOND event format is written which can include zero-suppression of multiple varieties including full eliminating channels that are empty

The ECOND_Formatter emulates the ECON-D re-formatting of the HGCROC event packets into the ECON-D event packet. This unpacking is done separately from this formatter so that it can be applied to data actually extracted from an ECON-D.

Member Function Documentation

◆ from()

void pflib::packing::ECONDEventPacket::from ( std::span< uint32_t > data)

parse into the packet from the passed data span

This function is what implements the format describe in the ECOND specification.

See also
MultiSampleECONDEventPacket for wrapping this function with more unpacking to handle the extra headers and trailers that are added by software emulation or hardware.

◆ to_csv()

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

write current packet into a CSV

Parameters
[in,out]ffile to write CSV to

The columns of the output CSV are

i_link, bx, event, orbit, channel, Tp, Tc, adc_tm1, adc, tot, toa
Sample channel(int i_link, int i_ch) const
get channel Sample from a link
Definition ECONDEventPacket.cxx:358

Since there are 36 channels and one calib channel per DAQ links, there are N*(36+1) rows written for each call to this function where N is the number of links.

The trigger links are entirely ignored.

◆ unpack_link_subpacket()

std::size_t pflib::packing::ECONDEventPacket::unpack_link_subpacket ( std::span< uint32_t > data,
DAQLinkFrame & link,
bool passthrough )
private

Unpack a eRx ("link") subpacket from the ECOND event into a DAQLinkFrame.

Note
We overload the zero'th corruption bit for DAQLinkFrame to mean that any of the three Stat bits are bad (not 1).
Parameters
[in]datasubpacket data to unpack
[out]linkDAQLinkFrame to update with unpacked data @paran[in] passthrough whether the ECOND is in pass through mode or not
Returns
std::size_t length of data in 32b words that was unpacked

Member Data Documentation

◆ corruption

std::array<bool, 4> pflib::packing::ECONDEventPacket::corruption

storage of corruption bits

Index Description
0 9b header marker is not the ECOND spec or common CMS config
1 stored length does not equal packet length
2 8b header CRC mismatch
3 32b sub-packet CRC mismatch

◆ links

std::vector<DAQLinkFrame> pflib::packing::ECONDEventPacket::links

storage of unpacked link data

This is very space in-efficient since we store zero words for any channel or measurement that was zero suppressed. This won't be a problem for the smaller-scale testbeam prototypes, but could be a memory issue when we get to the full LDMX detector with its almost 100k channels.

◆ to_csv_header

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

header string if using to_csv


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