44 produces<reco::CandidateBaseRefVector>();
51 std::auto_ptr<reco::CandidateBaseRefVector>
output(
55 for (
size_t i = 0;
i < cands->size(); ++
i)
56 output->push_back(cands->refAt(
i));
58 for (
size_t i = 0;
i < cands->size() && output->size() <
choose_; ++
i) {
61 double selectionProb =
62 (
choose_ - output->size())*1.0/(cands->size() -
i);
64 if (
randy_.Rndm() < selectionProb)
65 output->push_back(cands->refAt(
i));
68 size_t outputSize = output->size();
70 return ( !
filter_ || outputSize );
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
CandViewRefRandomSelector(const edm::ParameterSet &pset)
bool filter(edm::Event &, const edm::EventSetup &) override