24 class VertexTrackPtSumFilter :
public std::unary_function<reco::Vertex, bool> {
26 VertexTrackPtSumFilter(
double minPt):minPt_(minPt){}
28 double trackPtSum = 0.;
31 trackPtSum += (*track)->pt();
33 return trackPtSum > minPt_;
55 pset.getParameter<double>(
"minTrackSumPt")) {
57 token = consumes<reco::VertexCollection>(
src_);
59 produces<reco::VertexCollection>();
69 if (vertices_->size() > 1) {
73 std::remove_copy_if(vertices_->begin()+1, vertices_->end(),
74 std::back_inserter(*output), std::not1(
vtxFilter_));
76 size_t nPUVtx = output->size();
T getParameter(std::string const &) const
trackRef_iterator tracks_end() const
last iterator over tracks
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< Vertex > VertexCollection
collection of Vertex objects
VertexTrackPtSumFilter vtxFilter_
edm::EDGetTokenT< reco::VertexCollection > token
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
RecoTauPileUpVertexSelector(const edm::ParameterSet &pset)
bool filter(edm::Event &evt, const edm::EventSetup &es) override
~RecoTauPileUpVertexSelector()
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
trackRef_iterator tracks_begin() const
first iterator over tracks