48 double theNeutralFraction, px, py, pz, en;
52 reco::PFCandidateCollection::const_iterator itCand = pfCandidates->begin();
53 reco::PFCandidateCollection::const_iterator itCandEnd = pfCandidates->end();
54 for( ; itCand != itCandEnd; itCand++) {
58 theNeutralFraction =
par1 -
par2*itCand->energy();
59 if(theNeutralFraction > 0.){
60 px = theNeutralFraction*itCand->px();
61 py = theNeutralFraction*itCand->py();
62 pz = theNeutralFraction*itCand->pz();
63 en =
sqrt(px*px + py*py + pz*pz);
68 pOutputCandidateCollection->push_back(FakeNeutralHadron);
78 if(fabs(itCand->eta())< 4.) vEta = 0;
79 else if(fabs(itCand->eta())<= 5.) vEta = 1;
81 if (vEta==0 || vEta==1) {
86 en =
sqrt(px*px + py*py + pz*pz);
89 if(en>0.) pOutputCandidateCollection->push_back(EMHF);
91 }
else pOutputCandidateCollection->push_back(*itCand);
98 if(n_em_HF < (n_hadron_HF*
HF_Ratio)) pOutputCandidateCollection->push_back(*itCand);
99 }
else pOutputCandidateCollection->push_back(*itCand);
102 else pOutputCandidateCollection->push_back(*itCand);
105 iEvent.
put(pOutputCandidateCollection);
edm::InputTag labelPFCandidateCollection_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
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
std::vector< double > EM_HF_ScaleFactor
Particle reconstructed by the particle flow algorithm.
double energy_threshold(double eta)