CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FixedGridRhoProducerFastjet.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
9  bge_( iConfig.getParameter<double>("maxRapidity"),
10  iConfig.getParameter<double>("gridSpacing") )
11 {
12  pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag");
13  produces<double>();
14 }
15 
17 
19 
21  iEvent.getByLabel(pfCandidatesTag_,pfColl);
22  std::vector<fastjet::PseudoJet> inputs;
23  for ( reco::PFCandidateCollection::const_iterator ibegin = pfColl->begin(),
24  iend = pfColl->end(), i = ibegin; i != iend; ++i ){
25  inputs.push_back( fastjet::PseudoJet(i->px(), i->py(), i->pz(), i->energy()) );
26  }
27  bge_.set_particles(inputs);
28  std::auto_ptr<double> outputRho(new double(bge_.rho()));
29  iEvent.put(outputRho);
30 }
31 
FixedGridRhoProducerFastjet(const edm::ParameterSet &iConfig)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual void produce(edm::Event &, const edm::EventSetup &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
fastjet::GridMedianBackgroundEstimator bge_