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

Simple HGCROC-only event packet. More...

#include <SingleROCEventPacket.h>

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

Public Member Functions

void from (std::span< uint32_t > data)
 parse into this package from the passed data span
 
Readerread (Reader &r)
 read from the input reader into this packet
 
void to_csv (std::ofstream &f) const
 write current packet into a CSV
 
Sample channel (int ch) const
 Get a specific Sample from a channel.
 
uint32_t trigsum (int i_link, int i_sum, int i_bx=0) const
 Get a trigger cell sum.
 
 SingleROCEventPacket ()=default
 default constructor that does nothing
 

Public Attributes

std::array< DAQLinkFrame, 2 > daq_links
 the two daq links for the connected HGCROC
 
std::array< TriggerLinkFrame, 4 > trigger_links
 the four trigger links
 

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")}
 

Detailed Description

Simple HGCROC-only event packet.

No zero suppressions or condensation is done, the entire HGCROC DAQ and Link packets are reaodut into a single event packet in sequence.

This is the style of readout from the 2021 teastbeam and can be done easily in pflib without much emulation.

Member Function Documentation

◆ channel()

Sample pflib::packing::SingleROCEventPacket::channel ( int ch) const

Get a specific Sample from a channel.

The channel index input here is relative to the ROC [0,71]. If you have the channel index within a daq link (or ROC "half"), just access the daq links directly

ep.daq_links[i_link].channels[i_chan]

where i_link is the link index 0 or 1 and i_chan is the channel index within the link [0,35].

◆ read()

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

read from the input reader into this packet

enables us to

r >> ep;
Simple HGCROC-only event packet.
Definition SingleROCEventPacket.h:23

◆ to_csv()

void pflib::packing::SingleROCEventPacket::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 ch) const
Get a specific Sample from a channel.
Definition SingleROCEventPacket.cxx:118

Since there are two DAQ links each with 36 channels and one calib channel, there are 2*(36+1)=74 rows written for each call to this function.

The trigger links are entirely ignored.

◆ trigsum()

uint32_t pflib::packing::SingleROCEventPacket::trigsum ( int i_link,
int i_sum,
int i_bx = 0 ) const

Get a trigger cell sum.

We do not have a unified ID number for trigger cells defined at the moment, so you need to specify both which trigger link it comes from and the index of the sum within that trigger link.

Parameters
[in]i_linktrigger link 0-3
[in]i_sumindex of sum within the link 0-3
[in]i_bxindex of BX relative to in-time sample, default is 0 (the in-time sample)

We return the linearized sum since that is what most people want.

See also
TriggerLinkFrame::compressed_to_linearized for how this value is determined and how you should interpret it. TLDR: the value is linearized but is off by some scale factor that depends on the SelTC4 parameter on the chip.

Member Data Documentation

◆ to_csv_header

const std::string pflib::packing::SingleROCEventPacket::to_csv_header
static
Initial value:
=
"i_link,bx,event,orbit,channel," + Sample::to_csv_header
static const std::string to_csv_header
header if using to_csv
Definition Sample.h:26

header string if using to_csv


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