File indexing completed on 2025-01-18 10:06:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef Pythia8_CombineMatchingInput_H
0015 #define Pythia8_CombineMatchingInput_H
0016
0017
0018 #include "Pythia8/Pythia.h"
0019 #include "Pythia8Plugins/GeneratorInput.h"
0020 #include "Pythia8Plugins/JetMatching.h"
0021
0022 namespace Pythia8 {
0023
0024
0025
0026
0027
0028
0029
0030
0031 class JetMatchingAlpgenInputAlpgen : public AlpgenHooks,
0032 public JetMatchingAlpgen {
0033
0034 public:
0035
0036
0037 JetMatchingAlpgenInputAlpgen(Pythia& pythia) : AlpgenHooks(pythia),
0038 JetMatchingAlpgen() { }
0039 ~JetMatchingAlpgenInputAlpgen() {}
0040
0041
0042 virtual bool initAfterBeams() {
0043 if (!AlpgenHooks::initAfterBeams()) return false;
0044 if (!JetMatchingAlpgen::initAfterBeams()) return false;
0045 return true;
0046 }
0047
0048
0049 virtual bool canVetoProcessLevel() {
0050 return JetMatchingAlpgen::canVetoProcessLevel();
0051 }
0052 virtual bool doVetoProcessLevel(Event & proc) {
0053 return JetMatchingAlpgen::doVetoProcessLevel(proc);
0054 }
0055
0056
0057 virtual bool canVetoPartonLevelEarly() {
0058 return JetMatchingAlpgen::canVetoPartonLevelEarly();
0059 }
0060 virtual bool doVetoPartonLevelEarly(const Event &proc) {
0061 return JetMatchingAlpgen::doVetoPartonLevelEarly(proc);
0062 }
0063
0064 };
0065
0066
0067
0068
0069
0070
0071
0072
0073 class JetMatchingMadgraphInputAlpgen : public AlpgenHooks,
0074 public JetMatchingMadgraph {
0075
0076 public:
0077
0078
0079 JetMatchingMadgraphInputAlpgen(Pythia& pythia) : AlpgenHooks(pythia),
0080 JetMatchingMadgraph() {}
0081 ~JetMatchingMadgraphInputAlpgen() {}
0082
0083
0084 virtual bool initAfterBeams() {
0085
0086 settingsPtr->flag("JetMatching:setMad",false);
0087 if (!AlpgenHooks::initAfterBeams()) return false;
0088 if (!JetMatchingMadgraph::initAfterBeams()) return false;
0089 return true;
0090 }
0091
0092
0093 virtual bool canVetoProcessLevel() {
0094 return JetMatchingMadgraph::canVetoProcessLevel();
0095 }
0096 virtual bool doVetoProcessLevel(Event& proc) {
0097 return JetMatchingMadgraph::doVetoProcessLevel(proc);
0098 }
0099
0100
0101 virtual bool canVetoPartonLevelEarly() {
0102 return JetMatchingMadgraph::canVetoPartonLevelEarly();
0103 }
0104 virtual bool doVetoPartonLevelEarly(const Event& proc) {
0105 return JetMatchingMadgraph::doVetoPartonLevelEarly(proc);
0106 }
0107
0108 };
0109
0110
0111
0112 class CombineMatchingInput {
0113
0114 public:
0115
0116
0117 CombineMatchingInput() {}
0118 ~CombineMatchingInput() {}
0119
0120
0121 void setHook(Pythia& pythia) {
0122
0123
0124 bool isAlpgenFile = ( pythia.word("Alpgen:file") != "void" );
0125 int scheme = pythia.mode("JetMatching:scheme");
0126
0127
0128 if (isAlpgenFile) {
0129 if (scheme == 2)
0130 hook = make_shared<JetMatchingAlpgenInputAlpgen>(pythia);
0131 if (scheme == 1)
0132 hook = make_shared<JetMatchingMadgraphInputAlpgen>(pythia);
0133 } else {
0134 if (scheme == 2)
0135 hook = make_shared<JetMatchingAlpgen>();
0136 if (scheme == 1)
0137 hook = make_shared<JetMatchingMadgraph>();
0138 }
0139
0140 pythia.setUserHooksPtr(hook);
0141
0142 return;
0143 }
0144
0145 shared_ptr<UserHooks> hook;
0146
0147 };
0148
0149
0150
0151 }
0152
0153 #endif