4 src_(iConfig.getParameter<edm::
InputTag>(
"src")),
5 pfCharged_(iConfig.getParameter<edm::
InputTag>(
"chargedFromPV")),
6 pfPU_(iConfig.getParameter<edm::
InputTag>(
"chargedFromPU"))
8 produces<reco::PFCandidateCollection>();
56 if (cand.charge() !=0) {
58 edm::LogWarning(
"DeltaBetaWeights") <<
"Trying to reweight charged particle... saving it to output collection without any change";
60 (out->back()).setParticleType((out->back()).translatePdgIdToType(cand.pdgId()));
66 double eta=cand.eta();
67 double phi=cand.phi();
69 double sum = (chCand.pt()*chCand.pt())/(
deltaR2(eta,phi,chCand.eta(),chCand.phi()));
70 if(sum > 1.0) sumNPU *= sum;
72 sumNPU=0.5*
log(sumNPU);
75 double sum = (puCand.pt()*puCand.pt())/(
deltaR2(eta,phi,puCand.eta(),puCand.phi()));
76 if(sum > 1.0) sumPU *= sum;
83 neutral.
setP4(((sumNPU)/(sumNPU+sumPU))*neutral.
p4());
84 out->push_back(neutral);
edm::EDGetTokenT< edm::View< reco::Candidate > > pfPU_token
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCharged_token
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void setParticleType(ParticleType type)
set Particle Type
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
ParticleType translatePdgIdToType(int pdgid) const
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
edm::EDGetTokenT< edm::View< reco::Candidate > > src_token
Particle reconstructed by the particle flow algorithm.
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
DeltaBetaWeights(const edm::ParameterSet &)