test
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.
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  std::auto_ptr<double> outputRho(new double(bge_.rho()));
33  iEvent.put(outputRho);
34 }
35 
FixedGridRhoProducerFastjet(const edm::ParameterSet &iConfig)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::View< reco::Candidate > > input_pfcoll_token_
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
fastjet::GridMedianBackgroundEstimator bge_