CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CorrectJet.h
Go to the documentation of this file.
1 #ifndef CorrectJet_H
2 #define CorrectJet_H
3 
4 #include <string>
5 
9 
16 class CorrectJet {
17 
18  public:
20  CorrectJet(const std::string &corrector) :
21  m_corrector(0), m_correctorName(corrector) {}
22 
23  void setEventSetup(const edm::EventSetup & es)
24  {
25  if (!m_correctorName.empty())
27  else
28  m_corrector = 0;
29  }
30 
33  {
34  reco::Jet correctedJet(jet.p4(), jet.vertex());
35  if (m_corrector)
36  correctedJet.scaleEnergy(m_corrector->correction(jet));
37  return correctedJet;
38  }
39 
40  private:
42  std::string m_correctorName;
43 };
44 
45 #endif
virtual const Point & vertex() const
vertex position
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:21
void setEventSetup(const edm::EventSetup &es)
Definition: CorrectJet.h:23
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:445
reco::Jet operator()(const reco::Jet &jet) const
Returns the corrected jet.
Definition: CorrectJet.h:32
std::string m_correctorName
Definition: CorrectJet.h:42
CorrectJet(const std::string &corrector)
Definition: CorrectJet.h:20
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:51
const JetCorrector * m_corrector
Definition: CorrectJet.h:41
virtual const LorentzVector & p4() const
four-momentum Lorentz vector