CMS 3D CMS Logo

CSCDDUHeader.h
Go to the documentation of this file.
1 /* CSCDDUHeader 4/24/03 A.Tumanov
2  * documented at http://www.physics.ohio-state.edu/~cms/ddu/
3  */
4 
5 #ifndef EventFilter_CSCRawToDigi_CSCDDUHeader_h
6 #define EventFilter_CSCRawToDigi_CSCDDUHeader_h
8 #include <cstring>
9 #include <cstdint>
10 
11 class CSCDDUHeader {
12 public:
13  CSCDDUHeader();
14  CSCDDUHeader(unsigned bx, unsigned l1num, unsigned sourceId, unsigned fmt_version = 0x6);
15  CSCDDUHeader(const CSCDDUStatusDigi& digi) { memcpy(this, digi.header(), sizeInWords() * 2); }
16 
17  void setFromBuffer(uint16_t const* buf) { memcpy(this, buf, sizeInWords() * 2); }
18 
19  // Getters
20  int s_link_status() const { return s_link_status_; }
21  int format_version() const { return format_version_; }
22  int source_id() const { return source_id_; }
23  int bxnum() const { return bxnum_; }
24  int lvl1num() const { return lvl1num_; }
25  int event_type() const { return event_type_; }
26  int ncsc() const { return ncsc_; }
27  int dmb_dav() const { return dmb_dav_; }
28  int dmb_full() const { return dmb_full_; }
29  int live_cscs() const { return live_cscs_; }
30  int output_path_status() const { return output_path_; }
31  static unsigned sizeInWords() { return 12; }
32 
33  // Setters
34  void setDMBDAV(int dduInput);
35  void setSourceId(unsigned sourceId) { source_id_ = sourceId; }
36  void setFormatVersion(unsigned version) { format_version_ = version & 0xF; }
37  void setBXN(unsigned bxn) { bxnum_ = bxn & 0xFFF; }
38  void setL1A(unsigned l1a) { lvl1num_ = l1a & 0xFFFFFF; }
39  void setEventType(unsigned evt_type) { event_type_ = evt_type & 0xF; }
40  void setTTSStatus(unsigned status) { tts_status_ = status & 0xF; }
41  void setBOEStatus(unsigned status) { boe_status_ = status & 0x7F; }
42  void setOutputPathStatus(unsigned status) { output_path_ = status & 0xFF; }
43 
44  unsigned short* data() { return (unsigned short*)this; }
45  bool check() const;
46 
47  // gets some data filled by the event data
48  friend class CSCDDUEventData;
49 
50 private:
52  void init();
53 
54  unsigned s_link_status_ : 4;
55  unsigned format_version_ : 4;
56  unsigned source_id_ : 12;
57  unsigned bxnum_ : 12;
58 
59  unsigned lvl1num_ : 24;
60  unsigned event_type_ : 4;
62  unsigned bit64_ : 4;
63 
65  unsigned dmb_full_ : 16;
66  unsigned header2_1_ : 16;
67  unsigned header2_2_ : 16;
68  unsigned header2_3_ : 16;
69 
70  unsigned ncsc_ : 4;
71  unsigned tts_status_ : 4;
72  unsigned boe_status_ : 8;
73  unsigned dmb_dav_ : 16;
74  unsigned output_path_ : 16;
75  unsigned live_cscs_ : 16;
76 };
77 #endif
CSCDDUHeader::lvl1num_
unsigned lvl1num_
Definition: CSCDDUHeader.h:59
CSCDDUHeader::bxnum_
unsigned bxnum_
Definition: CSCDDUHeader.h:57
CSCDDUHeader::setBOEStatus
void setBOEStatus(unsigned status)
Definition: CSCDDUHeader.h:41
CSCDDUHeader::setOutputPathStatus
void setOutputPathStatus(unsigned status)
Definition: CSCDDUHeader.h:42
CSCDDUHeader::bxnum
int bxnum() const
Definition: CSCDDUHeader.h:23
CSCDDUHeader::check
bool check() const
Definition: CSCDDUHeader.cc:43
mps_update.status
status
Definition: mps_update.py:68
CSCDDUHeader
Definition: CSCDDUHeader.h:11
CSCDDUHeader::lvl1num
int lvl1num() const
Definition: CSCDDUHeader.h:24
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::setDMBDAV
void setDMBDAV(int dduInput)
Definition: CSCDDUHeader.cc:26
CSCDDUHeader::init
void init()
initializes constants
Definition: CSCDDUHeader.cc:20
CSCDDUHeader::dmb_full
int dmb_full() const
Definition: CSCDDUHeader.h:28
CSCDDUHeader::event_type_
unsigned event_type_
Definition: CSCDDUHeader.h:60
CSCDDUHeader::CSCDDUHeader
CSCDDUHeader(const CSCDDUStatusDigi &digi)
Definition: CSCDDUHeader.h:15
CSCDDUHeader::header2_3_
unsigned header2_3_
Definition: CSCDDUHeader.h:68
CSCDDUHeader::event_type
int event_type() const
Definition: CSCDDUHeader.h:25
CSCDDUHeader::s_link_status
int s_link_status() const
Definition: CSCDDUHeader.h:20
CSCDDUStatusDigi.h
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::CSCDDUHeader
CSCDDUHeader()
Definition: CSCDDUHeader.cc:5
CSCDDUHeader::s_link_status_
unsigned s_link_status_
Definition: CSCDDUHeader.h:54
CSCDDUHeader::setFromBuffer
void setFromBuffer(uint16_t const *buf)
Definition: CSCDDUHeader.h:17
CSCDDUHeader::ncsc
int ncsc() const
Definition: CSCDDUHeader.h:26
CSCDDUHeader::setFormatVersion
void setFormatVersion(unsigned version)
Definition: CSCDDUHeader.h:36
CSCDDUStatusDigi
Definition: CSCDDUStatusDigi.h:15
CSCDDUHeader::setTTSStatus
void setTTSStatus(unsigned status)
Definition: CSCDDUHeader.h:40
CSCDDUHeader::setL1A
void setL1A(unsigned l1a)
Definition: CSCDDUHeader.h:38
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:160
CSCDDUHeader::setEventType
void setEventType(unsigned evt_type)
Definition: CSCDDUHeader.h:39
CSCDDUHeader::live_cscs
int live_cscs() const
Definition: CSCDDUHeader.h:29
objects.autophobj.sourceId
sourceId
Definition: autophobj.py:239
CSCDDUHeader::data
unsigned short * data()
Definition: CSCDDUHeader.h:44
CSCDDUHeader::ncsc_
unsigned ncsc_
Definition: CSCDDUHeader.h:70
CSCDDUHeader::format_version_
unsigned format_version_
Definition: CSCDDUHeader.h:55
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDDUHeader::setBXN
void setBXN(unsigned bxn)
Definition: CSCDDUHeader.h:37
CSCDDUStatusDigi::header
const uint16_t * header() const
Data Accessors.
Definition: CSCDDUStatusDigi.h:24
CSCDDUHeader::boe_status_
unsigned boe_status_
Definition: CSCDDUHeader.h:72
CSCDDUHeader::setSourceId
void setSourceId(unsigned sourceId)
Definition: CSCDDUHeader.h:35
CSCDDUHeader::output_path_status
int output_path_status() const
Definition: CSCDDUHeader.h:30
CSCDDUHeader::tts_status_
unsigned tts_status_
Definition: CSCDDUHeader.h:71
CSCDDUHeader::dmb_dav
int dmb_dav() const
Definition: CSCDDUHeader.h:27
CSCDDUHeader::format_version
int format_version() const
Definition: CSCDDUHeader.h:21
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
CSCDDUHeader::source_id
int source_id() const
Definition: CSCDDUHeader.h:22