gaps-online-software 0.10
online software for the TOF system for the GAPS experiment
Loading...
Searching...
No Matches
MasterTriggerEvent Struct Reference

#include <events.h>

Public Member Functions

u64 get_timestamp_gps48 () const
 
u64 get_timestamp_abs48 () const
 Get absolute timestamp as sent by the GPS.
 
Vec< u8 > get_rb_link_ids () const
 
Vec< std::tuple< u8, u8, u8, LTBThreshold > > get_trigger_hits () const
 
Vec< TriggerType > get_trigger_sources () const
 Get the trigger sources from trigger source byte.
 
std::string to_string () const
 String representation of the struct.
 

Static Public Member Functions

static MasterTriggerEvent from_bytestream (const Vec< u8 > &bytestream, u64 &pos)
 

Public Attributes

EventStatus event_status
 
u32 event_id
 event_id as assigned by the MasterTriggerBoard
 
u32 timestamp
 MTB timestamp.
 
u32 tiu_timestamp
 Tracker (?) timestamp.
 
u32 tiu_gps32
 GAPS GPS clock value (slow)
 
u32 tiu_gps16
 GAPS GPS clock value (fast)
 
u32 crc
 triggered paddles as seen by the MTB
 
u16 trigger_source
 
u32 dsi_j_mask
 
Vec< u16 > channel_mask
 
u64 mtb_link_mask
 

Static Public Attributes

static const u16 HEAD = 0xAAAA
 begin struct marker
 
static const u16 TAIL = 0x5555
 end struct marker
 
static const usize SIZE = 45
 the struct has a fixed size of SIZE
 

Detailed Description

The MasterTriggerEvent represesnts the information provided by the MTB for this one specific event. Most notably, it includes a board mask, which is the DSI/J connections which triggered, and a hit mask. The hit mask gives hit channels per DSI/J, which correspond to hit channels on a LTB.

FIXME -compatibiltiy. Reading older data, we have 2 scenarios - either 113 bytes of fixed size for 20 LTBs, or 133 bytes for 25 LTBs. We can modify from_bytestream to at least not throw an error when reading older data, but this would currently be a todo of lower priority

Member Function Documentation

◆ from_bytestream()

static MasterTriggerEvent MasterTriggerEvent::from_bytestream ( const Vec< u8 > &  bytestream,
u64 &  pos 
)
static

Factory function for MasterTriggerEvent

Deserialize a MasterTriggerEvent from a vector of of bytes

Parameters
bytestreamByte representation of a MasterTriggerEvent, or including one at pos
pos: Expected position of MasterTriggerEvent::HEAD in the stream

◆ get_timestamp_gps48()

u64 MasterTriggerEvent::get_timestamp_gps48 ( ) const

The combined GPS 48bit timestamp into a 48bit timestamp

◆ get_trigger_hits()

Vec< std::tuple< u8, u8, u8, LTBThreshold > > MasterTriggerEvent::get_trigger_hits ( ) const

Get the combination of triggered DSI/J/CH on the MTB which formed the trigger. This does not include further hits which fall into the integration window. For those, se rb_link_mask

The returned values follow the TOF convention to start with 1, so that we can use them to look up LTB ids in the db.

Returns

Vec<(hit)> where hit is (DSI, J, CH)


The documentation for this struct was generated from the following file: