CMS 3D CMS Logo

RPCInverseTwinMuxLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13 {
14  setWhatProduced(this);
15 }
16 
18 {
20  _descs.add("RPCInverseTwinMuxLinkMapESProducer", _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  RPCAMCLinkMap const & _map = *(_es_map.product());
32  for (auto const & _link : _map.getMap()) {
33  _inverse_map.insert(RPCInverseAMCLinkMap::map_type::value_type(_link.second, _link.first));
34  }
35 }
36 
37 std::shared_ptr<RPCInverseAMCLinkMap> RPCInverseTwinMuxLinkMapESProducer::produce(RPCInverseTwinMuxLinkMapRcd const & _rcd)
38 {
39  auto host = holder_.makeOrGet([]() {
40  return new HostType;
41  });
42 
43  host->ifRecordChanges<RPCTwinMuxLinkMapRcd>(_rcd,
44  [this,h=host.get()](auto const& rec) {
45  setupRPCTwinMuxLinkMap(rec, h);
46  });
47 
48  return host;
49 }
50 
51 //define this as a module
host
Definition: query.py:115
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseTwinMuxLinkMapRcd const &_rcd)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
RPCInverseTwinMuxLinkMapESProducer(edm::ParameterSet const &_config)
edm::ReusableObjectHolder< HostType > holder_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
edm::ESProductHost< RPCInverseAMCLinkMap, RPCTwinMuxLinkMapRcd > HostType
std::multimap< RPCLBLink, RPCAMCLink > map_type
void get(HolderT &iHolder) const
map_type & getMap()
Definition: RPCAMCLinkMap.h:28
#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