CMS 3D CMS Logo

RPCInverseOMTFLinkMapESProducer.cc
Go to the documentation of this file.
2 
7 
11 
13  setWhatProduced(this);
14 }
15 
18  _descs.add("RPCInverseOMTFLinkMapESProducer", _desc);
19 }
20 
22  RPCInverseAMCLinkMap* inverse_linkmap) {
23  RPCInverseAMCLinkMap::map_type& _inverse_map(inverse_linkmap->getMap());
24  _inverse_map.clear();
25 
27  _rcd.get(_es_map);
28 
29  RPCAMCLinkMap const& _map = *(_es_map.product());
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> RPCInverseOMTFLinkMapESProducer::produce(RPCInverseOMTFLinkMapRcd const& _rcd) {
36  auto host = holder_.makeOrGet([]() { return new HostType; });
37 
38  host->ifRecordChanges<RPCOMTFLinkMapRcd>(_rcd,
39  [this, h = host.get()](auto const& rec) { setupRPCOMTFLinkMap(rec, h); });
40 
41  return host;
42 }
43 
44 //define this as a module
ConfigurationDescriptions.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
RPCInverseAMCLinkMap
Definition: RPCInverseAMCLinkMap.h:9
ESHandle.h
RPCOMTFLinkMapRcd
Definition: RPCOMTFLinkMapRcd.h:6
RPCInverseOMTFLinkMapESProducer::produce
std::shared_ptr< RPCInverseAMCLinkMap > produce(RPCInverseOMTFLinkMapRcd const &_rcd)
Definition: RPCInverseOMTFLinkMapESProducer.cc:35
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:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RPCInverseOMTFLinkMapESProducer::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: RPCInverseOMTFLinkMapESProducer.h:33
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
RPCInverseOMTFLinkMapESProducer::HostType
edm::ESProductHost< RPCInverseAMCLinkMap, RPCOMTFLinkMapRcd > HostType
Definition: RPCInverseOMTFLinkMapESProducer.h:29
query.host
host
Definition: query.py:115
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
RPCInverseOMTFLinkMapRcd
Definition: RPCInverseOMTFLinkMapRcd.h:9
RPCInverseOMTFLinkMapESProducer.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< RPCAMCLinkMap >
h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
RPCInverseAMCLinkMap::getMap
map_type & getMap()
Definition: RPCInverseAMCLinkMap.h:23
edm::ParameterSet
Definition: ParameterSet.h:36
RPCInverseOMTFLinkMapESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &_descs)
Definition: RPCInverseOMTFLinkMapESProducer.cc:16
RPCInverseOMTFLinkMapRcd.h
RPCInverseOMTFLinkMapESProducer::setupRPCOMTFLinkMap
void setupRPCOMTFLinkMap(RPCOMTFLinkMapRcd const &, RPCInverseAMCLinkMap *)
Definition: RPCInverseOMTFLinkMapESProducer.cc:21
RPCInverseOMTFLinkMapESProducer
Definition: RPCInverseOMTFLinkMapESProducer.h:20
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
RPCOMTFLinkMapRcd.h
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
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
RPCInverseOMTFLinkMapESProducer::RPCInverseOMTFLinkMapESProducer
RPCInverseOMTFLinkMapESProducer(edm::ParameterSet const &_config)
Definition: RPCInverseOMTFLinkMapESProducer.cc:12