CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
QIE10DataFrame::Sample Class Reference

#include <QIE10DataFrame.h>

Public Types

typedef uint32_t wide_type
 

Public Member Functions

constexpr int adc () const
 
constexpr int capid () const
 
constexpr int le_tdc () const
 
constexpr bool ok () const
 
constexpr edm::DataFrame::data_type raw (edm::DataFrame::size_type i) const
 
constexpr Sample (const edm::DataFrame &frame, edm::DataFrame::size_type i)
 
constexpr Sample (const edm::DataFrame::data_type &word1, const edm::DataFrame::data_type &word2)
 
 Sample (const wide_type wide)
 
constexpr bool soi () const
 
constexpr int te_tdc () const
 
QIE10DataFrame::Sample::wide_type wideRaw () const
 

Static Public Attributes

static const int MASK_ADC = 0xFF
 
static const int MASK_CAPID = 0x3
 
static const int MASK_LE_TDC = 0x3F
 
static const int MASK_OK = 0x1000
 
static const int MASK_SOI = 0x2000
 
static const int MASK_TE_TDC = 0x1F
 
static const int OFFSET_CAPID = 12
 
static const int OFFSET_TE_TDC = 6
 

Private Attributes

edm::DataFrame::data_type word1_
 
edm::DataFrame::data_type word2_
 

Detailed Description

Definition at line 20 of file QIE10DataFrame.h.

Member Typedef Documentation

◆ wide_type

Definition at line 22 of file QIE10DataFrame.h.

Constructor & Destructor Documentation

◆ Sample() [1/3]

constexpr QIE10DataFrame::Sample::Sample ( const edm::DataFrame frame,
edm::DataFrame::size_type  i 
)
inlineconstexpr

Definition at line 24 of file QIE10DataFrame.h.

25  : word1_(frame[i]), word2_(frame[i + 1]) {}

◆ Sample() [2/3]

constexpr QIE10DataFrame::Sample::Sample ( const edm::DataFrame::data_type word1,
const edm::DataFrame::data_type word2 
)
inlineconstexpr

Definition at line 26 of file QIE10DataFrame.h.

27  : word1_(word1), word2_(word2) {}

◆ Sample() [3/3]

QIE10DataFrame::Sample::Sample ( const wide_type  wide)
inlineexplicit

Definition at line 28 of file QIE10DataFrame.h.

28  : word1_{0}, word2_{0} {
29  static_assert(sizeof(wide) == 2 * sizeof(word1_), "The wide input type must be able to contain two words");
30  const edm::DataFrame::data_type* ptr = reinterpret_cast<const edm::DataFrame::data_type*>(&wide);
31  word1_ = ptr[0];
32  word2_ = ptr[1];
33  }

Member Function Documentation

◆ adc()

constexpr int QIE10DataFrame::Sample::adc ( ) const
inlineconstexpr

Definition at line 44 of file QIE10DataFrame.h.

44 { return word1_ & MASK_ADC; }

References MASK_ADC, and word1_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ capid()

constexpr int QIE10DataFrame::Sample::capid ( ) const
inlineconstexpr

Definition at line 49 of file QIE10DataFrame.h.

49 { return (word2_ >> OFFSET_CAPID) & MASK_CAPID; }

References MASK_CAPID, OFFSET_CAPID, and word2_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ le_tdc()

constexpr int QIE10DataFrame::Sample::le_tdc ( ) const
inlineconstexpr

Definition at line 45 of file QIE10DataFrame.h.

45 { return word2_ & MASK_LE_TDC; }

References MASK_LE_TDC, and word2_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ ok()

constexpr bool QIE10DataFrame::Sample::ok ( ) const
inlineconstexpr

Definition at line 47 of file QIE10DataFrame.h.

47 { return word1_ & MASK_OK; }

References MASK_OK, and word1_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ raw()

constexpr edm::DataFrame::data_type QIE10DataFrame::Sample::raw ( edm::DataFrame::size_type  i) const
inlineconstexpr

Definition at line 50 of file QIE10DataFrame.h.

50  {
51  return (i > WORDS_PER_SAMPLE) ? 0 : ((i == 1) ? word2_ : word1_);
52  }

References mps_fire::i, word1_, word2_, and QIE10DataFrame::WORDS_PER_SAMPLE.

◆ soi()

constexpr bool QIE10DataFrame::Sample::soi ( ) const
inlineconstexpr

Definition at line 48 of file QIE10DataFrame.h.

48 { return word1_ & MASK_SOI; }

References MASK_SOI, and word1_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ te_tdc()

constexpr int QIE10DataFrame::Sample::te_tdc ( ) const
inlineconstexpr

Definition at line 46 of file QIE10DataFrame.h.

46 { return (word2_ >> OFFSET_TE_TDC) & MASK_TE_TDC; }

