EventFilter
CSCRawToDigi
src
CSCDMBTrailer.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBTrailer.h
"
2
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBTrailer2005.h
"
3
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBTrailer2013.h
"
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
#include <iostream>
6
7
CSCDMBTrailer::CSCDMBTrailer
(uint16_t firmware_version) : theTrailerFormat(), theFirmwareVersion(firmware_version) {
8
if
(
theFirmwareVersion
== 2013) {
9
theTrailerFormat
= std::make_shared<CSCDMBTrailer2013>();
10
}
else
{
11
theTrailerFormat
= std::make_shared<CSCDMBTrailer2005>();
12
}
13
}
14
15
CSCDMBTrailer::CSCDMBTrailer
(
const
uint16_t *
buf
, uint16_t firmware_version)
16
: theTrailerFormat(), theFirmwareVersion(firmware_version) {
17
if
(
theFirmwareVersion
== 2013) {
18
theTrailerFormat
= std::make_shared<CSCDMBTrailer2013>(
buf
);
19
}
else
{
20
theTrailerFormat
= std::make_shared<CSCDMBTrailer2005>(
buf
);
21
}
22
}
23
24
CSCDMBTrailer2005
CSCDMBTrailer::dmbTrailer2005
()
const
{
25
const
CSCDMBTrailer2005
*
result
= dynamic_cast<const CSCDMBTrailer2005 *>(
theTrailerFormat
.get());
26
if
(
result
==
nullptr
) {
27
throw
cms::Exception
(
"Could not get 2005 DMB trailer format"
);
28
}
29
return
*
result
;
30
}
31
32
CSCDMBTrailer2013
CSCDMBTrailer::dmbTrailer2013
()
const
{
33
const
CSCDMBTrailer2013
*
result
= dynamic_cast<const CSCDMBTrailer2013 *>(
theTrailerFormat
.get());
34
if
(
result
==
nullptr
) {
35
throw
cms::Exception
(
"Could not get 2013 DMB trailer format"
);
36
}
37
return
*
result
;
38
}
CSCDMBTrailer2013.h
MessageLogger.h
CSCDMBTrailer.h
CSCDMBTrailer2005
Definition:
CSCDMBTrailer2005.h:8
CSCDMBTrailer2005.h
CSCDMBTrailer::dmbTrailer2005
CSCDMBTrailer2005 dmbTrailer2005() const
will throw if the cast fails
Definition:
CSCDMBTrailer.cc:24
CSCDMBTrailer::dmbTrailer2013
CSCDMBTrailer2013 dmbTrailer2013() const
Definition:
CSCDMBTrailer.cc:32
CSCDMBTrailer::theFirmwareVersion
int theFirmwareVersion
Definition:
CSCDMBTrailer.h:71
visDQMUpload.buf
buf
Definition:
visDQMUpload.py:154
CSCDMBTrailer::theTrailerFormat
std::shared_ptr< CSCVDMBTrailerFormat > theTrailerFormat
Definition:
CSCDMBTrailer.h:70
Exception
Definition:
hltDiff.cc:246
CSCDMBTrailer::CSCDMBTrailer
CSCDMBTrailer(uint16_t firmware_version=2005)
Definition:
CSCDMBTrailer.cc:7
mps_fire.result
result
Definition:
mps_fire.py:303
CSCDMBTrailer2013
Definition:
CSCDMBTrailer2013.h:42
Generated for CMSSW Reference Manual by
1.8.16