CMS 3D CMS Logo

FixedGridRhoProducerFastjet.cc
Go to the documentation of this file.
6 
7 using namespace std;
8 
10  : bge_(iConfig.getParameter<double>("maxRapidity"), iConfig.getParameter<double>("gridSpacing")) {
11  pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag");
12  produces<double>();
13 
14  input_pfcoll_token_ = consumes<edm::View<reco::Candidate> >(pfCandidatesTag_);
15 }
16 
18 
21  iEvent.getByToken(input_pfcoll_token_, pfColl);
22  std::vector<fastjet::PseudoJet> inputs;
23  for (edm::View<reco::Candidate>::const_iterator ibegin = pfColl->begin(), iend = pfColl->end(), i = ibegin; i != iend;
24  ++i) {
25  inputs.push_back(fastjet::PseudoJet(i->px(), i->py(), i->pz(), i->energy()));
26  }
27  bge_.set_particles(inputs);
28  iEvent.put(std::make_unique<double>(bge_.rho()));
29 }
30 
FixedGridRhoProducerFastjet(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< edm::View< reco::Candidate > > input_pfcoll_token_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
fastjet::GridMedianBackgroundEstimator bge_