References MASK_TE_TDC, OFFSET_TE_TDC, and word2_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

◆ wideRaw()

QIE10DataFrame::Sample::wide_type QIE10DataFrame::Sample::wideRaw ( ) const
inline

Definition at line 53 of file QIE10DataFrame.h.

53  {
54  static_assert(sizeof(QIE10DataFrame::Sample::wide_type) == 2 * sizeof(word1_),
55  "The wide result type must be able to contain two words");
56  wide_type result = 0;
57  edm::DataFrame::data_type* ptr = reinterpret_cast<edm::DataFrame::data_type*>(&result);
58  ptr[0] = word1_;
59  ptr[1] = word2_;
60  return result;
61  }

References mps_fire::result, word1_, and word2_.

Member Data Documentation

◆ MASK_ADC

const int QIE10DataFrame::Sample::MASK_ADC = 0xFF
static

Definition at line 35 of file QIE10DataFrame.h.

Referenced by adc(), and QIE10DataFrame::setSample().

◆ MASK_CAPID

const int QIE10DataFrame::Sample::MASK_CAPID = 0x3
static

Definition at line 41 of file QIE10DataFrame.h.

Referenced by capid(), and QIE10DataFrame::setSample().

◆ MASK_LE_TDC

const int QIE10DataFrame::Sample::MASK_LE_TDC = 0x3F
static

Definition at line 36 of file QIE10DataFrame.h.

Referenced by le_tdc(), and QIE10DataFrame::setSample().

◆ MASK_OK

const int QIE10DataFrame::Sample::MASK_OK = 0x1000
static

Definition at line 40 of file QIE10DataFrame.h.

Referenced by ok(), and QIE10DataFrame::setSample().

◆ MASK_SOI

const int QIE10DataFrame::Sample::MASK_SOI = 0x2000
static

Definition at line 39 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample(), and soi().

◆ MASK_TE_TDC

const int QIE10DataFrame::Sample::MASK_TE_TDC = 0x1F
static

Definition at line 37 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample(), and te_tdc().

◆ OFFSET_CAPID

const int QIE10DataFrame::Sample::OFFSET_CAPID = 12
static

Definition at line 42 of file QIE10DataFrame.h.

Referenced by capid(), and QIE10DataFrame::setSample().

◆ OFFSET_TE_TDC

const int QIE10DataFrame::Sample::OFFSET_TE_TDC = 6
static

Definition at line 38 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample(), and te_tdc().

◆ word1_

edm::DataFrame::data_type QIE10DataFrame::Sample::word1_
private

Definition at line 64 of file QIE10DataFrame.h.

Referenced by adc(), ok(), raw(), soi(), and wideRaw().

◆ word2_

edm::DataFrame::data_type QIE10DataFrame::Sample::word2_
private

Definition at line 65 of file QIE10DataFrame.h.

Referenced by capid(), le_tdc(), raw(), te_tdc(), and wideRaw().

mps_fire.i
i
Definition: mps_fire.py:428
QIE10DataFrame::Sample::OFFSET_CAPID
static const int OFFSET_CAPID
Definition: QIE10DataFrame.h:42
QIE10DataFrame::Sample::MASK_CAPID
static const int MASK_CAPID
Definition: QIE10DataFrame.h:41
QIE10DataFrame::Sample::MASK_OK
static const int MASK_OK
Definition: QIE10DataFrame.h:40
QIE10DataFrame::Sample::OFFSET_TE_TDC
static const int OFFSET_TE_TDC
Definition: QIE10DataFrame.h:38
QIE10DataFrame::WORDS_PER_SAMPLE
static const int WORDS_PER_SAMPLE
Definition: QIE10DataFrame.h:13
QIE10DataFrame::Sample::wide_type
uint32_t wide_type
Definition: QIE10DataFrame.h:22
QIE10DataFrame::Sample::MASK_ADC
static const int MASK_ADC
Definition: QIE10DataFrame.h:35
QIE10DataFrame::Sample::MASK_TE_TDC
static const int MASK_TE_TDC
Definition: QIE10DataFrame.h:37
QIE10DataFrame::Sample::word2_
edm::DataFrame::data_type word2_
Definition: QIE10DataFrame.h:65
QIE10DataFrame::Sample::word1_
edm::DataFrame::data_type word1_
Definition: QIE10DataFrame.h:64
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
QIE10DataFrame::Sample::MASK_SOI
static const int MASK_SOI
Definition: QIE10DataFrame.h:39
mps_fire.result
result
Definition: mps_fire.py:311
QIE10DataFrame::Sample::MASK_LE_TDC
static const int MASK_LE_TDC
Definition: QIE10DataFrame.h:36
edm::DataFrame::data_type
unsigned short data_type
Definition: DataFrame.h:19