CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalUMNioDigi Class Reference

#include <HcalUMNioDigi.h>

Public Member Functions

uint16_t bunchNumber () const
 
uint32_t eventNumber () const
 
uint8_t eventType () const
 
uint32_t getUserWord (int id) const
 
bool getUserWord (int id, uint32_t &value) const
 
bool hasUserWord (int id) const
 
 HcalUMNioDigi ()
 
 HcalUMNioDigi (const std::vector< uint16_t > &words)
 
 HcalUMNioDigi (const uint16_t *ptr, int words)
 
uint16_t idUserWord (int iword) const
 
bool invalid () const
 
bool isSpill () const
 
int numberUserWords () const
 
uint32_t orbitNumber () const
 
uint32_t runNumber () const
 
uint16_t spillCounter () const
 
uint32_t valueUserWord (int iword) const
 

Private Attributes

std::vector< uint16_t > payload_
 

Detailed Description

This class contains the readout data from the uMNio uTCA card as when used for orbit gap operations.

Author
J. Mans - Minnesota

Definition at line 15 of file HcalUMNioDigi.h.

Constructor & Destructor Documentation

◆ HcalUMNioDigi() [1/3]

HcalUMNioDigi::HcalUMNioDigi ( )

Definition at line 4 of file HcalUMNioDigi.cc.

4 {}

◆ HcalUMNioDigi() [2/3]

HcalUMNioDigi::HcalUMNioDigi ( const uint16_t *  ptr,
int  words 
)

Definition at line 5 of file HcalUMNioDigi.cc.

5  {
6  payload_.reserve(words);
7  for (int i = 0; i < words; i++) {
8  payload_.push_back(ptr[i]);
9  }
10 }

References mps_fire::i, and payload_.

◆ HcalUMNioDigi() [3/3]

HcalUMNioDigi::HcalUMNioDigi ( const std::vector< uint16_t > &  words)

Definition at line 11 of file HcalUMNioDigi.cc.

11 : payload_(words) {}

Member Function Documentation

◆ bunchNumber()

uint16_t HcalUMNioDigi::bunchNumber ( ) const

Definition at line 24 of file HcalUMNioDigi.cc.

24  {
25  if (invalid())
26  return 0;
27  return (payload_[1] >> 4) & 0xFFF;
28 }

References invalid(), and payload_.

Referenced by operator<<().

◆ eventNumber()

uint32_t HcalUMNioDigi::eventNumber ( ) const

Definition at line 29 of file HcalUMNioDigi.cc.

29  {
30  if (invalid())
31  return 0;
32  return payload_[2] + (uint32_t(payload_[3] & 0xFF) << 16);
33 }

References invalid(), and payload_.

Referenced by operator<<().

◆ eventType()

uint8_t HcalUMNioDigi::eventType ( ) const

Definition at line 35 of file HcalUMNioDigi.cc.

35  {
36  if (invalid())
37  return 0;
38  return (payload_[6] >> 8) & 0xF;
39 }

References invalid(), and payload_.

Referenced by HFRaddamTask::_isApplicable(), QIE11Task::_isApplicable(), PedestalTask::_isApplicable(), LEDTask::_isApplicable(), LaserTask::_isApplicable(), UMNioTask::_process(), and operator<<().

◆ getUserWord() [1/2]

uint32_t HcalUMNioDigi::getUserWord ( int  id) const

Definition at line 71 of file HcalUMNioDigi.cc.

71  {
72  uint32_t dummy(0);
73  getUserWord(id, dummy);
74  return dummy;
75 }

Referenced by hasUserWord().

◆ getUserWord() [2/2]

bool HcalUMNioDigi::getUserWord ( int  id,
uint32_t &  value 
) const

Definition at line 76 of file HcalUMNioDigi.cc.

76  {
77  int nwords = numberUserWords();
78  if (size_t(16 + nwords * 3) > payload_.size())
79  return false; // invalid format...
80 
81  for (int i = 0; i < nwords; i++) {
82  if (payload_[14 + 3 * i] == id) {
83  value = payload_[15 + 3 * i] + (uint32_t(payload_[16 + 3 * i]) << 16);
84  return true;
85  }
86  }
87  return false;
88 }

