EventFilter
CSCRawToDigi
src
CSCDMBHeader.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h
"
2
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBHeader2005.h
"
3
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBHeader2013.h
"
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
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
24
CSCDMBHeader2005
CSCDMBHeader::dmbHeader2005
()
const
{
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
32
CSCDMBHeader2013
CSCDMBHeader::dmbHeader2013
()
const
{
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
}
CSCDMBHeader::theFirmwareVersion
int theFirmwareVersion
Definition:
CSCDMBHeader.h:64
CSCDMBHeader::dmbHeader2005
CSCDMBHeader2005 dmbHeader2005() const
will throw if the cast fails
Definition:
CSCDMBHeader.cc:24
CSCDMBHeader2013
Definition:
CSCDMBHeader2013.h:43
Exception
Definition:
hltDiff.cc:245
MessageLogger.h
mps_fire.result
result
Definition:
mps_fire.py:311
CSCDMBHeader2005.h
CSCDMBHeader::dmbHeader2013
CSCDMBHeader2013 dmbHeader2013() const
Definition:
CSCDMBHeader.cc:32
visDQMUpload.buf
buf
Definition:
visDQMUpload.py:153
CSCDMBHeader::theHeaderFormat
std::shared_ptr< CSCVDMBHeaderFormat > theHeaderFormat
Definition:
CSCDMBHeader.h:63
CSCDMBHeader.h
CSCDMBHeader::CSCDMBHeader
CSCDMBHeader(uint16_t firmware_version=2005)
Definition:
CSCDMBHeader.cc:7
CSCDMBHeader2005
Definition:
CSCDMBHeader2005.h:10
CSCDMBHeader2013.h
Generated for CMSSW Reference Manual by
1.8.14