CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 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 setDMBDAV (int dduInput)
 
void setSourceId (unsigned sourceId)
 
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 10 of file CSCDDUHeader.h.

Constructor & Destructor Documentation

CSCDDUHeader::CSCDDUHeader ( )

Definition at line 5 of file CSCDDUHeader.cc.

References init(), and sizeInWords().

6 {
7  bzero(this, sizeInWords()*2);
8  init();
9 }
void init()
initializes constants
Definition: CSCDDUHeader.cc:23
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31
CSCDDUHeader::CSCDDUHeader ( unsigned  bx,
unsigned  l1num,
unsigned  sourceId 
)

Definition at line 12 of file CSCDDUHeader.cc.

References bxnum_, init(), lvl1num_, sizeInWords(), and source_id_.

13  : source_id_(sourceId), bxnum_(bx), lvl1num_(l1num)
14 {
15  bzero(this, sizeInWords()*2);
16  source_id_ = sourceId;
17  bxnum_ = bx;
18  lvl1num_ = l1num;
19  init();
20 }
unsigned source_id_
Definition: CSCDDUHeader.h:44
unsigned lvl1num_
Definition: CSCDDUHeader.h:47
void init()
initializes constants
Definition: CSCDDUHeader.cc:23
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31
unsigned bxnum_
Definition: CSCDDUHeader.h:45
CSCDDUHeader::CSCDDUHeader ( const CSCDDUStatusDigi digi)
inline

Definition at line 15 of file CSCDDUHeader.h.

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

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

Member Function Documentation

int CSCDDUHeader::bxnum ( ) const
inline

Definition at line 22 of file CSCDDUHeader.h.

References bxnum_.

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

22 { return bxnum_;}
unsigned bxnum_
Definition: CSCDDUHeader.h:45
bool CSCDDUHeader::check ( ) const

Definition at line 48 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

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

49 {
50  //std::cout <<"SANDRIK"<<std::hex <<header2_1_<<" "<<header2_2_ <<" "<<header2_3_<<std::endl;
51  return bit64_ == 5 && header2_1_ == 0x8000 && header2_3_ == 0x8000
52  && header2_2_ == 0x0001;
53 }
unsigned header2_3_
Definition: CSCDDUHeader.h:56
unsigned header2_2_
Definition: CSCDDUHeader.h:55
unsigned header2_1_
Definition: CSCDDUHeader.h:54
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:50
unsigned short* CSCDDUHeader::data ( )
inline

Definition at line 33 of file CSCDDUHeader.h.

Referenced by CSCDDUEventData::pack().

33 {return (unsigned short *) this;}
int CSCDDUHeader::dmb_dav ( ) const
inline

Definition at line 26 of file CSCDDUHeader.h.

References dmb_dav_.

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

26 { return dmb_dav_;}
unsigned dmb_dav_
Definition: CSCDDUHeader.h:62
int CSCDDUHeader::dmb_full ( ) const
inline

Definition at line 27 of file CSCDDUHeader.h.

References dmb_full_.

27 { return dmb_full_;}
unsigned dmb_full_
should be 8000/0001/8000
Definition: CSCDDUHeader.h:53
int CSCDDUHeader::event_type ( ) const
inline

Definition at line 24 of file CSCDDUHeader.h.

References event_type_.

24 { return event_type_;}
unsigned event_type_
Definition: CSCDDUHeader.h:48
int CSCDDUHeader::format_version ( ) const
inline
void CSCDDUHeader::init ( void  )
private

initializes constants

Definition at line 23 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

Referenced by CSCDDUHeader().

24 {
25  bit64_ = 5;
26  header2_2_ = 0x0001;
27  header2_1_ = header2_3_ = 0x8000;
28 }
unsigned header2_3_
Definition: CSCDDUHeader.h:56
unsigned header2_2_
Definition: CSCDDUHeader.h:55
unsigned header2_1_
Definition: CSCDDUHeader.h:54
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:50
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:64
int CSCDDUHeader::lvl1num ( ) const
inline

Definition at line 23 of file CSCDDUHeader.h.

References lvl1num_.

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

23 { return lvl1num_;}
unsigned lvl1num_
Definition: CSCDDUHeader.h:47
int CSCDDUHeader::ncsc ( ) const
inline

Definition at line 25 of file CSCDDUHeader.h.

References ncsc_.

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

