CMS 3D CMS Logo

CSCDMBHeader.cc
Go to the documentation of this file.
5 #include <iostream>
6 
7 CSCDMBHeader::CSCDMBHeader(uint16_t firmware_version) : theHeaderFormat(), theFirmwareVersion(firmware_version) {
8  if (theFirmwareVersion == 2013) {
9  theHeaderFormat = std::make_shared<CSCDMBHeader2013>();
10  } else {
11  theHeaderFormat = std::make_shared<CSCDMBHeader2005>();
12  }
13 }
14 
15 CSCDMBHeader::CSCDMBHeader(const uint16_t *buf, uint16_t firmware_version)
16  : theHeaderFormat(), theFirmwareVersion(firmware_version) {
17  if (theFirmwareVersion == 2013) {
18  theHeaderFormat = std::make_shared<CSCDMBHeader2013>(buf);
19  } else {
20  theHeaderFormat = std::make_shared<CSCDMBHeader2005>(buf);
21  }
22 }
23 
25  const CSCDMBHeader2005 *result = dynamic_cast<const CSCDMBHeader2005 *>(theHeaderFormat.get());
26  if (result == nullptr) {
27  throw cms::Exception("Could not get 2005 DMB header format");
28  }
29  return *result;
30 }
31 
33  const CSCDMBHeader2013 *result = dynamic_cast<const CSCDMBHeader2013 *>(theHeaderFormat.get());
34  if (result == nullptr) {
35  throw cms::Exception("Could not get 2013 DMB header format");
36  }
37  return *result;
38 }
MessageLogger.h
CSCDMBHeader2013.h
CSCDMBHeader.h
CSCDMBHeader::CSCDMBHeader
CSCDMBHeader(uint16_t firmware_version=2005)
Definition: CSCDMBHeader.cc:7
CSCDMBHeader::dmbHeader2005
CSCDMBHeader2005 dmbHeader2005() const
will throw if the cast fails
Definition: CSCDMBHeader.cc:24
CSCDMBHeader2005.h
CSCDMBHeader2005
Definition: CSCDMBHeader2005.h:10
CSCDMBHeader::dmbHeader2013
CSCDMBHeader2013 dmbHeader2013() const
Definition: CSCDMBHeader.cc:32
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCDMBHeader::theHeaderFormat
std::shared_ptr< CSCVDMBHeaderFormat > theHeaderFormat
Definition: CSCDMBHeader.h:63
Exception
Definition: hltDiff.cc:245
CSCDMBHeader::theFirmwareVersion
int theFirmwareVersion
Definition: CSCDMBHeader.h:64
CSCDMBHeader2013
Definition: CSCDMBHeader2013.h:43
mps_fire.result
result
Definition: mps_fire.py:311