pub struct TofEventSummary {Show 22 fields
pub status: EventStatus,
pub version: ProtocolVersion,
pub quality: u8,
pub trigger_sources: u16,
pub n_trigger_paddles: u8,
pub event_id: u32,
pub run_id: u16,
pub timestamp32: u32,
pub timestamp16: u16,
pub primary_beta: u16,
pub primary_charge: u16,
pub drs_dead_lost_hits: u16,
pub dsi_j_mask: u32,
pub channel_mask: Vec<u16>,
pub mtb_link_mask: u64,
pub hits: Vec<TofHit>,
pub n_hits_umb: u8,
pub n_hits_cbe: u8,
pub n_hits_cor: u8,
pub tot_edep_umb: f32,
pub tot_edep_cbe: f32,
pub tot_edep_cor: f32,
}
Expand description
De-facto the main event class
TofEventSummary provides a list of extracted hits from the ReadoutBoards as well as information about the trigger system.
Fields§
§status: EventStatus
§version: ProtocolVersion
§quality: u8
§trigger_sources: u16
§n_trigger_paddles: u8
the number of triggered paddles coming from the MTB directly. This might NOT be the same as the number of hits!
event_id: u32
§run_id: u16
NEW - uses the space for primary_beta, which we won’t have anyway
timestamp32: u32
§timestamp16: u16
§primary_beta: u16
DEPRECATED, won’t get serialized reconstructed primary beta
primary_charge: u16
DEPRECATED, won’t get serialized reconstructed primary charge
drs_dead_lost_hits: u16
scalar number of hits missed in this event due to DRS on the RB being busy
dsi_j_mask: u32
§channel_mask: Vec<u16>
§mtb_link_mask: u64
§hits: Vec<TofHit>
§n_hits_umb: u8
§n_hits_cbe: u8
§n_hits_cor: u8
§tot_edep_umb: f32
§tot_edep_cbe: f32
§tot_edep_cor: f32
Implementations§
Source§impl TofEventSummary
impl TofEventSummary
pub fn new() -> Self
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_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
Sourcepub fn get_rb_link_ids(&self) -> Vec<u8>
pub fn get_rb_link_ids(&self) -> Vec<u8>
Get the RB link IDs according to the mask
Sourcepub fn get_trigger_hits(&self) -> Vec<(u8, u8, (u8, u8), LTBThreshold)>
pub fn get_trigger_hits(&self) -> Vec<(u8, u8, (u8, u8), LTBThreshold)>
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)
Sourcepub fn get_trigger_sources(&self) -> Vec<TriggerType>
pub fn get_trigger_sources(&self) -> Vec<TriggerType>
Get the trigger sources from trigger source byte
pub fn get_timestamp48(&self) -> u64
Sourcepub fn get_edep_umbrella(&self) -> f32
pub fn get_edep_umbrella(&self) -> f32
Ttotal energy depostion in the TOF - Umbrella
Utilizes Philip’s formula based on peak height
Sourcepub fn get_edep_cube(&self) -> f32
pub fn get_edep_cube(&self) -> f32
Ttotal energy depostion in the TOF - Umbrella
Utilizes Philip’s formula based on peak height
Sourcepub fn get_edep_cortina(&self) -> f32
pub fn get_edep_cortina(&self) -> f32
Ttotal energy depostion in the Cortina
Utilizes Philip’s formula based on peak height
Trait Implementations§
Source§impl Clone for TofEventSummary
impl Clone for TofEventSummary
Source§fn clone(&self) -> TofEventSummary
fn clone(&self) -> TofEventSummary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TofEventSummary
impl Debug for TofEventSummary
Source§impl Default for TofEventSummary
impl Default for TofEventSummary
Source§impl Display for TofEventSummary
impl Display for TofEventSummary
Source§impl From<&TofEventSummary> for MasterTriggerEvent
impl From<&TofEventSummary> for MasterTriggerEvent
Source§fn from(tes: &TofEventSummary) -> Self
fn from(tes: &TofEventSummary) -> Self
Source§impl From<&TofEventSummary> for TofPacket
impl From<&TofEventSummary> for TofPacket
Source§fn from(tsum: &TofEventSummary) -> Self
fn from(tsum: &TofEventSummary) -> Self
Source§impl FromRandom for TofEventSummary
impl FromRandom for TofEventSummary
fn from_random() -> Self
Source§impl Packable for TofEventSummary
impl Packable for TofEventSummary
const PACKET_TYPE: PacketType = PacketType::TofEventSummary
Source§fn pack(&self) -> TofPacketwhere
Self: Serialization,
fn pack(&self) -> TofPacketwhere
Self: Serialization,
Source§impl PartialEq for TofEventSummary
impl PartialEq for TofEventSummary
Source§impl Serialization for TofEventSummary
impl Serialization for TofEventSummary
const HEAD: u16 = 43_690u16
const TAIL: u16 = 21_845u16
Source§fn to_bytestream(&self) -> Vec<u8>
fn to_bytestream(&self) -> Vec<u8>
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,
impl StructuralPartialEq for TofEventSummary
Auto Trait Implementations§
impl Freeze for TofEventSummary
impl RefUnwindSafe for TofEventSummary
impl Send for TofEventSummary
impl Sync for TofEventSummary
impl Unpin for TofEventSummary
impl UnwindSafe for TofEventSummary
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