CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1FastjetCorrector.cc
Go to the documentation of this file.
1 //
3 // L1FastjetCorrector
4 // ------------------
5 //
6 // 08/09/2009 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
8 
10 
13 
14 
15 using namespace std;
16 
17 
19 // construction / destruction
21 
22 //______________________________________________________________________________
24  : srcRho_(fConfig.getParameter<edm::InputTag>("srcRho"))
25 {
26  if (fParam.definitions().level() != "L1FastJet")
27  throw cms::Exception("L1FastjetCorrector")<<" correction level: "<<fParam.definitions().level()<<" is not L1FastJet";
28  vector<JetCorrectorParameters> vParam;
29  vParam.push_back(fParam);
31 }
32 
33 //______________________________________________________________________________
35 {
36  delete mCorrector;
37 }
38 
39 
41 // implementation of member functions
43 
44 //______________________________________________________________________________
46 {
47  throw cms::Exception("EventRequired")
48  <<"Wrong interface correction(LorentzVector), event required!";
49  return 1.0;
50 }
51 
52 
53 //______________________________________________________________________________
54 double L1FastjetCorrector::correction (const reco::Jet& fJet) const
55 {
56  throw cms::Exception("EventRequired")
57  <<"Wrong interface correction(reco::Jet), event required!";
58  return 1.0;
59 }
60 
61 
62 //______________________________________________________________________________
64  const edm::Event& fEvent,
65  const edm::EventSetup& fSetup) const
66 {
68  fEvent.getByLabel(srcRho_,rho);
69  double result(1.0);
71  values.setJetEta(fJet.eta());
72  values.setJetPt(fJet.pt());
73  values.setJetE(fJet.energy());
74  values.setJetA(fJet.jetArea());
75  values.setRho(*rho);
76  result = mCorrector->getCorrection(values);
77  return result;
78 }
79 
80 
81 
82 
virtual double correction(const LorentzVector &fJet) const
apply correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:20
const Definitions & definitions() const
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
virtual double energy() const
energy
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
L1FastjetCorrector(const JetCorrectorParameters &fParam, const edm::ParameterSet &fConfig)
virtual float jetArea() const
get jet area
Definition: Jet.h:105
FactorizedJetCorrectorCalculator const * mCorrector
reco::Particle::LorentzVector LorentzVector
Definition: JetCorrector.h:23