pub struct RBEventHeader {Show 16 fields
pub rb_id: u8,
pub event_id: u32,
pub stop_cell: u16,
pub pid_ch12: u8,
pub pid_ch34: u8,
pub pid_ch56: u8,
pub pid_ch78: u8,
pub pid_ch_order: u8,
pub rsvd1: u8,
pub rsvd2: u8,
pub rsvd3: u8,
pub fpga_temp: u16,
pub drs_deadtime: u16,
pub timestamp32: u32,
pub timestamp16: u16,
pub deadtime_instead_temp: bool,
/* private fields */
}
Expand description
The RBEvent header gets generated once per event per RB. Contains information about event id, timestamps, etc.
Fields§
§rb_id: u8
Readoutboard ID - should be in the range 1-50 not consecutive, there are some missing. In general, we have 40 boards
event_id: u32
The event ID as sent from the MTB or self-generated if not latched to the MTB
stop_cell: u16
The DRS stop cell. This is vital information which is needed for the calibration
pid_ch12: u8
RBPaddleID - component
pid_ch34: u8
RBPaddleID - component
pid_ch56: u8
RBPaddleID - component
pid_ch78: u8
RBPaddleID - component
pid_ch_order: u8
RBPaddleID - component
rsvd1: u8
Reserved
rsvd2: u8
Reserved
rsvd3: u8
Reserved
fpga_temp: u16
The adc value for the temperature of the FPGA
drs_deadtime: u16
DRS deadtime as read out from the register
timestamp32: u32
§timestamp16: u16
§deadtime_instead_temp: bool
Store the drs_deadtime instead of the fpga temperature
Implementations§
Source§impl RBEventHeader
impl RBEventHeader
pub fn new() -> Self
Sourcepub fn set_channel_mask(&mut self, channel_mask: u16)
pub fn set_channel_mask(&mut self, channel_mask: u16)
Set the channel mask with the 9bit number
Set bit 15 to either 1 or 0 depending on deadtime_instead_temp
Sourcepub fn get_channel_mask(&self) -> u16
pub fn get_channel_mask(&self) -> u16
Just return the channel mask and strip of the part which contains the information about drs deadtime or fpga temp
Sourcepub fn parse_channel_mask(ch_mask: u16) -> (bool, u16)
pub fn parse_channel_mask(ch_mask: u16) -> (bool, u16)
Get the channel mask from a bytestream.
This takes into acount that bit 15 is used to convey information about if we stored the drs temperature or deadtime
Sourcepub fn extract_eventid_from_rbheader(stream: &Vec<u8>) -> u32
pub fn extract_eventid_from_rbheader(stream: &Vec<u8>) -> u32
Only get the eventid from a binary stream
pub fn is_event_fragment(&self) -> bool
pub fn drs_lost_trigger(&self) -> bool
pub fn lost_lock(&self) -> bool
pub fn lost_lock_last_sec(&self) -> bool
pub fn is_locked(&self) -> bool
pub fn is_locked_last_sec(&self) -> bool
Sourcepub fn parse_status(&mut self, status_bytes: u16)
pub fn parse_status(&mut self, status_bytes: u16)
extract lock, drs busy and fpga temp from status field
Sourcepub fn get_fpga_temp(&self) -> f32
pub fn get_fpga_temp(&self) -> f32
Get the temperature value (Celsius) from the fpga_temp adc.
pub fn get_rbpaddleid(&self) -> RBPaddleID
pub fn set_rbpaddleid(&mut self, pid: &RBPaddleID)
Sourcepub fn get_channels(&self) -> Vec<u8>
pub fn get_channels(&self) -> Vec<u8>
Decode the channel mask into channel ids.
The channel ids inside the memory representation of the RB Event data (“blob”) are from 0-7
We keep ch9 seperate.
Sourcepub fn get_active_paddles(&self) -> Vec<(u8, bool)>
pub fn get_active_paddles(&self) -> Vec<(u8, bool)>
Get the active paddles
pub fn get_timestamp48(&self) -> u64
Trait Implementations§
Source§impl Clone for RBEventHeader
impl Clone for RBEventHeader
Source§fn clone(&self) -> RBEventHeader
fn clone(&self) -> RBEventHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RBEventHeader
impl Debug for RBEventHeader
Source§impl Default for RBEventHeader
impl Default for RBEventHeader
Source§impl Display for RBEventHeader
impl Display for RBEventHeader
Source§impl From<&RBEventHeader> for TofPacket
impl From<&RBEventHeader> for TofPacket
Source§fn from(ev_header: &RBEventHeader) -> TofPacket
fn from(ev_header: &RBEventHeader) -> TofPacket
Source§impl FromRandom for RBEventHeader
impl FromRandom for RBEventHeader
fn from_random() -> Self
Source§impl PartialEq for RBEventHeader
impl PartialEq for RBEventHeader
Source§impl Serialization for RBEventHeader
impl Serialization for RBEventHeader
const HEAD: u16 = 43_690u16
const TAIL: u16 = 21_845u16
Source§const SIZE: usize = 30usize
const SIZE: usize = 30usize
Source§fn from_bytestream(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>
fn from_bytestream( stream: &Vec<u8>, pos: &mut usize, ) -> Result<Self, SerializationError>
Source§fn to_bytestream(&self) -> Vec<u8>
fn to_bytestream(&self) -> Vec<u8>
Source§fn verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), SerializationError>
fn verify_fixed( stream: &Vec<u8>, pos: &mut usize, ) -> Result<(), SerializationError>
Source§fn from_tofpacket(packet: &TofPacket) -> Result<Self, SerializationError>where
Self: Sized,
fn from_tofpacket(packet: &TofPacket) -> Result<Self, SerializationError>where
Self: Sized,
fn from_slice(
_slice: &[u8],
_start_pos: usize,
) -> Result<Self, SerializationError>where
Self: Sized,
impl StructuralPartialEq for RBEventHeader
Auto Trait Implementations§
impl Freeze for RBEventHeader
impl RefUnwindSafe for RBEventHeader
impl Send for RBEventHeader
impl Sync for RBEventHeader
impl Unpin for RBEventHeader
impl UnwindSafe for RBEventHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self
to an expression for Diesel’s query builder. Read more