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 
)
inline

Definition at line 24 of file QIE10DataFrame.h.

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

◆ Sample() [2/3]

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

Definition at line 26 of file QIE10DataFrame.h.

27  : word1_(word1), word2_(word2) {}
edm::DataFrame::data_type word1_
edm::DataFrame::data_type 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  }
unsigned short data_type
Definition: DataFrame.h:19
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_

Member Function Documentation

◆ adc()

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

Definition at line 44 of file QIE10DataFrame.h.

References MASK_ADC, and word1_.

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

44 { return word1_ & MASK_ADC; }
static const int MASK_ADC
edm::DataFrame::data_type word1_

◆ capid()

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

Definition at line 49 of file QIE10DataFrame.h.

References MASK_CAPID, OFFSET_CAPID, and word2_.

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

49 { return (word2_ >> OFFSET_CAPID) & MASK_CAPID; }
static const int MASK_CAPID
edm::DataFrame::data_type word2_
static const int OFFSET_CAPID

◆ le_tdc()

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

Definition at line 45 of file QIE10DataFrame.h.

References MASK_LE_TDC, and word2_.

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

45 { return word2_ & MASK_LE_TDC; }
static const int MASK_LE_TDC
edm::DataFrame::data_type word2_

◆ ok()

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

Definition at line 47 of file QIE10DataFrame.h.

References MASK_OK, and word1_.

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

47 { return word1_ & MASK_OK; }
static const int MASK_OK
edm::DataFrame::data_type word1_

◆ raw()

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

Definition at line 50 of file QIE10DataFrame.h.

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

50  {
51  return (i > WORDS_PER_SAMPLE) ? 0 : ((i == 1) ? word2_ : word1_);
52  }
static const int WORDS_PER_SAMPLE
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_

◆ soi()

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

Definition at line 48 of file QIE10DataFrame.h.

References MASK_SOI, and word1_.

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

48 { return word1_ & MASK_SOI; }
static const int MASK_SOI
edm::DataFrame::data_type word1_

◆ te_tdc()

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

Definition at line 46 of file QIE10DataFrame.h.

References MASK_TE_TDC, OFFSET_TE_TDC, and word2_.

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

46 { return (word2_ >> OFFSET_TE_TDC) & MASK_TE_TDC; }
static const int OFFSET_TE_TDC
edm::DataFrame::data_type word2_
static const int MASK_TE_TDC

◆ wideRaw()

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

Definition at line 53 of file QIE10DataFrame.h.

References mps_fire::result, word1_, and word2_.

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;
58  ptr[0] = word1_;
59  ptr[1] = word2_;
60  return result;
61  }
unsigned short data_type
Definition: DataFrame.h:19
edm::DataFrame::data_type word1_
edm::DataFrame::data_type 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().