CMS 3D CMS Logo

RPCInverseTwinMuxLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13  setWhatProduced(this);
14 }
15 
18  _descs.add("RPCInverseTwinMuxLinkMapESProducer", _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> RPCInverseTwinMuxLinkMapESProducer::produce(
35  RPCInverseTwinMuxLinkMapRcd const& _rcd) {
36  auto host = holder_.makeOrGet([]() { return new HostType; });
37 
38  host->ifRecordChanges<RPCTwinMuxLinkMapRcd>(
39  _rcd, [this, h = host.get()](auto const& rec) { setupRPCTwinMuxLinkMap(rec, h); });
40 
41  return host;
42 }
43 
44 //define this as a module
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
host
Definition: query.py:115
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseTwinMuxLinkMapRcd const &_rcd)
RPCInverseTwinMuxLinkMapESProducer(edm::ParameterSet const &_config)
edm::ReusableObjectHolder< HostType > holder_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
edm::ESProductHost< RPCInverseAMCLinkMap, RPCTwinMuxLinkMapRcd > HostType
std::multimap< RPCLBLink, RPCAMCLink > map_type
map_type & getMap()
Definition: RPCAMCLinkMap.h:27
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn&#39;t an object already available, creates a new one using iFunc.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void setupRPCTwinMuxLinkMap(RPCTwinMuxLinkMapRcd const &, RPCInverseAMCLinkMap *)
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
T const * product() const
Definition: ESHandle.h:86