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 (int bx, int l1a, int sourceId, int version=0)
 
 CSCDCCHeader ()
 
 CSCDCCHeader (const CSCDCCStatusDigi &digi)
 
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::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.

References data(), FEDHeader::set(), and word.

8 {
9  word[0] = 0x5100000000000008LL;
10  word[1] = 0xD900000000000000LL;
12  FEDHeader::set(reinterpret_cast<unsigned char *>(data()), 1, l1a, bx, sourceId, version, true);
13 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
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
unsigned short * data()
Definition: CSCDCCHeader.h:31
CSCDCCHeader::CSCDCCHeader ( )

Definition at line 16 of file CSCDCCHeader.cc.

References word.

17 {
18  word[0] = 0x5100000000000008LL;
19  word[1] = 0xD900000000000000LL;
20 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
CSCDCCHeader::CSCDCCHeader ( const CSCDCCStatusDigi digi)

Definition at line 22 of file CSCDCCHeader.cc.

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

23 {
24  memcpy(this, digi.header(), sizeInWords()*2);
25 }
const uint16_t * header() const
data accessors
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:32

Member Function Documentation

bool CSCDCCHeader::check ( ) const
inline

Definition at line 30 of file CSCDCCHeader.h.

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

30 { return true/*dcc_code1==0xD9 && dcc_code2==0x97*/;}
unsigned short* CSCDCCHeader::data ( )
inline

Definition at line 31 of file CSCDCCHeader.h.

References word.

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

31 {return (short unsigned *)word;}
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
int CSCDCCHeader::getCDFBunchCounter ( ) const

Definition at line 34 of file CSCDCCHeader.cc.

References word.

Referenced by setFromBuffer().

35 {
36  return ((word[0]>>20)&0xFFF);
37 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
int CSCDCCHeader::getCDFEventNumber ( ) const

Definition at line 29 of file CSCDCCHeader.cc.

References word.

Referenced by cscdqm::EventProcessor::preProcessEvent(), and setFromBuffer().

30 {
31  return ((word[0]>>32)&0x00FFFFFF);
32 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
int CSCDCCHeader::getCDFEventType ( ) const

Definition at line 46 of file CSCDCCHeader.cc.

References word.

Referenced by setFromBuffer().

47 {
48  return ((word[0]>>56)&0xF);
49 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
int CSCDCCHeader::getCDFFOV ( ) const

Definition at line 42 of file CSCDCCHeader.cc.

References word.

Referenced by setFromBuffer().

43 {
44  return ((word[0]>>4)&0xF);
45 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
int CSCDCCHeader::getCDFSourceId ( ) const

Definition at line 38 of file CSCDCCHeader.cc.

References word.

Referenced by setFromBuffer().

39 {
40  return ((word[0]>>8)&0xFFF);
41 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
void CSCDCCHeader::setDAV ( int  dduSlot)

Definition at line 52 of file CSCDCCHeader.cc.

References word.

Referenced by CSCDCCEventData::addChamber(), and setFromBuffer().

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 }
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
void CSCDCCHeader::setFromBuffer ( uint16_t const *  buf)
inline

Definition at line 20 of file CSCDCCHeader.h.

References getCDFBunchCounter(), getCDFEventNumber(), getCDFEventType(), getCDFFOV(), getCDFSourceId(), setDAV(), and sizeInWords().

Referenced by CSCDCCEventData::unpack_data().

20  {
21  memcpy(this, buf, sizeInWords()*2);
22  }
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:32
static unsigned CSCDCCHeader::sizeInWords ( )
inlinestatic

Definition at line 32 of file CSCDCCHeader.h.

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

32 {return 8;}

Friends And Related Function Documentation

friend class CSCDDUEventData
friend

Definition at line 35 of file CSCDCCHeader.h.

Member Data Documentation

unsigned long long CSCDCCHeader::word[2]
private