Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/Shower/Dipole/Kernels/DipoleSplittingKernel.cc b/Shower/Dipole/Kernels/DipoleSplittingKernel.cc
--- a/Shower/Dipole/Kernels/DipoleSplittingKernel.cc
+++ b/Shower/Dipole/Kernels/DipoleSplittingKernel.cc
@@ -1,366 +1,386 @@
// -*- C++ -*-
//
// DipoleSplittingKernel.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the DipoleSplittingKernel class.
//
#include "DipoleSplittingKernel.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig/Shower/ShowerHandler.h"
using namespace Herwig;
DipoleSplittingKernel::DipoleSplittingKernel()
: HandlerBase(), theScreeningScale(0.0*GeV),
thePresamplingPoints(2000), theMaxtry(100000),
theFreezeGrid(500000),
theDetuning(1.0),
theStrictLargeN(false),
theFactorizationScaleFactor(1.0),
theRenormalizationScaleFactor(1.0),
theRenormalizationScaleFreeze(1.*GeV),
theFactorizationScaleFreeze(1.*GeV),
theVirtualitySplittingScale(false),
- theCMWScheme(false),
+ theCMWScheme(0),
presampling(false) {}
DipoleSplittingKernel::~DipoleSplittingKernel() {}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void DipoleSplittingKernel::persistentOutput(PersistentOStream & os) const {
os << theAlphaS << ounit(theScreeningScale,GeV) << theSplittingKinematics << thePDFRatio
<< thePresamplingPoints << theMaxtry << theFreezeGrid << theDetuning
<< theFlavour << theMCCheck << theStrictLargeN
<< theFactorizationScaleFactor
<< theRenormalizationScaleFactor
<< ounit(theRenormalizationScaleFreeze,GeV)
<< ounit(theFactorizationScaleFreeze,GeV)
<< theVirtualitySplittingScale<<theCMWScheme;
}
void DipoleSplittingKernel::persistentInput(PersistentIStream & is, int) {
is >> theAlphaS >> iunit(theScreeningScale,GeV) >> theSplittingKinematics >> thePDFRatio
>> thePresamplingPoints >> theMaxtry >> theFreezeGrid >> theDetuning
>> theFlavour >> theMCCheck >> theStrictLargeN
>> theFactorizationScaleFactor
>> theRenormalizationScaleFactor
>> iunit(theRenormalizationScaleFreeze,GeV)
>> iunit(theFactorizationScaleFreeze,GeV)
>> theVirtualitySplittingScale>>theCMWScheme;
}
double DipoleSplittingKernel::alphaPDF(const DipoleSplittingInfo& split,
Energy optScale,
double rScaleFactor,
double fScaleFactor) const {
Energy pt = optScale == ZERO ? split.lastPt() : optScale;
Energy2 scale = ZERO;
if ( !virtualitySplittingScale() ) {
scale = sqr(pt) + sqr(theScreeningScale);
} else {
scale = sqr(splittingKinematics()->QFromPt(pt,split)) + sqr(theScreeningScale);
}
if(split.calcFixedExpansion()){
scale=sqr(split.fixedScale());
}
Energy2 rScale = sqr(theRenormalizationScaleFactor*rScaleFactor)*scale;
- rScale = rScale > sqr(renormalizationScaleFreeze()) ? rScale : sqr(renormalizationScaleFreeze());
+ rScale = max( rScale , sqr(renormalizationScaleFreeze()) );
Energy2 fScale = sqr(theFactorizationScaleFactor*fScaleFactor)*scale;
- fScale = fScale > sqr(factorizationScaleFreeze()) ? fScale : sqr(factorizationScaleFreeze());
+ fScale = max( fScale , sqr(factorizationScaleFreeze()) );
double alphas = 1.0;
double pdf = 1.0;
// check if we are potentially reweighting and cache evaluations
bool evaluatePDF = true;
bool evaluateAlphaS = true;
bool variations =
!ShowerHandler::currentHandler()->showerVariations().empty() &&
!presampling;
if ( variations ) {
map<double,double>::const_iterator pit = thePDFCache.find(fScaleFactor);
evaluatePDF = (pit == thePDFCache.end());
if ( !evaluatePDF ) {
pdf = pit->second;
}
map<double,double>::const_iterator ait = theAlphaSCache.find(rScaleFactor);
evaluateAlphaS = (ait == theAlphaSCache.end());
if ( !evaluateAlphaS ) {
alphas = ait->second;
}
}
- if ( evaluateAlphaS )
- alphas = alphaS()->value(rScale);
-
+ if ( evaluateAlphaS ){
+ if (theCMWScheme==0) {
+ alphas = alphaS()->value(rScale);
+ }else if(theCMWScheme==1){
+
+ alphas = alphaS()->value(rScale);
+ alphas *=1.+(3.*(67./18.-1./6.*sqr(Constants::pi))
+ -5./9.*alphaS()->Nf(rScale))*
+ alphas/2./Constants::pi;
+
+ }else if(theCMWScheme==2){
+ double kg=exp(-(67.-3.*sqr(Constants::pi)-10/3*alphaS()->Nf(rScale))
+ /(33.-2.*alphaS()->Nf(rScale)));
+ Energy2 cmwscale2=max(sqr(kg)*rScale, sqr(renormalizationScaleFreeze()) );
+ alphas = alphaS()->value(cmwscale2);
+
+ }else{
+ throw Exception()
+ << "This CMW-Scheme is not implemented."
+ << Exception::abortnow;
+
+ }
+ }
if ( evaluatePDF ) {
if ( split.index().initialStateEmitter() ) {
assert(pdfRatio());
pdf *=
split.lastEmitterZ() *
(*pdfRatio())(split.index().emitterPDF(), fScale,
split.index().emitterData(),split.emitterData(),
split.emitterX(),split.lastEmitterZ());
}
if ( split.index().initialStateSpectator() ) {
assert(pdfRatio());
pdf *=
split.lastSpectatorZ() *
(*pdfRatio())(split.index().spectatorPDF(), fScale,
split.index().spectatorData(),split.spectatorData(),
split.spectatorX(),split.lastSpectatorZ());
}
}
if ( evaluatePDF && variations ) {
thePDFCache[fScaleFactor] = pdf;
}
if ( evaluateAlphaS && variations ) {
theAlphaSCache[rScaleFactor] = alphas;
}
double ret = pdf;
if(!split.calcFixedExpansion()){
ret *= alphas / (2.*Constants::pi);
- ret *= theCMWScheme?
- (1.+(3.*(67./18.-1./6.*Constants::pi*Constants::pi)
- -5./9.*alphaS()->Nf(rScale))*alphaS()->value(rScale)/2./Constants::pi)
- :1.;
}else{
ret *=1.;
}
if ( ret < 0. )
ret = 0.;
return ret;
}
void DipoleSplittingKernel::accept(const DipoleSplittingInfo& split,
double, double,
map<string,double>& weights) const {
if ( ShowerHandler::currentHandler()->showerVariations().empty() )
return;
double reference = alphaPDF(split);
assert(reference > 0.);
for ( map<string,ShowerVariation>::const_iterator var =
ShowerHandler::currentHandler()->showerVariations().begin();
var != ShowerHandler::currentHandler()->showerVariations().end(); ++var ) {
if ( ( ShowerHandler::currentHandler()->firstInteraction() && var->second.firstInteraction ) ||
( !ShowerHandler::currentHandler()->firstInteraction() && var->second.secondaryInteractions ) ) {
double varied = alphaPDF(split,ZERO,
var->second.renormalizationScaleFactor,
var->second.factorizationScaleFactor);
if ( varied != reference ) {
map<string,double>::iterator wi = weights.find(var->first);
if ( wi != weights.end() )
wi->second *= varied/reference;
else
weights[var->first] = varied/reference;
}
}
}
}
void DipoleSplittingKernel::veto(const DipoleSplittingInfo& split,
double p, double r,
map<string,double>& weights) const {
if ( ShowerHandler::currentHandler()->showerVariations().empty() )
return;
double reference = alphaPDF(split);
// this is dangerous, but we have no other choice currently -- need to
// carefully check for the effects; the assumption is that if the central
// one ius zero, then so will be the variations.
if ( reference == 0.0 )
return;
for ( map<string,ShowerVariation>::const_iterator var =
ShowerHandler::currentHandler()->showerVariations().begin();
var != ShowerHandler::currentHandler()->showerVariations().end(); ++var ) {
if ( ( ShowerHandler::currentHandler()->firstInteraction() && var->second.firstInteraction ) ||
( !ShowerHandler::currentHandler()->firstInteraction() && var->second.secondaryInteractions ) ) {
double varied = alphaPDF(split,ZERO,
var->second.renormalizationScaleFactor,
var->second.factorizationScaleFactor);
if ( varied != reference ) {
map<string,double>::iterator wi = weights.find(var->first);
if ( wi != weights.end() )
wi->second *= (r - varied*p/reference) / (r-p);
else
weights[var->first] = (r - varied*p/reference) / (r-p);
}
}
}
}
AbstractClassDescription<DipoleSplittingKernel> DipoleSplittingKernel::initDipoleSplittingKernel;
// Definition of the static class description member.
void DipoleSplittingKernel::Init() {
static ClassDocumentation<DipoleSplittingKernel> documentation
("DipoleSplittingKernel is the base class for all kernels "
"used within the dipole shower.");
static Reference<DipoleSplittingKernel,AlphaSBase> interfaceAlphaS
("AlphaS",
"The strong coupling to be used by this splitting kernel.",
&DipoleSplittingKernel::theAlphaS, false, false, true, true, false);
static Parameter<DipoleSplittingKernel,Energy> interfaceScreeningScale
("ScreeningScale",
"A colour screening scale",
&DipoleSplittingKernel::theScreeningScale, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Reference<DipoleSplittingKernel,DipoleSplittingKinematics> interfaceSplittingKinematics
("SplittingKinematics",
"The splitting kinematics to be used by this splitting kernel.",
&DipoleSplittingKernel::theSplittingKinematics, false, false, true, false, false);
static Reference<DipoleSplittingKernel,PDFRatio> interfacePDFRatio
("PDFRatio",
"Set the optional PDF ratio object to evaluate this kernel",
&DipoleSplittingKernel::thePDFRatio, false, false, true, true, false);
static Parameter<DipoleSplittingKernel,unsigned long> interfacePresamplingPoints
("PresamplingPoints",
"The number of points used to presample this kernel.",
&DipoleSplittingKernel::thePresamplingPoints, 2000, 1, 0,
false, false, Interface::lowerlim);
static Parameter<DipoleSplittingKernel,unsigned long> interfaceMaxtry
("Maxtry",
"The maximum number of attempts to generate a splitting.",
&DipoleSplittingKernel::theMaxtry, 10000, 1, 0,
false, false, Interface::lowerlim);
static Parameter<DipoleSplittingKernel,unsigned long> interfaceFreezeGrid
("FreezeGrid",
"",
&DipoleSplittingKernel::theFreezeGrid, 500000, 1, 0,
false, false, Interface::lowerlim);
static Reference<DipoleSplittingKernel,ParticleData> interfaceFlavour
("Flavour",
"Set the flavour to be produced if ambiguous.",
&DipoleSplittingKernel::theFlavour, false, false, true, true, false);
static Reference<DipoleSplittingKernel,DipoleMCCheck> interfaceMCCheck
("MCCheck",
"[debug option] MCCheck",
&DipoleSplittingKernel::theMCCheck, false, false, true, true, false);
interfaceMCCheck.rank(-1);
static Switch<DipoleSplittingKernel,bool> interfaceStrictLargeN
("StrictLargeN",
"Work in a strict large-N limit.",
&DipoleSplittingKernel::theStrictLargeN, false, false, false);
static SwitchOption interfaceStrictLargeNOn
(interfaceStrictLargeN,
"On",
"Replace C_F -> C_A/2 where present",
true);
static SwitchOption interfaceStrictLargeNOff
(interfaceStrictLargeN,
"Off",
"Keep C_F=4/3",
false);
interfaceStrictLargeN.rank(-2);
- static Switch<DipoleSplittingKernel,bool> interfaceCMWScheme
+ static Switch<DipoleSplittingKernel,unsigned int> interfaceCMWScheme
("CMWScheme",
- "Add the CMW Scheme related Kg expression to the splitting",
- &DipoleSplittingKernel::theCMWScheme, false, false, false);
- static SwitchOption interfaceCMWSchemeOn
- (interfaceCMWScheme,"On","", true);
+ "Use the CMW Scheme related Kg expression to the splitting",
+ &DipoleSplittingKernel::theCMWScheme, 0, false, false);
static SwitchOption interfaceCMWSchemeOff
- (interfaceCMWScheme,"Off","",false);
+ (interfaceCMWScheme,"Off","No CMW-Scheme", 0);
+ static SwitchOption interfaceCMWSchemeLinear
+ (interfaceCMWScheme,"Linear",
+ "Linear CMW multiplication: alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )",1);
+ static SwitchOption interfaceCMWSchemeFactor
+ (interfaceCMWScheme,"Factor",
+ "Use factor in alpha_s argument: alpha_s(q) -> alpha_s(k_g*q) with kfac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf)) ",2);
static Parameter<DipoleSplittingKernel,double> interfaceFactorizationScaleFactor
("FactorizationScaleFactor",
"The factorization scale factor.",
&DipoleSplittingKernel::theFactorizationScaleFactor, 1.0, 0.0, 0,
false, false, Interface::lowerlim);
interfaceFactorizationScaleFactor.rank(-2);
static Parameter<DipoleSplittingKernel,double> interfaceRenormalizationScaleFactor
("RenormalizationScaleFactor",
"The renormalization scale factor.",
&DipoleSplittingKernel::theRenormalizationScaleFactor, 1.0, 0.0, 0,
false, false, Interface::lowerlim);
interfaceRenormalizationScaleFactor.rank(-2);
static Parameter<DipoleSplittingKernel,Energy> interfaceRenormalizationScaleFreeze
("RenormalizationScaleFreeze",
"The freezing scale for the renormalization scale.",
&DipoleSplittingKernel::theRenormalizationScaleFreeze, GeV, 1.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<DipoleSplittingKernel,Energy> interfaceFactorizationScaleFreeze
("FactorizationScaleFreeze",
"The freezing scale for the factorization scale.",
&DipoleSplittingKernel::theFactorizationScaleFreeze, GeV, 1.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Switch<DipoleSplittingKernel,bool> interfaceVirtualitySplittingScale
("VirtualitySplittingScale",
"Use the virtuality as the splitting scale.",
&DipoleSplittingKernel::theVirtualitySplittingScale, false, false, false);
static SwitchOption interfaceVirtualitySplittingScaleYes
(interfaceVirtualitySplittingScale,
"Yes",
"Use vrituality.",
true);
static SwitchOption interfaceVirtualitySplittingScaleNo
(interfaceVirtualitySplittingScale,
"No",
"Use transverse momentum.",
false);
static Parameter<DipoleSplittingKernel,double> interfaceDetuning
("Detuning",
"A value to detune the overestimate kernel.",
&DipoleSplittingKernel::theDetuning, 1.0, 1.0, 0,
false, false, Interface::lowerlim);
}
diff --git a/Shower/Dipole/Kernels/DipoleSplittingKernel.h b/Shower/Dipole/Kernels/DipoleSplittingKernel.h
--- a/Shower/Dipole/Kernels/DipoleSplittingKernel.h
+++ b/Shower/Dipole/Kernels/DipoleSplittingKernel.h
@@ -1,501 +1,501 @@
// -*- C++ -*-
//
// DipoleSplittingKernel.h is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_DipoleSplittingKernel_H
#define HERWIG_DipoleSplittingKernel_H
//
// This is the declaration of the DipoleSplittingKernel class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "ThePEG/StandardModel/AlphaSBase.h"
#include "ThePEG/PDF/PDF.h"
#include "Herwig/Shower/Dipole/Utility/PDFRatio.h"
#include "Herwig/Shower/Dipole/Base/DipoleSplittingInfo.h"
#include "Herwig/Shower/Dipole/Kinematics/DipoleSplittingKinematics.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup DipoleShower
* \author Simon Platzer
*
* \brief DipoleSplittingKernel is the base class for all kernels
* used within the dipole shower.
*
* @see \ref DipoleSplittingKernelInterfaces "The interfaces"
* defined for DipoleSplittingKernel.
*/
class DipoleSplittingKernel: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
DipoleSplittingKernel();
/**
* The destructor.
*/
virtual ~DipoleSplittingKernel();
//@}
public:
/**
* Return the alpha_s to be used
*/
Ptr<AlphaSBase>::tptr alphaS() const { return theAlphaS; }
/**
* Set the alpha_s to be used
*/
void alphaS(Ptr<AlphaSBase>::tptr ap) { theAlphaS = ap; }
/**
* Return the splitting kinematics object
*/
Ptr<DipoleSplittingKinematics>::tptr splittingKinematics() const { return theSplittingKinematics; }
/**
* Return the mc check object
*/
Ptr<DipoleMCCheck>::ptr mcCheck() const { return theMCCheck; }
/**
* Set the splitting kinematics object
*/
void splittingKinematics(Ptr<DipoleSplittingKinematics>::tptr sp) { theSplittingKinematics = sp; }
/**
* Return the PDFRatio object
*/
Ptr<PDFRatio>::tptr pdfRatio() const { return thePDFRatio; }
/**
* Set the PDFRatio object
*/
void pdfRatio(Ptr<PDFRatio>::tptr sp) { thePDFRatio = sp; }
/**
* Return the number of additional parameter
* random variables needed to evaluate this kernel
* except the momentum fractions of incoming partons.
* These will be accessible through the
* lastSplittingParameters() container of the splitting
* info object.
*/
virtual int nDimAdditional() const { return 0; }
/**
* Set the freezing value for the renormalization scale
*/
void renormalizationScaleFreeze(Energy s) { theRenormalizationScaleFreeze = s; }
/**
* Set the freezing value for the factorization scale
*/
void factorizationScaleFreeze(Energy s) { theFactorizationScaleFreeze = s; }
/**
* Get the freezing value for the renormalization scale
*/
Energy renormalizationScaleFreeze() const { return theRenormalizationScaleFreeze; }
/**
* Get the freezing value for the factorization scale
*/
Energy factorizationScaleFreeze() const { return theFactorizationScaleFreeze; }
public:
/**
* Return true, if this splitting kernel
* applies to the given dipole index.
*/
virtual bool canHandle(const DipoleIndex&) const = 0;
/**
* Return true, if this splitting kernel is
* the same for the given index a, as the given
* splitting kernel for index b.
*/
virtual bool canHandleEquivalent(const DipoleIndex& a,
const DipoleSplittingKernel& sk,
const DipoleIndex& b) const = 0;
/**
* Return the emitter data after splitting, given
* a dipole index.
*/
virtual tcPDPtr emitter(const DipoleIndex&) const = 0;
/**
* Return the emission data after splitting, given
* a dipole index.
*/
virtual tcPDPtr emission(const DipoleIndex&) const = 0;
/**
* Return the spectator data after splitting, given
* a dipole index.
*/
virtual tcPDPtr spectator(const DipoleIndex&) const = 0;
/**
* Return the flavour produced, if this cannot
* be determined from the dipole.
*/
PDPtr flavour() const { return theFlavour; }
/**
* Return true, if this splitting kernel is supposed to work in a
* strict large-N limit, i.e. replacing C_F by C_A/2
*/
bool strictLargeN() const { return theStrictLargeN; }
public:
/**
* Inform this splitting kernel, that it is being
* presampled until a call to stopPresampling
*/
virtual void startPresampling(const DipoleIndex&) {
presampling = true;
}
/**
* Inform this splitting kernel, that it is not being
* presampled until a call to startPresampling
*/
virtual void stopPresampling(const DipoleIndex&) {
presampling = false;
}
/**
* Return the number of points to presample this
* splitting generator.
*/
unsigned long presamplingPoints() const { return thePresamplingPoints; }
/**
* Return the maximum number of trials
* to generate a splitting.
*/
unsigned long maxtry() const { return theMaxtry; }
/**
* Return the number of accepted points after which the grid should
* be frozen
*/
unsigned long freezeGrid() const { return theFreezeGrid; }
/**
* Set the number of accepted points after which the grid should
* be frozen
*/
void freezeGrid(unsigned long n) { theFreezeGrid = n; }
/**
* Set a detuning factor to be applied to the sampling overestimate kernel
*/
void detuning(double d) { theDetuning = d; }
/**
* Return the detuning factor applied to the sampling overestimate kernel
*/
double detuning() const { return theDetuning; }
/**
* Evaluate this splitting kernel for the given
* dipole splitting.
*/
virtual double evaluate(const DipoleSplittingInfo&) const = 0;
/**
* Clear the alphaPDF cache
*/
void clearAlphaPDFCache() const {
theAlphaSCache.clear();
thePDFCache.clear();
}
/**
* Update the variations vector at the given splitting using the indicated
* kernel and overestimate values.
*/
virtual void accept(const DipoleSplittingInfo&, double, double, map<string,double>&) const;
/**
* Update the variations vector at the given splitting using the indicated
* kernel and overestimate values.
*/
virtual void veto(const DipoleSplittingInfo&, double, double, map<string,double>&) const;
/**
* Return true, if this kernel is capable of
* delivering an overestimate to the kernel, and
* of inverting the integral over the overestimate
* w.r.t. the phasepsace provided by the given
* DipoleSplittingInfo object.
*/
virtual bool haveOverestimate(const DipoleSplittingInfo&) const { return false; }
/**
* Return the overestimate to this splitting kernel
* for the given dipole splitting.
*/
virtual double overestimate(const DipoleSplittingInfo&) const { return -1.; }
/**
* Invert the integral over the overestimate
* w.r.t. the phasepsace provided by the given
* DipoleSplittingInfo object to equal
* the given value.
*/
virtual double invertOverestimateIntegral(const DipoleSplittingInfo&, double) const { return -1.; }
public:
/**
* Get the factorization scale factor
*/
double factorizationScaleFactor() const { return theFactorizationScaleFactor; }
/**
* Set the factorization scale factor
*/
void factorizationScaleFactor(double f) { theFactorizationScaleFactor = f; }
/**
* Get the renormalization scale factor
*/
double renormalizationScaleFactor() const { return theRenormalizationScaleFactor; }
/**
* Set the renormalization scale factor
*/
void renormalizationScaleFactor(double f) { theRenormalizationScaleFactor = f; }
protected:
/**
* Return the common factor of (alphas/2pi)*(pdf ratio)
*/
double alphaPDF(const DipoleSplittingInfo&,
Energy optScale = ZERO,
double rScaleFactor = 1.0,
double fScaleFactor = 1.0) const;
/**
* Return true, if the virtuality of the splitting should be used as the
* argument of alphas rather than the pt
*/
bool virtualitySplittingScale() const { return theVirtualitySplittingScale; }
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
private:
/**
* The alpha_s to be used.
*/
Ptr<AlphaSBase>::ptr theAlphaS;
/**
* An optional 'colour screening' scale
* for alternative intrinsic pt generation.
*/
Energy theScreeningScale;
/**
* The splitting kinematics to be used.
*/
Ptr<DipoleSplittingKinematics>::ptr theSplittingKinematics;
/**
* An optional PDF ratio object to be used
* when evaluating this kernel.
*/
Ptr<PDFRatio>::ptr thePDFRatio;
/**
* The number of points to presample this
* splitting generator.
*/
unsigned long thePresamplingPoints;
/**
* The maximum number of trials
* to generate a splitting.
*/
unsigned long theMaxtry;
/**
* Return the number of accepted points after which the grid should
* be frozen
*/
unsigned long theFreezeGrid;
/**
* The detuning factor applied to the sampling overestimate kernel
*/
double theDetuning;
/**
* The flavour produced, if this cannot
* be determined from the dipole.
*/
PDPtr theFlavour;
/**
* Pointer to a check histogram object
*/
Ptr<DipoleMCCheck>::ptr theMCCheck;
/**
* True, if this splitting kernel is supposed to work in a
* strict large-N limit, i.e. replacing C_F by C_A/2
*/
bool theStrictLargeN;
/**
* The factorization scale factor.
*/
double theFactorizationScaleFactor;
/**
* The renormalization scale factor.
*/
double theRenormalizationScaleFactor;
/**
* A freezing value for the renormalization scale
*/
Energy theRenormalizationScaleFreeze;
/**
* A freezing value for the factorization scale
*/
Energy theFactorizationScaleFreeze;
/**
* True, if the virtuality of the splitting should be used as the
* argument of alphas rather than the pt
*/
bool theVirtualitySplittingScale;
/**
* Implementing CMW in the kernels.
**/
- bool theCMWScheme;
+ unsigned int theCMWScheme=0;
/**
* Cache for alphas evaluations
*/
mutable map<double,double> theAlphaSCache;
/**
* Cache for PDF evaluations
*/
mutable map<double,double> thePDFCache;
/**
* True, if we are presampling
*/
bool presampling;
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is an abstract class with persistent data.
*/
static AbstractClassDescription<DipoleSplittingKernel> initDipoleSplittingKernel;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
DipoleSplittingKernel & operator=(const DipoleSplittingKernel &);
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of DipoleSplittingKernel. */
template <>
struct BaseClassTrait<Herwig::DipoleSplittingKernel,1> {
/** Typedef of the first base class of DipoleSplittingKernel. */
typedef HandlerBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the DipoleSplittingKernel class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::DipoleSplittingKernel>
: public ClassTraitsBase<Herwig::DipoleSplittingKernel> {
/** Return a platform-independent class name */
static string className() { return "Herwig::DipoleSplittingKernel"; }
/**
* The name of a file containing the dynamic library where the class
* DipoleSplittingKernel is implemented. It may also include several, space-separated,
* libraries if the class DipoleSplittingKernel depends on other classes (base classes
* excepted). In this case the listed libraries will be dynamically
* linked in the order they are specified.
*/
static string library() { return "HwDipoleShower.so"; }
};
/** @endcond */
}
#endif /* HERWIG_DipoleSplittingKernel_H */
diff --git a/Shower/Dipole/Merging/Merger.cc b/Shower/Dipole/Merging/Merger.cc
--- a/Shower/Dipole/Merging/Merger.cc
+++ b/Shower/Dipole/Merging/Merger.cc
@@ -1,1501 +1,1537 @@
// -*- C++ -*-
//
// Merger.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright ( C ) 2002-2007 The Herwig Collaboration
//
// Herwig is licenced under version 2 of the GPL , see COPYING for details.
// Please respect the MCnet academic guidelines , see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined , non-templated member
// functions of the Merger class.
//
#include "Merger.h"
#include "Node.h"
#include "MergingFactory.h"
// other includes when needed below.
using namespace Herwig;
IBPtr Merger::clone() const {
return new_ptr( *this );
}
IBPtr Merger::fullclone() const {
return new_ptr( *this );
}
namespace {
double decideClustering(const NodePtr sub,const NodePtr head,bool& pro){
if( sub != head ){// at least one history step -> unitarisation
if ( UseRandom::rndbool() ){ pro = true; return -2.; }
else{ pro = false; return 2.; }
} // no ordered history -> no projection
else{ pro = false; return 1.; }
}
}
CrossSection Merger::MergingDSigDRBornStandard( ){
// get the history for the process
const NodePtr productionNode =
currentNode()-> getHistory( true, DSH()->hardScaleFactor() );
// decide if to cluster
weight = decideClustering(productionNode, currentNode(), projected);
// check if we only want to calculate the current multiplicity.
if(notOnlyMulti()) return ZERO;
// Check for cuts on the production proces.
if ( !productionNode->xcomb()->willPassCuts() ) return ZERO;
// calculate the staring scale for the production node
Energy startscale = CKKW_StartScale( productionNode );
// fill history with caluclation of sudakov supression
fillHistory( startscale , productionNode , currentNode() );
// fill the projector -> return the scale of the last splitting
currentNode()->runningPt( fillProjector( projected ? 1 : 0 ) );
// the weight has three components to get shower history weight
weight *= history.back().weight* // Sudakov suppression
alphaReweight()* // alpha_s reweight
pdfReweight(); // pdf reweight
// If weight is zero return.
if( weight == ZERO ) return ZERO;
//calculate the cross section
return weight*TreedSigDR( startscale , 1. );
}
CrossSection Merger::MergingDSigDRVirtualStandard( ){
// get the history for the process
const NodePtr productionNode = currentNode()-> getHistory( true , DSH()->hardScaleFactor() );
// decide if to cluster
weight = decideClustering(productionNode,currentNode(),projected);
// Check for cuts on the production proces.
if ( !productionNode->xcomb()->willPassCuts() )return ZERO;
// calculate the staring scale
Energy startscale = CKKW_StartScale( productionNode );
// fill history with caluclation of sudakov supression
fillHistory( startscale , productionNode , currentNode() );
// fill the projector -> return the scale of the last splitting
currentNode()->runningPt( fillProjector( projected ? 1 : 0 ) );
// the weight has three components to get shower history weight
double ww1 = history.back().weight;
double ww2 = alphaReweight();
double ww3 = pdfReweight();
weight *= ww1*ww2*ww3;
// If weight is zero return.
if( weight == 0. )return ZERO;
// calculate the cross section for virtual contribution
// and various insertion operators.
CrossSection matrixElement = LoopdSigDR( startscale );
// Now calculate the expansion of the shower history.
// first: the born contibution:
CrossSection bornWeight = currentME()->dSigHatDRB();
// second: expansion of pdf ,alpha_s-ratio and sudakov suppression.
double w1 = -sumPdfReweightExpansion();
double w2 = -sumAlphaSReweightExpansion();
double w3 = -sumFillHistoryExpansion();
// put together the expansion weights.
CrossSection expansionweight = ( w1+w2+w3 )
*bornWeight
*SM().alphaS()/( 2.*ThePEG::Constants::pi );
// [ DEBUG ]
if ( currentNode()->legsize() == 5 && Debug::level > 2 )
debugVirt(weight,w1,w2,w3,matrixElement,ww1,ww2,ww3,productionNode,bornWeight);
// return with correction that ME was calculated with fixed alpha_s
return weight* as( startscale*DSH()->renFac() )/
SM().alphaS()* ( matrixElement+expansionweight );
}
CrossSection Merger::MergingDSigDRRealStandard(){
if ( currentNode()->children().empty() ) {
throw Exception()
<< "Real emission contribution without underlying born."
<< "These are finite contibutions already handled in LO merging."
<< Exception::abortnow;
}
// check for IR Safe Cutoff
if( !currentNode()->allAbove( theIRSafePT ) )return ZERO;
auto inOutPair = currentNode()->getInOut();
NodePtr randomChild = currentNode()->randomChild();
bool meRegion =matrixElementRegion(
inOutPair.first ,
inOutPair.second ,
randomChild->pT() ,
theMergePt );
if ( meRegion )return MergingDSigDRRealAllAbove( );
if ( UseRandom::rndbool() )
return 2.*MergingDSigDRRealBelowSubReal( );
return 2.*MergingDSigDRRealBelowSubInt( );
}
CrossSection Merger::MergingDSigDRRealAllAbove( ){
//If all dipoles pts are above , we cluster to this dipole.
NodePtr CLNode = currentNode()->randomChild();
// Check if phase space poing is in ME region--> else rm PSP
if ( !CLNode->children().empty() ) {
auto inOutPair = CLNode->getInOut();
NodePtr randomChild = CLNode->randomChild();
if( !matrixElementRegion( inOutPair.first ,
inOutPair.second ,
randomChild->pT() ,
theMergePt ) )return ZERO;
}
// first find the history for the acctual Node
NodePtr productionNode = currentNode()-> getHistory( true , DSH()->hardScaleFactor() );
// check if the randomly choosen CLNode is part of the history.
// If CLNode is not part of the history , dont calculate the Real contribution
// else multiply the real contribution with N ( number of children ).
// this returns the sudakov suppression according to
// the clustering of the born parts.
bool inhist = CLNode->isInHistoryOf( productionNode );
// get the history for the clustered Node.
productionNode = CLNode-> getHistory( false , DSH()->hardScaleFactor() );
// decide if to cluster
weight = decideClustering(productionNode,CLNode,projected);
// Check for cuts on the production process.
if ( !productionNode->xcomb()->willPassCuts() )return ZERO;
// calculate the staring scale
Energy startscale = CKKW_StartScale( productionNode );
// fill history with caluclation of sudakov supression
fillHistory( startscale , productionNode , CLNode );
// fill the projector -> return the scale of the last splitting
currentNode()->runningPt( fillProjector( projected ? 2 : 1 ) );
// the weight has three components to get shower history weight
weight *= history.back().weight*alphaReweight()*pdfReweight();
if( weight == 0. )return ZERO;
// The inhist flag produces the correct cluster sensity.
CrossSection me = ( inhist?TreedSigDR( startscale ):ZERO );
// calculate the dipole
CrossSection dip = CLNode->calcDip( startscale* currentME()->renFac() );
CrossSection res = weight*as( startscale*DSH()->renFac() )/SM().alphaS()*
currentNode()->children().size()*( me -dip );
// [ DEBUG ]
if ( currentNode()->legsize() == 6&&Debug::level > 2 )
debugReal("RAA",weight,me,dip);
return res;
}
CrossSection Merger::MergingDSigDRRealBelowSubReal( ){
NodePtr HistNode = currentNode()->randomChild();
if ( !HistNode->children().empty() ) {
auto inOutPair = HistNode->getInOut();
NodePtr randomChild = HistNode->randomChild(); // Here we make sure that clustering and splitting are invertible
if( !matrixElementRegion( inOutPair.first , inOutPair.second , randomChild->pT() , theMergePt ) )return ZERO;
}
const NodePtr productionNode = HistNode-> getHistory( false , DSH()->hardScaleFactor() );
weight = decideClustering(productionNode,HistNode,projected);
if ( !productionNode->xcomb()->willPassCuts() )return ZERO;
Energy startscale = CKKW_StartScale( productionNode );
fillHistory( startscale , productionNode , HistNode );
currentNode()->runningPt( fillProjector( projected ? 1 : 0 ) );
weight *= history.back().weight*alphaReweight()*pdfReweight();
if( weight == 0. )return ZERO;
CrossSection sumPS = ZERO;
for( auto const & child : currentNode()->children() ){
if ( child->allAbove( mergePt() ) ){
if( ( child )->pT()>mergePt()/3. )//TODO: this is a dynamical cutoff( see below )
sumPS += child->calcPs( startscale* currentME()->renFac() );
else
sumPS += child->calcDip( startscale* currentME()->renFac() );
}else{
assert( child->pT()>mergePt() );
}
}
CrossSection me = TreedSigDR( startscale );
// [ DEBUG ]
if ( currentNode()->legsize() == 6&&Debug::level > 2 )
debugReal("RBSR",weight,me,sumPS);
//Here we subtract the PS ( and below the dynamical cutoff the Dip )
return weight*as( startscale*DSH()->renFac() )/SM().alphaS()*
( me-sumPS );
}
CrossSection Merger::MergingDSigDRRealBelowSubInt( ){
if( currentNode()->children().empty() )return ZERO;
NodePtr CLNode = currentNode()->randomChild();
if( CLNode->pT()<mergePt()/3. )return ZERO;//TODO: this is a dynamical cutoff( see above )
if ( !CLNode->children().empty() ) {
auto inOutPair = CLNode->getInOut( );
NodePtr randomChild = CLNode->randomChild(); // Here we make sure that clustering and splitting are invertible
if( !matrixElementRegion( inOutPair.first , inOutPair.second , randomChild->pT() , theMergePt ) )return ZERO;
}
const NodePtr productionNode = CLNode-> getHistory( false , DSH()->hardScaleFactor() );
weight = decideClustering(productionNode,CLNode,projected);
if ( !CLNode->allAbove( mergePt() ) )return ZERO;
if ( !productionNode->xcomb()->willPassCuts() )return ZERO;
Energy startscale = CKKW_StartScale( productionNode );
fillHistory( startscale , productionNode , CLNode );
currentNode()->runningPt( fillProjector( projected ? 2 : 1 ) );
weight *= history.back().weight*alphaReweight()*pdfReweight();
if( weight == 0. )return ZERO;
pair<CrossSection , CrossSection> DipAndPs =
CLNode->calcDipandPS( startscale* currentME()->renFac() );
// [ DEBUG ]
if ( currentNode()->legsize() == 6&&Debug::level > 2 )
debugReal("RBSI",weight,DipAndPs.second,DipAndPs.first);
//Here we add the PS and subtrac the Dip ( only above the dynamical cutoff )
return weight*as( startscale*DSH()->renFac() )/SM().alphaS()*
currentNode()->children().size()*( DipAndPs.second-DipAndPs.first );
}
CrossSection Merger::MergingDSigDRBornGamma( ){
double weightCL = 0.;
weight = 1.;
if ( !currentNode()->children().empty() ) {
auto const inOutPair = currentNode()->getInOut();
// Here we make sure that clustering and splitting are invertible.
NodePtr randomChild = currentNode()->randomChild();
// Check if point is part of the ME region.
if( !matrixElementRegion( inOutPair.first ,
inOutPair.second ,
randomChild->pT() ,
theMergePt ) )weight *= 0.;
}
const NodePtr productionNode = currentNode()->getHistory( true , DSH()->hardScaleFactor() );
NodePtr CLNode;
NodePtr BornCL;
if( !currentNode()->children().empty() ){
if ( UseRandom::rndbool() ){
CLNode = currentNode()->randomChild();
bool inhist = CLNode->isInHistoryOf( productionNode );
weight *= inhist?( -2.*int( currentNode()->children().size() ) ):0.;
projected = true;
weightCL = 2.*int( currentNode()->children().size() );
BornCL = CLNode-> getHistory( false , DSH()->hardScaleFactor() );
}else{
weight = 2.;
projected = false;
}
}else{
weight = 1.;
projected = false;
}
if ( treefactory()->onlymulti() != -1&&
treefactory()->onlymulti() !=
int( currentNode()->legsize()-(projected ? 1 : 0) ) )
return ZERO;
if( !currentNode()->allAbove( mergePt()*(1.-1e-6) ) )weight = 0.;
if( CLNode&&!CLNode->allAbove( mergePt()*(1.-1e-6) ) )weightCL = 0.;
if ( !productionNode->xcomb()->willPassCuts() ){
return ZERO;
}
CrossSection res = ZERO;
bool maxMulti = currentNode()->legsize() == int( maxLegsLO() );
if( weight != 0. ){
Energy startscale = CKKW_StartScale( productionNode );
fillHistory( startscale , productionNode , currentNode() );
currentNode()->runningPt( fillProjector( (projected ? 1 : 0) ) );
weight *= history.back().weight*alphaReweight()*pdfReweight();
if( weight == 0.&&weightCL == 0. )return ZERO;
res += weight*TreedSigDR( startscale , ( !maxMulti&&!projected )?theGamma:1. );
}
if( CLNode&&theGamma != 1. ){
Energy startscale = CKKW_StartScale( BornCL );
fillHistory( startscale , BornCL , CLNode );
currentNode()->runningPt( fillProjector( projected ? 1 : 0 ) );
weightCL *= history.back().weight*alphaReweight()*pdfReweight();
CrossSection diff = ZERO;
currentME()->factory()->setAlphaParameter( 1. );
diff -= weightCL*CLNode->dipole()->dSigHatDR( sqr( startscale* currentME()->renFac() ) );
currentME()->factory()->setAlphaParameter( theGamma );
string alp = ( CLNode->dipole()->aboveAlpha()?"Above":"Below" );
diff += weightCL*CLNode->dipole()->dSigHatDR( sqr( startscale* currentME()->renFac() ) );
currentME()->factory()->setAlphaParameter( 1. );
res += diff;
}
return res;
}
/// calculate the history weighted born cross section
#include "ThePEG/Handlers/SamplerBase.h"
CrossSection Merger::MergingDSigDRBornCheapME( ){
// Check if phase space poing is in ME region
if ( !currentNode()->children().empty() ) {
auto const & inOutPair = currentNode()->getInOut();
NodePtr randomChild = currentNode()->randomChild(); // Here we make sure that clustering and splitting are invertible
if( !matrixElementRegion( inOutPair.first , inOutPair.second , randomChild->pT() , theMergePt ) )return ZERO;
}
CrossSection meweight=(SamplerBase::runLevel() == SamplerBase::RunMode)?TreedSigDR( 60.*GeV, 1. ):1.*nanobarn;
if (SamplerBase::runLevel() == SamplerBase::RunMode && theHighMeWeightMap.count(currentNode()) ) {
if (abs(meweight)>abs(theHighMeWeightMap[currentNode()])) {
theHighMeWeightMap[currentNode()]=abs(meweight);
}else{
if (meweight/theHighMeWeightMap[currentNode()]<UseRandom::rnd()) {
return ZERO;
}
}
}else{
theHighMeWeightMap.insert({currentNode(),abs(meweight)});
}
// get the history for the process
const NodePtr productionNode = currentNode()-> getHistory( true , DSH()->hardScaleFactor() );
// decide if to cluster
weight = decideClustering(productionNode,currentNode(),projected);
if ( treefactory()->onlymulti() != -1&&
treefactory()->onlymulti() != int( currentNode()->legsize()-( projected ? 1 : 0 ) ) )
return ZERO;
// Check for cuts on the production proces.
if ( !productionNode->xcomb()->willPassCuts() )return ZERO;
// calculate the staring scale
Energy startscale = CKKW_StartScale( productionNode );
// fill history with caluclation of sudakov supression
fillHistory( startscale , productionNode , currentNode() );
// fill the projector -> return the scale of the last splitting
currentNode()->runningPt( fillProjector( projected ? 1 : 0 ) );
// the weight has three components to get shower history weight
weight *= history.back().weight*alphaReweight()*pdfReweight();
if( weight == 0. )return ZERO;
//calculate the cross section
return weight*TreedSigDR( startscale , 1. )*theHighMeWeightMap[currentNode()]/meweight;
}
CrossSection Merger::TreedSigDR( Energy startscale , double diffAlpha ){
currentME()->setScale( sqr( startscale ) , sqr( startscale ) );
CrossSection res = currentME()->dSigHatDRB();
if ( diffAlpha != 1. ) {
res += currentME()->dSigHatDRAlphaDiff( diffAlpha );
}
if( std::isnan( double( res/nanobarn ) ) ){
generator()->logWarning(Exception()
<< "Merger: TreedSigDR is nan"
<< Exception::warning);
res = ZERO;};
return res;
}
CrossSection Merger::LoopdSigDR( Energy startscale ){
currentME()->setScale( sqr( startscale ) , sqr( startscale ) );
currentME()->doOneLoopNoBorn();
CrossSection res = currentME()->dSigHatDRV()+
currentME()->dSigHatDRI();
currentME()->noOneLoopNoBorn();
return res;
}
Energy Merger::fillProjector( int pjs ){
// in the shower handler the scale is multiplied
// by DSH()->hardScaleFactor() so here we need
// to devide by the factor.
double xiQSh = history.begin()->node->legsize() == N0()?DSH()->hardScaleFactor():1.;
if( pjs == 0 ){
return ( history.size() == 1?1.:( 1./xiQSh ) )*history.back().scale;
}
for( auto const & hs : history )
if ( isProjectorStage( hs.node , pjs )&&pjs != 0 ){
currentNode()->xcomb()->lastProjector( hs.node->xcomb() );
return ( hs.node == history[0].node?1.:( 1./xiQSh ) )*hs.scale;
}
throw Exception() << "Could not fill projector." << Exception::abortnow;
return ZERO;
}
double Merger::pdfReweight(){ // TODO factorization scale inside
double res = 1.;
double facfactor = ( history[0].node->legsize() == N0()? currentME()->renFac():DSH()->facFac() );
for( int side : {0 , 1} ){
if( history[0].node->xcomb()->mePartonData()[side]->coloured() ){
for ( auto const & hs : history ){
//pdf-ratio only to the last step
if( !hs.node->parent() )continue;
if ( hs.node == history.back().node )continue;
if( !hs.node->dipole() ){
throw Exception() << "\nMerger: pdfReweight: history step has no dipol. "<< Exception::abortnow;
return 0.;
}
res *= pdfratio( hs.node , facfactor*hs.scale , DSH()->facFac()*( hs.node->pT() ) , side );
facfactor = DSH()->facFac();
}
res *= pdfratio( history.back().node , facfactor*history.back().scale , history[0].scale* currentME()->renFac() , side );
}
}
if ( std::isnan( res ) )
generator()->logWarning(Exception()
<< "Merger: pdfReweight is nan."
<< Exception::warning);
return res;
}
+
+double Merger::cmwAlphaS(Energy q)const{
+ double alphas=1.;
+ using Constants::pi;
+ // No cmw-scheme
+ if (theCMWScheme==0) {
+ alphas = as( q );
+ }
+ // Linear cmw-scheme
+ else if(theCMWScheme==1){
+ alphas = as( q );
+ alphas *=1.+(3.*(67./18.-1./6.*sqr(pi))
+ -5./9.*Nf(q))* alphas/2./pi;
+ }
+ // cmw-scheme as factor in argument.
+ else if(theCMWScheme==2){
+ double kg=exp(-(67.-3.*sqr(pi)-10/3*Nf(q))
+ /(33.-2.*Nf(q)));
+
+ alphas = as(max(kg*q,1_GeV));
+ }else{
+ throw Exception()
+ << "This CMW-Scheme is not implemented."
+ << Exception::abortnow;
+
+ }
+ return alphas;
+
+}
+
+
+
+
double Merger::alphaReweight(){
double res = 1.;
Energy Q_R = ( history[0].node->legsize() == N0()?
currentME()->renFac():
DSH()->renFac() )*
history[0].scale;
using Constants::pi;
const auto Q_qed=history[0].node->nodeME()->factory()->scaleChoice()->renormalizationScaleQED();
const auto Oew=history[0].node->nodeME()->orderInAlphaEW();
const auto Oqcd=history[0].node->nodeME()->orderInAlphaS();
const auto glfac=3.*( 67./18.-1./6.*pi*pi );
+ if (!history[0].node->children().empty()) {
+ assert(Oqcd!=0);
+ }
-
- res *= pow( as( Q_R ) / SM().alphaS() , Oqcd );
res *= pow( SM().alphaEMME( Q_qed )/ SM().alphaEMMZ() , Oew );
- if ( !( history[0].node->children().empty() ) ){
- res *= pow( ( theCMWScheme?( 1.+ ( glfac-5./9.*Nf( Q_R ) )*as( Q_R )/2./pi ):1. ) , int( history[0].node->legsize()-N0() ) );
- }
+ res *= pow( cmwAlphaS(Q_R) / SM().alphaS() , Oqcd );
+
+
for ( auto const & hs : history )
if ( hs.node!= history.back().node ){
Energy q_i = DSH()->renFac()* hs.node->pT();
- res *= as( q_i )/ SM().alphaS()
- *( theCMWScheme?( 1.+ ( glfac-5./9.*Nf( q_i ) )*as( q_i )/2./pi ):1. );
+ res *= cmwAlphaS(q_i) / SM().alphaS();
}
if ( std::isnan( res ) )
generator()->logWarning(Exception()
<< "Merger: alphaReweight is nan. "<< Exception::warning);
return res;
}
void Merger::fillHistory( Energy scale , NodePtr begin , NodePtr endNode ){
history.clear();
double sudakov0_n = 1.;
history.push_back( {begin , sudakov0_n , scale} );
double xiQSh = history.begin()->node->legsize() == N0()?
DSH()->hardScaleFactor():1.;
scale *= xiQSh;
if ( begin->parent()||!isUnitarized ) {
while ( begin->parent() && ( begin != endNode ) ) {
if ( !dosudakov( begin , scale , begin->pT() , sudakov0_n ) ){
history.push_back( { begin->parent() , 0. , scale } );
}
if ( std::isnan( sudakov0_n ) )
generator()->logWarning(Exception()
<< "Merger: sudakov"<<scale/GeV<<" "
<<begin->pT()/GeV<<"0_n is nan. "
<< Exception::warning);
scale = begin->pT();
history.push_back( { begin->parent() , sudakov0_n , begin->pT() } );
begin = begin->parent();
}
Energy notunirunning = scale;
if ( !isUnitarized&&N()+N0() > int( currentNode()->legsize() ) ) {
if ( !dosudakov( begin , notunirunning , mergePt() , sudakov0_n ) ){
history.back().weight = 0.;
}else{
history.back().weight = sudakov0_n;
}
}
}
if( history.size() == 1 )scale /= DSH()->hardScaleFactor();
}
double Merger::sumPdfReweightExpansion()const{
double res = 0.;
Energy beam1Scale = history[0].scale*
( history[0].node->legsize() == N0()?
currentME()->renFac():
DSH()->facFac() );
Energy beam2Scale = history[0].scale*
( history[0].node->legsize() == N0()?
currentME()->renFac():
DSH()->facFac() );
for ( auto const & hs : history ){
//pdf expansion only to the last step
if( !hs.node->parent() )continue;
if( hs.node->xcomb()->mePartonData()[0]->coloured()&&
hs.node->nodeME()->lastX1()>0.99 )return 0.;
if( hs.node->xcomb()->mePartonData()[1]->coloured()&&
hs.node->nodeME()->lastX2()>0.99 )return 0.;
if( hs.node->nodeME()->lastX1()<0.00001 )return 0.;
if( hs.node->nodeME()->lastX2()<0.00001 )return 0.;
if ( hs.node->dipole()->bornEmitter() == 0 ){
res += pdfExpansion( hs.node , 0 ,
beam1Scale ,
( hs.node->pT() ) ,
hs.node->nodeME()->lastX1() ,
Nf( history[0].scale ) ,
history[0].scale );
beam1Scale = ( hs.node->pT() )*DSH()->facFac();
}
else if ( hs.node->dipole()->bornEmitter() == 1 ){
res += pdfExpansion( hs.node , 1 ,
beam2Scale ,
( hs.node->pT() ) ,
hs.node->nodeME()->lastX2() ,
Nf( history[0].scale ) ,
history[0].scale );
beam2Scale = ( hs.node->pT() )*DSH()->facFac();
}
// if we're here we know hs.node->dipole()->bornEmitter() > 1
// works only in collinear scheme
else if ( hs.node->dipole()->bornSpectator() == 0 ){
res += pdfExpansion( hs.node , 0 ,
beam1Scale ,
( hs.node->pT() ) ,
hs.node->nodeME()->lastX1() ,
Nf( history[0].scale ) ,
history[0].scale );
beam1Scale = ( hs.node->pT() )*DSH()->facFac();
}
else if ( hs.node->dipole()->bornSpectator() == 1 ){
res += pdfExpansion( hs.node , 1 ,
beam2Scale ,
( hs.node->pT() ) ,
hs.node->nodeME()->lastX2() ,
Nf( history[0].scale ) ,
history[0].scale );
beam2Scale = ( hs.node->pT() )*DSH()->facFac();
}
}
if ( currentNode()->xcomb()->mePartonData()[0]->coloured() ){
res += pdfExpansion( history.back().node , 0 ,
beam1Scale ,
history[0].scale* currentME()->renFac() ,
( history.back() ).node->nodeME()->lastX1() ,
Nf( history[0].scale ) ,
history[0].scale );
}
if ( currentNode()->xcomb()->mePartonData()[1]->coloured() ) {
res += pdfExpansion( history.back().node , 1 ,
beam2Scale ,
history[0].scale* currentME()->renFac() ,
( history.back() ).node->nodeME()->lastX2() ,
Nf( history[0].scale ) ,
history[0].scale );
}
return res;
}
#include "Herwig/MatrixElement/Matchbox/Phasespace/RandomHelpers.h"
double Merger::pdfExpansion( NodePtr node ,
int side , Energy running ,
Energy next , double x ,
int nlp , Energy fixedScale ) const {
tcPDPtr particle , parton;
tcPDFPtr pdf;
if ( side == 0 ) {
particle = node->nodeME()->lastParticles().first->dataPtr();
parton = node->nodeME()->lastPartons().first->dataPtr();
pdf = node->xcomb()->partonBins().first->pdf();
}else{
assert( side == 1 );
particle = node->nodeME()->lastParticles().second->dataPtr();
parton = node->nodeME()->lastPartons().second->dataPtr();
pdf = node->xcomb()->partonBins().second->pdf();
}
//copied from PKOperator
double res = 0.;
int number = 10;
for ( int nr = 0;nr<number;nr++ ){
double restmp = 0;
using namespace RandomHelpers;
double r = UseRandom::rnd();
double eps = 1e-3;
pair<double , double> zw =
generate( ( piecewise() ,
flat( 0.0 , x ) ,
match( inverse( 0.0 , x , 1.0 ) +
inverse( 1.0+eps , x , 1.0 ) ) ) , r );
double z = zw.first;
double mapz = zw.second;
double PDFxparton = pdf->xfx( particle , parton , sqr( fixedScale ) , x )/x;
double CA = SM().Nc();
double CF = ( SM().Nc()*SM().Nc()-1.0 )/( 2.*SM().Nc() );
if ( abs( parton->id() ) < 7 ) {
double PDFxByzgluon = pdf->xfx( particle ,
getParticleData( ParticleID::g ) ,
sqr( fixedScale ) , x/z )*z/x;
double PDFxByzparton = pdf->xfx( particle , parton ,
sqr( fixedScale ) , x/z )*z/x;
assert( abs( parton->id() ) < 7 );
restmp += CF*( 3./2.+2.*log( 1.-x ) ) * PDFxparton;
if ( z > x ) {
restmp += 0.5 * ( sqr( z ) + sqr( 1.-z ) ) * PDFxByzgluon / z;
restmp += CF*2.*( PDFxByzparton - z*PDFxparton )/( z*( 1.-z ) );
restmp -= CF*PDFxByzparton * ( 1.+z )/z;
}
}else{
assert( parton->id() == ParticleID::g );
double PDFxByzgluon = pdf->xfx( particle ,
getParticleData( ParticleID::g ) ,
sqr( fixedScale ) , x/z )*z/x;
if ( z > x ){
double factor = CF * ( 1. + sqr( 1.-z ) ) / sqr( z );
for ( int f = -nlp; f <= nlp; ++f ) {
if ( f == 0 )
continue;
restmp += pdf->xfx( particle , getParticleData( f ) ,
sqr( fixedScale ) , x/z )*z/x*factor;
}
}
restmp += ( ( 11./6. ) * CA
- ( 1./3. )*Nf( history[0].scale )
+ 2.*CA*log( 1.-x ) ) *PDFxparton;
if ( z > x ) {
restmp += 2. * CA * ( PDFxByzgluon - z*PDFxparton ) / ( z*( 1.-z ) );
restmp += 2.* CA *( ( 1.-z )/z - 1. + z*( 1.-z ) ) * PDFxByzgluon / z;
}
}
if ( PDFxparton<1e-8 )restmp = 0.;
res += 1*restmp*log( sqr( running/next ) )/PDFxparton*mapz;
}
return res/number;
}
double Merger::sumAlphaSReweightExpansion()const{
double res = 0.;
if ( !( history[0].node->children().empty() ) ){
res += alphasExpansion( history[0].scale* DSH()->renFac() ,
history[0].scale* currentME()->renFac() )*
int( history[0].node->legsize()-N0() );
}
// dsig is calculated with fixed alpha_s
for ( auto const & hs : history ){
//expansion only to the last step
if( !hs.node->parent() )continue;
res += alphasExpansion( hs.node->pT()*DSH()->renFac() , history[0].scale );
}
return res;
}
double Merger::sumFillHistoryExpansion(){
double res = 0.;
double xiQSh = history[0].node->legsize() == N0()?DSH()->hardScaleFactor():1.;
for ( auto const & hs : history ){
if( !hs.node->parent() )continue;
doHistExpansion( hs.node , ( hs.node == history[0].node?xiQSh:1. )*hs.scale ,
hs.node->pT() , history[0].scale , res );
}
return res;
}
MergingFactoryPtr Merger::treefactory()const{return theTreeFactory;}
void Merger::doinit(){
if ( !DSH()->hardScaleIsMuF() ) {
throw Exception()
<< "Merger: Merging is currently only sensible "
<< "if we are using the hardScale as MuF."
<< Exception::abortnow;
}
}
CrossSection Merger::MergingDSigDR() {
history.clear();
assert(currentNode()==theFirstNodeMap[ currentME()]);
- assert( theCMWScheme );
DSH()->eventHandler( generator()->eventHandler() );
CrossSection res = ZERO;
if( currentNode()->subtractedReal() ){
res = MergingDSigDRRealStandard();
theCurrentMaxLegs = maxLegsNLO();
}else if( currentNode()->virtualContribution() ){
res = MergingDSigDRVirtualStandard();
theCurrentMaxLegs = maxLegsNLO();
}else if( theGamma!= 1. ){
res = MergingDSigDRBornGamma();
theCurrentMaxLegs = maxLegsLO();
}else{
res = MergingDSigDRBornStandard();
theCurrentMaxLegs = maxLegsLO();
}
auto lxc= currentME()->lastXCombPtr();
lxc->lastShowerScale( sqr( currentNode()->runningPt() ) );
auto lp= currentME()->lastXCombPtr()->lastProjector();
if( lp ){
lp->lastShowerScale( sqr( currentNode()->runningPt() ) );
}
if ( res == ZERO ){
history.clear();
return ZERO;
}
cleanup( currentNode() );
lxc->subProcess( SubProPtr() );
history.clear();
if( !std::isfinite( double( res/nanobarn ) ) ){
generator()->logWarning(Exception()
<< "Merger weight is " << res/nanobarn<< " -> setting to 0"
<< Exception::warning);
return ZERO;
}
return res;
}
#include "Herwig/PDF/HwRemDecayer.h"
void Merger::CKKW_PrepareSudakov( NodePtr node , Energy running ){
//cleanup( node );
tSubProPtr sub = node->xcomb()->construct();
const auto pb=node->xcomb()->partonBins();
DSH()->resetPDFs( {pb.first->pdf(),pb.second->pdf() },pb );
DSH()->setCurrentHandler();
DSH()->currentHandler()->generator()->currentEventHandler(
currentNode()->xcomb()->eventHandlerPtr() );
DSH()->currentHandler()->remnantDecayer()->setHadronContent( currentNode()->xcomb()->lastParticles() );
DSH()->eventRecord().clear();
DSH()->eventRecord().slimprepare( sub , dynamic_ptr_cast<tStdXCombPtr>( node->xcomb() ) , DSH()->pdfs() , currentNode()->xcomb()->lastParticles() );
DSH()->hardScales( sqr( running ) );
}
Energy Merger::CKKW_StartScale( NodePtr node ) const {
Energy res = generator()->maximumCMEnergy();;
if( !node->children().empty() ){
for ( int i = 0;i<node->legsize();i++ ){
if ( !node->nodeME()->mePartonData()[i]->coloured() )continue;
for ( int j = i+1;j<node->legsize();j++ ){
if ( i == j||!node->nodeME()->mePartonData()[j]->coloured() )continue;
res = min( res , sqrt( 2.*node->nodeME()->lastMEMomenta()[i]*node->nodeME()->lastMEMomenta()[j] ) );
}
}
}else{
node->nodeME()->factory()->scaleChoice()->setXComb( node->xcomb() );
res = sqrt( node->nodeME()->factory()->scaleChoice()->renormalizationScale() );
}
node->nodeME()->factory()->scaleChoice()->setXComb( node->xcomb() );
res = max( res , sqrt( node->nodeME()->factory()->scaleChoice()->renormalizationScale() ) );
return res;
}
double Merger::alphasExpansion( Energy next , Energy fixedScale ) const {
double betaZero = ( 11./6. )*SM().Nc() - ( 1./3. )*Nf( history[0].scale );
// TODO factorize the return statement, turn ?: into if
return ( betaZero*log( sqr( fixedScale/next ) ) )+
( theCMWScheme?( 3.*( 67./18.-1./6.*Constants::pi*Constants::pi )
-5./9.*Nf( history[0].scale ) ):0. );
}
double Merger::pdfratio( NodePtr node , Energy numerator_scale , Energy denominator_scale , int side ){
StdXCombPtr bXc = node->xcomb();
if( !bXc->mePartonData()[side]->coloured() )
throw Exception()
<< "Merger: pdf-ratio required for non-coloured particle."
<< Exception::abortnow;
double from , to;
if ( side == 0 ){
if ( denominator_scale == numerator_scale ) {
return 1.;
}
from = node->nodeME()->pdf1( sqr( denominator_scale ) );
to = node->nodeME()->pdf1( sqr( numerator_scale ) );
if ( ( to < 1e-8||from < 1e-8 )&&( to/from>10000000. ) ){
generator()->logWarning(Exception()
<< "Merger: pdfratio to = " << to << " from = " << from
<< Exception::warning);
return 0.;
}
}
else{
if ( denominator_scale == numerator_scale ) {
return 1.;
}
from = node->nodeME()->pdf2( sqr( denominator_scale ) );
to = node->nodeME()->pdf2( sqr( numerator_scale ) );
if ( ( to < 1e-8||from < 1e-8 )&&( to/from>10000000. ) ){
generator()->logWarning(Exception()
<< "Merger: pdfratio to = " << to << " from = " << from
<< Exception::warning);
return 0.;}
}
return to/from;
}
bool Merger::dosudakov( NodePtr node , Energy running , Energy next , double& sudakov0_n ) {
CKKW_PrepareSudakov( node , running );
for( DipoleChain const & chain : DSH()->eventRecord().chains() ){
for( Dipole const & dip : chain.dipoles() ){
sudakov0_n *= singlesudakov( dip , next , running , { true , false } );
sudakov0_n *= singlesudakov( dip , next , running , { false , true } );
if ( sudakov0_n == 0.0 ){
cleanup( node );
return false;
}
}
}
cleanup( node );
return true;
}
bool Merger::doHistExpansion( NodePtr node , Energy running , Energy next , Energy fixedScale , double& HistExpansion ) {
CKKW_PrepareSudakov( node , running );
for( DipoleChain const & chain : DSH()->eventRecord().chains() ){
for( Dipole const & dip : chain.dipoles() ){
HistExpansion += singleHistExpansion( dip , next , running , fixedScale , { true , false } );;
HistExpansion += singleHistExpansion( dip , next , running , fixedScale , { false , true } );
}
}
cleanup( node );
return true;
}
bool Merger::isProjectorStage( NodePtr node , int pjs )const{
return ( pjs == int( ( currentNode()->legsize() - node->legsize() ) ) );
}
void Merger::cleanup( NodePtr node ) {
DSH()->eventRecord().clear();
if( !node->xcomb()->subProcess() )return;
ParticleVector vecfirst = node->xcomb()->subProcess()->incoming().first->children();
for( auto const & particle : vecfirst )
node->xcomb()->subProcess()->incoming().first->abandonChild( particle );
ParticleVector vecsecond = node->xcomb()->subProcess()->incoming().second->children();
for( auto const & particle : vecsecond )
node->xcomb()->subProcess()->incoming().second->abandonChild( particle );
node->xcomb()->subProcess( SubProPtr() );
}
double Merger::singlesudakov( Dipole dip , Energy next , Energy running , pair<bool , bool> conf ){
double res = 1.;
tPPtr emitter = dip.emitter( conf );
tPPtr spectator = dip.spectator( conf );
DipoleSplittingInfo candidate( dip.index( conf ) , conf ,
dip.emitterX( conf ) ,
dip.spectatorX( conf ) ,
emitter , spectator );
if ( DSH()->generators().find( candidate.index() ) == DSH()->generators().end() ) DSH()->getGenerators( candidate.index() );
auto const & gens = DSH()->generators().equal_range( candidate.index() );
for ( auto gen = gens.first; gen != gens.second; ++gen ) {
if ( !( gen->first == candidate.index() ) )
continue;
Energy dScale = gen->second->splittingKinematics()->dipoleScale( emitter->momentum() , spectator->momentum() );
candidate.scale( dScale );
candidate.continuesEvolving();
Energy ptMax = gen->second->splittingKinematics()->ptMax( candidate.scale() , candidate.emitterX() , candidate.spectatorX() ,
candidate.index() , *gen->second->splittingKernel() );
candidate.hardPt( min( running , ptMax ) );
if ( candidate.hardPt()>next ){
res *= gen->second->sudakov( candidate , next );
}
}
return res;
}
double Merger::singleHistExpansion( Dipole dip , Energy next , Energy running , Energy fixedScale , pair<bool , bool> conf ){
double res = 0.;
tPPtr emitter = dip.emitter( conf );
tPPtr spectator = dip.spectator( conf );
DipoleSplittingInfo candidate( dip.index( conf ) ,
conf , dip.emitterX( conf ) ,
dip.spectatorX( conf ) ,
emitter , spectator );
if ( DSH()->generators().find( candidate.index() ) ==
DSH()->generators().end() )
DSH()->getGenerators( candidate.index() );
auto const & gens = DSH()->generators().equal_range( candidate.index() );
for ( auto gen = gens.first; gen != gens.second; ++gen ) {
if ( !( gen->first == candidate.index() ) )
continue;
Energy dScale = gen->second->splittingKinematics()->dipoleScale(
emitter->momentum() , spectator->momentum() );
candidate.scale( dScale );
candidate.continuesEvolving();
Energy ptMax = gen->second->
splittingKinematics()->ptMax(
candidate.scale() , candidate.emitterX() ,
candidate.spectatorX() , candidate.index() ,
*gen->second->splittingKernel() );
candidate.hardPt( min( running , ptMax ) );
if ( candidate.hardPt()>next ){
res += gen->second->sudakovExpansion( candidate , next , fixedScale );
}
}
return res;
}
void Merger::firstNodeMap( MatchboxMEBasePtr a , NodePtr b ){
theFirstNodeMap.insert( { a , b } );
}
map<MatchboxMEBasePtr , NodePtr> Merger::firstNodeMap()const{return theFirstNodeMap;}
void Merger::setXComb( tStdXCombPtr xc ){
currentNode()->setXComb( xc );
}
void Merger::setKinematics( ){
currentNode()->setKinematics();
}
void Merger::clearKinematics( ){
currentNode()->clearKinematics();
}
void Merger::flushCaches(){
if (currentNode()&&currentNode()->xcomb()->lastParticles().first) {
currentNode()->flushCaches();
}
}
bool Merger::generateKinematics( const double * r ){
return currentNode()->firstgenerateKinematics( r , ! currentNode()->subtractedReal() );
}
//#include "fastjet/ClusterSequence.hh"
bool Merger::matrixElementRegion( PVector incoming , PVector outgoing , Energy winnerScale , Energy cutscale )const{
//generator()->log() << "\nparticles s" << particles.size() << " " << particles[0] << " " << particles[1] << flush;
/*
if ( defMERegionByJetAlg && !particles[0]->coloured()&& !particles[1]->coloured() ) {
assert( false );
vector<fastjet::PseudoJet> input_particles;
for( size_t em = 2; em < particles.size();em++ ){
input_particles.push_back( fastjet::PseudoJet( em->momentum().x()/GeV ,
em->momentum().y()/GeV ,
em->momentum().z()/GeV ,
em->momentum().e()/GeV ) );
}
fastjet::JetDefinition jet_def( fastjet::ee_kt_algorithm );
fastjet::ClusterSequence clust_seq( input_particles , jet_def );
size_t n = particles.size()-2;
vector<fastjet::PseudoJet> exclusive_jets = clust_seq.exclusive_jets_ycut( ee_ycut );
return n == exclusive_jets.size();
}
if ( defMERegionByJetAlg ) {
assert( false );
size_t noncol = 0;
vector<fastjet::PseudoJet> input_particles;
for( size_t em = 2; em < particles.size();em++ ){
if ( em->coloured() )
input_particles.push_back( fastjet::PseudoJet( em->momentum().x()/GeV ,
em->momentum().y()/GeV ,
em->momentum().z()/GeV ,
em->momentum().e()/GeV ) );
else
noncol++;
}
double Rparam = 1.0;
fastjet::Strategy strategy = fastjet::Best;
fastjet::RecombinationScheme recomb_scheme = fastjet::E_scheme;
fastjet::JetDefinition jet_def( fastjet::kt_algorithm , Rparam , recomb_scheme , strategy );
fastjet::ClusterSequence clust_seq( input_particles , jet_def );
size_t n = particles.size()-2-noncol;
vector<fastjet::PseudoJet> exclusive_jets = clust_seq.exclusive_jets( pp_dcut );
// generator()->log() << "\nn = " << n << " jets = " << exclusive_jets.size();
//for ( size_t i = 0; i<exclusive_jets.size(); i++ ) {
//generator()->log() << "\nn = " << n << " jetspt = " << exclusive_jets[i].perp();
//}
return n == exclusive_jets.size();
}
*/
Energy ptx = Constants::MaxEnergy;
bool foundwinnerpt = false;
using namespace boost;
//FF
for( auto const & em : outgoing ){ if ( ! em->coloured() ) continue;
for( auto const & emm : outgoing ){ if ( !emm->coloured() ) continue; if ( em == emm ) continue;
for( auto const & spe : outgoing ){ if ( !spe->coloured() ) continue; if ( em == spe||emm == spe ) continue;
if ( !( em->id() == -emm->id()||emm->id()>6 ) )continue;
Energy pt = ZERO;
if ( em->momentum().m()<= 1_MeV &&
emm->momentum().m()<= 1_MeV &&
spe->momentum().m()<= 1_MeV ) {
pt = FFLTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}else{
pt = FFMTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}
if ( abs( pt-winnerScale ) < 1_MeV ) {
foundwinnerpt = true;
}
ptx = min( ptx , pt );
}
}
}
//FI
for( auto const & spe : incoming ){ if ( ! spe->coloured() ) continue;
for( auto const & emm : outgoing ){ if ( ! emm->coloured() ) continue;
for( auto const & em : outgoing ){ if ( ! em->coloured() ) continue; if ( em == emm ) continue;
if ( !( em->id() == -emm->id() || emm->id()>6 ) )continue;
Energy pt = ZERO;
if ( em->momentum().m()<= 1_MeV &&
emm->momentum().m()<= 1_MeV &&
spe->momentum().m()<= 1_MeV ) {
pt = FILTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}else{
pt = FIMTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}
if ( abs( pt-winnerScale )<1_MeV ) {
foundwinnerpt = true;
}
if( pt > ZERO )
ptx = min( ptx , pt );
}
}
}
//IF
for( auto const & em : incoming ){ if ( ! em->coloured() ) continue;
for( auto const & emm : outgoing ){ if ( ! emm->coloured() ) continue;
for( auto const & spe : outgoing ){ if ( ! spe->coloured() ) continue; if ( emm == spe ) continue;
if ( !( em->id()>6|| em->id() == emm->id() ||emm->id()>6 ) )continue;
Energy pt = ZERO;
if ( em->momentum().m()<= 1_MeV &&
emm->momentum().m()<= 1_MeV &&
spe->momentum().m()<= 1_MeV ) {
//massless
pt = IFLTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}else{
//massiv
pt = IFMTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
}
if ( abs( pt-winnerScale )< 10_MeV ) {
foundwinnerpt = true;
}
ptx = min( ptx , pt );
}
}
}
//II
for( auto const & em : incoming ){ if ( ! em->coloured() ) continue;
for( auto const & spe : incoming ){ if ( ! spe->coloured() ) continue; if ( em == spe ) continue;
for( auto const & emm : outgoing ){ if ( ! emm->coloured() ) continue;
if ( !( em->id()>6||em->id() == emm->id() ||emm->id()>6 ) )continue;
Energy pt = IILTK->lastPt( em->momentum() , emm->momentum() , spe->momentum() );
if ( abs( pt-winnerScale )< 10_MeV ) {
foundwinnerpt = true;
}
ptx = min( ptx , pt );
}
}
}
if( !foundwinnerpt ){
generator()->logWarning( Exception()
<< "Merger: Could not find winner with pt."
<< "Run with -d2 to get phase space points. "
<< Exception::warning );
if( Debug::level > 2 ) {
generator()->log() << "\nWarning: could not find winner with pt: " << winnerScale/GeV;
for( auto const & emm : incoming ){
generator()->log() << "\n" << emm->id() << " " << emm->momentum()/GeV << " " << emm->momentum().m()/GeV << flush;
}
for( auto const & emm : outgoing ){
generator()->log() <<"\n" << emm->id() << " " << emm->momentum()/GeV << " " << emm->momentum().m()/GeV << flush;
}
}
}
return ( ptx>cutscale ) ;
}
bool Merger::notOnlyMulti() const {
return ( treefactory()->onlymulti() != -1&&
treefactory()->onlymulti() !=
int( currentNode()->legsize()-( projected ? 1 : 0 ) ) );
}
int Merger::M()const{return theTreeFactory->M();}
int Merger::N()const{return theTreeFactory->N();}
void Merger::debugVirt(double weight,double w1,double w2,double w3,
CrossSection matrixElement,double ww1,double ww2,
double ww3, NodePtr node,CrossSection bornWeight)const{
Energy minPT = Constants::MaxEnergy;
for( auto const & no :currentNode()->children() )minPT = min( no->pT() , minPT );
generator()->log() << "\nVIRT " << minPT/GeV << " " << weight << " " << w1;
generator()->log() << " " << w2;
generator()->log() << " " << w3;
generator()->log() << " " << ( matrixElement/nanobarn ) << " " << ww1 << " " << ww2 << " " << ww3 << " " << node->pT()/GeV << " " << node->nodeME()->mePartonData()[3]->mass()/GeV << " " << ( bornWeight*SM().alphaS()/( 2.*ThePEG::Constants::pi )/nanobarn );
}
void Merger::debugReal(string realstr, double weight,
CrossSection me, CrossSection dip)const {
Energy minPT = Constants::MaxEnergy;
for( auto const & no :currentNode()->children() )minPT = min( no->pT() , minPT );
generator()->log() << "\n"<<realstr <<" "<< minPT/GeV << " " << weight << " " << ( me-dip )/nanobarn << " " << me/nanobarn << " " << dip/nanobarn;
}
// If needed , insert default implementations of virtual function defined
// in the InterfacedBase class here ( using ThePEG-interfaced-impl in Emacs ).
#include "ThePEG/Persistency/PersistentOStream.h"
void Merger::persistentOutput( PersistentOStream & os ) const {
os << ShowerExpansionWeights << theCMWScheme << projected <<
isUnitarized << isNLOUnitarized << defMERegionByJetAlg <<
theOpenInitialStateZ << theChooseHistory <<
theN0 << theOnlyN << weight <<
weightCB << theGamma << ee_ycut << pp_dcut <<
theSmearing << ounit( theIRSafePT , GeV ) <<
ounit( theMergePt , GeV ) << ounit( theCentralMergePt , GeV ) <<
theMergingJetFinder << theLargeNBasis << FFLTK << FILTK <<
IFLTK << IILTK << FFMTK << FIMTK << IFMTK <<
theDipoleShowerHandler << theTreeFactory << theFirstNodeMap;
}
#include "ThePEG/Persistency/PersistentIStream.h"
void Merger::persistentInput( PersistentIStream & is , int ) {
is >> ShowerExpansionWeights >> theCMWScheme >> projected >>
isUnitarized >> isNLOUnitarized >>
defMERegionByJetAlg >> theOpenInitialStateZ >>
theChooseHistory >> theN0 >> theOnlyN >>
weight >> weightCB >>
theGamma >> ee_ycut >> pp_dcut >>
theSmearing >> iunit( theIRSafePT , GeV ) >>
iunit( theMergePt , GeV ) >>
iunit( theCentralMergePt , GeV ) >>
theMergingJetFinder >> theLargeNBasis >>
FFLTK >> FILTK >> IFLTK >>
IILTK >> FFMTK >> FIMTK >>
IFMTK >> theDipoleShowerHandler >>
theTreeFactory >> theFirstNodeMap ;
}
// *** Attention *** The following static variable is needed for the type
// description system in ThePEG. Please check that the template arguments
// are correct ( the class and its base class ) , and that the constructor
// arguments are correct ( the class name and the name of the dynamically
// loadable library where the class implementation can be found ).
#include "ThePEG/Utilities/DescribeClass.h"
DescribeClass<Merger , Herwig::MergerBase>
describeHerwigMerger( "Herwig::Merger" , "HwDipoleShower.so" );
//ClassDescription<Merger> Merger::initMerger;
// Definition of the static class description member.
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Switch.h"
void Merger::Init() {
static ClassDocumentation<Merger> documentation
( "Merger." );
static Reference<Merger , DipoleShowerHandler> interfaceShowerHandler
( "DipoleShowerHandler" ,
"" ,
&Merger::theDipoleShowerHandler , false , false , true , true , false );
static Switch<Merger , bool>
interfaceShowerExpansionWeights ( "ShowerExpansionWeights" , "" , &Merger::ShowerExpansionWeights , false , false , false );
static SwitchOption interfaceShowerExpansionWeightsYes
( interfaceShowerExpansionWeights , "Yes" , "" , true );
static SwitchOption interfaceShowerExpansionWeightsNo
( interfaceShowerExpansionWeights , "No" , "" , false );
- static Switch<Merger , bool>
- interfacetheCMWScheme ( "CMWScheme" , "" , &Merger::theCMWScheme , false , false , false );
- static SwitchOption interfacetheCMWSchemeYes
- ( interfacetheCMWScheme , "Yes" , "" , true );
- static SwitchOption interfacetheCMWSchemeNo
- ( interfacetheCMWScheme , "No" , "" , false );
+ static Switch<Merger , unsigned int>
+ interfacetheCMWScheme ( "CMWScheme" , "" , &Merger::theCMWScheme , 0 , false , false );
+ static SwitchOption interfacetheCMWSchemeOff
+ (interfacetheCMWScheme,"Off","No CMW-Scheme", 0);
+ static SwitchOption interfacetheCMWSchemeLinear
+ (interfacetheCMWScheme,"Linear",
+ "Linear CMW multiplication: alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )",1);
+ static SwitchOption interfacetheCMWSchemeFactor
+ (interfacetheCMWScheme,"Factor",
+ "Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q) with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf)) ",2);
static Parameter<Merger , Energy> interfaceMergerScale
( "MergingScale" ,
"The MergingScale." ,
&Merger::theCentralMergePt , GeV , 20.0*GeV , 0.0*GeV , 0*GeV ,
false , false , Interface::lowerlim );
static Reference<Merger , MergingFactory> interfaceMergerHelper
( "MergingFactory" ,
"" ,
&Merger::theTreeFactory , false , false , true , true , false );
static Parameter<Merger , double> interfacedcut
( "pp_dcut" ,
"The MergingScale." ,
&Merger::pp_dcut , 5.0 , 0.0 , 0 ,
false , false , Interface::lowerlim );
static Parameter<Merger , double> interfaceycut
( "ee_ycut" ,
"The MergingScale." ,
&Merger::ee_ycut , 0.2 , 0.0 , 0 ,
false , false , Interface::lowerlim );
static Parameter<Merger , double> interfacegamma
( "gamma" ,
"gamma parameter." ,
&Merger::theGamma , 1.0 , 0.0 , 0 ,
false , false , Interface::lowerlim );
static Reference<Merger , JetFinder> interfaceMergingJetFinder
( "MergingJetFinder" ,
"A reference to the jet finder used in Merging." ,
&Merger::theMergingJetFinder , false , false , true , false , false );
static Reference<Merger , ColourBasis> interfaceLargeNBasis
( "LargeNBasis" ,
"Set the large-N colour basis implementation." ,
&Merger::theLargeNBasis , false , false , true , true , false );
static Switch<Merger , bool>
interfacedefMERegionByJetAlg
( "MERegionByJetAlg" , "" , &Merger::defMERegionByJetAlg , false , false , false );
static SwitchOption interfacedefMERegionByJetAlgYes
( interfacedefMERegionByJetAlg , "Yes" , "" , true );
static SwitchOption interfacedefMERegionByJetAlgNo
( interfacedefMERegionByJetAlg , "No" , "" , false );
static Switch<Merger , bool>
interfaceOpenInitialSateZ
( "OpenInitialStateZ" , "" , &Merger::theOpenInitialStateZ , false , false , false );
static SwitchOption interfaceOpenInitialSateZYes
( interfaceOpenInitialSateZ , "Yes" , "" , true );
static SwitchOption interfaceOpenInitialSateZNo
( interfaceOpenInitialSateZ , "No" , "" , false );
static Parameter<Merger , Energy>
interfaceIRSafePT
( "IRSafePT" , "Set the pt for which a matrixelement should be treated as IR-safe." ,
&Merger::theIRSafePT ,
GeV , 0.0 * GeV , ZERO , Constants::MaxEnergy , true , false , Interface::limited );
interfaceIRSafePT.setHasDefault( false );
static Parameter<Merger , double> interfacemergePtsmearing( "MergingScaleSmearing" , "Set the percentage the merging pt should be smeared." ,
&Merger::theSmearing , 0. , 0. ,
0.0 , 0.5 , true , false , Interface::limited );
static Parameter<Merger , int> interfacechooseHistory( "chooseHistory" , "different ways of choosing the history" , &Merger::theChooseHistory , 3 , -1 , 0 ,
false , false , Interface::lowerlim );
}
diff --git a/Shower/Dipole/Merging/Merger.h b/Shower/Dipole/Merging/Merger.h
--- a/Shower/Dipole/Merging/Merger.h
+++ b/Shower/Dipole/Merging/Merger.h
@@ -1,402 +1,404 @@
/// -*- C++ -*-
//
/// Merger.h is a part of Herwig - A multi-purpose Monte Carlo event generator
/// Copyright (C) 2002-2007 The Herwig Collaboration
//
/// Herwig is licenced under version 2 of the GPL, see COPYING for details.
/// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_Merger_H
#define HERWIG_Merger_H
//
/// This is the declaration of the Merger class.
//
#include "MergingFactory.fh"
#include "Node.fh"
#include "ThePEG/Handlers/HandlerBase.h"
#include "Herwig/Shower/Dipole/DipoleShowerHandler.h"
//#include "Herwig/Shower/Dipole/Base/DipoleSplittingGenerator.h"
#include "Herwig/MatrixElement/Matchbox/Base/MergerBase.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/FFLightTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/IFLightTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/FFMassiveTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/IFMassiveTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/FILightTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/IILightTildeKinematics.h"
#include "Herwig/MatrixElement/Matchbox/Phasespace/FIMassiveTildeKinematics.h"
#include "ThePEG/Cuts/JetFinder.h"
#include "ThePEG/Cuts/Cuts.h"
namespace Herwig {
using namespace ThePEG;
class Merger;
ThePEG_DECLARE_POINTERS(Merger , MergerPtr );
typedef vector<NodePtr> NodePtrVec;
//definition of a history step
struct HistoryStep {
/// containing the full information
NodePtr node;
/// current sudakov weight of the history
double weight;
/// current scale of the history
Energy scale;
};
typedef vector< HistoryStep > History;
typedef multimap<DipoleIndex, Ptr<DipoleSplittingGenerator>::ptr> GeneratorMap2;
/**
* \ingroup DipoleShower
* \author Johannes Bellm
*
* \brief Merger handles the Merger ....... //TODO .
*
* @see \ref MergerInterfaces "The interfaces"
* defined for Merger.
*/
class Merger: public MergerBase {
friend class MergingFactory;
friend class Node;
public:
// define the ME region for a particle vector.
bool matrixElementRegion(PVector incoming,
PVector outgoing,
Energy winnerScale = ZERO,
Energy cutscale = ZERO)const;
/// return the current merging scale,
/// gets smeared around the central merging scale in generate kinematics.
Energy mergingScale()const{return theMergePt;}
/// return the current merging pt (should be unified with mergingScale)
Energy mergePt()const {return theMergePt;}
/// legsize of highest process with NLO corrections
int M()const;
/// legsize of the highest LO merged process
int N()const;
/// legsize of the production process
int N0()const{return theN0;}
/// cross section of as given by the merging
CrossSection MergingDSigDR();
/// ***** virtual functions of the base class ****///
/// set the current xcomb, called from ME
void setXComb( tStdXCombPtr );
/// set kinematics, called from ME
void setKinematics();
/// clear kinematics, called from ME
void clearKinematics();
/// generate kinematics, called from ME
bool generateKinematics( const double * );
/// generate kinematics, called from ME
void flushCaches();
/// return the current maximum legs, the shower should veto
size_t maxLegs() const {return theCurrentMaxLegs;}
/// set the current ME
void setME(MatchboxMEBasePtr me){
theCurrentME=me;
assert(theFirstNodeMap.count(theCurrentME));
theCurrentNode=theFirstNodeMap[theCurrentME];
}
protected:
/// the merging factory needs to set the legsize of the production process
void N0(int n){ theN0=n;}
/// return the large-N basis (TODO: implement check if born ME works with the choice)
Ptr<ColourBasis>::ptr largeNBasis()const{return theLargeNBasis;}
/// smear the merging pt
void smearMergePt(){
const double factor = 1. + (-1. + 2.*UseRandom::rnd() ) * smear();
theMergePt = factor * centralMergePt();
}
/// true if the phase space for initial emissions should not be restricted in z.
bool openInitialStateZ()const{return theOpenInitialStateZ;}
/// return the current ME
MatchboxMEBasePtr currentME() const { return theCurrentME; }
/// return the current Node
NodePtr currentNode() const { return theCurrentNode; }
/// the gamma parameter to subtract dipoles above a alpha parameter
/// and subtract the corresponding IPK operator
double gamma()const{return theGamma;}
private:
/// calculate a single sudakov step for a given dipole
double singlesudakov(Dipole, Energy, Energy, pair<bool, bool>);
/// calculate the sudakov supression for a clusternode between
/// the current running scale and next scale
bool dosudakov(NodePtr Born, Energy running, Energy next, double& sudakov0_n);
/// cleanup
void cleanup(NodePtr);
/// return true if the cluster node has the matching number of
/// legs to the current projector stage
bool isProjectorStage( NodePtr , int )const;
/**
* Calculate the staring scale:
* if Node is part of the production process, calculate according to the
* scale choice object in the merging scale objekt, else
* return max(scale as scalechoice , min(Mass(i, j)))
*/
Energy CKKW_StartScale(NodePtr) const;
/// prepare the sudakov calculation
void CKKW_PrepareSudakov(NodePtr, Energy);
/// number of active flavours as given by the shower
double Nf(Energy scale)const{return DSH()->Nf(scale);}
/// pointer to the factory
MergingFactoryPtr treefactory() const;
/// map from ME to first clusternode
map<MatchboxMEBasePtr, NodePtr> firstNodeMap() const ;
/// set the current merging pt, smeared in generate kinematics
void mergePt(Energy x) {theMergePt = x;}
/// return the central merging pt
Energy centralMergePt() const {return theCentralMergePt;}
private:
/// calculate the history weighted born cross section
CrossSection MergingDSigDRBornStandard();
/// calculate the history weighted born cross section
CrossSection MergingDSigDRBornCheapME();
/**
* calculate the history weighted born cross section
* add the difference of IPK with and without alpha parameter
* subtract the dipoles above the alpha parameter
*/
CrossSection MergingDSigDRBornGamma();
/// calculate the history weighted virtual contribution
CrossSection MergingDSigDRVirtualStandard();
/**
* calculate the history weighted real contribution
* splitted into 3 differnt contibutions
*/
CrossSection MergingDSigDRRealStandard();
/// calculate the history weighted real contribution
/// all dipoles above:
/// N*(R rnd(i)-Dip_i) history_i U(\phi^n_i)
CrossSection MergingDSigDRRealAllAbove();
/// calculate the history weighted real contribution
/// not all dipoles above:
/// (R - sum PS_i) history_rnd U(\phi^n+1)
CrossSection MergingDSigDRRealBelowSubReal();
/// calculate the history weighted real contribution
/// not all dipoles above:
/// rnd(i)-> N*(PS_i - Dip_i) history_i U(\phi^n_i)
CrossSection MergingDSigDRRealBelowSubInt();
/// max legssize the shower should veto for LO
size_t maxLegsLO() const {return N0()+N();}
/// Calculate the LO partonic cross section.
/// if diffalpha != 1, add the difference of IPK(1)-IPK(diffalpha)
CrossSection TreedSigDR(Energy startscale, double diffalpha=1.);
/// fill the projecting xcomb
Energy fillProjector(int);
/// fill the history, including calculation of sudakov supression
void fillHistory(Energy, NodePtr, NodePtr );
/// calculate the pdf ratio for the given clusternode
double pdfratio(NodePtr, Energy, Energy, int);
/// return the pdf-ratio reweight for the history
double pdfReweight();
/// return the alpha_s reweight for the history
double alphaReweight();
/// max legssize the shower should veto for NLO
size_t maxLegsNLO()const {return N0()+M();}
/// calculate the virtual contribution.
CrossSection LoopdSigDR(Energy startscale );
/// calculate alpha_s expansion of the pdf-ratios
double sumPdfReweightExpansion()const;
/// calculate alpha_s expansion of the alpha_s-ratios, including K_g
double sumAlphaSReweightExpansion()const;
/// calculate alpha_s expansion of the sudakov exponents
double sumFillHistoryExpansion();
/// calculate alpha_s expansion of the single step alpha_s-ratio, including K_g
double alphasExpansion( Energy next, Energy fixedScale)const;
/// calculate alpha_s expansion of the single step pdf-ratio
double pdfExpansion(NodePtr, int, Energy, Energy, double, int, Energy)const;
/// calculate alpha_s expansion of the single step sudakov exponent
bool doHistExpansion(NodePtr Born, Energy running, Energy next, Energy fixedScale, double& HistExpansion);
/// calculate alpha_s expansion of the single dipole sudakov exponent
double singleHistExpansion(Dipole, Energy, Energy, Energy, pair<bool, bool>);
//alpha_s as given in the shower
double as(Energy q)const{return DSH()->as(q);}
// //return the dipole shower handler
DipoleShowerHandlerPtr DSH(){return theDipoleShowerHandler;}
//return the const dipole shower handler
cDipoleShowerHandlerPtr DSH()const{return theDipoleShowerHandler;}
/// insert map from ME to first clusternode
void firstNodeMap(MatchboxMEBasePtr, NodePtr);
/// history choice: weighted history choice
int chooseHistory()const {return theChooseHistory;}
/// the smearing factor for the merging scale
double smear()const{return theSmearing;}
/// flag to tell if ME region shoulcd be defined by jet algorithm
/// currently not implemented
bool MERegionByJetAlg()const{return defMERegionByJetAlg;}
/// return the large-N colour basis
void largeNBasis(Ptr<ColourBasis>::ptr x){theLargeNBasis=x;}
/// helper function to check the only multi condition.
bool notOnlyMulti()const;
+ /// Calculate the CMW AlphaS
+ double cmwAlphaS(Energy q)const;
/// debug output for virtual
void debugVirt(double, double, double, double, CrossSection,
double, double, double, NodePtr,CrossSection) const;
/// debug output for reals
void debugReal( string, double, CrossSection, CrossSection) const;
private:
/// calculate the history expansion
bool ShowerExpansionWeights = true;
/// use CMW scheme
- bool theCMWScheme = true;
+ unsigned int theCMWScheme = 0;
/// true if current point should be projected
bool projected = true;
/// true if LO cross sections should be unitarised
bool isUnitarized = true;
/// true if NLO contributions should be unitarised
bool isNLOUnitarized = true;
/// define ME region by jet algorithm
bool defMERegionByJetAlg = false;
/// no z-restricions on initial state emissions in clustering
bool theOpenInitialStateZ = false;
/// history weight choice
int theChooseHistory = 0;
/// legsize of production process
int theN0 = 0;
/// calculate only the N particle contribution
int theOnlyN = -1;
/// the current maxlegs (either LO or NLO maxlegs)
size_t theCurrentMaxLegs = -1;
/// current weight and weight of clustered born
double weight = 1.0;
double weightCB = 1.0;
/// subtract the dipole contribution above a given gamma
double theGamma = 1.0;
/// if ME region defined by jet algorithm, this is the y cut for ee
double ee_ycut = -1;
/// if ME region defined by jet algorithm, this is the d cut for pp
double pp_dcut = -1;
/// smearing factor for merging scale
double theSmearing = 0.;
/// cutoff for real emission contribution
Energy theIRSafePT = 1_GeV;
/// current merging scale
Energy theMergePt = 4_GeV;
/// central merging scale
Energy theCentralMergePt = 4_GeV;
/// current cluster histoy including sudakov weights
History history;
/// if ME region defined by jet algorithm, this is the jetfinder
Ptr<JetFinder>::ptr theMergingJetFinder;
/// pointer to the large-N basis
Ptr<ColourBasis>::ptr theLargeNBasis;
/// current Node
NodePtr theCurrentNode;
/// current ME
MatchboxMEBasePtr theCurrentME;
/// Tilde kinematics pointers, only to use lastPt(emitter, emission, spectator)
Ptr<FFLightTildeKinematics>::ptr FFLTK = new_ptr( FFLightTildeKinematics() );
Ptr<FILightTildeKinematics>::ptr FILTK = new_ptr( FILightTildeKinematics() );
Ptr<IFLightTildeKinematics>::ptr IFLTK = new_ptr( IFLightTildeKinematics() );
Ptr<IILightTildeKinematics>::ptr IILTK = new_ptr( IILightTildeKinematics() );
Ptr<FFMassiveTildeKinematics>::ptr FFMTK = new_ptr( FFMassiveTildeKinematics() );
Ptr<FIMassiveTildeKinematics>::ptr FIMTK = new_ptr( FIMassiveTildeKinematics() );
Ptr<IFMassiveTildeKinematics>::ptr IFMTK = new_ptr( IFMassiveTildeKinematics() );
//pointer to the shower handler
DipoleShowerHandlerPtr theDipoleShowerHandler;
/// pointer to the MergingFactory
MergingFactoryPtr theTreeFactory;
/// map from ME to first Node
map<MatchboxMEBasePtr, NodePtr> theFirstNodeMap;
/// map from ME to highest ME weight so far
map<NodePtr, CrossSection> theHighMeWeightMap;
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Merger & operator=(const Merger &) = delete;
};
}
#endif /* HERWIG_Merger_H */
diff --git a/src/LEP-Merging.in b/src/LEP-Merging.in
--- a/src/LEP-Merging.in
+++ b/src/LEP-Merging.in
@@ -1,138 +1,154 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
## Please mind the spaces between *j , j* in the brackets.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Matchbox/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Matchbox/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Matchbox/FactorCMWScheme_4fl.in
+# read Matchbox/LinearCMWScheme_4fl.ins
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun LEP-Merging EventGenerator
diff --git a/src/LHC-Merging.in b/src/LHC-Merging.in
--- a/src/LHC-Merging.in
+++ b/src/LHC-Merging.in
@@ -1,157 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Matchbox/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Matchbox/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Matchbox/FactorCMWScheme_4fl.in
+# read Matchbox/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
-#read Matchbox/LHC7-J-Analysis.in
-#read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-Z-Analysis.in
+read Merging/LHC7-W-Analysis.in
+#read Merging/LHC7-J-Analysis.in
+#read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun LHC-Merging EventGenerator
diff --git a/src/Matchbox/Makefile.am b/src/Matchbox/Makefile.am
--- a/src/Matchbox/Makefile.am
+++ b/src/Matchbox/Makefile.am
@@ -1,78 +1,72 @@
BUILT_SOURCES = done-all-links
Matchboxdir = ${pkgdatadir}/Matchbox
INPUTFILES = \
DefaultEEJets.in \
DefaultEPJets.in \
DefaultPPJets.in \
EECollider.in \
EPCollider.in \
FiveFlavourScheme.in \
FiveFlavourNoBMassScheme.in \
FourFlavourScheme.in \
GenericCollider.in \
HiggsEffective.in \
HJets.in \
IdentifiedBs.in \
InclusiveDurhamJets.in \
IncreaseVerbosity.in \
LO-DefaultShower.in \
LO-DipoleShower.in \
MCatLO-DefaultShower.in \
MCatLO-DipoleShower.in \
LO.in \
LO-NoShower.in \
MadGraph-MadGraph.in \
GoSam-GoSam.in \
OpenLoops-OpenLoops.in \
MadGraph-GoSam.in \
MadGraph-NJet.in \
NJet-NJet.in \
MadGraph-OpenLoops.in \
MCatNLO-DefaultShower.in \
MCatNLO-DipoleShower.in \
MuDown.in \
MuQDown.in \
MuQUp.in \
MuUp.in \
NLO-NoShower.in \
OnShellHProduction.in \
OnShellWProduction.in \
OnShellZProduction.in \
OnShellTopProduction.in \
Powheg-DefaultShower.in \
Powheg-DipoleShower.in \
Powheg.in \
PPCollider.in \
PQCDLevel.in \
VBFNLO.in \
VBFNLOPhasespace.in \
VBFDiagramsOnly.in \
MMHT2014.in \
MCatNLO-Default-HardAlphaSTune.in \
MCatNLO-Default-ShowerAlphaSTune.in \
Powheg-Default-HardAlphaSTune.in \
Powheg-Default-ShowerAlphaSTune.in \
MCatNLO-Dipole-HardAlphaSTune.in \
MCatNLO-Dipole-ShowerAlphaSTune.in \
StandardModelLike.in \
DiagonalCKM.in \
-NonDiagonalCKM.in \
-Merging.in \
-LEP91-Analysis.in \
-LHC7-Z-Analysis.in \
-LHC7-W-Analysis.in \
-LHC7-J-Analysis.in \
-LHC7-T-Analysis.in
+NonDiagonalCKM.in
dist_Matchbox_DATA = $(INPUTFILES)
CLEANFILES = done-all-links
done-all-links: $(INPUTFILES)
@echo "Linking input files"
@for i in $(INPUTFILES); do \
if test -f $(srcdir)/$$i -a ! -e $$i; then \
$(LN_S) -f $(srcdir)/$$i; fi; done
@touch done-all-links
diff --git a/src/Merging/1LO-0NLO-LEP.in b/src/Merging/1LO-0NLO-LEP.in
--- a/src/Merging/1LO-0NLO-LEP.in
+++ b/src/Merging/1LO-0NLO-LEP.in
@@ -1,137 +1,153 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 1LO-0NLO-LEP EventGenerator
diff --git a/src/Merging/1LO-0NLO-LEP_FixedOrder.in b/src/Merging/1LO-0NLO-LEP_FixedOrder.in
--- a/src/Merging/1LO-0NLO-LEP_FixedOrder.in
+++ b/src/Merging/1LO-0NLO-LEP_FixedOrder.in
@@ -1,280 +1,219 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do Factory:Process e- e+ -> j j
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## Matching and shower selection
##################################################
#read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
#read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
read Matchbox/LO-NoShower.in
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
insert /Herwig/Analysis/Rivet:Analyses 0 Clustermass
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
set /Herwig/Couplings/NLOAlphaS:min_active_flavours 4
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
set /Herwig/Couplings/NLOAlphaS:input_scale 91.18*GeV
set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:GlobalAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:MaxPtIsMuF Yes
create Herwig::MonacoSampler /Herwig/Samplers/Monaco
set /Herwig/Samplers/Sampler:BinSampler /Herwig/Samplers/Monaco
cd /Herwig/Particles
do c:UnsetHardProcessMass
do cbar:UnsetHardProcessMass
do b:UnsetHardProcessMass
do bbar:UnsetHardProcessMass
set c:NominalMass 0*GeV
set cbar:NominalMass 0*GeV
cd /Herwig/Samplers
set Monaco:EnhancementFactor 1.2
set Monaco:InitialPoints 10000
set Monaco:LuminosityMapperBins 8
set Monaco:NIterations 4
set Monaco:RemapChannelDimension Yes
set Monaco:RemapperMinSelection 0.0001
set Monaco:RemapperPoints 10000
set Monaco:UseAllIterations No
set Sampler:UpdateAfter 1000
set Sampler:AddUpSamplers Off
set Sampler:GlobalMaximumWeight Off
set Sampler:FlatSubprocesses Off
set Sampler:MinSelection 0.000001
set Sampler:AlmostUnweighted On
set Sampler:BinSampler:Kappa 1.
set Sampler:RunCombinationData Off
set Sampler:Verbose On
-#######
-# CMW scheme
-#######
-
-cd /Herwig/DipoleShower/Kernels
-set FFgx2ggxDipoleKernel:CMWScheme On
-set FFqx2qgxDipoleKernel:CMWScheme On
-set FFgx2ddxDipoleKernel:CMWScheme On
-set FFgx2uuxDipoleKernel:CMWScheme On
-set FFgx2ccxDipoleKernel:CMWScheme On
-set FFgx2ssxDipoleKernel:CMWScheme On
-set FFgx2bbxDipoleKernel:CMWScheme On
-set FFMgx2ggxDipoleKernel:CMWScheme On
-set FFMdx2dgxDipoleKernel:CMWScheme On
-set FFMux2ugxDipoleKernel:CMWScheme On
-set FFMcx2cgxDipoleKernel:CMWScheme On
-set FFMsx2sgxDipoleKernel:CMWScheme On
-set FFMbx2bgxDipoleKernel:CMWScheme On
-set FFMtx2tgxDipoleKernel:CMWScheme On
-set FFMgx2ddxDipoleKernel:CMWScheme On
-set FFMgx2uuxDipoleKernel:CMWScheme On
-set FFMgx2ccxDipoleKernel:CMWScheme On
-set FFMgx2ssxDipoleKernel:CMWScheme On
-set FFMgx2bbxDipoleKernel:CMWScheme On
-set FIgx2ggxDipoleKernel:CMWScheme On
-set FIqx2qgxDipoleKernel:CMWScheme On
-set FIgx2ddxDipoleKernel:CMWScheme On
-set FIgx2uuxDipoleKernel:CMWScheme On
-set FIgx2ccxDipoleKernel:CMWScheme On
-set FIgx2ssxDipoleKernel:CMWScheme On
-set FIgx2bbxDipoleKernel:CMWScheme On
-set FIMdx2dgxDipoleKernel:CMWScheme On
-set FIMux2ugxDipoleKernel:CMWScheme On
-set FIMcx2cgxDipoleKernel:CMWScheme On
-set FIMsx2sgxDipoleKernel:CMWScheme On
-set FIMbx2bgxDipoleKernel:CMWScheme On
-set FIMtx2tgxDipoleKernel:CMWScheme On
-set FIMgx2ddxDipoleKernel:CMWScheme On
-set FIMgx2uuxDipoleKernel:CMWScheme On
-set FIMgx2ccxDipoleKernel:CMWScheme On
-set FIMgx2ssxDipoleKernel:CMWScheme On
-set FIMgx2bbxDipoleKernel:CMWScheme On
-#set FIMgx2ttxDipoleKernel:CMWScheme On
-set IFgx2ggxDipoleKernel:CMWScheme On
-set IFqx2qgxDipoleKernel:CMWScheme On
-set IFqx2gqxDipoleKernel:CMWScheme On
-set IFgx2ddbarxDipoleKernel:CMWScheme On
-set IFgx2dbardxDipoleKernel:CMWScheme On
-set IFgx2uubarxDipoleKernel:CMWScheme On
-set IFgx2ubaruxDipoleKernel:CMWScheme On
-set IFgx2ccbarxDipoleKernel:CMWScheme On
-set IFgx2cbarcxDipoleKernel:CMWScheme On
-set IFgx2ssbarxDipoleKernel:CMWScheme On
-set IFgx2sbarsxDipoleKernel:CMWScheme On
-set IFMgx2ggxDipoleKernel:CMWScheme On
-set IFMqx2qgxDipoleKernel:CMWScheme On
-set IFMqx2gqxDipoleKernel:CMWScheme On
-set IFMgx2ddbarxDipoleKernel:CMWScheme On
-set IFMgx2dbardxDipoleKernel:CMWScheme On
-set IFMgx2uubarxDipoleKernel:CMWScheme On
-set IFMgx2ubaruxDipoleKernel:CMWScheme On
-set IFMgx2ccbarxDipoleKernel:CMWScheme On
-set IFMgx2cbarcxDipoleKernel:CMWScheme On
-set IFMgx2ssbarxDipoleKernel:CMWScheme On
-set IFMgx2sbarsxDipoleKernel:CMWScheme On
-set IIgx2ggxDipoleKernel:CMWScheme On
-set IIqx2qgxDipoleKernel:CMWScheme On
-set IIqx2gqxDipoleKernel:CMWScheme On
-set IIgx2ddbarxDipoleKernel:CMWScheme On
-set IIgx2dbardxDipoleKernel:CMWScheme On
-set IIgx2uubarxDipoleKernel:CMWScheme On
-set IIgx2ubaruxDipoleKernel:CMWScheme On
-set IIgx2ccbarxDipoleKernel:CMWScheme On
-set IIgx2cbarcxDipoleKernel:CMWScheme On
-set IIgx2ssbarxDipoleKernel:CMWScheme On
-set IIgx2sbarsxDipoleKernel:CMWScheme On
-
-
set /Herwig/Cuts/Cuts:Fuzzy NULL
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
+##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
cd /Herwig/Generators
saverun 1LO-0NLO-LEP_FixedOrder EventGenerator
diff --git a/src/Merging/1LO-0NLO-LEP_Matchbox.in b/src/Merging/1LO-0NLO-LEP_Matchbox.in
--- a/src/Merging/1LO-0NLO-LEP_Matchbox.in
+++ b/src/Merging/1LO-0NLO-LEP_Matchbox.in
@@ -1,278 +1,216 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do Factory:Process e- e+ -> j j
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## Matching and shower selection
##################################################
#read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
set /Herwig/Couplings/NLOAlphaS:min_active_flavours 4
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
set /Herwig/Couplings/NLOAlphaS:input_scale 91.18*GeV
set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:GlobalAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:MaxPtIsMuF Yes
create Herwig::MonacoSampler /Herwig/Samplers/Monaco
set /Herwig/Samplers/Sampler:BinSampler /Herwig/Samplers/Monaco
cd /Herwig/Particles
do c:UnsetHardProcessMass
do cbar:UnsetHardProcessMass
set c:NominalMass 0*GeV
set cbar:NominalMass 0*GeV
do b:UnsetHardProcessMass
do bbar:UnsetHardProcessMass
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
cd /Herwig/Samplers
set Monaco:EnhancementFactor 1.2
set Monaco:InitialPoints 10000
set Monaco:LuminosityMapperBins 8
set Monaco:NIterations 4
set Monaco:RemapChannelDimension Yes
set Monaco:RemapperMinSelection 0.0001
set Monaco:RemapperPoints 10000
set Monaco:UseAllIterations No
set Sampler:UpdateAfter 1000
set Sampler:AddUpSamplers Off
set Sampler:GlobalMaximumWeight Off
set Sampler:FlatSubprocesses Off
set Sampler:MinSelection 0.000001
set Sampler:AlmostUnweighted On
set Sampler:BinSampler:Kappa 1.
set Sampler:RunCombinationData Off
set Sampler:Verbose On
-#######
-# CMW scheme
-#######
+##################################################
+## CMW - Scheme
+##################################################
-cd /Herwig/DipoleShower/Kernels
-set FFgx2ggxDipoleKernel:CMWScheme On
-set FFqx2qgxDipoleKernel:CMWScheme On
-set FFgx2ddxDipoleKernel:CMWScheme On
-set FFgx2uuxDipoleKernel:CMWScheme On
-set FFgx2ccxDipoleKernel:CMWScheme On
-set FFgx2ssxDipoleKernel:CMWScheme On
-set FFgx2bbxDipoleKernel:CMWScheme On
-set FFMgx2ggxDipoleKernel:CMWScheme On
-set FFMdx2dgxDipoleKernel:CMWScheme On
-set FFMux2ugxDipoleKernel:CMWScheme On
-set FFMcx2cgxDipoleKernel:CMWScheme On
-set FFMsx2sgxDipoleKernel:CMWScheme On
-set FFMbx2bgxDipoleKernel:CMWScheme On
-set FFMtx2tgxDipoleKernel:CMWScheme On
-set FFMgx2ddxDipoleKernel:CMWScheme On
-set FFMgx2uuxDipoleKernel:CMWScheme On
-set FFMgx2ccxDipoleKernel:CMWScheme On
-set FFMgx2ssxDipoleKernel:CMWScheme On
-set FFMgx2bbxDipoleKernel:CMWScheme On
-set FIgx2ggxDipoleKernel:CMWScheme On
-set FIqx2qgxDipoleKernel:CMWScheme On
-set FIgx2ddxDipoleKernel:CMWScheme On
-set FIgx2uuxDipoleKernel:CMWScheme On
-set FIgx2ccxDipoleKernel:CMWScheme On
-set FIgx2ssxDipoleKernel:CMWScheme On
-set FIgx2bbxDipoleKernel:CMWScheme On
-set FIMdx2dgxDipoleKernel:CMWScheme On
-set FIMux2ugxDipoleKernel:CMWScheme On
-set FIMcx2cgxDipoleKernel:CMWScheme On
-set FIMsx2sgxDipoleKernel:CMWScheme On
-set FIMbx2bgxDipoleKernel:CMWScheme On
-set FIMtx2tgxDipoleKernel:CMWScheme On
-set FIMgx2ddxDipoleKernel:CMWScheme On
-set FIMgx2uuxDipoleKernel:CMWScheme On
-set FIMgx2ccxDipoleKernel:CMWScheme On
-set FIMgx2ssxDipoleKernel:CMWScheme On
-set FIMgx2bbxDipoleKernel:CMWScheme On
-#set FIMgx2ttxDipoleKernel:CMWScheme On
-set IFgx2ggxDipoleKernel:CMWScheme On
-set IFqx2qgxDipoleKernel:CMWScheme On
-set IFqx2gqxDipoleKernel:CMWScheme On
-set IFgx2ddbarxDipoleKernel:CMWScheme On
-set IFgx2dbardxDipoleKernel:CMWScheme On
-set IFgx2uubarxDipoleKernel:CMWScheme On
-set IFgx2ubaruxDipoleKernel:CMWScheme On
-set IFgx2ccbarxDipoleKernel:CMWScheme On
-set IFgx2cbarcxDipoleKernel:CMWScheme On
-set IFgx2ssbarxDipoleKernel:CMWScheme On
-set IFgx2sbarsxDipoleKernel:CMWScheme On
-set IFMgx2ggxDipoleKernel:CMWScheme On
-set IFMqx2qgxDipoleKernel:CMWScheme On
-set IFMqx2gqxDipoleKernel:CMWScheme On
-set IFMgx2ddbarxDipoleKernel:CMWScheme On
-set IFMgx2dbardxDipoleKernel:CMWScheme On
-set IFMgx2uubarxDipoleKernel:CMWScheme On
-set IFMgx2ubaruxDipoleKernel:CMWScheme On
-set IFMgx2ccbarxDipoleKernel:CMWScheme On
-set IFMgx2cbarcxDipoleKernel:CMWScheme On
-set IFMgx2ssbarxDipoleKernel:CMWScheme On
-set IFMgx2sbarsxDipoleKernel:CMWScheme On
-set IIgx2ggxDipoleKernel:CMWScheme On
-set IIqx2qgxDipoleKernel:CMWScheme On
-set IIqx2gqxDipoleKernel:CMWScheme On
-set IIgx2ddbarxDipoleKernel:CMWScheme On
-set IIgx2dbardxDipoleKernel:CMWScheme On
-set IIgx2uubarxDipoleKernel:CMWScheme On
-set IIgx2ubaruxDipoleKernel:CMWScheme On
-set IIgx2ccbarxDipoleKernel:CMWScheme On
-set IIgx2cbarcxDipoleKernel:CMWScheme On
-set IIgx2ssbarxDipoleKernel:CMWScheme On
-set IIgx2sbarsxDipoleKernel:CMWScheme On
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
cd /Herwig/Generators
saverun 1LO-0NLO-LEP_Matchbox EventGenerator
diff --git a/src/Merging/1LO-0NLO-LEP_Qt.in b/src/Merging/1LO-0NLO-LEP_Qt.in
--- a/src/Merging/1LO-0NLO-LEP_Qt.in
+++ b/src/Merging/1LO-0NLO-LEP_Qt.in
@@ -1,143 +1,143 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/EventHandlers/EventHandler:CascadeHandler /Herwig/Shower/ShowerHandler
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 1LO-0NLO-LEP_Qt EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-J.in b/src/Merging/1LO-0NLO-LHC-J.in
--- a/src/Merging/1LO-0NLO-LHC-J.in
+++ b/src/Merging/1LO-0NLO-LHC-J.in
@@ -1,156 +1,172 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 1LO-0NLO-LHC-J EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-J_OISZ.in b/src/Merging/1LO-0NLO-LHC-J_OISZ.in
--- a/src/Merging/1LO-0NLO-LHC-J_OISZ.in
+++ b/src/Merging/1LO-0NLO-LHC-J_OISZ.in
@@ -1,160 +1,176 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:OpenInitialStateZ Yes
set /Herwig/DipoleShower/Kinematics/IILightKinematics:OpenInitialStateZ Yes
set /Herwig/Merging/Merger:OpenInitialStateZ Yes
saverun 1LO-0NLO-LHC-J_OISZ EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-T.in b/src/Merging/1LO-0NLO-LHC-T.in
--- a/src/Merging/1LO-0NLO-LHC-T.in
+++ b/src/Merging/1LO-0NLO-LHC-T.in
@@ -1,156 +1,172 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> t tbar [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice TopPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 1LO-0NLO-LHC-T EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-T_QtDecay.in b/src/Merging/1LO-0NLO-LHC-T_QtDecay.in
--- a/src/Merging/1LO-0NLO-LHC-T_QtDecay.in
+++ b/src/Merging/1LO-0NLO-LHC-T_QtDecay.in
@@ -1,163 +1,179 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> t tbar [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice TopPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
clear /Herwig/DipoleShower/DipoleShowerHandler:DecayInShower
insert /Herwig/EventHandlers/EventHandler:PostCascadeHandlers 0 /Herwig/Shower/ShowerHandler
#Needed for W decay after Top decay
set /Herwig/Shower/ShowerHandler:Interactions QCDandQED
cd /Herwig/Generators
saverun 1LO-0NLO-LHC-T_QtDecay EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-W.in b/src/Merging/1LO-0NLO-LHC-W.in
--- a/src/Merging/1LO-0NLO-LHC-W.in
+++ b/src/Merging/1LO-0NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 1LO-0NLO-LHC-W EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-Z.in b/src/Merging/1LO-0NLO-LHC-Z.in
--- a/src/Merging/1LO-0NLO-LHC-Z.in
+++ b/src/Merging/1LO-0NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 1LO-0NLO-LHC-Z EventGenerator
diff --git a/src/Merging/1LO-0NLO-LHC-Z_OISZ.in b/src/Merging/1LO-0NLO-LHC-Z_OISZ.in
--- a/src/Merging/1LO-0NLO-LHC-Z_OISZ.in
+++ b/src/Merging/1LO-0NLO-LHC-Z_OISZ.in
@@ -1,160 +1,176 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:OpenInitialStateZ Yes
set /Herwig/DipoleShower/Kinematics/IILightKinematics:OpenInitialStateZ Yes
set /Herwig/Merging/Merger:OpenInitialStateZ Yes
saverun 1LO-0NLO-LHC-Z_OISZ EventGenerator
diff --git a/src/Merging/2LO-0NLO-LEP.in b/src/Merging/2LO-0NLO-LEP.in
--- a/src/Merging/2LO-0NLO-LEP.in
+++ b/src/Merging/2LO-0NLO-LEP.in
@@ -1,137 +1,153 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 2LO-0NLO-LEP EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-J.in b/src/Merging/2LO-0NLO-LHC-J.in
--- a/src/Merging/2LO-0NLO-LHC-J.in
+++ b/src/Merging/2LO-0NLO-LHC-J.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
set /Herwig/Samplers/Sampler:BinSampler:Kappa 0.02
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-J EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-J_OISZ.in b/src/Merging/2LO-0NLO-LHC-J_OISZ.in
--- a/src/Merging/2LO-0NLO-LHC-J_OISZ.in
+++ b/src/Merging/2LO-0NLO-LHC-J_OISZ.in
@@ -1,164 +1,180 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 2
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
set /Herwig/Samplers/Sampler:BinSampler:Kappa 0.02
cd /Herwig/Generators
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:OpenInitialStateZ Yes
set /Herwig/DipoleShower/Kinematics/IILightKinematics:OpenInitialStateZ Yes
set /Herwig/Merging/Merger:OpenInitialStateZ Yes
saverun 2LO-0NLO-LHC-J_OISZ EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-J_only0.in b/src/Merging/2LO-0NLO-LHC-J_only0.in
--- a/src/Merging/2LO-0NLO-LHC-J_only0.in
+++ b/src/Merging/2LO-0NLO-LHC-J_only0.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ j ]
set MergingFactory:NLOProcesses 0
set MergingFactory:onlymulti 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-J EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-J_only1.in b/src/Merging/2LO-0NLO-LHC-J_only1.in
--- a/src/Merging/2LO-0NLO-LHC-J_only1.in
+++ b/src/Merging/2LO-0NLO-LHC-J_only1.in
@@ -1,157 +1,173 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ j ]
set MergingFactory:NLOProcesses 0
set MergingFactory:onlymulti 1
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-J_only1 EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-T.in b/src/Merging/2LO-0NLO-LHC-T.in
--- a/src/Merging/2LO-0NLO-LHC-T.in
+++ b/src/Merging/2LO-0NLO-LHC-T.in
@@ -1,156 +1,172 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> t tbar [ j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice TopPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-T EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-T_QtDecay.in b/src/Merging/2LO-0NLO-LHC-T_QtDecay.in
--- a/src/Merging/2LO-0NLO-LHC-T_QtDecay.in
+++ b/src/Merging/2LO-0NLO-LHC-T_QtDecay.in
@@ -1,162 +1,178 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> t tbar [ j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice TopPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
clear /Herwig/DipoleShower/DipoleShowerHandler:DecayInShower
insert /Herwig/EventHandlers/EventHandler:PostCascadeHandlers 0 /Herwig/Shower/ShowerHandler
#Needed for W decay after Top decay
set /Herwig/Shower/ShowerHandler:Interactions QCDandQED
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-T_QtDecay EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-W.in b/src/Merging/2LO-0NLO-LHC-W.in
--- a/src/Merging/2LO-0NLO-LHC-W.in
+++ b/src/Merging/2LO-0NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [ j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-W EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-Z.in b/src/Merging/2LO-0NLO-LHC-Z.in
--- a/src/Merging/2LO-0NLO-LHC-Z.in
+++ b/src/Merging/2LO-0NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-Z EventGenerator
diff --git a/src/Merging/2LO-0NLO-LHC-Z_OISZ.in b/src/Merging/2LO-0NLO-LHC-Z_OISZ.in
--- a/src/Merging/2LO-0NLO-LHC-Z_OISZ.in
+++ b/src/Merging/2LO-0NLO-LHC-Z_OISZ.in
@@ -1,160 +1,176 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:OpenInitialStateZ Yes
set /Herwig/DipoleShower/Kinematics/IILightKinematics:OpenInitialStateZ Yes
set /Herwig/Merging/Merger:OpenInitialStateZ Yes
saverun 2LO-0NLO-LHC-Z_OISZ EventGenerator
diff --git a/src/Merging/2LO-1NLO-LEP.in b/src/Merging/2LO-1NLO-LEP.in
--- a/src/Merging/2LO-1NLO-LEP.in
+++ b/src/Merging/2LO-1NLO-LEP.in
@@ -1,137 +1,153 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 2LO-1NLO-LEP EventGenerator
diff --git a/src/Merging/2LO-1NLO-LEP_Matchbox.in b/src/Merging/2LO-1NLO-LEP_Matchbox.in
--- a/src/Merging/2LO-1NLO-LEP_Matchbox.in
+++ b/src/Merging/2LO-1NLO-LEP_Matchbox.in
@@ -1,280 +1,216 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do Factory:Process e- e+ -> j j
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## Matching and shower selection
##################################################
#read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
#read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
set /Herwig/Couplings/NLOAlphaS:min_active_flavours 4
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
set /Herwig/Couplings/NLOAlphaS:input_scale 91.18*GeV
set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:GlobalAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:MaxPtIsMuF Yes
create Herwig::MonacoSampler /Herwig/Samplers/Monaco
set /Herwig/Samplers/Sampler:BinSampler /Herwig/Samplers/Monaco
cd /Herwig/Particles
do c:UnsetHardProcessMass
do cbar:UnsetHardProcessMass
set c:NominalMass 0*GeV
set cbar:NominalMass 0*GeV
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
cd /Herwig/Samplers
set Monaco:EnhancementFactor 1.2
set Monaco:InitialPoints 10000
set Monaco:LuminosityMapperBins 8
set Monaco:NIterations 4
set Monaco:RemapChannelDimension Yes
set Monaco:RemapperMinSelection 0.0001
set Monaco:RemapperPoints 10000
set Monaco:UseAllIterations No
set Sampler:UpdateAfter 1000
set Sampler:AddUpSamplers Off
set Sampler:GlobalMaximumWeight Off
set Sampler:FlatSubprocesses Off
set Sampler:MinSelection 0.000001
set Sampler:AlmostUnweighted On
set Sampler:BinSampler:Kappa 1.
set Sampler:RunCombinationData Off
set Sampler:Verbose On
-#######
-# CMW scheme
-#######
+##################################################
+## CMW - Scheme
+##################################################
-cd /Herwig/DipoleShower/Kernels
-set FFgx2ggxDipoleKernel:CMWScheme On
-set FFqx2qgxDipoleKernel:CMWScheme On
-set FFgx2ddxDipoleKernel:CMWScheme On
-set FFgx2uuxDipoleKernel:CMWScheme On
-set FFgx2ccxDipoleKernel:CMWScheme On
-set FFgx2ssxDipoleKernel:CMWScheme On
-set FFgx2bbxDipoleKernel:CMWScheme On
-set FFMgx2ggxDipoleKernel:CMWScheme On
-set FFMdx2dgxDipoleKernel:CMWScheme On
-set FFMux2ugxDipoleKernel:CMWScheme On
-set FFMcx2cgxDipoleKernel:CMWScheme On
-set FFMsx2sgxDipoleKernel:CMWScheme On
-set FFMbx2bgxDipoleKernel:CMWScheme On
-set FFMtx2tgxDipoleKernel:CMWScheme On
-set FFMgx2ddxDipoleKernel:CMWScheme On
-set FFMgx2uuxDipoleKernel:CMWScheme On
-set FFMgx2ccxDipoleKernel:CMWScheme On
-set FFMgx2ssxDipoleKernel:CMWScheme On
-set FFMgx2bbxDipoleKernel:CMWScheme On
-set FIgx2ggxDipoleKernel:CMWScheme On
-set FIqx2qgxDipoleKernel:CMWScheme On
-set FIgx2ddxDipoleKernel:CMWScheme On
-set FIgx2uuxDipoleKernel:CMWScheme On
-set FIgx2ccxDipoleKernel:CMWScheme On
-set FIgx2ssxDipoleKernel:CMWScheme On
-set FIgx2bbxDipoleKernel:CMWScheme On
-set FIMdx2dgxDipoleKernel:CMWScheme On
-set FIMux2ugxDipoleKernel:CMWScheme On
-set FIMcx2cgxDipoleKernel:CMWScheme On
-set FIMsx2sgxDipoleKernel:CMWScheme On
-set FIMbx2bgxDipoleKernel:CMWScheme On
-set FIMtx2tgxDipoleKernel:CMWScheme On
-set FIMgx2ddxDipoleKernel:CMWScheme On
-set FIMgx2uuxDipoleKernel:CMWScheme On
-set FIMgx2ccxDipoleKernel:CMWScheme On
-set FIMgx2ssxDipoleKernel:CMWScheme On
-set FIMgx2bbxDipoleKernel:CMWScheme On
-#set FIMgx2ttxDipoleKernel:CMWScheme On
-set IFgx2ggxDipoleKernel:CMWScheme On
-set IFqx2qgxDipoleKernel:CMWScheme On
-set IFqx2gqxDipoleKernel:CMWScheme On
-set IFgx2ddbarxDipoleKernel:CMWScheme On
-set IFgx2dbardxDipoleKernel:CMWScheme On
-set IFgx2uubarxDipoleKernel:CMWScheme On
-set IFgx2ubaruxDipoleKernel:CMWScheme On
-set IFgx2ccbarxDipoleKernel:CMWScheme On
-set IFgx2cbarcxDipoleKernel:CMWScheme On
-set IFgx2ssbarxDipoleKernel:CMWScheme On
-set IFgx2sbarsxDipoleKernel:CMWScheme On
-set IFMgx2ggxDipoleKernel:CMWScheme On
-set IFMqx2qgxDipoleKernel:CMWScheme On
-set IFMqx2gqxDipoleKernel:CMWScheme On
-set IFMgx2ddbarxDipoleKernel:CMWScheme On
-set IFMgx2dbardxDipoleKernel:CMWScheme On
-set IFMgx2uubarxDipoleKernel:CMWScheme On
-set IFMgx2ubaruxDipoleKernel:CMWScheme On
-set IFMgx2ccbarxDipoleKernel:CMWScheme On
-set IFMgx2cbarcxDipoleKernel:CMWScheme On
-set IFMgx2ssbarxDipoleKernel:CMWScheme On
-set IFMgx2sbarsxDipoleKernel:CMWScheme On
-set IIgx2ggxDipoleKernel:CMWScheme On
-set IIqx2qgxDipoleKernel:CMWScheme On
-set IIqx2gqxDipoleKernel:CMWScheme On
-set IIgx2ddbarxDipoleKernel:CMWScheme On
-set IIgx2dbardxDipoleKernel:CMWScheme On
-set IIgx2uubarxDipoleKernel:CMWScheme On
-set IIgx2ubaruxDipoleKernel:CMWScheme On
-set IIgx2ccbarxDipoleKernel:CMWScheme On
-set IIgx2cbarcxDipoleKernel:CMWScheme On
-set IIgx2ssbarxDipoleKernel:CMWScheme On
-set IIgx2sbarsxDipoleKernel:CMWScheme On
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
-
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
cd /Herwig/Generators
saverun 2LO-1NLO-LEP_Matchbox EventGenerator
diff --git a/src/Merging/2LO-1NLO-LHC-W.in b/src/Merging/2LO-1NLO-LHC-W.in
--- a/src/Merging/2LO-1NLO-LHC-W.in
+++ b/src/Merging/2LO-1NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-1NLO-LHC-W EventGenerator
diff --git a/src/Merging/2LO-1NLO-LHC-Z.in b/src/Merging/2LO-1NLO-LHC-Z.in
--- a/src/Merging/2LO-1NLO-LHC-Z.in
+++ b/src/Merging/2LO-1NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-1NLO-LHC-Z EventGenerator
diff --git a/src/Merging/3LO-0NLO-LEP.in b/src/Merging/3LO-0NLO-LEP.in
--- a/src/Merging/3LO-0NLO-LEP.in
+++ b/src/Merging/3LO-0NLO-LEP.in
@@ -1,137 +1,153 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-0NLO-LEP EventGenerator
diff --git a/src/Merging/3LO-0NLO-LEP_only0.in b/src/Merging/3LO-0NLO-LEP_only0.in
--- a/src/Merging/3LO-0NLO-LEP_only0.in
+++ b/src/Merging/3LO-0NLO-LEP_only0.in
@@ -1,139 +1,155 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:onlymulti 0
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-0NLO-LEP_only0 EventGenerator
diff --git a/src/Merging/3LO-0NLO-LEP_only1.in b/src/Merging/3LO-0NLO-LEP_only1.in
--- a/src/Merging/3LO-0NLO-LEP_only1.in
+++ b/src/Merging/3LO-0NLO-LEP_only1.in
@@ -1,139 +1,155 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:onlymulti 1
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-0NLO-LEP_only1 EventGenerator
diff --git a/src/Merging/3LO-0NLO-LEP_only2.in b/src/Merging/3LO-0NLO-LEP_only2.in
--- a/src/Merging/3LO-0NLO-LEP_only2.in
+++ b/src/Merging/3LO-0NLO-LEP_only2.in
@@ -1,139 +1,155 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:onlymulti 2
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-0NLO-LEP_only2 EventGenerator
diff --git a/src/Merging/3LO-0NLO-LHC-J.in b/src/Merging/3LO-0NLO-LHC-J.in
--- a/src/Merging/3LO-0NLO-LHC-J.in
+++ b/src/Merging/3LO-0NLO-LHC-J.in
@@ -1,156 +1,172 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> j j [ j j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 1
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice MaxJetPtScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-J-Analysis.in
+read Merging/LHC7-J-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-0NLO-LHC-J EventGenerator
diff --git a/src/Merging/3LO-0NLO-LHC-T.in b/src/Merging/3LO-0NLO-LHC-T.in
--- a/src/Merging/3LO-0NLO-LHC-T.in
+++ b/src/Merging/3LO-0NLO-LHC-T.in
@@ -1,156 +1,172 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 2
set MergingFactory:OrderInAlphaEW 0
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> t tbar [ j j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice TopPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-T-Analysis.in
+read Merging/LHC7-T-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 2LO-0NLO-LHC-T EventGenerator
diff --git a/src/Merging/3LO-0NLO-LHC-W.in b/src/Merging/3LO-0NLO-LHC-W.in
--- a/src/Merging/3LO-0NLO-LHC-W.in
+++ b/src/Merging/3LO-0NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [j j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-0NLO-LHC-W EventGenerator
diff --git a/src/Merging/3LO-0NLO-LHC-Z.in b/src/Merging/3LO-0NLO-LHC-Z.in
--- a/src/Merging/3LO-0NLO-LHC-Z.in
+++ b/src/Merging/3LO-0NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
set /Herwig/Samplers/Sampler:BinSampler:Kappa 0.02
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-0NLO-LHC-Z EventGenerator
diff --git a/src/Merging/3LO-0NLO-LHC-Z_OISZ.in b/src/Merging/3LO-0NLO-LHC-Z_OISZ.in
--- a/src/Merging/3LO-0NLO-LHC-Z_OISZ.in
+++ b/src/Merging/3LO-0NLO-LHC-Z_OISZ.in
@@ -1,160 +1,176 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j ]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.ins
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:OpenInitialStateZ Yes
set /Herwig/DipoleShower/Kinematics/IILightKinematics:OpenInitialStateZ Yes
set /Herwig/Merging/Merger:OpenInitialStateZ Yes
saverun 3LO-0NLO-LHC-Z_OISZ EventGenerator
diff --git a/src/Merging/3LO-1NLO-LEP.in b/src/Merging/3LO-1NLO-LEP.in
--- a/src/Merging/3LO-1NLO-LEP.in
+++ b/src/Merging/3LO-1NLO-LEP.in
@@ -1,137 +1,153 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-1NLO-LEP EventGenerator
diff --git a/src/Merging/3LO-1NLO-LHC-W.in b/src/Merging/3LO-1NLO-LHC-W.in
--- a/src/Merging/3LO-1NLO-LHC-W.in
+++ b/src/Merging/3LO-1NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [j j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-1NLO-LHC-W EventGenerator
diff --git a/src/Merging/3LO-1NLO-LHC-Z.in b/src/Merging/3LO-1NLO-LHC-Z.in
--- a/src/Merging/3LO-1NLO-LHC-Z.in
+++ b/src/Merging/3LO-1NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [j j ]
set MergingFactory:NLOProcesses 1
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-1NLO-LHC-Z EventGenerator
diff --git a/src/Merging/3LO-2NLO-LEP.in b/src/Merging/3LO-2NLO-LEP.in
--- a/src/Merging/3LO-2NLO-LEP.in
+++ b/src/Merging/3LO-2NLO-LEP.in
@@ -1,140 +1,156 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set /Herwig/Samplers/Sampler:BinSampler:Kappa 0.02
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
#read Matchbox/MadGraph-OpenLoops.in
#set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath eejjjj
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-2NLO-LEP EventGenerator
diff --git a/src/Merging/3LO-2NLO-LEP_light.in b/src/Merging/3LO-2NLO-LEP_light.in
--- a/src/Merging/3LO-2NLO-LEP_light.in
+++ b/src/Merging/3LO-2NLO-LEP_light.in
@@ -1,141 +1,157 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/EECollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process e- e+ -> j j [ j j ]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 4.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice SHatScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LEP91-Analysis.in
+read Merging/LEP91-Analysis.in
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
saverun 3LO-2NLO-LEP_light EventGenerator
diff --git a/src/Merging/3LO-2NLO-LHC-W.in b/src/Merging/3LO-2NLO-LHC-W.in
--- a/src/Merging/3LO-2NLO-LHC-W.in
+++ b/src/Merging/3LO-2NLO-LHC-W.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> l nu [ j j]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/LeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/LeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-W-Analysis.in
+read Merging/LHC7-W-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-2NLO-LHC-W EventGenerator
diff --git a/src/Merging/3LO-2NLO-LHC-Z.in b/src/Merging/3LO-2NLO-LHC-Z.in
--- a/src/Merging/3LO-2NLO-LHC-Z.in
+++ b/src/Merging/3LO-2NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
set /Herwig/Samplers/Sampler:BinSampler:Kappa 0.02
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 3LO-2NLO-LHC-Z EventGenerator
diff --git a/src/Merging/4LO-0NLO-LHC-Z.in b/src/Merging/4LO-0NLO-LHC-Z.in
--- a/src/Merging/4LO-0NLO-LHC-Z.in
+++ b/src/Merging/4LO-0NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j j]
set MergingFactory:NLOProcesses 0
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 4LO-0NLO-LHC-Z EventGenerator
diff --git a/src/Merging/4LO-2NLO-LHC-Z.in b/src/Merging/4LO-2NLO-LHC-Z.in
--- a/src/Merging/4LO-2NLO-LHC-Z.in
+++ b/src/Merging/4LO-2NLO-LHC-Z.in
@@ -1,158 +1,174 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Merging example input file
##################################################
##################################################
## Collider type
##################################################
read Matchbox/PPCollider.in
-read Matchbox/Merging.in
+read Merging/Merging.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 7000*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do MergingFactory:Process p p -> e+ e- [ j j j ]
set MergingFactory:NLOProcesses 2
set Merger:MergingScale 10.*GeV
set Merger:MergingScaleSmearing 0.1
set Merger:gamma 1.
set MPreWeight:HTPower 0
set MPreWeight:MaxPTPower 0
set MPreWeight:OnlyColoured False
read Matchbox/PQCDLevel.in
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
# Special settings for the VBF approximation
# read Matchbox/VBFDiagramsOnly.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
read Matchbox/MadGraph-OpenLoops.in
# read Matchbox/HJets.in
# read Matchbox/VBFNLO.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV
set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV
cd /Herwig/MatrixElements/Matchbox/Utility
insert DiagramGenerator:ExcludeInternal 0 /Herwig/Particles/gamma
## cuts on additional jets
# read Matchbox/DefaultPPJets.in
# insert JetCuts:JetRegions 0 FirstJet
# insert JetCuts:JetRegions 1 SecondJet
# insert JetCuts:JetRegions 2 ThirdJet
# insert JetCuts:JetRegions 3 FourthJet
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox/Scales/
set /Herwig/Merging/MergingFactory:ScaleChoice LeptonPairMassScale
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## PDF choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
##################################################
+## CMW - Scheme
+##################################################
+
+### Use factor in alpha_s argument: alpha_s(q) -> alpha_s(fac*q)
+### with fac=exp(-(67-3pi^2-10/3*Nf)/(33-2Nf))
+read Merging/FactorCMWScheme.in
+
+### Linear CMW multiplication:
+### alpha_s(q) -> alpha_s(q)(1+K_g*alpha_s(q)/2pi )
+# read Merging/LinearCMWScheme.in
+
+### Same for 4 flavours
+# read Merging/FactorCMWScheme_4fl.in
+# read Merging/LinearCMWScheme_4fl.in
+
+##################################################
## Analyses
##################################################
cd /Herwig/Analysis
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
-read Matchbox/LHC7-Z-Analysis.in
+read Merging/LHC7-Z-Analysis.in
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
set /Herwig/Generators/EventGenerator:IntermediateOutput Yes
cd /Herwig/Generators
saverun 4LO-2NLO-LHC-Z EventGenerator
diff --git a/src/Merging/FactorCMWScheme.in b/src/Merging/FactorCMWScheme.in
new file mode 100644
--- /dev/null
+++ b/src/Merging/FactorCMWScheme.in
@@ -0,0 +1,92 @@
+#######
+# CMW scheme
+#######
+
+cd /Herwig/Merging
+set Merger:CMWScheme Factor
+
+cd /Herwig/DipoleShower/Kernels
+set FFgx2ggxDipoleKernel:CMWScheme Factor
+set FFqx2qgxDipoleKernel:CMWScheme Factor
+set FFgx2ddxDipoleKernel:CMWScheme Factor
+set FFgx2uuxDipoleKernel:CMWScheme Factor
+set FFgx2ccxDipoleKernel:CMWScheme Factor
+set FFgx2ssxDipoleKernel:CMWScheme Factor
+set FFgx2bbxDipoleKernel:CMWScheme Factor
+set FFMgx2ggxDipoleKernel:CMWScheme Factor
+set FFMdx2dgxDipoleKernel:CMWScheme Factor
+set FFMux2ugxDipoleKernel:CMWScheme Factor
+set FFMcx2cgxDipoleKernel:CMWScheme Factor
+set FFMsx2sgxDipoleKernel:CMWScheme Factor
+set FFMbx2bgxDipoleKernel:CMWScheme Factor
+set FFMtx2tgxDipoleKernel:CMWScheme Factor
+set FFMgx2ddxDipoleKernel:CMWScheme Factor
+set FFMgx2uuxDipoleKernel:CMWScheme Factor
+set FFMgx2ccxDipoleKernel:CMWScheme Factor
+set FFMgx2ssxDipoleKernel:CMWScheme Factor
+set FFMgx2bbxDipoleKernel:CMWScheme Factor
+set FIgx2ggxDipoleKernel:CMWScheme Factor
+set FIqx2qgxDipoleKernel:CMWScheme Factor
+set FIgx2ddxDipoleKernel:CMWScheme Factor
+set FIgx2uuxDipoleKernel:CMWScheme Factor
+set FIgx2ccxDipoleKernel:CMWScheme Factor
+set FIgx2ssxDipoleKernel:CMWScheme Factor
+set FIgx2bbxDipoleKernel:CMWScheme Factor
+set FIMdx2dgxDipoleKernel:CMWScheme Factor
+set FIMux2ugxDipoleKernel:CMWScheme Factor
+set FIMcx2cgxDipoleKernel:CMWScheme Factor
+set FIMsx2sgxDipoleKernel:CMWScheme Factor
+set FIMbx2bgxDipoleKernel:CMWScheme Factor
+set FIMtx2tgxDipoleKernel:CMWScheme Factor
+set FIMgx2ddxDipoleKernel:CMWScheme Factor
+set FIMgx2uuxDipoleKernel:CMWScheme Factor
+set FIMgx2ccxDipoleKernel:CMWScheme Factor
+set FIMgx2ssxDipoleKernel:CMWScheme Factor
+set FIMgx2bbxDipoleKernel:CMWScheme Factor
+#set FIMgx2ttxDipoleKernel:CMWScheme Factor
+set IFgx2ggxDipoleKernel:CMWScheme Factor
+set IFqx2qgxDipoleKernel:CMWScheme Factor
+set IFqx2gqxDipoleKernel:CMWScheme Factor
+set IFgx2ddbarxDipoleKernel:CMWScheme Factor
+set IFgx2dbardxDipoleKernel:CMWScheme Factor
+set IFgx2uubarxDipoleKernel:CMWScheme Factor
+set IFgx2ubaruxDipoleKernel:CMWScheme Factor
+set IFgx2ccbarxDipoleKernel:CMWScheme Factor
+set IFgx2cbarcxDipoleKernel:CMWScheme Factor
+set IFgx2ssbarxDipoleKernel:CMWScheme Factor
+set IFgx2sbarsxDipoleKernel:CMWScheme Factor
+set IFMgx2ggxDipoleKernel:CMWScheme Factor
+set IFMqx2qgxDipoleKernel:CMWScheme Factor
+set IFMqx2gqxDipoleKernel:CMWScheme Factor
+set IFMgx2ddbarxDipoleKernel:CMWScheme Factor
+set IFMgx2dbardxDipoleKernel:CMWScheme Factor
+set IFMgx2uubarxDipoleKernel:CMWScheme Factor
+set IFMgx2ubaruxDipoleKernel:CMWScheme Factor
+set IFMgx2ccbarxDipoleKernel:CMWScheme Factor
+set IFMgx2cbarcxDipoleKernel:CMWScheme Factor
+set IFMgx2ssbarxDipoleKernel:CMWScheme Factor
+set IFMgx2sbarsxDipoleKernel:CMWScheme Factor
+set IIgx2ggxDipoleKernel:CMWScheme Factor
+set IIqx2qgxDipoleKernel:CMWScheme Factor
+set IIqx2gqxDipoleKernel:CMWScheme Factor
+set IIgx2ddbarxDipoleKernel:CMWScheme Factor
+set IIgx2dbardxDipoleKernel:CMWScheme Factor
+set IIgx2uubarxDipoleKernel:CMWScheme Factor
+set IIgx2ubaruxDipoleKernel:CMWScheme Factor
+set IIgx2ccbarxDipoleKernel:CMWScheme Factor
+set IIgx2cbarcxDipoleKernel:CMWScheme Factor
+set IIgx2ssbarxDipoleKernel:CMWScheme Factor
+set IIgx2sbarsxDipoleKernel:CMWScheme Factor
+
+## bs from five flavournobmass scheme
+set IFgx2bbbarxDipoleKernel:CMWScheme Factor
+set IFgx2bbarbxDipoleKernel:CMWScheme Factor
+set IFMgx2bbbarxDipoleKernel:CMWScheme Factor
+set IFMgx2bbarbxDipoleKernel:CMWScheme Factor
+set IIgx2bbbarxDipoleKernel:CMWScheme Factor
+set IIgx2bbarbxDipoleKernel:CMWScheme Factor
+
+
+
+
+
diff --git a/src/Merging/FactorCMWScheme_4fl.in b/src/Merging/FactorCMWScheme_4fl.in
new file mode 100644
--- /dev/null
+++ b/src/Merging/FactorCMWScheme_4fl.in
@@ -0,0 +1,79 @@
+#######
+# CMW scheme
+#######
+
+cd /Herwig/Merging
+set Merger:CMWScheme Factor
+
+cd /Herwig/DipoleShower/Kernels
+set FFgx2ggxDipoleKernel:CMWScheme Factor
+set FFqx2qgxDipoleKernel:CMWScheme Factor
+set FFgx2ddxDipoleKernel:CMWScheme Factor
+set FFgx2uuxDipoleKernel:CMWScheme Factor
+set FFgx2ccxDipoleKernel:CMWScheme Factor
+set FFgx2ssxDipoleKernel:CMWScheme Factor
+set FFgx2bbxDipoleKernel:CMWScheme Factor
+set FFMgx2ggxDipoleKernel:CMWScheme Factor
+set FFMdx2dgxDipoleKernel:CMWScheme Factor
+set FFMux2ugxDipoleKernel:CMWScheme Factor
+set FFMcx2cgxDipoleKernel:CMWScheme Factor
+set FFMsx2sgxDipoleKernel:CMWScheme Factor
+set FFMbx2bgxDipoleKernel:CMWScheme Factor
+set FFMtx2tgxDipoleKernel:CMWScheme Factor
+set FFMgx2ddxDipoleKernel:CMWScheme Factor
+set FFMgx2uuxDipoleKernel:CMWScheme Factor
+set FFMgx2ccxDipoleKernel:CMWScheme Factor
+set FFMgx2ssxDipoleKernel:CMWScheme Factor
+set FFMgx2bbxDipoleKernel:CMWScheme Factor
+set FIgx2ggxDipoleKernel:CMWScheme Factor
+set FIqx2qgxDipoleKernel:CMWScheme Factor
+set FIgx2ddxDipoleKernel:CMWScheme Factor
+set FIgx2uuxDipoleKernel:CMWScheme Factor
+set FIgx2ccxDipoleKernel:CMWScheme Factor
+set FIgx2ssxDipoleKernel:CMWScheme Factor
+set FIgx2bbxDipoleKernel:CMWScheme Factor
+set FIMdx2dgxDipoleKernel:CMWScheme Factor
+set FIMux2ugxDipoleKernel:CMWScheme Factor
+set FIMcx2cgxDipoleKernel:CMWScheme Factor
+set FIMsx2sgxDipoleKernel:CMWScheme Factor
+set FIMbx2bgxDipoleKernel:CMWScheme Factor
+set FIMtx2tgxDipoleKernel:CMWScheme Factor
+set FIMgx2ddxDipoleKernel:CMWScheme Factor
+set FIMgx2uuxDipoleKernel:CMWScheme Factor
+set FIMgx2ccxDipoleKernel:CMWScheme Factor
+set FIMgx2ssxDipoleKernel:CMWScheme Factor
+set FIMgx2bbxDipoleKernel:CMWScheme Factor
+#set FIMgx2ttxDipoleKernel:CMWScheme Factor
+set IFgx2ggxDipoleKernel:CMWScheme Factor
+set IFqx2qgxDipoleKernel:CMWScheme Factor
+set IFqx2gqxDipoleKernel:CMWScheme Factor
+set IFgx2ddbarxDipoleKernel:CMWScheme Factor
+set IFgx2dbardxDipoleKernel:CMWScheme Factor
+set IFgx2uubarxDipoleKernel:CMWScheme Factor
+set IFgx2ubaruxDipoleKernel:CMWScheme Factor
+set IFgx2ccbarxDipoleKernel:CMWScheme Factor
+set IFgx2cbarcxDipoleKernel:CMWScheme Factor
+set IFgx2ssbarxDipoleKernel:CMWScheme Factor
+set IFgx2sbarsxDipoleKernel:CMWScheme Factor
+set IFMgx2ggxDipoleKernel:CMWScheme Factor
+set IFMqx2qgxDipoleKernel:CMWScheme Factor
+set IFMqx2gqxDipoleKernel:CMWScheme Factor
+set IFMgx2ddbarxDipoleKernel:CMWScheme Factor
+set IFMgx2dbardxDipoleKernel:CMWScheme Factor
+set IFMgx2uubarxDipoleKernel:CMWScheme Factor
+set IFMgx2ubaruxDipoleKernel:CMWScheme Factor
+set IFMgx2ccbarxDipoleKernel:CMWScheme Factor
+set IFMgx2cbarcxDipoleKernel:CMWScheme Factor
+set IFMgx2ssbarxDipoleKernel:CMWScheme Factor
+set IFMgx2sbarsxDipoleKernel:CMWScheme Factor
+set IIgx2ggxDipoleKernel:CMWScheme Factor
+set IIqx2qgxDipoleKernel:CMWScheme Factor
+set IIqx2gqxDipoleKernel:CMWScheme Factor
+set IIgx2ddbarxDipoleKernel:CMWScheme Factor
+set IIgx2dbardxDipoleKernel:CMWScheme Factor
+set IIgx2uubarxDipoleKernel:CMWScheme Factor
+set IIgx2ubaruxDipoleKernel:CMWScheme Factor
+set IIgx2ccbarxDipoleKernel:CMWScheme Factor
+set IIgx2cbarcxDipoleKernel:CMWScheme Factor
+set IIgx2ssbarxDipoleKernel:CMWScheme Factor
+set IIgx2sbarsxDipoleKernel:CMWScheme Factor
diff --git a/src/Matchbox/LEP91-Analysis.in b/src/Merging/LEP91-Analysis.in
rename from src/Matchbox/LEP91-Analysis.in
rename to src/Merging/LEP91-Analysis.in
diff --git a/src/Matchbox/LHC7-J-Analysis.in b/src/Merging/LHC7-J-Analysis.in
rename from src/Matchbox/LHC7-J-Analysis.in
rename to src/Merging/LHC7-J-Analysis.in
diff --git a/src/Matchbox/LHC7-T-Analysis.in b/src/Merging/LHC7-T-Analysis.in
rename from src/Matchbox/LHC7-T-Analysis.in
rename to src/Merging/LHC7-T-Analysis.in
diff --git a/src/Matchbox/LHC7-W-Analysis.in b/src/Merging/LHC7-W-Analysis.in
rename from src/Matchbox/LHC7-W-Analysis.in
rename to src/Merging/LHC7-W-Analysis.in
diff --git a/src/Matchbox/LHC7-Z-Analysis.in b/src/Merging/LHC7-Z-Analysis.in
rename from src/Matchbox/LHC7-Z-Analysis.in
rename to src/Merging/LHC7-Z-Analysis.in
diff --git a/src/Merging/LinearCMWScheme.in b/src/Merging/LinearCMWScheme.in
new file mode 100644
--- /dev/null
+++ b/src/Merging/LinearCMWScheme.in
@@ -0,0 +1,87 @@
+#######
+# CMW scheme
+#######
+cd /Herwig/Merging
+set Merger:CMWScheme Linear
+
+
+cd /Herwig/DipoleShower/Kernels
+set FFgx2ggxDipoleKernel:CMWScheme Linear
+set FFqx2qgxDipoleKernel:CMWScheme Linear
+set FFgx2ddxDipoleKernel:CMWScheme Linear
+set FFgx2uuxDipoleKernel:CMWScheme Linear
+set FFgx2ccxDipoleKernel:CMWScheme Linear
+set FFgx2ssxDipoleKernel:CMWScheme Linear
+set FFgx2bbxDipoleKernel:CMWScheme Linear
+set FFMgx2ggxDipoleKernel:CMWScheme Linear
+set FFMdx2dgxDipoleKernel:CMWScheme Linear
+set FFMux2ugxDipoleKernel:CMWScheme Linear
+set FFMcx2cgxDipoleKernel:CMWScheme Linear
+set FFMsx2sgxDipoleKernel:CMWScheme Linear
+set FFMbx2bgxDipoleKernel:CMWScheme Linear
+set FFMtx2tgxDipoleKernel:CMWScheme Linear
+set FFMgx2ddxDipoleKernel:CMWScheme Linear
+set FFMgx2uuxDipoleKernel:CMWScheme Linear
+set FFMgx2ccxDipoleKernel:CMWScheme Linear
+set FFMgx2ssxDipoleKernel:CMWScheme Linear
+set FFMgx2bbxDipoleKernel:CMWScheme Linear
+set FIgx2ggxDipoleKernel:CMWScheme Linear
+set FIqx2qgxDipoleKernel:CMWScheme Linear
+set FIgx2ddxDipoleKernel:CMWScheme Linear
+set FIgx2uuxDipoleKernel:CMWScheme Linear
+set FIgx2ccxDipoleKernel:CMWScheme Linear
+set FIgx2ssxDipoleKernel:CMWScheme Linear
+set FIgx2bbxDipoleKernel:CMWScheme Linear
+set FIMdx2dgxDipoleKernel:CMWScheme Linear
+set FIMux2ugxDipoleKernel:CMWScheme Linear
+set FIMcx2cgxDipoleKernel:CMWScheme Linear
+set FIMsx2sgxDipoleKernel:CMWScheme Linear
+set FIMbx2bgxDipoleKernel:CMWScheme Linear
+set FIMtx2tgxDipoleKernel:CMWScheme Linear
+set FIMgx2ddxDipoleKernel:CMWScheme Linear
+set FIMgx2uuxDipoleKernel:CMWScheme Linear
+set FIMgx2ccxDipoleKernel:CMWScheme Linear
+set FIMgx2ssxDipoleKernel:CMWScheme Linear
+set FIMgx2bbxDipoleKernel:CMWScheme Linear
+#set FIMgx2ttxDipoleKernel:CMWScheme Linear
+set IFgx2ggxDipoleKernel:CMWScheme Linear
+set IFqx2qgxDipoleKernel:CMWScheme Linear
+set IFqx2gqxDipoleKernel:CMWScheme Linear
+set IFgx2ddbarxDipoleKernel:CMWScheme Linear
+set IFgx2dbardxDipoleKernel:CMWScheme Linear
+set IFgx2uubarxDipoleKernel:CMWScheme Linear
+set IFgx2ubaruxDipoleKernel:CMWScheme Linear
+set IFgx2ccbarxDipoleKernel:CMWScheme Linear
+set IFgx2cbarcxDipoleKernel:CMWScheme Linear
+set IFgx2ssbarxDipoleKernel:CMWScheme Linear
+set IFgx2sbarsxDipoleKernel:CMWScheme Linear
+set IFMgx2ggxDipoleKernel:CMWScheme Linear
+set IFMqx2qgxDipoleKernel:CMWScheme Linear
+set IFMqx2gqxDipoleKernel:CMWScheme Linear
+set IFMgx2ddbarxDipoleKernel:CMWScheme Linear
+set IFMgx2dbardxDipoleKernel:CMWScheme Linear
+set IFMgx2uubarxDipoleKernel:CMWScheme Linear
+set IFMgx2ubaruxDipoleKernel:CMWScheme Linear
+set IFMgx2ccbarxDipoleKernel:CMWScheme Linear
+set IFMgx2cbarcxDipoleKernel:CMWScheme Linear
+set IFMgx2ssbarxDipoleKernel:CMWScheme Linear
+set IFMgx2sbarsxDipoleKernel:CMWScheme Linear
+set IIgx2ggxDipoleKernel:CMWScheme Linear
+set IIqx2qgxDipoleKernel:CMWScheme Linear
+set IIqx2gqxDipoleKernel:CMWScheme Linear
+set IIgx2ddbarxDipoleKernel:CMWScheme Linear
+set IIgx2dbardxDipoleKernel:CMWScheme Linear
+set IIgx2uubarxDipoleKernel:CMWScheme Linear
+set IIgx2ubaruxDipoleKernel:CMWScheme Linear
+set IIgx2ccbarxDipoleKernel:CMWScheme Linear
+set IIgx2cbarcxDipoleKernel:CMWScheme Linear
+set IIgx2ssbarxDipoleKernel:CMWScheme Linear
+set IIgx2sbarsxDipoleKernel:CMWScheme Linear
+
+## bs from five flavournobmass scheme
+set IFgx2bbbarxDipoleKernel:CMWScheme Linear
+set IFgx2bbarbxDipoleKernel:CMWScheme Linear
+set IFMgx2bbbarxDipoleKernel:CMWScheme Linear
+set IFMgx2bbarbxDipoleKernel:CMWScheme Linear
+set IIgx2bbbarxDipoleKernel:CMWScheme Linear
+set IIgx2bbarbxDipoleKernel:CMWScheme Linear
diff --git a/src/Merging/LinearCMWScheme_4fl.in b/src/Merging/LinearCMWScheme_4fl.in
new file mode 100644
--- /dev/null
+++ b/src/Merging/LinearCMWScheme_4fl.in
@@ -0,0 +1,79 @@
+#######
+# CMW scheme
+#######
+cd /Herwig/Merging
+set Merger:CMWScheme Linear
+
+
+cd /Herwig/DipoleShower/Kernels
+set FFgx2ggxDipoleKernel:CMWScheme Linear
+set FFqx2qgxDipoleKernel:CMWScheme Linear
+set FFgx2ddxDipoleKernel:CMWScheme Linear
+set FFgx2uuxDipoleKernel:CMWScheme Linear
+set FFgx2ccxDipoleKernel:CMWScheme Linear
+set FFgx2ssxDipoleKernel:CMWScheme Linear
+set FFgx2bbxDipoleKernel:CMWScheme Linear
+set FFMgx2ggxDipoleKernel:CMWScheme Linear
+set FFMdx2dgxDipoleKernel:CMWScheme Linear
+set FFMux2ugxDipoleKernel:CMWScheme Linear
+set FFMcx2cgxDipoleKernel:CMWScheme Linear
+set FFMsx2sgxDipoleKernel:CMWScheme Linear
+set FFMbx2bgxDipoleKernel:CMWScheme Linear
+set FFMtx2tgxDipoleKernel:CMWScheme Linear
+set FFMgx2ddxDipoleKernel:CMWScheme Linear
+set FFMgx2uuxDipoleKernel:CMWScheme Linear
+set FFMgx2ccxDipoleKernel:CMWScheme Linear
+set FFMgx2ssxDipoleKernel:CMWScheme Linear
+set FFMgx2bbxDipoleKernel:CMWScheme Linear
+set FIgx2ggxDipoleKernel:CMWScheme Linear
+set FIqx2qgxDipoleKernel:CMWScheme Linear
+set FIgx2ddxDipoleKernel:CMWScheme Linear
+set FIgx2uuxDipoleKernel:CMWScheme Linear
+set FIgx2ccxDipoleKernel:CMWScheme Linear
+set FIgx2ssxDipoleKernel:CMWScheme Linear
+set FIgx2bbxDipoleKernel:CMWScheme Linear
+set FIMdx2dgxDipoleKernel:CMWScheme Linear
+set FIMux2ugxDipoleKernel:CMWScheme Linear
+set FIMcx2cgxDipoleKernel:CMWScheme Linear
+set FIMsx2sgxDipoleKernel:CMWScheme Linear
+set FIMbx2bgxDipoleKernel:CMWScheme Linear
+set FIMtx2tgxDipoleKernel:CMWScheme Linear
+set FIMgx2ddxDipoleKernel:CMWScheme Linear
+set FIMgx2uuxDipoleKernel:CMWScheme Linear
+set FIMgx2ccxDipoleKernel:CMWScheme Linear
+set FIMgx2ssxDipoleKernel:CMWScheme Linear
+set FIMgx2bbxDipoleKernel:CMWScheme Linear
+#set FIMgx2ttxDipoleKernel:CMWScheme Linear
+set IFgx2ggxDipoleKernel:CMWScheme Linear
+set IFqx2qgxDipoleKernel:CMWScheme Linear
+set IFqx2gqxDipoleKernel:CMWScheme Linear
+set IFgx2ddbarxDipoleKernel:CMWScheme Linear
+set IFgx2dbardxDipoleKernel:CMWScheme Linear
+set IFgx2uubarxDipoleKernel:CMWScheme Linear
+set IFgx2ubaruxDipoleKernel:CMWScheme Linear
+set IFgx2ccbarxDipoleKernel:CMWScheme Linear
+set IFgx2cbarcxDipoleKernel:CMWScheme Linear
+set IFgx2ssbarxDipoleKernel:CMWScheme Linear
+set IFgx2sbarsxDipoleKernel:CMWScheme Linear
+set IFMgx2ggxDipoleKernel:CMWScheme Linear
+set IFMqx2qgxDipoleKernel:CMWScheme Linear
+set IFMqx2gqxDipoleKernel:CMWScheme Linear
+set IFMgx2ddbarxDipoleKernel:CMWScheme Linear
+set IFMgx2dbardxDipoleKernel:CMWScheme Linear
+set IFMgx2uubarxDipoleKernel:CMWScheme Linear
+set IFMgx2ubaruxDipoleKernel:CMWScheme Linear
+set IFMgx2ccbarxDipoleKernel:CMWScheme Linear
+set IFMgx2cbarcxDipoleKernel:CMWScheme Linear
+set IFMgx2ssbarxDipoleKernel:CMWScheme Linear
+set IFMgx2sbarsxDipoleKernel:CMWScheme Linear
+set IIgx2ggxDipoleKernel:CMWScheme Linear
+set IIqx2qgxDipoleKernel:CMWScheme Linear
+set IIqx2gqxDipoleKernel:CMWScheme Linear
+set IIgx2ddbarxDipoleKernel:CMWScheme Linear
+set IIgx2dbardxDipoleKernel:CMWScheme Linear
+set IIgx2uubarxDipoleKernel:CMWScheme Linear
+set IIgx2ubaruxDipoleKernel:CMWScheme Linear
+set IIgx2ccbarxDipoleKernel:CMWScheme Linear
+set IIgx2cbarcxDipoleKernel:CMWScheme Linear
+set IIgx2ssbarxDipoleKernel:CMWScheme Linear
+set IIgx2sbarsxDipoleKernel:CMWScheme Linear
diff --git a/src/Merging/Makefile.am b/src/Merging/Makefile.am
--- a/src/Merging/Makefile.am
+++ b/src/Merging/Makefile.am
@@ -1,59 +1,69 @@
BUILT_SOURCES = done-all-links
Matchboxdir = ${pkgdatadir}/Merging
INPUTFILES = \
+Merging.in \
+LEP91-Analysis.in \
+LHC7-Z-Analysis.in \
+LHC7-W-Analysis.in \
+LHC7-J-Analysis.in \
+LHC7-T-Analysis.in \
+FactorCMWScheme.in \
+LinearCMWScheme.in \
+FactorCMWScheme_4fl.in \
+LinearCMWScheme_4fl.in \
1LO-0NLO-LEP.in \
1LO-0NLO-LEP_Qt.in \
1LO-0NLO-LEP_Matchbox.in \
1LO-0NLO-LEP_FixedOrder.in \
1LO-0NLO-LHC-W.in \
1LO-0NLO-LHC-Z.in \
2LO-0NLO-LEP.in \
2LO-0NLO-LHC-W.in \
2LO-0NLO-LHC-Z.in \
2LO-1NLO-LEP.in \
2LO-1NLO-LEP_Matchbox.in \
2LO-1NLO-LHC-Z.in \
2LO-1NLO-LHC-W.in \
3LO-0NLO-LEP.in \
3LO-0NLO-LEP_only0.in \
3LO-0NLO-LEP_only1.in \
3LO-0NLO-LEP_only2.in \
3LO-0NLO-LHC-W.in \
3LO-0NLO-LHC-Z.in \
3LO-1NLO-LEP.in \
3LO-1NLO-LHC-Z.in \
3LO-1NLO-LHC-W.in \
3LO-2NLO-LEP.in \
3LO-2NLO-LEP_light.in \
3LO-2NLO-LHC-Z.in \
3LO-2NLO-LHC-W.in \
4LO-0NLO-LHC-Z.in \
1LO-0NLO-LHC-Z_OISZ.in \
2LO-0NLO-LHC-Z_OISZ.in \
3LO-0NLO-LHC-Z_OISZ.in \
1LO-0NLO-LHC-J.in \
1LO-0NLO-LHC-T.in \
1LO-0NLO-LHC-T_QtDecay.in \
1LO-0NLO-LHC-J_OISZ.in \
2LO-0NLO-LHC-J.in \
2LO-0NLO-LHC-J_only0.in \
2LO-0NLO-LHC-J_only1.in \
2LO-0NLO-LHC-T.in \
2LO-0NLO-LHC-T_QtDecay.in \
3LO-0NLO-LHC-T.in \
2LO-0NLO-LHC-J_OISZ.in
#2LO-0NLO-LHC-J_OISZIC.in
dist_Matchbox_DATA = $(INPUTFILES)
CLEANFILES = done-all-links
done-all-links: $(INPUTFILES)
@echo "Linking input files"
@for i in $(INPUTFILES); do \
if test -f $(srcdir)/$$i -a ! -e $$i; then \
$(LN_S) -f $(srcdir)/$$i; fi; done
@touch done-all-links
diff --git a/src/Matchbox/Merging.in b/src/Merging/Merging.in
rename from src/Matchbox/Merging.in
rename to src/Merging/Merging.in
--- a/src/Matchbox/Merging.in
+++ b/src/Merging/Merging.in
@@ -1,234 +1,150 @@
cd /Herwig/Merging
clear /Herwig/EventHandlers/EventHandler:SubProcessHandlers
insert /Herwig/EventHandlers/EventHandler:SubProcessHandlers[0] MergingFactory
set /Herwig/Cuts/MatchboxJetMatcher:Factory MergingFactory
set /Herwig/MatrixElements/Matchbox/MECorrectionHandler:Factory MergingFactory
set MergingFactory:Cuts /Herwig/Cuts/Cuts
set Merger:MergingFactory MergingFactory
set Merger:DipoleShowerHandler /Herwig/DipoleShower/DipoleShowerHandler
set /Herwig/DipoleShower/DipoleShowerHandler:MergingHelper Merger
set Merger:MergingJetFinder /Herwig/Cuts/JetFinder
set MergingFactory:MergingHelper Merger
+### Dont apply restrictions on the z-boundaries while clustering.
+set /Herwig/Merging/Merger:OpenInitialStateZ Yes
+
+
cd /Herwig/Analysis
create ThePEG::RivetAnalysis Rivet RivetAnalysis.so
-
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/Couplings/NLOAlphaS:min_active_flavours 3
set /Herwig/Couplings/NLOAlphaS:max_active_flavours 5
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
set /Herwig/Couplings/NLOAlphaS:input_scale 91.18*GeV
set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/NLOAlphaS
set /Herwig/DipoleShower/DipoleShowerHandler:GlobalAlphaS /Herwig/Couplings/NLOAlphaS
cd /Herwig/Generators
set EventGenerator:EventHandler:CascadeHandler /Herwig/DipoleShower/DipoleShowerHandler
set /Herwig/DipoleShower/DipoleShowerHandler:MaxPtIsMuF Yes
create Herwig::MonacoSampler /Herwig/Samplers/Monaco
set /Herwig/Samplers/Sampler:BinSampler /Herwig/Samplers/Monaco
cd /Herwig/Particles
do c:UnsetHardProcessMass
do cbar:UnsetHardProcessMass
#do b:UnsetHardProcessMass
#do bbar:UnsetHardProcessMass
set c:NominalMass 0*GeV
set cbar:NominalMass 0*GeV
##################################################
## intrinsic pt
##################################################
set /Herwig/DipoleShower/IntrinsicPtGenerator:ValenceIntrinsicPtScale 2.0*GeV
set /Herwig/DipoleShower/IntrinsicPtGenerator:SeaIntrinsicPtScale 2.0*GeV
##################################################
## Dipole shower tune settings
##################################################
set /Herwig/Particles/g:ConstituentMass 0.7899848*GeV
##################################################
## cutoffs
##################################################
set /Herwig/DipoleShower/Kinematics/FFLightKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/FFMassiveKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/FILightKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/FIMassiveKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/IFLightKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/IFMassiveKinematics:IRCutoff 0.45*GeV
set /Herwig/DipoleShower/Kinematics/IILightKinematics:IRCutoff 0.45*GeV
## needs to be synchronized with settings above
set /Herwig/MatrixElements/Matchbox/DipoleMatching:FFPtCut 0.45*GeV
set /Herwig/MatrixElements/Matchbox/DipoleMatching:FIPtCut 0.45*GeV
set /Herwig/MatrixElements/Matchbox/DipoleMatching:IIPtCut 0.45*GeV
##################################################
## hadronization parameters -- complete?
##################################################
cd /Herwig/Hadronization
set ClusterFissioner:ClMaxLight 3.30
set ClusterFissioner:ClPowLight 2.50
set ClusterFissioner:PSplitLight 1.29
set ClusterDecayer:ClDirLight 1
set ClusterDecayer:ClSmrLight 3.118342
set ClusterFissioner:ClMaxCharm 3.11*GeV
set ClusterFissioner:ClPowCharm 1.62
set ClusterFissioner:PSplitCharm 2.54
set ClusterDecayer:ClDirCharm 1
set ClusterDecayer:ClSmrCharm 0.
set HadronSelector:SingleHadronLimitCharm 0.0
set ClusterFissioner:ClMaxBottom 1.38*GeV
set ClusterFissioner:ClPowBottom 0.62
set ClusterFissioner:PSplitBottom 0.20
set ClusterDecayer:ClDirBottom 1
set ClusterDecayer:ClSmrBottom 0.
set HadronSelector:SingleHadronLimitBottom 0.12
set HadronSelector:PwtUquark 1.0
set HadronSelector:PwtDquark 1.0
set HadronSelector:PwtSquark 1.09
set HadronSelector:PwtCquark 1.0
set HadronSelector:PwtBquark 1.0
set HadronSelector:PwtDIquark 0.66
set HadronSelector:SngWt 1.0
set HadronSelector:DecWt 1.0
-cd /
-
-
-
-
-
-
-
-
-
-
cd /Herwig/Samplers
set Monaco:EnhancementFactor 1.2
set Monaco:InitialPoints 5000
set Monaco:LuminosityMapperBins 8
set Monaco:NIterations 4
set Monaco:RemapChannelDimension Yes
set Monaco:RemapperMinSelection 0.0001
set Monaco:RemapperPoints 10000
set Monaco:UseAllIterations No
set Sampler:UpdateAfter 1000
set Sampler:AddUpSamplers Off
set Sampler:GlobalMaximumWeight Off
set Sampler:FlatSubprocesses Off
set Sampler:MinSelection 0.000001
set Sampler:AlmostUnweighted On
set Sampler:BinSampler:Kappa 1.
set Sampler:RunCombinationData Off
set Sampler:Verbose On
-#######
-# CMW scheme
-#######
-
-cd /Herwig/DipoleShower/Kernels
-set FFgx2ggxDipoleKernel:CMWScheme On
-set FFqx2qgxDipoleKernel:CMWScheme On
-set FFgx2ddxDipoleKernel:CMWScheme On
-set FFgx2uuxDipoleKernel:CMWScheme On
-set FFgx2ccxDipoleKernel:CMWScheme On
-set FFgx2ssxDipoleKernel:CMWScheme On
-set FFgx2bbxDipoleKernel:CMWScheme On
-set FFMgx2ggxDipoleKernel:CMWScheme On
-set FFMdx2dgxDipoleKernel:CMWScheme On
-set FFMux2ugxDipoleKernel:CMWScheme On
-set FFMcx2cgxDipoleKernel:CMWScheme On
-set FFMsx2sgxDipoleKernel:CMWScheme On
-set FFMbx2bgxDipoleKernel:CMWScheme On
-set FFMtx2tgxDipoleKernel:CMWScheme On
-set FFMgx2ddxDipoleKernel:CMWScheme On
-set FFMgx2uuxDipoleKernel:CMWScheme On
-set FFMgx2ccxDipoleKernel:CMWScheme On
-set FFMgx2ssxDipoleKernel:CMWScheme On
-set FFMgx2bbxDipoleKernel:CMWScheme On
-set FIgx2ggxDipoleKernel:CMWScheme On
-set FIqx2qgxDipoleKernel:CMWScheme On
-set FIgx2ddxDipoleKernel:CMWScheme On
-set FIgx2uuxDipoleKernel:CMWScheme On
-set FIgx2ccxDipoleKernel:CMWScheme On
-set FIgx2ssxDipoleKernel:CMWScheme On
-set FIgx2bbxDipoleKernel:CMWScheme On
-set FIMdx2dgxDipoleKernel:CMWScheme On
-set FIMux2ugxDipoleKernel:CMWScheme On
-set FIMcx2cgxDipoleKernel:CMWScheme On
-set FIMsx2sgxDipoleKernel:CMWScheme On
-set FIMbx2bgxDipoleKernel:CMWScheme On
-set FIMtx2tgxDipoleKernel:CMWScheme On
-set FIMgx2ddxDipoleKernel:CMWScheme On
-set FIMgx2uuxDipoleKernel:CMWScheme On
-set FIMgx2ccxDipoleKernel:CMWScheme On
-set FIMgx2ssxDipoleKernel:CMWScheme On
-set FIMgx2bbxDipoleKernel:CMWScheme On
-#set FIMgx2ttxDipoleKernel:CMWScheme On
-set IFgx2ggxDipoleKernel:CMWScheme On
-set IFqx2qgxDipoleKernel:CMWScheme On
-set IFqx2gqxDipoleKernel:CMWScheme On
-set IFgx2ddbarxDipoleKernel:CMWScheme On
-set IFgx2dbardxDipoleKernel:CMWScheme On
-set IFgx2uubarxDipoleKernel:CMWScheme On
-set IFgx2ubaruxDipoleKernel:CMWScheme On
-set IFgx2ccbarxDipoleKernel:CMWScheme On
-set IFgx2cbarcxDipoleKernel:CMWScheme On
-set IFgx2ssbarxDipoleKernel:CMWScheme On
-set IFgx2sbarsxDipoleKernel:CMWScheme On
-set IFMgx2ggxDipoleKernel:CMWScheme On
-set IFMqx2qgxDipoleKernel:CMWScheme On
-set IFMqx2gqxDipoleKernel:CMWScheme On
-set IFMgx2ddbarxDipoleKernel:CMWScheme On
-set IFMgx2dbardxDipoleKernel:CMWScheme On
-set IFMgx2uubarxDipoleKernel:CMWScheme On
-set IFMgx2ubaruxDipoleKernel:CMWScheme On
-set IFMgx2ccbarxDipoleKernel:CMWScheme On
-set IFMgx2cbarcxDipoleKernel:CMWScheme On
-set IFMgx2ssbarxDipoleKernel:CMWScheme On
-set IFMgx2sbarsxDipoleKernel:CMWScheme On
-set IIgx2ggxDipoleKernel:CMWScheme On
-set IIqx2qgxDipoleKernel:CMWScheme On
-set IIqx2gqxDipoleKernel:CMWScheme On
-set IIgx2ddbarxDipoleKernel:CMWScheme On
-set IIgx2dbardxDipoleKernel:CMWScheme On
-set IIgx2uubarxDipoleKernel:CMWScheme On
-set IIgx2ubaruxDipoleKernel:CMWScheme On
-set IIgx2ccbarxDipoleKernel:CMWScheme On
-set IIgx2cbarcxDipoleKernel:CMWScheme On
-set IIgx2ssbarxDipoleKernel:CMWScheme On
-set IIgx2sbarsxDipoleKernel:CMWScheme On

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 9:21 PM (1 d, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3799741
Default Alt Text
(369 KB)

Event Timeline