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 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 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:27
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:32
CSCDDUHeader::CSCDDUHeader ( unsigned  bx,
unsigned  l1num,
unsigned  sourceId,
unsigned  fmt_version = 0x6 
)

Definition at line 12 of file CSCDDUHeader.cc.

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

13  : format_version_(fmt_version&0xF)
15  , bxnum_(bx)
16  , lvl1num_(l1num)
17 {
18  bzero(this, sizeInWords()*2);
20  bxnum_ = bx;
21  lvl1num_ = l1num;
22  format_version_ = fmt_version & 0xF;
23  init();
24 }
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:27
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:32
unsigned bxnum_
Definition: CSCDDUHeader.h:57
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:32

Member Function Documentation

int CSCDDUHeader::bxnum ( ) const
inline

Definition at line 24 of file CSCDDUHeader.h.

References bxnum_.

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

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

Definition at line 54 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

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

55 {
56  //std::cout <<"SANDRIK"<<std::hex <<header2_1_<<" "<<header2_2_ <<" "<<header2_3_<<std::endl;
57  return bit64_ == 5 && header2_1_ == 0x8000 && header2_3_ == 0x8000
58  && header2_2_ == 0x0001;
59 }
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
unsigned short* CSCDDUHeader::data ( )
inline

Definition at line 45 of file CSCDDUHeader.h.

References check().

Referenced by CSCDDUEventData::pack().

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

Definition at line 28 of file CSCDDUHeader.h.

References dmb_dav_.

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

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

Definition at line 29 of file CSCDDUHeader.h.

References dmb_full_.

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

Definition at line 26 of file CSCDDUHeader.h.

References event_type_.

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

initializes constants

Definition at line 27 of file CSCDDUHeader.cc.

References bit64_, header2_1_, header2_2_, and header2_3_.

Referenced by CSCDDUHeader().

28 {
29  bit64_ = 5;
30  header2_2_ = 0x0001;
31  header2_1_ = header2_3_ = 0x8000;
32 }
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
int CSCDDUHeader::live_cscs ( ) const
inline

Definition at line 30 of file CSCDDUHeader.h.

References live_cscs_.

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

30 {return live_cscs_;}
unsigned live_cscs_
Definition: CSCDDUHeader.h:76
int CSCDDUHeader::lvl1num ( ) const
inline

Definition at line 25 of file CSCDDUHeader.h.

References lvl1num_.

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

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

Definition at line 27 of file CSCDDUHeader.h.

References ncsc_.

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

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

Definition at line 31 of file CSCDDUHeader.h.

References output_path_.

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

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

Definition at line 21 of file CSCDDUHeader.h.

References s_link_status_.

21 { return s_link_status_;}
unsigned s_link_status_
Definition: CSCDDUHeader.h:54
void CSCDDUHeader::setBOEStatus ( unsigned  status)
inline

Definition at line 42 of file CSCDDUHeader.h.

References boe_status_.

42 {boe_status_ = status & 0x7F;}
unsigned boe_status_
Definition: CSCDDUHeader.h:73
void CSCDDUHeader::setBXN ( unsigned  bxn)
inline

Definition at line 38 of file CSCDDUHeader.h.

References bxnum_.

38 {bxnum_ = bxn & 0xFFF;}
unsigned bxnum_
Definition: CSCDDUHeader.h:57
void CSCDDUHeader::setDMBDAV ( int  dduInput)

Definition at line 35 of file CSCDDUHeader.cc.

References dmb_dav_, live_cscs_, and ncsc_.

Referenced by CSCDDUEventData::add(), and sizeInWords().

36 {
37  // Set appropriate bit in dmb_dav_
38 
39  dmb_dav_ |= ((1 << dduInput) & 0x7FFF); // dduInput is 0-14
40 
41  live_cscs_ |= ((1 << dduInput) & 0x7FFF); // Set DDU Inputs Connected to "Live" CSCs
42 
43  // Count bits set in dmb_dav_... for the trick used see
44  // http://en.wikipedia.org/wiki/Hamming_weight or http://graphics.stanford.edu/~seander/bithacks.html
45 
46  ncsc_ = 0;
47  unsigned short dmbdav = dmb_dav_;
48  for( ; dmbdav; ++ncsc_ )
49  {
50  dmbdav &= dmbdav - 1;
51  }
52 }
unsigned dmb_dav_
Definition: CSCDDUHeader.h:74
unsigned ncsc_
Definition: CSCDDUHeader.h:71
unsigned live_cscs_
Definition: CSCDDUHeader.h:76
void CSCDDUHeader::setEventType ( unsigned  evt_type)
inline

