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() );
157 iEvent.
put(p4SKOut,
"SoftKillerP4s");
158 iEvent.
put( pOutput );
T getParameter(std::string const &) const
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
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< LorentzVector > LorentzVectorCollection
virtual int charge() const =0
electric charge
SoftKillerProducer(const edm::ParameterSet &)
virtual int pdgId() const =0
PDG identifier.
std::vector< reco::PFCandidate > PFOutputCollection
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
ParticleType translatePdgIdToType(int pdgid) const
Particle reconstructed by the particle flow algorithm.
edm::EDGetTokenT< reco::CandidateView > tokenPFCandidates_
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector