File indexing completed on 2024-04-06 12:25:32
0001 #ifndef RecoJets_JetProducers_plugins_FastjetJetProducer_h
0002 #define RecoJets_JetProducers_plugins_FastjetJetProducer_h
0003
0004 #include "RecoJets/JetProducers/interface/JetSpecific.h"
0005 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0007
0008 #include "DataFormats/VertexReco/interface/Vertex.h"
0009 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0010
0011 #include "RecoJets/JetProducers/plugins/VirtualJetProducer.h"
0012
0013 #include <fastjet/tools/Transformer.hh>
0014
0015
0016
0017
0018
0019 class DynamicRfilt : public fastjet::FunctionOfPseudoJet<double> {
0020 public:
0021
0022 DynamicRfilt(double Rmax, double deltaR_factor) : _Rmax(Rmax), _deltaR_factor(deltaR_factor) {}
0023
0024
0025 double result(const fastjet::PseudoJet& j) const override {
0026 if (!j.has_pieces())
0027 return _Rmax;
0028
0029 std::vector<fastjet::PseudoJet> pieces = j.pieces();
0030 if (pieces.size() != 2)
0031 return _Rmax;
0032
0033 double deltaR = pieces[0].delta_R(pieces[1]);
0034 return std::min(_Rmax, _deltaR_factor * deltaR);
0035 }
0036
0037 private:
0038 double _Rmax, _deltaR_factor;
0039 };
0040
0041 class FastjetJetProducer : public VirtualJetProducer {
0042 public:
0043
0044 typedef fastjet::Transformer transformer;
0045 typedef std::unique_ptr<transformer> transformer_ptr;
0046 typedef std::vector<transformer_ptr> transformer_coll;
0047
0048
0049
0050 explicit FastjetJetProducer(const edm::ParameterSet& iConfig);
0051 ~FastjetJetProducer() override;
0052 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0053 static void fillDescriptionsFromFastJetProducer(edm::ParameterSetDescription& desc);
0054
0055 void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0056
0057
0058 typedef std::shared_ptr<DynamicRfilt> DynamicRfiltPtr;
0059
0060 protected:
0061
0062
0063
0064
0065 virtual void produceTrackJets(edm::Event& iEvent, const edm::EventSetup& iSetup);
0066 void runAlgorithm(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0067
0068 private:
0069
0070 bool useOnlyVertexTracks_;
0071 bool useOnlyOnePV_;
0072 float dzTrVtxMax_;
0073 float dxyTrVtxMax_;
0074 int minVtxNdof_;
0075 float maxVtxZ_;
0076
0077
0078 bool useMassDropTagger_;
0079 bool useFiltering_;
0080 bool useDynamicFiltering_;
0081 bool useTrimming_;
0082 bool usePruning_;
0083 bool useCMSBoostedTauSeedingAlgorithm_;
0084 bool useKtPruning_;
0085 bool useConstituentSubtraction_;
0086 bool useSoftDrop_;
0087 bool correctShape_;
0088 double muCut_;
0089 double yCut_;
0090 double rFilt_;
0091 DynamicRfiltPtr rFiltDynamic_;
0092 double rFiltFactor_;
0093 int nFilt_;
0094 double trimPtFracMin_;
0095 double zCut_;
0096 double RcutFactor_;
0097 double csRho_EtaMax_;
0098 double csRParam_;
0099 double beta_;
0100 double R0_;
0101 double gridMaxRapidity_;
0102 double gridSpacing_;
0103
0104 double subjetPtMin_;
0105 double muMin_;
0106 double muMax_;
0107 double yMin_;
0108 double yMax_;
0109 double dRMin_;
0110 double dRMax_;
0111 int maxDepth_;
0112
0113
0114 edm::EDGetTokenT<edm::View<reco::RecoChargedRefCandidate> > input_chrefcand_token_;
0115 };
0116
0117 #endif