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:41
HcalUMNioDigi::HcalUMNioDigi ( const std::vector< uint16_t > &  words)

Definition at line 11 of file HcalUMNioDigi.cc.

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

Member Function Documentation

uint16_t HcalUMNioDigi::bunchNumber ( ) const

Definition at line 23 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

23  {
24  if (invalid()) return 0;
25  return (payload_[1]>>4)&0xFFF;
26 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
uint32_t HcalUMNioDigi::eventNumber ( ) const

Definition at line 27 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

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

Definition at line 32 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

32  {
33  if (invalid()) return 0;
34  return (payload_[6]>>8)&0xF;
35 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
uint32_t HcalUMNioDigi::getUserWord ( int  id) const

Definition at line 62 of file HcalUMNioDigi.cc.

Referenced by hasUserWord(), and invalid().

62  {
63  uint32_t dummy(0);
64  getUserWord(id,dummy);
65  return dummy;
66 }
uint32_t getUserWord(int id) const
bool HcalUMNioDigi::getUserWord ( int  id,
uint32_t &  value 
) const

Definition at line 67 of file HcalUMNioDigi.cc.

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

67  {
68  int nwords=numberUserWords();
69  if (size_t(16+nwords*3)>payload_.size()) return false; // invalid format...
70 
71  for (int i=0; i<nwords; i++) {
72  if (payload_[14+3*i]==id) {
73  value=payload_[15+3*i]+(uint32_t(payload_[16+3*i])<<16);
74  return true;
75  }
76  }
77  return false;
78 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
Definition: value.py:1
int numberUserWords() const
bool HcalUMNioDigi::hasUserWord ( int  id) const

Definition at line 58 of file HcalUMNioDigi.cc.

References getUserWord().

Referenced by invalid().

58  {
59  uint32_t dummy;
60  return getUserWord(id,dummy);
61 }
uint32_t getUserWord(int id) const
uint16_t HcalUMNioDigi::idUserWord ( int  iword) const

Definition at line 50 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

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

50  {
51  if (iword>=numberUserWords() || payload_.size()<(size_t)(16+iword*3)) return 0;
52  return payload_[13+3*iword];
53 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
int numberUserWords() const
bool HcalUMNioDigi::invalid ( ) const
inline

Definition at line 31 of file HcalUMNioDigi.h.

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

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

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

Definition at line 40 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

40  {
41  if (invalid()) return false;
42  return (payload_[11]&0x8000);
43 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
int HcalUMNioDigi::numberUserWords ( ) const

Definition at line 45 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

45  {
46  if (invalid()) return 0;
47  return (payload_[12]&0xFF);
48 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
uint32_t HcalUMNioDigi::orbitNumber ( ) const

Definition at line 19 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

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

Definition at line 14 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

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

Definition at line 36 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

36  {
37  if (invalid()) return 0;
38  return (payload_[11])&0x7FFF;
39 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
uint32_t HcalUMNioDigi::valueUserWord ( int  iword) const

Definition at line 54 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

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

54  {
55  if (iword>=numberUserWords() || payload_.size()<(size_t)(16+iword*3)) return 0;
56  return payload_[14+3*iword]+(uint32_t(payload_[15+3*iword])<<16);
57 }
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
int numberUserWords() const

Member Data Documentation

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