32 if ( iConfig.
exists(
"checkClosestZVertex") ) {
33 checkClosestZVertex_ = iConfig.
getParameter<
bool>(
"checkClosestZVertex");
35 checkClosestZVertex_ =
false;
39 pileUpAlgo_.setVerbose(verbose_);
40 pileUpAlgo_.setCheckClosestZVertex(checkClosestZVertex_);
43 produces< PFCollection > ();
65 auto_ptr< PFCollection >
68 auto_ptr< PFCollectionByValue >
82 bool getFromFwdPtr = iEvent.
getByToken( tokenPFCandidates_, pfCandidates);
83 if ( getFromFwdPtr ) {
84 pfCandidatesRef = pfCandidates.
product();
93 bool getFromView = iEvent.
getByToken( tokenPFCandidates_, pfView );
94 if ( ! getFromView ) {
95 throw cms::Exception(
"PFPileUp is misconfigured. This needs to be either vector<FwdPtr<PFCandidate> >, or View<PFCandidate>");
98 viewEnd = pfView->end(), iview = viewBegin;
99 iview != viewEnd; ++iview ) {
102 pfCandidatesRef = &usedIfNoFwdPtrs;
105 if ( pfCandidatesRef == 0 ) {
106 throw cms::Exception(
"Something went dreadfully wrong with PFPileUp. pfCandidatesRef should never be zero, so this is a logic error.");
111 pileUpAlgo_.process(*pfCandidatesRef,*vertices);
112 pOutput->insert(pOutput->end(),pileUpAlgo_.getPFCandidatesFromPU().begin(),pileUpAlgo_.getPFCandidatesFromPU().end());
122 iEvent.
put( pOutput );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< reco::PFCandidate > PFCollectionByValue
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCollection
T const * product() const
PFPileUp(const edm::ParameterSet &)