PYTHIA  8.313
MergingHooks.h
1 // MergingHooks.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2025 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 // Header file to allow user access to program at different stages.
8 // HardProcess: Container class for the hard process to be merged. Holds the
9 // bookkeeping of particles not be be reclustered
10 // MergingHooks: Steering class for matrix element merging. Some functions can
11 // be redefined in a derived class to have access to the merging
12 
13 #ifndef Pythia8_MergingHooks_H
14 #define Pythia8_MergingHooks_H
15 
16 #include "Pythia8/Basics.h"
17 #include "Pythia8/BeamParticle.h"
18 #include "Pythia8/Event.h"
19 #include "Pythia8/Info.h"
20 #include "Pythia8/ParticleData.h"
21 #include "Pythia8/PartonSystems.h"
22 #include "Pythia8/PhysicsBase.h"
23 #include "Pythia8/PythiaStdlib.h"
24 #include "Pythia8/Settings.h"
25 
26 
27 namespace Pythia8 {
28 
29 class PartonLevel;
30 
31 //==========================================================================
32 
33 // Declaration of hard process class
34 // This class holds information on the desired hard 2->2 process
35 // for the merging.
36 // This class is a container class for History class use.
37 
38 class HardProcess {
39 
40 public:
41 
42  // Flavour of the first incoming particle
44  // Flavour of the second incoming particle
46  // Flavours of the outgoing particles
47  vector<int> hardOutgoing1;
48  vector<int> hardOutgoing2;
49  // Flavour of intermediate bosons in the hard 2->2
50  vector<int> hardIntermediate;
51 
52  // Current reference event
54  // Potential positions of outgoing particles in reference event
55  vector<int> PosOutgoing1;
56  vector<int> PosOutgoing2;
57  // Potential positions of intermediate bosons in reference event
58  vector<int> PosIntermediate;
59 
60  // Information on merging scale read from LHE file
61  double tms;
62 
63  // Default constructor
64  HardProcess() : hardIncoming1(), hardIncoming2(), tms(){}
65  // Default destructor
66  virtual ~HardProcess(){}
67 
68  // Copy constructor
69  HardProcess( const HardProcess& hardProcessIn )
70  : state(hardProcessIn.state),
71  tms(hardProcessIn.tms) {
72  hardIncoming1 = hardProcessIn.hardIncoming1;
73  hardIncoming2 = hardProcessIn.hardIncoming2;
74  for(int i =0; i < int(hardProcessIn.hardOutgoing1.size());++i)
75  hardOutgoing1.push_back( hardProcessIn.hardOutgoing1[i]);
76  for(int i =0; i < int(hardProcessIn.hardOutgoing2.size());++i)
77  hardOutgoing2.push_back( hardProcessIn.hardOutgoing2[i]);
78  for(int i =0; i < int(hardProcessIn.hardIntermediate.size());++i)
79  hardIntermediate.push_back( hardProcessIn.hardIntermediate[i]);
80  for(int i =0; i < int(hardProcessIn.PosOutgoing1.size());++i)
81  PosOutgoing1.push_back( hardProcessIn.PosOutgoing1[i]);
82  for(int i =0; i < int(hardProcessIn.PosOutgoing2.size());++i)
83  PosOutgoing2.push_back( hardProcessIn.PosOutgoing2[i]);
84  for(int i =0; i < int(hardProcessIn.PosIntermediate.size());++i)
85  PosIntermediate.push_back( hardProcessIn.PosIntermediate[i]);
86  }
87 
88  // Constructor with path to LHE file
89  HardProcess( string LHEfile, ParticleData* particleData) : hardIncoming1(),
90  hardIncoming2(), tms() {
91  state = Event();
92  state.init("(hard process)", particleData);
93  translateLHEFString(LHEfile);
94  }
95 
96  // Constructor with core process input
97  virtual void initOnProcess( string process, ParticleData* particleData);
98 
99  // Constructor with path to LHE file input
100  void initOnLHEF( string LHEfile, ParticleData* particleData);
101 
102  // Function to access the LHE file and read relevant information
103  void translateLHEFString( string LHEpath);
104 
105  // Function to translate the process string (in MG/ME notation)
106  virtual void translateProcessString( string process);
107 
108  // Function to clear hard process information
109  void clear();
110 
111  // Function to check whether the sets of candidates Pos1, Pos2, together
112  // with the proposed candidate iPos give an allowed hard process state
113  virtual bool allowCandidates(int iPos, vector<int> Pos1, vector<int> Pos2,
114  const Event& event);
115  // Function to identify the hard subprocess in the current event
116  virtual void storeCandidates( const Event& event, string process);
117  // Function to check if the particle event[iPos] matches any of
118  // the stored outgoing particles of the hard subprocess
119  virtual bool matchesAnyOutgoing(int iPos, const Event& event);
120  // Function to check if instead of the particle event[iCandidate], another
121  // particle could serve as part of the hard process. Assumes that iCandidate
122  // is already stored as part of the hard process.
123  virtual bool findOtherCandidates(int iPos, const Event& event,
124  bool doReplace);
125  // Function to exchange a stored hard process candidate with another choice.
126  virtual bool exchangeCandidates( vector<int> candidates1,
127  vector<int> candidates2,
128  unordered_map<int,int> further1, unordered_map<int,int> further2);
129 
130  // Function to get the number of coloured final state partons in the
131  // hard process
132  int nQuarksOut();
133  // Function to get the number of uncoloured final state particles in the
134  // hard process
135  int nLeptonOut();
136  // Function to get the number of electroweak final state bosons in the
137  // hard process
138  int nBosonsOut();
139 
140  // Function to get the number of coloured initial state partons in the
141  // hard process
142  int nQuarksIn();
143  // Function to get the number of uncoloured initial state particles in the
144  // hard process
145  int nLeptonIn();
146  // Function to report if a resonace decay was found in the 2->2 sub-process
147  // of the current state
148  int hasResInCurrent();
149  // Function to report the number of resonace decays in the 2->2 sub-process
150  // of the current state
151  int nResInCurrent();
152  // Function to report if a resonace decay was found in the 2->2 hard process
153  bool hasResInProc();
154  // Function to print the hard process (for debug)
155  void list() const;
156  // Function to print the hard process candidates in the
157  // Matrix element state (for debug)
158  void listCandidates() const;
159 
160 };
161 
162 //==========================================================================
163 
164 // MergingHooks is base class for user input to the merging procedure.
165 
166 class MergingHooks : public PhysicsBase {
167 
168 public:
169 
170  // Constructor.
171  MergingHooks() : useShowerPluginSave(), showers(),
172  doUserMergingSave(false),
173  doMGMergingSave(false),
174  doKTMergingSave(false),
175  doPTLundMergingSave(false),
176  doCutBasedMergingSave(false),
177  doDynamicMergingSave(false), includeMassiveSave(),
178  enforceStrongOrderingSave(),
179  orderInRapiditySave(), pickByFullPSave(), pickByPoPT2Save(),
180  includeRedundantSave(), pickBySumPTSave(), allowColourShufflingSave(),
181  resetHardQRenSave(), resetHardQFacSave(), unorderedScalePrescipSave(),
182  unorderedASscalePrescipSave(), unorderedPDFscalePrescipSave(),
183  incompleteScalePrescipSave(), ktTypeSave(), nReclusterSave(),
184  nQuarksMergeSave(), nRequestedSave(), scaleSeparationFactorSave(),
185  nonJoinedNormSave(), fsrInRecNormSave(), herwigAcollFSRSave(),
186  herwigAcollISRSave(), pT0ISRSave(), pTcutSave(),
187  doNL3TreeSave(false),
188  doNL3LoopSave(false),
189  doNL3SubtSave(false),
190  doUNLOPSTreeSave(false),
191  doUNLOPSLoopSave(false),
192  doUNLOPSSubtSave(false),
193  doUNLOPSSubtNLOSave(false),
194  doUMEPSTreeSave(false),
195  doUMEPSSubtSave(false),
196  doEstimateXSection(false),
197  doRuntimeAMCATNLOInterfaceSave(false),
198  applyVeto(),
199  doRemoveDecayProducts(false), muMISave(), kFactor0jSave(), kFactor1jSave(),
200  kFactor2jSave(), tmsValueSave(), tmsValueNow(),
201  DparameterSave(), SparameterSave(),
202  nJetMaxSave(), nJetMaxNLOSave(),
203  doOrderHistoriesSave(true),
204  doCutOnRecStateSave(false),
205  doWeakClusteringSave(false),
206  doSQCDClusteringSave(false), muFSave(), muRSave(), muFinMESave(),
207  muRinMESave(),
208  doIgnoreEmissionsSave(true),
209  doIgnoreStepSave(true), pTsave(), weightCKKWL1Save(), weightCKKWL2Save(),
210  nMinMPISave(), weightCKKWLSave(), weightFIRSTSave(),
211  doVariations(false), nWgts(0), nJetMaxLocal(), nJetMaxNLOLocal(),
212  hasJetMaxLocal(false),
213  includeWGTinXSECSave(false), nHardNowSave(), nJetNowSave(),
214  tmsHardNowSave(), tmsNowSave() {
215  inputEvent = Event(); resonances.resize(0);
216  useOwnHardProcess = false; hardProcess = 0; stopScaleSave= 0.0;
217  nVetoedInMainShower = 0;}
218 
219  // Make History class friend to allow access to advanced switches
220  friend class History;
221  // Make Pythia class friend
222  friend class Pythia;
223  // Make PartonLevel class friend
224  friend class PartonLevel;
225  // Make SpaceShower class friend
226  friend class SpaceShower;
227  // Make TimeShower class friend
228  friend class TimeShower;
229  // Make Merging class friend
230  friend class Merging;
231 
232  // Destructor.
233  virtual ~MergingHooks();
234  // Function encoding the functional definition of the merging scale
235  virtual double tmsDefinition( const Event& event){ return event[0].e();}
236  // Function to dampen weights calculated from histories with lowest
237  // multiplicity reclustered events that do not pass the ME cuts
238  virtual double dampenIfFailCuts( const Event& inEvent ) {
239  // Dummy statement to avoid compiler warnings
240  if(false) cout << inEvent[0].e();
241  return 1.;
242  }
243  // Hooks to disallow states in the construction of all histories, e.g.
244  // because jets are below the merging scale or fail the matrix element cuts
245  // Function to allow interference in the construction of histories
246  virtual bool canCutOnRecState() { return doCutOnRecStateSave; }
247  // Function to check reclustered state while generating all possible
248  // histories
249  // Function implementing check of reclustered events while constructing
250  // all possible histories
251  virtual bool doCutOnRecState( const Event& event ) {
252  // Dummy statement to avoid compiler warnings.
253  if(false) cout << event[0].e();
254  // Count number of final state partons.
255  int nPartons = 0;
256  for( int i=0; i < int(event.size()); ++i)
257  if( event[i].isFinal()
258  && (event[i].isGluon() || event[i].isQuark()) )
259  nPartons++;
260  // For gg -> h, allow only histories with gluons in initial state
261  if( hasEffectiveG2EW() && nPartons < 2){
262  if(event[3].id() != 21 && event[4].id() != 21)
263  return true;
264  }
265  return false;
266  }
267  // Function to allow not counting a trial emission.
268  virtual bool canVetoTrialEmission() { return false;}
269  // Function to check if trial emission should be rejected.
270  virtual bool doVetoTrialEmission( const Event&, const Event& ) {
271  return false; }
272 
273  // Function to calculate the hard process matrix element.
274  virtual double hardProcessME( const Event& inEvent ) {
275  // Dummy statement to avoid compiler warnings.
276  if ( false ) cout << inEvent[0].e();
277  return 1.; }
278 
279  // Functions for internal use inside Pythia source code
280  // Initialize.
281  virtual void init();
282 
283  // Function returning the value of the merging scale.
284  double tms() {
285  if(doCutBasedMergingSave) return 0.;
286  //else return tmsValueSave;
287  else return tmsValueNow;
288  }
289  double tmsCut() {
290  if (doCutBasedMergingSave) return 0.;
291  if (doDynamicMergingSave) {
292  // Fetch fixed merging cut and factorisation scale.
293  const double QbarCut = tmsValueSave;
294  const double Q2 = infoPtr->Q2DIS();
295  // Calculate dynamic merging scale, cf. eq. (2) in arXiv:0912.3715.
296  return QbarCut/sqrt(1. + pow2(QbarCut/SparameterSave)/Q2);
297  }
298  return tmsValueSave;
299  }
300  void tms( double tmsIn ) { tmsValueNow = tmsIn; }
301 
302  // Function returning the value of the Delta R_{ij} cut for
303  // cut based merging scale definition.
304  double dRijMS() {
305  return ((tmsListSave.size() == 3) ? tmsListSave[0] : 0.);
306  }
307  // Function returning the value of the pT_{i} cut for
308  // cut based merging scale definition.
309  double pTiMS() {
310  return ((tmsListSave.size() == 3) ? tmsListSave[1] : 0.);
311  }
312  // Function returning the value of the pT_{i} cut for
313  // cut based merging scale definition.
314  double QijMS() {
315  return ((tmsListSave.size() == 3) ? tmsListSave[2] : 0.);
316  }
317  // Function returning the value of the maximal number of merged jets.
318  int nMaxJets() { return (hasJetMaxLocal) ? nJetMaxLocal : nJetMaxSave;}
319  // Function returning the value of the maximal number of merged jets,
320  // for which NLO corrections are available.
322  { return (hasJetMaxLocal) ? nJetMaxNLOLocal : nJetMaxNLOSave;}
323  // Function to return hard process string.
324  string getProcessString() { return processNow;}
325  // Function to return the number of outgoing partons in the core process
326  int nHardOutPartons(){ return hardProcess->nQuarksOut();}
327  // Function to return the number of outgoing leptons in the core process
328  int nHardOutLeptons(){ return hardProcess->nLeptonOut();}
329  // Function to return the number of outgoing electroweak bosons in the core
330  // process.
331  int nHardOutBosons(){ return hardProcess->nBosonsOut();}
332  // Function to return the number of incoming partons (hadrons) in the core
333  // process.
334  int nHardInPartons(){ return hardProcess->nQuarksIn();}
335  // Function to return the number of incoming leptons in the core process.
336  int nHardInLeptons(){ return hardProcess->nLeptonIn();}
337  // Function to report the number of resonace decays in the 2->2 sub-process
338  // of the current state.
339  int nResInCurrent(){ return hardProcess->nResInCurrent();}
340  // Function to determine if user defined merging should be applied.
341  bool doUserMerging(){ return doUserMergingSave;}
342  // Function to determine if automated MG/ME merging should be applied.
343  bool doMGMerging() { return doMGMergingSave;}
344  // Function to determine if KT merging should be applied.
345  bool doKTMerging() { return doKTMergingSave;}
346  // Function to determine if PTLund merging should be applied.
347  bool doPTLundMerging() { return doPTLundMergingSave;}
348  // Function to determine if cut based merging should be applied.
349  bool doCutBasedMerging() { return doCutBasedMergingSave;}
350  // Function to determine if merging with dynamic scale should be applied.
351  bool doDynamicMerging() { return doDynamicMergingSave;}
352  bool doCKKWLMerging() { return (doUserMergingSave || doMGMergingSave
353  || doKTMergingSave || doPTLundMergingSave || doCutBasedMergingSave
354  || doDynamicMergingSave); }
355  // Functions to determine if and which part of UMEPS merging
356  // should be applied
357  bool doUMEPSTree() { return doUMEPSTreeSave;}
358  bool doUMEPSSubt() { return doUMEPSSubtSave;}
359  bool doUMEPSMerging() { return (doUMEPSTreeSave || doUMEPSSubtSave);}
360  // Functions to determine if and which part of NL3 merging
361  // should be applied
362  bool doNL3Tree() { return doNL3TreeSave;}
363  bool doNL3Loop() { return doNL3LoopSave;}
364  bool doNL3Subt() { return doNL3SubtSave;}
365  bool doNL3Merging() { return (doNL3TreeSave || doNL3LoopSave
366  || doNL3SubtSave); }
367  // Functions to determine if and which part of UNLOPS merging
368  // should be applied
369  bool doUNLOPSTree() { return doUNLOPSTreeSave;}
370  bool doUNLOPSLoop() { return doUNLOPSLoopSave;}
371  bool doUNLOPSSubt() { return doUNLOPSSubtSave;}
372  bool doUNLOPSSubtNLO() { return doUNLOPSSubtNLOSave;}
373  bool doUNLOPSMerging() { return (doUNLOPSTreeSave || doUNLOPSLoopSave
374  || doUNLOPSSubtSave || doUNLOPSSubtNLOSave); }
375 
376  // Function to determine if we have a runtime interface to aMC@NLO.
377  bool doRuntimeAMCATNLOInterface() { return doRuntimeAMCATNLOInterfaceSave;}
378 
379  // Return the number clustering steps that have actually been done.
380  int nRecluster() { return nReclusterSave;}
381 
382  // Return number of requested additional jets on top of the Born process.
383  int nRequested() { return nRequestedSave;}
384 
385  //----------------------------------------------------------------------//
386  // Output functions to analyse/prepare event for merging
387  //----------------------------------------------------------------------//
388 
389  // Function to check if event contains an emission not present in the hard
390  // process.
391  bool isFirstEmission(const Event& event);
392 
393  // Function to allow effective gg -> EW boson couplings.
395  if ( getProcessString().compare("pp>h") == 0 ) return true;
396  return false; }
397 
398  // Function to allow effective gg -> EW boson couplings.
399  bool allowEffectiveVertex( vector<int> in, vector<int> out) {
400  if ( getProcessString().compare("ta+ta->jj") == 0
401  || getProcessString().compare("ta-ta+>jj") == 0 ) {
402  int nInFermions(0), nOutFermions(0);
403  for (int i=0; i < int(in.size()); ++i)
404  if (abs(in[i])<20) nInFermions++;
405  for (int i=0; i < int(out.size()); ++i)
406  if (abs(out[i])<20) nOutFermions++;
407  return (nInFermions%2==0 && nOutFermions%2==0);
408  }
409  return false;
410  }
411 
412  // Return event stripped from decay products.
413  Event bareEvent( const Event& inputEventIn, bool storeInputEvent );
414  // Write event with decay products attached to argument.
415  bool reattachResonanceDecays( Event& process );
416 
417  // Check if particle at position iPos is part of the hard sub-system
418  bool isInHard( int iPos, const Event& event);
419 
420  // Function to return the number of clustering steps for the current event
421  virtual int getNumberOfClusteringSteps(const Event& event,
422  bool resetNjetMax = false);
423 
424  //----------------------------------------------------------------------//
425  // Functions to steer construction of histories
426  //----------------------------------------------------------------------//
427 
428  // Function to force preferred picking of ordered histories. By default,
429  // unordered histories will only be considered if no ordered histories
430  // were found.
431  void orderHistories( bool doOrderHistoriesIn) {
432  doOrderHistoriesSave = doOrderHistoriesIn; }
433  // Function to force cut on reconstructed states internally, as needed
434  // for gg -> Higgs to ensure that e.g. uu~ -> Higgs is not constructed.
435  void allowCutOnRecState( bool doCutOnRecStateIn) {
436  doCutOnRecStateSave = doCutOnRecStateIn; }
437 
438  // Function to allow final state clusterings of weak bosons
439  void doWeakClustering( bool doWeakClusteringIn ) {
440  doWeakClusteringSave = doWeakClusteringIn; }
441 
442  //----------------------------------------------------------------------//
443  // Functions used as default merging scales
444  //----------------------------------------------------------------------//
445 
446  // Function to check if the input particle is a light jet, i.e. should be
447  // checked against the merging scale defintion.
448  bool checkAgainstCut( const Particle& particle);
449  // Function to return the value of the merging scale function in the
450  // current event.
451  virtual double tmsNow( const Event& event );
452  // Find the minimal Lund pT between coloured partons in the event
453  double rhoms( const Event& event, bool withColour);
454  // Function to calculate the minimal kT in the event
455  double kTms(const Event & event);
456  // Find the if the event passes the Delta R_{ij}, pT_{i} and Q_{ij} cuts on
457  // the matrix element, as needed for cut-based merging scale definition
458  double cutbasedms( const Event& event );
459 
460  //----------------------------------------------------------------------//
461  // Functions to steer shower evolution (public to allow for PS plugin)
462  //----------------------------------------------------------------------//
463 
464  // Flag to indicate trial shower usage.
465  void doIgnoreEmissions( bool doIgnoreIn ) {
466  doIgnoreEmissionsSave = doIgnoreIn;}
467  // Function to allow not counting a trial emission.
468  virtual bool canVetoEmission() { return !doIgnoreEmissionsSave; }
469  // Function to check if emission should be rejected.
470  virtual bool doVetoEmission( const Event& );
471 
472  //----------------------------------------------------------------------//
473  // Functions used as clusterings / probabilities
474  //----------------------------------------------------------------------//
475 
477  virtual bool useShowerPlugin() { return useShowerPluginSave; }
478  virtual bool usesVincia() {return false;}
479 
480  //----------------------------------------------------------------------//
481  // Functions to retrieve if merging weight should countin the internal
482  // cross section and the event weight.
483  //----------------------------------------------------------------------//
484 
485  bool includeWGTinXSEC() { return includeWGTinXSECSave;}
486 
487  //----------------------------------------------------------------------//
488  // Functions to retrieve event veto information
489  //----------------------------------------------------------------------//
490 
491  int nHardNow() { return nHardNowSave; }
492  double tmsHardNow() { return tmsHardNowSave; }
493  int nJetsNow() { return nJetNowSave; }
494  double tmsNow() { return tmsNowSave;}
495 
496  void setHardProcessPtr(HardProcess* hardProcIn) { hardProcess = hardProcIn; }
497 
498  //----------------------------------------------------------------------//
499  // Functions related to renormalization scale variations
500  //----------------------------------------------------------------------//
501 
502  int nMuRVar() { return muRVarFactors.size(); }
503  void printIndividualWeights();
504 
505  //----------------------------------------------------------------------//
506  // The members, switches etc.
507  //----------------------------------------------------------------------//
508 
509  // Helper class doing all the core process book-keeping
511  HardProcess* hardProcess;
512 
513  PartonLevel* showers;
514  void setShowerPointer(PartonLevel* psIn ) {showers = psIn;}
515 
516  // AlphaS objects for alphaS reweighting use
518  AlphaStrong AlphaS_ISRSave;
519  AlphaEM AlphaEM_FSRSave;
520  AlphaEM AlphaEM_ISRSave;
521 
522  // Saved path to LHE file for more automated merging
523  string lheInputFile;
524 
525  // Flags for merging procedure definition.
526  bool doUserMergingSave, doMGMergingSave, doKTMergingSave,
527  doPTLundMergingSave, doCutBasedMergingSave, doDynamicMergingSave,
528  includeMassiveSave, enforceStrongOrderingSave, orderInRapiditySave,
529  pickByFullPSave, pickByPoPT2Save, includeRedundantSave,
530  pickBySumPTSave, allowColourShufflingSave, resetHardQRenSave,
531  resetHardQFacSave;
532  int unorderedScalePrescipSave, unorderedASscalePrescipSave,
533  unorderedPDFscalePrescipSave, incompleteScalePrescipSave,
534  ktTypeSave, nReclusterSave, nQuarksMergeSave, nRequestedSave;
535 
536  double scaleSeparationFactorSave, nonJoinedNormSave,
537  fsrInRecNormSave, herwigAcollFSRSave, herwigAcollISRSave,
538  pT0ISRSave, pTcutSave, pTminISRSave, pTminFSRSave;
539  bool doNL3TreeSave, doNL3LoopSave, doNL3SubtSave;
540  bool doUNLOPSTreeSave, doUNLOPSLoopSave, doUNLOPSSubtSave,
541  doUNLOPSSubtNLOSave;
542  bool doUMEPSTreeSave, doUMEPSSubtSave;
543 
544  // Flag to only do phase space cut, rejecting events below the tms cut.
546 
547  // Flag for runtime aMC@NLO interface. Needed for aMC@NLO-Delta.
549 
550  // Flag for postponing event vetos. If false, events are not vetoed
551  // based on the merging scale in CKKW-L merging, but have to be
552  // vetoed by the user in the main program.
553  bool applyVeto;
554 
555  // Save input event in case decay products need to be detached.
557  vector< pair<int,int> > resonances;
558  bool doRemoveDecayProducts;
559 
560  // Starting scale for attaching MPI.
561  double muMISave;
562 
563  // Precalculated K-factors.
565  double kFactor1jSave;
566  double kFactor2jSave;
567 
568  // Saved members.
569  double tmsValueSave, tmsValueNow, DparameterSave, SparameterSave;
570  int nJetMaxSave;
571  int nJetMaxNLOSave;
572 
573  string processSave, processNow;
574 
575  // List of cut values to used to define a merging scale. Ordering:
576  // 0: DeltaR_{jet_i,jet_j,min}
577  // 1: p_{T,jet_i,min}
578  // 2: Q_{jet_i,jet_j,min}
579  vector<double> tmsListSave;
580 
581  // INTERNAL Hooks to allow construction of all histories,
582  // including un-ordered ones
584 
585  // INTERNAL Hooks to disallow states in the construction of all histories,
586  // e.g. because jets are below the merging scale, of to avoid the
587  // construction of uu~ -> Higgs histories.
589 
590  // INTERNAL Hooks to allow clustering W bosons.
591  bool doWeakClusteringSave, doSQCDClusteringSave;
592 
593  // Store / get first scale in PDF's that Pythia should have used
594  double muFSave;
595  double muRSave;
596 
597  // Store / get factorisation scale used in matrix element calculation.
598  double muFinMESave;
599  double muRinMESave;
600 
601  // Flag to indicate trial shower usage.
603  // Flag to indicate if events should be vetoed.
605  // Stored weights in case veot needs to be revoked
606  double pTsave;
607  vector<double> weightCKKWL1Save, weightCKKWL2Save;
608  int nMinMPISave;
609  // Save CKKW-L weight / O(\alpha_s) weight.
610  vector<double> weightCKKWLSave, weightFIRSTSave;
611 
612  // Struct to save individual weights
614  vector<double> wtSave;
615  vector<double> pdfWeightSave;
616  vector<double> mpiWeightSave;
617  vector<double> asWeightSave;
618  vector<double> aemWeightSave;
619  vector<double> bornAsVarFac;
620  };
621 
622  IndividualWeights individualWeights;
623 
624  // Flag to indicate whether renormalization scale variations are performed
626  // Vector of variation factors applied to renormalization scale
627  vector<double> muRVarFactors;
628  // Number of weights, nominal + variations
629  int nWgts;
630 
631  // Local copies of nJetMax inputs, if recalculation is necessary.
633  int nJetMaxNLOLocal;
634  bool hasJetMaxLocal;
635 
636  // Event veto and hard process information, if veto should not applied be
637  // directly, but is up to the user.
639  int nHardNowSave, nJetNowSave;
640  double tmsHardNowSave, tmsNowSave;
641 
642  //----------------------------------------------------------------------//
643  // Generic setup functions
644  //----------------------------------------------------------------------//
645 
646  // Function storing candidates for the hard process in the current event
647  // Needed in order not to cluster members of the core process
648  void storeHardProcessCandidates(const Event& event){
649  hardProcess->storeCandidates(event,getProcessString());
650  }
651 
652  // Function to set the path to the LHE file, so that more automated merging
653  // can be used.
654  // Remove "_1.lhe" suffix from LHE file name.
655  // This is done so that the HarsProcess class can access both the +0 and +1
656  // LHE files to find both the merging scale and the core process string
657  // Store.
658  void setLHEInputFile( string lheFile) {
659  lheInputFile = lheFile.substr(0,lheFile.size()-6); }
660 
661  //----------------------------------------------------------------------//
662  // Functions for output of class members.
663  //----------------------------------------------------------------------//
664 
665  // Return AlphaStrong objects
666  AlphaStrong* AlphaS_FSR() { return &AlphaS_FSRSave;}
667  AlphaStrong* AlphaS_ISR() { return &AlphaS_ISRSave;}
668  AlphaEM* AlphaEM_FSR() { return &AlphaEM_FSRSave;}
669  AlphaEM* AlphaEM_ISR() { return &AlphaEM_ISRSave;}
670 
671  // Functions to return advanced merging switches
672  // Include masses in definition of evolution pT and splitting kernels
673  bool includeMassive() { return includeMassiveSave;}
674  // Prefer strongly ordered histories
675  bool enforceStrongOrdering() { return enforceStrongOrderingSave;}
676  // Prefer histories ordered in rapidity and evolution pT
677  bool orderInRapidity() { return orderInRapiditySave;}
678  // Pick history probabilistically by full (correct) splitting probabilities
679  bool pickByFull() { return pickByFullPSave;}
680  // Pick history probabilistically, with easier form of probabilities
681  bool pickByPoPT2() { return pickByPoPT2Save;}
682  // Include redundant terms (e.g. PDF ratios) in the splitting probabilities
683  bool includeRedundant(){ return includeRedundantSave;}
684  // Pick by winner-takes-it-all, with minimum sum of scalar evolution pT
685  bool pickBySumPT(){ return pickBySumPTSave;}
686 
687  // Prescription for combined scale of unordered emissions
688  // 0 : use larger scale
689  // 1 : use smaller scale
690  int unorderedScalePrescip() { return unorderedScalePrescipSave;}
691  // Prescription for combined scale used in alpha_s for unordered emissions
692  // 0 : use combined emission scale in alpha_s weight for both (!) splittings
693  // 1 : use original reclustered scales of each emission in alpha_s weight
694  int unorderedASscalePrescip() { return unorderedASscalePrescipSave;}
695  // Prescription for combined scale used in PDF ratios for unordered
696  // emissions
697  // 0 : use combined emission scale in PDFs for both (!) splittings
698  // 1 : use original reclustered scales of each emission in PDF ratiost
699  int unorderedPDFscalePrescip() { return unorderedPDFscalePrescipSave;}
700  // Prescription for starting scale of incomplete histories
701  // 0: use factorization scale
702  // 1: use sHat
703  // 2: use s
704  int incompleteScalePrescip() { return incompleteScalePrescipSave;}
705 
706  // Allow swapping one colour index while reclustering
707  bool allowColourShuffling() { return allowColourShufflingSave;}
708 
709  // Allow use of dynamical renormalisation scale of the core 2-> 2 process.
710  bool resetHardQRen() { return resetHardQRenSave; }
711  // Allow use of dynamical factorisation scale of the core 2-> 2 process.
712  bool resetHardQFac() { return resetHardQFacSave; }
713 
714  // Factor by which two scales should differ to be classified strongly
715  // ordered.
716  double scaleSeparationFactor() { return scaleSeparationFactorSave;}
717  // Absolute normalization of splitting probability for non-joined
718  // evolution.
719  double nonJoinedNorm() { return nonJoinedNormSave;}
720  // Absolute normalization of splitting probability for final state
721  // splittings with initial state recoiler
722  double fsrInRecNorm() { return fsrInRecNormSave;}
723  // Factor multiplying scalar evolution pT for FSR splitting, when picking
724  // history by minimum scalar pT (see Jonathan Tully's thesis)
725  double herwigAcollFSR() { return herwigAcollFSRSave;}
726  // Factor multiplying scalar evolution pT for ISR splitting, when picking
727  // history by minimum scalar pT (see Jonathan Tully's thesis)
728  double herwigAcollISR() { return herwigAcollISRSave;}
729  // ISR regularisation scale
730  double pT0ISR() { return pT0ISRSave;}
731  // Shower cut-off scale
732  double pTcut() { return pTcutSave;}
733 
734  // MI starting scale.
735  void muMI( double mu) { muMISave = mu; }
736  double muMI() { return muMISave;}
737 
738  // Full k-Factor for current event
739  double kFactor(int njet = 0) {
740  return (njet == 0) ? kFactor0jSave
741  :(njet == 1) ? kFactor1jSave
742  : kFactor2jSave;
743  }
744  // O(\alhpa_s)-term of the k-Factor for current event
745  double k1Factor( int njet = 0) {
746  return (kFactor(njet) - 1)/infoPtr->alphaS();
747  }
748 
749  // Function to return if construction of histories is biased towards ordered
750  // histories.
751  bool orderHistories() { return doOrderHistoriesSave;}
752 
753  // INTERNAL Hooks to disallow states in the construction of all histories,
754  // e.g. because jets are below the merging scale, of to avoid the
755  // construction of uu~ -> Higgs histories.
756  bool allowCutOnRecState() { return doCutOnRecStateSave;}
757 
758  // INTERNAL Hooks to allow clustering W bosons.
759  bool doWeakClustering() { return doWeakClusteringSave;}
760  // INTERNAL Hooks to allow clustering clustering of gluons to squarks.
761  bool doSQCDClustering() { return doSQCDClusteringSave;}
762 
763  // Store / get first scale in PDF's that Pythia should have used
764  double muF() { return (muFSave > 0.) ? muFSave : infoPtr->QFac();}
765  double muR() { return (muRSave > 0.) ? muRSave : infoPtr->QRen();}
766  // Store / get factorisation scale used in matrix element calculation.
767  double muFinME() {
768  // Start with checking the event attribute called "muf".
769  string mus = infoPtr->getEventAttribute("muf2",true);
770  double mu = (mus.empty()) ? 0. : atof((char*)mus.c_str());
771  mu = sqrt(mu);
772  // Check the scales tag of the event.
773  if (infoPtr->scales) mu = infoPtr->getScalesAttribute("muf");
774  return (mu > 0.) ? mu : (muFinMESave > 0.) ? muFinMESave
775  : infoPtr->QFac();
776  }
777  double muRinME() {
778  // Start with checking the event attribute called "mur2".
779  string mus = infoPtr->getEventAttribute("mur2",true);
780  double mu = (mus.empty()) ? 0. : atof((char*)mus.c_str());
781  mu = sqrt(mu);
782  // Check the scales tag of the event.
783  if (infoPtr->scales) mu = infoPtr->getScalesAttribute("mur");
784  return (mu > 0.) ? mu : (muRinMESave > 0.) ? muRinMESave
785  : infoPtr->QRen();
786  }
787 
788 
789  //----------------------------------------------------------------------//
790  // Functions to steer merging code
791  //----------------------------------------------------------------------//
792 
793  // Flag to indicate if events should be vetoed.
794  void doIgnoreStep(bool doIgnoreIn) {doIgnoreStepSave = doIgnoreIn;}
795  // Function to allow event veto.
796  virtual bool canVetoStep() {return !doIgnoreStepSave;}
797 
798  // Stored weights in case veto needs to be revoked
799  void storeWeights(vector<double> weight) {
800  weightCKKWL1Save = weightCKKWL2Save = weight;}
801 
802  // Function to check event veto.
803  virtual bool doVetoStep(const Event& process, const Event& event,
804  bool doResonance = false);
805 
806  // Set starting scales
807  virtual bool setShowerStartingScales( bool isTrial, bool doMergeFirstEmm,
808  double& pTscaleIn, const Event& event,
809  double& pTmaxFSRIn, bool& limitPTmaxFSRin,
810  double& pTmaxISRIn, bool& limitPTmaxISRin,
811  double& pTmaxMPIIn, bool& limitPTmaxMPIin );
812 
813  // Set shower stopping scale. Necessary to e.g. avoid accumulation of
814  // incorrect (low-pT) shower weights through trial showering.
816  void setShowerStoppingScale(double scale = 0.) {stopScaleSave = scale;}
817  double getShowerStoppingScale() {return stopScaleSave;}
818 
819  void nMinMPI(int nMinMPIIn) {nMinMPISave = nMinMPIIn; }
820  int nMinMPI() {return nMinMPISave;}
821 
822  //----------------------------------------------------------------------//
823  // Functions for internal merging scale definions
824  //----------------------------------------------------------------------//
825 
826  // Function to calculate the kT separation between two particles
827  double kTdurham(const Particle& RadAfterBranch,
828  const Particle& EmtAfterBranch, int Type, double D );
829  // Function to compute "pythia pT separation" from Particle input
830  double rhoPythia(const Event& event, int rad, int emt, int rec,
831  int ShowerType);
832 
833  // Function to find a colour (anticolour) index in the input event,
834  // used to find colour-connected recoilers
835  int findColour(int col, int iExclude1, int iExclude2,
836  const Event& event, int type, bool isHardIn);
837  // Function to compute Delta R separation from 4-vector input
838  double deltaRij(Vec4 jet1, Vec4 jet2);
839 
840  //----------------------------------------------------------------------//
841  // Functions for weight management
842  //----------------------------------------------------------------------//
843 
844  // Function to get the CKKW-L weight for the current event
845  double getWeightNLO(int i=0) { return (weightCKKWLSave[i]
846  - weightFIRSTSave[i]);}
847  // Return CKKW-L weight.
848  vector<double> getWeightCKKWL() { return weightCKKWLSave; }
849  // Return O(\alpha_s) weight.
850  vector<double> getWeightFIRST() { return weightFIRSTSave; }
851  // Set CKKW-L weight.
852  void setWeightCKKWL( vector<double> weightIn){
853  weightCKKWLSave = weightIn;
854  infoPtr->weightContainerPtr
855  ->weightsMerging.setValueVector(weightIn); }
856  // Set O(\alpha_s) weight.
857  void setWeightFIRST( vector<double> weightIn){
858  weightFIRSTSave = weightIn;
859  infoPtr->weightContainerPtr->weightsMerging
860  .setValueFirstVector(weightIn); }
861  // Function to return Sudakov weight as calculated before, also include MPI
862  // weight. Only call after regular weight functions, since it is calculated
863  // there.
864  vector<double> getSudakovWeight() {
865  vector<double> ret = individualWeights.wtSave;
866  for (int i = 0; i < nWgts; ++i) {
867  ret[i] *= individualWeights.pdfWeightSave[i] *
868  individualWeights.mpiWeightSave[i];
869  }
870  return ret;
871  }
872  // Function to return coupling weight.
873  vector<double> getCouplingWeight() {
874  vector<double> ret = individualWeights.asWeightSave;
875  for (int i = 0; i < nWgts; ++i) {
876  ret[i] *= individualWeights.aemWeightSave[i];
877  }
878  return ret;
879  }
880 
881 //--------------------------------------------------------------------------
882 
883 
884 
885  //----------------------------------------------------------------------//
886  // Functions and members to store the event veto information
887  //----------------------------------------------------------------------//
888 
889  // Set CKKWL veto information.
890  void setEventVetoInfo(int nJetNowIn, double tmsNowIn) {
891  nJetNowSave = nJetNowIn; tmsNowSave = tmsNowIn; }
892 
893  // Set the hard process information.
894  void setHardProcessInfo(int nHardNowIn, double tmsHardNowIn) {
895  nHardNowSave = nHardNowIn; tmsHardNowSave = tmsHardNowIn; }
896 
897  // Statistics.
899  void addVetoInMainShower() {++nVetoedInMainShower;}
900  int getNumberVetoedInMainShower() {return nVetoedInMainShower;}
901 
902 };
903 
904 //==========================================================================
905 
906 } // end namespace Pythia8
907 
908 #endif // Pythia8_MergingHooks_H
vector< int > hardIntermediate
Flavour of intermediate bosons in the hard 2->2.
Definition: MergingHooks.h:50
bool resetHardQRen()
Allow use of dynamical renormalisation scale of the core 2-> 2 process.
Definition: MergingHooks.h:710
bool pickByFull()
Pick history probabilistically by full (correct) splitting probabilities.
Definition: MergingHooks.h:679
bool doKTMerging()
Function to determine if KT merging should be applied.
Definition: MergingHooks.h:345
double pTiMS()
Definition: MergingHooks.h:309
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:182
bool applyVeto
Definition: MergingHooks.h:553
Event state
Current reference event.
Definition: MergingHooks.h:53
Definition: StandardModel.h:23
vector< int > hardOutgoing1
Flavours of the outgoing particles.
Definition: MergingHooks.h:47
vector< double > getWeightFIRST()
Return O() weight.
Definition: MergingHooks.h:850
int unorderedASscalePrescip()
Definition: MergingHooks.h:694
bool orderInRapidity()
Prefer histories ordered in rapidity and evolution pT.
Definition: MergingHooks.h:677
int nHardInLeptons()
Function to return the number of incoming leptons in the core process.
Definition: MergingHooks.h:336
int nHardOutPartons()
Function to return the number of outgoing partons in the core process.
Definition: MergingHooks.h:326
void setLHEInputFile(string lheFile)
Definition: MergingHooks.h:658
bool pickByPoPT2()
Pick history probabilistically, with easier form of probabilities.
Definition: MergingHooks.h:681
Definition: PhysicsBase.h:27
Struct to save individual weights.
Definition: MergingHooks.h:613
virtual bool allowCandidates(int iPos, vector< int > Pos1, vector< int > Pos2, const Event &event)
Definition: MergingHooks.cc:915
int nVetoedInMainShower
Statistics.
Definition: MergingHooks.h:898
vector< double > getWeightCKKWL()
Return CKKW-L weight.
Definition: MergingHooks.h:848
virtual void translateProcessString(string process)
Function to translate the process string (in MG/ME notation)
Definition: MergingHooks.cc:554
virtual bool canVetoStep()
Function to allow event veto.
Definition: MergingHooks.h:796
double muFinME()
Store / get factorisation scale used in matrix element calculation.
Definition: MergingHooks.h:767
The Event class holds all info on the generated event.
Definition: Event.h:408
int hardIncoming2
Flavour of the second incoming particle.
Definition: MergingHooks.h:45
The TimeShower class does timelike showers.
Definition: TimeShower.h:33
MergingHooks()
Constructor.
Definition: MergingHooks.h:171
AlphaStrong AlphaS_FSRSave
AlphaS objects for alphaS reweighting use.
Definition: MergingHooks.h:517
double kFactor0jSave
Precalculated K-factors.
Definition: MergingHooks.h:564
bool useShowerPluginSave
Functions used as clusterings / probabilities.
Definition: MergingHooks.h:476
bool doUserMergingSave
Flags for merging procedure definition.
Definition: MergingHooks.h:526
bool doIgnoreStepSave
Flag to indicate if events should be vetoed.
Definition: MergingHooks.h:604
double nonJoinedNorm()
Definition: MergingHooks.h:719
HardProcess(const HardProcess &hardProcessIn)
Copy constructor.
Definition: MergingHooks.h:69
double stopScaleSave
Definition: MergingHooks.h:815
bool doIgnoreEmissionsSave
Flag to indicate trial shower usage.
Definition: MergingHooks.h:602
bool doWeakClusteringSave
INTERNAL Hooks to allow clustering W bosons.
Definition: MergingHooks.h:591
double muF()
Store / get first scale in PDF&#39;s that Pythia should have used.
Definition: MergingHooks.h:764
void allowCutOnRecState(bool doCutOnRecStateIn)
Definition: MergingHooks.h:435
vector< double > muRVarFactors
Vector of variation factors applied to renormalization scale.
Definition: MergingHooks.h:627
HardProcess()
Default constructor.
Definition: MergingHooks.h:64
virtual bool matchesAnyOutgoing(int iPos, const Event &event)
Definition: MergingHooks.cc:1559
int nJetMaxLocal
Local copies of nJetMax inputs, if recalculation is necessary.
Definition: MergingHooks.h:632
int nWgts
Number of weights, nominal + variations.
Definition: MergingHooks.h:629
int nHardNow()
Functions to retrieve event veto information.
Definition: MergingHooks.h:491
void doIgnoreEmissions(bool doIgnoreIn)
Functions to steer shower evolution (public to allow for PS plugin)
Definition: MergingHooks.h:465
bool doUMEPSTree()
Definition: MergingHooks.h:357
virtual double hardProcessME(const Event &inEvent)
Function to calculate the hard process matrix element.
Definition: MergingHooks.h:274
Event inputEvent
Save input event in case decay products need to be detached.
Definition: MergingHooks.h:556
double muFSave
Store / get first scale in PDF&#39;s that Pythia should have used.
Definition: MergingHooks.h:594
bool hasResInProc()
Function to report if a resonace decay was found in the 2->2 hard process.
Definition: MergingHooks.cc:1948
bool allowEffectiveVertex(vector< int > in, vector< int > out)
Function to allow effective gg -> EW boson couplings.
Definition: MergingHooks.h:399
bool resetHardQFac()
Allow use of dynamical factorisation scale of the core 2-> 2 process.
Definition: MergingHooks.h:712
virtual bool doVetoTrialEmission(const Event &, const Event &)
Function to check if trial emission should be rejected.
Definition: MergingHooks.h:270
int nQuarksIn()
Definition: MergingHooks.cc:1878
void list() const
Function to print the hard process (for debug)
Definition: MergingHooks.cc:1970
void clear()
Function to clear hard process information.
Definition: MergingHooks.cc:2007
AlphaStrong * AlphaS_FSR()
Functions for output of class members.
Definition: MergingHooks.h:666
Definition: StandardModel.h:106
bool doOrderHistoriesSave
Definition: MergingHooks.h:583
int unorderedScalePrescip()
Definition: MergingHooks.h:690
bool pickBySumPT()
Pick by winner-takes-it-all, with minimum sum of scalar evolution pT.
Definition: MergingHooks.h:685
double pTsave
Stored weights in case veot needs to be revoked.
Definition: MergingHooks.h:606
virtual bool canVetoTrialEmission()
Function to allow not counting a trial emission.
Definition: MergingHooks.h:268
bool doUNLOPSTree()
Definition: MergingHooks.h:369
void storeWeights(vector< double > weight)
Stored weights in case veto needs to be revoked.
Definition: MergingHooks.h:799
bool hasEffectiveG2EW()
Function to allow effective gg -> EW boson couplings.
Definition: MergingHooks.h:394
double muFinMESave
Store / get factorisation scale used in matrix element calculation.
Definition: MergingHooks.h:598
double tmsCut()
Definition: MergingHooks.h:289
Definition: Merging.h:33
int nMaxJetsNLO()
Definition: MergingHooks.h:321
vector< double > weightCKKWLSave
Save CKKW-L weight / O() weight.
Definition: MergingHooks.h:610
virtual double dampenIfFailCuts(const Event &inEvent)
Definition: MergingHooks.h:238
double fsrInRecNorm()
Definition: MergingHooks.h:722
double scaleSeparationFactor()
Definition: MergingHooks.h:716
void doWeakClustering(bool doWeakClusteringIn)
Function to allow final state clusterings of weak bosons.
Definition: MergingHooks.h:439
virtual bool canVetoEmission()
Function to allow not counting a trial emission.
Definition: MergingHooks.h:468
bool doCutBasedMerging()
Function to determine if cut based merging should be applied.
Definition: MergingHooks.h:349
string getProcessString()
Function to return hard process string.
Definition: MergingHooks.h:324
bool includeWGTinXSECSave
Definition: MergingHooks.h:638
double kFactor(int njet=0)
Full k-Factor for current event.
Definition: MergingHooks.h:739
int nHardInPartons()
Definition: MergingHooks.h:334
double tms
Information on merging scale read from LHE file.
Definition: MergingHooks.h:61
int incompleteScalePrescip()
Definition: MergingHooks.h:704
bool includeRedundant()
Include redundant terms (e.g. PDF ratios) in the splitting probabilities.
Definition: MergingHooks.h:683
int hasResInCurrent()
Definition: MergingHooks.cc:1902
bool doMGMerging()
Function to determine if automated MG/ME merging should be applied.
Definition: MergingHooks.h:343
Definition: PartonLevel.h:45
bool doDynamicMerging()
Function to determine if merging with dynamic scale should be applied.
Definition: MergingHooks.h:351
int nResInCurrent()
Definition: MergingHooks.cc:1924
vector< int > PosOutgoing1
Potential positions of outgoing particles in reference event.
Definition: MergingHooks.h:55
bool doNL3Tree()
Definition: MergingHooks.h:362
double dRijMS()
Definition: MergingHooks.h:304
int nResInCurrent()
Definition: MergingHooks.h:339
int nBosonsOut()
Definition: MergingHooks.cc:1861
double tmsValueSave
Saved members.
Definition: MergingHooks.h:569
double tms()
Function returning the value of the merging scale.
Definition: MergingHooks.h:284
void listCandidates() const
Definition: MergingHooks.cc:1989
void initOnLHEF(string LHEfile, ParticleData *particleData)
Constructor with path to LHE file input.
Definition: MergingHooks.cc:36
Definition: MergingHooks.h:38
void setWeightFIRST(vector< double > weightIn)
Set O() weight.
Definition: MergingHooks.h:857
int nHardOutLeptons()
Function to return the number of outgoing leptons in the core process.
Definition: MergingHooks.h:328
double muRinME()
Definition: MergingHooks.h:777
void doIgnoreStep(bool doIgnoreIn)
Functions to steer merging code.
Definition: MergingHooks.h:794
void orderHistories(bool doOrderHistoriesIn)
Functions to steer construction of histories.
Definition: MergingHooks.h:431
int size() const
Event record size.
Definition: Event.h:459
Definition: Event.h:32
bool orderHistories()
Definition: MergingHooks.h:751
int nMaxJets()
Function returning the value of the maximal number of merged jets.
Definition: MergingHooks.h:318
bool doPTLundMerging()
Function to determine if PTLund merging should be applied.
Definition: MergingHooks.h:347
bool doSQCDClustering()
INTERNAL Hooks to allow clustering clustering of gluons to squarks.
Definition: MergingHooks.h:761
void setEventVetoInfo(int nJetNowIn, double tmsNowIn)
Functions and members to store the event veto information.
Definition: MergingHooks.h:890
vector< double > getCouplingWeight()
Function to return coupling weight.
Definition: MergingHooks.h:873
double k1Factor(int njet=0)
O()-term of the k-Factor for current event.
Definition: MergingHooks.h:745
bool doUserMerging()
Function to determine if user defined merging should be applied.
Definition: MergingHooks.h:341
string lheInputFile
Saved path to LHE file for more automated merging.
Definition: MergingHooks.h:523
void setHardProcessInfo(int nHardNowIn, double tmsHardNowIn)
Set the hard process information.
Definition: MergingHooks.h:894
bool doCutOnRecStateSave
Definition: MergingHooks.h:588
int nMuRVar()
Functions related to renormalization scale variations.
Definition: MergingHooks.h:502
bool doRuntimeAMCATNLOInterfaceSave
Flag for runtime aMC interface. Needed for aMC-Delta.
Definition: MergingHooks.h:548
bool doVariations
Flag to indicate whether renormalization scale variations are performed.
Definition: MergingHooks.h:625
virtual bool findOtherCandidates(int iPos, const Event &event, bool doReplace)
Definition: MergingHooks.cc:1631
vector< double > tmsListSave
Definition: MergingHooks.h:579
double pT0ISR()
ISR regularisation scale.
Definition: MergingHooks.h:730
bool includeWGTinXSEC()
Definition: MergingHooks.h:485
virtual void storeCandidates(const Event &event, string process)
Function to identify the hard subprocess in the current event.
Definition: MergingHooks.cc:986
void setWeightCKKWL(vector< double > weightIn)
Set CKKW-L weight.
Definition: MergingHooks.h:852
int nRecluster()
Return the number clustering steps that have actually been done.
Definition: MergingHooks.h:380
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
virtual double tmsDefinition(const Event &event)
Function encoding the functional definition of the merging scale.
Definition: MergingHooks.h:235
double pTcut()
Shower cut-off scale.
Definition: MergingHooks.h:732
vector< double > getSudakovWeight()
Definition: MergingHooks.h:864
void storeHardProcessCandidates(const Event &event)
Generic setup functions.
Definition: MergingHooks.h:648
int nQuarksOut()
Definition: MergingHooks.cc:1786
double herwigAcollISR()
Definition: MergingHooks.h:728
double herwigAcollFSR()
Definition: MergingHooks.h:725
void init(string headerIn="", ParticleData *particleDataPtrIn=0, int startColTagIn=100)
Initialize header for event listing, particle data table, and colour.
Definition: Event.h:422
bool allowColourShuffling()
Allow swapping one colour index while reclustering.
Definition: MergingHooks.h:707
double QijMS()
Definition: MergingHooks.h:314
bool doRuntimeAMCATNLOInterface()
Function to determine if we have a runtime interface to aMC.
Definition: MergingHooks.h:377
virtual bool canCutOnRecState()
Definition: MergingHooks.h:246
int nHardOutBosons()
Definition: MergingHooks.h:331
The SpaceShower class does spacelike showers.
Definition: SpaceShower.h:33
int nLeptonIn()
Definition: MergingHooks.cc:1890
bool includeMassive()
Definition: MergingHooks.h:673
vector< int > PosIntermediate
Potential positions of intermediate bosons in reference event.
Definition: MergingHooks.h:58
HardProcess(string LHEfile, ParticleData *particleData)
Constructor with path to LHE file.
Definition: MergingHooks.h:89
bool allowCutOnRecState()
Definition: MergingHooks.h:756
virtual void initOnProcess(string process, ParticleData *particleData)
Constructor with core process input.
Definition: MergingHooks.cc:27
bool enforceStrongOrdering()
Prefer strongly ordered histories.
Definition: MergingHooks.h:675
MergingHooks is base class for user input to the merging procedure.
Definition: MergingHooks.h:166
bool useOwnHardProcess
The members, switches etc.
Definition: MergingHooks.h:510
int nLeptonOut()
Definition: MergingHooks.cc:1814
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
virtual bool exchangeCandidates(vector< int > candidates1, vector< int > candidates2, unordered_map< int, int > further1, unordered_map< int, int > further2)
Function to exchange a stored hard process candidate with another choice.
Definition: MergingHooks.cc:1751
int nRequested()
Return number of requested additional jets on top of the Born process.
Definition: MergingHooks.h:383
virtual bool doCutOnRecState(const Event &event)
Definition: MergingHooks.h:251
Definition: Basics.h:32
int hardIncoming1
Flavour of the first incoming particle.
Definition: MergingHooks.h:43
virtual ~HardProcess()
Default destructor.
Definition: MergingHooks.h:66
int unorderedPDFscalePrescip()
Definition: MergingHooks.h:699
bool doEstimateXSection
Flag to only do phase space cut, rejecting events below the tms cut.
Definition: MergingHooks.h:545
double muMISave
Starting scale for attaching MPI.
Definition: MergingHooks.h:561
Definition: History.h:116
double getWeightNLO(int i=0)
Functions for weight management.
Definition: MergingHooks.h:845
bool doWeakClustering()
INTERNAL Hooks to allow clustering W bosons.
Definition: MergingHooks.h:759
void translateLHEFString(string LHEpath)
Function to access the LHE file and read relevant information.
Definition: MergingHooks.cc:52
void muMI(double mu)
MI starting scale.
Definition: MergingHooks.h:735