PYTHIA  8.312
CombineMatchingInput.h
1 // CombineMatchingInput.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the following classes:
7 // JetMatchingAlpgenInputAlpgen: combines Alpgen-style MLM matching
8 // with Alpgen native format event input.
9 // JetMatchingMadgraphInputAlpgen: combines Madgraph-style MLM matching
10 // with Alpgen native format event input.
11 // CombineMatchingInput: invokes Alpgen- or Madgraphs-style MLM matching
12 // for Madgraph LHEF or Alpgen native format event input.
13 
14 #ifndef Pythia8_CombineMatchingInput_H
15 #define Pythia8_CombineMatchingInput_H
16 
17 // Includes and namespace
18 #include "Pythia8/Pythia.h"
19 #include "Pythia8Plugins/GeneratorInput.h"
20 #include "Pythia8Plugins/JetMatching.h"
21 
22 namespace Pythia8 {
23 
24 //==========================================================================
25 
26 // JetMatchingAlpgenInputAlpgen:
27 // A small UserHooks class that gives the functionality of both AlpgenHooks
28 // and JetMatchingAlpgen. These classes have one overlapping function,
29 // 'initAfterBeams()', which is overridden here such that both are called.
30 
32  public JetMatchingAlpgen {
33 
34 public:
35 
36  // Constructor and destructor.
38  JetMatchingAlpgen() { }
40 
41  // Initialisation.
42  virtual bool initAfterBeams() {
43  if (!AlpgenHooks::initAfterBeams()) return false;
44  if (!JetMatchingAlpgen::initAfterBeams()) return false;
45  return true;
46  }
47 
48  // Process level vetos.
49  virtual bool canVetoProcessLevel() {
51  }
52  virtual bool doVetoProcessLevel(Event & proc) {
54  }
55 
56  // Parton level vetos (before beam remnants and resonance decays).
57  virtual bool canVetoPartonLevelEarly() {
59  }
60  virtual bool doVetoPartonLevelEarly(const Event &proc) {
62  }
63 
64 };
65 
66 //==========================================================================
67 
68 // JetMatchingMadgraphInputAlpgen:
69 // A small UserHooks class that gives the functionality of both AlpgenHooks
70 // and JetMatchingMadgraph. These classes have one overlapping function,
71 // 'initAfterBeams()', which is overridden here such that both are called.
72 
74  public JetMatchingMadgraph {
75 
76 public:
77 
78  // Constructor and destructor.
82 
83  // Initialisation.
84  virtual bool initAfterBeams() {
85  // Madgraph matching parameters should not be set from Alpgen file.
86  settingsPtr->flag("JetMatching:setMad",false);
87  if (!AlpgenHooks::initAfterBeams()) return false;
88  if (!JetMatchingMadgraph::initAfterBeams()) return false;
89  return true;
90  }
91 
92  // Process level vetos.
93  virtual bool canVetoProcessLevel() {
95  }
96  virtual bool doVetoProcessLevel(Event& proc) {
98  }
99 
100  // Parton level vetos (before beam remnants and resonance decays).
101  virtual bool canVetoPartonLevelEarly() {
103  }
104  virtual bool doVetoPartonLevelEarly(const Event& proc) {
106  }
107 
108 };
109 
110 //==========================================================================
111 
113 
114 public:
115 
116  // Constructor and destructor.
119 
120  // Return a hook relevant for combination of input and matching.
121  void setHook(Pythia& pythia) {
122 
123  // Find input source and matching scheme.
124  bool isAlpgenFile = ( pythia.word("Alpgen:file") != "void" );
125  int scheme = pythia.mode("JetMatching:scheme");
126 
127  // Return relevant UserHooks.
128  if (isAlpgenFile) {
129  if (scheme == 2)
130  hook = make_shared<JetMatchingAlpgenInputAlpgen>(pythia);
131  if (scheme == 1)
132  hook = make_shared<JetMatchingMadgraphInputAlpgen>(pythia);
133  } else {
134  if (scheme == 2)
135  hook = make_shared<JetMatchingAlpgen>();
136  if (scheme == 1)
137  hook = make_shared<JetMatchingMadgraph>();
138  }
139 
140  pythia.setUserHooksPtr(hook);
141 
142  return;
143  }
144 
145  shared_ptr<UserHooks> hook;
146 
147 };
148 
149 //==========================================================================
150 
151 } // end namespace Pythia8
152 
153 #endif // Pythia8_CombineMatchingInput_H
bool initAfterBeams()
Initialisation.
Definition: JetMatching.h:518
bool doVetoProcessLevel(Event &process)
Definition: JetMatching.h:137
virtual bool canVetoProcessLevel()
Process level vetos.
Definition: CombineMatchingInput.h:49
virtual bool doVetoPartonLevelEarly(const Event &proc)
Definition: CombineMatchingInput.h:60
bool flag(string keyIn)
Give back current value, with check that key exists.
Definition: Settings.cc:1478
Settings * settingsPtr
Pointer to the settings database.
Definition: PhysicsBase.h:81
The Event class holds all info on the generated event.
Definition: Event.h:453
virtual bool doVetoProcessLevel(Event &proc)
Definition: CombineMatchingInput.h:96
Declaration of main UserHooks class to perform Alpgen matching.
Definition: JetMatching.h:241
bool initAfterBeams()
Override initAfterBeams routine from UserHooks.
Definition: GeneratorInput.h:1063
virtual bool doVetoProcessLevel(Event &proc)
Definition: CombineMatchingInput.h:52
bool canVetoPartonLevelEarly()
Parton level vetos (before beam remnants and resonance decays)
Definition: JetMatching.h:143
virtual bool canVetoPartonLevelEarly()
Parton level vetos (before beam remnants and resonance decays).
Definition: CombineMatchingInput.h:57
virtual bool doVetoPartonLevelEarly(const Event &proc)
Definition: CombineMatchingInput.h:104
JetMatchingAlpgenInputAlpgen(Pythia &pythia)
Constructor and destructor.
Definition: CombineMatchingInput.h:37
virtual bool initAfterBeams()
Initialisation.
Definition: CombineMatchingInput.h:84
Definition: GeneratorInput.h:133
Definition: CombineMatchingInput.h:73
Declaration of main UserHooks class to perform Madgraph matching.
Definition: JetMatching.h:274
JetMatchingMadgraphInputAlpgen(Pythia &pythia)
Constructor and destructor.
Definition: CombineMatchingInput.h:79
Definition: CombineMatchingInput.h:112
bool doVetoPartonLevelEarly(const Event &event)
Early parton level veto (before beam remnants and resonance showers)
Definition: JetMatching.h:384
Definition: CombineMatchingInput.h:31
CombineMatchingInput()
Constructor and destructor.
Definition: CombineMatchingInput.h:117
bool canVetoProcessLevel()
Process level vetos.
Definition: JetMatching.h:136
virtual bool canVetoProcessLevel()
Process level vetos.
Definition: CombineMatchingInput.h:93
bool setUserHooksPtr(UserHooksPtr userHooksPtrIn)
Possibility to pass in pointer for user hooks.
Definition: Pythia.h:147
virtual bool canVetoPartonLevelEarly()
Parton level vetos (before beam remnants and resonance decays).
Definition: CombineMatchingInput.h:101
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
virtual bool initAfterBeams()
Initialisation.
Definition: CombineMatchingInput.h:42
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:71
bool doVetoProcessLevel(Event &process)
Process level vetos.
Definition: JetMatching.h:1196
void setHook(Pythia &pythia)
Return a hook relevant for combination of input and matching.
Definition: CombineMatchingInput.h:121
bool canVetoProcessLevel()
Process level vetos.
Definition: JetMatching.h:286
bool initAfterBeams()
Initialisation.
Definition: JetMatching.h:1045