CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
CSCDCCHeader Class Reference

#include <CSCDCCHeader.h>

Public Member Functions

bool check () const
 
 CSCDCCHeader ()
 
 CSCDCCHeader (const CSCDCCStatusDigi &digi)
 
 CSCDCCHeader (int bx, int l1a, int sourceId, int version=0)
 
unsigned short * data ()
 
int getCDFBunchCounter () const
 
int getCDFEventNumber () const
 
int getCDFEventType () const
 
int getCDFFOV () const
 
int getCDFSourceId () const
 
void setDAV (int dduSlot)
 
void setFromBuffer (uint16_t const *buf)
 

Static Public Member Functions

static unsigned sizeInWords ()
 

Private Attributes

unsigned long long word [2]
 

Friends

class CSCDDUEventData
 

Detailed Description

Definition at line 13 of file CSCDCCHeader.h.

Constructor & Destructor Documentation

◆ CSCDCCHeader() [1/3]

CSCDCCHeader::CSCDCCHeader ( int  bx,
int  l1a,
int  sourceId,
int  version = 0 
)

=VB= Should pass true as last parameter for FEDHeader::set() method to construct correct data

Definition at line 7 of file CSCDCCHeader.cc.

7  {
8  word[0] = 0x5100000000000008LL;
9  word[1] = 0xD900000000000000LL;
11  FEDHeader::set(reinterpret_cast<unsigned char *>(data()), 1, l1a, bx, sourceId, version, true);
12 }

References l1GtPatternGenerator_cfi::bx, data(), L1DTConfigBti_cff::LL, FEDHeader::set(), objects.autophobj::sourceId, and BeamSplash_cfg::version.

◆ CSCDCCHeader() [2/3]

CSCDCCHeader::CSCDCCHeader ( )

Definition at line 14 of file CSCDCCHeader.cc.

14  {
15  word[0] = 0x5100000000000008LL;
16  word[1] = 0xD900000000000000LL;
17 }

References L1DTConfigBti_cff::LL.

◆ CSCDCCHeader() [3/3]

CSCDCCHeader::CSCDCCHeader ( const CSCDCCStatusDigi digi)

Definition at line 19 of file CSCDCCHeader.cc.

19 { memcpy(this, digi.header(), sizeInWords() * 2); }

References CSCDCCStatusDigi::header(), and sizeInWords().

Member Function Documentation

◆ check()

bool CSCDCCHeader::check ( ) const
inline

Definition at line 27 of file CSCDCCHeader.h.

27 { return true /*dcc_code1==0xD9 && dcc_code2==0x97*/; }

Referenced by CSCDCCEventData::check(), and CSCChamberDataItr::CSCChamberDataItr().

◆ data()

unsigned short* CSCDCCHeader::data ( )
inline

Definition at line 28 of file CSCDCCHeader.h.

28 { return (short unsigned*)word; }

References word.

Referenced by CSCDCCHeader(), and CSCDCCEventData::pack().

◆ getCDFBunchCounter()

int CSCDCCHeader::getCDFBunchCounter ( ) const

Definition at line 23 of file CSCDCCHeader.cc.

23 { return ((word[0] >> 20) & 0xFFF); }

◆ getCDFEventNumber()

int CSCDCCHeader::getCDFEventNumber ( ) const

Definition at line 21 of file CSCDCCHeader.cc.

21 { return ((word[0] >> 32) & 0x00FFFFFF); }

◆ getCDFEventType()

int CSCDCCHeader::getCDFEventType ( ) const

Definition at line 26 of file CSCDCCHeader.cc.

26 { return ((word[0] >> 56) & 0xF); }

◆ getCDFFOV()

int CSCDCCHeader::getCDFFOV ( ) const

Definition at line 25 of file CSCDCCHeader.cc.

25 { return ((word[0] >> 4) & 0xF); }

◆ getCDFSourceId()

int CSCDCCHeader::getCDFSourceId ( ) const

Definition at line 24 of file CSCDCCHeader.cc.

24 { return ((word[0] >> 8) & 0xFFF); }

◆ setDAV()

void CSCDCCHeader::setDAV ( int  dduSlot)

Definition at line 28 of file CSCDCCHeader.cc.

28  {
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 }

References cms::cuda::assert().

Referenced by CSCDCCEventData::addChamber().

◆ setFromBuffer()

void CSCDCCHeader::setFromBuffer ( uint16_t const *  buf)
inline

Definition at line 19 of file CSCDCCHeader.h.

19 { memcpy(this, buf, sizeInWords() * 2); }

References visDQMUpload::buf, and sizeInWords().

Referenced by CSCDCCEventData::unpack_data().

◆ sizeInWords()

static unsigned CSCDCCHeader::sizeInWords ( )
inlinestatic

Definition at line 29 of file CSCDCCHeader.h.

29 { return 8; }

Referenced by CSCDCCHeader(), CSCDCCEventData::pack(), setFromBuffer(), and CSCDCCEventData::unpack_data().

Friends And Related Function Documentation

◆ CSCDDUEventData

friend class CSCDDUEventData
friend

Definition at line 32 of file CSCDCCHeader.h.

Member Data Documentation

◆ word

unsigned long long CSCDCCHeader::word[2]
private

Definition at line 35 of file CSCDCCHeader.h.

Referenced by data().

l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
cms::cuda::assert
assert(be >=bs)
CSCDCCHeader::sizeInWords
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:29
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
CSCDCCHeader::data
unsigned short * data()
Definition: CSCDCCHeader.h:28
CSCDCCHeader::word
unsigned long long word[2]
Definition: CSCDCCHeader.h:35
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
objects.autophobj.sourceId
sourceId
Definition: autophobj.py:239
L1DTConfigBti_cff.LL
LL
Definition: L1DTConfigBti_cff.py:25
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
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45