Public Member Functions | |
bool | filter (edm::Event &evt, const edm::EventSetup &es) |
RecoTauPileUpVertexSelector (const edm::ParameterSet &pset) | |
~RecoTauPileUpVertexSelector () | |
Private Attributes | |
bool | filter_ |
edm::InputTag | src_ |
VertexTrackPtSumFilter | vtxFilter_ |
Definition at line 40 of file RecoTauPileUpVertexSelector.cc.
RecoTauPileUpVertexSelector::RecoTauPileUpVertexSelector | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 51 of file RecoTauPileUpVertexSelector.cc.
References edm::ParameterSet::exists(), filter_, edm::ParameterSet::getParameter(), and src_.
:vtxFilter_( pset.getParameter<double>("minTrackSumPt")) { src_ = pset.getParameter<edm::InputTag>("src"); filter_ = pset.exists("filter") ? pset.getParameter<bool>("filter") : false; produces<reco::VertexCollection>(); }
RecoTauPileUpVertexSelector::~RecoTauPileUpVertexSelector | ( | ) | [inline] |
Definition at line 43 of file RecoTauPileUpVertexSelector.cc.
{}
bool RecoTauPileUpVertexSelector::filter | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 60 of file RecoTauPileUpVertexSelector.cc.
References filter_, edm::Event::getByLabel(), convertSQLitetoXML_cfg::output, edm::Event::put(), src_, and vtxFilter_.
{ edm::Handle<reco::VertexCollection> vertices_; evt.getByLabel(src_, vertices_); std::auto_ptr<reco::VertexCollection> output(new reco::VertexCollection); // If there is only one vertex, there are no PU vertices! if (vertices_->size() > 1) { // Copy over all the vertices that have associatd tracks with pt greater // than the threshold. The predicate function is the VertexTrackPtSumFilter // better name: copy_if_not std::remove_copy_if(vertices_->begin()+1, vertices_->end(), std::back_inserter(*output), std::not1(vtxFilter_)); } size_t nPUVtx = output->size(); evt.put(output); // If 'filter' is enabled, return whether true if there are PU vertices if (!filter_) return true; else return nPUVtx; }
bool RecoTauPileUpVertexSelector::filter_ [private] |
Definition at line 48 of file RecoTauPileUpVertexSelector.cc.
Referenced by filter(), and RecoTauPileUpVertexSelector().
Definition at line 46 of file RecoTauPileUpVertexSelector.cc.
Referenced by filter(), and RecoTauPileUpVertexSelector().
VertexTrackPtSumFilter RecoTauPileUpVertexSelector::vtxFilter_ [private] |
Definition at line 47 of file RecoTauPileUpVertexSelector.cc.
Referenced by filter().