Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef JetMETCorrections_Type1MET_PFCandMETcorrInputProducer_h
0002 #define JetMETCorrections_Type1MET_PFCandMETcorrInputProducer_h
0003 
0004 /** \class PFCandMETcorrInputProducer
0005  *
0006  * Sum PFCandidates not within jets ("unclustered energy"),
0007  * needed as input for Type 2 MET corrections
0008  *
0009  * \authors Michael Schmitt, Richard Cavanaugh, The University of Florida
0010  *          Florent Lacroix, University of Illinois at Chicago
0011  *          Christian Veelken, LLR
0012  *
0013  *
0014  *
0015  */
0016 
0017 #include "FWCore/Framework/interface/stream/EDProducer.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/EventSetup.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Utilities/interface/InputTag.h"
0022 #include "DataFormats/Common/interface/ValueMap.h"
0023 
0024 #include "DataFormats/METReco/interface/CorrMETData.h"
0025 
0026 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0027 #include "DataFormats/Candidate/interface/Candidate.h"
0028 
0029 #include <string>
0030 
0031 class PFCandMETcorrInputProducer : public edm::stream::EDProducer<> {
0032 public:
0033   explicit PFCandMETcorrInputProducer(const edm::ParameterSet&);
0034   ~PFCandMETcorrInputProducer() override;
0035 
0036 private:
0037   void produce(edm::Event&, const edm::EventSetup&) override;
0038 
0039   std::string moduleLabel_;
0040 
0041   edm::EDGetTokenT<edm::View<reco::Candidate>> token_;
0042   edm::EDGetTokenT<edm::ValueMap<float>> weightsToken_;
0043 
0044   struct binningEntryType {
0045     binningEntryType() : binLabel_(""), binSelection_(nullptr) {}
0046     binningEntryType(const edm::ParameterSet& cfg)
0047         : binLabel_(cfg.getParameter<std::string>("binLabel")),
0048           binSelection_(new StringCutObjectSelector<reco::Candidate::LorentzVector>(
0049               cfg.getParameter<std::string>("binSelection"))) {}
0050     ~binningEntryType() {}
0051     const std::string binLabel_;
0052     std::unique_ptr<const StringCutObjectSelector<reco::Candidate::LorentzVector>> binSelection_;
0053     CorrMETData binUnclEnergySum_;
0054   };
0055   std::vector<std::unique_ptr<binningEntryType>> binning_;
0056 };
0057 
0058 #endif