File indexing completed on 2024-04-06 12:25:31
0001 #ifndef NjettinessAdder_h
0002 #define NjettinessAdder_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/Njettiness.hh"
0013
0014 class NjettinessAdder : public edm::stream::EDProducer<> {
0015 public:
0016 enum MeasureDefinition_t {
0017 NormalizedMeasure = 0,
0018 UnnormalizedMeasure,
0019 OriginalGeometricMeasure,
0020 NormalizedCutoffMeasure,
0021 UnnormalizedCutoffMeasure,
0022 GeometricCutoffMeasure,
0023 N_MEASURE_DEFINITIONS
0024 };
0025 enum AxesDefinition_t {
0026 KT_Axes = 0,
0027 CA_Axes,
0028 AntiKT_Axes,
0029 WTA_KT_Axes,
0030 WTA_CA_Axes,
0031 Manual_Axes,
0032 OnePass_KT_Axes,
0033 OnePass_CA_Axes,
0034 OnePass_AntiKT_Axes,
0035 OnePass_WTA_KT_Axes,
0036 OnePass_WTA_CA_Axes,
0037 OnePass_Manual_Axes,
0038 MultiPass_Axes,
0039 N_AXES_DEFINITIONS
0040 };
0041
0042 explicit NjettinessAdder(const edm::ParameterSet& iConfig);
0043
0044 ~NjettinessAdder() override {}
0045
0046 void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0047 float getTau(unsigned num, const edm::Ptr<reco::Jet>& object) const;
0048
0049 private:
0050 edm::InputTag src_;
0051 edm::EDGetTokenT<edm::View<reco::Jet>> src_token_;
0052 std::vector<unsigned> Njets_;
0053
0054
0055 unsigned measureDefinition_;
0056 double beta_;
0057 double R0_;
0058 double Rcutoff_;
0059
0060
0061 unsigned axesDefinition_;
0062 int nPass_;
0063 double akAxesR0_;
0064
0065 edm::EDGetTokenT<edm::ValueMap<float>> input_weights_token_;
0066 edm::ValueMap<float> const* weightsHandle_;
0067
0068 std::unique_ptr<fastjet::contrib::Njettiness> routine_;
0069 };
0070
0071 #endif