Identifies pile-up candidates from a collection of PFCandidates, and produces the corresponding collection of PileUpCandidates. More...
#include <PFPileUp.h>
Public Member Functions | |
virtual void | beginJob () |
PFPileUp (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~PFPileUp () | |
Private Attributes | |
bool | checkClosestZVertex_ |
use the closest z vertex if a track is not in a vertex | |
bool | enable_ |
enable PFPileUp selection | |
edm::InputTag | inputTagPFCandidates_ |
PFCandidates to be analyzed. | |
edm::InputTag | inputTagVertices_ |
vertices | |
PFPileUpAlgo | pileUpAlgo_ |
bool | verbose_ |
verbose ? |
Identifies pile-up candidates from a collection of PFCandidates, and produces the corresponding collection of PileUpCandidates.
Definition at line 34 of file PFPileUp.h.
PFPileUp::PFPileUp | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 18 of file PFPileUp.cc.
References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ inputTagPFCandidates_ = iConfig.getParameter<InputTag>("PFCandidates"); inputTagVertices_ = iConfig.getParameter<InputTag>("Vertices"); enable_ = iConfig.getParameter<bool>("Enable"); verbose_ = iConfig.getUntrackedParameter<bool>("verbose",false); if ( iConfig.exists("checkClosestZVertex") ) { checkClosestZVertex_ = iConfig.getParameter<bool>("checkClosestZVertex"); } else { checkClosestZVertex_ = false; } // Configure the algo pileUpAlgo_.setVerbose(verbose_); pileUpAlgo_.setCheckClosestZVertex(checkClosestZVertex_); produces<reco::PFCandidateCollection>(); }
PFPileUp::~PFPileUp | ( | ) |
Definition at line 48 of file PFPileUp.cc.
{ }
void PFPileUp::beginJob | ( | void | ) | [virtual] |
void PFPileUp::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 55 of file PFPileUp.cc.
References edm::Event::getByLabel(), reco::tau::pfCandidates(), and edm::Event::put().
{ // LogDebug("PFPileUp")<<"START event: "<<iEvent.id().event() // <<" in run "<<iEvent.id().run()<<endl; // get PFCandidates auto_ptr< reco::PFCandidateCollection > pOutput( new reco::PFCandidateCollection ); if(enable_) { Handle<PFCandidateCollection> pfCandidates; iEvent.getByLabel( inputTagPFCandidates_, pfCandidates); // get vertices Handle<VertexCollection> vertices; iEvent.getByLabel( inputTagVertices_, vertices); pileUpAlgo_.process(*pfCandidates,*vertices,&pfCandidates); pOutput->insert(pOutput->end(),pileUpAlgo_.getPFCandidatesFromPU().begin(),pileUpAlgo_.getPFCandidatesFromPU().end()); } // outsize of the loop to fill the collection anyway even when disabled iEvent.put( pOutput ); }
bool PFPileUp::checkClosestZVertex_ [private] |
use the closest z vertex if a track is not in a vertex
Definition at line 62 of file PFPileUp.h.
bool PFPileUp::enable_ [private] |
enable PFPileUp selection
Definition at line 56 of file PFPileUp.h.
edm::InputTag PFPileUp::inputTagPFCandidates_ [private] |
PFCandidates to be analyzed.
Definition at line 50 of file PFPileUp.h.
edm::InputTag PFPileUp::inputTagVertices_ [private] |
vertices
Definition at line 53 of file PFPileUp.h.
PFPileUpAlgo PFPileUp::pileUpAlgo_ [private] |
Definition at line 47 of file PFPileUp.h.
bool PFPileUp::verbose_ [private] |
verbose ?
Definition at line 59 of file PFPileUp.h.