pub struct RBEventHeader {Show 18 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,
pub status_byte: u8,
pub channel_mask: u16,
}
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
status_byte: u8
The status byte contains information about lsos of lock and event fragments and needs to be decoded
channel_mask: u16
The channel mask is 9bit for the 9 channels. This leaves 7 bits of space so we actually hijack that for the version information
Bit 15 will be set 1 in case we are sending the DRS_DEADTIME instead of FPGA TEMP
FIXME - make this proper and use ProtocolVersion instead
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 PartialEq for RBEventHeader
impl PartialEq for RBEventHeader
Source§impl Serialization for RBEventHeader
impl Serialization for RBEventHeader
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 verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), SerializationError>
fn verify_fixed( stream: &Vec<u8>, pos: &mut usize, ) -> Result<(), SerializationError>
Source§fn from_bytestream_alt(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>where
Self: Sized,
fn from_bytestream_alt(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>where
Self: Sized,
impl Copy for RBEventHeader
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> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT
modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL
modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.