25 { return ncsc_;}
unsigned ncsc_
Definition: CSCDDUHeader.h:59
int CSCDDUHeader::output_path_status ( ) const
inline

Definition at line 30 of file CSCDDUHeader.h.

References output_path_.

30 {return output_path_;}
unsigned output_path_
Definition: CSCDDUHeader.h:63
int CSCDDUHeader::s_link_status ( ) const
inline

Definition at line 19 of file CSCDDUHeader.h.

References s_link_status_.

19 { return s_link_status_;}
unsigned s_link_status_
Definition: CSCDDUHeader.h:42
void CSCDDUHeader::setDMBDAV ( int  dduInput)

Definition at line 31 of file CSCDDUHeader.cc.

References dmb_dav_, and ncsc_.

Referenced by CSCDDUEventData::add().

32 {
33  // Set appropriate bit in dmb_dav_
34 
35  dmb_dav_ |= (1 << dduInput); // dduInput is 0-14
36 
37  // Count bits set in dmb_dav_... for the trick used see
38  // http://en.wikipedia.org/wiki/Hamming_weight or http://graphics.stanford.edu/~seander/bithacks.html
39 
40  ncsc_ = 0;
41  unsigned short dmbdav = dmb_dav_;
42  for( ; dmbdav; ++ncsc_ )
43  {
44  dmbdav &= dmbdav - 1;
45  }
46 }
unsigned dmb_dav_
Definition: CSCDDUHeader.h:62
unsigned ncsc_
Definition: CSCDDUHeader.h:59
void CSCDDUHeader::setSourceId ( unsigned  sourceId)
inline

Definition at line 32 of file CSCDDUHeader.h.

References source_id_.

32 {source_id_ = sourceId;}
unsigned source_id_
Definition: CSCDDUHeader.h:44
static unsigned CSCDDUHeader::sizeInWords ( )
inlinestatic

Definition at line 31 of file CSCDDUHeader.h.

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

31 {return 12;}
int CSCDDUHeader::source_id ( ) const
inline

Definition at line 21 of file CSCDDUHeader.h.

References source_id_.

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

21 { return source_id_;}
unsigned source_id_
Definition: CSCDDUHeader.h:44

Friends And Related Function Documentation

friend class CSCDDUEventData
friend

Definition at line 37 of file CSCDDUHeader.h.

Member Data Documentation

unsigned CSCDDUHeader::bit64_
private

should always be 5

Definition at line 50 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::boe_status_
private

Definition at line 61 of file CSCDDUHeader.h.

unsigned CSCDDUHeader::bxnum_
private

Definition at line 45 of file CSCDDUHeader.h.

Referenced by bxnum(), and CSCDDUHeader().

unsigned CSCDDUHeader::dmb_dav_
private

Definition at line 62 of file CSCDDUHeader.h.

Referenced by dmb_dav(), and setDMBDAV().

unsigned CSCDDUHeader::dmb_full_
private

should be 8000/0001/8000

Definition at line 53 of file CSCDDUHeader.h.

Referenced by dmb_full().

unsigned CSCDDUHeader::event_type_
private

Definition at line 48 of file CSCDDUHeader.h.

Referenced by event_type().

unsigned CSCDDUHeader::format_version_
private

Definition at line 43 of file CSCDDUHeader.h.

Referenced by format_version().

unsigned CSCDDUHeader::header2_1_
private

Definition at line 54 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::header2_2_
private

Definition at line 55 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::header2_3_
private

Definition at line 56 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::live_cscs_
private

Definition at line 64 of file CSCDDUHeader.h.

Referenced by live_cscs().

unsigned CSCDDUHeader::lvl1num_
private

Definition at line 47 of file CSCDDUHeader.h.

Referenced by CSCDDUHeader(), and lvl1num().

unsigned CSCDDUHeader::ncsc_
private

Definition at line 59 of file CSCDDUHeader.h.

Referenced by ncsc(), and setDMBDAV().

unsigned CSCDDUHeader::output_path_
private

Definition at line 63 of file CSCDDUHeader.h.

Referenced by output_path_status().

unsigned CSCDDUHeader::s_link_status_
private

Definition at line 42 of file CSCDDUHeader.h.

Referenced by s_link_status().

unsigned CSCDDUHeader::source_id_
private

Definition at line 44 of file CSCDDUHeader.h.

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

unsigned CSCDDUHeader::tts_status_
private

Definition at line 60 of file CSCDDUHeader.h.