![]() |
![]() |
#include <ParticleFlowForChargedMETProducer.h>
Public Member Functions | |
ParticleFlowForChargedMETProducer (const edm::ParameterSet &) | |
~ParticleFlowForChargedMETProducer () | |
Private Member Functions | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
double | dzCut |
double | neutralEtThreshold |
edm::InputTag | pfCollectionLabel |
edm::InputTag | pvCollectionLabel |
Definition at line 17 of file ParticleFlowForChargedMETProducer.h.
ParticleFlowForChargedMETProducer::ParticleFlowForChargedMETProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 12 of file ParticleFlowForChargedMETProducer.cc.
References edm::ParameterSet::getParameter().
{ pfCollectionLabel = iConfig.getParameter<edm::InputTag>("PFCollectionLabel"); pvCollectionLabel = iConfig.getParameter<edm::InputTag>("PVCollectionLabel"); dzCut = iConfig.getParameter<double>("dzCut"); neutralEtThreshold = iConfig.getParameter<double>("neutralEtThreshold"); produces<PFCandidateCollection>(); }
ParticleFlowForChargedMETProducer::~ParticleFlowForChargedMETProducer | ( | ) |
Definition at line 64 of file ParticleFlowForChargedMETProducer.cc.
{}
void ParticleFlowForChargedMETProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 22 of file ParticleFlowForChargedMETProducer.cc.
References edm::Event::getByLabel(), i, edm::Ptr< T >::isNonnull(), reco::tau::pfCandidates(), and edm::Event::put().
{ //Get the PV collection Handle<VertexCollection> pvCollection; iEvent.getByLabel(pvCollectionLabel, pvCollection); VertexCollection::const_iterator vertex = pvCollection->begin(); //Get pfCandidates Handle<PFCandidateCollection> pfCandidates; iEvent.getByLabel(pfCollectionLabel, pfCandidates); // the output collection auto_ptr<PFCandidateCollection> chargedPFCandidates( new PFCandidateCollection ) ; if (pvCollection->size()>0) { for( unsigned i=0; i<pfCandidates->size(); i++ ) { const PFCandidate& pfCand = (*pfCandidates)[i]; PFCandidatePtr pfCandPtr(pfCandidates, i); if (pfCandPtr->trackRef().isNonnull()) { if (pfCandPtr->trackRef()->dz((*vertex).position()) < dzCut) { chargedPFCandidates->push_back( pfCand ); chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr ); } } else if (neutralEtThreshold>0 and pfCandPtr->pt()>neutralEtThreshold) { chargedPFCandidates->push_back( pfCand ); chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr ); } } } iEvent.put(chargedPFCandidates); return; }
double reco::ParticleFlowForChargedMETProducer::dzCut [private] |
Definition at line 30 of file ParticleFlowForChargedMETProducer.h.
double reco::ParticleFlowForChargedMETProducer::neutralEtThreshold [private] |
Definition at line 31 of file ParticleFlowForChargedMETProducer.h.
Definition at line 27 of file ParticleFlowForChargedMETProducer.h.
Definition at line 28 of file ParticleFlowForChargedMETProducer.h.