37 : minPt_(pset.getParameter<double>(
"minTrackSumPt")) {
39 token = consumes<reco::VertexCollection>(
src_);
41 produces<reco::VertexCollection>();
47 auto output = std::make_unique<reco::VertexCollection>();
49 if (vertices_->size() > 1) {
53 std::remove_copy_if(vertices_->begin() + 1, vertices_->end(), std::back_inserter(*
output), [
this](
auto const& vtx) {
54 double trackPtSum = 0.;
56 trackPtSum += (*track)->pt();
58 return trackPtSum > this->
minPt_;
61 size_t nPUVtx =
output->size();
74 desc.
add<
double>(
"minTrackSumPt");
76 desc.
add<
bool>(
"filter");
78 descriptions.
add(
"recoTauPileUpVertexSelector", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::VertexCollection > token
RecoTauPileUpVertexSelector(const edm::ParameterSet &pset)
bool filter(edm::Event &evt, const edm::EventSetup &es) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~RecoTauPileUpVertexSelector() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>