Main Page
Namespaces
Classes
Package Documentation
EventFilter
CSCRawToDigi
src
CSCDCCHeader.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCDCCHeader.h
"
2
#include "
DataFormats/FEDRawData/interface/FEDHeader.h
"
3
#include <iostream>
4
#include <cassert>
5
#include <cstring>
6
7
CSCDCCHeader::CSCDCCHeader
(
int
bx,
int
l1a,
int
sourceId
,
int
version
)
8
{
9
word
[0] = 0x5100000000000008LL;
10
word
[1] = 0xD900000000000000LL;
12
FEDHeader::set
(reinterpret_cast<unsigned char *>(
data
()), 1, l1a, bx, sourceId, version,
true
);
13
}
14
15
16
CSCDCCHeader::CSCDCCHeader
()
17
{
18
word
[0] = 0x5100000000000008LL;
19
word
[1] = 0xD900000000000000LL;
20
}
21
22
CSCDCCHeader::CSCDCCHeader
(
const
CSCDCCStatusDigi
& digi)
23
{
24
memcpy(
this
, digi.
header
(),
sizeInWords
()*2);
25
}
26
27
28
29
int
CSCDCCHeader::getCDFEventNumber
()
const
30
{
31
return
((
word
[0]>>32)&0x00FFFFFF);
32
}
33
34
int
CSCDCCHeader::getCDFBunchCounter
()
const
35
{
36
return
((
word
[0]>>20)&0xFFF);
37
}
38
int
CSCDCCHeader::getCDFSourceId
()
const
39
{
40
return
((
word
[0]>>8)&0xFFF);
41
}
42
int
CSCDCCHeader::getCDFFOV
()
const
43
{
44
return
((
word
[0]>>4)&0xF);
45
}
46
int
CSCDCCHeader::getCDFEventType
()
const
47
{
48
return
((
word
[0]>>56)&0xF);
49
}
50
51
52
void
CSCDCCHeader::setDAV
(
int
slot)
53
{
54
/* Bits 7,6,5,4,2 to indicate available DDU.
55
For slink0, the DDU slots are 5, 12, 4, 13, 3 (same as Fifo_in_use[4:0]);
56
for slink1, the DDU slots are 9, 7, 10, 6, 11
57
*/
58
assert(slot>=3 && slot <= 13);
59
int
bit[] = {0, 0, 0, 2, 5, 7, 4, 6, 0, 7, 5, 2, 6, 4};
60
word
[0] |= 1 << bit[slot];
61
}
62
63
std::ostream &
operator<<
(std::ostream & os,
const
CSCDCCHeader
& hdr)
64
{
65
os <<
"DCC Header"
<< std::endl;
66
return
os;
67
}
68
CSCDCCStatusDigi::header
const uint16_t * header() const
data accessors
Definition:
CSCDCCStatusDigi.h:28
CSCDCCHeader::setDAV
void setDAV(int dduSlot)
Definition:
CSCDCCHeader.cc:52
CSCDCCHeader::CSCDCCHeader
CSCDCCHeader()
Definition:
CSCDCCHeader.cc:16
operator<<
std::ostream & operator<<(std::ostream &os, const CSCDCCHeader &hdr)
Definition:
CSCDCCHeader.cc:63
FEDHeader.h
CSCDCCHeader::getCDFFOV
int getCDFFOV() const
Definition:
CSCDCCHeader.cc:42
CSCDCCHeader::getCDFBunchCounter
int getCDFBunchCounter() const
Definition:
CSCDCCHeader.cc:34
jets_cff.version
version
Definition:
jets_cff.py:20
CSCDCCHeader::getCDFEventNumber
int getCDFEventNumber() const
Definition:
CSCDCCHeader.cc:29
CSCDCCHeader::getCDFEventType
int getCDFEventType() const
Definition:
CSCDCCHeader.cc:46
CSCDCCHeader
Definition:
CSCDCCHeader.h:11
objects.autophobj.sourceId
sourceId
Definition:
autophobj.py:239
CSCDCCHeader::getCDFSourceId
int getCDFSourceId() const
Definition:
CSCDCCHeader.cc:38
CSCDCCHeader::word
unsigned long long word[2]
Definition:
CSCDCCHeader.h:32
CSCDCCHeader::sizeInWords
static unsigned sizeInWords()
Definition:
CSCDCCHeader.h:26
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
CSCDCCStatusDigi
Definition:
CSCDCCStatusDigi.h:15
CSCDCCHeader::data
unsigned short * data()
Definition:
CSCDCCHeader.h:25
CSCDCCHeader.h
Generated for CMSSW Reference Manual by
1.8.11