49 double theNeutralFraction, px, py, pz, en;
53 reco::PFCandidateCollection::const_iterator itCand = pfCandidates->begin();
54 reco::PFCandidateCollection::const_iterator itCandEnd = pfCandidates->end();
55 for( ; itCand != itCandEnd; itCand++) {
59 theNeutralFraction =
par1 -
par2*itCand->energy();
60 if(theNeutralFraction > 0.){
61 px = theNeutralFraction*itCand->px();
62 py = theNeutralFraction*itCand->py();
63 pz = theNeutralFraction*itCand->pz();
64 en =
sqrt(px*px + py*py + pz*pz);
69 pOutputCandidateCollection->push_back(FakeNeutralHadron);
79 if(fabs(itCand->eta())< 4.) vEta = 0;
80 else if(fabs(itCand->eta())<= 5.) vEta = 1;
82 if (vEta==0 || vEta==1) {
87 en =
sqrt(px*px + py*py + pz*pz);
90 if(en>0.) pOutputCandidateCollection->push_back(EMHF);
92 }
else pOutputCandidateCollection->push_back(*itCand);
99 if(n_em_HF < (n_hadron_HF*
HF_Ratio)) pOutputCandidateCollection->push_back(*itCand);
100 }
else pOutputCandidateCollection->push_back(*itCand);
103 else pOutputCandidateCollection->push_back(*itCand);
106 iEvent.
put(pOutputCandidateCollection);
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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.
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::vector< double > EM_HF_ScaleFactor
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidateToken
Particle reconstructed by the particle flow algorithm.
double energy_threshold(double eta)