CMS 3D CMS Logo

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 30 of file Phase2TrackerFEDDAQHeader.h.

Constructor & Destructor Documentation

◆ FEDDAQHeader() [1/3]

Phase2Tracker::FEDDAQHeader::FEDDAQHeader ( )
inline

Definition at line 32 of file Phase2TrackerFEDDAQHeader.h.

32 {}

◆ FEDDAQHeader() [2/3]

Phase2Tracker::FEDDAQHeader::FEDDAQHeader ( const uint8_t *  header)
inlineexplicit

◆ FEDDAQHeader() [3/3]

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 76 of file Phase2TrackerFEDDAQHeader.cc.

References bxID(), header_, l1ID(), setBXID(), setEventType(), setL1ID(), setSourceID(), and sourceID().

79  {
80  //clear everything (FOV,H,x,$ all set to 0)
81  memset(header_, 0x0, 8);
82  //set the BoE nibble to indicate this is the last fragment
83  header_[7] = 0x50;
84  //set variable fields vith values supplied
85  setEventType(evtType);
86  setL1ID(l1ID);
87  setBXID(bxID);
89  }
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

◆ boeNibble()

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

Definition at line 70 of file Phase2TrackerFEDDAQHeader.h.

References header_.

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

◆ bxID()

uint16_t Phase2Tracker::FEDDAQHeader::bxID ( ) const
inline

Definition at line 76 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqBXID(), FEDDAQHeader(), and setBXID().

76 { return ((header_[3] << 4) | ((header_[2] & 0xF0) >> 4)); }

◆ data()

const uint8_t * Phase2Tracker::FEDDAQHeader::data ( ) const
inline

Definition at line 86 of file Phase2TrackerFEDDAQHeader.h.

References header_.

◆ eventType()

FEDDAQEventType Phase2Tracker::FEDDAQHeader::eventType ( ) const

Definition at line 43 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().

◆ eventTypeNibble()

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

Definition at line 72 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by eventType().

72 { return (header_[7] & 0x0F); }

◆ hBit()

bool Phase2Tracker::FEDDAQHeader::hBit ( ) const
inline

Definition at line 82 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by lastHeader().

82 { return (header_[0] & 0x8); }

◆ l1ID()

uint32_t Phase2Tracker::FEDDAQHeader::l1ID ( ) const
inline

Definition at line 74 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqLvl1ID(), FEDDAQHeader(), and setL1ID().

74 { return (header_[4] | (header_[5] << 8) | (header_[6] << 16)); }

◆ lastHeader()

bool Phase2Tracker::FEDDAQHeader::lastHeader ( ) const
inline

Definition at line 84 of file Phase2TrackerFEDDAQHeader.h.

References hBit().

84 { return !hBit(); }

◆ print()

void Phase2Tracker::FEDDAQHeader::print ( std::ostream &  os) const
inline

Definition at line 88 of file Phase2TrackerFEDDAQHeader.h.

References header_, l1tGTMenu_BTagSeeds_cff::os, and Phase2Tracker::printHex().

88 { printHex(header_, 8, os); }
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
Definition: utils.h:59

◆ setBXID()

void Phase2Tracker::FEDDAQHeader::setBXID ( const uint16_t  bxID)

Definition at line 66 of file Phase2TrackerFEDDAQHeader.cc.

References bxID(), and header_.

Referenced by FEDDAQHeader().

66  {
67  header_[3] = ((bxID & 0x0FF0) >> 4);
68  header_[2] = ((header_[2] & 0x0F) | ((bxID & 0x000F) << 4));
69  }

◆ setEventType()

void Phase2Tracker::FEDDAQHeader::setEventType ( const FEDDAQEventType  evtType)

Definition at line 58 of file Phase2TrackerFEDDAQHeader.cc.

References header_.

Referenced by FEDDAQHeader().

58 { header_[7] = ((header_[7] & 0xF0) | evtType); }

◆ setL1ID()

void Phase2Tracker::FEDDAQHeader::setL1ID ( const uint32_t  l1ID)

Definition at line 60 of file Phase2TrackerFEDDAQHeader.cc.

References header_, and l1ID().

Referenced by FEDDAQHeader().

60  {
61  header_[4] = (l1ID & 0x000000FF);
62  header_[5] = ((l1ID & 0x0000FF00) >> 8);
63  header_[6] = ((l1ID & 0x00FF0000) >> 16);
64  }

◆ setSourceID()

void Phase2Tracker::FEDDAQHeader::setSourceID ( const uint16_t  sourceID)

Definition at line 71 of file Phase2TrackerFEDDAQHeader.cc.

References header_, and sourceID().

Referenced by FEDDAQHeader().

71  {
72  header_[2] = ((header_[2] & 0xF0) | ((sourceID & 0x0F00) >> 8));
73  header_[1] = (sourceID & 0x00FF);
74  }

◆ sourceID()

uint16_t Phase2Tracker::FEDDAQHeader::sourceID ( ) const
inline

Definition at line 78 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqSourceID(), FEDDAQHeader(), and setSourceID().

78 { return (((header_[2] & 0x0F) << 8) | header_[1]); }

◆ version()

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

Definition at line 80 of file Phase2TrackerFEDDAQHeader.h.

References header_.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

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

Member Data Documentation

◆ header_

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