1 #ifndef CommonTools_UtilAlgos_AssociationVectorSelector_h 2 #define CommonTools_UtilAlgos_AssociationVectorSelector_h 15 template<
typename KeyRefProd,
typename CVal,
35 template<
typename KeyRefProd,
typename CVal,
typename KeySelector,
typename ValSelector>
41 produces<collection_t>().setBranchAlias(alias);
42 produces<association_t>().setBranchAlias(alias +
"Association");
45 template<
typename KeyRefProd,
typename CVal,
typename KeySelector,
typename ValSelector>
52 vector<typename CVal::value_type> selectedValues;
53 size_t size = association->size();
54 selected->reserve(size);
55 selectedValues.reserve(size);
57 i != association->end(); ++
i) {
62 selectedValues.push_back(
i->second);
68 unique_ptr<association_t> selectedAssociation(
new association_t(ref, selected.get()));
69 size = selected->size();
71 for(
size_t i = 0;
i !=
size; ++
i)
72 selectedAssociation->setValue(
i, selectedValues[
i]);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
transient_vector_type::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
S make(const edm::ParameterSet &cfg)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< association_t > associationToken_
void produce(edm::Event &, const edm::EventSetup &) override
def template(fileName, svg, replaceme="REPLACEME")
association_t::CKey collection_t
KeyRefProd::product_type CKey
RefProd< PROD > getRefBeforePut()
KeyRef::value_type key_type
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
edm::AssociationVector< KeyRefProd, CVal > association_t
AssociationVectorSelector(const edm::ParameterSet &)