File indexing completed on 2024-04-06 12:19:15
0001
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
0012 namespace edm {
0013 class ParameterSet;
0014 class Event;
0015 class EventSetup;
0016 class ConsumesCollector;
0017 class ConfigurationDescriptions;
0018 }
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
0037 class L1JPTOffsetCorrectorImpl : public reco::JetCorrectorImpl {
0038 public:
0039 typedef L1JPTOffsetCorrectorImplMaker Maker;
0040
0041
0042 L1JPTOffsetCorrectorImpl(std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector,
0043 const reco::JetCorrector* offsetService);
0044
0045
0046 double correction(const LorentzVector& fJet) const override;
0047
0048
0049 double correction(const reco::Jet& fJet) const override;
0050
0051
0052 bool refRequired() const override { return false; }
0053
0054 private:
0055
0056 const reco::JetCorrector* offsetService_;
0057 std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector_;
0058 };
0059
0060 #endif