10 ParticleFlowForChargedMETProducer::ParticleFlowForChargedMETProducer(
const edm::ParameterSet& iConfig)
15 pfCandidatesToken = consumes<PFCandidateCollection>(pfCollectionLabel);
16 pvCollectionToken = consumes<VertexCollection>(pvCollectionLabel);
19 neutralEtThreshold = iConfig.
getParameter<
double>(
"neutralEtThreshold");
21 produces<PFCandidateCollection>();
29 iEvent.
getByToken(pvCollectionToken, pvCollection);
30 VertexCollection::const_iterator vertex = pvCollection->begin();
34 iEvent.
getByToken(pfCandidatesToken, pfCandidates);
38 if (pvCollection->size()>0) {
39 for(
unsigned i=0;
i<pfCandidates->size();
i++ ) {
44 if (pfCandPtr->trackRef()->dz((*vertex).position()) < dzCut) {
45 chargedPFCandidates->push_back( pfCand );
46 chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr );
50 else if (neutralEtThreshold>0 and
51 pfCandPtr->pt()>neutralEtThreshold) {
52 chargedPFCandidates->push_back( pfCand );
53 chargedPFCandidates->back().setSourceCandidatePtr( pfCandPtr );
61 iEvent.
put(chargedPFCandidates);
66 ParticleFlowForChargedMETProducer::~ParticleFlowForChargedMETProducer(){}
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) 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.
tuple chargedPFCandidates
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle reconstructed by the particle flow algorithm.