CondTools
DT
plugins
DTKeyedConfigPopConAnalyzer.cc
Go to the documentation of this file.
1
#include "
CondCore/PopCon/interface/PopConAnalyzer.h
"
2
#include "
CondTools/DT/interface/DTKeyedConfigHandler.h
"
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
FWCore/Framework/interface/EventSetup.h
"
5
#include "
CondCore/CondDB/interface/KeyList.h
"
6
#include "
FWCore/Framework/interface/MakerMacros.h
"
7
#include "
CondFormats/DTObjects/interface/DTKeyedConfig.h
"
8
#include "
CondFormats/DataRecord/interface/DTKeyedConfigListRcd.h
"
9
#include <memory>
10
11
//typedef popcon::PopConAnalyzer<DTKeyedConfigHandler> DTKeyedConfigPopConAnalyzer;
12
class
DTKeyedConfigPopConAnalyzer
:
public
popcon::PopConAnalyzer
<DTKeyedConfigHandler> {
13
public
:
14
DTKeyedConfigPopConAnalyzer
(
const
edm::ParameterSet
&
pset
)
15
:
popcon
::
PopConAnalyzer
<
DTKeyedConfigHandler
>(
pset
),
16
copyData
(
pset
.getParameter<
edm
::
ParameterSet
>(
"Source"
).getUntrackedParameter<
bool
>(
"copyData"
,
true
)) {}
17
~DTKeyedConfigPopConAnalyzer
()
override
{}
18
void
analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
s
)
override
{
19
if
(!
copyData
)
20
return
;
21
22
edm::ESHandle<cond::persistency::KeyList>
klh;
23
std::cout
<<
"got eshandle"
<< std::endl;
24
s
.get<
DTKeyedConfigListRcd
>().
get
(klh);
25
std::cout
<<
"got context"
<< std::endl;
26
cond::persistency::KeyList
const
& kl = *klh.
product
();
27
for
(
size_t
i
= 0;
i
< kl.
size
();
i
++) {
28
std::shared_ptr<DTKeyedConfig> kelem = kl.
getUsingIndex
<
DTKeyedConfig
>(
i
);
29
if
(kelem.get())
30
std::cout
<< kelem->getId() << std::endl;
31
}
32
source
().
setList
(&kl);
33
}
34
35
private
:
36
bool
copyData
;
37
};
38
39
DEFINE_FWK_MODULE
(
DTKeyedConfigPopConAnalyzer
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
electrons_cff.bool
bool
Definition:
electrons_cff.py:372
mps_fire.i
i
Definition:
mps_fire.py:355
ESHandle.h
DTKeyedConfigPopConAnalyzer::DTKeyedConfigPopConAnalyzer
DTKeyedConfigPopConAnalyzer(const edm::ParameterSet &pset)
Definition:
DTKeyedConfigPopConAnalyzer.cc:14
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DTKeyedConfigListRcd.h
popcon::PopConAnalyzer< DTKeyedConfigHandler >::source
SourceHandler & source()
Definition:
PopConAnalyzer.h:27
MakerMacros.h
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
DTKeyedConfigPopConAnalyzer
Definition:
DTKeyedConfigPopConAnalyzer.cc:12
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
DTKeyedConfigListRcd
Definition:
DTKeyedConfigListRcd.h:5
edm::ESHandle
Definition:
DTSurvey.h:22
cond::persistency::KeyList::getUsingIndex
std::shared_ptr< T > getUsingIndex(size_t n) const
Retrieves the pre-fetched data. The index is the same order as the keys used in setKeys.
Definition:
KeyList.h:44
funct::true
true
Definition:
Factorize.h:173
edm::ParameterSet
Definition:
ParameterSet.h:36
ParameterSet
Definition:
Functions.h:16
cond::persistency::KeyList::size
size_t size() const
Number of keys based on container passed to setKeys.
Definition:
KeyList.h:63
DTKeyedConfig.h
DTKeyedConfigPopConAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &s) override
Definition:
DTKeyedConfigPopConAnalyzer.cc:18
DTKeyedConfig
Definition:
DTKeyedConfig.h:35
DTKeyedConfigPopConAnalyzer::~DTKeyedConfigPopConAnalyzer
~DTKeyedConfigPopConAnalyzer() override
Definition:
DTKeyedConfigPopConAnalyzer.cc:17
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
DTKeyedConfigHandler.h
popcon
Definition:
Exception.h:6
KeyList.h
DTKeyedConfigPopConAnalyzer::copyData
bool copyData
Definition:
DTKeyedConfigPopConAnalyzer.cc:36
EventSetup.h
cond::persistency::KeyList
Definition:
KeyList.h:33
DTKeyedConfigHandler::setList
void setList(const cond::persistency::KeyList *list)
Definition:
DTKeyedConfigHandler.cc:605
edm::Event
Definition:
Event.h:73
PopConAnalyzer.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
popcon::PopConAnalyzer< DTKeyedConfigHandler >::PopConAnalyzer
PopConAnalyzer(const edm::ParameterSet &pset)
Definition:
PopConAnalyzer.h:21
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
popcon::PopConAnalyzer
Definition:
PopConAnalyzer.h:17
DTKeyedConfigHandler
Definition:
DTKeyedConfigHandler.h:46
Generated for CMSSW Reference Manual by
1.8.16