CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Member Functions

virtual void beginJob ()
 
 PFPileUp (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PFPileUp ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

bool checkClosestZVertex_
 use the closest z vertex if a track is not in a vertex More...
 
bool enable_
 enable PFPileUp selection More...
 
edm::InputTag inputTagPFCandidates_
 PFCandidates to be analyzed. More...
 
edm::InputTag inputTagVertices_
 vertices More...
 
PFPileUpAlgo pileUpAlgo_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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().

18  {
19 
21  = iConfig.getParameter<InputTag>("PFCandidates");
22 
24  = iConfig.getParameter<InputTag>("Vertices");
25 
26  enable_ = iConfig.getParameter<bool>("Enable");
27 
28  verbose_ =
29  iConfig.getUntrackedParameter<bool>("verbose",false);
30 
31 
32  if ( iConfig.exists("checkClosestZVertex") ) {
33  checkClosestZVertex_ = iConfig.getParameter<bool>("checkClosestZVertex");
34  } else {
35  checkClosestZVertex_ = false;
36  }
37 
38  // Configure the algo
39  pileUpAlgo_.setVerbose(verbose_);
41 
42  produces<reco::PFCandidateCollection>();
43 
44 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::InputTag inputTagVertices_
vertices
Definition: PFPileUp.h:53
void setCheckClosestZVertex(bool val)
Definition: PFPileUpAlgo.h:28
bool verbose_
verbose ?
Definition: PFPileUp.h:59
bool enable_
enable PFPileUp selection
Definition: PFPileUp.h:56
edm::InputTag inputTagPFCandidates_
PFCandidates to be analyzed.
Definition: PFPileUp.h:50
PFPileUpAlgo pileUpAlgo_
Definition: PFPileUp.h:47
bool checkClosestZVertex_
use the closest z vertex if a track is not in a vertex
Definition: PFPileUp.h:62
void setVerbose(bool verbose)
Definition: PFPileUpAlgo.h:26
PFPileUp::~PFPileUp ( )

Definition at line 48 of file PFPileUp.cc.

48 { }

Member Function Documentation

void PFPileUp::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 52 of file PFPileUp.cc.

52 { }
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().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

56  {
57 
58 // LogDebug("PFPileUp")<<"START event: "<<iEvent.id().event()
59 // <<" in run "<<iEvent.id().run()<<endl;
60 
61 
62  // get PFCandidates
63 
64  auto_ptr< reco::PFCandidateCollection >
65  pOutput( new reco::PFCandidateCollection );
66 
67  if(enable_) {
68 
70  iEvent.getByLabel( inputTagPFCandidates_, pfCandidates);
71 
72 
73  // get vertices
74 
75  Handle<VertexCollection> vertices;
76  iEvent.getByLabel( inputTagVertices_, vertices);
77 
78  pileUpAlgo_.process(*pfCandidates,*vertices,&pfCandidates);
79 
80  pOutput->insert(pOutput->end(),pileUpAlgo_.getPFCandidatesFromPU().begin(),pileUpAlgo_.getPFCandidatesFromPU().end());
81  }
82  // outsize of the loop to fill the collection anyway even when disabled
83  iEvent.put( pOutput );
84 }
const reco::PFCandidateCollection & getPFCandidatesFromPU() const
Definition: PFPileUpAlgo.h:30
edm::InputTag inputTagVertices_
vertices
Definition: PFPileUp.h:53
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool enable_
enable PFPileUp selection
Definition: PFPileUp.h:56
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void process(const reco::PFCandidateCollection &pfCandidates, const reco::VertexCollection &vertices, const edm::Handle< reco::PFCandidateCollection > *handle=0)
Definition: PFPileUpAlgo.cc:5
edm::InputTag inputTagPFCandidates_
PFCandidates to be analyzed.
Definition: PFPileUp.h:50
PFPileUpAlgo pileUpAlgo_
Definition: PFPileUp.h:47

Member Data Documentation

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.