37 pfCharged_(iConfig.getParameter<
edm::
InputTag>(
"chargedFromPV")),
38 pfPU_(iConfig.getParameter<
edm::
InputTag>(
"chargedFromPU")) {
39 produces<reco::PFCandidateCollection>();
68 if (
cand.charge() != 0) {
71 <<
"Trying to reweight charged particle... saving it to output collection without any change";
73 (
out->back()).setParticleType((
out->back()).translatePdgIdToType(
cand.pdgId()));
82 double sum = (chCand.pt() * chCand.pt()) / (
deltaR2(
eta,
phi, chCand.eta(), chCand.phi()));
86 sumNPU = 0.5 *
log(sumNPU);
89 double sum = (puCand.pt() * puCand.pt()) / (
deltaR2(
eta,
phi, puCand.eta(), puCand.phi()));
93 sumPU = 0.5 *
log(sumPU);
97 if (sumNPU + sumPU > 0)
98 neutral.
setP4(((sumNPU) / (sumNPU + sumPU)) * neutral.
p4());
99 out->push_back(neutral);
edm::EDGetTokenT< edm::View< reco::Candidate > > pfPU_token
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCharged_token
#define DEFINE_FWK_MODULE(type)
const LorentzVector & p4() const final
four-momentum Lorentz vector
void setParticleType(ParticleType type)
set Particle Type
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< edm::View< reco::Candidate > > src_token
Particle reconstructed by the particle flow algorithm.
ParticleType translatePdgIdToType(int pdgid) const
Log< level::Warning, false > LogWarning
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void setP4(const LorentzVector &p4) final
set 4-momentum
DeltaBetaWeights(const edm::ParameterSet &)