CMS 3D CMS Logo

CSCDMBHeader.h
Go to the documentation of this file.
1 #ifndef CSCDMBHeader_h
2 #define CSCDMBHeader_h
3 
4 #include <cassert>
5 #include <iosfwd>
6 #include <cstring> // bzero
7 #include <memory>
11 
12 struct CSCDMBHeader2005;
13 struct CSCDMBHeader2013;
14 
15 class CSCDMBHeader {
16 public:
17 
18  CSCDMBHeader(uint16_t firmware_version = 2005);
19 
20  CSCDMBHeader(const uint16_t * buf, uint16_t firmware_version = 2005);
21 
22 
23 
24  bool cfebAvailable(unsigned icfeb) {
25  return (theHeaderFormat->cfebAvailable() >> icfeb) & 1;
26  }
27 
28  void addCFEB(int icfeb) { theHeaderFormat->addCFEB(icfeb); }
29  void addNCLCT() { theHeaderFormat->addNCLCT();};
30 
31  void addNALCT() { theHeaderFormat->addNALCT(); };
32  void setBXN(int bxn) { theHeaderFormat->setBXN(bxn); };
33  void setL1A(int l1a) { theHeaderFormat->setL1A(l1a); };
34  void setL1A24(int l1a) { theHeaderFormat->setL1A24(l1a); };
35  void setCrateAddress(int crate, int dmbId) { theHeaderFormat->setCrateAddress(crate, dmbId); };
36  void setdmbID(int newDMBID) { theHeaderFormat->setdmbID(newDMBID); };
37  void setdmbVersion(unsigned int version) { theHeaderFormat->setdmbVersion(version); };
38 
39  unsigned cfebActive() const { return theHeaderFormat->cfebActive(); };
40  unsigned crateID() const { return theHeaderFormat->crateID(); };
41  unsigned dmbID() const { return theHeaderFormat->dmbID(); };
42  unsigned bxn() const { return theHeaderFormat->bxn(); };
43  unsigned bxn12() const { return theHeaderFormat->bxn12(); };
44  unsigned l1a() const { return theHeaderFormat->l1a(); };
45  unsigned l1a24() const { return theHeaderFormat->l1a24(); };
46  unsigned cfebAvailable() const { return theHeaderFormat->cfebAvailable(); };
47  unsigned nalct() const { return theHeaderFormat->nalct(); };
48  unsigned nclct() const { return theHeaderFormat->nclct(); };
49  unsigned cfebMovlp() const { return theHeaderFormat->cfebMovlp(); };
50  unsigned dmbCfebSync() const { return theHeaderFormat->dmbCfebSync(); };
51  unsigned activeDavMismatch() const { return theHeaderFormat->activeDavMismatch(); };
52 
53  unsigned sizeInWords() const { return theHeaderFormat->sizeInWords(); };
54  unsigned format_version() const { return theHeaderFormat->format_version(); };
55 
56  bool check() const { return theHeaderFormat->check(); };
57 
58  unsigned short * data() {return theHeaderFormat->data(); };
59  unsigned short * data() const {return theHeaderFormat->data(); };
60 
61 
62  //ostream & operator<<(ostream &, const CSCDMBHeader &);
63 
67 
68 
69  private:
70 
71  std::shared_ptr<CSCVDMBHeaderFormat> theHeaderFormat;
73 
74 
75 };
76 
77 #endif
78 
int theFirmwareVersion
Definition: CSCDMBHeader.h:72
bool check() const
Definition: CSCDMBHeader.h:56
unsigned l1a() const
Definition: CSCDMBHeader.h:44
unsigned l1a24() const
Definition: CSCDMBHeader.h:45
unsigned nclct() const
Definition: CSCDMBHeader.h:48
unsigned cfebActive() const
Definition: CSCDMBHeader.h:39
void addNCLCT()
Definition: CSCDMBHeader.h:29
unsigned nalct() const
Definition: CSCDMBHeader.h:47
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:37
void setL1A(int l1a)
Definition: CSCDMBHeader.h:33
unsigned cfebMovlp() const
Definition: CSCDMBHeader.h:49
void setBXN(int bxn)
Definition: CSCDMBHeader.h:32
CSCDMBHeader2005 dmbHeader2005() const
will throw if the cast fails
Definition: CSCDMBHeader.cc:30
std::shared_ptr< CSCVDMBHeaderFormat > theHeaderFormat
Definition: CSCDMBHeader.h:71
unsigned sizeInWords() const
Definition: CSCDMBHeader.h:53
CSCDMBHeader2013 dmbHeader2013() const
Definition: CSCDMBHeader.cc:40
void addCFEB(int icfeb)
Definition: CSCDMBHeader.h:28
unsigned bxn12() const
Definition: CSCDMBHeader.h:43
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.h:35
unsigned format_version() const
Definition: CSCDMBHeader.h:54
unsigned crateID() const
Definition: CSCDMBHeader.h:40
unsigned bxn() const
Definition: CSCDMBHeader.h:42
unsigned short * data()
Definition: CSCDMBHeader.h:58
CSCDMBHeader(uint16_t firmware_version=2005)
Definition: CSCDMBHeader.cc:8
void setL1A24(int l1a)
Definition: CSCDMBHeader.h:34
unsigned cfebAvailable() const
Definition: CSCDMBHeader.h:46
unsigned short * data() const
Definition: CSCDMBHeader.h:59
unsigned dmbID() const
Definition: CSCDMBHeader.h:41
unsigned activeDavMismatch() const
Definition: CSCDMBHeader.h:51
void addNALCT()
Definition: CSCDMBHeader.h:31
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.h:50
bool cfebAvailable(unsigned icfeb)
Definition: CSCDMBHeader.h:24
void setdmbID(int newDMBID)
Definition: CSCDMBHeader.h:36