CMS 3D CMS Logo

RPCInverseLBLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13 
15  setWhatProduced(this);
16 }
17 
20  _descs.add("RPCInverseLBLinkMapESProducer", _desc);
21 }
22 
24  RPCInverseLBLinkMap* inverse_linkmap) {
25  RPCInverseLBLinkMap::map_type& _inverse_map(inverse_linkmap->getMap());
26  _inverse_map.clear();
27 
29  _rcd.get(_es_map);
30  RPCLBLinkMap const& _map = *(_es_map.product());
31  for (auto const& _link : _map.getMap()) {
32  _inverse_map.insert(RPCInverseLBLinkMap::map_type::value_type(_link.second.getRPCDetId().rawId(), _link));
33  }
34 }
35 
36 std::shared_ptr<RPCInverseLBLinkMap> RPCInverseLBLinkMapESProducer::produce(RPCInverseLBLinkMapRcd const& _rcd) {
37  auto host = holder_.makeOrGet([]() { return new HostType; });
38 
39  host->ifRecordChanges<RPCLBLinkMapRcd>(_rcd, [this, h = host.get()](auto const& rec) { setupRPCLBLinkMap(rec, h); });
40 
41  return host;
42 }
43 
44 //define this as a module
edm::ESProductHost< RPCInverseLBLinkMap, RPCLBLinkMapRcd > HostType
RPCInverseLBLinkMapESProducer(edm::ParameterSet const &_config)
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.
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn&#39;t an object already available, creates a new one using iFunc.
map_type & getMap()
Definition: RPCLBLinkMap.h:27
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void setupRPCLBLinkMap(RPCLBLinkMapRcd const &, RPCInverseLBLinkMap *)
edm::ReusableObjectHolder< HostType > holder_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::multimap< std::uint32_t, std::pair< RPCLBLink, RPCFebConnector > > map_type
std::shared_ptr< RPCInverseLBLinkMap > produce(RPCInverseLBLinkMapRcd const &_rcd)
T const * product() const
Definition: ESHandle.h:86