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