Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:36

0001 #ifndef RecoMET_METPUSubtraction_mvaMEtUtilities_h
0002 #define RecoMET_METPUSubtraction_mvaMEtUtilities_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #include "DataFormats/Candidate/interface/Candidate.h"
0007 #include "DataFormats/METReco/interface/CommonMETData.h"
0008 #include "DataFormats/METReco/interface/PUSubMETData.h"
0009 
0010 #include <vector>
0011 #include <utility>
0012 
0013 class MvaMEtUtilities {
0014 public:
0015   enum { kPFCands = 0, kLeptons, kJets };
0016   enum { kPF = 0, kChHS, kHS, kPU, kHSMinusNeutralPU };
0017 
0018 private:
0019   CommonMETData leptonsSum_;
0020   CommonMETData leptonsChSum_;
0021   CommonMETData pfCandSum_;
0022   CommonMETData pfCandChHSSum_;
0023   CommonMETData pfCandChPUSum_;
0024   CommonMETData neutralJetHSSum_;
0025   CommonMETData neutralJetPUSum_;
0026 
0027   std::vector<reco::PUSubMETCandInfo> cleanedJets_;
0028 
0029   double dzCut_;
0030   double ptThreshold_;
0031 
0032 public:
0033   MvaMEtUtilities(const edm::ParameterSet& cfg);
0034   virtual ~MvaMEtUtilities();
0035 
0036   reco::Candidate::LorentzVector leadJetP4(const std::vector<reco::PUSubMETCandInfo>&);
0037   reco::Candidate::LorentzVector subleadJetP4(const std::vector<reco::PUSubMETCandInfo>&);
0038   unsigned numJetsAboveThreshold(const std::vector<reco::PUSubMETCandInfo>&, double);
0039 
0040   const std::vector<reco::PUSubMETCandInfo>& getCleanedJets() const;
0041 
0042   //access functions for lepton suns ============
0043   double getLeptonsSumMEX() const;
0044   double getLeptonsSumMEY() const;
0045 
0046   double getLeptonsChSumMEX() const;
0047   double getLeptonsChSumMEY() const;
0048 
0049   //recoil and sum computing functions ========
0050   void computeAllSums(const std::vector<reco::PUSubMETCandInfo>& jets,
0051                       const std::vector<reco::PUSubMETCandInfo>& leptons,
0052                       const std::vector<reco::PUSubMETCandInfo>& pfCandidates);
0053 
0054   CommonMETData computeRecoil(int metType);
0055 
0056 protected:
0057   reco::Candidate::LorentzVector jetP4(const std::vector<reco::PUSubMETCandInfo>&, unsigned);
0058 
0059   // cuts on jet Id. MVA output in bins of jet Pt and eta
0060   double mvaCut_[3][4][4];
0061 
0062 private:
0063   //utilities functions for jets ===============
0064   bool passesMVA(const reco::Candidate::LorentzVector&, double);
0065 
0066   std::vector<reco::PUSubMETCandInfo> cleanJets(const std::vector<reco::PUSubMETCandInfo>&,
0067                                                 const std::vector<reco::PUSubMETCandInfo>&,
0068                                                 double,
0069                                                 double);
0070 
0071   //utilities functions for pf candidate ======
0072   std::vector<reco::PUSubMETCandInfo> cleanPFCands(const std::vector<reco::PUSubMETCandInfo>&,
0073                                                    const std::vector<reco::PUSubMETCandInfo>&,
0074                                                    double,
0075                                                    bool);
0076 
0077   CommonMETData computeCandSum(int compKey,
0078                                double dZmax,
0079                                int dZflag,
0080                                bool iCharged,
0081                                bool mvaPassFlag,
0082                                const std::vector<reco::PUSubMETCandInfo>& objects);
0083 
0084   void finalize(CommonMETData& metData);
0085 };
0086 
0087 #endif