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;
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);
T getParameter(std::string const &) 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
SoftKillerProducer(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFOutputCollection
~SoftKillerProducer() override
edm::EDGetTokenT< reco::CandidateView > tokenPFCandidates_
Particle reconstructed by the particle flow algorithm.
ParticleType translatePdgIdToType(int pdgid) const
void setP4(const LorentzVector &p4) final
set 4-momentum