CMS 3D CMS Logo

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

#include <CSCDDUHeader.h>

Public Member Functions

int bxnum () const
 
bool check () const
 
 CSCDDUHeader ()
 
 CSCDDUHeader (unsigned bx, unsigned l1num, unsigned sourceId, unsigned fmt_version=0x6)
 
 CSCDDUHeader (const CSCDDUStatusDigi &digi)
 
unsigned short * data ()
 
int dmb_dav () const
 
int dmb_full () const
 
int event_type () const
 
int format_version () const
 
int live_cscs () const
 
int lvl1num () const
 
int ncsc () const
 
int output_path_status () const
 
int s_link_status () const
 
void setBOEStatus (unsigned status)
 
void setBXN (unsigned bxn)
 
void setDMBDAV (int dduInput)
 
void setEventType (unsigned evt_type)
 
void setFormatVersion (unsigned version)
 
void setFromBuffer (uint16_t const *buf)
 
void setL1A (unsigned l1a)
 
void setOutputPathStatus (unsigned status)
 
void setSourceId (unsigned sourceId)
 
void setTTSStatus (unsigned status)
 
int source_id () const
 

Static Public Member Functions

static unsigned sizeInWords ()
 

Private Member Functions

void init ()
 initializes constants More...
 

Private Attributes

unsigned bit64_: 4
 should always be 5 More...
 
unsigned boe_status_: 8
 
unsigned bxnum_: 12
 
unsigned dmb_dav_: 16
 
unsigned dmb_full_: 16
 should be 8000/0001/8000 More...
 
unsigned event_type_: 4
 
unsigned format_version_: 4
 
unsigned header2_1_: 16
 
unsigned header2_2_: 16
 
unsigned header2_3_: 16
 
unsigned live_cscs_: 16
 
unsigned lvl1num_: 24
 
unsigned ncsc_: 4
 
unsigned output_path_: 16
 
unsigned s_link_status_: 4
 
unsigned source_id_: 12
 
unsigned tts_status_: 4
 

Friends

class CSCDDUEventData
 

Detailed Description

Definition at line 11 of file CSCDDUHeader.h.

Constructor & Destructor Documentation

◆ CSCDDUHeader() [1/3]

CSCDDUHeader::CSCDDUHeader ( )

Definition at line 5 of file CSCDDUHeader.cc.

References init(), and sizeInWords().

5  {
6  bzero(this, sizeInWords() * 2);
7  init();
8 }
void init()
initializes constants
Definition: CSCDDUHeader.cc:20
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31

◆ CSCDDUHeader() [2/3]

CSCDDUHeader::CSCDDUHeader ( unsigned  bx,
unsigned  l1num,
unsigned  sourceId,
unsigned  fmt_version = 0x6 
)

Definition at line 10 of file CSCDDUHeader.cc.

References simKBmtfDigis_cfi::bx, bxnum_, format_version_, init(), lvl1num_, sizeInWords(), source_id_, and objects.autophobj::sourceId.

11  : format_version_(fmt_version & 0xF), source_id_(sourceId), bxnum_(bx), lvl1num_(l1num) {
12  bzero(this, sizeInWords() * 2);
14  bxnum_ = bx;
15  lvl1num_ = l1num;
16  format_version_ = fmt_version & 0xF;
17  init();
18 }
unsigned source_id_
Definition: CSCDDUHeader.h:56
unsigned lvl1num_
Definition: CSCDDUHeader.h:59
unsigned format_version_
Definition: CSCDDUHeader.h:55
void init()
initializes constants
Definition: CSCDDUHeader.cc:20
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31
unsigned bxnum_
Definition: CSCDDUHeader.h:57

◆ CSCDDUHeader() [3/3]

CSCDDUHeader::CSCDDUHeader ( const CSCDDUStatusDigi digi)
inline

Definition at line 15 of file CSCDDUHeader.h.

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

15 { memcpy(this, digi.header(), sizeInWords() * 2); }
const uint16_t * header() const
Data Accessors.
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31

Member Function Documentation

◆ bxnum()

int CSCDDUHeader::bxnum ( ) const
inline

Definition at line 23 of file CSCDDUHeader.h.

References bxnum_.

