35 #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);
131 for (
auto j = fjInputs.begin(),
132 jend = fjInputs.end();
j != jend; ++
j ) {
134 auto val =
j->user_index();
135 auto skmatch = find_if( soft_killed_event.begin(), soft_killed_event.end(), [&val](fastjet::PseudoJet
const &
i){
return i.user_index() == val;} );
137 if ( skmatch != soft_killed_event.end() ) {
138 pVec.SetPxPyPzE(skmatch->px(),skmatch->py(),skmatch->pz(),skmatch->E());
140 pVec.SetPxPyPzE( 0., 0., 0., 0.);
143 skP4s.push_back( pVec );
144 pOutput->push_back(pCand);
149 p4SKFiller.
insert(pfCandidates,skP4s.begin(), skP4s.end() );
152 iEvent.
put(p4SKOut,
"SoftKillerP4s");
153 iEvent.
put( pOutput );
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< PFInputCollection > tokenPFCandidates_
#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
edm::View< reco::PFCandidate > PFView
Container::value_type value_type
SoftKillerProducer(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFOutputCollection
std::vector< reco::PFCandidate > PFInputCollection