37 #include "fastjet/contrib/SoftKiller.hh" 77 Rho_EtaMax_( iConfig.getParameter<double>(
"Rho_EtaMax") ),
78 rParam_ ( iConfig.getParameter<double>(
"rParam") )
84 produces<edm::ValueMap<LorentzVector> > (
"SoftKillerP4s");
85 produces< PFOutputCollection >();
111 std::vector<fastjet::PseudoJet> fjInputs;
112 for (
auto i = pfCandidates->
begin(),
113 ibegin = pfCandidates->
begin(),
114 iend = pfCandidates->
end();
i != iend; ++
i ) {
115 fjInputs.push_back( fastjet::PseudoJet(
i->px(),
i->py(),
i->pz(),
i->energy() ) );
116 fjInputs.back().set_user_index(
i - ibegin );
122 double pt_threshold = 0.;
123 std::vector<fastjet::PseudoJet> soft_killed_event;
124 soft_killer.apply(fjInputs, soft_killed_event, pt_threshold);
133 for (
auto j = fjInputs.begin(),
134 jend = fjInputs.end(); j != jend; ++j ) {
139 auto val = j->user_index();
140 auto skmatch = find_if( soft_killed_event.begin(), soft_killed_event.end(), [&
val](fastjet::PseudoJet
const &
i){
return i.user_index() ==
val;} );
142 if ( skmatch != soft_killed_event.end() ) {
143 pVec.SetPxPyPzE(skmatch->px(),skmatch->py(),skmatch->pz(),skmatch->E());
145 pVec.SetPxPyPzE( 0., 0., 0., 0.);
148 skP4s.push_back( pVec );
149 pOutput->push_back(pCand);
154 p4SKFiller.
insert(pfCandidates,skP4s.begin(), skP4s.end() );
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void insert(const H &h, I begin, I end)
math::XYZTLorentzVector LorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
void produce(edm::Event &, const edm::EventSetup &) override
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int pdgId() const =0
PDG identifier.
std::vector< LorentzVector > LorentzVectorCollection
SoftKillerProducer(const edm::ParameterSet &)
~SoftKillerProducer() override
std::vector< reco::PFCandidate > PFOutputCollection
ParticleType translatePdgIdToType(int pdgid) const
virtual int charge() const =0
electric charge
Particle reconstructed by the particle flow algorithm.
const_reference at(size_type pos) const
const_iterator end() const
edm::EDGetTokenT< reco::CandidateView > tokenPFCandidates_
void setP4(const LorentzVector &p4) final
set 4-momentum