7#include <unordered_map>
15#include "alcor_spilldata.h"
22#define _FRAME_SIZE_ 1024
25#define _FRAME_LENGTH_NS_ (_FRAME_SIZE_ * 3.125)
28#define _FIRST_FRAMES_TRIGGER_ 2500
31#define _AFTERPULSE_DEADTIME_ 64
146 void assign_bar(mist::logger::progress_bar &bar);
158 void assign_bar(mist::logger::subtask_progress_bar &bar);
199 void _update_bar(int64_t current, int64_t total);
205 uint16_t n_threads_requested;
208 std::mutex frame_mutexes_access;
211 std::mutex triggers_map_mutex;
214 std::mutex spilldata_masks_mutex;
222 uint8_t _current_spill;
228 std::map<std::string, uint32_t> _next_spill;
240 std::variant<std::monostate,
241 mist::logger::progress_bar *,
242 mist::logger::subtask_progress_bar *>
249 std::vector<alcor_data_streamer> data_streams;
257 std::vector<trigger_config> triggers;
260 std::unordered_map<uint8_t, trigger_config> triggers_map;
266 uint16_t _frame_size;
274 TH2F *h2_fine_tune_distribution;
Sequential cursor-based reader for ALCOR hit-level data in a ROOT TTree.
Definition alcor_data_streamer.h:18
High-level accessor class for one beam-spill worth of ALCOR data.
Definition alcor_spilldata.h:99
Frames raw ALCOR data streams from multiple input files in parallel.
Definition parallel_streaming_framer.h:48
TH2F * get_fine_tune_distribution()
Returns the fine tune distribution per tdc index.
Definition parallel_streaming_framer.cxx:47
void set_spilldata_link(alcor_spilldata &v)
Sets the spill data by reference.
Definition parallel_streaming_framer.cxx:51
void process(alcor_data_streamer ¤t_stream, int _frame_size)
Processes a single data stream and returns the framed spill data.
Definition parallel_streaming_framer.cxx:72
parallel_streaming_framer(std::vector< std::string > filenames, uint16_t frame_size=_FRAME_SIZE_)
Construct a framer from a list of input files.
Definition parallel_streaming_framer.h:62
alcor_spilldata get_spilldata() const
Returns a copy of the current spill data.
Definition parallel_streaming_framer.cxx:44
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.
Definition parallel_streaming_framer.h:71
void set_spilldata(alcor_spilldata v)
Sets the spill data by value.
Definition parallel_streaming_framer.cxx:50
void assign_bar(mist::logger::progress_bar &bar)
Assign a standalone progress bar for reporting streaming progress.
Definition parallel_streaming_framer.cxx:55
parallel_streaming_framer()=default
Default constructor.
bool next_spill()
Advances all data streams to the next spill.
Definition parallel_streaming_framer.cxx:201
void clear_bar()
Detach the currently assigned bar without finishing it.
Definition parallel_streaming_framer.cxx:57
int get_registered_triggers()
Returns the number of triggers registered from the configuration file.
Definition parallel_streaming_framer.cxx:46
void set_parallel_cores(uint16_t v)
Sets the number of parallel processing threads.
Definition parallel_streaming_framer.cxx:52
alcor_spilldata & get_spilldata_link()
Returns a reference to the current spill data.
Definition parallel_streaming_framer.cxx:45
Searchable container of readout_config_struct entries.
Definition config_reader.h:85
#define _FRAME_SIZE_
Number of clock cycles per frame.
Definition parallel_streaming_framer.h:22