1 #ifndef PhysicsTools_TagAndProbe_interface_AnythingToValueMap_h 2 #define PhysicsTools_TagAndProbe_interface_AnythingToValueMap_h 15 template<
class Adaptor,
class Collection =
typename Adaptor::Collection,
typename value_type =
typename Adaptor::value_type>
36 template<
class Adaptor,
class Collection,
typename value_type>
42 bool adaptorOk =
adaptor_.init(iEvent);
45 std::vector<value_type> ret;
46 ret.reserve(handle->size());
50 auto map = std::make_unique<Map>();
52 filler.insert(handle, ret.begin(), ret.end());
57 template<
class Adaptor,
class Collection =
typename Adaptor::Collection,
typename value_type =
typename Adaptor::value_type>
64 src_(
consumes<Collection>(iConfig.getParameter<
edm::InputTag>(
"collection"))),
65 inputs_(iConfig.getParameter<
std::vector<
edm::InputTag> >(
"associations"))
67 for (std::vector<edm::InputTag>::const_iterator it = inputs_.begin(), ed = inputs_.end(); it != ed; ++it) {
69 produces< Map >(adaptors_.back().label());
83 template<
class Adaptor,
class Collection,
typename value_type>
89 std::vector<value_type> ret;
90 ret.reserve(handle->size());
92 for (
typename std::vector<Adaptor>::iterator it = adaptors_.begin(), ed = adaptors_.end(); it != ed; ++it) {
94 if (it->run(iEvent, *handle, ret)) {
95 auto map = std::make_unique<Map>();
97 filler.insert(handle, ret.begin(), ret.end());
edm::ValueMap< value_type > Map
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::InputTag > inputs_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)