pub struct RAT {
pub rat_id: i16,
pub pb_id: i16,
pub rb1_id: i16,
pub rb2_id: i16,
pub ltb_id: i16,
pub ltb_harting_cable_length: i16,
}
Expand description
Representation of a local trigger board.
The individual LTB channels do not map directly to PaddleEnds. Rather two of them map to a paddle and then the whole paddle should get read out. To be more specific about this. The LTB has 16 channels, but we treat them as 8. Each 2 LTB channels get “married” internally in the board and will then continue on as 1 LTB channel, visible to the outside. The information about which end of the Paddle crossed which threshhold is lost. How it works is that the two channels will be combined by the trigger logic:
- There are 4 states (2 bits)
- 0 - no hit
- 1 - Hit
- 2 - Beta
- 3 - Veto
Each defining an individual threshold. If that is crossed, the whole paddle (ends A+B) will be read out by the ReadoutBoard
The LTB channels here are labeled 1-8. This is as it is in the TOF spreadsheet. Also dsi is labeled as in the spreadsheet and will start from one.
It is NOT clear from this which ch on the rb is connected to which side, for that the paddle/RB tables need to be consulted. Again: rb_ch0 does NOT necessarily correspond to the A side!
Fields§
§rat_id: i16
§pb_id: i16
§rb1_id: i16
§rb2_id: i16
§ltb_id: i16
§ltb_harting_cable_length: i16
Implementations§
Source§impl RAT
impl RAT
pub fn new() -> Self
Sourcepub fn where_rb2id(conn: &mut SqliteConnection, rb2id: u8) -> Option<Vec<RAT>>
pub fn where_rb2id(conn: &mut SqliteConnection, rb2id: u8) -> Option<Vec<RAT>>
Get the RAT where rb2id matched the argument
Sourcepub fn where_rb1id(conn: &mut SqliteConnection, rb2id: u8) -> Option<Vec<RAT>>
pub fn where_rb1id(conn: &mut SqliteConnection, rb2id: u8) -> Option<Vec<RAT>>
Get the RAT where rb1id (the rb id of rb“1“ in the RAT) matched the argument
pub fn all(conn: &mut SqliteConnection) -> Option<Vec<RAT>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RAT
impl<'de> Deserialize<'de> for RAT
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for RATwhere
(i16, i16, i16, i16, i16, i16): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB>,
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for RATwhere
(i16, i16, i16, i16, i16, i16): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB>,
Source§impl<__DB: Backend> Selectable<__DB> for RAT
impl<__DB: Backend> Selectable<__DB> for RAT
Source§type SelectExpression = (rat_id, pb_id, rb1_id, rb2_id, ltb_id, ltb_harting_cable_length)
type SelectExpression = (rat_id, pb_id, rb1_id, rb2_id, ltb_id, ltb_harting_cable_length)
Source§fn construct_selection() -> Self::SelectExpression
fn construct_selection() -> Self::SelectExpression
Auto Trait Implementations§
impl Freeze for RAT
impl RefUnwindSafe for RAT
impl Send for RAT
impl Sync for RAT
impl Unpin for RAT
impl UnwindSafe for RAT
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> 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<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
Source§fn as_select() -> SelectBy<T, DB>
fn as_select() -> SelectBy<T, DB>
Selectable
implementation. Read moreSource§fn as_returning() -> SelectBy<Self, DB>
fn as_returning() -> SelectBy<Self, DB>
as_select
that can be used with returning clauses