24 produces<reco::PFCandidateCollection>();
42 iEvent.
getByLabel (labelPFCandidateCollection_, pfCandidates);
46 LogDebug(
"FSPFProducer")<<
"START event: "
48 <<
" in run "<<iEvent.
id().
run()<<endl;
50 double theNeutralFraction, px, py, pz, en;
51 reco::PFCandidateCollection::const_iterator itCand = pfCandidates->begin();
52 reco::PFCandidateCollection::const_iterator itCandEnd = pfCandidates->end();
53 for( ; itCand != itCandEnd; itCand++) {
54 pOutputCandidateCollection->push_back(*itCand);
56 theNeutralFraction = par1 - par2*itCand->energy();
57 if(theNeutralFraction > 0.){
58 px = theNeutralFraction*itCand->px();
59 py = theNeutralFraction*itCand->py();
60 pz = theNeutralFraction*itCand->pz();
61 en =
sqrt(px*px + py*py + pz*pz);
62 if (en > energy_threshold(itCand->eta())) {
66 pOutputCandidateCollection->push_back(FakeNeutralHadron);
71 iEvent.
put(pOutputCandidateCollection);
75 if (eta<0) eta = -
eta;
76 if (eta < 1.6)
return barrel_th;
77 else if (eta < 1.8)
return middle_th;
78 else return endcap_th;
T getParameter(std::string const &) const
EventNumber_t event() const
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual void beginRun(edm::Run &, const edm::EventSetup &)
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 &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle reconstructed by the particle flow algorithm.
double energy_threshold(double eta)