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 (const CSCDDUStatusDigi &digi)
 
 CSCDDUHeader (unsigned bx, unsigned l1num, unsigned sourceId, unsigned fmt_version=0x6)
 
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.

5  {
6  bzero(this, sizeInWords() * 2);
7  init();
8 }

References init(), and sizeInWords().

◆ CSCDDUHeader() [2/3]

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

Definition at line 10 of file CSCDDUHeader.cc.

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 }

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

◆ CSCDDUHeader() [3/3]

CSCDDUHeader::CSCDDUHeader ( const CSCDDUStatusDigi digi)
inline

Definition at line 15 of file CSCDDUHeader.h.

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

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

Member Function Documentation

◆ bxnum()

int CSCDDUHeader::bxnum ( ) const
inline

Definition at line 23 of file CSCDDUHeader.h.

23 { return bxnum_; }

References bxnum_.

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

◆ check()

bool CSCDDUHeader::check ( ) const

Definition at line 43 of file CSCDDUHeader.cc.

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 }

References bit64_, header2_1_, header2_2_, and header2_3_.

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

◆ data()

unsigned short* CSCDDUHeader::data ( )
inline

Definition at line 44 of file CSCDDUHeader.h.

44 { return (unsigned short*)this; }

Referenced by CSCDDUEventData::pack().

◆ dmb_dav()

int CSCDDUHeader::dmb_dav ( ) const
inline

Definition at line 27 of file CSCDDUHeader.h.

27 { return dmb_dav_; }

References dmb_dav_.

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

◆ dmb_full()

int CSCDDUHeader::dmb_full ( ) const
inline

Definition at line 28 of file CSCDDUHeader.h.

28 { return dmb_full_; }

References dmb_full_.

◆ event_type()

int CSCDDUHeader::event_type ( ) const
inline

Definition at line 25 of file CSCDDUHeader.h.

25 { return event_type_; }

References event_type_.

◆ format_version()

int CSCDDUHeader::format_version ( ) const
inline

Definition at line 21 of file CSCDDUHeader.h.

21 { return format_version_; }

References format_version_.

Referenced by CSCDDUEventData::unpack_data().

◆ init()

void CSCDDUHeader::init ( void  )
private

initializes constants

Definition at line 20 of file CSCDDUHeader.cc.

20  {
21  bit64_ = 5;
22  header2_2_ = 0x0001;
23  header2_1_ = header2_3_ = 0x8000;
24 }

References bit64_, header2_1_, header2_2_, and header2_3_.

Referenced by CSCDDUHeader().

◆ live_cscs()

int CSCDDUHeader::live_cscs ( ) const
inline

Definition at line 29 of file CSCDDUHeader.h.

29 { return live_cscs_; }

References live_cscs_.

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

◆ lvl1num()

int CSCDDUHeader::lvl1num ( ) const
inline

Definition at line 24 of file CSCDDUHeader.h.

24 { return lvl1num_; }

References lvl1num_.

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

◆ ncsc()

int CSCDDUHeader::ncsc ( ) const
inline

Definition at line 26 of file CSCDDUHeader.h.

26 { return ncsc_; }

References ncsc_.

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

◆ output_path_status()

int CSCDDUHeader::output_path_status ( ) const
inline

Definition at line 30 of file CSCDDUHeader.h.

30 { return output_path_; }

References output_path_.

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

◆ s_link_status()

int CSCDDUHeader::s_link_status ( ) const
inline

Definition at line 20 of file CSCDDUHeader.h.

20 { return s_link_status_; }

References s_link_status_.

◆ setBOEStatus()

void CSCDDUHeader::setBOEStatus ( unsigned  status)
inline

Definition at line 41 of file CSCDDUHeader.h.

41 { boe_status_ = status & 0x7F; }

References boe_status_, and mps_update::status.

◆ setBXN()

void CSCDDUHeader::setBXN ( unsigned  bxn)
inline

Definition at line 37 of file CSCDDUHeader.h.

37 { bxnum_ = bxn & 0xFFF; }

References bxnum_.

◆ setDMBDAV()

void CSCDDUHeader::setDMBDAV ( int  dduInput)

Definition at line 26 of file CSCDDUHeader.cc.

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 }

References dmb_dav_, live_cscs_, and ncsc_.

Referenced by CSCDDUEventData::add().

◆ setEventType()

