File indexing completed on 2024-04-06 12:25:31
0001 #ifndef RecoJets_JetProducers_ECFAdder_h
0002 #define RecoJets_JetProducers_ECFAdder_h
0003
0004 #include <memory>
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/stream/EDProducer.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "FWCore/Utilities/interface/InputTag.h"
0010 #include "DataFormats/JetReco/interface/Jet.h"
0011 #include "DataFormats/Common/interface/ValueMap.h"
0012 #include "fastjet/contrib/EnergyCorrelator.hh"
0013 #include "CommonTools/UtilAlgos/interface/StringCutObjectSelector.h"
0014
0015 class ECFAdder : public edm::stream::EDProducer<> {
0016 public:
0017 explicit ECFAdder(const edm::ParameterSet& iConfig);
0018
0019 void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0020 float getECF(unsigned index, const edm::Ptr<reco::Jet>& object) const;
0021
0022 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0023
0024 private:
0025 edm::InputTag src_;
0026 edm::EDGetTokenT<edm::View<reco::Jet>> src_token_;
0027 std::vector<unsigned> Njets_;
0028 std::vector<std::string> cuts_;
0029 std::string ecftype_;
0030 std::vector<std::string> variables_;
0031 double alpha_;
0032 double beta_;
0033
0034 std::vector<std::shared_ptr<fastjet::FunctionOfPseudoJet<double>>> routine_;
0035 std::vector<StringCutObjectSelector<reco::Jet>> selectors_;
0036 edm::EDGetTokenT<edm::ValueMap<float>> input_weights_token_;
0037 edm::ValueMap<float> const* weightsHandle_;
0038 };
0039
0040 #endif