CondTools
SiStrip
plugins
SiStripBadStripReader.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
2
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
3
#include "
FWCore/Framework/interface/Event.h
"
4
#include "
FWCore/Framework/interface/EventSetup.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
#include "
CondFormats/DataRecord/interface/SiStripBadStripRcd.h
"
8
#include "
CondFormats/SiStripObjects/interface/SiStripBadStrip.h
"
9
10
#include <iostream>
11
#include <cstdio>
12
#include <sys/time.h>
13
14
class
SiStripBadStripReader
:
public
edm::EDAnalyzer
{
15
public
:
16
explicit
SiStripBadStripReader
(
const
edm::ParameterSet
& iConfig)
17
:
printdebug_
(iConfig.getUntrackedParameter<uint32_t>(
"printDebug"
, 1)),
badStripToken_
(
esConsumes
()) {}
18
19
~SiStripBadStripReader
()
override
;
20
21
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
22
23
private
:
24
uint32_t
printdebug_
;
25
edm::ESGetToken<SiStripBadStrip, SiStripBadStripRcd>
badStripToken_
;
26
};
27
28
SiStripBadStripReader::~SiStripBadStripReader
() {}
29
30
void
SiStripBadStripReader::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
& iSetup) {
31
const
auto
& badStrip = iSetup.
getData
(
badStripToken_
);
32
edm::LogInfo
(
"SiStripBadStripReader"
) <<
"[SiStripBadStripReader::analyze] End Reading SiStripBadStrip"
<< std::endl;
33
34
std::vector<uint32_t> detid;
35
badStrip.getDetIds(detid);
36
37
if
(
printdebug_
)
38
for
(
size_t
id
= 0;
id
< detid.size();
id
++) {
39
SiStripBadStrip::Range
range
= badStrip.getRange(detid[
id
]);
40
41
for
(
int
it = 0; it <
range
.second -
range
.first; it++) {
42
unsigned
int
value
= (*(
range
.first + it));
43
edm::LogInfo
(
"SiStripBadStripReader"
) <<
"detid "
<< detid[
id
] <<
" \t"
44
<<
" firstBadStrip "
<< badStrip.decode(
value
).firstStrip <<
"\t "
45
<<
" NconsecutiveBadStrips "
<< badStrip.decode(
value
).range <<
"\t "
46
<<
" flag "
<< badStrip.decode(
value
).flag <<
"\t "
47
<<
" packed integer "
<< std::hex <<
value
<<
std::dec
48
<<
"\t "
49
//<< badStrip.getBadStrips(range) << " \t"
50
<< std::endl;
51
}
52
}
53
}
54
55
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
56
#include "
FWCore/Framework/interface/MakerMacros.h
"
57
DEFINE_FWK_MODULE
(
SiStripBadStripReader
);
FastTimerService_cff.range
range
Definition:
FastTimerService_cff.py:34
MessageLogger.h
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
SiStripBadStrip.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition:
SiStripBadStrip.h:53
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
SiStripBadStripReader
Definition:
SiStripBadStripReader.cc:14
SiStripBadStripReader::SiStripBadStripReader
SiStripBadStripReader(const edm::ParameterSet &iConfig)
Definition:
SiStripBadStripReader.cc:16
edm::ParameterSet
Definition:
ParameterSet.h:47
SiStripBadStripReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
SiStripBadStripReader.cc:30
Event.h
ModuleDef.h
value
Definition:
value.py:1
edm::EventSetup
Definition:
EventSetup.h:58
SiStripBadStripReader::badStripToken_
edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_
Definition:
SiStripBadStripReader.cc:25
edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
SiStripBadStripReader::~SiStripBadStripReader
~SiStripBadStripReader() override
Definition:
SiStripBadStripReader.cc:28
Frameworkfwd.h
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:29
EventSetup.h
SiStripBadStripReader::printdebug_
uint32_t printdebug_
Definition:
SiStripBadStripReader.cc:24
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:206
ParameterSet.h
edm::Event
Definition:
Event.h:73
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:142
SiStripBadStripRcd.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16