CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
FEDHeader Class Reference

#include <FEDHeader.h>

Public Member Functions

uint16_t bxID () const
 The bunch crossing number. More...
 
bool check () const
 Check that the header is OK. More...
 
 FEDHeader (const unsigned char *header)
 Constructor. More...
 
uint32_t lvl1ID () const
 Level-1 event number generated by the TTC system. More...
 
bool moreHeaders () const
 
uint16_t sourceID () const
 Identifier of the FED. More...
 
uint8_t triggerType () const
 Event Trigger type identifier. More...
 
uint8_t version () const
 Version identifier of the FED data format. More...
 
 ~FEDHeader ()
 Destructor. More...
 

Static Public Member Functions

static void set (unsigned char *header, uint8_t triggerType, uint32_t lvl1ID, uint16_t bxID, uint16_t sourceID, uint8_t version=0, bool moreHeaders=false)
 Set all fields in the header. More...
 

Static Public Attributes

static const uint32_t length = sizeof(fedh_t)
 

Private Attributes

const fedh_structtheHeader
 

Detailed Description

Helper class to interpret/create FED header words.

Author
N. Amapane - CERN, R. Mommsen - FNAL

Definition at line 14 of file FEDHeader.h.

Constructor & Destructor Documentation

FEDHeader::FEDHeader ( const unsigned char *  header)

Constructor.

Definition at line 10 of file FEDHeader.cc.

10  :
11  theHeader(reinterpret_cast<const fedh_t*>(header)) {}
const fedh_struct * theHeader
Definition: FEDHeader.h:57
FEDHeader::~FEDHeader ( )

Destructor.

Definition at line 14 of file FEDHeader.cc.

14 {}

Member Function Documentation

uint16_t FEDHeader::bxID ( ) const
bool FEDHeader::check ( ) const
uint32_t FEDHeader::lvl1ID ( ) const
bool FEDHeader::moreHeaders ( ) const

0 -> the current header word is the last one. 1-> other header words can follow (always 1 for ECAL)

Definition at line 42 of file FEDHeader.cc.

References FED_MORE_HEADERS_EXTRACT, fedh_struct::sourceid, and theHeader.

Referenced by ErrorChecker::checkHeader(), RPixErrorChecker::checkHeader(), ESUnpacker::interpretRawData(), RPCUnpackingModule::produce(), omtf::OmtfUnpacker::produce(), L1GlobalTriggerEvmRawToDigi::unpackHeader(), and L1GlobalTriggerRawToDigi::unpackHeader().

42  {
44 }
const fedh_struct * theHeader
Definition: FEDHeader.h:57
#define FED_MORE_HEADERS_EXTRACT(a)
Definition: fed_header.h:62
uint32_t sourceid
Definition: fed_header.h:23
void FEDHeader::set ( unsigned char *  header,
uint8_t  triggerType,
uint32_t  lvl1ID,
uint16_t  bxID,
uint16_t  sourceID,
uint8_t  version = 0,
bool  moreHeaders = false 
)
static

Set all fields in the header.

Definition at line 47 of file FEDHeader.cc.

References fedh_struct::eventid, FED_BXID_MASK, FED_BXID_SHIFT, FED_EVTY_MASK, FED_EVTY_SHIFT, FED_HCTRLID_SHIFT, FED_LVL1_MASK, FED_LVL1_SHIFT, FED_MORE_HEADERS_SHIFT, FED_MORE_HEADERS_WIDTH, FED_SLINK_START_MARKER, FED_SOID_MASK, FED_SOID_SHIFT, FED_VERSION_MASK, FED_VERSION_SHIFT, RecoTauValidation_cfi::header, and fedh_struct::sourceid.

Referenced by CSCDCCHeader::CSCDCCHeader(), ESDataFormatterV1_1::DigiToRaw(), ESDataFormatterV4::DigiToRaw(), DaqFakeReader::fillFEDs(), DaqFakeReader::fillGTPFED(), l1t::AMCDumpToRaw::formatRaw(), l1t::MP7BufferDumpToRaw::formatRaw(), PixelDataFormatter::formatRawData(), L1GTEvmDigiToRaw::packHeader(), L1GTDigiToRaw::packHeader(), DTDigiToRawModule::produce(), RPCTwinMuxDigiToRaw::produce(), CSCTFPacker::produce(), HcalDigiToRawuHTR::produce(), GctDigiToRaw::produce(), omtf::OmtfPacker::produce(), l1t::L1TDigiToRaw::produce(), and RPCPackingModule::rawData().

53  {
54 
55  // FIXME: should check that input ranges are OK!!!
56  fedh_t* h = reinterpret_cast<fedh_t*>(header);
57  h->eventid =
61 
62  h->sourceid =
63  ( (bxID << FED_BXID_SHIFT ) & FED_BXID_MASK ) |
66 
67  if (moreHeaders)
69 }
uint8_t triggerType() const
Event Trigger type identifier.
Definition: FEDHeader.cc:17
bool moreHeaders() const
Definition: FEDHeader.cc:42
#define FED_SLINK_START_MARKER
Definition: fed_header.h:27
uint16_t sourceID() const
Identifier of the FED.
Definition: FEDHeader.cc:32
uint8_t version() const
Version identifier of the FED data format.
Definition: FEDHeader.cc:37
#define FED_MORE_HEADERS_WIDTH
Definition: fed_header.h:59
#define FED_SOID_SHIFT
Definition: fed_header.h:50
#define FED_EVTY_SHIFT
Definition: fed_header.h:35
#define FED_BXID_MASK
Definition: fed_header.h:46
uint32_t eventid
Definition: fed_header.h:24
#define FED_VERSION_MASK
Definition: fed_header.h:56
#define FED_BXID_SHIFT
Definition: fed_header.h:45
#define FED_SOID_MASK
Definition: fed_header.h:51
#define FED_MORE_HEADERS_SHIFT
Definition: fed_header.h:60
#define FED_LVL1_MASK
Definition: fed_header.h:41
#define FED_VERSION_SHIFT
Definition: fed_header.h:55
#define FED_LVL1_SHIFT
Definition: fed_header.h:40
uint16_t bxID() const
The bunch crossing number.
Definition: FEDHeader.cc:27
uint32_t sourceid
Definition: fed_header.h:23
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:22
#define FED_EVTY_MASK
Definition: fed_header.h:36
#define FED_HCTRLID_SHIFT
Definition: fed_header.h:30
uint16_t FEDHeader::sourceID ( ) const
uint8_t FEDHeader::triggerType ( ) const
uint8_t FEDHeader::version ( ) const

Member Data Documentation

const uint32_t FEDHeader::length = sizeof(fedh_t)
static
const fedh_struct* FEDHeader::theHeader
private

Definition at line 57 of file FEDHeader.h.

Referenced by bxID(), check(), lvl1ID(), moreHeaders(), sourceID(), triggerType(), and version().