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
Phase2Tracker::FEDDAQHeader Class Reference

#include <Phase2TrackerFEDDAQHeader.h>

Public Member Functions

uint8_t boeNibble () const
 
uint16_t bxID () const
 
const uint8_t * data () const
 
FEDDAQEventType eventType () const
 
uint8_t eventTypeNibble () const
 
 FEDDAQHeader ()
 
 FEDDAQHeader (const uint8_t *header)
 
 FEDDAQHeader (const uint32_t l1ID, const uint16_t bxID, const uint16_t sourceID, const FEDDAQEventType evtType=DAQ_EVENT_TYPE_PHYSICS)
 
bool hBit () const
 
uint32_t l1ID () const
 
bool lastHeader () const
 
void print (std::ostream &os) const
 
void setBXID (const uint16_t bxID)
 
void setEventType (const FEDDAQEventType evtType)
 
void setL1ID (const uint32_t l1ID)
 
void setSourceID (const uint16_t sourceID)
 
uint16_t sourceID () const
 
uint8_t version () const
 

Private Attributes

uint8_t header_ [8]
 

Detailed Description

Definition at line 29 of file Phase2TrackerFEDDAQHeader.h.

Constructor & Destructor Documentation

Phase2Tracker::FEDDAQHeader::FEDDAQHeader ( )
inline

Definition at line 32 of file Phase2TrackerFEDDAQHeader.h.

32 { }
Phase2Tracker::FEDDAQHeader::FEDDAQHeader ( const uint8_t *  header)
inlineexplicit

Definition at line 67 of file Phase2TrackerFEDDAQHeader.h.

References header_.

68  { memcpy(header_,header,8); }
Phase2Tracker::FEDDAQHeader::FEDDAQHeader ( const uint32_t  l1ID,
const uint16_t  bxID,
const uint16_t  sourceID,
const FEDDAQEventType  evtType = DAQ_EVENT_TYPE_PHYSICS 
)

Definition at line 84 of file Phase2TrackerFEDDAQHeader.cc.

References header_, setBXID(), setEventType(), setL1ID(), and setSourceID().

85  {
86  //clear everything (FOV,H,x,$ all set to 0)
87  memset(header_,0x0,8);
88  //set the BoE nibble to indicate this is the last fragment
89  header_[7] = 0x50;
90  //set variable fields vith values supplied
91  setEventType(evtType);
92  setL1ID(l1ID);
93  setBXID(bxID);
95  }
void setBXID(const uint16_t bxID)
void setSourceID(const uint16_t sourceID)
void setEventType(const FEDDAQEventType evtType)
void setL1ID(const uint32_t l1ID)

Member Function Documentation

uint8_t Phase2Tracker::FEDDAQHeader::boeNibble ( ) const
inline

Definition at line 70 of file Phase2TrackerFEDDAQHeader.h.

References header_.

71  { return ( (header_[7] & 0xF0) >> 4 ); }
uint16_t Phase2Tracker::FEDDAQHeader::bxID ( ) const
inline

Definition at line 79 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqBXID().

80  { return ( (header_[3]<<4) | ((header_[2]&0xF0)>>4) ); }
const uint8_t * Phase2Tracker::FEDDAQHeader::data ( ) const
inline

Definition at line 94 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by cuy.FindIssue::__init__().

95  { return header_; }
FEDDAQEventType Phase2Tracker::FEDDAQHeader::eventType ( ) const

Definition at line 44 of file Phase2TrackerFEDDAQHeader.cc.

References Phase2Tracker::DAQ_EVENT_TYPE_CALIBRATION, Phase2Tracker::DAQ_EVENT_TYPE_ERROR, Phase2Tracker::DAQ_EVENT_TYPE_INVALID, Phase2Tracker::DAQ_EVENT_TYPE_PHYSICS, Phase2Tracker::DAQ_EVENT_TYPE_SIMULATED, Phase2Tracker::DAQ_EVENT_TYPE_TECHNICAL, Phase2Tracker::DAQ_EVENT_TYPE_TEST, Phase2Tracker::DAQ_EVENT_TYPE_TRACED, and eventTypeNibble().

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqEventType().

uint8_t Phase2Tracker::FEDDAQHeader::eventTypeNibble ( ) const
inline

Definition at line 73 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by eventType().

74  { return (header_[7] & 0x0F); }
bool Phase2Tracker::FEDDAQHeader::hBit ( ) const
inline

Definition at line 88 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by lastHeader().

89  { return (header_[0] & 0x8); }
uint32_t Phase2Tracker::FEDDAQHeader::l1ID ( ) const
inline

Definition at line 76 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqLvl1ID().

77  { return ( header_[4] | (header_[5]<<8) | (header_[6]<<16) ); }
bool Phase2Tracker::FEDDAQHeader::lastHeader ( ) const
inline

Definition at line 91 of file Phase2TrackerFEDDAQHeader.h.

References hBit().

92  { return !hBit(); }
void Phase2Tracker::FEDDAQHeader::print ( std::ostream &  os) const
inline

Definition at line 97 of file Phase2TrackerFEDDAQHeader.h.

References header_, and Phase2Tracker::printHex().

98  { printHex(header_,8,os); }
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
Definition: utils.h:60
void Phase2Tracker::FEDDAQHeader::setBXID ( const uint16_t  bxID)

Definition at line 72 of file Phase2TrackerFEDDAQHeader.cc.

References header_.

Referenced by FEDDAQHeader().

73  {
74  header_[3] = ( (bxID & 0x0FF0) >> 4);
75  header_[2] = ( (header_[2] & 0x0F) | ( (bxID & 0x000F) << 4) );
76  }
void Phase2Tracker::FEDDAQHeader::setEventType ( const FEDDAQEventType  evtType)

Definition at line 60 of file Phase2TrackerFEDDAQHeader.cc.

References header_.

Referenced by FEDDAQHeader().

61  {
62  header_[7] = ((header_[7] & 0xF0) | evtType);
63  }
void Phase2Tracker::FEDDAQHeader::setL1ID ( const uint32_t  l1ID)

Definition at line 65 of file Phase2TrackerFEDDAQHeader.cc.

References header_.

Referenced by FEDDAQHeader().

66  {
67  header_[4] = (l1ID & 0x000000FF);
68  header_[5] = ( (l1ID & 0x0000FF00) >> 8);
69  header_[6] = ( (l1ID & 0x00FF0000) >> 16);
70  }
void Phase2Tracker::FEDDAQHeader::setSourceID ( const uint16_t  sourceID)

Definition at line 78 of file Phase2TrackerFEDDAQHeader.cc.

References header_.

Referenced by FEDDAQHeader().

79  {
80  header_[2] = ( (header_[2] & 0xF0) | ( (sourceID & 0x0F00) >> 8) );
81  header_[1] = (sourceID & 0x00FF);
82  }
uint16_t Phase2Tracker::FEDDAQHeader::sourceID ( ) const
inline

Definition at line 82 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqSourceID().

83  { return ( ((header_[2]&0x0F)<<8) | header_[1] ); }
uint8_t Phase2Tracker::FEDDAQHeader::version ( ) const
inline

Definition at line 85 of file Phase2TrackerFEDDAQHeader.h.

References header_.

86  { return ( (header_[0] & 0xF0) >> 4 ); }

Member Data Documentation

uint8_t Phase2Tracker::FEDDAQHeader::header_[8]
private