CMS 3D CMS Logo

RPCInverseTwinMuxLinkMapESProducer.cc
Go to the documentation of this file.
2 
9 
13 
15  auto cc = setWhatProduced(this);
17 }
18 
21  _descs.add("RPCInverseTwinMuxLinkMapESProducer", _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_tm_l_map_token_);
30  for (auto const& _link : _map.getMap()) {
31  _inverse_map.insert(RPCInverseAMCLinkMap::map_type::value_type(_link.second, _link.first));
32  }
33 }
34 
35 std::shared_ptr<RPCInverseAMCLinkMap> RPCInverseTwinMuxLinkMapESProducer::produce(
36  RPCInverseTwinMuxLinkMapRcd const& _rcd) {
37  auto host = holder_.makeOrGet([]() { return new HostType; });
38 
39  host->ifRecordChanges<RPCTwinMuxLinkMapRcd>(
40  _rcd, [this, h = host.get()](auto const& rec) { setupRPCTwinMuxLinkMap(rec, h); });
41 
42  return host;
43 }
44 
45 //define this as a module
ConfigurationDescriptions.h
RPCInverseTwinMuxLinkMapESProducer::RPCInverseTwinMuxLinkMapESProducer
RPCInverseTwinMuxLinkMapESProducer(edm::ParameterSet const &_config)
Definition: RPCInverseTwinMuxLinkMapESProducer.cc:14
RPCInverseAMCLinkMap
Definition: RPCInverseAMCLinkMap.h:9
ESHandle.h
RPCInverseAMCLinkMap::map_type
std::multimap< RPCLBLink, RPCAMCLink > map_type
Definition: RPCInverseAMCLinkMap.h:11
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RPCInverseTwinMuxLinkMapESProducer::es_rpc_tm_l_map_token_
edm::ESGetToken< RPCAMCLinkMap, RPCTwinMuxLinkMapRcd > es_rpc_tm_l_map_token_
Definition: RPCInverseTwinMuxLinkMapESProducer.h:38
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
RPCInverseTwinMuxLinkMapESProducer::produce
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseTwinMuxLinkMapRcd const &_rcd)
Definition: RPCInverseTwinMuxLinkMapESProducer.cc:35
query.host
string host
Definition: query.py:115
RPCInverseTwinMuxLinkMapESProducer
Definition: RPCInverseTwinMuxLinkMapESProducer.h:23
RPCAMCLinkMap.h
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
RPCTwinMuxLinkMapRcd.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
RPCInverseAMCLinkMap::getMap
map_type & getMap()
Definition: RPCInverseAMCLinkMap.h:23
RPCInverseTwinMuxLinkMapESProducer::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: RPCInverseTwinMuxLinkMapESProducer.h:36
edm::ParameterSet
Definition: ParameterSet.h:47
RPCInverseTwinMuxLinkMapRcd.h
Event.h
RPCInverseTwinMuxLinkMapESProducer::setupRPCTwinMuxLinkMap
void setupRPCTwinMuxLinkMap(RPCTwinMuxLinkMapRcd const &, RPCInverseAMCLinkMap *)
Definition: RPCInverseTwinMuxLinkMapESProducer.cc:24
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
cc
RPCInverseTwinMuxLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition: RPCInverseTwinMuxLinkMapESProducer.cc:19
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
RPCInverseTwinMuxLinkMapRcd
Definition: RPCInverseTwinMuxLinkMapRcd.h:9
RPCInverseTwinMuxLinkMapESProducer::HostType
edm::ESProductHost< RPCInverseAMCLinkMap, RPCTwinMuxLinkMapRcd > HostType
Definition: RPCInverseTwinMuxLinkMapESProducer.h:32
EventSetup.h
RPCInverseTwinMuxLinkMapESProducer.h
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
RPCAMCLinkMap::getMap
map_type & getMap()
Definition: RPCAMCLinkMap.h:27
ParameterSet.h
RPCTwinMuxLinkMapRcd
Definition: RPCTwinMuxLinkMapRcd.h:6