23 class VertexTrackPtSumFilter :
public std::unary_function<reco::Vertex, bool> {
25 VertexTrackPtSumFilter(
double minPt):minPt_(minPt){}
27 double trackPtSum = 0.;
30 trackPtSum += (*track)->pt();
32 return trackPtSum > minPt_;
53 pset.getParameter<double>(
"minTrackSumPt")) {
56 produces<reco::VertexCollection>();
66 if (vertices_->size() > 1) {
70 std::remove_copy_if(vertices_->begin()+1, vertices_->end(),
71 std::back_inserter(*output), std::not1(
vtxFilter_));
73 size_t nPUVtx = output->size();
T getParameter(std::string const &) const
trackRef_iterator tracks_end() const
last iterator over tracks
#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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
RecoTauPileUpVertexSelector(const edm::ParameterSet &pset)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
~RecoTauPileUpVertexSelector()
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
trackRef_iterator tracks_begin() const
first iterator over tracks
bool filter(edm::Event &evt, const edm::EventSetup &es)