Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
8
CSCDMBHeader::CSCDMBHeader
(uint16_t firmware_version)
9
: theHeaderFormat(), theFirmwareVersion(firmware_version)
10
{
11
12
if
(
theFirmwareVersion
== 2013) {
13
theHeaderFormat
= boost::shared_ptr<CSCVDMBHeaderFormat>(
new
CSCDMBHeader2013
());
14
}
else
{
15
theHeaderFormat
= boost::shared_ptr<CSCVDMBHeaderFormat>(
new
CSCDMBHeader2005
());
16
}
17
18
}
19
20
CSCDMBHeader::CSCDMBHeader
(
unsigned
short
* buf, uint16_t firmware_version)
21
: theHeaderFormat(), theFirmwareVersion(firmware_version)
22
{
23
if
(
theFirmwareVersion
== 2013) {
24
theHeaderFormat
= boost::shared_ptr<CSCVDMBHeaderFormat>(
new
CSCDMBHeader2013
(buf));
25
}
else
{
26
theHeaderFormat
= boost::shared_ptr<CSCVDMBHeaderFormat>(
new
CSCDMBHeader2005
(buf));
27
}
28
}
29
30
CSCDMBHeader2005
CSCDMBHeader::dmbHeader2005
()
const
{
31
CSCDMBHeader2005
*
result
=
dynamic_cast<
CSCDMBHeader2005
*
>
(
theHeaderFormat
.get());
32
if
(result == 0)
33
{
34
throw
cms::Exception
(
"Could not get 2005 DMB header format"
);
35
}
36
return
*
result
;
37
}
38
39
40
CSCDMBHeader2013
CSCDMBHeader::dmbHeader2013
()
const
{
41
CSCDMBHeader2013
*
result
=
dynamic_cast<
CSCDMBHeader2013
*
>
(
theHeaderFormat
.get());
42
if
(result == 0)
43
{
44
throw
cms::Exception
(
"Could not get 2013 DMB header format"
);
45
}
46
return
*
result
;
47
}
48
49
50
CSCDMBHeader::theFirmwareVersion
int theFirmwareVersion
Definition:
CSCDMBHeader.h:78
CSCDMBHeader2013
Definition:
CSCDMBHeader2013.h:44
MessageLogger.h
CSCDMBHeader2005.h
CSCDMBHeader::theHeaderFormat
boost::shared_ptr< CSCVDMBHeaderFormat > theHeaderFormat
Definition:
CSCDMBHeader.h:77
CSCDMBHeader::dmbHeader2005
CSCDMBHeader2005 dmbHeader2005() const
will throw if the cast fails
Definition:
CSCDMBHeader.cc:30
query.result
tuple result
Definition:
query.py:137
CSCDMBHeader.h
CSCDMBHeader::dmbHeader2013
CSCDMBHeader2013 dmbHeader2013() const
Definition:
CSCDMBHeader.cc:40
edm::hlt::Exception
error
Definition:
HLTenums.h:21
CSCDMBHeader::CSCDMBHeader
CSCDMBHeader(uint16_t firmware_version=2005)
Definition:
CSCDMBHeader.cc:8
CSCDMBHeader2005
Definition:
CSCDMBHeader2005.h:10
CSCDMBHeader2013.h
Generated for CMSSW Reference Manual by
1.8.5