herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Merger.h
1
2 //
5 //
8 //
9#ifndef HERWIG_Merger_H
10#define HERWIG_Merger_H
11 //
13 //
14#include "MergingFactory.fh"
15#include "Node.fh"
16
17
18
19#include "ThePEG/Handlers/HandlerBase.h"
20#include "Herwig/Shower/Dipole/DipoleShowerHandler.h"
21 //#include "Herwig/Shower/Dipole/Base/DipoleSplittingGenerator.h"
22#include "Herwig/MatrixElement/Matchbox/Base/MergerBase.h"
23
24#include "Herwig/MatrixElement/Matchbox/Phasespace/FFLightTildeKinematics.h"
25#include "Herwig/MatrixElement/Matchbox/Phasespace/IFLightTildeKinematics.h"
26#include "Herwig/MatrixElement/Matchbox/Phasespace/FFMassiveTildeKinematics.h"
27#include "Herwig/MatrixElement/Matchbox/Phasespace/IFMassiveTildeKinematics.h"
28#include "Herwig/MatrixElement/Matchbox/Phasespace/FILightTildeKinematics.h"
29#include "Herwig/MatrixElement/Matchbox/Phasespace/IILightTildeKinematics.h"
30#include "Herwig/MatrixElement/Matchbox/Phasespace/FIMassiveTildeKinematics.h"
31
32#include "ThePEG/Cuts/JetFinder.h"
33#include "ThePEG/Cuts/Cuts.h"
34
35
36
37namespace Herwig {
38
39 using namespace ThePEG;
40
41
42 class Merger;
43
44 ThePEG_DECLARE_POINTERS(Merger , MergerPtr );
45
46 typedef vector<NodePtr> NodePtrVec;
47 //definition of a history step
48 struct HistoryStep {
50 NodePtr node;
52 double weight;
54 Energy scale;
55 };
56
57 typedef vector< HistoryStep > History;
58
59 typedef multimap<DipoleIndex, Ptr<DipoleSplittingGenerator>::ptr> GeneratorMap2;
60
95 class Merger: public MergerBase {
96
97 friend class MergingFactory;
98 friend class Node;
99
100 public:
101
102 // define the ME region for a particle vector.
105 Energy winnerScale = ZERO,
106 Energy cutscale = ZERO)const;
109 Energy mergingScale()const{return theMergePt;}
111 Energy mergePt()const {return theMergePt;}
113 int M()const;
115 int N()const;
117 int N0()const{return theN0;}
119 CrossSection MergingDSigDR();
122 void setXComb( tStdXCombPtr );
128 bool generateKinematics( const double * );
132 size_t maxLegs() const {return theCurrentMaxLegs;}
134 void setME(MatchboxMEBasePtr me){
135 theCurrentME=me;
136 assert(theFirstNodeMap.count(theCurrentME));
138 }
139
140 protected:
142 void N0(int n){ theN0=n;}
144 Ptr<ColourBasis>::ptr largeNBasis()const{return theLargeNBasis;}
147 const double factor = 1. + (-1. + 2.*UseRandom::rnd() ) * smear();
148 theMergePt = factor * centralMergePt();
149 }
151 int openZBoundaries()const{return DSH()->showerPhaseSpaceOption();}
153 MatchboxMEBasePtr currentME() const { return theCurrentME; }
155 NodePtr currentNode() const { return theCurrentNode; }
156
157 private:
159 double singlesudakov(Dipole, Energy, Energy, pair<bool, bool>);
162 bool dosudakov(NodePtr Born, Energy running, Energy next, double& sudakov0_n);
164 void cleanup(NodePtr);
167 bool isProjectorStage( NodePtr , int )const;
174 Energy CKKW_StartScale(NodePtr) const;
176 void CKKW_PrepareSudakov(NodePtr, Energy);
178 double Nf(Energy scale)const{return DSH()->Nf(scale);}
180 MergingFactoryPtr treefactory() const;
182 map<MatchboxMEBasePtr, NodePtr> firstNodeMap() const ;
184 void mergePt(Energy x) {theMergePt = x;}
186 Energy centralMergePt() const {return theCentralMergePt;}
187
188 private:
211 size_t maxLegsLO() const {return N0()+N();}
213 CrossSection TreedSigDR(Energy startscale);
215 Energy fillProjector(int);
217 void fillHistory(Energy, NodePtr, NodePtr );
219 double pdfratio(NodePtr, Energy, Energy, int, bool fromIsME, bool toIsME);
221 double pdfReweight();
223 double alphaReweight(bool nocmw=false);
225 size_t maxLegsNLO()const {return N0()+M();}
227 CrossSection LoopdSigDR(Energy startscale );
235 double alphasExpansion( Energy next, Energy fixedScale)const;
237 double pdfExpansion(NodePtr, int, Energy, Energy, double, int, Energy)const;
239 bool doHistExpansion(NodePtr Born, Energy running, Energy next, Energy fixedScale, double& HistExpansion);
241 double singleHistExpansion(Dipole, Energy, Energy, Energy, pair<bool, bool>);
242 //alpha_s as given in the shower
243 double as(Energy q)const{return DSH()->as(q);}
244 // set the pointer to the Mergingfactory.
245 void setFactory(MergingFactoryPtr f){theTreeFactory=f;}
246 // set the pointer to the DipoleShower.
247 void setDipoleShower(DipoleShowerHandlerPtr dsh){theDipoleShowerHandler=dsh;}
248 //return the dipole shower handler
249 DipoleShowerHandlerPtr DSH(){return theDipoleShowerHandler;}
250 //return the const dipole shower handler
251 cDipoleShowerHandlerPtr DSH()const{return theDipoleShowerHandler;}
253 void firstNodeMap(MatchboxMEBasePtr, NodePtr);
255 int chooseHistory()const {return theChooseHistory;}
257 double smear()const{return theSmearing;}
259 void largeNBasis(Ptr<ColourBasis>::ptr x){theLargeNBasis=x;}
261 bool notOnlyMulti()const;
263 double cmwAlphaS(Energy q)const;
265 void debugVirt(double, double, double, double, CrossSection,
266 double, double, double, NodePtr,CrossSection) const;
268 void debugReal( string, double, CrossSection, CrossSection) const;
269
270 private:
271
275 unsigned int theCMWScheme = 0;
277 bool projected = true;
279 bool isUnitarized = true;
281 bool isNLOUnitarized = true;
285 int theN0 = 0;
287 int theOnlyN = -1;
291 double theSmearing = 0.;
293 Energy theIRSafePT = 1_GeV;
295 Energy theMergePt = 4_GeV;
297 Energy theCentralMergePt = 4_GeV;
302 History history;
304 Ptr<ColourBasis>::ptr theLargeNBasis;
308 MatchboxMEBasePtr theCurrentME;
310 Ptr<FFLightTildeKinematics>::ptr FFLTK = new_ptr( FFLightTildeKinematics() );
311 Ptr<FILightTildeKinematics>::ptr FILTK = new_ptr( FILightTildeKinematics() );
312 Ptr<IFLightTildeKinematics>::ptr IFLTK = new_ptr( IFLightTildeKinematics() );
313 Ptr<IILightTildeKinematics>::ptr IILTK = new_ptr( IILightTildeKinematics() );
314 Ptr<FFMassiveTildeKinematics>::ptr FFMTK = new_ptr( FFMassiveTildeKinematics() );
315 Ptr<FIMassiveTildeKinematics>::ptr FIMTK = new_ptr( FIMassiveTildeKinematics() );
316 Ptr<IFMassiveTildeKinematics>::ptr IFMTK = new_ptr( IFMassiveTildeKinematics() );
317 //pointer to the shower handler
318 DipoleShowerHandlerPtr theDipoleShowerHandler;
320 MergingFactoryPtr theTreeFactory;
322 map<MatchboxMEBasePtr, NodePtr> theFirstNodeMap;
324 map<NodePtr, CrossSection> theHighMeWeightMap;
325
326 protected:
327
335 virtual void doinit();
336
338
339
340 public:
341
349
355 void persistentInput(PersistentIStream & is, int version);
357
364 static void Init();
365
366 protected:
367
374 virtual IBPtr clone() const;
375
380 virtual IBPtr fullclone() const;
382
383
384 // If needed, insert declarations of virtual function defined in the
385 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
386
387
388 private:
389
390
391
396 Merger & operator=(const Merger &) = delete;
397
398 };
399
400}
401
402
403
404#endif /* HERWIG_Merger_H */
The Dipole class is used by the dipole shower to represent a dipole of two coloured partons.
Definition: Dipole.h:30
FFLightTildeKinematics implements the 'tilde' kinematics for a final-final subtraction dipole.
FFMassiveTildeKinematics implements the 'tilde' kinematics for a final-final subtraction dipole.
FILightTildeKinematics implements the 'tilde' kinematics for a final-initial subtraction dipole.
FIMassiveTildeKinematics implements the 'tilde' kinematics for a final-initial subtraction dipole.
IFLightTildeKinematics implements the 'tilde' kinematics for a initial-final subtraction dipole.
IFMassiveTildeKinematics implements the 'tilde' kinematics for a initial-final subtraction dipole.
MergerBase is the base class MergingHelpers.
Definition: MergerBase.h:38
This class is responsible for the handling of the merging process after the setup stage,...
Definition: Merger.h:95
void clearKinematics()
clear kinematics, called from ME
NodePtr theCurrentNode
current Node
Definition: Merger.h:306
double alphasExpansion(Energy next, Energy fixedScale) const
calculate alpha_s expansion of the single step alpha_s-ratio, including K_g
Ptr< ColourBasis >::ptr largeNBasis() const
return the large-N basis (TODO: implement check if born ME works with the choice)
Definition: Merger.h:144
void smearMergePt()
smear the merging pt
Definition: Merger.h:146
double smear() const
the smearing factor for the merging scale
Definition: Merger.h:257
CrossSection MergingDSigDRRealAllAbove()
calculate the history weighted real contribution all dipoles above: N*(R rnd(i)-Dip_i) history_i U(\p...
unsigned int theShowerExpansionWeights
calculate the history expansion
Definition: Merger.h:273
CrossSection MergingDSigDRBornStandard()
calculate the history weighted born cross section
Energy theMergePt
current merging scale
Definition: Merger.h:295
int chooseHistory() const
history choice: weighted history choice
Definition: Merger.h:255
Ptr< ColourBasis >::ptr theLargeNBasis
pointer to the large-N basis
Definition: Merger.h:304
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
CrossSection MergingDSigDRRealBelowSubInt()
calculate the history weighted real contribution not all dipoles above: rnd(i)-> N*(PS_i - Dip_i) his...
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
double pdfExpansion(NodePtr, int, Energy, Energy, double, int, Energy) const
calculate alpha_s expansion of the single step pdf-ratio
void fillHistory(Energy, NodePtr, NodePtr)
fill the history, including calculation of sudakov supression
double theRealSubtractionRatio
below mergingscale/theRealSubtractionRatio the dipoles are used to subtract.
Definition: Merger.h:300
NodePtr currentNode() const
return the current Node
Definition: Merger.h:155
size_t maxLegsNLO() const
max legssize the shower should veto for NLO
Definition: Merger.h:225
unsigned int theCMWScheme
use CMW scheme
Definition: Merger.h:275
double sumPdfReweightExpansion() const
calculate alpha_s expansion of the pdf-ratios
void flushCaches()
generate kinematics, called from ME
Merger & operator=(const Merger &)=delete
The assignment operator is private and must never be called.
static void Init()
The standard Init function used to initialize the interfaces.
MatchboxMEBasePtr theCurrentME
current ME
Definition: Merger.h:308
bool doHistExpansion(NodePtr Born, Energy running, Energy next, Energy fixedScale, double &HistExpansion)
calculate alpha_s expansion of the single step sudakov exponent
Energy mergingScale() const
return the current merging scale, gets smeared around the central merging scale in generate kinematic...
Definition: Merger.h:109
Energy CKKW_StartScale(NodePtr) const
Calculate the staring scale: if Node is part of the production process, calculate according to the sc...
int N0() const
legsize of the production process
Definition: Merger.h:117
Energy theIRSafePT
cutoff for real emission contribution
Definition: Merger.h:293
bool isProjectorStage(NodePtr, int) const
return true if the cluster node has the matching number of legs to the current projector stage
bool notOnlyMulti() const
helper function to check the only multi condition.
double sumAlphaSReweightExpansion() const
calculate alpha_s expansion of the alpha_s-ratios, including K_g
CrossSection MergingDSigDR()
cross section of as given by the merging
double singlesudakov(Dipole, Energy, Energy, pair< bool, bool >)
calculate a single sudakov step for a given dipole
int M() const
legsize of highest process with NLO corrections
MergingFactoryPtr theTreeFactory
pointer to the MergingFactory
Definition: Merger.h:320
Ptr< FFLightTildeKinematics >::ptr FFLTK
Tilde kinematics pointers, only to use lastPt(emitter, emission, spectator)
Definition: Merger.h:310
int N() const
legsize of the highest LO merged process
void mergePt(Energy x)
set the current merging pt, smeared in generate kinematics
Definition: Merger.h:184
void setXComb(tStdXCombPtr)
***** virtual functions of the base class ****‍/// set the current xcomb, called from ME
void setME(MatchboxMEBasePtr me)
set the current ME
Definition: Merger.h:134
MergingFactoryPtr treefactory() const
pointer to the factory
bool projected
true if current point should be projected
Definition: Merger.h:277
void debugVirt(double, double, double, double, CrossSection, double, double, double, NodePtr, CrossSection) const
debug output for virtual
size_t maxLegsLO() const
max legssize the shower should veto for LO
Definition: Merger.h:211
Energy centralMergePt() const
return the central merging pt
Definition: Merger.h:186
double singleHistExpansion(Dipole, Energy, Energy, Energy, pair< bool, bool >)
calculate alpha_s expansion of the single dipole sudakov exponent
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
int theChooseHistory
history weight choice
Definition: Merger.h:283
int theCurrentMaxLegs
the current maxlegs (either LO or NLO maxlegs)
Definition: Merger.h:289
CrossSection MergingDSigDRRealBelowSubReal()
calculate the history weighted real contribution not all dipoles above: (R - sum PS_i) history_rnd U(...
map< NodePtr, CrossSection > theHighMeWeightMap
map from ME to highest ME weight so far
Definition: Merger.h:324
double Nf(Energy scale) const
number of active flavours as given by the shower
Definition: Merger.h:178
void setKinematics()
set kinematics, called from ME
Energy theCentralMergePt
central merging scale
Definition: Merger.h:297
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void largeNBasis(Ptr< ColourBasis >::ptr x)
return the large-N colour basis
Definition: Merger.h:259
void debugReal(string, double, CrossSection, CrossSection) const
debug output for reals
bool generateKinematics(const double *)
generate kinematics, called from ME
map< MatchboxMEBasePtr, NodePtr > theFirstNodeMap
map from ME to first Node
Definition: Merger.h:322
Energy fillProjector(int)
fill the projecting xcomb
double theSmearing
smearing factor for merging scale
Definition: Merger.h:291
CrossSection MergingDSigDRRealStandard()
calculate the history weighted real contribution splitted into 3 differnt contibutions
void firstNodeMap(MatchboxMEBasePtr, NodePtr)
insert map from ME to first clusternode
void CKKW_PrepareSudakov(NodePtr, Energy)
prepare the sudakov calculation
int theN0
legsize of production process
Definition: Merger.h:285
CrossSection MergingDSigDRVirtualStandard()
calculate the history weighted virtual contribution
virtual IBPtr clone() const
Make a simple clone of this object.
double sumFillHistoryExpansion()
calculate alpha_s expansion of the sudakov exponents
CrossSection TreedSigDR(Energy startscale)
Calculate the LO partonic cross section.
void cleanup(NodePtr)
cleanup
double pdfReweight()
return the pdf-ratio reweight for the history
int openZBoundaries() const
true if the phase space for initial emissions should not be restricted in z.
Definition: Merger.h:151
bool isUnitarized
true if LO cross sections should be unitarised
Definition: Merger.h:279
bool dosudakov(NodePtr Born, Energy running, Energy next, double &sudakov0_n)
calculate the sudakov supression for a clusternode between the current running scale and next scale
double pdfratio(NodePtr, Energy, Energy, int, bool fromIsME, bool toIsME)
calculate the pdf ratio for the given clusternode
void N0(int n)
the merging factory needs to set the legsize of the production process
Definition: Merger.h:142
Energy mergePt() const
return the current merging pt (should be unified with mergingScale)
Definition: Merger.h:111
History history
current cluster histoy including sudakov weights
Definition: Merger.h:302
map< MatchboxMEBasePtr, NodePtr > firstNodeMap() const
map from ME to first clusternode
bool matrixElementRegion(PVector incoming, PVector outgoing, Energy winnerScale=ZERO, Energy cutscale=ZERO) const
define the ME region for a particle vector.
CrossSection LoopdSigDR(Energy startscale)
calculate the virtual contribution.
bool isNLOUnitarized
true if NLO contributions should be unitarised
Definition: Merger.h:281
MatchboxMEBasePtr currentME() const
return the current ME
Definition: Merger.h:153
int theOnlyN
calculate only the N particle contribution
Definition: Merger.h:287
double cmwAlphaS(Energy q) const
Calculate the CMW AlphaS.
double alphaReweight(bool nocmw=false)
return the alpha_s reweight for the history
size_t maxLegs() const
return the current maximum legs, the shower should veto
Definition: Merger.h:132
MergingFactory automatically sets up a NLO QCD merging.
The Node class represents a part of the shower history in the merging procedure.
Definition: Node.h:45
static double rnd()
-*- C++ -*-
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
constexpr ZeroUnit ZERO
vector< PPtr > PVector
double weight
current sudakov weight of the history
Definition: Merger.h:52
Energy scale
current scale of the history
Definition: Merger.h:54
NodePtr node
containing the full information
Definition: Merger.h:50