pub struct TofDetectorStatus {
pub channels000_031: u32,
pub channels032_063: u32,
pub channels064_095: u32,
pub channels096_127: u32,
pub channels128_159: u32,
pub channels160_191: u32,
pub channels192_223: u32,
pub channels224_255: u32,
pub channels256_297: u32,
pub channels298_319: u32,
}
Expand description
Report dead channels/non-active detectors for the TOF system
This is a very simple approach A channels are the paddle_id - 1 while B channels are encoded as paddle_id - 159
Dead channels will be 0, active channels will be 1
Fields§
§channels000_031: u32
§channels032_063: u32
§channels064_095: u32
§channels096_127: u32
§channels128_159: u32
§channels160_191: u32
§channels192_223: u32
§channels224_255: u32
§channels256_297: u32
§channels298_319: u32
Implementations§
Source§impl TofDetectorStatus
impl TofDetectorStatus
pub fn new() -> Self
Sourcepub fn update_from_map(&mut self, paddles: HashMap<u16, bool>)
pub fn update_from_map(&mut self, paddles: HashMap<u16, bool>)
Update the dead channel list form a HashMap with paddle information as it is created in the RB communication threads of liftof-cc
Sourcepub fn get_dead_paddles_a(&self) -> Vec<u8>
pub fn get_dead_paddles_a(&self) -> Vec<u8>
Get all paddle ids which have dead channels on the A-side
Sourcepub fn get_dead_paddles_b(&self) -> Vec<u8>
pub fn get_dead_paddles_b(&self) -> Vec<u8>
Get all paddle ids which have dead channels on the B-side
Trait Implementations§
Source§impl Clone for TofDetectorStatus
impl Clone for TofDetectorStatus
Source§fn clone(&self) -> TofDetectorStatus
fn clone(&self) -> TofDetectorStatus
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TofDetectorStatus
impl Debug for TofDetectorStatus
Source§impl Default for TofDetectorStatus
impl Default for TofDetectorStatus
Source§impl Display for TofDetectorStatus
impl Display for TofDetectorStatus
Source§impl FromRandom for TofDetectorStatus
impl FromRandom for TofDetectorStatus
fn from_random() -> Self
Source§impl Packable for TofDetectorStatus
impl Packable for TofDetectorStatus
const PACKET_TYPE: PacketType = PacketType::TofDetectorStatus
Source§fn pack(&self) -> TofPacketwhere
Self: Serialization,
fn pack(&self) -> TofPacketwhere
Self: Serialization,
Wrap myself in a TofPacket
Source§impl PartialEq for TofDetectorStatus
impl PartialEq for TofDetectorStatus
Source§impl Serialization for TofDetectorStatus
impl Serialization for TofDetectorStatus
const HEAD: u16 = 43_690u16
const TAIL: u16 = 21_845u16
Source§const SIZE: usize = 44usize
const SIZE: usize = 44usize
The SIZE is the size of the serialized
bytestream INCLUDING 4 bytes for head
and tail bytes. In case the struct does
NOT HAVE a fixed size, SIZE will be 0
(so default value of the trait
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>
Decode a serializable from a bytestream
Source§fn to_bytestream(&self) -> Vec<u8>
fn to_bytestream(&self) -> Vec<u8>
Encode a serializable to a bytestream
Source§fn verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), SerializationError>
fn verify_fixed( stream: &Vec<u8>, pos: &mut usize, ) -> Result<(), SerializationError>
Verify that the serialized representation of the struct has the
correct size, including header + footer. Read more
Source§fn from_tofpacket(packet: &TofPacket) -> Result<Self, SerializationError>where
Self: Sized,
fn from_tofpacket(packet: &TofPacket) -> Result<Self, SerializationError>where
Self: Sized,
Decode a serializable directly from a TofPacket
fn from_slice(
_slice: &[u8],
_start_pos: usize,
) -> Result<Self, SerializationError>where
Self: Sized,
impl Copy for TofDetectorStatus
impl StructuralPartialEq for TofDetectorStatus
Auto Trait Implementations§
impl Freeze for TofDetectorStatus
impl RefUnwindSafe for TofDetectorStatus
impl Send for TofDetectorStatus
impl Sync for TofDetectorStatus
impl Unpin for TofDetectorStatus
impl UnwindSafe for TofDetectorStatus
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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
Convert
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
Convert
&self
to an expression for Diesel’s query builder. Read more