Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:23

0001 #ifndef JetMETCorrections_JetCorrector_JetCorrector_h
0002 #define JetMETCorrections_JetCorrector_JetCorrector_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     JetMETCorrections/JetCorrector
0006 // Class  :     reco::JetCorrector
0007 //
0008 /**\class reco::JetCorrector JetCorrector.h "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Fri, 29 Aug 2014 15:42:37 GMT
0019 //
0020 
0021 // system include files
0022 #include <memory>
0023 
0024 // user include files
0025 #include "JetMETCorrections/JetCorrector/interface/JetCorrectorImpl.h"
0026 #include "DataFormats/Common/interface/RefToBase.h"
0027 #include "DataFormats/JetReco/interface/Jet.h"
0028 
0029 // forward declarations
0030 
0031 namespace reco {
0032 
0033   class JetCorrector {
0034   public:
0035     JetCorrector();
0036     JetCorrector(std::unique_ptr<JetCorrectorImpl const> fImpl) : impl_(std::move(fImpl)) {}
0037     JetCorrector(JetCorrector&&) = default;
0038     JetCorrector& operator=(JetCorrector&&) = default;
0039     JetCorrector(const JetCorrector&) = delete;
0040     JetCorrector& operator=(const JetCorrector&) = delete;
0041 
0042     typedef reco::Particle::LorentzVector LorentzVector;
0043 
0044     // ---------- const member functions ---------------------
0045     /// get correction using Jet information only
0046     double correction(const LorentzVector& fJet) const { return impl_->correction(fJet); }
0047 
0048     /// apply correction using Jet information only
0049     double correction(const reco::Jet& fJet) const { return impl_->correction(fJet); }
0050 
0051     /// apply correction using Ref
0052     double correction(const reco::Jet& fJet, const edm::RefToBase<reco::Jet>& fJetRef) const {
0053       return impl_->correction(fJet, fJetRef);
0054     }
0055 
0056     /// Apply vectorial correction
0057     double correction(const reco::Jet& fJet, const edm::RefToBase<reco::Jet>& fJetRef, LorentzVector& corrected) const {
0058       return impl_->correction(fJet, fJetRef, corrected);
0059     }
0060 
0061     /// if correction needs the jet reference
0062     bool refRequired() const { return impl_->refRequired(); }
0063 
0064     /// if vectorial correction is provided
0065     bool vectorialCorrection() const { return impl_->vectorialCorrection(); }
0066 
0067     // ---------- static member functions --------------------
0068 
0069     // ---------- member functions ---------------------------
0070 
0071   private:
0072     // ---------- member data --------------------------------
0073     std::unique_ptr<JetCorrectorImpl const> impl_;
0074   };
0075 }  // namespace reco
0076 
0077 #endif