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
10 #include <boost/shared_ptr.hpp>
11 
12 class CSCDMBHeader2005;
13 class CSCDMBHeader2013;
14 
15 class CSCDMBHeader {
16 public:
17 
18  CSCDMBHeader(uint16_t firmware_version = 2005);
19 
20  CSCDMBHeader(unsigned short * buf, uint16_t firmware_version = 2005);
21 
23  {
24  memcpy(this, digi.header(), sizeInWords()*2);
25  }
26 
27 
28 
29  bool cfebAvailable(unsigned icfeb) {
30  return (theHeaderFormat->cfebAvailable() >> icfeb) & 1;
31  }
32 
33  void addCFEB(int icfeb) { theHeaderFormat->addCFEB(icfeb); }
34  void addNCLCT() { theHeaderFormat->addNCLCT();};
35 
36  void addNALCT() { theHeaderFormat->addNALCT(); };
37  void setBXN(int bxn) { theHeaderFormat->setBXN(bxn); };
38  void setL1A(int l1a) { theHeaderFormat->setL1A(l1a); };
39  void setL1A24(int l1a) { theHeaderFormat->setL1A24(l1a); };
40  void setCrateAddress(int crate, int dmbId) { theHeaderFormat->setCrateAddress(crate, dmbId); };
41  void setdmbID(int newDMBID) { theHeaderFormat->setdmbID(newDMBID); };
42  void setdmbVersion(unsigned int version) { theHeaderFormat->setdmbVersion(version); };
43 
44  unsigned cfebActive() const { return theHeaderFormat->cfebActive(); };
45  unsigned crateID() const { return theHeaderFormat->crateID(); };
46  unsigned dmbID() const { return theHeaderFormat->dmbID(); };
47  unsigned bxn() const { return theHeaderFormat->bxn(); };
48  unsigned bxn12() const { return theHeaderFormat->bxn12(); };
49  unsigned l1a() const { return theHeaderFormat->l1a(); };
50  unsigned l1a24() const { return theHeaderFormat->l1a24(); };
51  unsigned cfebAvailable() const { return theHeaderFormat->cfebAvailable(); };
52  unsigned nalct() const { return theHeaderFormat->nalct(); };
53  unsigned nclct() const { return theHeaderFormat->nclct(); };
54  unsigned cfebMovlp() const { return theHeaderFormat->cfebMovlp(); };
55  unsigned dmbCfebSync() const { return theHeaderFormat->dmbCfebSync(); };
56  unsigned activeDavMismatch() const { return theHeaderFormat->activeDavMismatch(); };
57 
58  unsigned sizeInWords() const { return theHeaderFormat->sizeInWords(); };
59  unsigned format_version() const { return theHeaderFormat->format_version(); };
60 
61  bool check() const { return theHeaderFormat->check(); };
62 
63  unsigned short * data() {return theHeaderFormat->data(); };
64  unsigned short * data() const {return theHeaderFormat->data(); };
65 
66 
67  //ostream & operator<<(ostream &, const CSCDMBHeader &);
68 
72 
73 
74  private:
75 
76  boost::shared_ptr<CSCVDMBHeaderFormat> theHeaderFormat;
78 
79 
80 };
81 
82 #endif
83 
int theFirmwareVersion
Definition: CSCDMBHeader.h:77
bool check() const
Definition: CSCDMBHeader.h:61
unsigned l1a() const
Definition: CSCDMBHeader.h:49
unsigned l1a24() const
Definition: CSCDMBHeader.h:50
unsigned nclct() const
Definition: CSCDMBHeader.h:53
unsigned cfebActive() const
Definition: CSCDMBHeader.h:44
void addNCLCT()
Definition: CSCDMBHeader.h:34
unsigned nalct() const
Definition: CSCDMBHeader.h:52
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:42
void setL1A(int l1a)
Definition: CSCDMBHeader.h:38
unsigned cfebMovlp() const
Definition: CSCDMBHeader.h:54
boost::shared_ptr< CSCVDMBHeaderFormat > theHeaderFormat
Definition: CSCDMBHeader.h:76
void setBXN(int bxn)
Definition: CSCDMBHeader.h:37
CSCDMBHeader2005 dmbHeader2005() const
will throw if the cast fails
Definition: CSCDMBHeader.cc:30
CSCDMBHeader(const CSCDMBStatusDigi &digi)
Definition: CSCDMBHeader.h:22
unsigned sizeInWords() const
Definition: CSCDMBHeader.h:58
CSCDMBHeader2013 dmbHeader2013() const
Definition: CSCDMBHeader.cc:40
void addCFEB(int icfeb)
Definition: CSCDMBHeader.h:33
unsigned bxn12() const
Definition: CSCDMBHeader.h:48
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.h:40
unsigned format_version() const
Definition: CSCDMBHeader.h:59
unsigned crateID() const
Definition: CSCDMBHeader.h:45
unsigned bxn() const
Definition: CSCDMBHeader.h:47
unsigned short * data()
Definition: CSCDMBHeader.h:63
CSCDMBHeader(uint16_t firmware_version=2005)
Definition: CSCDMBHeader.cc:8
void setL1A24(int l1a)
Definition: CSCDMBHeader.h:39
unsigned cfebAvailable() const
Definition: CSCDMBHeader.h:51
unsigned short * data() const
Definition: CSCDMBHeader.h:64
unsigned dmbID() const
Definition: CSCDMBHeader.h:46
unsigned activeDavMismatch() const
Definition: CSCDMBHeader.h:56
void addNALCT()
Definition: CSCDMBHeader.h:36
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.h:55
bool cfebAvailable(unsigned icfeb)
Definition: CSCDMBHeader.h:29
void setdmbID(int newDMBID)
Definition: CSCDMBHeader.h:41
const uint16_t * header() const
Data Accessors.