Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:24

0001 ////////////////////////////////////////////////////////////////////////////////
0002 //
0003 // Level6 SLB (Semileptonic BJet) Corrector
0004 // ----------------------------------------
0005 //
0006 //           25/10/2009  Hauke Held             <hauke.held@cern.ch>
0007 //                       Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
0008 ////////////////////////////////////////////////////////////////////////////////
0009 #ifndef L6SLBCorrectorImpl_h
0010 #define L6SLBCorrectorImpl_h
0011 
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/Utilities/interface/EDGetToken.h"
0014 #include "JetMETCorrections/JetCorrector/interface/JetCorrectorImpl.h"
0015 #include "JetMETCorrections/Algorithms/interface/JetCorrectorImplMakerBase.h"
0016 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrectorCalculator.h"
0017 #include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
0018 
0019 namespace edm {
0020   class ParameterSet;
0021   class Event;
0022   class EventSetup;
0023   class ConsumesCollector;
0024   class ConfigurationDescriptions;
0025 }  // namespace edm
0026 
0027 class L6SLBCorrectorImplMaker : public JetCorrectorImplMakerBase {
0028 public:
0029   L6SLBCorrectorImplMaker(edm::ParameterSet const&, edm::ConsumesCollector);
0030   std::unique_ptr<reco::JetCorrectorImpl> make(edm::Event const&, edm::EventSetup const&);
0031 
0032   static void fillDescriptions(edm::ConfigurationDescriptions& iDescriptions);
0033 
0034 private:
0035   edm::EDGetTokenT<std::vector<reco::SoftLeptonTagInfo>> elecToken_;
0036   edm::EDGetTokenT<std::vector<reco::SoftLeptonTagInfo>> muonToken_;
0037   bool addMuonToJet_;
0038 };
0039 
0040 class L6SLBCorrectorImpl : public reco::JetCorrectorImpl {
0041   //
0042   // construction / destruction
0043   //
0044 public:
0045   typedef L6SLBCorrectorImplMaker Maker;
0046 
0047   L6SLBCorrectorImpl(std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector,
0048                      edm::RefProd<std::vector<reco::SoftLeptonTagInfo>> const& bTagInfoMuon,
0049                      edm::RefProd<std::vector<reco::SoftLeptonTagInfo>> const& bTagInfoElec,
0050                      bool addMuonToJet);
0051 
0052   //
0053   // member functions
0054   //
0055 public:
0056   /// apply correction using Jet information only
0057   double correction(const LorentzVector& fJet) const override;
0058   /// apply correction using Jet information only
0059   double correction(const reco::Jet& fJet) const override;
0060   /// apply correction using all event information
0061   double correction(const reco::Jet& fJet, const edm::RefToBase<reco::Jet>& refToRawJet) const override;
0062 
0063   //----- if correction needs a jet reference -------------
0064   bool refRequired() const override { return true; }
0065 
0066   //
0067   // private member functions
0068   //
0069 private:
0070   int getBTagInfoIndex(const edm::RefToBase<reco::Jet>& refToRawJet,
0071                        const std::vector<reco::SoftLeptonTagInfo>& tags) const;
0072 
0073   //
0074   // member data
0075   //
0076 private:
0077   //edm::InputTag           srcBTagInfoElec_;
0078   //edm::InputTag           srcBTagInfoMuon_;
0079   std::shared_ptr<FactorizedJetCorrectorCalculator const> corrector_;
0080   edm::RefProd<std::vector<reco::SoftLeptonTagInfo>> bTagInfoMuon_;
0081   edm::RefProd<std::vector<reco::SoftLeptonTagInfo>> bTagInfoElec_;
0082   bool addMuonToJet_;
0083 };
0084 
0085 #endif