CMS 3D CMS Logo

CSCDCCHeader.cc
Go to the documentation of this file.
3 #include <iostream>
4 #include <cassert>
5 #include <cstring>
6 
7 CSCDCCHeader::CSCDCCHeader(int bx, int l1a, int sourceId, int version) {
8  word[0] = 0x5100000000000008LL;
9  word[1] = 0xD900000000000000LL;
11  FEDHeader::set(reinterpret_cast<unsigned char *>(data()), 1, l1a, bx, sourceId, version, true);
12 }
13 
15  word[0] = 0x5100000000000008LL;
16  word[1] = 0xD900000000000000LL;
17 }
18 
19 CSCDCCHeader::CSCDCCHeader(const CSCDCCStatusDigi &digi) { memcpy(this, digi.header(), sizeInWords() * 2); }
20 
21 int CSCDCCHeader::getCDFEventNumber() const { return ((word[0] >> 32) & 0x00FFFFFF); }
22 
23 int CSCDCCHeader::getCDFBunchCounter() const { return ((word[0] >> 20) & 0xFFF); }
24 int CSCDCCHeader::getCDFSourceId() const { return ((word[0] >> 8) & 0xFFF); }
25 int CSCDCCHeader::getCDFFOV() const { return ((word[0] >> 4) & 0xF); }
26 int CSCDCCHeader::getCDFEventType() const { return ((word[0] >> 56) & 0xF); }
27 
28 void CSCDCCHeader::setDAV(int slot) {
29  /* Bits 7,6,5,4,2 to indicate available DDU.
30  For slink0, the DDU slots are 5, 12, 4, 13, 3 (same as Fifo_in_use[4:0]);
31  for slink1, the DDU slots are 9, 7, 10, 6, 11
32  */
33  assert(slot >= 3 && slot <= 13);
34  int bit[] = {0, 0, 0, 2, 5, 7, 4, 6, 0, 7, 5, 2, 6, 4};
35  word[0] |= 1 << bit[slot];
36 }
37 
38 std::ostream &operator<<(std::ostream &os, const CSCDCCHeader &hdr) {
39  os << "DCC Header" << std::endl;
40  return os;
41 }
CSCDCCHeader::getCDFFOV
int getCDFFOV() const
Definition: CSCDCCHeader.cc:25
CSCDCCHeader.h
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
cms::cuda::assert
assert(be >=bs)
CSCDCCHeader::sizeInWords
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:29
CSCDCCHeader
Definition: CSCDCCHeader.h:13
CSCDCCHeader::CSCDCCHeader
CSCDCCHeader()
Definition: CSCDCCHeader.cc:14
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
CSCDCCHeader::getCDFSourceId
int getCDFSourceId() const
Definition: CSCDCCHeader.cc:24
operator<<
std::ostream & operator<<(std::ostream &os, const CSCDCCHeader &hdr)
Definition: CSCDCCHeader.cc:38
CSCDCCHeader::data
unsigned short * data()
Definition: CSCDCCHeader.h:28
CSCDCCHeader::getCDFEventType
int getCDFEventType() const
Definition: CSCDCCHeader.cc:26
CSCDCCHeader::getCDFEventNumber
int getCDFEventNumber() const
Definition: CSCDCCHeader.cc:21
CSCDCCStatusDigi
Definition: CSCDCCStatusDigi.h:15
CSCDCCHeader::getCDFBunchCounter
int getCDFBunchCounter() const
Definition: CSCDCCHeader.cc:23
objects.autophobj.sourceId
sourceId
Definition: autophobj.py:239
L1DTConfigBti_cff.LL
LL
Definition: L1DTConfigBti_cff.py:25
CSCDCCHeader::setDAV
void setDAV(int dduSlot)
Definition: CSCDCCHeader.cc:28
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
CSCDCCStatusDigi::header
const uint16_t * header() const
data accessors
Definition: CSCDCCStatusDigi.h:25
FEDHeader.h
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45