File indexing completed on 2024-04-06 12:13:56
0001 #ifndef GeneratorInterface_Pythia8Interface_JetMatchingEWKFxFx_h
0002 #define GeneratorInterface_Pythia8Interface_JetMatchingEWKFxFx_h
0003
0004
0005
0006
0007
0008
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/PluginManager/interface/PluginFactory.h"
0011 #include "Pythia8/Pythia.h"
0012 #include "Pythia8Plugins/JetMatching.h"
0013 #include "Pythia8Plugins/GeneratorInput.h"
0014 #include <memory>
0015 #include "GeneratorInterface/Pythia8Interface/interface/CustomHook.h"
0016
0017
0018
0019
0020 class JetMatchingEWKFxFx : public Pythia8::JetMatching {
0021 public:
0022
0023 JetMatchingEWKFxFx(const edm::ParameterSet& iConfig);
0024 ~JetMatchingEWKFxFx() override {}
0025
0026
0027 bool initAfterBeams() override;
0028
0029 bool canVetoPartonLevelEarly() override { return true; }
0030 bool doVetoPartonLevelEarly(const Pythia8::Event& event) override;
0031
0032 bool canVetoProcessLevel() override { return true; }
0033 bool doVetoProcessLevel(Pythia8::Event& event) override;
0034
0035
0036 int numberVetoStep() override { return 1; }
0037 bool canVetoStep() override { return doShowerKt; }
0038 bool doVetoStep(int, int, int, const Pythia8::Event&) override;
0039
0040 Pythia8::SlowJet* slowJetDJR;
0041
0042 Pythia8::vector<double> getDJR() { return DJR; }
0043 Pythia8::pair<int, int> nMEpartons() { return nMEpartonsSave; }
0044
0045 Pythia8::Event getWorkEventJet() { return workEventJetSave; }
0046 Pythia8::Event getProcessSubset() { return processSubsetSave; }
0047 bool getExclusive() { return exclusive; }
0048 double getPTfirst() { return pTfirstSave; }
0049
0050
0051 void sortIncomingProcess(const Pythia8::Event&) override;
0052
0053 void jetAlgorithmInput(const Pythia8::Event&, int) override;
0054 void runJetAlgorithm() override;
0055 bool matchPartonsToJets(int) override;
0056 int matchPartonsToJetsLight() override;
0057 int matchPartonsToJetsHeavy() override;
0058 int matchPartonsToJetsOther();
0059 bool doShowerKtVeto(double pTfirst);
0060
0061
0062 void clearDJR() { DJR.resize(0); }
0063 void setDJR(const Pythia8::Event& event);
0064
0065 void clear_nMEpartons() { nMEpartonsSave.first = nMEpartonsSave.second = -1; }
0066 void set_nMEpartons(const int nOrig, const int nMatch) {
0067 clear_nMEpartons();
0068 nMEpartonsSave.first = nOrig;
0069 nMEpartonsSave.second = nMatch;
0070 };
0071
0072
0073
0074 int npNLO();
0075
0076 private:
0077 Pythia8::Event processSubsetSave;
0078 Pythia8::Event workEventJetSave;
0079 double pTfirstSave;
0080
0081 bool performVeto;
0082
0083 Pythia8::vector<int> origTypeIdx[3];
0084 int nQmatch;
0085 double qCut, qCutSq, clFact;
0086 bool doFxFx;
0087 int nPartonsNow;
0088 double qCutME, qCutMESq;
0089
0090 Pythia8::vector<double> DJR;
0091
0092 Pythia8::pair<int, int> nMEpartonsSave;
0093 };
0094
0095
0096 REGISTER_USERHOOK(JetMatchingEWKFxFx);
0097 #endif