File indexing completed on 2024-04-06 12:10:26
0001 #include "EventFilter/CSCRawToDigi/interface/CSCDCCHeader.h"
0002 #include "DataFormats/FEDRawData/interface/FEDHeader.h"
0003 #include <iostream>
0004 #include <cassert>
0005 #include <cstring>
0006
0007 CSCDCCHeader::CSCDCCHeader(int bx, int l1a, int sourceId, int version) {
0008 word[0] = 0x5100000000000008LL;
0009 word[1] = 0xD900000000000000LL;
0010
0011 FEDHeader::set(reinterpret_cast<unsigned char *>(data()), 1, l1a, bx, sourceId, version, true);
0012 }
0013
0014 CSCDCCHeader::CSCDCCHeader() {
0015 word[0] = 0x5100000000000008LL;
0016 word[1] = 0xD900000000000000LL;
0017 }
0018
0019 CSCDCCHeader::CSCDCCHeader(const CSCDCCStatusDigi &digi) { memcpy(this, digi.header(), sizeInWords() * 2); }
0020
0021 int CSCDCCHeader::getCDFEventNumber() const { return ((word[0] >> 32) & 0x00FFFFFF); }
0022
0023 int CSCDCCHeader::getCDFBunchCounter() const { return ((word[0] >> 20) & 0xFFF); }
0024 int CSCDCCHeader::getCDFSourceId() const { return ((word[0] >> 8) & 0xFFF); }
0025 int CSCDCCHeader::getCDFFOV() const { return ((word[0] >> 4) & 0xF); }
0026 int CSCDCCHeader::getCDFEventType() const { return ((word[0] >> 56) & 0xF); }
0027
0028 void CSCDCCHeader::setDAV(int slot) {
0029
0030
0031
0032
0033 assert(slot >= 3 && slot <= 13);
0034 int bit[] = {0, 0, 0, 2, 5, 7, 4, 6, 0, 7, 5, 2, 6, 4};
0035 word[0] |= 1 << bit[slot];
0036 }
0037
0038 std::ostream &operator<<(std::ostream &os, const CSCDCCHeader &hdr) {
0039 os << "DCC Header" << std::endl;
0040 return os;
0041 }