PYTHIA  8.312
Merging.h
1 // Merging.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 is written by Stefan Prestel.
7 // Merging: Wrapper class to interface matrix element merging schemes with
8 // Pythia
9 
10 #ifndef Pythia8_Merging_H
11 #define Pythia8_Merging_H
12 
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/BeamParticle.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/History.h"
17 #include "Pythia8/Info.h"
18 #include "Pythia8/MergingHooks.h"
19 #include "Pythia8/ParticleData.h"
20 #include "Pythia8/PartonLevel.h"
21 #include "Pythia8/PhysicsBase.h"
22 #include "Pythia8/PythiaStdlib.h"
23 #include "Pythia8/Settings.h"
24 #include "Pythia8/StandardModel.h"
25 
26 namespace Pythia8 {
27 
28 //==========================================================================
29 
30 // Merging is a wrapper class for the interface of matrix element merging and
31 // Pythia8.
32 
33 class Merging : public PhysicsBase {
34 
35 public:
36 
37  // Constructor.
38  Merging() : PhysicsBase(), lhaPtr(nullptr), trialPartonLevelPtr(),
40 
41  // Destructor.
42  virtual ~Merging(){}
43 
44  // Initialisation function for internal use inside Pythia source code
45  void initPtrs( MergingHooksPtr mergingHooksPtrIn,
46  PartonLevel* trialPartonLevelPtrIn) {
47  trialPartonLevelPtr = trialPartonLevelPtrIn;
48  mergingHooksPtr = mergingHooksPtrIn;
49  }
50 
51  // Initialisation function for internal use inside Pythia source code
52  virtual void init();
53 
54  // Function to print statistics.
55  virtual void statistics();
56 
57  // Function to steer different merging prescriptions.
58  virtual int mergeProcess( Event& process);
59 
60  // Runtime interface functions for communication with aMCatNLO
61  // Function to retrieve shower scale information (to be used to set
62  // scales in aMCatNLO-LHEF-production.
63  virtual void getStoppingInfo(double scales[100][100],
64  double masses[100][100]);
65 
66  // Function to retrieve if any of the shower scales would not have been
67  // possible to produce by Pythia.
68  virtual void getDeadzones(bool dzone[100][100]);
69 
70  // Function to generate Sudakov factors for MCatNLO-Delta.
71  virtual double generateSingleSudakov (double pTbegAll, double pTendAll,
72  double m2dip, int idA, int type, double s = -1., double x = -1.);
73 
74  LHEF3FromPythia8Ptr lhaPtr;
75  void setLHAPtr(LHEF3FromPythia8Ptr lhaUpIn) { lhaPtr = lhaUpIn; }
76 
77 protected:
78 
79  // Make Pythia class friend
80  friend class Pythia;
81 
82  // Pointer to trial PartonLevel object
84 
85  // Pointer to trial MergingHooks object
86  MergingHooksPtr mergingHooksPtr;
87 
88  // Minimal value found for the merging scale in events.
89  double tmsNowMin;
90  static const double TMSMISMATCH;
91 
92  // Minimum allowed weight value to prevent division by zero.
93  static const double MINWGT;
94 
95  // Function to perform CKKW-L merging on the event.
96  int mergeProcessCKKWL( Event& process);
97 
98  // Function to perform UMEPS merging on the event.
99  int mergeProcessUMEPS( Event& process);
100 
101  // Function to perform NL3 NLO merging on the event.
102  int mergeProcessNL3( Event& process);
103 
104  // Function to perform UNLOPS merging on the event.
105  int mergeProcessUNLOPS( Event& process);
106 
107  // Function to apply the merging scale cut on an input event.
108  bool cutOnProcess( Event& process);
109 
110  // Clear all information stored in the runtime interface to aMCatNLO.
111  void clearInfos() {
112  stoppingScalesSave.clear();
113  mDipSave.clear();
114  radSave.clear();
115  emtSave.clear();
116  recSave.clear();
117  isInDeadzone.clear();
118  }
119 
120  // Store all information required for the runtime interface to aMCatNLO.
121  int clusterAndStore(Event& process);
122 
123  // Helper function to be able to extract all shower scales by checking
124  // all dipoles. Relevant only to runtime aMC@NLO interface.
125  void getDipoles( int iRad, int colTag, int colSign,
126  const Event& event, vector<pair<int,int> >& dipEnds);
127 
128  // Saved information about shower stopping scales, dipole masses,
129  // dipole ends, and whether or not a clustering is in the shower
130  // deadzone. Relevant only to runtime aMC@NLO interface.
131  vector<double> stoppingScalesSave, mDipSave;
132  vector<int> radSave, emtSave, recSave;
133  vector<bool> isInDeadzone;
134 
135 };
136 
137 //==========================================================================
138 
139 } // end namespace Pythia8
140 
141 #endif // Pythia8_Merging_H
Merging()
Constructor.
Definition: Merging.h:38
static const double MINWGT
Minimum allowed weight value to prevent division by zero.
Definition: Merging.h:93
virtual void statistics()
Function to print statistics.
Definition: Merging.cc:36
Definition: PhysicsBase.h:27
The Event class holds all info on the generated event.
Definition: Event.h:453
virtual void init()
Initialisation function for internal use inside Pythia source code.
Definition: Merging.cc:30
void clearInfos()
Clear all information stored in the runtime interface to aMCatNLO.
Definition: Merging.h:111
void initPtrs(MergingHooksPtr mergingHooksPtrIn, PartonLevel *trialPartonLevelPtrIn)
Initialisation function for internal use inside Pythia source code.
Definition: Merging.h:45
int mergeProcessNL3(Event &process)
Function to perform NL3 NLO merging on the event.
Definition: Merging.cc:812
bool cutOnProcess(Event &process)
Function to apply the merging scale cut on an input event.
Definition: Merging.cc:1465
Definition: Merging.h:33
vector< double > stoppingScalesSave
Definition: Merging.h:131
PartonLevel * trialPartonLevelPtr
Pointer to trial PartonLevel object.
Definition: Merging.h:83
void getDipoles(int iRad, int colTag, int colSign, const Event &event, vector< pair< int, int > > &dipEnds)
Definition: Merging.cc:320
Definition: PartonLevel.h:45
int mergeProcessUNLOPS(Event &process)
Function to perform UNLOPS merging on the event.
Definition: Merging.cc:1036
int mergeProcessUMEPS(Event &process)
Function to perform UMEPS merging on the event.
Definition: Merging.cc:620
int clusterAndStore(Event &process)
Store all information required for the runtime interface to aMCatNLO.
Definition: Merging.cc:147
virtual void getDeadzones(bool dzone[100][100])
Definition: Merging.cc:399
double tmsNowMin
Minimal value found for the merging scale in events.
Definition: Merging.h:89
virtual ~Merging()
Destructor.
Definition: Merging.h:42
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:71
MergingHooksPtr mergingHooksPtr
Pointer to trial MergingHooks object.
Definition: Merging.h:86
virtual void getStoppingInfo(double scales[100][100], double masses[100][100])
Definition: Merging.cc:379
virtual double generateSingleSudakov(double pTbegAll, double pTendAll, double m2dip, int idA, int type, double s=-1., double x=-1.)
Function to generate Sudakov factors for MCatNLO-Delta.
Definition: Merging.cc:414
int mergeProcessCKKWL(Event &process)
Function to perform CKKW-L merging on the event.
Definition: Merging.cc:444
virtual int mergeProcess(Event &process)
Function to steer different merging prescriptions.
Definition: Merging.cc:69
static const double TMSMISMATCH
The Merging class.
Definition: Merging.h:90