CMS 3D CMS Logo

RPCInverseCPPFLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13  setWhatProduced(this);
14 }
15 
18  _descs.add("RPCInverseCPPFLinkMapESProducer", _desc);
19 }
20 
22  RPCInverseAMCLinkMap* inverse_linkmap) {
23  RPCInverseAMCLinkMap::map_type& _inverse_map(inverse_linkmap->getMap());
24  _inverse_map.clear();
25 
27  _rcd.get(_es_map);
28  RPCAMCLinkMap const& _map = *(_es_map.product());
29  for (auto const& _link : _map.getMap()) {
30  _inverse_map.insert(RPCInverseAMCLinkMap::map_type::value_type(_link.second, _link.first));
31  }
32 }
33 
34 std::shared_ptr<RPCInverseAMCLinkMap> RPCInverseCPPFLinkMapESProducer::produce(RPCInverseCPPFLinkMapRcd const& _rcd) {
35  auto host = holder_.makeOrGet([]() { return new HostType; });
36 
37  host->ifRecordChanges<RPCCPPFLinkMapRcd>(_rcd,
38  [this, h = host.get()](auto const& rec) { setupRPCCPPFLinkMap(rec, h); });
39 
40  return host;
41 }
42 
43 //define this as a module
ConfigurationDescriptions.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
RPCInverseCPPFLinkMapESProducer::setupRPCCPPFLinkMap
void setupRPCCPPFLinkMap(RPCCPPFLinkMapRcd const &, RPCInverseAMCLinkMap *)
Definition: RPCInverseCPPFLinkMapESProducer.cc:21
RPCInverseAMCLinkMap
Definition: RPCInverseAMCLinkMap.h:9
RPCInverseCPPFLinkMapESProducer::RPCInverseCPPFLinkMapESProducer
RPCInverseCPPFLinkMapESProducer(edm::ParameterSet const &_config)
Definition: RPCInverseCPPFLinkMapESProducer.cc:12
ESHandle.h
RPCInverseAMCLinkMap::map_type
std::multimap< RPCLBLink, RPCAMCLink > map_type
Definition: RPCInverseAMCLinkMap.h:11
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
RPCInverseCPPFLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition: RPCInverseCPPFLinkMapESProducer.cc:16
query.host
host
Definition: query.py:115
RPCAMCLinkMap.h
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
RPCInverseCPPFLinkMapESProducer::produce
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseCPPFLinkMapRcd const &_rcd)
Definition: RPCInverseCPPFLinkMapESProducer.cc:34
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
RPCInverseCPPFLinkMapRcd.h
RPCInverseCPPFLinkMapESProducer
Definition: RPCInverseCPPFLinkMapESProducer.h:20
edm::ESHandle< RPCAMCLinkMap >
h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
RPCInverseAMCLinkMap::getMap
map_type & getMap()
Definition: RPCInverseAMCLinkMap.h:23
edm::ParameterSet
Definition: ParameterSet.h:36
RPCInverseCPPFLinkMapESProducer::HostType
edm::ESProductHost< RPCInverseAMCLinkMap, RPCCPPFLinkMapRcd > HostType
Definition: RPCInverseCPPFLinkMapESProducer.h:29
RPCInverseCPPFLinkMapESProducer::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: RPCInverseCPPFLinkMapESProducer.h:33
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
RPCInverseCPPFLinkMapRcd
Definition: RPCInverseCPPFLinkMapRcd.h:9
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
RPCCPPFLinkMapRcd
Definition: RPCCPPFLinkMapRcd.h:6
RPCCPPFLinkMapRcd.h
RPCInverseCPPFLinkMapESProducer.h
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
RPCAMCLinkMap::getMap
map_type & getMap()
Definition: RPCAMCLinkMap.h:27
ParameterSet.h