File indexing completed on 2024-04-06 12:25:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef RecoJets_FFTJetProducers_FFTJetInterface_h
0018 #define RecoJets_FFTJetProducers_FFTJetInterface_h
0019
0020 #include <memory>
0021 #include <vector>
0022 #include <cassert>
0023
0024
0025 #include "fftjet/Grid2d.hh"
0026
0027
0028 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0029 #include "FWCore/Framework/interface/Event.h"
0030 #include "FWCore/Utilities/interface/Exception.h"
0031 #include "FWCore/Framework/interface/stream/EDProducer.h"
0032
0033 #include "DataFormats/Candidate/interface/Particle.h"
0034
0035 #include "RecoJets/JetProducers/interface/AnomalousTower.h"
0036
0037 #include "DataFormats/Candidate/interface/Candidate.h"
0038 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0039 #include "DataFormats/Common/interface/Handle.h"
0040
0041 #include "DataFormats/VertexReco/interface/Vertex.h"
0042 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0043
0044
0045 #include "RecoJets/FFTJetAlgorithms/interface/fftjetTypedefs.h"
0046 #include "RecoJets/FFTJetProducers/interface/JetType.h"
0047
0048
0049
0050
0051 namespace fftjetcms {
0052 class FFTJetInterface : public edm::stream::EDProducer<> {
0053 public:
0054
0055 FFTJetInterface() = delete;
0056 FFTJetInterface(const FFTJetInterface&) = delete;
0057 FFTJetInterface& operator=(const FFTJetInterface&) = delete;
0058 ~FFTJetInterface() override {}
0059
0060 protected:
0061 explicit FFTJetInterface(const edm::ParameterSet&);
0062
0063 template <class Ptr>
0064 void checkConfig(const Ptr& ptr, const char* message) {
0065 if (ptr.get() == nullptr)
0066 throw cms::Exception("FFTJetBadConfig") << message << std::endl;
0067 }
0068
0069 void loadInputCollection(const edm::Event&);
0070 void discretizeEnergyFlow();
0071 double getEventScale() const;
0072 bool storeInSinglePrecision() const;
0073
0074 const reco::Particle::Point& vertexUsed() const { return vertex_; }
0075
0076
0077 const edm::InputTag inputLabel;
0078
0079
0080 const std::string outputLabel;
0081
0082
0083 const JetType jetType;
0084
0085
0086 const bool doPVCorrection;
0087
0088
0089 const edm::InputTag srcPVs;
0090
0091
0092 const std::vector<double> etaDependentMagnutideFactors;
0093
0094
0095 const AnomalousTower anomalous;
0096
0097
0098 std::vector<fftjetcms::VectorLike> eventData;
0099
0100
0101 std::vector<unsigned> candidateIndex;
0102
0103
0104 std::unique_ptr<fftjet::Grid2d<fftjetcms::Real> > energyFlow;
0105
0106
0107 edm::Handle<reco::CandidateView> inputCollection;
0108
0109 private:
0110 const bool insertCompleteEvent;
0111 const double completeEventScale;
0112 reco::Particle::Point vertex_;
0113
0114 edm::EDGetTokenT<reco::CandidateView> inputToken;
0115 edm::EDGetTokenT<reco::VertexCollection> srcPVsToken;
0116 };
0117 }
0118
0119 #endif