Main Page
Namespaces
Classes
Package Documentation
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
10
FEDHeader::FEDHeader
(
const
unsigned
char
*
header
) :
11
theHeader(reinterpret_cast<const
fedh_t
*>(header)) {}
12
13
14
FEDHeader::~FEDHeader
() {}
15
16
17
uint8_t
FEDHeader::triggerType
()
const
{
18
return
FED_EVTY_EXTRACT
(
theHeader
->
eventid
);
19
}
20
21
22
uint32_t
FEDHeader::lvl1ID
()
const
{
23
return
FED_LVL1_EXTRACT
(
theHeader
->
eventid
);
24
}
25
26
27
uint16_t
FEDHeader::bxID
()
const
{
28
return
FED_BXID_EXTRACT
(
theHeader
->
sourceid
);
29
}
30
31
32
uint16_t
FEDHeader::sourceID
()
const
{
33
return
FED_SOID_EXTRACT
(
theHeader
->
sourceid
);
34
}
35
36
37
uint8_t
FEDHeader::version
()
const
{
38
return
FED_VERSION_EXTRACT
(
theHeader
->
sourceid
);
39
}
40
41
42
bool
FEDHeader::moreHeaders
()
const
{
43
return
(
FED_MORE_HEADERS_EXTRACT
(
theHeader
->
sourceid
) != 0 );
44
}
45
46
47
void
FEDHeader::set
(
unsigned
char
*
header
,
48
uint8_t
triggerType
,
49
uint32_t
lvl1ID
,
50
uint16_t
bxID
,
51
uint16_t
sourceID
,
52
uint8_t
version
,
53
bool
moreHeaders
) {
54
55
// FIXME: should check that input ranges are OK!!!
56
fedh_t
*
h
=
reinterpret_cast<
fedh_t
*
>
(
header
);
57
h->
eventid
=
58
(
FED_SLINK_START_MARKER
<<
FED_HCTRLID_SHIFT
) |
59
( (triggerType <<
FED_EVTY_SHIFT
) &
FED_EVTY_MASK
) |
60
( (lvl1ID <<
FED_LVL1_SHIFT
) &
FED_LVL1_MASK
);
61
62
h->
sourceid
=
63
( (bxID <<
FED_BXID_SHIFT
) &
FED_BXID_MASK
) |
64
( (sourceID <<
FED_SOID_SHIFT
) &
FED_SOID_MASK
) |
65
( (version <<
FED_VERSION_SHIFT
) &
FED_VERSION_MASK
);
66
67
if
(moreHeaders)
68
h->
sourceid
|= (
FED_MORE_HEADERS_WIDTH
<<
FED_MORE_HEADERS_SHIFT
);
69
}
70
71
72
bool
FEDHeader::check
()
const
{
73
return
(
FED_HCTRLID_EXTRACT
(
theHeader
->
eventid
) ==
FED_SLINK_START_MARKER
);
74
}
75
76
77
const
uint32_t
FEDHeader::length
=
sizeof
(
fedh_t
);
FED_HCTRLID_EXTRACT
#define FED_HCTRLID_EXTRACT(a)
Definition:
fed_header.h:32
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
FEDHeader::triggerType
uint8_t triggerType() const
Event Trigger type identifier.
Definition:
FEDHeader.cc:17
FEDHeader::length
static const uint32_t length
Definition:
FEDHeader.h:54
FEDHeader::moreHeaders
bool moreHeaders() const
Definition:
FEDHeader.cc:42
FED_SOID_EXTRACT
#define FED_SOID_EXTRACT(a)
Definition:
fed_header.h:52
FEDHeader::check
bool check() const
Check that the header is OK.
Definition:
FEDHeader.cc:72
FED_SLINK_START_MARKER
#define FED_SLINK_START_MARKER
Definition:
fed_header.h:27
FEDHeader::sourceID
uint16_t sourceID() const
Identifier of the FED.
Definition:
FEDHeader.cc:32
FEDHeader::FEDHeader
FEDHeader(const unsigned char *header)
Constructor.
Definition:
FEDHeader.cc:10
FEDHeader.h
FEDHeader::version
uint8_t version() const
Version identifier of the FED data format.
Definition:
FEDHeader.cc:37
FED_EVTY_EXTRACT
#define FED_EVTY_EXTRACT(a)
Definition:
fed_header.h:37
FED_MORE_HEADERS_WIDTH
#define FED_MORE_HEADERS_WIDTH
Definition:
fed_header.h:59
RecoTauValidation_cfi.header
header
Definition:
RecoTauValidation_cfi.py:300
FED_SOID_SHIFT
#define FED_SOID_SHIFT
Definition:
fed_header.h:50
FEDHeader::theHeader
const fedh_struct * theHeader
Definition:
FEDHeader.h:57
FED_EVTY_SHIFT
#define FED_EVTY_SHIFT
Definition:
fed_header.h:35
FED_VERSION_EXTRACT
#define FED_VERSION_EXTRACT(a)
Definition:
fed_header.h:57
FED_BXID_MASK
#define FED_BXID_MASK
Definition:
fed_header.h:46
fedh_struct::eventid
uint32_t eventid
Definition:
fed_header.h:24
FED_VERSION_MASK
#define FED_VERSION_MASK
Definition:
fed_header.h:56
FED_BXID_SHIFT
#define FED_BXID_SHIFT
Definition:
fed_header.h:45
FED_SOID_MASK
#define FED_SOID_MASK
Definition:
fed_header.h:51
fedh_t
struct fedh_struct fedh_t
FED_MORE_HEADERS_SHIFT
#define FED_MORE_HEADERS_SHIFT
Definition:
fed_header.h:60
FED_LVL1_MASK
#define FED_LVL1_MASK
Definition:
fed_header.h:41
FED_VERSION_SHIFT
#define FED_VERSION_SHIFT
Definition:
fed_header.h:55
FED_BXID_EXTRACT
#define FED_BXID_EXTRACT(a)
Definition:
fed_header.h:47
fedh_struct
Definition:
fed_header.h:22
FED_LVL1_EXTRACT
#define FED_LVL1_EXTRACT(a)
Definition:
fed_header.h:42
FED_LVL1_SHIFT
#define FED_LVL1_SHIFT
Definition:
fed_header.h:40
FEDHeader::bxID
uint16_t bxID() const
The bunch crossing number.
Definition:
FEDHeader.cc:27
FED_MORE_HEADERS_EXTRACT
#define FED_MORE_HEADERS_EXTRACT(a)
Definition:
fed_header.h:62
fedh_struct::sourceid
uint32_t sourceid
Definition:
fed_header.h:23
FEDHeader::lvl1ID
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition:
FEDHeader.cc:22
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:47
FED_EVTY_MASK
#define FED_EVTY_MASK
Definition:
fed_header.h:36
FED_HCTRLID_SHIFT
#define FED_HCTRLID_SHIFT
Definition:
fed_header.h:30
FEDHeader::~FEDHeader
~FEDHeader()
Destructor.
Definition:
FEDHeader.cc:14
fed_header.h
Generated for CMSSW Reference Manual by
1.8.11