DQM
SiStripMonitorHardware
src
SiStripFEDDump.cc
Go to the documentation of this file.
1
#include <sstream>
2
3
#include "
FWCore/Utilities/interface/EDGetToken.h
"
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
#include "
FWCore/Utilities/interface/InputTag.h
"
10
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
11
12
#include "
EventFilter/SiStripRawToDigi/interface/SiStripFEDBuffer.h
"
13
#include "
DataFormats/FEDRawData/interface/FEDRawDataCollection.h
"
14
#include "
DataFormats/FEDRawData/interface/FEDRawData.h
"
15
#include "
DataFormats/FEDRawData/interface/FEDNumbering.h
"
16
17
#include "
DQMServices/Core/interface/DQMEDAnalyzer.h
"
18
19
//
20
// Class declaration
21
//
22
23
class
SiStripFEDDumpPlugin
:
public
DQMEDAnalyzer
{
24
public
:
25
explicit
SiStripFEDDumpPlugin
(
const
edm::ParameterSet
&);
26
~SiStripFEDDumpPlugin
()
override
;
27
28
private
:
29
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
30
void
bookHistograms
(
DQMStore::IBooker
&,
edm::Run
const
&,
edm::EventSetup
const
&)
override
;
31
32
//tag of FEDRawData collection
33
edm::InputTag
rawDataTag_
;
34
edm::EDGetTokenT<FEDRawDataCollection>
rawDataToken_
;
35
//FED ID to dump
36
unsigned
int
fedIdToDump_
;
37
};
38
39
//
40
// Constructors and destructor
41
//
42
43
SiStripFEDDumpPlugin::SiStripFEDDumpPlugin
(
const
edm::ParameterSet
& iConfig)
44
: rawDataTag_(iConfig.getUntrackedParameter<
edm
::
InputTag
>(
"RawDataTag"
,
edm
::
InputTag
(
"source"
,
""
))),
45
fedIdToDump_(iConfig.getUntrackedParameter<unsigned
int
>(
"FEDID"
, 50)) {
46
rawDataToken_
= consumes<FEDRawDataCollection>(
rawDataTag_
);
47
if
((
fedIdToDump_
>
FEDNumbering::MAXSiStripFEDID
) || (
fedIdToDump_
<
FEDNumbering::MINSiStripFEDID
))
48
edm::LogError
(
"SiStripFEDDump"
) <<
"FED ID "
<<
fedIdToDump_
<<
" is not valid. "
49
<<
"SiStrip FED IDs are "
<< uint16_t(
FEDNumbering::MINSiStripFEDID
) <<
"-"
50
<< uint16_t(
FEDNumbering::MAXSiStripFEDID
);
51
}
52
53
SiStripFEDDumpPlugin::~SiStripFEDDumpPlugin
() {}
54
55
//
56
// Member functions
57
//
58
59
// ------------ method called to for each event ------------
60
void
SiStripFEDDumpPlugin::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
61
//get raw data
62
edm::Handle<FEDRawDataCollection>
rawDataCollectionHandle;
63
iEvent
.getByToken(
rawDataToken_
, rawDataCollectionHandle);
64
const
FEDRawDataCollection
& rawDataCollection = *rawDataCollectionHandle;
65
66
const
FEDRawData
&
rawData
= rawDataCollection.
FEDData
(
fedIdToDump_
);
67
const
auto
st_buffer =
sistrip::preconstructCheckFEDBufferBase
(
rawData
,
false
);
68
if
(
sistrip::FEDBufferStatusCode::SUCCESS
!= st_buffer) {
69
throw
cms::Exception
(
"FEDBuffer"
) << st_buffer;
70
}
71
const
sistrip::FEDBufferBase
buffer
{
rawData
};
72
std::ostringstream os;
73
os <<
buffer
<< std::endl;
74
buffer
.dump(os);
75
edm::LogVerbatim
(
"SiStripFEDDump"
) << os.str();
76
}
77
78
void
SiStripFEDDumpPlugin::bookHistograms
(
DQMStore::IBooker
& ibooker,
79
const
edm::Run
&
run
,
80
const
edm::EventSetup
& eSetup) {}
81
82
//
83
// Define as a plug-in
84
//
85
86
#include "
FWCore/Framework/interface/MakerMacros.h
"
87
DEFINE_FWK_MODULE
(
SiStripFEDDumpPlugin
);
FEDNumbering.h
MessageLogger.h
edm::Run
Definition:
Run.h:45
edm::EDGetTokenT< FEDRawDataCollection >
FEDRawDataCollection
Definition:
FEDRawDataCollection.h:18
edm
HLT enums.
Definition:
AlignableModifier.h:19
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition:
l1tstage2_dqm_sourceclient-live_cfg.py:156
SiStripFEDDumpPlugin::rawDataTag_
edm::InputTag rawDataTag_
Definition:
SiStripFEDDump.cc:33
EDAnalyzer.h
FEDRawData.h
edm::Handle
Definition:
AssociativeIterator.h:50
sistrip::FEDBufferBase
Definition:
SiStripFEDBufferComponents.h:643
FEDRawData
Definition:
FEDRawData.h:19
SiStripFEDDumpPlugin::rawDataToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
Definition:
SiStripFEDDump.cc:34
edmScanValgrind.buffer
buffer
Definition:
edmScanValgrind.py:171
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
SiStripFEDBuffer.h
SiStripFEDDumpPlugin
Definition:
SiStripFEDDump.cc:23
EDGetToken.h
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
DQMEDAnalyzer.h
DQMEDAnalyzer
Definition:
DQMEDAnalyzer.py:1
SiStripFEDDumpPlugin::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition:
SiStripFEDDump.cc:78
FEDNumbering::MAXSiStripFEDID
Definition:
FEDNumbering.h:30
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogError
Definition:
MessageLogger.h:183
Event.h
SiStripFEDDumpPlugin::fedIdToDump_
unsigned int fedIdToDump_
Definition:
SiStripFEDDump.cc:36
createfilelist.int
int
Definition:
createfilelist.py:10
iEvent
int iEvent
Definition:
GenABIO.cc:224
sistrip::FEDBufferStatusCode::SUCCESS
FEDRawDataCollection.h
edm::LogVerbatim
Definition:
MessageLogger.h:297
SiStripFEDDumpPlugin::SiStripFEDDumpPlugin
SiStripFEDDumpPlugin(const edm::ParameterSet &)
Definition:
SiStripFEDDump.cc:43
edm::EventSetup
Definition:
EventSetup.h:57
InputTag.h
sistrip::preconstructCheckFEDBufferBase
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Definition:
SiStripFEDBufferComponents.h:757
SiStripFEDDumpPlugin::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
SiStripFEDDump.cc:60
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
Frameworkfwd.h
Exception
Definition:
hltDiff.cc:246
EventSetup.h
SiStripFEDDumpPlugin::~SiStripFEDDumpPlugin
~SiStripFEDDumpPlugin() override
Definition:
SiStripFEDDump.cc:53
dqm::implementation::IBooker
Definition:
DQMStore.h:43
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
FEDNumbering::MINSiStripFEDID
Definition:
FEDNumbering.h:29
Generated for CMSSW Reference Manual by
1.8.16