CMS 3D CMS Logo

RPCInverseLBLinkMapESProducer.cc
Go to the documentation of this file.
2 
9 
13 
15 
17  auto cc = setWhatProduced(this);
18 
20 }
21 
24  _descs.add("RPCInverseLBLinkMapESProducer", _desc);
25 }
26 
28  RPCInverseLBLinkMap* inverse_linkmap) {
29  RPCInverseLBLinkMap::map_type& _inverse_map(inverse_linkmap->getMap());
30  _inverse_map.clear();
31 
32  RPCLBLinkMap const& _map = _rcd.get(es_rpc_lb_map_token_);
33 
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  auto host = holder_.makeOrGet([]() { return new HostType; });
41 
42  host->ifRecordChanges<RPCLBLinkMapRcd>(_rcd, [this, h = host.get()](auto const& rec) { setupRPCLBLinkMap(rec, h); });
43 
44  return host;
45 }
46 
47 //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:165
string host
Definition: query.py:115
edm::ESGetToken< RPCLBLinkMap, RPCLBLinkMapRcd > es_rpc_lb_map_token_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
std::shared_ptr< T > makeOrGet(FM &&iMakeFunc)
Takes an object from the queue if one is available, or creates one using iMakeFunc.
map_type & getMap()
Definition: RPCLBLinkMap.h:27
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4