CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FixedGridRhoProducer.cc
Go to the documentation of this file.
4 
5 using namespace std;
6 
8  pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag");
9  string etaRegion = iConfig.getParameter<string>("EtaRegion");
10  if (etaRegion=="Central") myEtaRegion = FixedGridEnergyDensity::Central;
11  else if (etaRegion=="Forward") myEtaRegion = FixedGridEnergyDensity::Forward;
12  else if (etaRegion=="All") myEtaRegion = FixedGridEnergyDensity::All;
13  else {
14  edm::LogWarning("FixedGridRhoProducer") << "Wrong EtaRegion parameter: " << etaRegion << ". Using EtaRegion = Central";
15  myEtaRegion = FixedGridEnergyDensity::Central;
16  }
17  produces<double>();
18 }
19 
21 
23 
25  iEvent.getByLabel(pfCandidatesTag_,pfColl);
26 
27  algo = new FixedGridEnergyDensity(pfColl.product());
28 
29  double result = algo->fixedGridRho(myEtaRegion);
30  std::auto_ptr<double> output(new double(result));
31  iEvent.put(output);
32 
33  delete algo;
34 
35 }
36 
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:243
FixedGridRhoProducer(const edm::ParameterSet &iConfig)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
T const * product() const
Definition: Handle.h:81
virtual void produce(edm::Event &, const edm::EventSetup &)