5 pfCharged_(iConfig.getParameter<
edm::
InputTag>(
"chargedFromPV")),
6 pfPU_(iConfig.getParameter<
edm::
InputTag>(
"chargedFromPU")) {
7 produces<reco::PFCandidateCollection>();
45 if (
cand.charge() != 0) {
48 <<
"Trying to reweight charged particle... saving it to output collection without any change";
50 (
out->back()).setParticleType((
out->back()).translatePdgIdToType(
cand.pdgId()));
59 double sum = (chCand.pt() * chCand.pt()) / (
deltaR2(
eta,
phi, chCand.eta(), chCand.phi()));
63 sumNPU = 0.5 *
log(sumNPU);
66 double sum = (puCand.pt() * puCand.pt()) / (
deltaR2(
eta,
phi, puCand.eta(), puCand.phi()));
70 sumPU = 0.5 *
log(sumPU);
74 if (sumNPU + sumPU > 0)
75 neutral.
setP4(((sumNPU) / (sumNPU + sumPU)) * neutral.
p4());
76 out->push_back(neutral);