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 uint16_t *ptr, int words)
 
 HcalUMNioDigi (const std::vector< uint16_t > &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.

References mps_fire::i, and payload_.

5  {
6  payload_.reserve(words);
7  for (int i = 0; i < words; i++) {
8  payload_.push_back(ptr[i]);
9  }
10 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40

◆ HcalUMNioDigi() [3/3]

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

Definition at line 11 of file HcalUMNioDigi.cc.

11 : payload_(words) {}
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40

Member Function Documentation

◆ bunchNumber()

uint16_t HcalUMNioDigi::bunchNumber ( ) const

Definition at line 24 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

24  {
25  if (invalid())
26  return 0;
27  return (payload_[1] >> 4) & 0xFFF;
28 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ eventNumber()

uint32_t HcalUMNioDigi::eventNumber ( ) const

Definition at line 29 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

29  {
30  if (invalid())
31  return 0;
32  return payload_[2] + (uint32_t(payload_[3] & 0xFF) << 16);
33 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ eventType()

uint8_t HcalUMNioDigi::eventType ( ) const

Definition at line 35 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

35  {
36  if (invalid())
37  return 0;
38  return (payload_[6] >> 8) & 0xF;
39 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ getUserWord() [1/2]

uint32_t HcalUMNioDigi::getUserWord ( int  id) const

Definition at line 71 of file HcalUMNioDigi.cc.

Referenced by hasUserWord().

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

◆ getUserWord() [2/2]

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

Definition at line 76 of file HcalUMNioDigi.cc.

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

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 }
int numberUserWords() const
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
Definition: value.py:1

◆ hasUserWord()

bool HcalUMNioDigi::hasUserWord ( int  id) const

Definition at line 67 of file HcalUMNioDigi.cc.

References getUserWord().

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

◆ idUserWord()

uint16_t HcalUMNioDigi::idUserWord ( int  iword) const

Definition at line 57 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

Referenced by operator<<().

57  {
58  if (iword >= numberUserWords() || payload_.size() < (size_t)(16 + iword * 3))
59  return 0;
60  return payload_[13 + 3 * iword];
61 }
int numberUserWords() const
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40

◆ invalid()

bool HcalUMNioDigi::invalid ( ) const
inline

Definition at line 30 of file HcalUMNioDigi.h.

References payload_.

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

30 { return (payload_.size() < 16) || (payload_[6] & 0xF000) != 0x2000; }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40

◆ isSpill()

bool HcalUMNioDigi::isSpill ( ) const

Definition at line 45 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

45  {
46  if (invalid())
47  return false;
48  return (payload_[11] & 0x8000);
49 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ numberUserWords()

int HcalUMNioDigi::numberUserWords ( ) const

Definition at line 51 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

51  {
52  if (invalid())
53  return 0;
54  return (payload_[12] & 0xFF);
55 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ orbitNumber()

uint32_t HcalUMNioDigi::orbitNumber ( ) const

Definition at line 19 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

19  {
20  if (invalid())
21  return 0;
22  return payload_[5] + (uint32_t(payload_[8]) << 16);
23 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ runNumber()

uint32_t HcalUMNioDigi::runNumber ( ) const

Definition at line 13 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

13  {
14  if (invalid())
15  return 0;
16  return payload_[9] + (uint32_t(payload_[10]) << 16);
17 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ spillCounter()

uint16_t HcalUMNioDigi::spillCounter ( ) const

Definition at line 40 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

40  {
41  if (invalid())
42  return 0;
43  return (payload_[11]) & 0x7FFF;
44 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
bool invalid() const
Definition: HcalUMNioDigi.h:30

◆ valueUserWord()

uint32_t HcalUMNioDigi::valueUserWord ( int  iword) const

Definition at line 62 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

Referenced by QIE11Task::_isApplicable(), LaserTask::_isApplicable(), operator<<(), and HcalUMNioTableProducer::produce().

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 }
int numberUserWords() const
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40

Member Data Documentation

◆ payload_

std::vector<uint16_t> HcalUMNioDigi::payload_
private