Main Page
Namespaces
Classes
Package Documentation
CondTools
RPC
plugins
RPCInverseCPPFLinkMapESProducer.cc
Go to the documentation of this file.
1
#include "
CondTools/RPC/plugins/RPCInverseCPPFLinkMapESProducer.h
"
2
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
6
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
7
8
#include "
CondFormats/RPCObjects/interface/RPCAMCLinkMap.h
"
9
#include "
CondFormats/DataRecord/interface/RPCCPPFLinkMapRcd.h
"
10
#include "
CondFormats/DataRecord/interface/RPCInverseCPPFLinkMapRcd.h
"
11
12
RPCInverseCPPFLinkMapESProducer::RPCInverseCPPFLinkMapESProducer
(
edm::ParameterSet
const
& _config)
13
: inverse_linkmap_(new
RPCInverseAMCLinkMap
())
14
{
15
setWhatProduced
(
this
,
edm::eventsetup::dependsOn
(&
RPCInverseCPPFLinkMapESProducer::RPCCPPFLinkMapCallback
));
16
}
17
18
void
RPCInverseCPPFLinkMapESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& _descs)
19
{
20
edm::ParameterSetDescription
_desc;
21
_descs.
add
(
"RPCInverseCPPFLinkMapESProducer"
, _desc);
22
}
23
24
void
RPCInverseCPPFLinkMapESProducer::RPCCPPFLinkMapCallback
(
RPCCPPFLinkMapRcd
const
& _rcd)
25
{
26
RPCInverseAMCLinkMap::map_type
& _inverse_map(
inverse_linkmap_
->getMap());
27
_inverse_map.clear();
28
29
edm::ESHandle<RPCAMCLinkMap>
_es_map;
30
_rcd.
get
(_es_map);
31
RPCAMCLinkMap
const
& _map = *(_es_map.
product
());
32
for
(
auto
const
& _link : _map.
getMap
()) {
33
_inverse_map.insert(
RPCInverseAMCLinkMap::map_type::value_type
(_link.second, _link.first));
34
}
35
}
36
37
std::shared_ptr<RPCInverseAMCLinkMap>
RPCInverseCPPFLinkMapESProducer::produce
(
RPCInverseCPPFLinkMapRcd
const
& _rcd)
38
{
39
return
inverse_linkmap_
;
40
}
41
42
//define this as a module
43
#include "
FWCore/Framework/interface/ModuleFactory.h
"
44
DEFINE_FWK_EVENTSETUP_MODULE
(
RPCInverseCPPFLinkMapESProducer
);
edm::eventsetup::dependsOn
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
Definition:
eventsetup_dependsOn.h:190
RPCAMCLinkMap.h
RPCInverseCPPFLinkMapESProducer
Definition:
RPCInverseCPPFLinkMapESProducer.h:18
RPCCPPFLinkMapRcd
Definition:
RPCCPPFLinkMapRcd.h:6
edm::ESProducer::setWhatProduced
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition:
ESProducer.h:115
RPCInverseCPPFLinkMapESProducer::RPCCPPFLinkMapCallback
void RPCCPPFLinkMapCallback(RPCCPPFLinkMapRcd const &_rcd)
Definition:
RPCInverseCPPFLinkMapESProducer.cc:24
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
ParameterSet.h
RPCInverseCPPFLinkMapESProducer::RPCInverseCPPFLinkMapESProducer
RPCInverseCPPFLinkMapESProducer(edm::ParameterSet const &_config)
Definition:
RPCInverseCPPFLinkMapESProducer.cc:12
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
ParameterSetDescription.h
edm::ESHandle< RPCAMCLinkMap >
RPCInverseAMCLinkMap::map_type
std::multimap< RPCLBLink, RPCAMCLink > map_type
Definition:
RPCInverseAMCLinkMap.h:12
RPCInverseAMCLinkMap
Definition:
RPCInverseAMCLinkMap.h:9
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:105
RPCAMCLinkMap::getMap
map_type & getMap()
Definition:
RPCAMCLinkMap.h:28
ESHandle.h
RPCInverseCPPFLinkMapESProducer::produce
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseCPPFLinkMapRcd const &_rcd)
Definition:
RPCInverseCPPFLinkMapESProducer.cc:37
RPCAMCLinkMap
Definition:
RPCAMCLinkMap.h:11
RPCCPPFLinkMapRcd.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:67
edm::ParameterSet
Definition:
ParameterSet.h:36
ModuleFactory.h
RPCInverseCPPFLinkMapRcd.h
ConfigurationDescriptions.h
RPCInverseCPPFLinkMapESProducer.h
RPCInverseCPPFLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition:
RPCInverseCPPFLinkMapESProducer.cc:18
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
RPCInverseCPPFLinkMapRcd
Definition:
RPCInverseCPPFLinkMapRcd.h:9
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
RPCInverseCPPFLinkMapESProducer::inverse_linkmap_
std::shared_ptr< RPCInverseAMCLinkMap > inverse_linkmap_
Definition:
RPCInverseCPPFLinkMapESProducer.h:31
Generated for CMSSW Reference Manual by
1.8.11