References mps_fire::i, numberUserWords(), and payload_.

◆ hasUserWord()

bool HcalUMNioDigi::hasUserWord ( int  id) const

Definition at line 67 of file HcalUMNioDigi.cc.

67  {
68  uint32_t dummy;
69  return getUserWord(id, dummy);
70 }

References getUserWord().

◆ idUserWord()

uint16_t HcalUMNioDigi::idUserWord ( int  iword) const

Definition at line 57 of file HcalUMNioDigi.cc.

57  {
58  if (iword >= numberUserWords() || payload_.size() < (size_t)(16 + iword * 3))
59  return 0;
60  return payload_[13 + 3 * iword];
61 }

References numberUserWords(), and payload_.

Referenced by operator<<().

◆ invalid()

bool HcalUMNioDigi::invalid ( ) const
inline

Definition at line 30 of file HcalUMNioDigi.h.

30 { return (payload_.size() < 16) || (payload_[6] & 0xF000) != 0x2000; }

References payload_.

Referenced by bunchNumber(), eventNumber(), eventType(), isSpill(), numberUserWords(), orbitNumber(), runNumber(), and spillCounter().

◆ isSpill()

bool HcalUMNioDigi::isSpill ( ) const

Definition at line 45 of file HcalUMNioDigi.cc.

45  {
46  if (invalid())
47  return false;
48  return (payload_[11] & 0x8000);
49 }

References invalid(), and payload_.

◆ numberUserWords()

int HcalUMNioDigi::numberUserWords ( ) const

Definition at line 51 of file HcalUMNioDigi.cc.

51  {
52  if (invalid())
53  return 0;
54  return (payload_[12] & 0xFF);
55 }

References invalid(), and payload_.

Referenced by getUserWord(), idUserWord(), operator<<(), and valueUserWord().

◆ orbitNumber()

uint32_t HcalUMNioDigi::orbitNumber ( ) const

Definition at line 19 of file HcalUMNioDigi.cc.

19  {
20  if (invalid())
21  return 0;
22  return payload_[5] + (uint32_t(payload_[8]) << 16);
23 }

References invalid(), and payload_.

Referenced by operator<<().

◆ runNumber()

uint32_t HcalUMNioDigi::runNumber ( ) const

Definition at line 13 of file HcalUMNioDigi.cc.

13  {
14  if (invalid())
15  return 0;
16  return payload_[9] + (uint32_t(payload_[10]) << 16);
17 }

References invalid(), and payload_.

Referenced by operator<<().

◆ spillCounter()

uint16_t HcalUMNioDigi::spillCounter ( ) const

Definition at line 40 of file HcalUMNioDigi.cc.

40  {
41  if (invalid())
42  return 0;
43  return (payload_[11]) & 0x7FFF;
44 }

References invalid(), and payload_.

◆ valueUserWord()

uint32_t HcalUMNioDigi::valueUserWord ( int  iword) const

Definition at line 62 of file HcalUMNioDigi.cc.

62  {
63  if (iword >= numberUserWords() || payload_.size() < (size_t)(16 + iword * 3))
64  return 0;
65  return payload_[14 + 3 * iword] + (uint32_t(payload_[15 + 3 * iword]) << 16);
66 }

References numberUserWords(), and payload_.

Referenced by HFRaddamTask::_isApplicable(), QIE11Task::_isApplicable(), LaserTask::_isApplicable(), UMNioTask::_process(), and operator<<().

Member Data Documentation

◆ payload_

std::vector<uint16_t> HcalUMNioDigi::payload_
private
mps_fire.i
i
Definition: mps_fire.py:355
HcalUMNioDigi::invalid
bool invalid() const
Definition: HcalUMNioDigi.h:30
HcalUMNioDigi::numberUserWords
int numberUserWords() const
Definition: HcalUMNioDigi.cc:51
HcalUMNioDigi::payload_
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
value
Definition: value.py:1
dummy
Definition: DummySelector.h:38
HcalUMNioDigi::getUserWord
uint32_t getUserWord(int id) const
Definition: HcalUMNioDigi.cc:71