CMS 3D CMS Logo

Public Member Functions | Private Attributes

PFPileUp Class Reference

Identifies pile-up candidates from a collection of PFCandidates, and produces the corresponding collection of PileUpCandidates. More...

#include <PFPileUp.h>

Inheritance diagram for PFPileUp:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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 ?

Detailed Description

Identifies pile-up candidates from a collection of PFCandidates, and produces the corresponding collection of PileUpCandidates.

Author:
Colin Bernet
Date:
february 2008 Florian Beaudette 30/03/2012

Definition at line 34 of file PFPileUp.h.


Constructor & Destructor Documentation

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.

{ }

Member Function Documentation

void PFPileUp::beginJob ( void  ) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 52 of file PFPileUp.cc.

{ }
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 );
}

Member Data Documentation

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.

PFCandidates to be analyzed.

Definition at line 50 of file PFPileUp.h.

vertices

Definition at line 53 of file PFPileUp.h.

Definition at line 47 of file PFPileUp.h.

bool PFPileUp::verbose_ [private]

verbose ?

Definition at line 59 of file PFPileUp.h.