Referenced by CSCDDUEventData::add(), and cscdqm::EventProcessor::processDDU().

23 { return bxnum_; }
unsigned bxnum_
Definition: CSCDDUHeader.h:57

◆ check()

bool CSCDDUHeader::check ( ) const

Definition at line 43 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

Referenced by CSCDDUEventData::check(), and CSCDDUDataItr::CSCDDUDataItr().

43  {
44  //std::cout <<"SANDRIK"<<std::hex <<header2_1_<<" "<<header2_2_ <<" "<<header2_3_<<std::endl;
45  return bit64_ == 5 && header2_1_ == 0x8000 && header2_3_ == 0x8000 && header2_2_ == 0x0001;
46 }
unsigned header2_3_
Definition: CSCDDUHeader.h:68
unsigned header2_2_
Definition: CSCDDUHeader.h:67
unsigned header2_1_
Definition: CSCDDUHeader.h:66
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:62

◆ data()

unsigned short* CSCDDUHeader::data ( )
inline

Definition at line 44 of file CSCDDUHeader.h.

Referenced by CSCDDUEventData::pack().

44 { return (unsigned short*)this; }

◆ dmb_dav()

int CSCDDUHeader::dmb_dav ( ) const
inline

Definition at line 27 of file CSCDDUHeader.h.

References dmb_dav_.

Referenced by cscdqm::EventProcessor::processDDU().

27 { return dmb_dav_; }
unsigned dmb_dav_
Definition: CSCDDUHeader.h:73

◆ dmb_full()

int CSCDDUHeader::dmb_full ( ) const
inline

Definition at line 28 of file CSCDDUHeader.h.

References dmb_full_.

28 { return dmb_full_; }
unsigned dmb_full_
should be 8000/0001/8000
Definition: CSCDDUHeader.h:65

◆ event_type()

int CSCDDUHeader::event_type ( ) const
inline

Definition at line 25 of file CSCDDUHeader.h.

References event_type_.

25 { return event_type_; }
unsigned event_type_
Definition: CSCDDUHeader.h:60

◆ format_version()

int CSCDDUHeader::format_version ( ) const
inline

Definition at line 21 of file CSCDDUHeader.h.

References format_version_.

Referenced by CSCDDUEventData::unpack_data().

21 { return format_version_; }
unsigned format_version_
Definition: CSCDDUHeader.h:55

◆ init()

void CSCDDUHeader::init ( void  )
private

initializes constants

Definition at line 20 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

Referenced by CSCDDUHeader().

20  {
21  bit64_ = 5;
22  header2_2_ = 0x0001;
23  header2_1_ = header2_3_ = 0x8000;
24 }
unsigned header2_3_
Definition: CSCDDUHeader.h:68
unsigned header2_2_
Definition: CSCDDUHeader.h:67
unsigned header2_1_
Definition: CSCDDUHeader.h:66
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:62

◆ live_cscs()

int CSCDDUHeader::live_cscs ( ) const
inline

Definition at line 29 of file CSCDDUHeader.h.

References live_cscs_.

Referenced by cscdqm::EventProcessor::processDDU().

29 { return live_cscs_; }
unsigned live_cscs_
Definition: CSCDDUHeader.h:75

◆ lvl1num()

int CSCDDUHeader::lvl1num ( ) const
inline

Definition at line 24 of file CSCDDUHeader.h.

References lvl1num_.

Referenced by CSCDDUEventData::add(), and cscdqm::EventProcessor::processDDU().

24 { return lvl1num_; }
unsigned lvl1num_
Definition: CSCDDUHeader.h:59

◆ ncsc()

int CSCDDUHeader::ncsc ( ) const
inline

Definition at line 26 of file CSCDDUHeader.h.

References ncsc_.

Referenced by cscdqm::EventProcessor::processDDU(), and CSCDDUEventData::unpack_data().

26 { return ncsc_; }
unsigned ncsc_
Definition: CSCDDUHeader.h:70

◆ output_path_status()

int CSCDDUHeader::output_path_status ( ) const
inline

Definition at line 30 of file CSCDDUHeader.h.

References output_path_.

Referenced by cscdqm::EventProcessor::processDDU().

