1 #ifndef CommonTools_UtilAlgos_AssociationVectorSelector_h 2 #define CommonTools_UtilAlgos_AssociationVectorSelector_h 15 template <
typename KeyRefProd,
typename CVal,
typename KeySelector = AnySelector,
typename ValSelector = AnySelector>
35 template <
typename KeyRefProd,
typename CVal,
typename KeySelector,
typename ValSelector>
42 produces<collection_t>().setBranchAlias(
alias);
43 produces<association_t>().setBranchAlias(
alias +
"Association");
46 template <
typename KeyRefProd,
typename CVal,
typename KeySelector,
typename ValSelector>
54 vector<typename CVal::value_type> selectedValues;
56 selected->reserve(size);
57 selectedValues.reserve(size);
60 if (selectKey_(
obj) && selectVal_(
i->second)) {
63 selectedValues.push_back(
i->second);
69 unique_ptr<association_t> selectedAssociation(
new association_t(ref, selected.get()));
70 size = selected->size();
72 for (
size_t i = 0;
i != size; ++
i)
73 selectedAssociation->setValue(
i, selectedValues[
i]);
std::tuple< sharedEnergyAndScore_t, sharedEnergyAndScore_t > association_t
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
transient_vector_type::const_iterator const_iterator
S make(const edm::ParameterSet &cfg)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
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 &)