CMS 3D CMS Logo

RPCInverseOMTFLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13 {
14  setWhatProduced(this);
15 }
16 
18 {
20  _descs.add("RPCInverseOMTFLinkMapESProducer", _desc);
21 }
22 
24  RPCInverseAMCLinkMap* inverse_linkmap)
25 {
26  RPCInverseAMCLinkMap::map_type & _inverse_map(inverse_linkmap->getMap());
27  _inverse_map.clear();
28 
30  _rcd.get(_es_map);
31 
32  RPCAMCLinkMap const & _map = *(_es_map.product());
33  for (auto const & _link : _map.getMap()) {
34  _inverse_map.insert(RPCInverseAMCLinkMap::map_type::value_type(_link.second, _link.first));
35  }
36 }
37 
38 std::shared_ptr<RPCInverseAMCLinkMap> RPCInverseOMTFLinkMapESProducer::produce(RPCInverseOMTFLinkMapRcd const & _rcd)
39 {
40  auto host = holder_.makeOrGet([]() {
41  return new HostType;
42  });
43 
44  host->ifRecordChanges<RPCOMTFLinkMapRcd>(_rcd,
45  [this,h=host.get()](auto const& rec) {
46  setupRPCOMTFLinkMap(rec, h);
47  });
48 
49  return host;
50 }
51 
52 //define this as a module
edm::ESProductHost< RPCInverseAMCLinkMap, RPCOMTFLinkMapRcd > HostType
host
Definition: query.py:115
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::multimap< RPCLBLink, RPCAMCLink > map_type
void get(HolderT &iHolder) const
map_type & getMap()
Definition: RPCAMCLinkMap.h:28
void setupRPCOMTFLinkMap(RPCOMTFLinkMapRcd const &, RPCInverseAMCLinkMap *)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ReusableObjectHolder< HostType > holder_
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
T const * product() const
Definition: ESHandle.h:86
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseOMTFLinkMapRcd const &_rcd)
RPCInverseOMTFLinkMapESProducer(edm::ParameterSet const &_config)