CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Attributes | Private Attributes
QIE11DataFrame Class Reference

#include <QIE11DataFrame.h>

Classes

class  Sample
 

Public Member Functions

constexpr edm::DataFrame::iterator begin ()
 iterators More...
 
constexpr edm::DataFrame::const_iterator begin () const
 
constexpr bool capidError () const
 
constexpr void copyContent (const QIE11DataFrame &digi)
 
constexpr DetId detid () const
 Get the detector id. More...
 
constexpr edm::DataFrame::iterator end ()
 
constexpr edm::DataFrame::const_iterator end () const
 
constexpr uint16_t flags () const
 get the flag word More...
 
constexpr int flavor () const
 get the flavor of the frame More...
 
constexpr edm::DataFrame::id_type id () const
 
constexpr bool linkError () const
 was there a link error? More...
 
constexpr Sample operator[] (edm::DataFrame::size_type i) const
 get the sample More...
 
constexpr int presamples () const
 for backward compatibility More...
 
constexpr QIE11DataFrame ()
 
constexpr QIE11DataFrame (edm::DataFrame const &df)
 
constexpr int samples () const
 total number of samples in the digi More...
 
constexpr void setCapid0 (int cap0)
 
constexpr void setFlags (uint16_t v)
 set the flag word More...
 
constexpr void setFlavor (int flavor)
 
