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  input_pfcoll_token_ = consumes<reco::PFCandidateCollection>(pfCandidatesTag_);
20 
21 }
22 
24 
26 
28  iEvent.getByToken(input_pfcoll_token_, pfColl);
29 
30  algo = new FixedGridEnergyDensity(pfColl.product());
31 
32  double result = algo->fixedGridRho(myEtaRegion);
33  std::auto_ptr<double> output(new double(result));
34  iEvent.put(output);
35 
36  delete algo;
37 
38 }
39 
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
tuple result
Definition: mps_fire.py:95
int iEvent
Definition: GenABIO.cc:230
FixedGridRhoProducer(const edm::ParameterSet &iConfig)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
T const * product() const
Definition: Handle.h:81
virtual void produce(edm::Event &, const edm::EventSetup &)