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 L1OffsetCorrectorImpl_h
0003 #define L1OffsetCorrectorImpl_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 #include "DataFormats/VertexReco/interface/Vertex.h"
0011 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0012 
0013 //----- classes declaration -----------------------------------
0014 namespace edm {
0015   class ParameterSet;
0016   class Event;
0017   class EventSetup;
0018   class ConsumesCollector;
0019   class ConfigurationDescriptions;
0020 }  // namespace edm
0021 
0022 class L1OffsetCorrectorImplMaker : public JetCorrectorImplMakerBase {
0023 public:
0024   L1OffsetCorrectorImplMaker(edm::ParameterSet const&, edm::ConsumesCollector);
0025   std::unique_ptr<reco::JetCorrectorImpl> make(edm::Event const&, edm::EventSetup const&);
0026 
0027   static void fillDescriptions(edm::ConfigurationDescriptions& iDescriptions);
0028 
0029 private:
0030   edm::EDGetTokenT<reco::VertexCollection> verticesToken_;
0031   int minVtxNdof_;
0032 };
0033 
0034 //----- LXXXCorrector interface -------------------------------
0035 class L1OffsetCorrectorImpl : public reco::JetCorrectorImpl {
0036 public:
0037   typedef L1OffsetCorrectorImplMaker Maker;
0038 
0039   //----- constructors---------------------------------------
0040   L1OffsetCorrectorImpl(std::shared_ptr<FactorizedJetCorrectorCalculator const> calculator, int npv);
0041 
0042   //----- destructor ----------------------------------------
0043 
0044   //----- apply correction using Jet information only -------
0045   double correction(const LorentzVector& fJet) const override;
0046 
0047   //----- apply correction using Jet information only -------
0048   double correction(const reco::Jet& fJet) const override;
0049 
0050   //----- if correction needs a jet reference -------------
0051   bool refRequired() const override { return false; }
0052 
0053 private:
0054   //----- member data ---------------------------------------
0055   std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector_;
0056   int npv_;
0057 };
0058 
0059 #endif