6#include <unordered_map>
9#include "alcor_lightdata.h"
228 frame_reference_for_deletion.clear();
252 void do_not_write_frame(uint32_t index_of_frame) { frame_reference_for_deletion[index_of_frame] =
true; }
327 std::unordered_map<uint32_t, bool> frame_reference_for_deletion;
Class wrapping lightdata hits with convenient accessors and utilities.
Definition alcor_lightdata.h:38
High-level accessor class for one beam-spill worth of ALCOR data.
Definition alcor_spilldata.h:99
void clear()
Resets the spill to an empty state, also clearing the deletion registry.
Definition alcor_spilldata.h:225
void set_dead_mask(std::map< uint8_t, uint32_t > v)
Replaces the dead-mask map (copied).
Definition alcor_spilldata.h:200
std::map< uint32_t, alcor_lightdata_struct > get_frame() const
Returns a copy of the frame → light-data map.
Definition alcor_spilldata.h:122
void prepare_tree_fill()
Converts the working maps into flat vectors ready for TTree::Fill.
Definition alcor_spilldata.cxx:101
std::vector< alcor_finedata_struct > & get_frame_cherenkov_hits(uint32_t index_of_frame)
Returns a mutable reference to the Cherenkov-hit list for a given frame.
Definition alcor_spilldata.h:184
alcor_spilldata()
Default constructor — initialises to an empty spill.
Definition alcor_spilldata.h:106
std::vector< alcor_lightdata_struct > get_frame_list() const
Returns a copy of the flat light-data vector (TTree representation).
Definition alcor_spilldata.h:131
std::vector< trigger_event > & get_frame_trigger_hits(uint32_t index_of_frame)
Returns a mutable reference to the trigger-hit list for a given frame.
Definition alcor_spilldata.h:166
void set_spilldata_link(alcor_spilldata_struct &v)
Replaces the internal spill-data struct (move-assigned from reference).
Definition alcor_spilldata.h:207
std::map< uint8_t, uint32_t > get_participants_mask() const
Returns a copy of the device → participants-mask map.
Definition alcor_spilldata.h:125
std::map< uint32_t, alcor_lightdata_struct > & get_frame_link()
Returns a mutable reference to the frame → light-data map.
Definition alcor_spilldata.h:144
void get_entry()
Placeholder called after TTree::GetEntry — currently a no-op.
Definition alcor_spilldata.h:323
void link_to_tree(TTree *input_tree)
Binds the flat-vector members to branches of an existing input TTree.
Definition alcor_spilldata.cxx:79
std::vector< alcor_finedata_struct > & get_frame_tracking_hits(uint32_t index_of_frame)
Returns a mutable reference to the tracking-hit list for a given frame.
Definition alcor_spilldata.h:178
void set_participants_mask(std::map< uint8_t, uint32_t > v)
Replaces the participants-mask map (copied).
Definition alcor_spilldata.h:197
std::vector< alcor_finedata_struct > & get_frame_timing_hits(uint32_t index_of_frame)
Returns a mutable reference to the timing-hit list for a given frame.
Definition alcor_spilldata.h:172
std::vector< uint32_t > get_frame_reference_list() const
Returns a copy of the flat frame-reference vector (TTree representation).
Definition alcor_spilldata.h:134
void set_frame(std::map< uint32_t, alcor_lightdata_struct > v)
Replaces the frame → light-data map (copied).
Definition alcor_spilldata.h:194
void write_to_tree(TTree *output_tree)
Creates branches on an output TTree and binds them to the flat vectors.
Definition alcor_spilldata.cxx:90
std::vector< uint32_t > & get_frame_reference_list_link()
Returns a mutable reference to the flat frame-reference vector.
Definition alcor_spilldata.h:156
void set_dead_mask_link(std::map< uint8_t, uint32_t > &v)
Replaces the dead-mask map (move-assigned from reference).
Definition alcor_spilldata.h:216
alcor_spilldata_struct & get_spilldata_link()
Returns a mutable reference to the internal spill-data struct.
Definition alcor_spilldata.h:141
void add_trigger_to_frame(uint32_t index_of_frame, trigger_event trg)
Appends a trigger event to the hit list of the specified frame.
Definition alcor_spilldata.h:242
std::map< uint8_t, uint32_t > get_dead_mask() const
Returns a copy of the device → dead-mask map.
Definition alcor_spilldata.h:128
void set_spilldata(alcor_spilldata_struct v)
Replaces the internal spill-data struct (copied).
Definition alcor_spilldata.h:191
std::vector< alcor_lightdata_struct > & get_frame_list_link()
Returns a mutable reference to the flat light-data vector.
Definition alcor_spilldata.h:153
std::map< uint32_t, std::vector< uint8_t > > get_not_dead_participants()
Returns, per device, the list of channels that are participating but not marked as dead.
Definition alcor_spilldata.cxx:41
alcor_spilldata(const alcor_spilldata_struct &v)
Construct from an existing spill-data struct (copied).
Definition alcor_spilldata.h:112
void do_not_write_frame(uint32_t index_of_frame)
Marks a frame to be excluded from the next TTree fill.
Definition alcor_spilldata.h:252
bool has_trigger(uint32_t index_of_frame)
Returns true if the given frame contains at least one trigger hit.
Definition alcor_spilldata.h:235
bool has_data()
Returns true if this object contains any spill data.
Definition alcor_spilldata.h:274
std::map< uint8_t, uint32_t > & get_dead_mask_link()
Returns a mutable reference to the dead-mask map.
Definition alcor_spilldata.h:150
std::map< uint8_t, uint32_t > & get_participants_mask_link()
Returns a mutable reference to the participants-mask map.
Definition alcor_spilldata.h:147
alcor_spilldata_struct get_spilldata() const
Returns a full copy of the internal spill-data struct.
Definition alcor_spilldata.h:119
void set_participants_mask_link(std::map< uint8_t, uint32_t > &v)
Replaces the participants-mask map (move-assigned from reference).
Definition alcor_spilldata.h:213
void set_frame_link(std::map< uint32_t, alcor_lightdata_struct > &v)
Replaces the frame map (move-assigned from reference).
Definition alcor_spilldata.h:210
Structure holding all types of light detector hits for a spill.
Definition alcor_lightdata.h:17
Plain-old-data aggregate that owns all spill information for one beam spill.
Definition alcor_spilldata.h:46
void clear()
Resets all members to an empty state and re-synchronises the branch-address pointers with their respe...
Definition alcor_spilldata.cxx:7
std::vector< alcor_lightdata_struct > * lightdata_list_in_frame_ptr
Stable pointer for ROOT branch address.
Definition alcor_spilldata.h:75
std::map< uint32_t, alcor_lightdata_struct > frame_and_lightdata
frame_id → light-data payload.
Definition alcor_spilldata.h:59
std::vector< data_mask_struct > participants_mask_list
Flat copy of participants_mask for TTree output.
Definition alcor_spilldata.h:63
std::map< uint8_t, uint32_t > dead_mask
device → dead-channel bitmask.
Definition alcor_spilldata.h:57
std::vector< data_mask_struct > * participants_mask_list_ptr
Stable pointer for ROOT branch address.
Definition alcor_spilldata.h:73
std::vector< data_mask_struct > * dead_mask_list_ptr
Stable pointer for ROOT branch address.
Definition alcor_spilldata.h:72
std::vector< uint32_t > * frame_reference_ptr
Stable pointer for ROOT branch address.
Definition alcor_spilldata.h:74
std::vector< alcor_lightdata_struct > lightdata_list_in_frame
Light-data entries parallel to frame_reference.
Definition alcor_spilldata.h:65
std::vector< data_mask_struct > dead_mask_list
Flat copy of dead_mask for TTree output.
Definition alcor_spilldata.h:62
std::map< uint8_t, uint32_t > participants_mask
device → participating-channel bitmask.
Definition alcor_spilldata.h:58
std::vector< uint32_t > frame_reference
Ordered list of frame IDs written to the TTree.
Definition alcor_spilldata.h:64
Pairs a device ID with a bitmask (used for dead and participant masks).
Definition alcor_spilldata.h:25
uint32_t mask
Bitmask encoding channel states (e.g. alive/dead).
Definition alcor_spilldata.h:27
uint8_t device
Device (ALCOR chip) identifier.
Definition alcor_spilldata.h:26
Per-event trigger data attached to a decoded data frame.
Definition triggers.h:114
Header-only trigger definitions, registry, and TOML-based configuration reader.