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 uint32_t l1ID, const uint16_t bxID, const uint16_t sourceID, const FEDDAQEventType evtType=DAQ_EVENT_TYPE_PHYSICS)
 
 FEDDAQHeader (const uint8_t *header)
 
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

Definition at line 68 of file Phase2TrackerFEDDAQHeader.h.

68 { memcpy(header_, header, 8); }

References RecoTauValidation_cfi::header, and header_.

◆ 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.

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  }

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

Member Function Documentation

◆ boeNibble()

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

Definition at line 70 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

◆ bxID()

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

Definition at line 76 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

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

◆ data()

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

Definition at line 86 of file Phase2TrackerFEDDAQHeader.h.

86 { return header_; }

References header_.

◆ eventType()

FEDDAQEventType Phase2Tracker::FEDDAQHeader::eventType ( ) const

◆ eventTypeNibble()

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

Definition at line 72 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

Referenced by eventType().

◆ hBit()

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

Definition at line 82 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

Referenced by lastHeader().

◆ l1ID()

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

Definition at line 74 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

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

◆ lastHeader()

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

Definition at line 84 of file Phase2TrackerFEDDAQHeader.h.

84 { return !hBit(); }

References hBit().

◆ print()

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

Definition at line 88 of file Phase2TrackerFEDDAQHeader.h.

88 { printHex(header_, 8, os); }

References header_, and Phase2Tracker::printHex().

◆ setBXID()

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

Definition at line 66 of file Phase2TrackerFEDDAQHeader.cc.

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

References bxID(), and header_.

Referenced by FEDDAQHeader().

◆ setEventType()

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

Definition at line 58 of file Phase2TrackerFEDDAQHeader.cc.

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

References header_.

Referenced by FEDDAQHeader().

◆ setL1ID()

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

Definition at line 60 of file Phase2TrackerFEDDAQHeader.cc.

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

References header_, and l1ID().

Referenced by FEDDAQHeader().

◆ setSourceID()

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

Definition at line 71 of file Phase2TrackerFEDDAQHeader.cc.

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

References header_, and sourceID().

Referenced by FEDDAQHeader().

◆ sourceID()

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

Definition at line 78 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

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

◆ version()

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

Definition at line 80 of file Phase2TrackerFEDDAQHeader.h.

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

References header_.

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

Member Data Documentation

◆ header_

uint8_t Phase2Tracker::FEDDAQHeader::header_[8]
private
Phase2Tracker::FEDDAQHeader::eventTypeNibble
uint8_t eventTypeNibble() const
Definition: Phase2TrackerFEDDAQHeader.h:72
Phase2Tracker::FEDDAQHeader::setSourceID
void setSourceID(const uint16_t sourceID)
Definition: Phase2TrackerFEDDAQHeader.cc:71
Phase2Tracker::FEDDAQHeader::hBit
bool hBit() const
Definition: Phase2TrackerFEDDAQHeader.h:82
Phase2Tracker::DAQ_EVENT_TYPE_PHYSICS
Definition: Phase2TrackerFEDDAQHeader.h:16
Phase2Tracker::FEDDAQHeader::l1ID
uint32_t l1ID() const
Definition: Phase2TrackerFEDDAQHeader.h:74
Phase2Tracker::DAQ_EVENT_TYPE_TRACED
Definition: Phase2TrackerFEDDAQHeader.h:21
Phase2Tracker::DAQ_EVENT_TYPE_ERROR
Definition: Phase2TrackerFEDDAQHeader.h:22
Phase2Tracker::FEDDAQHeader::setBXID
void setBXID(const uint16_t bxID)
Definition: Phase2TrackerFEDDAQHeader.cc:66
Phase2Tracker::DAQ_EVENT_TYPE_INVALID
Definition: Phase2TrackerFEDDAQHeader.h:23
Phase2Tracker::FEDDAQEventType
FEDDAQEventType
Definition: Phase2TrackerFEDDAQHeader.h:15
Phase2Tracker::FEDDAQHeader::setEventType
void setEventType(const FEDDAQEventType evtType)
Definition: Phase2TrackerFEDDAQHeader.cc:58
Phase2Tracker::DAQ_EVENT_TYPE_TECHNICAL
Definition: Phase2TrackerFEDDAQHeader.h:19
Phase2Tracker::FEDDAQHeader::sourceID
uint16_t sourceID() const
Definition: Phase2TrackerFEDDAQHeader.h:78
Phase2Tracker::FEDDAQHeader::header_
uint8_t header_[8]
Definition: Phase2TrackerFEDDAQHeader.h:63
Phase2Tracker::printHex
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
Definition: utils.h:58
Phase2Tracker::DAQ_EVENT_TYPE_SIMULATED
Definition: Phase2TrackerFEDDAQHeader.h:20
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
Phase2Tracker::DAQ_EVENT_TYPE_TEST
Definition: Phase2TrackerFEDDAQHeader.h:18
Phase2Tracker::FEDDAQHeader::setL1ID
void setL1ID(const uint32_t l1ID)
Definition: Phase2TrackerFEDDAQHeader.cc:60
Phase2Tracker::DAQ_EVENT_TYPE_CALIBRATION
Definition: Phase2TrackerFEDDAQHeader.h:17
Phase2Tracker::FEDDAQHeader::bxID
uint16_t bxID() const
Definition: Phase2TrackerFEDDAQHeader.h:76