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 ) {
138 auto val =
j->user_index();
139 auto skmatch = find_if( soft_killed_event.begin(), soft_killed_event.end(), [&val](fastjet::PseudoJet
const &
i){
return i.user_index() == val;} );
141 if ( skmatch != soft_killed_event.end() ) {
142 pVec.SetPxPyPzE(skmatch->px(),skmatch->py(),skmatch->pz(),skmatch->E());
144 pVec.SetPxPyPzE( 0., 0., 0., 0.);
147 skP4s.push_back( pVec );
148 pOutput->push_back(pCand);
153 p4SKFiller.
insert(pfCandidates,skP4s.begin(), skP4s.end() );
156 iEvent.
put(p4SKOut,
"SoftKillerP4s");
157 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
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