12 ParticleFlowForChargedMETProducer::ParticleFlowForChargedMETProducer(
const edm::ParameterSet& iConfig)
17 neutralEtThreshold = iConfig.
getParameter<
double>(
"neutralEtThreshold");
19 produces<PFCandidateCollection>();
27 iEvent.
getByLabel(pvCollectionLabel, pvCollection);
28 VertexCollection::const_iterator vertex = pvCollection->begin();
32 iEvent.
getByLabel(pfCollectionLabel, pfCandidates);
36 if (pvCollection->size()>0) {
37 for(
unsigned i=0;
i<pfCandidates->size();
i++ ) {
42 if (pfCandPtr->trackRef()->dz((*vertex).position()) < dzCut) {
43 chargedPFCandidates->push_back( pfCand );
44 chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr );
48 else if (neutralEtThreshold>0 and
49 pfCandPtr->pt()>neutralEtThreshold) {
50 chargedPFCandidates->push_back( pfCand );
51 chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr );
59 iEvent.
put(chargedPFCandidates);
64 ParticleFlowForChargedMETProducer::~ParticleFlowForChargedMETProducer(){}
T getParameter(std::string const &) const
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
bool isNonnull() const
Checks for non-null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle reconstructed by the particle flow algorithm.