Main Page
Namespaces
Classes
Package Documentation
CondTools
RPC
plugins
RPCInverseLBLinkMapESProducer.cc
Go to the documentation of this file.
1
#include "
CondTools/RPC/plugins/RPCInverseLBLinkMapESProducer.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/RPCLBLinkMap.h
"
9
#include "
CondFormats/DataRecord/interface/RPCLBLinkMapRcd.h
"
10
#include "
CondFormats/DataRecord/interface/RPCInverseLBLinkMapRcd.h
"
11
12
#include "
DataFormats/MuonDetId/interface/RPCDetId.h
"
13
14
RPCInverseLBLinkMapESProducer::RPCInverseLBLinkMapESProducer
(
edm::ParameterSet
const
& _config)
15
: inverse_linkmap_(new
RPCInverseLBLinkMap
())
16
{
17
setWhatProduced
(
this
,
edm::eventsetup::dependsOn
(&
RPCInverseLBLinkMapESProducer::RPCLBLinkMapCallback
));
18
}
19
20
void
RPCInverseLBLinkMapESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& _descs)
21
{
22
edm::ParameterSetDescription
_desc;
23
_descs.
add
(
"RPCInverseLBLinkMapESProducer"
, _desc);
24
}
25
26
void
RPCInverseLBLinkMapESProducer::RPCLBLinkMapCallback
(
RPCLBLinkMapRcd
const
& _rcd)
27
{
28
RPCInverseLBLinkMap::map_type
& _inverse_map(
inverse_linkmap_
->getMap());
29
_inverse_map.clear();
30
31
edm::ESHandle<RPCLBLinkMap>
_es_map;
32
_rcd.
get
(_es_map);
33
RPCLBLinkMap
const
& _map = *(_es_map.
product
());
34
for
(
auto
const
& _link : _map.
getMap
()) {
35
_inverse_map.insert(
RPCInverseLBLinkMap::map_type::value_type
(_link.second.getRPCDetId().rawId(), _link));
36
}
37
}
38
39
std::shared_ptr<RPCInverseLBLinkMap>
RPCInverseLBLinkMapESProducer::produce
(
RPCInverseLBLinkMapRcd
const
& _rcd)
40
{
41
return
inverse_linkmap_
;
42
}
43
44
//define this as a module
45
#include "
FWCore/Framework/interface/ModuleFactory.h
"
46
DEFINE_FWK_EVENTSETUP_MODULE
(
RPCInverseLBLinkMapESProducer
);
RPCInverseLBLinkMapESProducer::RPCInverseLBLinkMapESProducer
RPCInverseLBLinkMapESProducer(edm::ParameterSet const &_config)
Definition:
RPCInverseLBLinkMapESProducer.cc:14
edm::eventsetup::dependsOn
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
Definition:
eventsetup_dependsOn.h:190
RPCDetId.h
RPCInverseLBLinkMap
Definition:
RPCInverseLBLinkMap.h:11
edm::ESProducer::setWhatProduced
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition:
ESProducer.h:115
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
RPCInverseLBLinkMapESProducer.h
ParameterSet.h
RPCInverseLBLinkMapESProducer
Definition:
RPCInverseLBLinkMapESProducer.h:18
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
ParameterSetDescription.h
RPCInverseLBLinkMapRcd
Definition:
RPCInverseLBLinkMapRcd.h:9
edm::ESHandle< RPCLBLinkMap >
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:105
ESHandle.h
RPCInverseLBLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition:
RPCInverseLBLinkMapESProducer.cc:20
RPCInverseLBLinkMapESProducer::RPCLBLinkMapCallback
void RPCLBLinkMapCallback(RPCLBLinkMapRcd const &_rcd)
Definition:
RPCInverseLBLinkMapESProducer.cc:26
RPCLBLinkMap::getMap
map_type & getMap()
Definition:
RPCLBLinkMap.h:28
RPCInverseLBLinkMapESProducer::inverse_linkmap_
std::shared_ptr< RPCInverseLBLinkMap > inverse_linkmap_
Definition:
RPCInverseLBLinkMapESProducer.h:31
RPCInverseLBLinkMapRcd.h
RPCLBLinkMapRcd
Definition:
RPCLBLinkMapRcd.h:6
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
RPCInverseLBLinkMap::map_type
std::multimap< std::uint32_t, std::pair< RPCLBLink, RPCFebConnector > > map_type
Definition:
RPCInverseLBLinkMap.h:14
RPCInverseLBLinkMapESProducer::produce
std::shared_ptr< RPCInverseLBLinkMap > produce(RPCInverseLBLinkMapRcd const &_rcd)
Definition:
RPCInverseLBLinkMapESProducer.cc:39
edm::ParameterSet
Definition:
ParameterSet.h:36
ModuleFactory.h
ConfigurationDescriptions.h
RPCLBLinkMap
Definition:
RPCLBLinkMap.h:11
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
RPCLBLinkMap.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
RPCLBLinkMapRcd.h
Generated for CMSSW Reference Manual by
1.8.11