epic-drich-beam-test-analysis
ePIC dRICH beam test analysis framework
Loading...
Searching...
No Matches
parallel_streaming_framer Class Reference

Frames raw ALCOR data streams from multiple input files in parallel. More...

#include <parallel_streaming_framer.h>

Public Member Functions

 parallel_streaming_framer ()=default
 Default constructor.
 
 parallel_streaming_framer (std::vector< std::string > filenames, uint16_t frame_size=_FRAME_SIZE_)
 Construct a framer from a list of input files.
 
 parallel_streaming_framer (std::vector< std::string > filenames, std::string trigger_config_file, uint16_t frame_size=_FRAME_SIZE_)
 Construct a framer with trigger configuration.
 
 parallel_streaming_framer (std::vector< std::string > filenames, std::string trigger_config_file, std::string readout_config_file, uint16_t frame_size=_FRAME_SIZE_)
 Construct a framer with trigger and readout configuration.
 
alcor_spilldata get_spilldata () const
 Returns a copy of the current spill data.
 
alcor_spilldataget_spilldata_link ()
 Returns a reference to the current spill data.
 
int get_registered_triggers ()
 Returns the number of triggers registered from the configuration file.
 
TH2F * get_fine_tune_distribution ()
 Returns the fine tune distribution per tdc index.
 
void set_spilldata (alcor_spilldata v)
 Sets the spill data by value.
 
void set_spilldata_link (alcor_spilldata &v)
 Sets the spill data by reference.
 
void set_parallel_cores (uint16_t v)
 Sets the number of parallel processing threads.
 
void assign_bar (mist::logger::progress_bar &bar)
 Assign a standalone progress bar for reporting streaming progress.
 
void assign_bar (mist::logger::subtask_progress_bar &bar)
 Assign a subtask bar from a multi_progress_bar group.
 
void clear_bar ()
 Detach the currently assigned bar without finishing it.
 
bool next_spill ()
 Advances all data streams to the next spill.
 
void process (alcor_data_streamer &current_stream, int _frame_size)
 Processes a single data stream and returns the framed spill data.
 

Detailed Description

Frames raw ALCOR data streams from multiple input files in parallel.

This class manages multiple alcor_data_streamer instances, one per input file, and processes them concurrently to produce framed spill data. It supports optional trigger and readout configuration and afterpulse suppression.

Note
Frame size and timing constants are defined via macros and should eventually be moved to a config file with a proper pass-down mechanism to alcor_spilldata.

Constructor & Destructor Documentation

◆ parallel_streaming_framer() [1/3]

parallel_streaming_framer::parallel_streaming_framer ( std::vector< std::string >  filenames,
uint16_t  frame_size = _FRAME_SIZE_ 
)
inline

Construct a framer from a list of input files.

Parameters
filenamesPaths to the raw ALCOR data files to stream.
frame_sizeNumber of clock cycles per frame (default: _FRAME_SIZE_).

◆ parallel_streaming_framer() [2/3]

parallel_streaming_framer::parallel_streaming_framer ( std::vector< std::string >  filenames,
std::string  trigger_config_file,
uint16_t  frame_size = _FRAME_SIZE_ 
)
inline

Construct a framer with trigger configuration.

Parameters
filenamesPaths to the raw ALCOR data files to stream.
trigger_config_filePath to the trigger configuration file.
frame_sizeNumber of clock cycles per frame (default: _FRAME_SIZE_).

◆ parallel_streaming_framer() [3/3]

parallel_streaming_framer::parallel_streaming_framer ( std::vector< std::string >  filenames,
std::string  trigger_config_file,
std::string  readout_config_file,
uint16_t  frame_size = _FRAME_SIZE_ 
)

Construct a framer with trigger and readout configuration.

Parameters
filenamesPaths to the raw ALCOR data files to stream.
trigger_config_filePath to the trigger configuration file.
readout_config_filePath to the readout configuration file.
frame_sizeNumber of clock cycles per frame (default: _FRAME_SIZE_).

Member Function Documentation

◆ assign_bar() [1/2]

void parallel_streaming_framer::assign_bar ( mist::logger::progress_bar &  bar)

Assign a standalone progress bar for reporting streaming progress.

The framer holds a non-owning pointer — bar must remain alive for the entire duration of processing. Replaces any previously assigned bar.

Parameters
barA progress_bar instance owned by the caller.

◆ assign_bar() [2/2]

void parallel_streaming_framer::assign_bar ( mist::logger::subtask_progress_bar &  bar)

Assign a subtask bar from a multi_progress_bar group.

Use this when the framer is one of several concurrent tasks displayed together. The parent multi_progress_bar (and therefore this subtask handle) must outlive the framer. Replaces any previously assigned bar.

Parameters
barA subtask_progress_bar handle returned by multi_progress_bar::add_subtask().

◆ clear_bar()

void parallel_streaming_framer::clear_bar ( )

Detach the currently assigned bar without finishing it.

After this call the framer reports no progress. The bar itself is unaffected — the caller retains full ownership.

◆ get_fine_tune_distribution()

TH2F * parallel_streaming_framer::get_fine_tune_distribution ( )

Returns the fine tune distribution per tdc index.

Returns
fine tune distribution per tdc index.

◆ get_registered_triggers()

int parallel_streaming_framer::get_registered_triggers ( )

Returns the number of triggers registered from the configuration file.

Returns
Number of triggers registered from the configuration file.
Todo:
Trigger number should be assigned by program, and checked to avoid using reserved numbers > should be [0-100[

◆ get_spilldata()

alcor_spilldata parallel_streaming_framer::get_spilldata ( ) const

Returns a copy of the current spill data.

Returns
The accumulated alcor_spilldata for the current spill.

◆ get_spilldata_link()

alcor_spilldata & parallel_streaming_framer::get_spilldata_link ( )

Returns a reference to the current spill data.

Returns
Reference to the internal alcor_spilldata object.

◆ next_spill()

bool parallel_streaming_framer::next_spill ( )

Advances all data streams to the next spill.

Returns
true if a next spill is available, false if all streams are exhausted.

◆ process()

void parallel_streaming_framer::process ( alcor_data_streamer current_stream,
int  _frame_size 
)

Processes a single data stream and returns the framed spill data.

Parameters
current_streamReference to the alcor_data_streamer to process.
_frame_sizeNumber of clock cycles per frame.

◆ set_parallel_cores()

void parallel_streaming_framer::set_parallel_cores ( uint16_t  v)

Sets the number of parallel processing threads.

Parameters
vRequested number of threads.

◆ set_spilldata()

void parallel_streaming_framer::set_spilldata ( alcor_spilldata  v)

Sets the spill data by value.

Parameters
vThe alcor_spilldata object to assign.

◆ set_spilldata_link()

void parallel_streaming_framer::set_spilldata_link ( alcor_spilldata v)

Sets the spill data by reference.

Parameters
vReference to the alcor_spilldata object to assign.

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