void CSCDDUHeader::setEventType ( unsigned  evt_type)
inline

Definition at line 39 of file CSCDDUHeader.h.

39 { event_type_ = evt_type & 0xF; }

References event_type_.

◆ setFormatVersion()

void CSCDDUHeader::setFormatVersion ( unsigned  version)
inline

Definition at line 36 of file CSCDDUHeader.h.

36 { format_version_ = version & 0xF; }

References format_version_, and BeamSplash_cfg::version.

◆ setFromBuffer()

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

Definition at line 17 of file CSCDDUHeader.h.

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

References visDQMUpload::buf, and sizeInWords().

Referenced by CSCDDUEventData::unpack_data().

◆ setL1A()

void CSCDDUHeader::setL1A ( unsigned  l1a)
inline

Definition at line 38 of file CSCDDUHeader.h.

38 { lvl1num_ = l1a & 0xFFFFFF; }

References lvl1num_.

◆ setOutputPathStatus()

void CSCDDUHeader::setOutputPathStatus ( unsigned  status)
inline

Definition at line 42 of file CSCDDUHeader.h.

42 { output_path_ = status & 0xFF; }

References output_path_, and mps_update::status.

◆ setSourceId()

void CSCDDUHeader::setSourceId ( unsigned  sourceId)
inline

Definition at line 35 of file CSCDDUHeader.h.

35 { source_id_ = sourceId; }

References source_id_, and objects.autophobj::sourceId.

◆ setTTSStatus()

void CSCDDUHeader::setTTSStatus ( unsigned  status)
inline

Definition at line 40 of file CSCDDUHeader.h.

40 { tts_status_ = status & 0xF; }

References mps_update::status, and tts_status_.

◆ sizeInWords()

static unsigned CSCDDUHeader::sizeInWords ( )
inlinestatic

Definition at line 31 of file CSCDDUHeader.h.

31 { return 12; }

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

◆ source_id()

int CSCDDUHeader::source_id ( ) const
inline

Definition at line 22 of file CSCDDUHeader.h.

22 { return source_id_; }

References source_id_.

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

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().

CSCDDUHeader::lvl1num_
unsigned lvl1num_
Definition: CSCDDUHeader.h:59
CSCDDUHeader::bxnum_
unsigned bxnum_
Definition: CSCDDUHeader.h:57
mps_update.status
status
Definition: mps_update.py:69
CSCDDUHeader::header2_2_
unsigned header2_2_
Definition: CSCDDUHeader.h:67
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCDDUHeader::dmb_full_
unsigned dmb_full_
should be 8000/0001/8000
Definition: CSCDDUHeader.h:65
CSCDDUHeader::init
void init()
initializes constants
Definition: CSCDDUHeader.cc:20
CSCDDUHeader::event_type_
unsigned event_type_
Definition: CSCDDUHeader.h:60
CSCDDUHeader::header2_3_
unsigned header2_3_
Definition: CSCDDUHeader.h:68
CSCDDUHeader::dmb_dav_
unsigned dmb_dav_
Definition: CSCDDUHeader.h:73
CSCDDUHeader::header2_1_
unsigned header2_1_
Definition: CSCDDUHeader.h:66
CSCDDUHeader::sizeInWords
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:31
CSCDDUHeader::bit64_
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:62
CSCDDUHeader::output_path_
unsigned output_path_
Definition: CSCDDUHeader.h:74
CSCDDUHeader::s_link_status_
unsigned s_link_status_
Definition: CSCDDUHeader.h:54
CSCDDUHeader::live_cscs_
unsigned live_cscs_
Definition: CSCDDUHeader.h:75
CSCDDUHeader::source_id_
unsigned source_id_
Definition: CSCDDUHeader.h:56
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
objects.autophobj.sourceId
sourceId
Definition: autophobj.py:239
CSCDDUHeader::ncsc_
unsigned ncsc_
Definition: CSCDDUHeader.h:70
CSCDDUHeader::format_version_
unsigned format_version_
Definition: CSCDDUHeader.h:55
CSCDDUStatusDigi::header
const uint16_t * header() const
Data Accessors.
Definition: CSCDDUStatusDigi.h:24
CSCDDUHeader::boe_status_
unsigned boe_status_
Definition: CSCDDUHeader.h:72
CSCDDUHeader::tts_status_
unsigned tts_status_
Definition: CSCDDUHeader.h:71
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45