30 { return output_path_; }
unsigned output_path_
Definition: CSCDDUHeader.h:74

◆ s_link_status()

int CSCDDUHeader::s_link_status ( ) const
inline

Definition at line 20 of file CSCDDUHeader.h.

References s_link_status_.

20 { return s_link_status_; }
unsigned s_link_status_
Definition: CSCDDUHeader.h:54

◆ setBOEStatus()

void CSCDDUHeader::setBOEStatus ( unsigned  status)
inline

Definition at line 41 of file CSCDDUHeader.h.

References boe_status_, and mps_update::status.

41 { boe_status_ = status & 0x7F; }
unsigned boe_status_
Definition: CSCDDUHeader.h:72

◆ setBXN()

void CSCDDUHeader::setBXN ( unsigned  bxn)
inline

Definition at line 37 of file CSCDDUHeader.h.

References bxnum_.

37 { bxnum_ = bxn & 0xFFF; }
unsigned bxnum_
Definition: CSCDDUHeader.h:57

◆ setDMBDAV()

void CSCDDUHeader::setDMBDAV ( int  dduInput)

Definition at line 26 of file CSCDDUHeader.cc.

References dmb_dav_, live_cscs_, and ncsc_.

Referenced by CSCDDUEventData::add().

26  {
27  // Set appropriate bit in dmb_dav_
28 
29  dmb_dav_ |= ((1 << dduInput) & 0x7FFF); // dduInput is 0-14
30 
31  live_cscs_ |= ((1 << dduInput) & 0x7FFF); // Set DDU Inputs Connected to "Live" CSCs
32 
33  // Count bits set in dmb_dav_... for the trick used see
34  // http://en.wikipedia.org/wiki/Hamming_weight or http://graphics.stanford.edu/~seander/bithacks.html
35 
36  ncsc_ = 0;
37  unsigned short dmbdav = dmb_dav_;
38  for (; dmbdav; ++ncsc_) {
39  dmbdav &= dmbdav - 1;
40  }
41 }
unsigned dmb_dav_
Definition: CSCDDUHeader.h:73
unsigned ncsc_
Definition: CSCDDUHeader.h:70
unsigned live_cscs_
Definition: CSCDDUHeader.h:75

◆ setEventType()

void CSCDDUHeader::setEventType ( unsigned  evt_type)
inline

Definition at line 39 of file CSCDDUHeader.h.

References event_type_.

39 { event_type_ = evt_type & 0xF; }
unsigned event_type_
Definition: CSCDDUHeader.h:60

◆ setFormatVersion()

void CSCDDUHeader::setFormatVersion ( unsigned  version)
inline

Definition at line 36 of file CSCDDUHeader.h.

References format_version_, and BeamSplash_cfg::version.

36 { format_version_ = version & 0xF; }
unsigned format_version_
Definition: CSCDDUHeader.h:55

◆ setFromBuffer()

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

Definition at line 17 of file CSCDDUHeader.h.

References visDQMUpload::buf, and sizeInWords().

Referenced by CSCDDUEventData::unpack_data().

17 { memcpy(this, buf, sizeInWords() * 2); }
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31

◆ setL1A()

void CSCDDUHeader::setL1A ( unsigned  l1a)
inline

Definition at line 38 of file CSCDDUHeader.h.

References lvl1num_.

38 { lvl1num_ = l1a & 0xFFFFFF; }
unsigned lvl1num_
Definition: CSCDDUHeader.h:59

◆ setOutputPathStatus()

void CSCDDUHeader::setOutputPathStatus ( unsigned  status)
inline

Definition at line 42 of file CSCDDUHeader.h.

References output_path_, and mps_update::status.

42 { output_path_ = status & 0xFF; }
unsigned output_path_
Definition: CSCDDUHeader.h:74

◆ setSourceId()

void CSCDDUHeader::setSourceId ( unsigned  sourceId)
inline

Definition at line 35 of file CSCDDUHeader.h.

References source_id_, and objects.autophobj::sourceId.

◆ setTTSStatus()

void CSCDDUHeader::setTTSStatus ( unsigned  status)
inline

Definition at line 40 of file CSCDDUHeader.h.

References mps_update::status, and tts_status_.

