File indexing completed on 2024-04-06 12:19:26
0001 #ifndef JetMETCorrections_Type1MET_PFCandMETcorrInputProducer_h
0002 #define JetMETCorrections_Type1MET_PFCandMETcorrInputProducer_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
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