CMS 3D CMS Logo

RPCInverseOMTFLinkMapESProducer.cc
Go to the documentation of this file.
2 
9 
13 
15  auto cc = setWhatProduced(this);
17 }
18 
21  _descs.add("RPCInverseOMTFLinkMapESProducer", _desc);
22 }
23 
25  RPCInverseAMCLinkMap* inverse_linkmap) {
26  RPCInverseAMCLinkMap::map_type& _inverse_map(inverse_linkmap->getMap());
27  _inverse_map.clear();
28 
29  RPCAMCLinkMap const& _map = _rcd.get(es_rpc_omt_l_map_token_);
30 
31  for (auto const& _link : _map.getMap()) {
32  _inverse_map.insert(RPCInverseAMCLinkMap::map_type::value_type(_link.second, _link.first));
33  }
34 }
35 
36 std::shared_ptr<RPCInverseAMCLinkMap> RPCInverseOMTFLinkMapESProducer::produce(RPCInverseOMTFLinkMapRcd const& _rcd) {
37  auto host = holder_.makeOrGet([]() { return new HostType; });
38 
39  host->ifRecordChanges<RPCOMTFLinkMapRcd>(_rcd,
40  [this, h = host.get()](auto const& rec) { setupRPCOMTFLinkMap(rec, h); });
41 
42  return host;
43 }
44 
45 //define this as a module
edm::ESProductHost< RPCInverseAMCLinkMap, RPCOMTFLinkMapRcd > HostType
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
string host
Definition: query.py:115
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< RPCAMCLinkMap, RPCOMTFLinkMapRcd > es_rpc_omt_l_map_token_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
std::multimap< RPCLBLink, RPCAMCLink > map_type
map_type & getMap()
Definition: RPCAMCLinkMap.h:27
#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.
void setupRPCOMTFLinkMap(RPCOMTFLinkMapRcd const &, RPCInverseAMCLinkMap *)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ReusableObjectHolder< HostType > holder_
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseOMTFLinkMapRcd const &_rcd)
RPCInverseOMTFLinkMapESProducer(edm::ParameterSet const &_config)