36 #include "fastjet/contrib/SoftKiller.hh"
72 : Rho_EtaMax_(iConfig.getParameter<double>(
"Rho_EtaMax")), rParam_(iConfig.getParameter<double>(
"rParam")) {
75 produces<edm::ValueMap<LorentzVector> >(
"SoftKillerP4s");
76 produces<PFOutputCollection>();
93 std::vector<fastjet::PseudoJet> fjInputs;
94 for (
auto i = pfCandidates->begin(), ibegin = pfCandidates->begin(), iend = pfCandidates->end();
i != iend; ++
i) {
95 fjInputs.push_back(fastjet::PseudoJet(
i->px(),
i->py(),
i->pz(),
i->energy()));
96 fjInputs.back().set_user_index(
i - ibegin);
102 double pt_threshold = 0.;
103 std::vector<fastjet::PseudoJet> soft_killed_event;
104 soft_killer.apply(fjInputs, soft_killed_event, pt_threshold);
113 for (
auto j = fjInputs.begin(), jend = fjInputs.end();
j != jend; ++
j) {
118 auto val =
j->user_index();
119 auto skmatch = find_if(soft_killed_event.begin(), soft_killed_event.end(), [&
val](fastjet::PseudoJet
const&
i) {
120 return i.user_index() ==
val;
123 if (skmatch != soft_killed_event.end()) {
124 pVec.SetPxPyPzE(skmatch->px(), skmatch->py(), skmatch->pz(), skmatch->E());
126 pVec.SetPxPyPzE(0., 0., 0., 0.);
129 skP4s.push_back(pVec);
130 pOutput->push_back(pCand);
135 p4SKFiller.
insert(pfCandidates, skP4s.begin(), skP4s.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
uint16_t *__restrict__ id
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
math::XYZTLorentzVector LorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< LorentzVector > LorentzVectorCollection
virtual int charge() const =0
electric charge
SoftKillerProducer(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFOutputCollection
virtual int pdgId() const =0
PDG identifier.
~SoftKillerProducer() override
T getParameter(std::string const &) const
ParticleType translatePdgIdToType(int pdgid) const
edm::EDGetTokenT< reco::CandidateView > tokenPFCandidates_
Particle reconstructed by the particle flow algorithm.
void setP4(const LorentzVector &p4) final
set 4-momentum
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector