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
ConfigurationDescriptions.h
RPCInverseLBLinkMapESProducer
Definition: RPCInverseLBLinkMapESProducer.h:23
RPCInverseLBLinkMapESProducer::RPCInverseLBLinkMapESProducer
RPCInverseLBLinkMapESProducer(edm::ParameterSet const &_config)
Definition: RPCInverseLBLinkMapESProducer.cc:16
RPCInverseLBLinkMapESProducer::es_rpc_lb_map_token_
edm::ESGetToken< RPCLBLinkMap, RPCLBLinkMapRcd > es_rpc_lb_map_token_
Definition: RPCInverseLBLinkMapESProducer.h:38
ESHandle.h
RPCInverseLBLinkMap
Definition: RPCInverseLBLinkMap.h:11
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RPCLBLinkMap::getMap
map_type & getMap()
Definition: RPCLBLinkMap.h:27
query.host
string host
Definition: query.py:115
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
RPCLBLinkMap.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
RPCInverseLBLinkMapRcd.h
RPCInverseLBLinkMapESProducer.h
h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
RPCDetId.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
RPCInverseLBLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition: RPCInverseLBLinkMapESProducer.cc:22
RPCInverseLBLinkMapESProducer::produce
std::shared_ptr< RPCInverseLBLinkMap > produce(RPCInverseLBLinkMapRcd const &_rcd)
Definition: RPCInverseLBLinkMapESProducer.cc:39
RPCInverseLBLinkMapESProducer::setupRPCLBLinkMap
void setupRPCLBLinkMap(RPCLBLinkMapRcd const &, RPCInverseLBLinkMap *)
Definition: RPCInverseLBLinkMapESProducer.cc:27
RPCLBLinkMap
Definition: RPCLBLinkMap.h:11
RPCInverseLBLinkMapRcd
Definition: RPCInverseLBLinkMapRcd.h:9
RPCLBLinkMapRcd
Definition: RPCLBLinkMapRcd.h:6
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
cc
RPCInverseLBLinkMap::getMap
map_type & getMap()
Definition: RPCInverseLBLinkMap.h:25
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
EventSetup.h
RPCInverseLBLinkMapESProducer::HostType
edm::ESProductHost< RPCInverseLBLinkMap, RPCLBLinkMapRcd > HostType
Definition: RPCInverseLBLinkMapESProducer.h:32
RPCInverseLBLinkMap::map_type
std::multimap< std::uint32_t, std::pair< RPCLBLink, RPCFebConnector > > map_type
Definition: RPCInverseLBLinkMap.h:13
RPCInverseLBLinkMapESProducer::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: RPCInverseLBLinkMapESProducer.h:36
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
ParameterSet.h
RPCLBLinkMapRcd.h