pub struct TofEvent {
pub compression_level: CompressionLevel,
pub quality: EventQuality,
pub header: TofEventHeader,
pub mt_event: MasterTriggerEvent,
pub rb_events: Vec<RBEvent>,
pub creation_time: Instant,
pub write_to_disk: bool,
pub paddles_set: bool,
}
Fields§
§compression_level: CompressionLevel
§quality: EventQuality
§header: TofEventHeader
§mt_event: MasterTriggerEvent
§rb_events: Vec<RBEvent>
§creation_time: Instant
§write_to_disk: bool
§paddles_set: bool
Implementations§
Source§impl TofEvent
impl TofEvent
pub fn new() -> Self
pub fn set_paddles(&mut self, paddles: &HashMap<u8, Paddle>)
Sourcepub fn get_pointcloud(&self) -> Option<Vec<(f32, f32, f32, f32, f32)>>
pub fn get_pointcloud(&self) -> Option<Vec<(f32, f32, f32, f32, f32)>>
Get the pointcloud of this event, sorted by time
§Returns
(f32, f32, f32, f32, f32) : (x,y,z,t,edep)
Sourcepub fn get_missing_paddles_hg(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
pub fn get_missing_paddles_hg(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
Compare the MasterTriggerEvent::trigger_hits with the actual hits to determine from which paddles we should have received HG hits (from waveforms) but we did not get them
WARNING: The current implementation of this is rather slow and not fit for production use FIXME - rewrite as a closure
Sourcepub fn get_extra_paddles_hg(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
pub fn get_extra_paddles_hg(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
Compare the MasterTriggerEvent::trigger_hits with the actual hits to determine from which paddles we have received more hits than we were supposed to. These hits are neither in the trigger hits nor rb_link_ids
FIXME - this can be hits which are exclusively within the RB integration window
Sourcepub fn get_missing_paddles_wf(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
pub fn get_missing_paddles_wf(&self, pid_map: &DsiJChPidMapping) -> Vec<u8> ⓘ
Compare the MasterTriggerEvent::trigger_hits with the actual recorded waveforms to determine from which paddles we should have received waveforms from. This is independent of the hits, which additionally required that the hit extraction algorithm worked.
Sourcepub fn get_triggered_paddles(&self, pid_map: DsiJChPidMapping) -> Vec<u8> ⓘ
pub fn get_triggered_paddles(&self, pid_map: DsiJChPidMapping) -> Vec<u8> ⓘ
Get the triggered paddle ids
Warning, this might be a bit slow
pub fn extract_event_id_from_stream( stream: &Vec<u8>, ) -> Result<u32, SerializationError>
pub fn age(&self) -> u64
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Simple check if the event contains as much RBEvents as expected from the provided boards masks by the MTB
Sourcepub fn is_complete_masked(&self, mtb_link_ids_excluded: &Vec<u8>) -> bool
pub fn is_complete_masked(&self, mtb_link_ids_excluded: &Vec<u8>) -> bool
A more advanced check, where events which are not in the provided mtb_link_id list don’t count for completion
Sourcepub fn construct_sizes_header(&self) -> u32
pub fn construct_sizes_header(&self) -> u32
Encode the sizes of the vectors holding the into an u32
We have one byte (256) max length per vector.
pub fn decode_size_header(mask: &u32) -> (usize, usize)
pub fn get_combined_vector_sizes(&self) -> usize
Sourcepub fn get_rbwaveforms(&self) -> Vec<RBWaveform>
pub fn get_rbwaveforms(&self) -> Vec<RBWaveform>
Get all waveforms of all RBEvents in this event
Sourcepub fn get_waveforms(&self) -> Vec<RBWaveform>
pub fn get_waveforms(&self) -> Vec<RBWaveform>
Get all waveforms of all RBEvents in this event ISSUE - Performance, Memory FIXME - reimplement this things where this returns only a reference
Sourcepub fn get_waveform_pids(&self) -> Vec<u8> ⓘ
pub fn get_waveform_pids(&self) -> Vec<u8> ⓘ
Get all the paddles which have waveforms
Sourcepub fn has_any_mangling(&self) -> bool
pub fn has_any_mangling(&self) -> bool
Check if th eassociated RBEvents have any of their mangling stati set
pub fn get_summary(&self) -> TofEventSummary
Sourcepub fn get_lost_hits(&self) -> u16
pub fn get_lost_hits(&self) -> u16
The number of hits we did not get becaue of the DRS busy
pub fn get_nhits_umb(&self) -> usize
pub fn get_nhits(&self) -> usize
Trait Implementations§
Source§impl From<MasterTriggerEvent> for TofEvent
impl From<MasterTriggerEvent> for TofEvent
Source§fn from(mte: MasterTriggerEvent) -> Self
fn from(mte: MasterTriggerEvent) -> Self
Source§impl FromRandom for TofEvent
impl FromRandom for TofEvent
fn from_random() -> Self
Source§impl Packable for TofEvent
impl Packable for TofEvent
const PACKET_TYPE: PacketType = PacketType::TofEvent
Source§fn pack(&self) -> TofPacketwhere
Self: Serialization,
fn pack(&self) -> TofPacketwhere
Self: Serialization,
Source§impl Serialization for TofEvent
impl Serialization for TofEvent
const HEAD: u16 = 43_690u16
const TAIL: u16 = 21_845u16
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§const SIZE: usize = 0usize
const SIZE: usize = 0usize
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,
Auto Trait Implementations§
impl Freeze for TofEvent
impl RefUnwindSafe for TofEvent
impl Send for TofEvent
impl Sync for TofEvent
impl Unpin for TofEvent
impl UnwindSafe for TofEvent
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