File indexing completed on 2024-04-06 12:25:31
0001 #ifndef JetProducers_QGTagger_h
0002 #define JetProducers_QGTagger_h
0003 #include <tuple>
0004
0005 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0006 #include "DataFormats/Common/interface/ValueMap.h"
0007
0008 #include "FWCore/Framework/interface/Frameworkfwd.h"
0009 #include "FWCore/Framework/interface/global/EDProducer.h"
0010
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013
0014 #include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
0015 #include "RecoJets/JetAlgorithms/interface/QGLikelihoodCalculator.h"
0016 #include "CondFormats/DataRecord/interface/QGLikelihoodRcd.h"
0017 #include "CondFormats/DataRecord/interface/QGLikelihoodSystematicsRcd.h"
0018
0019 class QGTagger : public edm::global::EDProducer<> {
0020 public:
0021 explicit QGTagger(const edm::ParameterSet&);
0022 ~QGTagger() override = default;
0023 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0024
0025 private:
0026 void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0027 std::tuple<int, float, float> calcVariables(const reco::Jet*,
0028 edm::Handle<reco::VertexCollection>&,
0029 edm::ValueMap<float>&,
0030 bool) const;
0031 template <typename T>
0032 void putInEvent(const std::string&,
0033 const edm::Handle<edm::View<reco::Jet>>&,
0034 const std::vector<T>&,
0035 edm::Event&) const;
0036 bool isPackedCandidate(const reco::Jet* jet) const;
0037
0038 edm::EDGetTokenT<edm::View<reco::Jet>> jetsToken;
0039 edm::EDGetTokenT<reco::JetCorrector> jetCorrectorToken;
0040 edm::EDGetTokenT<reco::VertexCollection> vertexToken;
0041 edm::EDGetTokenT<double> rhoToken;
0042 const bool computeLikelihood;
0043 edm::ESGetToken<QGLikelihoodObject, QGLikelihoodRcd> paramsToken;
0044 edm::ESGetToken<QGLikelihoodSystematicsObject, QGLikelihoodSystematicsRcd> systToken;
0045 const bool useQC, useJetCorr, produceSyst;
0046 bool applyConstituentWeight;
0047 edm::EDGetTokenT<edm::ValueMap<float>> constituentWeightsToken;
0048 QGLikelihoodCalculator qgLikelihood;
0049 };
0050
0051 #endif