Definition at line 40 of file CSCDDUHeader.h.

References event_type_.

40 {event_type_ = evt_type & 0xF;}
unsigned event_type_
Definition: CSCDDUHeader.h:60
void CSCDDUHeader::setFormatVersion ( unsigned  version)
inline

Definition at line 37 of file CSCDDUHeader.h.

References format_version_.

void CSCDDUHeader::setL1A ( unsigned  l1a)
inline

Definition at line 39 of file CSCDDUHeader.h.

References lvl1num_.

39 {lvl1num_ = l1a & 0xFFFFFF;}
unsigned lvl1num_
Definition: CSCDDUHeader.h:59
void CSCDDUHeader::setOutputPathStatus ( unsigned  status)
inline

Definition at line 43 of file CSCDDUHeader.h.

References output_path_.

43 {output_path_ = status & 0xFF;}
unsigned output_path_
Definition: CSCDDUHeader.h:75
void CSCDDUHeader::setSourceId ( unsigned  sourceId)
inline

Definition at line 36 of file CSCDDUHeader.h.

References source_id_, and objects.autophobj::sourceId.

void CSCDDUHeader::setTTSStatus ( unsigned  status)
inline

Definition at line 41 of file CSCDDUHeader.h.

References tts_status_.

41 {tts_status_ = status & 0xF;}
unsigned tts_status_
Definition: CSCDDUHeader.h:72
static unsigned CSCDDUHeader::sizeInWords ( )
inlinestatic

Definition at line 32 of file CSCDDUHeader.h.

References setDMBDAV().

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

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

Definition at line 23 of file CSCDDUHeader.h.

References source_id_.

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

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

Friends And Related Function Documentation

friend class CSCDDUEventData
friend

Definition at line 49 of file CSCDDUHeader.h.

Member Data Documentation

unsigned CSCDDUHeader::bit64_
private

should always be 5

Definition at line 62 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::boe_status_
private

Definition at line 73 of file CSCDDUHeader.h.

Referenced by setBOEStatus().

unsigned CSCDDUHeader::bxnum_
private

Definition at line 57 of file CSCDDUHeader.h.

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

unsigned CSCDDUHeader::dmb_dav_
private

Definition at line 74 of file CSCDDUHeader.h.

Referenced by dmb_dav(), and setDMBDAV().

unsigned CSCDDUHeader::dmb_full_
private

should be 8000/0001/8000

Definition at line 65 of file CSCDDUHeader.h.

Referenced by dmb_full().

unsigned CSCDDUHeader::event_type_
private

Definition at line 60 of file CSCDDUHeader.h.

Referenced by event_type(), and setEventType().

unsigned CSCDDUHeader::format_version_
private

Definition at line 55 of file CSCDDUHeader.h.

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

unsigned CSCDDUHeader::header2_1_
private

Definition at line 66 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::header2_2_
private

Definition at line 67 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::header2_3_
private

Definition at line 68 of file CSCDDUHeader.h.

Referenced by check(), and init().

unsigned CSCDDUHeader::live_cscs_
private

Definition at line 76 of file CSCDDUHeader.h.

Referenced by live_cscs(), and setDMBDAV().

unsigned CSCDDUHeader::lvl1num_
private

Definition at line 59 of file CSCDDUHeader.h.

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

unsigned CSCDDUHeader::ncsc_
private

Definition at line 71 of file CSCDDUHeader.h.

Referenced by ncsc(), and setDMBDAV().

unsigned CSCDDUHeader::output_path_
private

Definition at line 75 of file CSCDDUHeader.h.

Referenced by output_path_status(), and setOutputPathStatus().

unsigned CSCDDUHeader::s_link_status_
private

Definition at line 54 of file CSCDDUHeader.h.

Referenced by s_link_status().

unsigned CSCDDUHeader::source_id_
private

Definition at line 56 of file CSCDDUHeader.h.

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

unsigned CSCDDUHeader::tts_status_
private

Definition at line 72 of file CSCDDUHeader.h.

Referenced by setTTSStatus().