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::HcalUMNioDigi ( )

Definition at line 4 of file HcalUMNioDigi.cc.

4 {}
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::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

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 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
uint32_t HcalUMNioDigi::eventNumber ( ) const

Definition at line 29 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

29  {
30  if (invalid())
31  return 0;
32  return payload_[2] + (uint32_t(payload_[3] & 0xFF) << 16);
33 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
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(), UMNioTask::_process(), and operator<<().

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

Definition at line 71 of file HcalUMNioDigi.cc.

Referenced by hasUserWord(), and invalid().

71  {
72  uint32_t dummy(0);
73  getUserWord(id, dummy);
74  return dummy;
75 }
uint32_t getUserWord(int id) const
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 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
Definition: value.py:1
int numberUserWords() const
bool HcalUMNioDigi::hasUserWord ( int  id) const

Definition at line 67 of file HcalUMNioDigi.cc.

References getUserWord().

Referenced by invalid().

67  {
68  uint32_t dummy;
69  return getUserWord(id, dummy);
70 }
uint32_t getUserWord(int id) const
uint16_t HcalUMNioDigi::idUserWord ( int  iword) const

Definition at line 57 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

Referenced by invalid(), and operator<<().

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

Definition at line 30 of file HcalUMNioDigi.h.

References getUserWord(), hasUserWord(), idUserWord(), numberUserWords(), payload_, and valueUserWord().

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

Definition at line 51 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

51  {
52  if (invalid())
53  return 0;
54  return (payload_[12] & 0xFF);
55 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
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 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
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 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
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 }
bool invalid() const
Definition: HcalUMNioDigi.h:30
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:40
uint32_t HcalUMNioDigi::valueUserWord ( int  iword) const

Definition at line 62 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

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

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

Member Data Documentation

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