40 { tts_status_ = status & 0xF; }
unsigned tts_status_
Definition: CSCDDUHeader.h:71

◆ sizeInWords()

static unsigned CSCDDUHeader::sizeInWords ( )
inlinestatic

Definition at line 31 of file CSCDDUHeader.h.

Referenced by CSCDDUHeader(), CSCDDUEventData::pack(), setFromBuffer(), and CSCDDUEventData::unpack_data().

31 { return 12; }

◆ source_id()

int CSCDDUHeader::source_id ( ) const
inline

Definition at line 22 of file CSCDDUHeader.h.

References source_id_.

Referenced by cscdqm::EventProcessor::processDDU(), and CSCDDUEventData::unpack_data().

22 { return source_id_; }
unsigned source_id_
Definition: CSCDDUHeader.h:56

Friends And Related Function Documentation

◆ CSCDDUEventData

friend class CSCDDUEventData
friend

Definition at line 48 of file CSCDDUHeader.h.

Member Data Documentation

◆ bit64_

unsigned CSCDDUHeader::bit64_
private

should always be 5

Definition at line 62 of file CSCDDUHeader.h.

Referenced by check(), and init().

◆ boe_status_

unsigned CSCDDUHeader::boe_status_
private

Definition at line 72 of file CSCDDUHeader.h.

Referenced by setBOEStatus().

◆ bxnum_

unsigned CSCDDUHeader::bxnum_
private

Definition at line 57 of file CSCDDUHeader.h.

Referenced by bxnum(), CSCDDUHeader(), and setBXN().

◆ dmb_dav_

unsigned CSCDDUHeader::dmb_dav_
private

Definition at line 73 of file CSCDDUHeader.h.

Referenced by dmb_dav(), and setDMBDAV().

◆ dmb_full_

unsigned CSCDDUHeader::dmb_full_
private

should be 8000/0001/8000

Definition at line 65 of file CSCDDUHeader.h.

Referenced by dmb_full().

◆ event_type_

unsigned CSCDDUHeader::event_type_
private

Definition at line 60 of file CSCDDUHeader.h.

Referenced by event_type(), and setEventType().

◆ format_version_

unsigned CSCDDUHeader::format_version_
private

Definition at line 55 of file CSCDDUHeader.h.

Referenced by CSCDDUHeader(), format_version(), and setFormatVersion().

◆ header2_1_

unsigned CSCDDUHeader::header2_1_
private

Definition at line 66 of file CSCDDUHeader.h.

Referenced by check(), and init().

◆ header2_2_

unsigned CSCDDUHeader::header2_2_
private

Definition at line 67 of file CSCDDUHeader.h.

Referenced by check(), and init().

◆ header2_3_

unsigned CSCDDUHeader::header2_3_
private

Definition at line 68 of file CSCDDUHeader.h.

Referenced by check(), and init().

◆ live_cscs_

unsigned CSCDDUHeader::live_cscs_
private

Definition at line 75 of file CSCDDUHeader.h.

Referenced by live_cscs(), and setDMBDAV().

◆ lvl1num_

unsigned CSCDDUHeader::lvl1num_
private

Definition at line 59 of file CSCDDUHeader.h.

Referenced by CSCDDUHeader(), lvl1num(), and setL1A().

◆ ncsc_

unsigned CSCDDUHeader::ncsc_
private

Definition at line 70 of file CSCDDUHeader.h.

Referenced by ncsc(), and setDMBDAV().

◆ output_path_

unsigned CSCDDUHeader::output_path_
private

Definition at line 74 of file CSCDDUHeader.h.

Referenced by output_path_status(), and setOutputPathStatus().

◆ s_link_status_

unsigned CSCDDUHeader::s_link_status_
private

Definition at line 54 of file CSCDDUHeader.h.

Referenced by s_link_status().

◆ source_id_

unsigned CSCDDUHeader::source_id_
private

Definition at line 56 of file CSCDDUHeader.h.

Referenced by CSCDDUHeader(), setSourceId(), and source_id().

◆ tts_status_

unsigned CSCDDUHeader::tts_status_
private

Definition at line 71 of file CSCDDUHeader.h.

Referenced by setTTSStatus().