CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetCorrector.cc
Go to the documentation of this file.
1 //
2 // Original Author: Fedor Ratnikov Dec 27, 2006
3 //
4 // Generic interface for JetCorrection services
5 //
6 
8 
13 
14 double JetCorrector::correction (const reco::Jet& fJet,
15  const edm::Event& fEvent,
16  const edm::EventSetup& fSetup) const {
17  if (eventRequired () && !refRequired()) {
18  edm::LogError ("Missing Jet Correction Method")
19  << "Undefined Jet Correction method requiring event data is called" << std::endl;
20  return 0;
21  }
22  return correction (fJet);
23 }
24 
25 double JetCorrector::correction (const reco::Jet& fJet,
26  const edm::RefToBase<reco::Jet>& fJetRef,
27  const edm::Event& fEvent,
28  const edm::EventSetup& fSetup) const {
29  if (eventRequired () && refRequired()) {
30  edm::LogError ("Missing Jet Correction Method")
31  << "Undefined Jet Correction method requiring event data and jet reference is called" << std::endl;
32  return 0;
33  }
34  return correction (fJet);
35 }
36 
37 double JetCorrector::correction (const reco::Jet& fJet,
38  const edm::RefToBase<reco::Jet>& fJetRef,
39  const edm::Event& fEvent,
40  const edm::EventSetup& fSetup,
41  LorentzVector& corrected ) const {
42  if ( vectorialCorrection() ) {
43  edm::LogError ("Missing Jet Correction Method")
44  << "Undefined Jet (vectorial) correction method requiring event data is called" << std::endl;
45  return 0;
46  }
47  return correction (fJet);
48 }
49 
53  record.get (fName, handle);
54  return &*handle;
55 }
JetCorrectorParameters::Record record
Definition: classes.h:7
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:20
virtual bool eventRequired() const =0
if correction needs event information
void get(HolderT &iHolder) const
tuple handle
Definition: patZpeak.py:22
virtual bool vectorialCorrection() const
if vectorial correction is provided
Definition: JetCorrector.h:66
const T & get() const
Definition: EventSetup.h:56
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
virtual bool refRequired() const =0
if correction needs the jet reference
reco::Particle::LorentzVector LorentzVector
Definition: JetCorrector.h:23