18 EM_HF_ScaleFactor = iConfig.
getParameter< std::vector <double> >(
"EM_HF_ScaleFactor");
26 produces<reco::PFCandidateCollection>();
29 pfCandidateToken = consumes<reco::PFCandidateCollection>(labelPFCandidateCollection_);
39 iEvent.
getByToken (pfCandidateToken, pfCandidates);
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);
65 if (en > energy_threshold(itCand->eta())) {
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) {
84 px = EM_HF_ScaleFactor[vEta]*itCand->px();
85 py = EM_HF_ScaleFactor[vEta]*itCand->py();
86 pz = EM_HF_ScaleFactor[vEta]*itCand->pz();
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);
110 if (eta<0) eta = -
eta;
111 if (eta < 1.6)
return barrel_th;
112 else if (eta < 1.8)
return middle_th;
113 else return endcap_th;
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &) override
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.
FSPFProducer(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle reconstructed by the particle flow algorithm.
double energy_threshold(double eta)