Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
FEDRawData
src
FEDHeader.cc
Go to the documentation of this file.
1
8
#include <
DataFormats/FEDRawData/interface/FEDHeader.h
>
9
#include "
fed_header.h
"
10
11
FEDHeader::FEDHeader
(
const
unsigned
char
*
header
) :
12
theHeader(reinterpret_cast<
const
fedh_t
*>(header)) {}
13
14
15
FEDHeader::~FEDHeader
(){}
16
17
18
int
FEDHeader::triggerType
(){
19
return
((
theHeader
->
eventid
&
FED_EVTY_MASK
) >>
FED_EVTY_SHIFT
);
20
}
21
22
int
FEDHeader::lvl1ID
(){
23
return
(
theHeader
->
eventid
&
FED_LVL1_MASK
);
24
}
25
26
int
FEDHeader::bxID
(){
27
return
((
theHeader
->
sourceid
&
FED_BXID_MASK
) >>
FED_BXID_SHIFT
);
28
}
29
30
int
FEDHeader::sourceID
(){
31
return
((
theHeader
->
sourceid
&
FED_SOID_MASK
) >>
FED_SOID_SHIFT
);
32
}
33
34
int
FEDHeader::version
(){
35
return
((
theHeader
->
sourceid
&
FED_VERSION_MASK
) >>
FED_VERSION_SHIFT
);
36
}
37
38
bool
FEDHeader::moreHeaders
(){
39
return
((
theHeader
->
sourceid
&
FED_MORE_HEADERS
)!=0);
40
}
41
42
void
FEDHeader::set
(
unsigned
char
*
header
,
43
int
evt_ty,
44
int
lvl1_ID,
45
int
bx_ID,
46
int
source_ID,
47
int
version
,
48
bool
H){
49
50
// FIXME: should check that input ranges are OK!!!
51
fedh_t
*
h
=
reinterpret_cast<
fedh_t
*
>
(
header
);
52
h->
eventid
=
53
(
FED_HCTRLID
&
FED_HCTRLID_MASK
) |
54
( ( evt_ty <<
FED_EVTY_SHIFT
) &
FED_EVTY_MASK
) |
55
( ( lvl1_ID <<
FED_LVL1_SHIFT
) &
FED_LVL1_MASK
);
56
57
h->
sourceid
=
58
( ( bx_ID <<
FED_BXID_SHIFT
) &
FED_BXID_MASK
) |
59
( ( source_ID <<
FED_SOID_SHIFT
) &
FED_SOID_MASK
) |
60
( ( version <<
FED_VERSION_SHIFT
) &
FED_VERSION_MASK
);
61
62
if
(H) h->
sourceid
|=
FED_MORE_HEADERS
;
63
64
}
65
66
bool
FEDHeader::check
() {
67
// ...may report with finer detail
68
bool
result
=
true
;
69
result &= ((
theHeader
->
eventid
&
FED_HCTRLID_MASK
) ==
FED_HCTRLID
);
70
71
return
result
;
72
}
FEDHeader::version
int version()
Version identifier of the FED data format.
Definition:
FEDHeader.cc:34
FEDHeader::FEDHeader
FEDHeader(const unsigned char *header)
Constructor.
Definition:
FEDHeader.cc:11
fedh_struct::sourceid
unsigned int sourceid
Definition:
fed_header.h:32
FED_SOID_SHIFT
#define FED_SOID_SHIFT
Definition:
fed_header.h:55
FEDHeader::theHeader
const fedh_struct * theHeader
Definition:
FEDHeader.h:56
FEDHeader::sourceID
int sourceID()
Identifier of the FED.
Definition:
FEDHeader.cc:30
FEDHeader::moreHeaders
bool moreHeaders()
Definition:
FEDHeader.cc:38
FED_EVTY_SHIFT
#define FED_EVTY_SHIFT
Definition:
fed_header.h:51
FEDHeader::set
static void set(unsigned char *header, int evt_ty, int lvl1_ID, int bx_ID, int source_ID, int version=0, bool H=false)
Set all fields in the header.
Definition:
FEDHeader.cc:42
query.result
tuple result
Definition:
query.py:137
FED_BXID_MASK
#define FED_BXID_MASK
Definition:
fed_header.h:41
FED_VERSION_MASK
#define FED_VERSION_MASK
Definition:
fed_header.h:43
FED_BXID_SHIFT
#define FED_BXID_SHIFT
Definition:
fed_header.h:54
FED_SOID_MASK
#define FED_SOID_MASK
Definition:
fed_header.h:42
BeamSplash_cfg.version
tuple version
Definition:
BeamSplash_cfg.py:45
FEDHeader::check
bool check()
Check that the header is OK.
Definition:
FEDHeader.cc:66
FED_LVL1_MASK
#define FED_LVL1_MASK
Definition:
fed_header.h:39
FED_VERSION_SHIFT
#define FED_VERSION_SHIFT
Definition:
fed_header.h:56
FEDHeader.h
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_HCTRLID
#define FED_HCTRLID
Definition:
fed_header.h:47
FEDHeader::bxID
int bxID()
The bunch crossing number.
Definition:
FEDHeader.cc:26
fedh_struct
Definition:
fed_header.h:31
compareJSON.const
string const
Definition:
compareJSON.py:14
FED_LVL1_SHIFT
#define FED_LVL1_SHIFT
Definition:
fed_header.h:52
fedh_struct::eventid
unsigned int eventid
Definition:
fed_header.h:33
errorMatrix2Lands.header
tuple header
Definition:
errorMatrix2Lands.py:19
FED_MORE_HEADERS
#define FED_MORE_HEADERS
Definition:
fed_header.h:44
FED_HCTRLID_MASK
#define FED_HCTRLID_MASK
Definition:
fed_header.h:37
FEDHeader::lvl1ID
int lvl1ID()
Level-1 event number generated by the TTC system.
Definition:
FEDHeader.cc:22
FED_EVTY_MASK
#define FED_EVTY_MASK
Definition:
fed_header.h:38
FEDHeader::triggerType
int triggerType()
Event Trigger type identifier.
Definition:
FEDHeader.cc:18
FEDHeader::~FEDHeader
~FEDHeader()
Destructor.
Definition:
FEDHeader.cc:15
fed_header.h
Generated for CMSSW Reference Manual by
1.8.5