constexpr void setSample (edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
 set the sample contents More...
 
constexpr void setZSInfo (bool markAndPass)
 set ZS params More...
 
constexpr edm::DataFrame::size_type size () const
 more accessors More...
 
constexpr bool zsMarkAndPass () const
 was this a mark-and-pass ZS event? More...
 

Static Public Attributes

static const int FLAG_WORDS = 1
 
static const int FLAVOR_HB = 3
 
static const int HEADER_WORDS = 1
 
static const int MASK_CAPIDERROR = 0x400
 was there a capid rotation error? More...
 
static const int MASK_FLAVOR = 0x7
 
static const int MASK_LINKERROR = 0x800
 
static const int OFFSET_FLAVOR = 12
 
static const int WORDS_PER_SAMPLE = 1
 

Private Attributes

edm::DataFrame m_data
 

Detailed Description

Precision readout digi from QIE11 including TDC information

Definition at line 11 of file QIE11DataFrame.h.

Constructor & Destructor Documentation

◆ QIE11DataFrame() [1/2]

constexpr QIE11DataFrame::QIE11DataFrame ( )
inlineconstexpr

Definition at line 22 of file QIE11DataFrame.h.

22 {}

◆ QIE11DataFrame() [2/2]

constexpr QIE11DataFrame::QIE11DataFrame ( edm::DataFrame const &  df)
inlineconstexpr

Definition at line 23 of file QIE11DataFrame.h.

23 : m_data(df) {}

Member Function Documentation

◆ begin() [1/2]

constexpr edm::DataFrame::iterator QIE11DataFrame::begin ( void  )
inlineconstexpr

iterators

Definition at line 72 of file QIE11DataFrame.h.

72 { return m_data.begin(); }

References edm::DataFrame::begin(), and m_data.

Referenced by UHTRpacker::addChannel(), and convertHB().

◆ begin() [2/2]

constexpr edm::DataFrame::const_iterator QIE11DataFrame::begin ( void  ) const
inlineconstexpr

Definition at line 74 of file QIE11DataFrame.h.

74 { return m_data.begin(); }

References edm::DataFrame::begin(), and m_data.

◆ capidError()

constexpr bool QIE11DataFrame::capidError ( ) const
inlineconstexpr

Definition at line 92 of file QIE11DataFrame.h.

92 { return m_data[0] & MASK_CAPIDERROR; }

References m_data, and MASK_CAPIDERROR.

Referenced by operator<<().

◆ copyContent()

constexpr void QIE11DataFrame::copyContent ( const QIE11DataFrame digi)
inlineconstexpr

Definition at line 59 of file QIE11DataFrame.h.

59  {
60  for (edm::DataFrame::size_type i = 0; i < size() && i < digi.size(); i++) {
61  Sample sam = digi[i];
62  setSample(i, sam.adc(), sam.tdc(), sam.soi());
63  }
64  }

References QIE11DataFrame::Sample::adc(), mps_fire::i, setSample(), size(), QIE11DataFrame::Sample::soi(), and QIE11DataFrame::Sample::tdc().

◆ detid()

constexpr DetId QIE11DataFrame::detid ( ) const
inlineconstexpr

◆ end() [1/2]

constexpr edm::DataFrame::iterator QIE11DataFrame::end ( void  )
inlineconstexpr

◆ end() [2/2]

constexpr edm::DataFrame::const_iterator QIE11DataFrame::end ( void  ) const
inlineconstexpr

Definition at line 75 of file QIE11DataFrame.h.

75 { return m_data.end(); }

References edm::DataFrame::end(), and m_data.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

◆ flags()

constexpr uint16_t QIE11DataFrame::flags ( ) const
inlineconstexpr

get the flag word

Definition at line 133 of file QIE11DataFrame.h.

133 { return m_data[size() - 1]; }

References m_data, and size().

◆ flavor()

constexpr int QIE11DataFrame::flavor ( ) const
inlineconstexpr

get the flavor of the frame

Definition at line 87 of file QIE11DataFrame.h.

87 { return ((m_data[0] >> OFFSET_FLAVOR) & MASK_FLAVOR); }

References m_data, MASK_FLAVOR, and OFFSET_FLAVOR.

Referenced by operator<<(), UHTRpacker::packQIE11header(), setCapid0(), setFlavor(), setSample(), and zsMarkAndPass().

◆ id()

constexpr edm::DataFrame::id_type QIE11DataFrame::id ( ) const
inlineconstexpr

Definition at line 68 of file QIE11DataFrame.h.

68 { return m_data.id(); }

References edm::DataFrame::id(), and m_data.

Referenced by HcalZSAlgoRealistic::keepMe(), and HcalZSAlgoRealistic::shouldKeep().

◆ linkError()

constexpr bool QIE11DataFrame::linkError ( ) const
inlineconstexpr

was there a link error?

Definition at line 89 of file QIE11DataFrame.h.

89 { return m_data[0] & MASK_LINKERROR; }

References m_data, and MASK_LINKERROR.

Referenced by operator<<().

◆ operator[]()

constexpr Sample QIE11DataFrame::operator[] ( edm::DataFrame::size_type  i) const
inlineconstexpr

get the sample

Definition at line 101 of file QIE11DataFrame.h.

101 { return Sample(m_data, i + HEADER_WORDS); }

References HEADER_WORDS, mps_fire::i, and m_data.

◆ presamples()

constexpr int QIE11DataFrame::presamples ( ) const
inlineconstexpr

for backward compatibility

Definition at line 79 of file QIE11DataFrame.h.

79  {
80  for (int i = 0; i < samples(); i++) {
81  if ((*this)[i].soi())
82  return i;
83  }
84  return -1;
85  }

References mps_fire::i, and samples().

Referenced by LaserTask::_process(), and HcalDigiToRawuHTR::produce().

◆ samples()

constexpr int QIE11DataFrame::samples ( ) const
inlineconstexpr

◆ setCapid0()

constexpr void QIE11DataFrame::setCapid0 ( int  cap0)
inlineconstexpr

Definition at line 109 of file QIE11DataFrame.h.

109  {
110  if (flavor() == FLAVOR_HB) {
111  for (int i = 0; i < samples(); i++) {
113  m_data[i + 1] |= ((cap0 + i) & Sample::MASK_CAPID) << Sample::OFFSET_CAPID_HB;
114  }
115  } else {
116  m_data[0] &= 0xFCFF; // inversion of the capid0 mask
118  }
119  }

References flavor(), FLAVOR_HB, mps_fire::i, m_data, QIE11DataFrame::Sample::MASK_CAPID, QIE11DataFrame::Sample::MASK_CAPID_INV_HB, QIE11DataFrame::Sample::OFFSET_CAPID_HB, QIE11DataFrame::Sample::OFFSET_CAPID_HE, and samples().

Referenced by convertHB().

◆ setFlags()

constexpr void QIE11DataFrame::setFlags ( uint16_t  v)
inlineconstexpr

set the flag word

Definition at line 135 of file QIE11DataFrame.h.

135 { m_data[size() - 1] = v; }

References m_data, size(), and findQualityFiles::v.

◆ setFlavor()

constexpr void QIE11DataFrame::setFlavor ( int  flavor)
inlineconstexpr

Definition at line 104 of file QIE11DataFrame.h.

104  {
105  m_data[0] &= 0x9FFF; // inversion of flavor mask
106  m_data[0] |= ((flavor & MASK_FLAVOR) << OFFSET_FLAVOR);
107  }

References flavor(), m_data, MASK_FLAVOR, and OFFSET_FLAVOR.

Referenced by convertHB().

◆ setSample()

constexpr void QIE11DataFrame::setSample ( edm::DataFrame::size_type  isample,
int  adc,
int  tdc,
bool  soi = false 
)
inlineconstexpr

set the sample contents

Definition at line 121 of file QIE11DataFrame.h.

121  {
122  if (isample >= size())
123  return;
124  if (flavor() == FLAVOR_HB)
125  m_data[isample + 1] = (adc & Sample::MASK_ADC) | (soi ? (Sample::MASK_SOI) : (0)) |
127  (m_data[isample + 1] & Sample::MASK_CAPID_KEEP_HB);
128  else
129  m_data[isample + 1] = (adc & Sample::MASK_ADC) | (soi ? (Sample::MASK_SOI) : (0)) |
131  }

References gpuClustering::adc, flavor(), FLAVOR_HB, m_data, QIE11DataFrame::Sample::MASK_ADC, QIE11DataFrame::Sample::MASK_CAPID_KEEP_HB, QIE11DataFrame::Sample::MASK_SOI, QIE11DataFrame::Sample::MASK_TDC_HB, QIE11DataFrame::Sample::MASK_TDC_HE, QIE11DataFrame::Sample::OFFSET_TDC, and size().

Referenced by convertHB(), copyContent(), and HcalTDC::timing().

◆ setZSInfo()

constexpr void QIE11DataFrame::setZSInfo ( bool  markAndPass)
inlineconstexpr

set ZS params

Definition at line 96 of file QIE11DataFrame.h.

96  {
97  if (markAndPass)
99  }

References m_data, DigiNZS_cff::markAndPass, MASK_FLAVOR, and OFFSET_FLAVOR.

◆ size()

constexpr edm::DataFrame::size_type QIE11DataFrame::size ( void  ) const
inlineconstexpr

◆ zsMarkAndPass()

constexpr bool QIE11DataFrame::zsMarkAndPass ( ) const
inlineconstexpr

was this a mark-and-pass ZS event?

Definition at line 94 of file QIE11DataFrame.h.

94 { return (flavor() == 1); }

References flavor().

Referenced by operator<<().

Member Data Documentation

◆ FLAG_WORDS

const int QIE11DataFrame::FLAG_WORDS = 1
static

Definition at line 15 of file QIE11DataFrame.h.

Referenced by UHTRpacker::addChannel(), and samples().

◆ FLAVOR_HB

const int QIE11DataFrame::FLAVOR_HB = 3
static

◆ HEADER_WORDS

const int QIE11DataFrame::HEADER_WORDS = 1
static

◆ m_data

edm::DataFrame QIE11DataFrame::m_data
private

◆ MASK_CAPIDERROR

const int QIE11DataFrame::MASK_CAPIDERROR = 0x400
static

was there a capid rotation error?

Definition at line 91 of file QIE11DataFrame.h.

Referenced by capidError().

◆ MASK_FLAVOR

const int QIE11DataFrame::MASK_FLAVOR = 0x7
static

Definition at line 18 of file QIE11DataFrame.h.

Referenced by QIE11DataFrame::Sample::flavor(), flavor(), setFlavor(), and setZSInfo().

◆ MASK_LINKERROR

const int QIE11DataFrame::MASK_LINKERROR = 0x800
static

Definition at line 20 of file QIE11DataFrame.h.

Referenced by QIE11DataFrame::Sample::linkError(), and linkError().

◆ OFFSET_FLAVOR

const int QIE11DataFrame::OFFSET_FLAVOR = 12
static

Definition at line 17 of file QIE11DataFrame.h.

Referenced by QIE11DataFrame::Sample::flavor(), flavor(), setFlavor(), and setZSInfo().

◆ WORDS_PER_SAMPLE

const int QIE11DataFrame::WORDS_PER_SAMPLE = 1
static

Definition at line 13 of file QIE11DataFrame.h.

Referenced by samples().

QIE11DataFrame::Sample::MASK_CAPID
static const int MASK_CAPID
Definition: QIE11DataFrame.h:34
mps_fire.i
i
Definition: mps_fire.py:428
QIE11DataFrame::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: QIE11DataFrame.h:17
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
findQualityFiles.v
v
Definition: findQualityFiles.py:179
DetId
Definition: DetId.h:17
QIE11DataFrame::FLAVOR_HB
static const int FLAVOR_HB
Definition: QIE11DataFrame.h:19
DigiNZS_cff.markAndPass
markAndPass
Definition: DigiNZS_cff.py:6
QIE11DataFrame::samples
constexpr int samples() const
total number of samples in the digi
Definition: QIE11DataFrame.h:77
QIE11DataFrame::WORDS_PER_SAMPLE
static const int WORDS_PER_SAMPLE
Definition: QIE11DataFrame.h:13
edm::DataFrame::size_type
unsigned int size_type
Definition: DataFrame.h:17
QIE11DataFrame::Sample::MASK_TDC_HB
static const int MASK_TDC_HB
Definition: QIE11DataFrame.h:30
QIE11DataFrame::size
constexpr edm::DataFrame::size_type size() const
more accessors
Definition: QIE11DataFrame.h:70
QIE11DataFrame::Sample::OFFSET_TDC
static const int OFFSET_TDC
Definition: QIE11DataFrame.h:31
QIE11DataFrame::setSample
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
Definition: QIE11DataFrame.h:121
QIE11DataFrame::HEADER_WORDS
static const int HEADER_WORDS
Definition: QIE11DataFrame.h:14
QIE11DataFrame::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: QIE11DataFrame.h:18
QIE11DataFrame::Sample::MASK_CAPID_KEEP_HB
static const int MASK_CAPID_KEEP_HB
Definition: QIE11DataFrame.h:36
QIE11DataFrame::Sample::OFFSET_CAPID_HE
static const int OFFSET_CAPID_HE
Definition: QIE11DataFrame.h:37
QIE11DataFrame::MASK_CAPIDERROR
static const int MASK_CAPIDERROR
was there a capid rotation error?
Definition: QIE11DataFrame.h:91
QIE11DataFrame::Sample::OFFSET_CAPID_HB
static const int OFFSET_CAPID_HB
Definition: QIE11DataFrame.h:38
QIE11DataFrame::MASK_LINKERROR
static const int MASK_LINKERROR
Definition: QIE11DataFrame.h:20
edm::DataFrame::end
constexpr iterator end()
Definition: DataFrame.h:35
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
QIE11DataFrame::Sample::MASK_TDC_HE
static const int MASK_TDC_HE
Definition: QIE11DataFrame.h:29
QIE11DataFrame::flavor
constexpr int flavor() const
get the flavor of the frame
Definition: QIE11DataFrame.h:87
edm::DataFrame::size
constexpr size_type size() const
Definition: DataFrame.h:43
QIE11DataFrame::FLAG_WORDS
static const int FLAG_WORDS
Definition: QIE11DataFrame.h:15
edm::DataFrame::id
constexpr id_type id() const
Definition: DataFrame.h:41
edm::DataFrame::begin
constexpr iterator begin()
Definition: DataFrame.h:33
QIE11DataFrame::Sample::MASK_SOI
static const int MASK_SOI
Definition: QIE11DataFrame.h:32
QIE11DataFrame::m_data
edm::DataFrame m_data
Definition: QIE11DataFrame.h:138
QIE11DataFrame::Sample::MASK_CAPID_INV_HB
static const int MASK_CAPID_INV_HB
Definition: QIE11DataFrame.h:35
QIE11DataFrame::Sample::MASK_ADC
static const int MASK_ADC
Definition: QIE11DataFrame.h:28