Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // L1Offset jet corrector class. Inherits from JetCorrector.h
0002 #ifndef L1JPTOffsetCorrectorImpl_h
0003 #define L1JPTOffsetCorrectorImpl_h
0004 
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "JetMETCorrections/JetCorrector/interface/JetCorrectorImpl.h"
0007 #include "JetMETCorrections/Algorithms/interface/JetCorrectorImplMakerBase.h"
0008 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrectorCalculator.h"
0009 #include "FWCore/Utilities/interface/EDGetToken.h"
0010 
0011 //----- classes declaration -----------------------------------
0012 namespace edm {
0013   class ParameterSet;
0014   class Event;
0015   class EventSetup;
0016   class ConsumesCollector;
0017   class ConfigurationDescriptions;
0018 }  // namespace edm
0019 
0020 namespace reco {
0021   class JetCorrector;
0022 }
0023 
0024 class L1JPTOffsetCorrectorImplMaker : public JetCorrectorImplMakerBase {
0025 public:
0026   L1JPTOffsetCorrectorImplMaker(edm::ParameterSet const&, edm::ConsumesCollector);
0027   std::unique_ptr<reco::JetCorrectorImpl> make(edm::Event const&, edm::EventSetup const&);
0028 
0029   static void fillDescriptions(edm::ConfigurationDescriptions& iDescriptions);
0030 
0031 private:
0032   edm::EDGetTokenT<reco::JetCorrector> offsetCorrectorToken_;
0033   bool useOffset_;
0034 };
0035 
0036 //----- LXXXCorrector interface -------------------------------
0037 class L1JPTOffsetCorrectorImpl : public reco::JetCorrectorImpl {
0038 public:
0039   typedef L1JPTOffsetCorrectorImplMaker Maker;
0040 
0041   //----- constructors---------------------------------------
0042   L1JPTOffsetCorrectorImpl(std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector,
0043                            const reco::JetCorrector* offsetService);
0044 
0045   //----- apply correction using Jet information only -------
0046   double correction(const LorentzVector& fJet) const override;
0047 
0048   //----- apply correction using Jet information only -------
0049   double correction(const reco::Jet& fJet) const override;
0050 
0051   //----- if correction needs event information -------------
0052   bool refRequired() const override { return false; }
0053 
0054 private:
0055   //----- member data ---------------------------------------
0056   const reco::JetCorrector* offsetService_;
0057   std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector_;
0058 };
0059 
0060 #endif