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"),
11  iConfig.getParameter<double>("gridSpacing") )
12 {
13  pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag");
14  produces<double>();
15 
16  input_pfcoll_token_ = consumes<edm::View<reco::Candidate> >(pfCandidatesTag_);
17 
18 }
19 
21 
23 
25  iEvent.getByToken(input_pfcoll_token_, pfColl);
26  std::vector<fastjet::PseudoJet> inputs;
27  for ( edm::View<reco::Candidate>::const_iterator ibegin = pfColl->begin(),
28  iend = pfColl->end(), i = ibegin; i != iend; ++i ){
29  inputs.push_back( fastjet::PseudoJet(i->px(), i->py(), i->pz(), i->energy()) );
30  }
31  bge_.set_particles(inputs);
32  iEvent.put(std::make_unique<double>(bge_.rho()));
33 }
34 
FixedGridRhoProducerFastjet(const edm::ParameterSet &iConfig)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Candidate > > input_pfcoll_token_
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
fastjet::GridMedianBackgroundEstimator bge_