1 #ifndef PhysicsTools_TagAndProbe_interface_AnythingToValueMap_h
2 #define PhysicsTools_TagAndProbe_interface_AnythingToValueMap_h
16 template <
class Adaptor,
17 class Collection =
typename Adaptor::Collection,
39 template <
class Adaptor,
class Collection,
typename value_type>
47 bool adaptorOk = adaptor_.init(iEvent);
48 if ((!adaptorOk) && failSilently_)
51 std::vector<value_type>
ret;
52 ret.reserve(handle->size());
54 adaptor_.run(*handle, ret);
56 auto map = std::make_unique<Map>();
58 filler.insert(handle, ret.begin(), ret.end());
63 template <
class Adaptor,
64 class Collection =
typename Adaptor::Collection,
74 for (std::vector<edm::InputTag>::const_iterator it =
inputs_.begin(), ed =
inputs_.end(); it != ed; ++it) {
90 template <
class Adaptor,
class Collection,
typename value_type>
98 std::vector<value_type>
ret;
99 ret.reserve(handle->size());
101 for (
typename std::vector<Adaptor>::iterator it = adaptors_.begin(), ed = adaptors_.end(); it != ed; ++it) {
103 if (it->run(iEvent, *handle, ret)) {
104 auto map = std::make_unique<Map>();
106 filler.insert(handle, ret.begin(), ret.end());
111 throw cms::Exception(
"ManyThingsToValueMaps") <<
"Error in adapter " << it->label() <<
"\n";
edm::ValueMap< value_type > Map
tuple ret
prodAgent to be discontinued
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~ManyThingsToValueMaps() override
~AnythingToValueMap() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::InputTag > inputs_
Container::value_type value_type
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
AnythingToValueMap(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< Collection > src_
std::vector< Adaptor > adaptors_
edm::ValueMap< value_type > Map
edm::EDGetTokenT< Collection > src_
ManyThingsToValueMaps(const edm::ParameterSet &iConfig)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override