test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 3 of file HcalUMNioDigi.cc.

3 { }
HcalUMNioDigi::HcalUMNioDigi ( const uint16_t *  ptr,
int  words 
)

Definition at line 4 of file HcalUMNioDigi.cc.

References i, and payload_.

4  {
5  payload_.reserve(words);
6  for (int i=0; i<words; i++) payload_.push_back(ptr[i]);
7 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
HcalUMNioDigi::HcalUMNioDigi ( const std::vector< uint16_t > &  words)

Definition at line 8 of file HcalUMNioDigi.cc.

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

Member Function Documentation

uint16_t HcalUMNioDigi::bunchNumber ( ) const

Definition at line 20 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

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

Definition at line 24 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

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

Definition at line 29 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

29  {
30  if (invalid()) return 0;
31  return (payload_[6]>>8)&0xF;
32 }
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 59 of file HcalUMNioDigi.cc.

Referenced by hasUserWord().

59  {
60  uint32_t dummy(0);
61  getUserWord(id,dummy);
62  return dummy;
63 }
uint32_t getUserWord(int id) const
bool HcalUMNioDigi::getUserWord ( int  id,
uint32_t &  value 
) const

Definition at line 64 of file HcalUMNioDigi.cc.

References i, numberUserWords(), and payload_.

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

Definition at line 55 of file HcalUMNioDigi.cc.

References getUserWord().

55  {
56  uint32_t dummy;
57  return getUserWord(id,dummy);
58 }
uint32_t getUserWord(int id) const
uint16_t HcalUMNioDigi::idUserWord ( int  iword) const

Definition at line 47 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

Referenced by operator<<().

47  {
48  if (iword>=numberUserWords() || payload_.size()<(size_t)(16+iword*3)) return 0;
49  return payload_[13+3*iword];
50 }
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 payload_.

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

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

Definition at line 37 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

37  {
38  if (invalid()) return 0;
39  return (payload_[9]&0x8000);
40 }
bool invalid() const
Definition: HcalUMNioDigi.h:31
std::vector< uint16_t > payload_
Definition: HcalUMNioDigi.h:41
int HcalUMNioDigi::numberUserWords ( ) const

Definition at line 42 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

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

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

Definition at line 16 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

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

Definition at line 11 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

Referenced by operator<<().

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

Definition at line 33 of file HcalUMNioDigi.cc.

References invalid(), and payload_.

33  {
34  if (invalid()) return 0;
35  return (payload_[9])&0x7FFF;
36 }
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 51 of file HcalUMNioDigi.cc.

References numberUserWords(), and payload_.

Referenced by operator<<().

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

Member Data Documentation

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