#include <FSPFProducer.h>
Public Member Functions | |
virtual void | beginJob () |
virtual void | beginRun (edm::Run &, const edm::EventSetup &) |
FSPFProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~FSPFProducer () | |
Private Member Functions | |
double | energy_threshold (double eta) |
Private Attributes | |
double | barrel_th |
double | endcap_th |
edm::InputTag | labelPFCandidateCollection_ |
double | middle_th |
double | par1 |
double | par2 |
Definition at line 17 of file FSPFProducer.h.
FSPFProducer::FSPFProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 14 of file FSPFProducer.cc.
References edm::ParameterSet::getParameter().
{ labelPFCandidateCollection_ = iConfig.getParameter < edm::InputTag > ("pfCandidates"); par1 = iConfig.getParameter<double>("par1"); par2 = iConfig.getParameter<double>("par2"); barrel_th = iConfig.getParameter<double>("barrel_th"); endcap_th = iConfig.getParameter<double>("endcap_th"); middle_th = iConfig.getParameter<double>("middle_th"); // register products produces<reco::PFCandidateCollection>(); }
FSPFProducer::~FSPFProducer | ( | ) |
Definition at line 28 of file FSPFProducer.cc.
{}
void FSPFProducer::beginJob | ( | void | ) | [virtual] |
void FSPFProducer::beginRun | ( | edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
double FSPFProducer::energy_threshold | ( | double | eta | ) | [private] |
void FSPFProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 38 of file FSPFProducer.cc.
References edm::EventID::event(), edm::Event::getByLabel(), h, reco::PFCandidate::h0, edm::EventBase::id(), LogDebug, reco::tau::pfCandidates(), edm::Event::put(), edm::EventID::run(), and mathSSE::sqrt().
{ Handle < reco::PFCandidateCollection > pfCandidates; iEvent.getByLabel (labelPFCandidateCollection_, pfCandidates); auto_ptr< reco::PFCandidateCollection > pOutputCandidateCollection(new PFCandidateCollection); LogDebug("FSPFProducer")<<"START event: " <<iEvent.id().event() <<" in run "<<iEvent.id().run()<<endl; double theNeutralFraction, px, py, pz, en; reco::PFCandidateCollection::const_iterator itCand = pfCandidates->begin(); reco::PFCandidateCollection::const_iterator itCandEnd = pfCandidates->end(); for( ; itCand != itCandEnd; itCand++) { pOutputCandidateCollection->push_back(*itCand); if(itCand->particleId() == reco::PFCandidate::h){ theNeutralFraction = par1 - par2*itCand->energy(); if(theNeutralFraction > 0.){ px = theNeutralFraction*itCand->px(); py = theNeutralFraction*itCand->py(); pz = theNeutralFraction*itCand->pz(); en = sqrt(px*px + py*py + pz*pz); if (en > energy_threshold(itCand->eta())) { // create a PFCandidate and add it to the particles Collection math::XYZTLorentzVector momentum(px,py,pz,en); reco::PFCandidate FakeNeutralHadron(0, momentum, reco::PFCandidate::h0); pOutputCandidateCollection->push_back(FakeNeutralHadron); } } } } iEvent.put(pOutputCandidateCollection); }
double FSPFProducer::barrel_th [private] |
Definition at line 30 of file FSPFProducer.h.
double FSPFProducer::endcap_th [private] |
Definition at line 30 of file FSPFProducer.h.
Definition at line 28 of file FSPFProducer.h.
double FSPFProducer::middle_th [private] |
Definition at line 30 of file FSPFProducer.h.
double FSPFProducer::par1 [private] |
Definition at line 29 of file FSPFProducer.h.
double FSPFProducer::par2 [private] |
Definition at line 29 of file FSPFProducer.h.