CMS 3D CMS Logo

FEDHeader.cc
Go to the documentation of this file.
1 
8 
9 FEDHeader::FEDHeader(const unsigned char* header) : theHeader(reinterpret_cast<const fedh_t*>(header)) {}
10 
12 
14 
15 uint32_t FEDHeader::lvl1ID() const { return FED_LVL1_EXTRACT(theHeader->eventid); }
16 
17 uint16_t FEDHeader::bxID() const { return FED_BXID_EXTRACT(theHeader->sourceid); }
18 
20 
22 
24 
25 void FEDHeader::set(unsigned char* header,
26  uint8_t triggerType,
27  uint32_t lvl1ID,
28  uint16_t bxID,
29  uint16_t sourceID,
30  uint8_t version,
31  bool moreHeaders) {
32  // FIXME: should check that input ranges are OK!!!
33  fedh_t* h = reinterpret_cast<fedh_t*>(header);
36 
37  h->sourceid = (((bxID & FED_BXID_WIDTH) << FED_BXID_SHIFT) & FED_BXID_MASK) |
39 
40  if (moreHeaders)
42 }
43 
45 
46 const uint32_t FEDHeader::length = sizeof(fedh_t);
#define FED_HCTRLID_EXTRACT(a)
Definition: fed_header.h:30
uint8_t triggerType() const
Event Trigger type identifier.
Definition: FEDHeader.cc:13
bool check() const
Check that the header is OK.
Definition: FEDHeader.cc:44
static const uint32_t length
Definition: FEDHeader.h:54
uint16_t sourceID() const
Identifier of the FED.
Definition: FEDHeader.cc:19
#define FED_SLINK_START_MARKER
Definition: fed_header.h:25
FEDHeader(const unsigned char *header)
Constructor.
Definition: FEDHeader.cc:9
#define FED_MORE_HEADERS_WIDTH
Definition: fed_header.h:57
#define FED_BXID_WIDTH
Definition: fed_header.h:42
#define FED_SOID_SHIFT
Definition: fed_header.h:48
#define FED_LVL1_EXTRACT(a)
Definition: fed_header.h:40
const fedh_struct * theHeader
Definition: FEDHeader.h:57
#define FED_EVTY_SHIFT
Definition: fed_header.h:33
#define FED_BXID_MASK
Definition: fed_header.h:44
uint32_t eventid
Definition: fed_header.h:22
#define FED_VERSION_MASK
Definition: fed_header.h:54
#define FED_BXID_SHIFT
Definition: fed_header.h:43
bool moreHeaders() const
Definition: FEDHeader.cc:23
#define FED_SOID_MASK
Definition: fed_header.h:49
struct fedh_struct fedh_t
#define FED_VERSION_EXTRACT(a)
Definition: fed_header.h:55
uint16_t bxID() const
The bunch crossing number.
Definition: FEDHeader.cc:17
#define FED_MORE_HEADERS_SHIFT
Definition: fed_header.h:58
#define FED_SOID_EXTRACT(a)
Definition: fed_header.h:50
#define FED_BXID_EXTRACT(a)
Definition: fed_header.h:45
#define FED_LVL1_MASK
Definition: fed_header.h:39
#define FED_VERSION_SHIFT
Definition: fed_header.h:53
uint8_t version() const
Version identifier of the FED data format.
Definition: FEDHeader.cc:21
#define FED_LVL1_SHIFT
Definition: fed_header.h:38
#define FED_MORE_HEADERS_EXTRACT(a)
Definition: fed_header.h:60
uint32_t sourceid
Definition: fed_header.h:21
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:15
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.
Definition: FEDHeader.cc:25
#define FED_EVTY_EXTRACT(a)
Definition: fed_header.h:35
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
#define FED_EVTY_MASK
Definition: fed_header.h:34
#define FED_HCTRLID_SHIFT
Definition: fed_header.h:28
~FEDHeader()
Destructor.
Definition: FEDHeader.cc:11