Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,63 +1,64 @@
\.svn/.*
.*/Makefile
.*/Makefile\.in
.*/\.deps
.*/\.libs
.*/.*\.l[ao]
.*/.*\.so\.*
.*/.*\.o
.*~
.*\.tar\.(gz|bz2)
autom4te.cache
config.herwig
config.log
config.status
configure
include/Herwig\+\+
Config/config.guess
Config/config.h
Config/config.h.in
Config/config.sub
Config/depcomp
Config/install-sh
Config/missing
Config/stamp-h1
Config/ar-lib
Contrib/make_makefiles.sh
Doc/HerwigDefaults.in
Doc/fixinterfaces.pl
Doc/refman.conf
Doc/refman.h
Doc/AllInterfaces.h
Doc/HerwigDefaults.rpo
Doc/Herwig\+\+-refman.tag
(src|Utilities)/version.tmp
(src|Utilities)/version.tmp.new
INSTALL
Makefile
Makefile.in
Utilities/versionstring.h
aclocal.m4
confdefs.h
conftest.c
conftest.err
include/done-all-links
libtool
src/herwigopts.h
src/herwigopts.c
src/defaults/Analysis.in
src/herwig-config
src/.*\.(run|tex|out|log|rpo|spc|top|dump|dot|aux|pdf|ps|png|svg|hepmc)
lib/done-all-links
src/Herwig\+\+
src/defaults/PDF.in
src/defaults/done-all-links
src/versionstring.h
src/tune
src/tests/.*\.(time|mult|Bmult|chisq)
Tests/.*/.*\.(top|ps|pyc|info|dat|pdf|png)
+Tests/.*\.(top|ps|pyc|info|dat|pdf|png)
Tests/.*\.(top|run|tex|mult|Bmult|aida|yoda)
Tests/Rivet-.*
Tests/plots
Tests/.*index.html
Herwig\+\+\-.\..\..
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -1,10 +1,11 @@
168ae2110e964d62fbc1331a1c2e095952a67748 release-2-5-2
3abb4fa42e20e332796c2572334c2d77204cd0e0 release-2-4-2
4796ca080aafd5daa3b7349b015cb1df944428a2 release-2-5-0
76da042f056eb153981b4d005d5474ffb90a5e88 release-2-4-1
81a684a558413c69df314365eabf09893ffd43d8 release-2-6-0
bd75cd00d99f4bdbaed992daf98f0a73c0f91e9b release-2-4-0
ff6ecc8d49ce10299303b050394bd5cb5837f1c3 release-2-5-1
d0389f5453b2c210923e1adc7b872b18269de668 release-2-6-1
f8998033021185942533b824607285feb3fbd2dc release-2-6-1a
cead23e428b9aacaf2d709e722624e54f844498b release-2-6-1b
+191db4655439045f912cb21bd905e729d59ec7bc release-2-6-2
diff --git a/Decay/FormFactors/Makefile.am b/Decay/FormFactors/Makefile.am
--- a/Decay/FormFactors/Makefile.am
+++ b/Decay/FormFactors/Makefile.am
@@ -1,31 +1,31 @@
noinst_LTLIBRARIES = libHwFormFactor.la
pkglib_LTLIBRARIES = HwFormFactors.la
libHwFormFactor_la_SOURCES = \
BaryonFormFactor.cc BaryonFormFactor.fh \
BaryonFormFactor.h \
ScalarFormFactor.cc ScalarFormFactor.fh \
ScalarFormFactor.h \
BtoSGammaHadronicMass.h \
BtoSGammaHadronicMass.cc BtoSGammaHadronicMass.fh
-HwFormFactors_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 7:0:0
+HwFormFactors_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 8:0:0
HwFormFactors_la_SOURCES = \
BallZwickyScalarFormFactor.cc BallZwickyScalarFormFactor.h \
BallZwickyVectorFormFactor.cc BallZwickyVectorFormFactor.h \
BaryonSimpleFormFactor.cc BaryonSimpleFormFactor.h \
BaryonThreeQuarkModelFormFactor.cc BaryonThreeQuarkModelFormFactor.h \
ChengHeavyBaryonFormFactor.cc ChengHeavyBaryonFormFactor.h \
ISGW2FormFactor.cc ISGW2FormFactor.h \
ISGWFormFactor.cc ISGWFormFactor.h \
LambdabExcitedLambdacSumRuleFormFactor.cc \
LambdabExcitedLambdacSumRuleFormFactor.h \
LightBaryonQuarkModelFormFactor.cc LightBaryonQuarkModelFormFactor.h \
SingletonFormFactor.cc SingletonFormFactor.h\
WSBFormFactor.cc WSBFormFactor.h\
KiselevBcFormFactor.cc KiselevBcFormFactor.h\
MelikhovFormFactor.cc MelikhovFormFactor.h \
MelikhovStechFormFactor.cc MelikhovStechFormFactor.h \
BtoSGammaFlatEnergy.h BtoSGammaFlatEnergy.cc \
BtoSGammaKagan.h BtoSGammaKagan.cc\
HQETFormFactor.h HQETFormFactor.cc
diff --git a/Decay/Makefile.am b/Decay/Makefile.am
--- a/Decay/Makefile.am
+++ b/Decay/Makefile.am
@@ -1,24 +1,24 @@
SUBDIRS = FormFactors Tau Baryon VectorMeson Perturbative \
WeakCurrents ScalarMeson TensorMeson Partonic General Radiation
noinst_LTLIBRARIES = libHwDecay.la
pkglib_LTLIBRARIES = Hw64Decay.la HwMamboDecay.la
Hw64Decay_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 7:0:0
Hw64Decay_la_SOURCES = Hw64Decayer.h Hw64Decayer.cc
-HwMamboDecay_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 7:2:0
+HwMamboDecay_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 8:0:0
HwMamboDecay_la_SOURCES = MamboDecayer.h MamboDecayer.cc
libHwDecay_la_LIBADD = $(top_builddir)/PDT/libHwPDT.la
libHwDecay_la_SOURCES = \
DecayIntegrator.cc DecayIntegrator.fh DecayIntegrator.h \
DecayPhaseSpaceChannel.cc DecayPhaseSpaceChannel.fh \
DecayPhaseSpaceChannel.h \
DecayPhaseSpaceMode.cc DecayPhaseSpaceMode.fh \
DecayPhaseSpaceMode.h \
HwDecayerBase.cc HwDecayerBase.fh HwDecayerBase.h \
HwDecayHandler.cc HwDecayHandler.h\
DecayVertex.fh DecayVertex.h DecayVertex.cc \
DecayMatrixElement.h DecayMatrixElement.cc \
BranchingRatioReweighter.h BranchingRatioReweighter.cc
diff --git a/Decay/Radiation/Makefile.am b/Decay/Radiation/Makefile.am
--- a/Decay/Radiation/Makefile.am
+++ b/Decay/Radiation/Makefile.am
@@ -1,15 +1,15 @@
noinst_LTLIBRARIES = libHwDecRad.la
pkglib_LTLIBRARIES = HwSOPHTY.la
libHwDecRad_la_SOURCES = \
DecayRadiationGenerator.cc DecayRadiationGenerator.h \
DecayRadiationGenerator.fh \
QEDRadiationHandler.cc QEDRadiationHandler.fh\
QEDRadiationHandler.h
HwSOPHTY_la_SOURCES = \
SOPHTY.h SOPHTY.cc \
FFDipole.cc FFDipole.fh FFDipole.h \
IFDipole.cc IFDipole.fh IFDipole.h \
YFSFormFactors.cc YFSFormFactors.h
-HwSOPHTY_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 2:0:0
+HwSOPHTY_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 2:1:0
diff --git a/Decay/ScalarMeson/Makefile.am b/Decay/ScalarMeson/Makefile.am
--- a/Decay/ScalarMeson/Makefile.am
+++ b/Decay/ScalarMeson/Makefile.am
@@ -1,20 +1,20 @@
pkglib_LTLIBRARIES = HwSMDecay.la
HwSMDecay_la_SOURCES = \
EtaPiGammaGammaDecayer.cc EtaPiGammaGammaDecayer.h\
EtaPiPiGammaDecayer.cc EtaPiPiGammaDecayer.h \
EtaPiPiPiDecayer.cc EtaPiPiPiDecayer.h \
PScalar4FermionsDecayer.cc PScalar4FermionsDecayer.h\
PScalarLeptonNeutrinoDecayer.cc PScalarLeptonNeutrinoDecayer.h\
PScalarPScalarVectorDecayer.cc PScalarPScalarVectorDecayer.h \
PScalarVectorFermionsDecayer.cc PScalarVectorFermionsDecayer.h\
PScalarVectorVectorDecayer.cc PScalarVectorVectorDecayer.h\
ScalarMesonTensorScalarDecayer.cc ScalarMesonTensorScalarDecayer.h\
ScalarScalarScalarDecayer.cc ScalarScalarScalarDecayer.h \
SemiLeptonicScalarDecayer.cc SemiLeptonicScalarDecayer.h \
ScalarMesonFactorizedDecayer.cc ScalarMesonFactorizedDecayer.h \
ScalarVectorVectorDecayer.h ScalarVectorVectorDecayer.cc \
DtoKPiPiCLEO.h DtoKPiPiCLEO.cc \
DtoKPiPiE691.h DtoKPiPiE691.cc\
DtoKPiPiMarkIII.h DtoKPiPiMarkIII.cc
-HwSMDecay_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 8:2:0
+HwSMDecay_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 9:0:0
diff --git a/Decay/WeakCurrents/Makefile.am b/Decay/WeakCurrents/Makefile.am
--- a/Decay/WeakCurrents/Makefile.am
+++ b/Decay/WeakCurrents/Makefile.am
@@ -1,20 +1,20 @@
pkglib_LTLIBRARIES = HwWeakCurrents.la
noinst_LTLIBRARIES = libHwWeakCurrent.la
libHwWeakCurrent_la_SOURCES = \
WeakDecayCurrent.cc WeakDecayCurrent.fh WeakDecayCurrent.h\
LeptonNeutrinoCurrent.cc LeptonNeutrinoCurrent.fh \
LeptonNeutrinoCurrent.h
-HwWeakCurrents_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 7:1:0
+HwWeakCurrents_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 8:0:0
HwWeakCurrents_la_SOURCES = \
FourPionNovosibirskCurrent.cc FourPionNovosibirskCurrent.h \
ScalarMesonCurrent.cc ScalarMesonCurrent.h\
ThreeMesonCurrentBase.cc ThreeMesonCurrentBase.h \
ThreeMesonDefaultCurrent.cc ThreeMesonDefaultCurrent.h\
ThreePionCLEOCurrent.cc ThreePionCLEOCurrent.h\
TwoMesonRhoKStarCurrent.cc TwoMesonRhoKStarCurrent.h\
TwoPionPhotonCurrent.cc TwoPionPhotonCurrent.h\
VectorMesonCurrent.cc VectorMesonCurrent.h\
FivePionCurrent.cc FivePionCurrent.h \
KPiCurrent.cc KPiCurrent.h\
KaonThreeMesonCurrent.cc KaonThreeMesonCurrent.h
diff --git a/MatrixElement/Matchbox/Base/SubtractedME.h b/MatrixElement/Matchbox/Base/SubtractedME.h
--- a/MatrixElement/Matchbox/Base/SubtractedME.h
+++ b/MatrixElement/Matchbox/Base/SubtractedME.h
@@ -1,539 +1,541 @@
// -*- C++ -*-
//
// SubtractedME.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_SubtractedME_H
#define HERWIG_SubtractedME_H
//
// This is the declaration of the SubtractedME class.
//
#include "ThePEG/MatrixElement/MEGroup.h"
#include "Herwig++/MatrixElement/Matchbox/Base/MatchboxMEBase.h"
#include "Herwig++/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief SubtractedME represents a subtracted real emission matrix element.
*
* @see \ref SubtractedMEInterfaces "The interfaces"
* defined for SubtractedME.
*/
class SubtractedME: public MEGroup {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
SubtractedME();
/**
* The destructor.
*/
virtual ~SubtractedME();
//@}
public:
/** @name Phasespace and subprocess information */
//@{
/**
* Set the XComb object to be used in the next call to
* generateKinematics() and dSigHatDR().
*/
virtual void setXComb(tStdXCombPtr);
/**
* Return true, if the same additional random numbers
* should be presented to any of the dependent
* matrix elements.
*/
virtual bool uniformAdditional() const { return true; }
/**
* Return true, if the XComb steering this matrix element
* should keep track of the random numbers used to generate
* the last phase space point
*/
virtual bool keepRandomNumbers() const { return true; }
/**
* Given a process from the head matrix element,
* return a list of diagrams which should be considered for
* the given dependent matrix element.
*/
virtual MEBase::DiagramVector dependentDiagrams(const cPDVector& proc,
tMEPtr depME) const;
/**
* Return true, if SubProcessGroups should be
* setup from this MEGroup. If not, a single SubProcess
* is constructed from the data provided by the
* head matrix element.
*/
- virtual bool subProcessGroups() const { return theSubProcessGroups; }
+ virtual bool subProcessGroups() const {
+ return theSubProcessGroups && !(showerApproximation() || inclusive());
+ }
/**
* Switch on or off producing subprocess groups.
*/
void setSubProcessGroups(bool on = true) { theSubProcessGroups = on; }
/**
* Return true, if one of the dependent subprocesses should be
* constructed in place of the one driven by the head matrix element
* or a full subprocess group.
*/
virtual bool selectDependentSubProcess() const { return theInclusive; }
/**
* Return true, if the integral over the unresolved emission should be
* calculated.
*/
bool inclusive() const { return theInclusive; }
/**
* Switch on or off inclusive mode.
*/
void setInclusive(bool on = true) { theInclusive = on; }
/**
* Fill the projectors object of xcombs to choose subprocesses
* different than the one currently integrated.
*/
virtual void fillProjectors();
/**
* Return true, if this MEGroup will reweight the contributing cross
* sections.
*/
virtual bool groupReweighted() const { return inclusive() || showerApproximation(); }
/**
* Reweight the head cross section
*/
virtual double reweightHead(const vector<tStdXCombPtr>&);
/**
* Reweight the dependent cross section
*/
virtual double reweightDependent(tStdXCombPtr, const vector<tStdXCombPtr>&);
/**
* Switch on or off that scales should be calculated from real emission kinematics
*/
void doRealEmissionScales();
//@}
/** @name Methods relevant to matching */
//@{
/**
* Inform this matrix element that a new phase space
* point is about to be generated, so all caches should
* be flushed.
*/
virtual void flushCaches() {
MEGroup::flushCaches();
if ( showerApproximation() )
showerApproximation()->resetBelowCutoff();
}
/**
* Set the shower approximation.
*/
void showerApproximation(Ptr<ShowerApproximation>::tptr);
/**
* Return the shower approximation.
*/
Ptr<ShowerApproximation>::tptr showerApproximation() const { return theShowerApproximation; }
/**
* Indicate that the shower real emission contribution should be subtracted.
*/
void doRealShowerSubtraction();
/**
* Return true, if the shower real emission contribution should be subtracted.
*/
bool realShowerSubtraction() const { return theRealShowerSubtraction; }
/**
* Indicate that the shower virtual contribution should be subtracted.
*/
void doVirtualShowerSubtraction();
/**
* Return true, if the shower virtual contribution should be subtracted.
*/
bool virtualShowerSubtraction() const { return theVirtualShowerSubtraction; }
//@}
/** @name Matrix element and dipole information */
//@{
/**
* Return the subtraction dipoles.
*/
vector<Ptr<SubtractionDipole>::ptr> dipoles();
/**
* Return the underlying born matrix elements.
*/
const vector<Ptr<MatchboxMEBase>::ptr>& borns() const { return theBorns; }
/**
* Access the underlying born matrix elements.
*/
vector<Ptr<MatchboxMEBase>::ptr>& borns() { return theBorns; }
/**
* Build up dipoles needed.
*/
void getDipoles();
/**
* Return all dipoles matching the given Born process
*/
vector<Ptr<SubtractionDipole>::ptr> splitDipoles(const cPDVector&);
/**
* Return the subtraction dipoles.
*/
const vector<Ptr<SubtractionDipole>::ptr>& allDipoles() const { return theDipoles; }
/**
* Access the subtraction dipoles.
*/
vector<Ptr<SubtractionDipole>::ptr>& allDipoles() { return theDipoles; }
//@}
/** @name Veto scale settings */
//@{
/**
* Set veto scales on the particles at the given
* SubProcess which has been generated using this
* matrix element.
*/
virtual void setVetoScales(tSubProPtr) const;
/**
* Return true, if veto scales should be set
* for the real emission
*/
bool vetoScales() const { return theVetoScales; }
/**
* Switch on setting veto scales
*/
void doVetoScales() { theVetoScales = true; }
/**
* Switch off setting veto scales
*/
void noVetoScales() { theVetoScales = true; }
//@}
/** @name Diagnostic information */
//@{
/**
* Dump the setup to an ostream
*/
void print(ostream&) const;
/**
* Collect information on the last evaluated phasespace
* point for verification or debugging purposes. This
* only called, if the StdXCombGroup did accumulate
* a non-zero cross section from this ME group.
*/
virtual void lastEventStatistics();
/**
* Print debug information on the last event
*/
void printLastEvent(ostream&) const;
/**
* Check the subtraction for the last event
*/
void lastEventSubtraction();
/**
* Set a file to print subtraction check to
*/
void subtractionData(string n) { theSubtractionData = n; }
/**
* Return true, if verbose
*/
bool verbose() const { return theVerbose; }
/**
* Switch on or off verbosity for this subtracted ME
*/
void setVerbose(bool on = true) { theVerbose = on; }
//@}
/** @name Setup of Subtracted ME objects */
//@{
/**
* Return true if this object needs to be initialized before all
* other objects (except those for which this function also returns
* true). This default version always returns false, but subclasses
* may override it to return true.
*/
virtual bool preInitialize() const { return true; }
//@}
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).
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();
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish();
/**
* Rebind pointer to other Interfaced objects. Called in the setup phase
* after all objects used in an EventGenerator has been cloned so that
* the pointers will refer to the cloned objects afterwards.
* @param trans a TranslationMap relating the original objects to
* their respective clones.
* @throws RebindException if no cloned object was found for a given
* pointer.
*/
virtual void rebind(const TranslationMap & trans);
/**
* Return a vector of all pointers to Interfaced objects used in this
* object.
* @return a vector of pointers.
*/
virtual IVector getReferences();
//@}
private:
/**
* Pointer to the head real emission ME casted to a MatchboxMEBase
* object.
*/
Ptr<MatchboxMEBase>::ptr theReal;
/**
* The dipoles to be considered; the dipoles generated
* can be accessed throught the dependent() matrxi element
* vector, provided the head() is a MatchboxMEBase object.
*/
vector<Ptr<SubtractionDipole>::ptr> theDipoles;
/**
* The underlying Born matrix elements to be considered
*/
vector<Ptr<MatchboxMEBase>::ptr> theBorns;
/**
* File name to dump subtraction check to
*/
string theSubtractionData;
/**
* Simple envelope histogram to keep track of subtraction
*/
struct SubtractionHistogram {
/**
* The lower bound
*/
double lower;
/**
* The bins, indexed by upper bound.
*/
map<double,pair<double,double> > bins;
/**
* Constructor
*/
SubtractionHistogram(double low = 0.001,
double up = 10.,
unsigned int nbins = 100);
/**
* Book an event.
*/
void book(double inv, double ratio) {
map<double,pair<double,double> >::iterator b =
bins.upper_bound(inv);
if ( b == bins.end() ) return;
b->second.first = min(b->second.first,abs(ratio));
b->second.second = max(b->second.second,abs(ratio));
}
/**
* Write to file given name and invariant.
*/
void dump(const std::string& prefix,
const cPDVector& proc,
int i, int j) const;
};
/**
* Define the key for the collinear subtraction data.
*/
typedef pair<cPDVector,pair<size_t, size_t> > CollinearSubtractionIndex;
/**
* subtraction data for collinear limits.
*/
map<CollinearSubtractionIndex,SubtractionHistogram> collinearHistograms;
/**
* Define the key for the soft subtraction data.
*/
typedef pair<cPDVector,size_t> SoftSubtractionIndex;
/**
* subtraction data for soft limits.
*/
map<SoftSubtractionIndex,SubtractionHistogram> softHistograms;
/**
* Switch to print full information on the
* last phase space point.
*/
bool theVerbose;
/**
* True, if SubProcessGroups should be
* setup from this MEGroup. If not, a single SubProcess
* is constructed from the data provided by the
* head matrix element.
*/
bool theSubProcessGroups;
/**
* True, if the integral over the unresolved emission should be
* calculated.
*/
bool theInclusive;
/**
* True, if veto scales should be set
* for the real emission
*/
bool theVetoScales;
/**
* The shower approximation.
*/
Ptr<ShowerApproximation>::ptr theShowerApproximation;
/**
* True, if the shower real emission contribution should be subtracted.
*/
bool theRealShowerSubtraction;
/**
* True, if the shower virtual contribution should be subtracted.
*/
bool theVirtualShowerSubtraction;
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
SubtractedME & operator=(const SubtractedME &);
};
}
#endif /* HERWIG_SubtractedME_H */
diff --git a/MatrixElement/Matchbox/MatchboxFactory.cc b/MatrixElement/Matchbox/MatchboxFactory.cc
--- a/MatrixElement/Matchbox/MatchboxFactory.cc
+++ b/MatrixElement/Matchbox/MatchboxFactory.cc
@@ -1,1204 +1,1203 @@
// -*- C++ -*-
//
// MatchboxFactory.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 MatchboxFactory class.
//
#include "MatchboxFactory.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/RefVector.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Command.h"
#include "ThePEG/Utilities/StringUtils.h"
#include "ThePEG/Repository/Repository.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/MatrixElement/Matchbox/Base/DipoleRepository.h"
#include "Herwig++/MatrixElement/Matchbox/Utility/SU2Helper.h"
#include <boost/progress.hpp>
#include <iterator>
using std::ostream_iterator;
using namespace Herwig;
using std::ostream_iterator;
MatchboxFactory::MatchboxFactory()
: SubProcessHandler(), theNLight(0),
theOrderInAlphaS(0), theOrderInAlphaEW(0),
theBornContributions(true), theVirtualContributions(true),
theRealContributions(true), theIndependentVirtuals(false),
theSubProcessGroups(false), theInclusive(false),
theFactorizationScaleFactor(1.0), theRenormalizationScaleFactor(1.0),
theFixedCouplings(false), theFixedQEDCouplings(false), theVetoScales(false),
theVerbose(false), theInitVerbose(false), theSubtractionData(""),
theCheckPoles(false), theRealEmissionScales(false) {}
MatchboxFactory::~MatchboxFactory() {}
IBPtr MatchboxFactory::clone() const {
return new_ptr(*this);
}
IBPtr MatchboxFactory::fullclone() const {
return new_ptr(*this);
}
void MatchboxFactory::prepareME(Ptr<MatchboxMEBase>::ptr me) const {
Ptr<MatchboxAmplitude>::ptr amp =
dynamic_ptr_cast<Ptr<MatchboxAmplitude>::ptr>((*me).amplitude());
me->matchboxAmplitude(amp);
if ( diagramGenerator() && !me->diagramGenerator() )
me->diagramGenerator(diagramGenerator());
if ( processData() && !me->processData() )
me->processData(processData());
if ( me->nLight() == 0 )
me->nLight(nLight());
if ( phasespace() && !me->phasespace() )
me->phasespace(phasespace());
if ( scaleChoice() && !me->scaleChoice() )
me->scaleChoice(scaleChoice());
if ( me->factorizationScaleFactor() == 1.0 )
me->factorizationScaleFactor(factorizationScaleFactor());
if ( me->renormalizationScaleFactor() == 1.0 )
me->renormalizationScaleFactor(renormalizationScaleFactor());
if ( fixedCouplings() )
me->setFixedCouplings();
if ( fixedQEDCouplings() )
me->setFixedQEDCouplings();
if ( cache() && !me->cache() )
me->cache(cache());
if ( verbose() )
me->setVerbose();
}
struct LegIndex {
int spin;
int charge;
int colour;
int isSameAs;
int isSameFamilyAs;
inline bool operator==(const LegIndex& other) const {
return
spin == other.spin &&
charge == other.charge &&
colour == other.colour &&
isSameAs == other.isSameAs &&
isSameFamilyAs == other.isSameFamilyAs;
}
inline bool operator<(const LegIndex& other) const {
if ( spin != other.spin )
return spin < other.spin;
if ( charge != other.charge )
return charge < other.charge;
if ( colour != other.colour )
return colour < other.colour;
if ( isSameAs != other.isSameAs )
return isSameAs < other.isSameAs;
if ( isSameFamilyAs != other.isSameFamilyAs )
return isSameFamilyAs < other.isSameFamilyAs;
return false;
}
};
vector<LegIndex> makeIndex(const PDVector& proc) {
map<long,int> idMap;
map<int,int> familyIdMap;
int lastId = 0;
int lastFamilyId = 0;
vector<LegIndex> res;
for ( PDVector::const_iterator p = proc.begin();
p != proc.end(); ++p ) {
int id;
if ( idMap.find((**p).id()) != idMap.end() ) {
id = idMap[(**p).id()];
} else {
id = lastId;
idMap[(**p).id()] = lastId;
++lastId;
}
int familyId;
if ( familyIdMap.find(SU2Helper::family(*p)) != familyIdMap.end() ) {
familyId = familyIdMap[SU2Helper::family(*p)];
} else {
familyId = lastFamilyId;
familyIdMap[SU2Helper::family(*p)] = lastFamilyId;
++lastFamilyId;
}
LegIndex idx;
idx.spin = (**p).iSpin();
idx.charge = (**p).iCharge();
idx.colour = (**p).iColour();
idx.isSameAs = id;
idx.isSameFamilyAs = familyId;
res.push_back(idx);
}
return res;
}
string pid(const vector<LegIndex>& key) {
ostringstream res;
for ( vector<LegIndex>::const_iterator k =
key.begin(); k != key.end(); ++k )
res << k->spin << k->charge
<< k->colour << k->isSameAs
<< k->isSameFamilyAs;
return res.str();
}
vector<Ptr<MatchboxMEBase>::ptr> MatchboxFactory::
makeMEs(const vector<string>& proc, unsigned int orderas) const {
typedef vector<LegIndex> QNKey;
generator()->log() << "determining subprocesses for ";
copy(proc.begin(),proc.end(),ostream_iterator<string>(generator()->log()," "));
generator()->log() << flush;
map<Ptr<MatchboxAmplitude>::ptr,map<QNKey,vector<PDVector> > > ampProcs;
set<PDVector> processes = makeSubProcesses(proc);
vector<Ptr<MatchboxAmplitude>::ptr> matchAmplitudes;
for ( vector<Ptr<MatchboxAmplitude>::ptr>::const_iterator amp
= amplitudes().begin(); amp != amplitudes().end(); ++amp ) {
(**amp).orderInGs(orderas);
(**amp).orderInGem(orderInAlphaEW());
if ( (**amp).orderInGs() != orderas ||
(**amp).orderInGem() != orderInAlphaEW() ) {
continue;
}
matchAmplitudes.push_back(*amp);
}
size_t combinations = processes.size()*matchAmplitudes.size();
size_t procCount = 0;
boost::progress_display * progressBar =
new boost::progress_display(combinations,generator()->log());
for ( vector<Ptr<MatchboxAmplitude>::ptr>::const_iterator amp
= matchAmplitudes.begin(); amp != matchAmplitudes.end(); ++amp ) {
(**amp).orderInGs(orderas);
(**amp).orderInGem(orderInAlphaEW());
for ( set<PDVector>::const_iterator p = processes.begin();
p != processes.end(); ++p ) {
++(*progressBar);
if ( !(**amp).canHandle(*p) )
continue;
QNKey key = makeIndex(*p);
++procCount;
ampProcs[*amp][key].push_back(*p);
}
}
delete progressBar;
generator()->log() << flush;
vector<Ptr<MatchboxMEBase>::ptr> res;
for ( map<Ptr<MatchboxAmplitude>::ptr,map<QNKey,vector<PDVector> > >::const_iterator
ap = ampProcs.begin(); ap != ampProcs.end(); ++ap ) {
for ( map<QNKey,vector<PDVector> >::const_iterator m = ap->second.begin();
m != ap->second.end(); ++m ) {
Ptr<MatchboxMEBase>::ptr me = ap->first->makeME(m->second);
me->subProcesses() = m->second;
me->amplitude(ap->first);
string pname = "ME" + ap->first->name() + pid(m->first);
if ( ! (generator()->preinitRegister(me,pname) ) )
throw InitException() << "Matrix element " << pname << " already existing.";
res.push_back(me);
}
}
generator()->log() << "created " << res.size()
<< " matrix element objects for "
<< procCount << " subprocesses.\n";
generator()->log() << "--------------------------------------------------------------------------------\n"
<< flush;
return res;
}
void MatchboxFactory::setup() {
- if ( !amplitudes().empty() ) {
+ if ( bornMEs().empty() ) {
if ( particleGroups().find("j") == particleGroups().end() )
throw InitException() << "Could not find a jet particle group named 'j'";
// rebind the particle data objects
for ( map<string,PDVector>::iterator g = particleGroups().begin();
g != particleGroups().end(); ++g )
for ( PDVector::iterator p = g->second.begin();
p != g->second.end(); ++p ) {
#ifndef NDEBUG
long checkid = (**p).id();
#endif
*p = getParticleData((**p).id());
assert((**p).id() == checkid);
}
const PDVector& partons = particleGroups()["j"];
unsigned int nl = 0;
for ( PDVector::const_iterator p = partons.begin();
p != partons.end(); ++p )
if ( abs((**p).id()) < 6 )
++nl;
nLight(nl/2);
vector<Ptr<MatchboxMEBase>::ptr> ames = makeMEs(process,orderInAlphaS());
copy(ames.begin(),ames.end(),back_inserter(bornMEs()));
- if ( realContributions() ) {
+ if ( realContributions() && realEmissionMEs().empty() ) {
vector<string> rproc = process;
if ( realEmissionProcess.empty() ) {
rproc.push_back("j");
} else {
rproc = realEmissionProcess;
}
ames = makeMEs(rproc,orderInAlphaS()+1);
copy(ames.begin(),ames.end(),back_inserter(realEmissionMEs()));
}
}
// check if we have virtual contributions
bool haveVirtuals = true;
// check DR conventions of virtual contributions
bool virtualsAreDR = false;
bool virtualsAreCDR = false;
// check finite term conventions of virtual contributions
bool virtualsAreCS = false;
bool virtualsAreBDK = false;
bool virtualsAreExpanded = false;
// check and prepare the Born and virtual matrix elements
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator born
= bornMEs().begin(); born != bornMEs().end(); ++born ) {
prepareME(*born);
haveVirtuals &= (**born).haveOneLoop();
if ( (**born).haveOneLoop() ) {
virtualsAreDR |= (**born).isDR();
virtualsAreCDR |= !(**born).isDR();
virtualsAreCS |= (**born).isCS();
virtualsAreBDK |= (**born).isBDK();
virtualsAreExpanded |= (**born).isExpanded();
}
}
// check the additional insertion operators
if ( !virtuals().empty() )
haveVirtuals = true;
for ( vector<Ptr<MatchboxInsertionOperator>::ptr>::const_iterator virt
= virtuals().begin(); virt != virtuals().end(); ++virt ) {
virtualsAreDR |= (**virt).isDR();
virtualsAreCDR |= !(**virt).isDR();
virtualsAreCS |= (**virt).isCS();
virtualsAreBDK |= (**virt).isBDK();
virtualsAreExpanded |= (**virt).isExpanded();
}
// check for consistent conventions on virtuals, if we are to include them
if ( virtualContributions() ) {
if ( virtualsAreDR && virtualsAreCDR ) {
throw InitException() << "Virtual corrections use inconsistent regularization schemes.\n";
}
if ( (virtualsAreCS && virtualsAreBDK) ||
(virtualsAreCS && virtualsAreExpanded) ||
(virtualsAreBDK && virtualsAreExpanded) ||
(!virtualsAreCS && !virtualsAreBDK && !virtualsAreExpanded) ) {
throw InitException() << "Virtual corrections use inconsistent conventions on finite terms.\n";
}
if ( !haveVirtuals ) {
throw InitException() << "Could not find amplitudes for all virtual contributions needed.\n";
}
}
// prepare dipole insertion operators
if ( virtualContributions() ) {
for ( vector<Ptr<MatchboxInsertionOperator>::ptr>::const_iterator virt
= DipoleRepository::insertionOperators().begin();
virt != DipoleRepository::insertionOperators().end(); ++virt ) {
if ( virtualsAreDR )
(**virt).useDR();
else
(**virt).useCDR();
if ( virtualsAreCS )
(**virt).useCS();
if ( virtualsAreBDK )
(**virt).useBDK();
if ( virtualsAreExpanded )
(**virt).useExpanded();
}
}
// prepare the real emission matrix elements
if ( realContributions() ) {
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator real
= realEmissionMEs().begin(); real != realEmissionMEs().end(); ++real ) {
prepareME(*real);
}
}
// start creating matrix elements
MEs().clear();
// setup born and virtual contributions
if ( bornContributions() || virtualContributions() ) {
- generator()->log() << "preparing Born "
- << (virtualContributions() ? "and virtual" : "")
- << " matrix elements." << flush;
+ generator()->log() << "preparing Born"
+ << (virtualContributions() ? " and virtual" : "")
+ << " matrix elements.\n" << flush;
}
if ( (bornContributions() && !virtualContributions()) ||
(bornContributions() && virtualContributions() && independentVirtuals()) ) {
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator born
= bornMEs().begin(); born != bornMEs().end(); ++born ) {
if ( (**born).onlyOneLoop() )
continue;
Ptr<MatchboxMEBase>::ptr bornme = (**born).cloneMe();
string pname = fullName() + "/" + (**born).name();
if ( independentVirtuals() )
pname += ".Born";
if ( ! (generator()->preinitRegister(bornme,pname) ) )
throw InitException() << "Matrix element " << pname << " already existing.";
bornme->cloneDependencies();
MEs().push_back(bornme);
}
}
if ( virtualContributions() ) {
bornVirtualMEs().clear();
boost::progress_display * progressBar =
new boost::progress_display(bornMEs().size(),generator()->log());
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator born
= bornMEs().begin(); born != bornMEs().end(); ++born ) {
Ptr<MatchboxMEBase>::ptr nlo = (**born).cloneMe();
string pname = fullName() + "/" + (**born).name();
if ( !independentVirtuals() )
pname += ".BornVirtual";
else
pname += ".Virtual";
if ( ! (generator()->preinitRegister(nlo,pname) ) )
throw InitException() << "NLO ME " << pname << " already existing.";
nlo->virtuals().clear();
if ( !nlo->onlyOneLoop() ) {
for ( vector<Ptr<MatchboxInsertionOperator>::ptr>::const_iterator virt
= virtuals().begin(); virt != virtuals().end(); ++virt ) {
if ( (**virt).apply((**born).diagrams().front()->partons()) )
nlo->virtuals().push_back(*virt);
}
for ( vector<Ptr<MatchboxInsertionOperator>::ptr>::const_iterator virt
= DipoleRepository::insertionOperators().begin();
virt != DipoleRepository::insertionOperators().end(); ++virt ) {
if ( (**virt).apply((**born).diagrams().front()->partons()) )
nlo->virtuals().push_back(*virt);
}
if ( nlo->virtuals().empty() )
throw InitException() << "No insertion operators have been found for "
<< (**born).name() << "\n";
if ( checkPoles() ) {
if ( !virtualsAreExpanded ) {
throw InitException() << "Cannot check epsilon poles if virtuals are not in `expanded' convention.\n";
}
nlo->doCheckPoles();
}
}
if ( !bornContributions() || independentVirtuals() ) {
nlo->doOneLoopNoBorn();
} else {
nlo->doOneLoop();
}
nlo->cloneDependencies();
bornVirtualMEs().push_back(nlo);
MEs().push_back(nlo);
++(*progressBar);
}
delete progressBar;
generator()->log() << "--------------------------------------------------------------------------------\n"
<< flush;
}
theSplittingDipoles.clear();
set<cPDVector> bornProcs;
if ( showerApproximation() )
if ( showerApproximation()->needsSplittingGenerator() ) {
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator born
= bornMEs().begin(); born != bornMEs().end(); ++born )
for ( MEBase::DiagramVector::const_iterator d = (**born).diagrams().begin();
d != (**born).diagrams().end(); ++d )
bornProcs.insert((**d).partons());
}
if ( realContributions() ) {
- generator()->log() << "preparing real emission matrix elements." << flush;
+ generator()->log() << "preparing real emission matrix elements.\n" << flush;
if ( theSubtractionData != "" )
if ( theSubtractionData[theSubtractionData.size()-1] != '/' )
theSubtractionData += "/";
subtractedMEs().clear();
boost::progress_display * progressBar =
new boost::progress_display(realEmissionMEs().size(),generator()->log());
for ( vector<Ptr<MatchboxMEBase>::ptr>::iterator real
= realEmissionMEs().begin(); real != realEmissionMEs().end(); ++real ) {
Ptr<SubtractedME>::ptr sub = new_ptr(SubtractedME());
string pname = fullName() + "/" + (**real).name() + ".Real";
if ( ! (generator()->preinitRegister(sub,pname) ) )
throw InitException() << "Subtracted ME " << pname << " already existing.";
sub->borns() = bornMEs();
sub->head(*real);
sub->allDipoles().clear();
sub->dependent().clear();
if ( subtractionData() != "" )
sub->subtractionData(subtractionData());
sub->getDipoles();
if ( sub->dependent().empty() ) {
// finite real contribution
Ptr<MatchboxMEBase>::ptr fme =
dynamic_ptr_cast<Ptr<MatchboxMEBase>::ptr>(sub->head())->cloneMe();
string pname = fullName() + "/" + (**real).name() + ".FiniteReal";
if ( ! (generator()->preinitRegister(fme,pname) ) )
throw InitException() << "ME " << pname << " already existing.";
MEs().push_back(fme);
finiteRealMEs().push_back(fme);
sub->head(tMEPtr());
continue;
}
if ( verbose() )
sub->setVerbose();
if ( subProcessGroups() )
sub->setSubProcessGroups();
if ( inclusive() )
sub->setInclusive();
if ( vetoScales() )
sub->doVetoScales();
if ( realEmissionScales() )
sub->doRealEmissionScales();
subtractedMEs().push_back(sub);
MEs().push_back(sub);
if ( showerApproximation() ) {
sub->showerApproximation(showerApproximation());
Ptr<SubtractedME>::ptr subv = new_ptr(*sub);
string vname = sub->fullName() + ".vsub";
- if ( ! (generator()->preinitRegister(subv,pname) ) )
+ if ( ! (generator()->preinitRegister(subv,vname) ) )
throw InitException() << "Subtracted ME " << vname << " already existing.";
sub->doRealShowerSubtraction();
subv->doVirtualShowerSubtraction();
subtractedMEs().push_back(subv);
MEs().push_back(subv);
if ( showerApproximation()->needsSplittingGenerator() )
for ( set<cPDVector>::const_iterator p = bornProcs.begin();
p != bornProcs.end(); ++p ) {
vector<Ptr<SubtractionDipole>::ptr> sdip = sub->splitDipoles(*p);
set<Ptr<SubtractionDipole>::ptr>& dips = theSplittingDipoles[*p];
copy(sdip.begin(),sdip.end(),inserter(dips,dips.begin()));
}
}
++(*progressBar);
}
delete progressBar;
generator()->log() << "--------------------------------------------------------------------------------\n"
<< flush;
}
if ( !theSplittingDipoles.empty() ) {
map<Ptr<SubtractionDipole>::ptr,Ptr<SubtractionDipole>::ptr> cloneMap;
for ( map<cPDVector,set<Ptr<SubtractionDipole>::ptr> >::const_iterator sd = theSplittingDipoles.begin();
sd != theSplittingDipoles.end(); ++sd ) {
for ( set<Ptr<SubtractionDipole>::ptr>::const_iterator d = sd->second.begin();
d != sd->second.end(); ++d ) {
cloneMap[*d] = Ptr<SubtractionDipole>::ptr();
}
}
for ( map<Ptr<SubtractionDipole>::ptr,Ptr<SubtractionDipole>::ptr>::iterator cd =
cloneMap.begin(); cd != cloneMap.end(); ++cd ) {
Ptr<SubtractionDipole>::ptr cloned = cd->first->cloneMe();
string dname = cd->first->fullName() + ".splitting";
if ( ! (generator()->preinitRegister(cloned,dname)) )
throw InitException() << "Dipole '" << dname << "' already existing.";
cloned->cloneDependencies();
cloned->showerApproximation(Ptr<ShowerApproximation>::tptr());
cloned->doSplitting();
cd->second = cloned;
}
for ( map<cPDVector,set<Ptr<SubtractionDipole>::ptr> >::iterator sd = theSplittingDipoles.begin();
sd != theSplittingDipoles.end(); ++sd ) {
set<Ptr<SubtractionDipole>::ptr> cloned;
for ( set<Ptr<SubtractionDipole>::ptr>::iterator d = sd->second.begin();
d != sd->second.end(); ++d ) {
cloned.insert(cloneMap[*d]);
}
sd->second = cloned;
}
}
- generator()->log() << "process setup finished.\n" << flush;
+ generator()->log() << "Process setup finished.\n" << flush;
}
list<MatchboxFactory::SplittingChannel>
MatchboxFactory::getSplittingChannels(tStdXCombPtr xcptr) const {
if ( xcptr->lastProjector() )
xcptr = xcptr->lastProjector();
const StandardXComb& xc = *xcptr;
cPDVector proc = xc.mePartonData();
map<cPDVector,set<Ptr<SubtractionDipole>::ptr> >::const_iterator splitEntries
= splittingDipoles().find(proc);
list<SplittingChannel> res;
if ( splitEntries == splittingDipoles().end() )
return res;
const set<Ptr<SubtractionDipole>::ptr>& splitDipoles = splitEntries->second;
for ( set<Ptr<SubtractionDipole>::ptr>::const_iterator sd =
splitDipoles.begin(); sd != splitDipoles.end(); ++sd ) {
Ptr<MatchboxMEBase>::tptr bornME =
const_ptr_cast<Ptr<MatchboxMEBase>::tptr>((**sd).underlyingBornME());
SplittingChannel channel;
channel.dipole = *sd;
channel.bornXComb =
bornME->makeXComb(xc.maxEnergy(),xc.particles(),xc.eventHandlerPtr(),
const_ptr_cast<tSubHdlPtr>(xc.subProcessHandler()),
xc.pExtractor(),xc.CKKWHandler(),
xc.partonBins(),xc.cuts(),xc.diagrams(),xc.mirror(),
PartonPairVec());
vector<StdXCombPtr> realXCombs = (**sd).makeRealXCombs(channel.bornXComb);
for ( vector<StdXCombPtr>::const_iterator rxc = realXCombs.begin();
rxc != realXCombs.end(); ++rxc ) {
channel.realXComb = *rxc;
if ( showerApproximation()->needsTildeXCombs() ) {
channel.tildeXCombs.clear();
assert(!channel.dipole->partnerDipoles().empty());
for ( vector<Ptr<SubtractionDipole>::ptr>::const_iterator p =
channel.dipole->partnerDipoles().begin();
p != channel.dipole->partnerDipoles().end(); ++p ) {
StdXCombPtr txc = channel.dipole->makeBornXComb(channel.realXComb);
if ( txc )
channel.tildeXCombs.push_back(txc);
}
}
res.push_back(channel);
}
}
return res;
}
void MatchboxFactory::print(ostream& os) const {
os << "--- MatchboxFactory setup -----------------------------------------------------------\n";
if ( !amplitudes().empty() ) {
os << " generated Born matrix elements:\n";
for ( vector<Ptr<MatchboxMEBase>::ptr>::const_iterator m = bornMEs().begin();
m != bornMEs().end(); ++m ) {
(**m).print(os);
}
os << flush;
os << " generated real emission matrix elements:\n";
for ( vector<Ptr<MatchboxMEBase>::ptr>::const_iterator m = realEmissionMEs().begin();
m != realEmissionMEs().end(); ++m ) {
(**m).print(os);
}
os << flush;
}
os << " generated Born+virtual matrix elements:\n";
for ( vector<Ptr<MatchboxMEBase>::ptr>::const_iterator bv
= bornVirtualMEs().begin(); bv != bornVirtualMEs().end(); ++bv ) {
(**bv).print(os);
}
os << " generated subtracted matrix elements:\n";
for ( vector<Ptr<SubtractedME>::ptr>::const_iterator sub
= subtractedMEs().begin(); sub != subtractedMEs().end(); ++sub ) {
os << " '" << (**sub).name() << "'\n";
}
os << "--------------------------------------------------------------------------------\n";
os << flush;
}
void MatchboxFactory::doinit() {
setup();
if ( initVerbose() )
print(Repository::clog());
SubProcessHandler::doinit();
}
void MatchboxFactory::persistentOutput(PersistentOStream & os) const {
os << theDiagramGenerator << theProcessData
<< theNLight << theOrderInAlphaS << theOrderInAlphaEW
<< theBornContributions << theVirtualContributions
<< theRealContributions << theIndependentVirtuals << theSubProcessGroups << theInclusive
<< thePhasespace << theScaleChoice
<< theFactorizationScaleFactor << theRenormalizationScaleFactor
<< theFixedCouplings << theFixedQEDCouplings << theVetoScales
<< theAmplitudes << theCache
<< theBornMEs << theVirtuals << theRealEmissionMEs
<< theBornVirtualMEs << theSubtractedMEs << theFiniteRealMEs
<< theVerbose << theInitVerbose << theSubtractionData << theCheckPoles
<< theParticleGroups << process << realEmissionProcess
<< theShowerApproximation << theSplittingDipoles
<< theRealEmissionScales;
}
void MatchboxFactory::persistentInput(PersistentIStream & is, int) {
is >> theDiagramGenerator >> theProcessData
>> theNLight >> theOrderInAlphaS >> theOrderInAlphaEW
>> theBornContributions >> theVirtualContributions
>> theRealContributions >> theIndependentVirtuals >> theSubProcessGroups >> theInclusive
>> thePhasespace >> theScaleChoice
>> theFactorizationScaleFactor >> theRenormalizationScaleFactor
>> theFixedCouplings >> theFixedQEDCouplings >> theVetoScales
>> theAmplitudes >> theCache
>> theBornMEs >> theVirtuals >> theRealEmissionMEs
>> theBornVirtualMEs >> theSubtractedMEs >> theFiniteRealMEs
>> theVerbose >> theInitVerbose >> theSubtractionData >> theCheckPoles
>> theParticleGroups >> process >> realEmissionProcess
>> theShowerApproximation >> theSplittingDipoles
>> theRealEmissionScales;
}
string MatchboxFactory::startParticleGroup(string name) {
particleGroupName = StringUtils::stripws(name);
particleGroup.clear();
return "";
}
string MatchboxFactory::endParticleGroup(string) {
if ( particleGroup.empty() )
throw InitException() << "Empty particle group.";
particleGroups()[particleGroupName] = particleGroup;
particleGroup.clear();
return "";
}
string MatchboxFactory::doProcess(string in) {
process = StringUtils::split(in);
if ( process.size() < 3 )
throw InitException() << "Invalid process.";
for ( vector<string>::iterator p = process.begin();
p != process.end(); ++p ) {
*p = StringUtils::stripws(*p);
}
return "";
}
string MatchboxFactory::doSingleRealProcess(string in) {
realEmissionProcess = StringUtils::split(in);
if ( realEmissionProcess.size() < 3 )
throw InitException() << "Invalid process.";
for ( vector<string>::iterator p = realEmissionProcess.begin();
p != realEmissionProcess.end(); ++p ) {
*p = StringUtils::stripws(*p);
}
return "";
}
struct SortPID {
inline bool operator()(PDPtr a, PDPtr b) const {
return a->id() < b->id();
}
};
set<PDVector> MatchboxFactory::
makeSubProcesses(const vector<string>& proc) const {
if ( proc.empty() )
throw InitException() << "No process specified.";
vector<PDVector> allProcs(1);
size_t pos = 0;
typedef map<string,PDVector>::const_iterator GroupIterator;
while ( pos < proc.size() ) {
GroupIterator git =
particleGroups().find(proc[pos]);
if ( git == particleGroups().end() ) {
throw InitException() << "particle group '"
<< proc[pos] << "' not defined.";
}
vector<PDVector> mine;
for ( vector<PDVector>::const_iterator i = allProcs.begin();
i != allProcs.end(); ++i ) {
for ( PDVector::const_iterator p = git->second.begin();
p != git->second.end(); ++p ) {
PDVector v = *i;
v.push_back(*p);
mine.push_back(v);
}
}
allProcs = mine;
++pos;
}
set<PDVector> allCheckedProcs;
for ( vector<PDVector>::const_iterator p = allProcs.begin();
p != allProcs.end(); ++p ) {
int charge = -(*p)[0]->iCharge() -(*p)[1]->iCharge();
for ( size_t k = 2; k < (*p).size(); ++k )
charge += (*p)[k]->iCharge();
if ( charge != 0 )
continue;
PDVector pr = *p;
sort(pr.begin()+2,pr.end(),SortPID());
allCheckedProcs.insert(pr);
}
return allCheckedProcs;
}
void MatchboxFactory::Init() {
static ClassDocumentation<MatchboxFactory> documentation
("MatchboxFactory",
"NLO QCD corrections have been calculated "
"using Matchbox \\cite{Platzer:2011bc}",
"%\\cite{Platzer:2011bc}\n"
"\\bibitem{Platzer:2011bc}\n"
"S.~Platzer and S.~Gieseke,\n"
"``Dipole Showers and Automated NLO Matching in Herwig++,''\n"
"arXiv:1109.6256 [hep-ph].\n"
"%%CITATION = ARXIV:1109.6256;%%");
static Reference<MatchboxFactory,Tree2toNGenerator> interfaceDiagramGenerator
("DiagramGenerator",
"Set the diagram generator.",
&MatchboxFactory::theDiagramGenerator, false, false, true, true, false);
static Reference<MatchboxFactory,ProcessData> interfaceProcessData
("ProcessData",
"Set the process data object to be used.",
&MatchboxFactory::theProcessData, false, false, true, true, false);
static Parameter<MatchboxFactory,unsigned int> interfaceOrderInAlphaS
("OrderInAlphaS",
"The order in alpha_s to consider.",
&MatchboxFactory::theOrderInAlphaS, 0, 0, 0,
false, false, Interface::lowerlim);
static Parameter<MatchboxFactory,unsigned int> interfaceOrderInAlphaEW
("OrderInAlphaEW",
"The order in alpha_EW",
&MatchboxFactory::theOrderInAlphaEW, 2, 0, 0,
false, false, Interface::lowerlim);
static Switch<MatchboxFactory,bool> interfaceBornContributions
("BornContributions",
"Switch on or off the Born contributions.",
&MatchboxFactory::theBornContributions, true, false, false);
static SwitchOption interfaceBornContributionsOn
(interfaceBornContributions,
"On",
"Switch on Born contributions.",
true);
static SwitchOption interfaceBornContributionsOff
(interfaceBornContributions,
"Off",
"Switch off Born contributions.",
false);
static Switch<MatchboxFactory,bool> interfaceVirtualContributions
("VirtualContributions",
"Switch on or off the virtual contributions.",
&MatchboxFactory::theVirtualContributions, true, false, false);
static SwitchOption interfaceVirtualContributionsOn
(interfaceVirtualContributions,
"On",
"Switch on virtual contributions.",
true);
static SwitchOption interfaceVirtualContributionsOff
(interfaceVirtualContributions,
"Off",
"Switch off virtual contributions.",
false);
static Switch<MatchboxFactory,bool> interfaceRealContributions
("RealContributions",
"Switch on or off the real contributions.",
&MatchboxFactory::theRealContributions, true, false, false);
static SwitchOption interfaceRealContributionsOn
(interfaceRealContributions,
"On",
"Switch on real contributions.",
true);
static SwitchOption interfaceRealContributionsOff
(interfaceRealContributions,
"Off",
"Switch off real contributions.",
false);
static Switch<MatchboxFactory,bool> interfaceIndependentVirtuals
("IndependentVirtuals",
"Switch on or off virtual contributions as separate subprocesses.",
&MatchboxFactory::theIndependentVirtuals, true, false, false);
static SwitchOption interfaceIndependentVirtualsOn
(interfaceIndependentVirtuals,
"On",
"Switch on virtual contributions as separate subprocesses.",
true);
static SwitchOption interfaceIndependentVirtualsOff
(interfaceIndependentVirtuals,
"Off",
"Switch off virtual contributions as separate subprocesses.",
false);
static Switch<MatchboxFactory,bool> interfaceSubProcessGroups
("SubProcessGroups",
"Switch on or off production of sub-process groups.",
&MatchboxFactory::theSubProcessGroups, false, false, false);
static SwitchOption interfaceSubProcessGroupsOn
(interfaceSubProcessGroups,
"On",
"On",
true);
static SwitchOption interfaceSubProcessGroupsOff
(interfaceSubProcessGroups,
"Off",
"Off",
false);
static Switch<MatchboxFactory,bool> interfaceInclusive
("Inclusive",
"Switch on or off production of inclusive cross section.",
&MatchboxFactory::theInclusive, false, false, false);
static SwitchOption interfaceInclusiveOn
(interfaceInclusive,
"On",
"On",
true);
static SwitchOption interfaceInclusiveOff
(interfaceInclusive,
"Off",
"Off",
false);
static Reference<MatchboxFactory,MatchboxPhasespace> interfacePhasespace
("Phasespace",
"Set the phasespace generator.",
&MatchboxFactory::thePhasespace, false, false, true, true, false);
static Reference<MatchboxFactory,MatchboxScaleChoice> interfaceScaleChoice
("ScaleChoice",
"Set the scale choice object.",
&MatchboxFactory::theScaleChoice, false, false, true, true, false);
static Parameter<MatchboxFactory,double> interfaceFactorizationScaleFactor
("FactorizationScaleFactor",
"The factorization scale factor.",
&MatchboxFactory::theFactorizationScaleFactor, 1.0, 0.0, 0,
false, false, Interface::lowerlim);
static Parameter<MatchboxFactory,double> interfaceRenormalizationScaleFactor
("RenormalizationScaleFactor",
"The renormalization scale factor.",
&MatchboxFactory::theRenormalizationScaleFactor, 1.0, 0.0, 0,
false, false, Interface::lowerlim);
static Switch<MatchboxFactory,bool> interfaceFixedCouplings
("FixedCouplings",
"Switch on or off fixed couplings.",
&MatchboxFactory::theFixedCouplings, true, false, false);
static SwitchOption interfaceFixedCouplingsOn
(interfaceFixedCouplings,
"On",
"On",
true);
static SwitchOption interfaceFixedCouplingsOff
(interfaceFixedCouplings,
"Off",
"Off",
false);
static Switch<MatchboxFactory,bool> interfaceFixedQEDCouplings
("FixedQEDCouplings",
"Switch on or off fixed QED couplings.",
&MatchboxFactory::theFixedQEDCouplings, true, false, false);
static SwitchOption interfaceFixedQEDCouplingsOn
(interfaceFixedQEDCouplings,
"On",
"On",
true);
static SwitchOption interfaceFixedQEDCouplingsOff
(interfaceFixedQEDCouplings,
"Off",
"Off",
false);
static Switch<MatchboxFactory,bool> interfaceVetoScales
("VetoScales",
"Switch on or setting veto scales.",
&MatchboxFactory::theVetoScales, false, false, false);
static SwitchOption interfaceVetoScalesOn
(interfaceVetoScales,
"On",
"On",
true);
static SwitchOption interfaceVetoScalesOff
(interfaceVetoScales,
"Off",
"Off",
false);
static RefVector<MatchboxFactory,MatchboxAmplitude> interfaceAmplitudes
("Amplitudes",
"The amplitude objects.",
&MatchboxFactory::theAmplitudes, -1, false, false, true, true, false);
static Reference<MatchboxFactory,MatchboxMECache> interfaceCache
("Cache",
"Set the matrix element cache object.",
&MatchboxFactory::theCache, false, false, true, true, false);
static RefVector<MatchboxFactory,MatchboxMEBase> interfaceBornMEs
("BornMEs",
"The Born matrix elements to be used",
&MatchboxFactory::theBornMEs, -1, false, false, true, true, false);
static RefVector<MatchboxFactory,MatchboxInsertionOperator> interfaceVirtuals
("Virtuals",
"The virtual corrections to include",
&MatchboxFactory::theVirtuals, -1, false, false, true, true, false);
static RefVector<MatchboxFactory,MatchboxMEBase> interfaceRealEmissionMEs
("RealEmissionMEs",
"The RealEmission matrix elements to be used",
&MatchboxFactory::theRealEmissionMEs, -1, false, false, true, true, false);
static RefVector<MatchboxFactory,MatchboxMEBase> interfaceBornVirtuals
("BornVirtualMEs",
"The generated Born/virtual contributions",
&MatchboxFactory::theBornVirtualMEs, -1, false, true, true, true, false);
static RefVector<MatchboxFactory,SubtractedME> interfaceSubtractedMEs
("SubtractedMEs",
"The generated subtracted real emission contributions",
&MatchboxFactory::theSubtractedMEs, -1, false, true, true, true, false);
static RefVector<MatchboxFactory,MatchboxMEBase> interfaceFiniteRealMEs
("FiniteRealMEs",
"The generated finite real contributions",
&MatchboxFactory::theFiniteRealMEs, -1, false, true, true, true, false);
static Switch<MatchboxFactory,bool> interfaceVerbose
("Verbose",
"Print full infomation on each evaluated phase space point.",
&MatchboxFactory::theVerbose, false, false, false);
static SwitchOption interfaceVerboseOn
(interfaceVerbose,
"On",
"On",
true);
static SwitchOption interfaceVerboseOff
(interfaceVerbose,
"Off",
"Off",
false);
static Switch<MatchboxFactory,bool> interfaceInitVerbose
("InitVerbose",
"Print setup information.",
&MatchboxFactory::theInitVerbose, false, false, false);
static SwitchOption interfaceInitVerboseOn
(interfaceInitVerbose,
"On",
"On",
true);
static SwitchOption interfaceInitVerboseOff
(interfaceInitVerbose,
"Off",
"Off",
false);
static Parameter<MatchboxFactory,string> interfaceSubtractionData
("SubtractionData",
"Prefix for subtraction check data.",
&MatchboxFactory::theSubtractionData, "",
false, false);
static Switch<MatchboxFactory,bool> interfaceCheckPoles
("CheckPoles",
"Switch on or off checks of epsilon poles.",
&MatchboxFactory::theCheckPoles, true, false, false);
static SwitchOption interfaceCheckPolesOn
(interfaceCheckPoles,
"On",
"On",
true);
static SwitchOption interfaceCheckPolesOff
(interfaceCheckPoles,
"Off",
"Off",
false);
static RefVector<MatchboxFactory,ParticleData> interfaceParticleGroup
("ParticleGroup",
"The particle group just started.",
&MatchboxFactory::particleGroup, -1, false, false, true, false, false);
static Command<MatchboxFactory> interfaceStartParticleGroup
("StartParticleGroup",
"Start a particle group.",
&MatchboxFactory::startParticleGroup, false);
static Command<MatchboxFactory> interfaceEndParticleGroup
("EndParticleGroup",
"End a particle group.",
&MatchboxFactory::endParticleGroup, false);
static Command<MatchboxFactory> interfaceProcess
("Process",
"Set the process to consider.",
&MatchboxFactory::doProcess, false);
static Command<MatchboxFactory> interfaceSingleRealProcess
("SingleRealProcess",
"Set the process to consider.",
&MatchboxFactory::doSingleRealProcess, false);
static Reference<MatchboxFactory,ShowerApproximation> interfaceShowerApproximation
("ShowerApproximation",
"Set the shower approximation to be considered.",
&MatchboxFactory::theShowerApproximation, false, false, true, true, false);
static Switch<MatchboxFactory,bool> interfaceRealEmissionScales
("RealEmissionScales",
"Switch on or off calculation of subtraction scales from real emission kinematics.",
- &MatchboxFactory::theRealEmissionScales, true, false, false);
+ &MatchboxFactory::theRealEmissionScales, false, false, false);
static SwitchOption interfaceRealEmissionScalesOn
(interfaceRealEmissionScales,
"On",
"On",
true);
static SwitchOption interfaceRealEmissionScalesOff
(interfaceRealEmissionScales,
"Off",
"Off",
false);
-
}
// *** 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).
DescribeClass<MatchboxFactory,SubProcessHandler>
describeHerwigMatchboxFactory("Herwig::MatchboxFactory", "HwMatchbox.so");
diff --git a/MatrixElement/Matchbox/Matching/DipoleMatching.cc b/MatrixElement/Matchbox/Matching/DipoleMatching.cc
--- a/MatrixElement/Matchbox/Matching/DipoleMatching.cc
+++ b/MatrixElement/Matchbox/Matching/DipoleMatching.cc
@@ -1,88 +1,87 @@
// -*- C++ -*-
//
// DipoleMatching.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 DipoleMatching class.
//
#include "DipoleMatching.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
using namespace Herwig;
DipoleMatching::DipoleMatching() {}
DipoleMatching::~DipoleMatching() {}
IBPtr DipoleMatching::clone() const {
return new_ptr(*this);
}
IBPtr DipoleMatching::fullclone() const {
return new_ptr(*this);
}
CrossSection DipoleMatching::dSigHatDR() const {
- double pdfFactor = 1.;
- if ( showerScalesInSubtraction() ) {
- double bornPDF = bornPDFWeight(showerScalesInSubtraction());
- double bornPDFHard = bornPDFWeight(false);
- pdfFactor = bornPDFHard / bornPDF;
- }
+
+ double xme2 = dipole()->me2();
+ xme2 /= dipole()->underlyingBornME()->lastXComb().lastAlphaS();
+ xme2 *= bornPDFWeight(dipole()->underlyingBornME()->lastScale());
+
return
sqr(hbarc) *
realXComb()->jacobian() *
- realPDFWeight(showerScalesInSubtraction()) * pdfFactor *
- couplingWeight(showerScalesInSubtraction()) *
- dipole()->me2() /
+ subtractionScaleWeight() *
+ xme2 /
(2. * realXComb()->lastSHat());
+
}
double DipoleMatching::me2() const {
throw Exception() << "Not intented to use. Disable the ShowerApproximationGenerator."
<< Exception::abortnow;
return 0.;
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void DipoleMatching::persistentOutput(PersistentOStream &) const {}
void DipoleMatching::persistentInput(PersistentIStream &, int) {}
// *** 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).
DescribeClass<DipoleMatching,Herwig::ShowerApproximation>
describeHerwigDipoleMatching("Herwig::DipoleMatching", "HwMatchbox.so");
void DipoleMatching::Init() {
static ClassDocumentation<DipoleMatching> documentation
("DipoleMatching implements naive NLO matching with the dipole shower.");
}
diff --git a/MatrixElement/Matchbox/Matching/MEMatching.cc b/MatrixElement/Matchbox/Matching/MEMatching.cc
--- a/MatrixElement/Matchbox/Matching/MEMatching.cc
+++ b/MatrixElement/Matchbox/Matching/MEMatching.cc
@@ -1,173 +1,147 @@
// -*- C++ -*-
//
// MEMatching.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 MEMatching class.
//
#include "MEMatching.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
using namespace Herwig;
-MEMatching::MEMatching()
- : theBornScreening(true),
- theScreeningPower(2.0) {}
+MEMatching::MEMatching() {}
MEMatching::~MEMatching() {}
IBPtr MEMatching::clone() const {
return new_ptr(*this);
}
IBPtr MEMatching::fullclone() const {
return new_ptr(*this);
}
double MEMatching::channelWeight(int emitter, int emission, int spectator) const {
// do the most simple thing for the time being; needs fixing later
if ( realCXComb()->mePartonData()[emission]->id() == ParticleID::g ) {
Energy2 pipk =
realCXComb()->meMomenta()[emitter] * realCXComb()->meMomenta()[spectator];
Energy2 pipj =
realCXComb()->meMomenta()[emitter] * realCXComb()->meMomenta()[emission];
Energy2 pjpk =
realCXComb()->meMomenta()[emission] * realCXComb()->meMomenta()[spectator];
return GeV2 * pipk / ( pipj * ( pipj + pjpk ) );
}
return
GeV2 / (realCXComb()->meMomenta()[emitter] * realCXComb()->meMomenta()[emission]);
}
double MEMatching::channelWeight() const {
double currentChannel = channelWeight(dipole()->realEmitter(),
dipole()->realEmission(),
dipole()->realSpectator());
if ( currentChannel == 0. )
return 0.;
double sum = 0.;
for ( vector<Ptr<SubtractionDipole>::ptr>::const_iterator dip =
dipole()->partnerDipoles().begin();
dip != dipole()->partnerDipoles().end(); ++dip )
sum += channelWeight((**dip).realEmitter(),
(**dip).realEmission(),
(**dip).realSpectator());
assert(sum > 0.0);
return currentChannel / sum;
}
-double MEMatching::screeningME2() const {
- return
- pow(sqr(dipole()->lastPt())/bornXComb()->lastSHat(),screeningPower()) *
- dipole()->underlyingBornME()->me2Norm();
-}
+CrossSection MEMatching::dSigHatDR() const {
-CrossSection MEMatching::dSigHatDR() const {
- double pdfFactor = 1.;
- double bornPDF = bornPDFWeight(showerScalesInSubtraction());
- double bornPDFHard = bornPDF;
- if ( showerScalesInSubtraction() )
- bornPDFHard = bornPDFWeight(false);
- if ( bornScreening() ) {
- double bornME2 = dipole()->underlyingBornME()->me2();
- double screenME2 = screeningME2();
- pdfFactor = bornME2 * bornPDFHard / ( bornME2 * bornPDF + screenME2 );
- } else {
- pdfFactor = bornPDFHard / bornPDF;
- }
- assert(realXComb()->lastME2() > 0.0);
+ double xme2 =
+ realXComb()->lastME2() > 0.0 ?
+ realXComb()->lastME2() :
+ dipole()->realEmissionME()->me2();
+
+ xme2 *= channelWeight();
+ xme2 /=
+ pow(dipole()->realEmissionME()->lastXComb().lastAlphaS(),
+ (double)(dipole()->realEmissionME()->orderInAlphaS()));
+ xme2 *=
+ pow(dipole()->underlyingBornME()->lastXComb().lastAlphaS(),
+ (double)(dipole()->underlyingBornME()->orderInAlphaS()));
+ xme2 *= bornPDFWeight(dipole()->underlyingBornME()->lastScale());
+
return
sqr(hbarc) *
realXComb()->jacobian() *
- realPDFWeight(showerScalesInSubtraction()) *
- couplingWeight(showerScalesInSubtraction()) *
- pdfFactor *
- channelWeight() * realXComb()->lastME2() /
+ subtractionScaleWeight() *
+ xme2 /
(2. * realXComb()->lastSHat());
+
}
double MEMatching::me2() const {
- double bornPDF = bornPDFWeight(showerScalesInSplitting());
- double realPDF = realPDFWeight(showerScalesInSplitting());
+
assert(bornXComb()->lastME2() > 0.0);
- double den =
- bornXComb()->lastME2() * bornPDF;
- if ( bornScreening() )
- den += screeningME2();
- double num =
- dipole()->realEmissionME()->me2() * realPDF;
- num *= pow(bornXComb()->lastSHat()/realXComb()->lastSHat(),2.*(realCXComb()->mePartonData().size())-8.);
- return
- (num/den) *
- (bornXComb()->lastSHat()/realXComb()->lastSHat()) *
- couplingWeight(showerScalesInSplitting());
+
+ double bme2 = bornXComb()->lastME2();
+ bme2 /=
+ pow(dipole()->underlyingBornME()->lastXComb().lastAlphaS(),
+ (double)(dipole()->underlyingBornME()->orderInAlphaS()));
+
+ double rme2 = dipole()->realEmissionME()->me2();
+ rme2 /=
+ pow(dipole()->realEmissionME()->lastXComb().lastAlphaS(),
+ (double)(dipole()->realEmissionME()->orderInAlphaS()));
+ rme2 *=
+ pow(bornXComb()->lastSHat()/realXComb()->lastSHat(),
+ 2.*(realCXComb()->mePartonData().size())-8.);
+
+ return
+ channelWeight() * (rme2/bme2) *
+ splittingScaleWeight();
+
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-void MEMatching::persistentOutput(PersistentOStream & os) const {
- os << theBornScreening << theScreeningPower;
-}
+void MEMatching::persistentOutput(PersistentOStream & ) const {}
-void MEMatching::persistentInput(PersistentIStream & is, int) {
- is >> theBornScreening >> theScreeningPower;
-}
+void MEMatching::persistentInput(PersistentIStream & , int) {}
// *** 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).
DescribeClass<MEMatching,Herwig::ShowerApproximation>
describeHerwigMEMatching("Herwig::MEMatching", "HwMatchbox.so");
void MEMatching::Init() {
static ClassDocumentation<MEMatching> documentation
("MEMatching implements NLO matching with matrix element correction (aka Powheg).");
- static Switch<MEMatching,bool> interfaceBornScreening
- ("BornScreening",
- "Switch on or off Born screening",
- &MEMatching::theBornScreening, true, false, false);
- static SwitchOption interfaceBornScreeningOn
- (interfaceBornScreening,
- "On",
- "Perform Born screening",
- true);
- static SwitchOption interfaceBornScreeningOff
- (interfaceBornScreening,
- "Off",
- "Do not perform Born screening",
- false);
-
- static Parameter<MEMatching,double> interfaceScreeningPower
- ("ScreeningPower",
- "Set the power of pt used in the screening term",
- &MEMatching::theScreeningPower, 2.0, 1.0, 0,
- false, false, Interface::lowerlim);
-
}
diff --git a/MatrixElement/Matchbox/Matching/MEMatching.h b/MatrixElement/Matchbox/Matching/MEMatching.h
--- a/MatrixElement/Matchbox/Matching/MEMatching.h
+++ b/MatrixElement/Matchbox/Matching/MEMatching.h
@@ -1,165 +1,140 @@
// -*- C++ -*-
//
// MEMatching.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_MEMatching_H
#define Herwig_MEMatching_H
//
// This is the declaration of the MEMatching class.
//
#include "Herwig++/MatrixElement/Matchbox/Matching/ShowerApproximation.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief MEMatching implements NLO matching with matrix element correction (aka Powheg).
*
*/
class MEMatching: public Herwig::ShowerApproximation {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
MEMatching();
/**
* The destructor.
*/
virtual ~MEMatching();
//@}
public:
/**
* Return true, if this shower approximation will require a
* splitting generator
*/
virtual bool needsSplittingGenerator() const { return true; }
public:
/**
* Return the shower approximation to the real emission cross
* section for the given pair of Born and real emission
* configurations.
*/
virtual CrossSection dSigHatDR() const;
/**
* Return the shower approximation splitting kernel for the given
* pair of Born and real emission configurations in units of the
* Born center of mass energy squared, and including a weight to
* project onto the splitting given by the dipole used.
*/
virtual double me2() const;
/**
* Generate a weight for the given dipole channel
*/
double channelWeight(int emitter, int emission, int spectator) const;
/**
* Generate a normalized weight taking into account all channels
*/
double channelWeight() const;
- /**
- * Return true, if 'Born screening' is taken into account
- */
- bool bornScreening() const { return theBornScreening; }
-
- /**
- * Return the power of pt used in the screening term
- */
- double screeningPower() const { return theScreeningPower; }
-
- /**
- * Return the screening `matrix element squared'
- */
- double screeningME2() const;
-
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:
/**
- * True, if 'Born screening' should be done
- */
- bool theBornScreening;
-
- /**
- * The power of pt used in the screening term
- */
- double theScreeningPower;
-
- /**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MEMatching & operator=(const MEMatching &);
};
}
#endif /* Herwig_MEMatching_H */
diff --git a/MatrixElement/Matchbox/Matching/ShowerApproximation.cc b/MatrixElement/Matchbox/Matching/ShowerApproximation.cc
--- a/MatrixElement/Matchbox/Matching/ShowerApproximation.cc
+++ b/MatrixElement/Matchbox/Matching/ShowerApproximation.cc
@@ -1,296 +1,463 @@
// -*- C++ -*-
//
// ShowerApproximation.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 ShowerApproximation class.
//
#include "ShowerApproximation.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
using namespace Herwig;
ShowerApproximation::ShowerApproximation()
: HandlerBase(), theBelowCutoff(false),
theFFPtCut(1.0*GeV), theFFScreeningScale(ZERO),
theFIPtCut(1.0*GeV), theFIScreeningScale(ZERO),
theIIPtCut(1.0*GeV), theIIScreeningScale(ZERO),
- theShowerScalesInSubtraction(false),
- theShowerScalesInSplitting(true),
theRestrictPhasespace(true), theHardScaleFactor(1.0),
- theExtrapolationX(0.65) {}
+ theRenormalizationScaleFactor(1.0), theFactorizationScaleFactor(1.0),
+ theExtrapolationX(0.65),
+ theRealEmissionScaleInSubtraction(showerScale),
+ theBornScaleInSubtraction(showerScale),
+ theEmissionScaleInSubtraction(showerScale),
+ theRealEmissionScaleInSplitting(showerScale),
+ theBornScaleInSplitting(showerScale),
+ theEmissionScaleInSplitting(showerScale) {}
ShowerApproximation::~ShowerApproximation() {}
void ShowerApproximation::setDipole(Ptr<SubtractionDipole>::tcptr dip) { theDipole = dip; }
Ptr<SubtractionDipole>::tcptr ShowerApproximation::dipole() const { return theDipole; }
bool ShowerApproximation::isAboveCutoff() const {
if ( dipole()->bornEmitter() > 1 &&
dipole()->bornSpectator() > 1 ) {
return dipole()->lastPt() > ffPtCut();
} else if ( ( dipole()->bornEmitter() > 1 &&
dipole()->bornSpectator() < 2 ) ||
( dipole()->bornEmitter() < 2 &&
dipole()->bornSpectator() > 1 ) ) {
return dipole()->lastPt() > fiPtCut();
} else {
assert(dipole()->bornEmitter() < 2 &&
dipole()->bornSpectator() < 2);
return dipole()->lastPt() > iiPtCut();
}
return true;
}
bool ShowerApproximation::isInShowerPhasespace() const {
if ( !isAboveCutoff() )
return false;
if ( !restrictPhasespace() )
return true;
Energy maxPt = generator()->maximumCMEnergy();
vector<Lorentz5Momentum>::const_iterator p =
bornCXComb()->meMomenta().begin() + 2;
cPDVector::const_iterator pp =
bornCXComb()->mePartonData().begin() + 2;
for ( ; p != bornCXComb()->meMomenta().end(); ++p, ++pp )
if ( (**pp).coloured() )
maxPt = min(maxPt,p->perp());
if ( maxPt == generator()->maximumCMEnergy() )
maxPt = (bornCXComb()->meMomenta()[0] + bornCXComb()->meMomenta()[1]).m();
maxPt *= sqrt(hardScaleFactor());
return dipole()->lastPt() <= maxPt;
}
-Energy2 ShowerApproximation::showerRenormalizationScale() const {
+Energy2 ShowerApproximation::showerEmissionScale() const {
Energy2 mur = sqr(dipole()->lastPt());
if ( dipole()->bornEmitter() > 1 &&
dipole()->bornSpectator() > 1 ) {
return mur + sqr(ffScreeningScale());
} else if ( ( dipole()->bornEmitter() > 1 &&
dipole()->bornSpectator() < 2 ) ||
( dipole()->bornEmitter() < 2 &&
dipole()->bornSpectator() > 1 ) ) {
return mur + sqr(fiScreeningScale());
} else {
assert(dipole()->bornEmitter() < 2 &&
dipole()->bornSpectator() < 2);
return mur + sqr(iiScreeningScale());
}
return mur;
}
-double ShowerApproximation::couplingWeight(bool showerscales) const {
- if ( !showerscales )
- return 1.;
- double hardAlpha = dipole()->realEmissionME()->lastAlphaS();
- Energy2 mur = showerRenormalizationScale();
- mur *= dipole()->realEmissionME()->renormalizationScaleFactor();
- double runAlpha = SM().alphaS(mur);
- return runAlpha/hardAlpha;
+Energy2 ShowerApproximation::bornRenormalizationScale() const {
+ return
+ dipole()->underlyingBornME()->renormalizationScaleFactor() *
+ dipole()->underlyingBornME()->renormalizationScale();
}
-double ShowerApproximation::bornPDFWeight(bool showerscales) const {
+Energy2 ShowerApproximation::bornFactorizationScale() const {
+ return
+ dipole()->underlyingBornME()->factorizationScaleFactor() *
+ dipole()->underlyingBornME()->factorizationScale();
+}
+
+Energy2 ShowerApproximation::realRenormalizationScale() const {
+ return
+ dipole()->realEmissionME()->renormalizationScaleFactor() *
+ dipole()->realEmissionME()->renormalizationScale();
+}
+
+Energy2 ShowerApproximation::realFactorizationScale() const {
+ return
+ dipole()->realEmissionME()->factorizationScaleFactor() *
+ dipole()->realEmissionME()->factorizationScale();
+}
+
+double ShowerApproximation::bornPDFWeight(Energy2 muf) const {
if ( !bornCXComb()->mePartonData()[0]->coloured() &&
!bornCXComb()->mePartonData()[1]->coloured() )
return 1.;
- Energy2 muf;
- if ( showerscales ) {
- muf = showerFactorizationScale();
- } else {
- muf = dipole()->underlyingBornME()->factorizationScale();
- }
- muf *= dipole()->underlyingBornME()->factorizationScaleFactor();
double pdfweight = 1.;
if ( bornCXComb()->mePartonData()[0]->coloured() &&
dipole()->underlyingBornME()->havePDFWeight1() )
pdfweight *= dipole()->underlyingBornME()->pdf1(muf,theExtrapolationX);
if ( bornCXComb()->mePartonData()[1]->coloured() &&
dipole()->underlyingBornME()->havePDFWeight2() )
pdfweight *= dipole()->underlyingBornME()->pdf2(muf,theExtrapolationX);
return pdfweight;
}
-double ShowerApproximation::realPDFWeight(bool showerscales) const {
+double ShowerApproximation::realPDFWeight(Energy2 muf) const {
if ( !realCXComb()->mePartonData()[0]->coloured() &&
!realCXComb()->mePartonData()[1]->coloured() )
return 1.;
- Energy2 muf;
- if ( showerscales ) {
- muf = showerFactorizationScale();
- } else {
- muf = dipole()->realEmissionME()->factorizationScale();
- }
- muf *= dipole()->realEmissionME()->factorizationScaleFactor();
double pdfweight = 1.;
if ( realCXComb()->mePartonData()[0]->coloured() &&
dipole()->realEmissionME()->havePDFWeight1() )
pdfweight *= dipole()->realEmissionME()->pdf1(muf,theExtrapolationX);
if ( realCXComb()->mePartonData()[1]->coloured() &&
dipole()->realEmissionME()->havePDFWeight2() )
pdfweight *= dipole()->realEmissionME()->pdf2(muf,theExtrapolationX);
return pdfweight;
}
+double ShowerApproximation::scaleWeight(int rScale, int bScale, int eScale) const {
+
+ double emissionAlpha = 1.;
+ Energy2 emissionScale = ZERO;
+ if ( eScale == showerScale ) {
+ emissionAlpha = SM().alphaS(showerRenormalizationScale());
+ emissionScale = showerFactorizationScale();
+ } else if ( eScale == realScale ) {
+ emissionAlpha = dipole()->realEmissionME()->lastXComb().lastAlphaS();
+ emissionScale = dipole()->realEmissionME()->lastScale();
+ } else if ( eScale == bornScale ) {
+ emissionAlpha = dipole()->underlyingBornME()->lastXComb().lastAlphaS();
+ emissionScale = dipole()->underlyingBornME()->lastScale();
+ }
+ double emissionPDF = realPDFWeight(emissionScale);
+
+ double couplingFactor = 1.;
+ if ( bScale != rScale ) {
+ double bornAlpha = 1.;
+ if ( bScale == showerScale ) {
+ bornAlpha = SM().alphaS(showerRenormalizationScale());
+ } else if ( bScale == realScale ) {
+ bornAlpha = dipole()->realEmissionME()->lastXComb().lastAlphaS();
+ } else if ( bScale == bornScale ) {
+ bornAlpha = dipole()->underlyingBornME()->lastXComb().lastAlphaS();
+ }
+ double realAlpha = 1.;
+ if ( rScale == showerScale ) {
+ realAlpha = SM().alphaS(showerRenormalizationScale());
+ } else if ( rScale == realScale ) {
+ realAlpha = dipole()->realEmissionME()->lastXComb().lastAlphaS();
+ } else if ( rScale == bornScale ) {
+ realAlpha = dipole()->underlyingBornME()->lastXComb().lastAlphaS();
+ }
+ couplingFactor *=
+ pow(realAlpha/bornAlpha,(double)(dipole()->underlyingBornME()->orderInAlphaS()));
+ }
+
+ Energy2 hardScale = ZERO;
+ if ( bScale == showerScale ) {
+ hardScale = showerFactorizationScale();
+ } else if ( bScale == realScale ) {
+ hardScale = dipole()->realEmissionME()->lastScale();
+ } else if ( bScale == bornScale ) {
+ hardScale = dipole()->underlyingBornME()->lastScale();
+ }
+ double bornPDF = bornPDFWeight(hardScale);
+
+ return
+ emissionAlpha * emissionPDF *
+ couplingFactor / bornPDF;
+
+}
+
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void ShowerApproximation::persistentOutput(PersistentOStream & os) const {
os << theBornXComb << theRealXComb << theTildeXCombs << theDipole << theBelowCutoff
<< ounit(theFFPtCut,GeV) << ounit(theFFScreeningScale,GeV)
<< ounit(theFIPtCut,GeV) << ounit(theFIScreeningScale,GeV)
<< ounit(theIIPtCut,GeV) << ounit(theIIScreeningScale,GeV)
- << theShowerScalesInSubtraction << theShowerScalesInSplitting
<< theRestrictPhasespace << theHardScaleFactor
- << theExtrapolationX;
+ << theRenormalizationScaleFactor << theFactorizationScaleFactor
+ << theExtrapolationX
+ << theRealEmissionScaleInSubtraction << theBornScaleInSubtraction
+ << theEmissionScaleInSubtraction << theRealEmissionScaleInSplitting
+ << theBornScaleInSplitting << theEmissionScaleInSplitting;
}
void ShowerApproximation::persistentInput(PersistentIStream & is, int) {
is >> theBornXComb >> theRealXComb >> theTildeXCombs >> theDipole >> theBelowCutoff
>> iunit(theFFPtCut,GeV) >> iunit(theFFScreeningScale,GeV)
>> iunit(theFIPtCut,GeV) >> iunit(theFIScreeningScale,GeV)
>> iunit(theIIPtCut,GeV) >> iunit(theIIScreeningScale,GeV)
- >> theShowerScalesInSubtraction >> theShowerScalesInSplitting
>> theRestrictPhasespace >> theHardScaleFactor
- >> theExtrapolationX;
+ >> theRenormalizationScaleFactor >> theFactorizationScaleFactor
+ >> theExtrapolationX
+ >> theRealEmissionScaleInSubtraction >> theBornScaleInSubtraction
+ >> theEmissionScaleInSubtraction >> theRealEmissionScaleInSplitting
+ >> theBornScaleInSplitting >> theEmissionScaleInSplitting;
}
// *** 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).
DescribeAbstractClass<ShowerApproximation,HandlerBase>
describeHerwigShowerApproximation("Herwig::ShowerApproximation", "HwMatchbox.so");
void ShowerApproximation::Init() {
static ClassDocumentation<ShowerApproximation> documentation
("ShowerApproximation describes the shower emission to be used "
"in NLO matching.");
static Parameter<ShowerApproximation,Energy> interfaceFFPtCut
("FFPtCut",
"Set the pt infrared cutoff",
&ShowerApproximation::theFFPtCut, GeV, 1.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<ShowerApproximation,Energy> interfaceFIPtCut
("FIPtCut",
"Set the pt infrared cutoff",
&ShowerApproximation::theFIPtCut, GeV, 1.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<ShowerApproximation,Energy> interfaceIIPtCut
("IIPtCut",
"Set the pt infrared cutoff",
&ShowerApproximation::theIIPtCut, GeV, 1.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<ShowerApproximation,Energy> interfaceFFScreeningScale
("FFScreeningScale",
"Set the screening scale",
&ShowerApproximation::theFFScreeningScale, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<ShowerApproximation,Energy> interfaceFIScreeningScale
("FIScreeningScale",
"Set the screening scale",
&ShowerApproximation::theFIScreeningScale, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<ShowerApproximation,Energy> interfaceIIScreeningScale
("IIScreeningScale",
"Set the screening scale",
&ShowerApproximation::theIIScreeningScale, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
- static Switch<ShowerApproximation,bool> interfaceShowerScalesInSubtraction
- ("ShowerScalesInSubtraction",
- "Switch on or off shower scales in the matching subtraction",
- &ShowerApproximation::theShowerScalesInSubtraction, true, false, false);
- static SwitchOption interfaceShowerScalesInSubtractionOn
- (interfaceShowerScalesInSubtraction,
- "On",
- "Use shower scales in the matching subtraction",
- true);
- static SwitchOption interfaceShowerScalesInSubtractionOff
- (interfaceShowerScalesInSubtraction,
- "Off",
- "Use hard process scales in the matching subtraction",
- false);
-
- static Switch<ShowerApproximation,bool> interfaceShowerScalesInSplitting
- ("ShowerScalesInSplitting",
- "Switch on or off shower scales in the splitting generation",
- &ShowerApproximation::theShowerScalesInSplitting, true, false, false);
- static SwitchOption interfaceShowerScalesInSplittingOn
- (interfaceShowerScalesInSplitting,
- "On",
- "Use shower scales in the matching splitting generation",
- true);
- static SwitchOption interfaceShowerScalesInSplittingOff
- (interfaceShowerScalesInSplitting,
- "Off",
- "Use hard process scales in the matching splitting generation",
- false);
-
static Switch<ShowerApproximation,bool> interfaceRestrictPhasespace
("RestrictPhasespace",
"Switch on or off phasespace restrictions",
&ShowerApproximation::theRestrictPhasespace, true, false, false);
static SwitchOption interfaceRestrictPhasespaceOn
(interfaceRestrictPhasespace,
"On",
"Perform phasespace restrictions",
true);
static SwitchOption interfaceRestrictPhasespaceOff
(interfaceRestrictPhasespace,
"Off",
"Do not perform phasespace restrictions",
false);
static Parameter<ShowerApproximation,double> interfaceHardScaleFactor
("HardScaleFactor",
"The hard scale factor.",
&ShowerApproximation::theHardScaleFactor, 1.0, 0.0, 0,
false, false, Interface::lowerlim);
+ static Parameter<ShowerApproximation,double> interfaceRenormalizationScaleFactor
+ ("RenormalizationScaleFactor",
+ "The hard scale factor.",
+ &ShowerApproximation::theRenormalizationScaleFactor, 1.0, 0.0, 0,
+ false, false, Interface::lowerlim);
+
+ static Parameter<ShowerApproximation,double> interfaceFactorizationScaleFactor
+ ("FactorizationScaleFactor",
+ "The hard scale factor.",
+ &ShowerApproximation::theFactorizationScaleFactor, 1.0, 0.0, 0,
+ false, false, Interface::lowerlim);
+
static Parameter<ShowerApproximation,double> interfaceExtrapolationX
("ExtrapolationX",
"The x from which on extrapolation should be performed.",
&ShowerApproximation::theExtrapolationX, 0.65, 0.0, 1.0,
false, false, Interface::limited);
+ static Switch<ShowerApproximation,int> interfaceRealEmissionScaleInSubtraction
+ ("RealEmissionScaleInSubtraction",
+ "Set the scale choice for the real emission cross section in the matching subtraction.",
+ &ShowerApproximation::theRealEmissionScaleInSubtraction, showerScale, false, false);
+ static SwitchOption interfaceRealEmissionScaleInSubtractionRealScale
+ (interfaceRealEmissionScaleInSubtraction,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceRealEmissionScaleInSubtractionBornScale
+ (interfaceRealEmissionScaleInSubtraction,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceRealEmissionScaleInSubtractionShowerScale
+ (interfaceRealEmissionScaleInSubtraction,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
+ static Switch<ShowerApproximation,int> interfaceBornScaleInSubtraction
+ ("BornScaleInSubtraction",
+ "Set the scale choice for the Born cross section in the matching subtraction.",
+ &ShowerApproximation::theBornScaleInSubtraction, showerScale, false, false);
+ static SwitchOption interfaceBornScaleInSubtractionRealScale
+ (interfaceBornScaleInSubtraction,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceBornScaleInSubtractionBornScale
+ (interfaceBornScaleInSubtraction,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceBornScaleInSubtractionShowerScale
+ (interfaceBornScaleInSubtraction,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
+ static Switch<ShowerApproximation,int> interfaceEmissionScaleInSubtraction
+ ("EmissionScaleInSubtraction",
+ "Set the scale choice for the emission in the matching subtraction.",
+ &ShowerApproximation::theEmissionScaleInSubtraction, showerScale, false, false);
+ static SwitchOption interfaceEmissionScaleInSubtractionRealScale
+ (interfaceEmissionScaleInSubtraction,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceEmissionScaleInSubtractionEmissionScale
+ (interfaceEmissionScaleInSubtraction,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceEmissionScaleInSubtractionShowerScale
+ (interfaceEmissionScaleInSubtraction,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
+ static Switch<ShowerApproximation,int> interfaceRealEmissionScaleInSplitting
+ ("RealEmissionScaleInSplitting",
+ "Set the scale choice for the real emission cross section in the splitting.",
+ &ShowerApproximation::theRealEmissionScaleInSplitting, showerScale, false, false);
+ static SwitchOption interfaceRealEmissionScaleInSplittingRealScale
+ (interfaceRealEmissionScaleInSplitting,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceRealEmissionScaleInSplittingBornScale
+ (interfaceRealEmissionScaleInSplitting,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceRealEmissionScaleInSplittingShowerScale
+ (interfaceRealEmissionScaleInSplitting,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
+ static Switch<ShowerApproximation,int> interfaceBornScaleInSplitting
+ ("BornScaleInSplitting",
+ "Set the scale choice for the Born cross section in the splitting.",
+ &ShowerApproximation::theBornScaleInSplitting, showerScale, false, false);
+ static SwitchOption interfaceBornScaleInSplittingRealScale
+ (interfaceBornScaleInSplitting,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceBornScaleInSplittingBornScale
+ (interfaceBornScaleInSplitting,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceBornScaleInSplittingShowerScale
+ (interfaceBornScaleInSplitting,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
+ static Switch<ShowerApproximation,int> interfaceEmissionScaleInSplitting
+ ("EmissionScaleInSplitting",
+ "Set the scale choice for the emission in the splitting.",
+ &ShowerApproximation::theEmissionScaleInSplitting, showerScale, false, false);
+ static SwitchOption interfaceEmissionScaleInSplittingRealScale
+ (interfaceEmissionScaleInSplitting,
+ "RealScale",
+ "Use the real emission scale.",
+ realScale);
+ static SwitchOption interfaceEmissionScaleInSplittingEmissionScale
+ (interfaceEmissionScaleInSplitting,
+ "BornScale",
+ "Use the Born scale.",
+ bornScale);
+ static SwitchOption interfaceEmissionScaleInSplittingShowerScale
+ (interfaceEmissionScaleInSplitting,
+ "ShowerScale",
+ "Use the shower scale",
+ showerScale);
+
}
diff --git a/MatrixElement/Matchbox/Matching/ShowerApproximation.h b/MatrixElement/Matchbox/Matching/ShowerApproximation.h
--- a/MatrixElement/Matchbox/Matching/ShowerApproximation.h
+++ b/MatrixElement/Matchbox/Matching/ShowerApproximation.h
@@ -1,370 +1,503 @@
// -*- C++ -*-
//
// ShowerApproximation.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_ShowerApproximation_H
#define Herwig_ShowerApproximation_H
//
// This is the declaration of the ShowerApproximation class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "Herwig++/MatrixElement/Matchbox/Dipoles/SubtractionDipole.fh"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief ShowerApproximation describes the shower emission to be used
* in NLO matching.
*
*/
class ShowerApproximation: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
ShowerApproximation();
/**
* The destructor.
*/
virtual ~ShowerApproximation();
//@}
public:
/**
* Return true, if this shower approximation will require a
* splitting generator
*/
virtual bool needsSplittingGenerator() const { return false; }
/**
* Return true, if this shower approximation will require tilde
* XCombs for the real phase space point generated
*/
virtual bool needsTildeXCombs() const { return false; }
public:
/**
* Set the XComb object describing the Born process
*/
void setBornXComb(tStdXCombPtr xc) { theBornXComb = xc; }
/**
* Return the XComb object describing the Born process
*/
tStdXCombPtr bornXComb() const { return theBornXComb; }
/**
* Return the XComb object describing the Born process
*/
tcStdXCombPtr bornCXComb() const { return theBornXComb; }
/**
* Set the XComb object describing the real emission process
*/
void setRealXComb(tStdXCombPtr xc) { theRealXComb = xc; }
/**
* Return the XComb object describing the real emission process
*/
tStdXCombPtr realXComb() const { return theRealXComb; }
/**
* Return the XComb object describing the real emission process
*/
tcStdXCombPtr realCXComb() const { return theRealXComb; }
/**
* Set the tilde xcomb objects associated to the real xcomb
*/
void setTildeXCombs(const vector<StdXCombPtr>& xc) { theTildeXCombs = xc; }
/**
* Return the tilde xcomb objects associated to the real xcomb
*/
const vector<StdXCombPtr>& tildeXCombs() const { return theTildeXCombs; }
/**
* Set the dipole in charge for the emission
*/
void setDipole(Ptr<SubtractionDipole>::tcptr);
/**
* Return the dipole in charge for the emission
*/
Ptr<SubtractionDipole>::tcptr dipole() const;
public:
/**
* Return true if one of the recently encountered configutations was
* below the infrared cutoff.
*/
bool belowCutoff() const { return theBelowCutoff; }
/**
* Indicate that one of the recently encountered configutations was
* below the infrared cutoff.
*/
void wasBelowCutoff() { theBelowCutoff = true; }
/**
* Reset the below cutoff flag.
*/
void resetBelowCutoff() { theBelowCutoff = false; }
/**
* Return the pt cut to be applied for final-final dipoles.
*/
Energy ffPtCut() const { return theFFPtCut; }
/**
* Return the pt cut to be applied for final-initial dipoles.
*/
Energy fiPtCut() const { return theFIPtCut; }
/**
* Return the pt cut to be applied for initial-initial dipoles.
*/
Energy iiPtCut() const { return theIIPtCut; }
/**
* Return the screening scale to be applied for final-final dipoles.
*/
Energy ffScreeningScale() const { return theFFScreeningScale; }
/**
* Return the screening scale to be applied for final-initial dipoles.
*/
Energy fiScreeningScale() const { return theFIScreeningScale; }
/**
* Return the screening scale to be applied for initial-initial dipoles.
*/
Energy iiScreeningScale() const { return theIIScreeningScale; }
/**
* Return the shower renormalization scale
*/
- Energy2 showerRenormalizationScale() const;
+ virtual Energy2 showerEmissionScale() const;
+
+ /**
+ * Return the shower renormalization scale
+ */
+ Energy2 showerRenormalizationScale() const {
+ return renormalizationScaleFactor()*showerEmissionScale();
+ }
/**
* Return the shower factorization scale
*/
Energy2 showerFactorizationScale() const {
- return showerRenormalizationScale();
+ return factorizationScaleFactor()*showerEmissionScale();
+ }
+
+ /**
+ * Return the Born renormalization scale
+ */
+ Energy2 bornRenormalizationScale() const;
+
+ /**
+ * Return the Born factorization scale
+ */
+ Energy2 bornFactorizationScale() const;
+
+ /**
+ * Return the real emission renormalization scale
+ */
+ Energy2 realRenormalizationScale() const;
+
+ /**
+ * Return the real emission factorization scale
+ */
+ Energy2 realFactorizationScale() const;
+
+ /**
+ * Enumerate possible scale choices
+ */
+ enum ScaleChoices {
+
+ bornScale = 0,
+ /** Use the born scales */
+
+ realScale = 1,
+ /** Use the real scales */
+
+ showerScale = 2
+ /** Use the shower scales */
+
+ };
+
+ /**
+ * Return the scale choice in the real emission cross section to be
+ * used in the matching subtraction.
+ */
+ int realEmissionScaleInSubtraction() const { return theRealEmissionScaleInSubtraction; }
+
+ /**
+ * Return the scale choice in the born cross section to be
+ * used in the matching subtraction.
+ */
+ int bornScaleInSubtraction() const { return theBornScaleInSubtraction; }
+
+ /**
+ * Return the scale choice in the emission contribution to be
+ * used in the matching subtraction.
+ */
+ int emissionScaleInSubtraction() const { return theEmissionScaleInSubtraction; }
+
+ /**
+ * Return the scale choice in the real emission cross section to be
+ * used in the splitting.
+ */
+ int realEmissionScaleInSplitting() const { return theRealEmissionScaleInSplitting; }
+
+ /**
+ * Return the scale choice in the born cross section to be
+ * used in the splitting.
+ */
+ int bornScaleInSplitting() const { return theBornScaleInSplitting; }
+
+ /**
+ * Return the scale choice in the emission contribution to be
+ * used in the splitting.
+ */
+ int emissionScaleInSplitting() const { return theEmissionScaleInSplitting; }
+
+ /**
+ * Return the scale weight
+ */
+ double scaleWeight(int rScale, int bScale, int eScale) const;
+
+ /**
+ * Return the scale weight for the matching subtraction
+ */
+ double subtractionScaleWeight() const {
+ return scaleWeight(realEmissionScaleInSubtraction(),
+ bornScaleInSubtraction(),
+ emissionScaleInSubtraction());
+ }
+
+ /**
+ * Return the scale weight for the splitting
+ */
+ double splittingScaleWeight() const {
+ return scaleWeight(realEmissionScaleInSplitting(),
+ bornScaleInSplitting(),
+ emissionScaleInSplitting());
}
public:
/**
* Return true, if the phase space restrictions of the dipole shower should
* be applied.
*/
bool restrictPhasespace() const { return theRestrictPhasespace; }
/**
* Return the scale factor for the hard scale
*/
double hardScaleFactor() const { return theHardScaleFactor; }
/**
+ * Get the factorization scale factor
+ */
+ double factorizationScaleFactor() const { return theFactorizationScaleFactor; }
+
+ /**
+ * Get the renormalization scale factor
+ */
+ double renormalizationScaleFactor() const { return theRenormalizationScaleFactor; }
+
+ /**
* Return true, if the shower was able to generate an emission
* leading from the given Born to the given real emission process.
*/
virtual bool isInShowerPhasespace() const;
/**
* Return true, if the shower emission leading from the given Born
* to the given real emission process would have been generated
* above the shower's infrared cutoff.
*/
virtual bool isAboveCutoff() const;
/**
* Return the shower approximation to the real emission cross
* section for the given pair of Born and real emission
* configurations.
*/
virtual CrossSection dSigHatDR() const = 0;
/**
* Return the shower approximation splitting kernel for the given
* pair of Born and real emission configurations in units of the
* Born center of mass energy squared, and including a weight to
* project onto the splitting given by the dipole used.
*/
virtual double me2() const = 0;
/**
- * Return true, if the shower scales should be used in the subtraction
- */
- bool showerScalesInSubtraction() const { return theShowerScalesInSubtraction; }
-
- /**
- * Return true, if the shower scales should be used in splitting generation
- */
- bool showerScalesInSplitting() const { return theShowerScalesInSplitting; }
-
- /**
- * Return the running coupling weight
- */
- double couplingWeight(bool showerscales) const;
-
- /**
* Return the Born PDF weight
*/
- double bornPDFWeight(bool showerscales) const;
+ double bornPDFWeight(Energy2 muF) const;
/**
* Return the real emission PDF weight
*/
- double realPDFWeight(bool showerscales) const;
+ double realPDFWeight(Energy2 muF) const;
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 XComb object describing the Born process
*/
tStdXCombPtr theBornXComb;
/**
* The XComb object describing the real emission process
*/
tStdXCombPtr theRealXComb;
/**
* The tilde xcomb objects associated to the real xcomb
*/
vector<StdXCombPtr> theTildeXCombs;
/**
* The dipole in charge for the emission
*/
Ptr<SubtractionDipole>::tcptr theDipole;
/**
* True if one of the recently encountered configutations was below
* the infrared cutoff.
*/
bool theBelowCutoff;
/**
* The pt cut to be applied for final-final dipoles.
*/
Energy theFFPtCut;
/**
* An optional screening scale for final-final dipoles; see
* DipoleSplittingKernel
*/
Energy theFFScreeningScale;
/**
* The pt cut to be applied for final-initial dipoles.
*/
Energy theFIPtCut;
/**
* An optional screening scale for final-initial dipoles; see
* DipoleSplittingKernel
*/
Energy theFIScreeningScale;
/**
* The pt cut to be applied for initial-initial dipoles.
*/
Energy theIIPtCut;
/**
* An optional screening scale for initial-initial dipoles; see
* DipoleSplittingKernel
*/
Energy theIIScreeningScale;
/**
- * True, if the shower scales should be used in the subtraction
- */
- bool theShowerScalesInSubtraction;
-
- /**
- * True, if the shower scales should be used in splitting generation
- */
- bool theShowerScalesInSplitting;
-
- /**
* True, if the phase space restrictions of the dipole shower should
* be applied.
*/
bool theRestrictPhasespace;
/**
* The scale factor for the hard scale
*/
double theHardScaleFactor;
/**
+ * The scale factor for the renormalization scale
+ */
+ double theRenormalizationScaleFactor;
+
+ /**
+ * The scale factor for the factorization scale
+ */
+ double theFactorizationScaleFactor;
+
+ /**
* The x value from which on we extrapolate PDFs for numerically stable ratios.
*/
double theExtrapolationX;
+ /**
+ * The scale choice in the real emission cross section to be
+ * used in the matching subtraction.
+ */
+ int theRealEmissionScaleInSubtraction;
+
+ /**
+ * The scale choice in the born cross section to be
+ * used in the matching subtraction.
+ */
+ int theBornScaleInSubtraction;
+
+ /**
+ * The scale choice in the emission contribution to be
+ * used in the matching subtraction.
+ */
+ int theEmissionScaleInSubtraction;
+
+ /**
+ * The scale choice in the real emission cross section to be
+ * used in the splitting.
+ */
+ int theRealEmissionScaleInSplitting;
+
+ /**
+ * The scale choice in the born cross section to be
+ * used in the splitting.
+ */
+ int theBornScaleInSplitting;
+
+ /**
+ * The scale choice in the emission contribution to be
+ * used in the splitting.
+ */
+ int theEmissionScaleInSplitting;
+
private:
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
ShowerApproximation & operator=(const ShowerApproximation &);
};
}
#endif /* Herwig_ShowerApproximation_H */
diff --git a/MatrixElement/Matchbox/Phasespace/FlatInvertiblePhasespace.cc b/MatrixElement/Matchbox/Phasespace/FlatInvertiblePhasespace.cc
--- a/MatrixElement/Matchbox/Phasespace/FlatInvertiblePhasespace.cc
+++ b/MatrixElement/Matchbox/Phasespace/FlatInvertiblePhasespace.cc
@@ -1,360 +1,360 @@
// -*- C++ -*-
//
// FlatInvertiblePhasespace.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 FlatInvertiblePhasespace class.
//
#include "FlatInvertiblePhasespace.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "Herwig++/Utilities/GSLBisection.h"
#include "ThePEG/Cuts/Cuts.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
FlatInvertiblePhasespace::FlatInvertiblePhasespace() {}
FlatInvertiblePhasespace::~FlatInvertiblePhasespace() {}
IBPtr FlatInvertiblePhasespace::clone() const {
return new_ptr(*this);
}
IBPtr FlatInvertiblePhasespace::fullclone() const {
return new_ptr(*this);
}
void FlatInvertiblePhasespace::prepare(tStdXCombPtr xc, bool) {
theLastXComb = xc;
}
double FlatInvertiblePhasespace::bisect(double v, double n,
double target, double maxLevel) const {
if ( v != 0.0 && v != 1.0 ) {
double level = 0;
double left = 0;
double right = 1;
double checkV = -1.;
double u = -1;
while ( level < maxLevel ) {
u = (left+right)*pow(0.5,level+1.);
checkV =
pow(u,n+1.)*(n+2.-(n+1.)*u);
if ( log10(abs(1.-checkV/v)) <= target )
break;
left *= 2.;
right *= 2.;
if ( v <= checkV ) {
right -= 1.;
++level;
}
if ( v > checkV ) {
left += 1.;
++level;
}
}
return u;
}
return v;
}
static double flatWeights[7] = {
-1.,-1.,
0.039788735772973833942,
0.00012598255637968550463,
1.3296564302788840628E-7,
7.0167897579949011130E-11,
2.2217170114046130768E-14
};
double FlatInvertiblePhasespace::generateIntermediates(vector<Energy>& K,
const double* r) const {
size_t n = K.size() + 1;
for ( size_t i = 2; i <= n-1; ++i ) {
double u = bisect(r[i-2],n-1-i);
K[i-1] = sqrt(u*sqr(K[i-2]));
}
return flatWeights[n];
}
double FlatInvertiblePhasespace::invertIntermediates(const vector<Energy>& K,
double* r) const {
size_t n = K.size() + 1;
for ( size_t i = 2; i <= n-1; ++i ) {
double u = sqr(K[i-1]/K[i-2]);
r[i-2] = (n+1-i)*pow(u,(double)(n-i)) - (n-i)*pow(u,(double)(n+1-i));
}
return flatWeights[n];
}
double FlatInvertiblePhasespace::generateIntermediates(vector<Energy>& M,
const vector<Energy>& m,
const double* r) const {
size_t n = M.size() + 1;
vector<Energy> K = M;
for ( size_t i = 1; i <= n; ++i )
K[0] -= m[i-1];
double w0 = generateIntermediates(K,r);
M = K;
for ( size_t i = 1; i <= n-1; ++i ) {
for ( size_t k = i; k <= n; ++k )
M[i-1] += m[k-1];
}
double weight = 8.*w0*rho(M[n-2],m[n-1],m[n-2]);
for ( size_t i = 2; i <= n-1; ++i ) {
weight *=
(rho(M[i-2],M[i-1],m[i-2])/rho(K[i-2],K[i-1],ZERO)) * (M[i-1]/K[i-1]);
}
weight *= pow(K[0]/M[0],2.*n-4.);
return weight;
}
double FlatInvertiblePhasespace::invertIntermediates(const vector<Energy>& M,
const vector<Energy>& m,
double* r) const {
size_t n = M.size() + 1;
vector<Energy> K = M;
for ( size_t i = 1; i <= n-1; ++i ) {
for ( size_t k = i; k <= n; ++k )
K[i-1] -= m[k-1];
}
double w0 = invertIntermediates(K,r);
double weight = 8.*w0*rho(M[n-2],m[n-1],m[n-2]);
for ( size_t i = 2; i <= n-1; ++i ) {
weight *=
(rho(M[i-2],M[i-1],m[i-2])/rho(K[i-2],K[i-1],ZERO)) * (M[i-1]/K[i-1]);
}
weight *= pow(K[0]/M[0],2.*n-4.);
return weight;
}
double FlatInvertiblePhasespace::generateKinematics(vector<Lorentz5Momentum>& P,
Energy Ecm,
const double* r) const {
vector<Energy> m;
for ( vector<Lorentz5Momentum>::const_iterator p =
- P.begin(); p != P.end(); ++p )
+ P.begin() + 2; p != P.end(); ++p )
m.push_back(p->mass());
- size_t n = P.size();
+ size_t n = P.size() - 2;
vector<Energy> M(n-1);
M[0] = Ecm;
double weight = generateIntermediates(M,m,r);
M.push_back(m.back());
Lorentz5Momentum Q(M[0]);
Lorentz5Momentum nextQ;
for ( size_t i = 2; i <= n; ++i ) {
Energy q = 4.*M[i-2]*rho(M[i-2],M[i-1],m[i-2]);
double c = 2.*r[n-6+2*i]-1.;
double s = sqrt(1.-sqr(c));
double phi = 2.*Constants::pi*r[n-5+2*i];
double cphi = cos(phi);
double sphi = sqrt(1.-sqr(cphi));
if ( phi > Constants::pi )
sphi = -sphi;
- P[i-2].setX(q*cphi*s);
- P[i-2].setY(q*sphi*s);
- P[i-2].setZ(q*c);
- P[i-2].rescaleEnergy();
- P[i-2].boost(Q.boostVector());
- P[i-2].rescaleEnergy();
+ P[i].setX(q*cphi*s);
+ P[i].setY(q*sphi*s);
+ P[i].setZ(q*c);
+ P[i].rescaleEnergy();
+ P[i].boost(Q.boostVector());
+ P[i].rescaleEnergy();
- nextQ = Q - P[i-2];
+ nextQ = Q - P[i];
nextQ.setMass(M[i-1]);
nextQ.rescaleEnergy();
Q = nextQ;
}
P.back() = Q;
return weight;
}
double FlatInvertiblePhasespace::invertKinematics(const vector<Lorentz5Momentum>& P,
Energy Ecm,
double* r) const {
vector<Energy> m;
for ( vector<Lorentz5Momentum>::const_iterator p =
- P.begin(); p != P.end(); ++p )
+ P.begin() + 2; p != P.end(); ++p )
m.push_back(p->mass());
- size_t n = P.size();
+ size_t n = P.size() - 2;
vector<Energy> M(n-1);
M[0] = Ecm;
vector<Lorentz5Momentum> Q(n-1);
Q[0] = Lorentz5Momentum(M[0]);
for ( size_t i = 2; i <= n-1; ++i ) {
for ( size_t k = i; k <= n; ++k )
- Q[i-1] += P[k-1];
+ Q[i-1] += P[k+1];
M[i-1] = Q[i-1].m();
}
double weight = invertIntermediates(M,m,r);
for ( size_t i = 2; i <= n; ++i ) {
- Lorentz5Momentum p = P[i-2];
+ Lorentz5Momentum p = P[i];
p.boost(-Q[i-2].boostVector());
r[n-6+2*i] = (p.cosTheta()+1.)/2.;
double phi = p.phi();
if ( phi < 0. )
phi = 2.*Constants::pi + phi;
r[n-5+2*i] = phi/(2.*Constants::pi);
}
return weight;
}
double FlatInvertiblePhasespace::generateKinematics(const double* r,
vector<Lorentz5Momentum>& momenta) {
if ( momenta.size() > 3 ) {
cPDVector::const_iterator pd = mePartonData().begin();
vector<Lorentz5Momentum>::iterator p = momenta.begin();
for ( ; pd != mePartonData().end(); ++pd, ++p )
p->setMass((**pd).mass());
double weight = generateKinematics(momenta,sqrt(lastXCombPtr()->lastSHat()),r);
fillDiagramWeights();
return weight;
}
double tau = momenta[2].mass2()/lastXCombPtr()->lastS();
double ltau = log(tau)/2.;
double y = ltau - 2.*r[0]*ltau;
double x1 = sqrt(tau)*exp(y);
double x2 = sqrt(tau)*exp(-y);
ThreeVector<Energy> p1 =
x1*(lastXCombPtr()->lastParticles().first->momentum().vect());
ThreeVector<Energy> p2 =
x2*(lastXCombPtr()->lastParticles().second->momentum().vect());
ThreeVector<Energy> q = p1 + p2;
momenta[0] = Lorentz5Momentum(momenta[0].mass(),p1);
momenta[1] = Lorentz5Momentum(momenta[1].mass(),p2);
momenta[2] = Lorentz5Momentum(momenta[2].mass(),q);
lastXCombPtr()->lastX1X2(make_pair(x1,x2));
lastXCombPtr()->lastSHat((momenta[0]+momenta[1]).m2());
fillDiagramWeights();
return -4.*Constants::pi*ltau;
}
double FlatInvertiblePhasespace::invertKinematics(const vector<Lorentz5Momentum>& momenta,
double* r) const {
if ( momenta.size() > 3 )
return invertKinematics(momenta,(momenta[0]+momenta[1]).m(),r);
double tau = momenta[2].mass2()/lastXCombPtr()->lastS();
double ltau = log(tau)/2.;
r[0] = (ltau - (momenta[0]+momenta[1]).rapidity())/(2.*ltau);
return -4.*Constants::pi*ltau;
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void FlatInvertiblePhasespace::persistentOutput(PersistentOStream &) const {}
void FlatInvertiblePhasespace::persistentInput(PersistentIStream &, int) {}
// *** 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).
DescribeClass<FlatInvertiblePhasespace,MatchboxPhasespace>
describeHerwigFlatInvertiblePhasespace("Herwig::FlatInvertiblePhasespace", "HwMatchbox.so");
void FlatInvertiblePhasespace::Init() {
static ClassDocumentation<FlatInvertiblePhasespace> documentation
("FlatInvertiblePhasespace implements flat, invertible phase space generation.");
}
diff --git a/MatrixElement/Matchbox/Phasespace/TreePhasespace.cc b/MatrixElement/Matchbox/Phasespace/TreePhasespace.cc
--- a/MatrixElement/Matchbox/Phasespace/TreePhasespace.cc
+++ b/MatrixElement/Matchbox/Phasespace/TreePhasespace.cc
@@ -1,255 +1,259 @@
// -*- C++ -*-
//
// TreePhasespace.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 TreePhasespace class.
//
#include "TreePhasespace.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
using namespace Herwig::PhasespaceHelpers;
TreePhasespace::TreePhasespace()
: x0(0.01), xc(1e-4), M0(ZERO), Mc(ZERO) {
lastPhasespaceInfo.x0 = x0;
lastPhasespaceInfo.xc = xc;
lastPhasespaceInfo.M0 = M0;
lastPhasespaceInfo.Mc = Mc;
theIncludeMirrored = true;
}
TreePhasespace::~TreePhasespace() {}
IBPtr TreePhasespace::clone() const {
return new_ptr(*this);
}
IBPtr TreePhasespace::fullclone() const {
return new_ptr(*this);
}
void TreePhasespace::prepare(tStdXCombPtr xco, bool) {
theLastXComb = xco;
lastChannelsIterator = channelMap().find(lastXCombPtr());
if ( lastChannelsIterator == channelMap().end() ) {
map<Ptr<Tree2toNDiagram>::ptr,pair<PhasespaceTree, PhasespaceTree> > channels;
for ( StandardXComb::DiagramVector::const_iterator d =
lastXComb().diagrams().begin(); d != lastXComb().diagrams().end(); ++d ) {
PhasespaceTree tree;
Ptr<Tree2toNDiagram>::ptr diag =
dynamic_ptr_cast<Ptr<Tree2toNDiagram>::ptr>(*d);
tree.setup(*diag);
PhasespaceTree treeMirror;
treeMirror.setupMirrored(*diag, diag->nSpace() - 1);
channels[diag] = make_pair(tree,treeMirror);
}
channelMap()[lastXCombPtr()] = channels;
lastChannelsIterator = channelMap().find(lastXCombPtr());
}
lastPhasespaceInfo.sHat = lastXComb().lastSHat();
lastPhasespaceInfo.sqrtSHat = sqrt(lastXComb().lastSHat());
lastPhasespaceInfo.weight = 1.;
}
double TreePhasespace::generateKinematics(const double* random,
vector<Lorentz5Momentum>& momenta) {
cPDVector::const_iterator pd = mePartonData().begin();
vector<Lorentz5Momentum>::iterator p = momenta.begin();
for ( ; pd != mePartonData().end(); ++pd, ++p )
p->setMass((**pd).mass());
if ( momenta.size() > 3 ) {
size_t nchannels = lastXComb().diagrams().size();
bool doMirror = (UseRandom::rnd() < 0.5) && theIncludeMirrored;
map<Ptr<Tree2toNDiagram>::ptr,
pair <PhasespaceHelpers::PhasespaceTree, PhasespaceHelpers::PhasespaceTree> >::iterator ds =
lastChannels().begin();
advance(ds,(size_t)(random[0]*nchannels));
Ptr<Tree2toNDiagram>::ptr channel = ds->first;
++random;
lastPhasespaceInfo.rnd.numbers = random;
lastPhasespaceInfo.rnd.nRnd = 3*momenta.size() - 10;
try {
if ( !doMirror )
lastChannels()[channel].first.generateKinematics(lastPhasespaceInfo,momenta);
else
lastChannels()[channel].second.generateKinematics(lastPhasespaceInfo,momenta);
} catch (Veto) {
return 0.;
}
if ( !matchConstraints(momenta) )
return 0.;
- fillDiagramWeights(x0);
+ double flatCut = x0;
+ if ( M0 != ZERO )
+ flatCut = M0/sqrt(lastSHat());
+
+ fillDiagramWeights(flatCut);
double sum = 0.;
for ( map<Ptr<Tree2toNDiagram>::ptr,
pair <PhasespaceHelpers::PhasespaceTree, PhasespaceHelpers::PhasespaceTree> >::const_iterator d
= lastChannels().begin(); d != lastChannels().end(); ++d )
sum += diagramWeight(*(d->first));
double piWeight = pow(2.*Constants::pi,(double)(3*(momenta.size()-2)-4));
for ( vector<Lorentz5Momentum>::iterator k = momenta.begin();
k != momenta.end(); ++k )
k->rescaleRho();
return nchannels*lastPhasespaceInfo.weight*diagramWeight(*channel)/(sum*piWeight);
}
double tau = momenta[2].mass2()/lastXCombPtr()->lastS();
double ltau = log(tau)/2.;
double y = ltau - 2.*random[0]*ltau;
double x1 = sqrt(tau)*exp(y);
double x2 = sqrt(tau)*exp(-y);
ThreeVector<Energy> p1 =
x1*(lastXCombPtr()->lastParticles().first->momentum().vect());
ThreeVector<Energy> p2 =
x2*(lastXCombPtr()->lastParticles().second->momentum().vect());
ThreeVector<Energy> q = p1 + p2;
momenta[0] = Lorentz5Momentum(momenta[0].mass(),p1);
momenta[1] = Lorentz5Momentum(momenta[1].mass(),p2);
momenta[2] = Lorentz5Momentum(momenta[2].mass(),q);
lastXCombPtr()->lastX1X2(make_pair(x1,x2));
lastXCombPtr()->lastSHat((momenta[0]+momenta[1]).m2());
fillDiagramWeights();
double weight = -4.*Constants::pi*ltau;
return weight;
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void TreePhasespace::doinit() {
MatchboxPhasespace::doinit();
lastPhasespaceInfo.x0 = x0;
lastPhasespaceInfo.xc = xc;
lastPhasespaceInfo.M0 = M0;
lastPhasespaceInfo.Mc = Mc;
}
void TreePhasespace::doinitrun() {
MatchboxPhasespace::doinitrun();
lastPhasespaceInfo.x0 = x0;
lastPhasespaceInfo.xc = xc;
lastPhasespaceInfo.M0 = M0;
lastPhasespaceInfo.Mc = Mc;
}
void TreePhasespace::persistentOutput(PersistentOStream & os) const {
os << theChannelMap << x0 << xc
<< ounit(M0,GeV) << ounit(Mc,GeV)
<< theIncludeMirrored;
}
void TreePhasespace::persistentInput(PersistentIStream & is, int) {
is >> theChannelMap >> x0 >> xc
>> iunit(M0,GeV) >> iunit(Mc,GeV)
>> theIncludeMirrored;
}
// *** 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).
DescribeClass<TreePhasespace,MatchboxPhasespace>
describeHerwigTreePhasespace("Herwig::TreePhasespace", "HwMatchbox.so");
void TreePhasespace::Init() {
static ClassDocumentation<TreePhasespace> documentation
("TreePhasespace is a multichannel phasespace generator "
"adapting to singularity structures as determined from the matrix "
"elements diagrams.");
static Reference<TreePhasespace,TreePhasespaceChannels> interfaceChannelMap
("ChannelMap",
"Set the object storing the channels.",
&TreePhasespace::theChannelMap, false, false, true, false, false);
static Parameter<TreePhasespace,double> interfaceX0
("X0",
"Set the cut below which flat virtuality sampling is imposed.",
&TreePhasespace::x0, 0.01, 0.0, 0,
false, false, Interface::lowerlim);
static Parameter<TreePhasespace,double> interfaceXC
("XC",
"Set the cut below which no virtualities are generated.",
&TreePhasespace::xc, 1e-4, 0.0, 0,
false, false, Interface::lowerlim);
static Parameter<TreePhasespace,Energy> interfaceM0
("M0",
"Set the cut below which flat virtuality sammpling is imposed.",
&TreePhasespace::M0, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Parameter<TreePhasespace,Energy> interfaceMC
("MC",
"Set the cut below which no virtualities are generated.",
&TreePhasespace::Mc, GeV, 0.0*GeV, 0.0*GeV, 0*GeV,
false, false, Interface::lowerlim);
static Switch<TreePhasespace,bool> interfaceIncludeMirrored
("IncludeMirrored",
"Choose whether to include mirrored diagrams for PS generation",
&TreePhasespace::theIncludeMirrored, true, true, false);
static SwitchOption interfaceIncludeMirroredTrue
(interfaceIncludeMirrored,
"True",
"Use unmirrored and mirrored diagrams",
true);
static SwitchOption interfaceIncludeMirroredFalse
(interfaceIncludeMirrored,
"False",
"Use only unmirrored diagrams",
false);
}
diff --git a/MatrixElement/Matchbox/Tests/HardProcessAnalysis.cc b/MatrixElement/Matchbox/Tests/HardProcessAnalysis.cc
--- a/MatrixElement/Matchbox/Tests/HardProcessAnalysis.cc
+++ b/MatrixElement/Matchbox/Tests/HardProcessAnalysis.cc
@@ -1,211 +1,416 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the HardProcessAnalysis class.
//
#include "HardProcessAnalysis.h"
#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Interface/Parameter.h"
+#include "ThePEG/Interface/Switch.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/EventRecord/SubProcess.h"
#include "ThePEG/EventRecord/SubProcessGroup.h"
+#include "ThePEG/Handlers/EventHandler.h"
+
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
-HardProcessAnalysis::HardProcessAnalysis() {}
+HardProcessAnalysis::HardProcessAnalysis()
+ : theNBins(100), theUnitWeights(false),
+ theSplitInitialStates(true),
+ thePartonsAreJets(false) {}
HardProcessAnalysis::~HardProcessAnalysis() {}
#ifndef LWH_AIAnalysisFactory_H
#ifndef LWH
#define LWH ThePEGLWH
#endif
#include "ThePEG/Analysis/LWH/AnalysisFactory.h"
#endif
-HardProcessAnalysis::Histograms::Histograms(Energy ECM) {
+HardProcessAnalysis::Histograms::Histograms(Energy ECM, unsigned int theNBins) {
- size_t nbins = 100;
-
- vector<double> logBins(nbins+1);
- double logLow = 0.1;
- double logUp = ECM/GeV;
- double cLog = log10(logUp/logLow)/nbins;
- for ( size_t k = 0; k < nbins+1; ++k )
- logBins[k] = logLow*pow(10.0,cLog*k);
-
- energy = new_ptr(Histogram(logBins));
-
- logUp = ECM/GeV/4.;
- cLog = log10(logUp/logLow)/nbins;
- for ( size_t k = 0; k < nbins+1; ++k )
+ vector<double> logBins(theNBins+1);
+ double logLow = 1.0;
+ double logUp = ECM/GeV/4.;
+ double cLog = log10(logUp/logLow)/theNBins;
+ for ( size_t k = 0; k < theNBins+1; ++k )
logBins[k] = logLow*pow(10.0,cLog*k);
transverse = new_ptr(Histogram(logBins));
- cosTheta = new_ptr(Histogram(-1.,1.,nbins));
+ rapidity = new_ptr(Histogram(-7.,7.,theNBins));
- rapidity = new_ptr(Histogram(-7.,7.,nbins));
-
- phi = new_ptr(Histogram(-Constants::pi,Constants::pi,nbins));
+ phi = new_ptr(Histogram(-Constants::pi,Constants::pi,theNBins));
}
void HardProcessAnalysis::Histograms::fill(const Lorentz5Momentum& p, double weight) {
- energy->addWeighted(p.t()/GeV,weight);
transverse->addWeighted(p.perp()/GeV,weight);
- cosTheta->addWeighted(p.cosTheta(),weight);
rapidity->addWeighted(p.rapidity(),weight);
phi->addWeighted(p.phi(),weight);
}
-void HardProcessAnalysis::Histograms::finalize(const string& subpro,
- size_t legid) {
+void HardProcessAnalysis::Histograms::finalize(ostream& dat,
+ ostream& plot,
+ const string& subpro,
+ size_t legid,
+ double norm,
+ bool theUnitWeights) {
- energy->normaliseToCrossSection();
- transverse->normaliseToCrossSection();
- cosTheta->normaliseToCrossSection();
- rapidity->normaliseToCrossSection();
- phi->normaliseToCrossSection();
+ transverse->prefactor(norm);
+ rapidity->prefactor(norm);
+ phi->prefactor(norm);
ostringstream prefix;
prefix << subpro << "_" << legid;
- string energyName = prefix.str() + "_energy.dat";
- ofstream energyOut(energyName.c_str());
- energy->rivetOutput(energyOut,"HardProcessAnalysis",prefix.str() + "_energy",
- "Energy of " + prefix.str(),"$E$/GeV","${\\rm d}\\sigma/{\\rm d}E$/(nb/GeV)");
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << prefix.str() << "_transverse\n"
+ << "Title=Transverse momentum of " << prefix.str() << "\n"
+ << "XLabel=" << "$p_\\perp$/GeV" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}p_\\perp$/(nb/GeV)" << "\n"
+ << "LogX=1\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
- string transverseName = prefix.str() + "_transverse.dat";
- ofstream transverseOut(transverseName.c_str());
- transverse->rivetOutput(transverseOut,"HardProcessAnalysis",prefix.str() + "_transverse",
- "Transverse momentum of " + prefix.str(),"$p_\\perp$/GeV","${\\rm d}\\sigma/{\\rm d}p_\\perp$/(nb/GeV)");
- string costhetaName = prefix.str() + "_costheta.dat";
- ofstream costhetaOut(costhetaName.c_str());
- cosTheta->rivetOutput(costhetaOut,"HardProcessAnalysis",prefix.str() + "_costheta",
- "Polar angle of " + prefix.str(),"$\\cos\\theta$","${\\rm d}\\sigma/{\\rm d}\\cos\\theta$/nb");
+ transverse->rivetOutput(dat,prefix.str() + "_transverse",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
- string rapidityName = prefix.str() + "_rapidity.dat";
- ofstream rapidityOut(rapidityName.c_str());
- rapidity->rivetOutput(rapidityOut,"HardProcessAnalysis",prefix.str() + "_rapidity",
- "Rapidity of " + prefix.str(),"$y$","${\\rm d}\\sigma/{\\rm d}y$/nb");
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << prefix.str() << "_rapidity\n"
+ << "Title=Rapidity of " << prefix.str() << "\n"
+ << "XLabel=" << "$y$" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}y$/nb" << "\n"
+ << "LogX=0\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
- string phiName = prefix.str() + "_phi.dat";
- ofstream phiOut(phiName.c_str());
- phi->rivetOutput(phiOut,"HardProcessAnalysis",prefix.str() + "_phi",
- "Azimuthal angle of " + prefix.str(),"$\\phi$","${\\rm d}\\sigma/{\\rm d}\\phi$/nb");
+ rapidity->rivetOutput(dat,prefix.str() + "_rapidity",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << prefix.str() << "_phi\n"
+ << "Title=Azimuthal angle of " << prefix.str() << "\n"
+ << "XLabel=" << "$\\phi$" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}\\phi$/nb" << "\n"
+ << "LogX=0\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
+
+ phi->rivetOutput(dat,prefix.str() + "_phi",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
}
-struct SortIdEnergy {
+struct SortedInPt {
+ bool partonsAreJets;
+ explicit SortedInPt(bool newPartonsAreJets = false)
+ : partonsAreJets(newPartonsAreJets) {}
inline bool operator()(PPtr a, PPtr b) const {
- if ( a->id() < b->id() )
- return true;
- if ( a->momentum().t() > b->momentum().t() )
- return true;
- return false;
+ long aId = a->id();
+ if ( partonsAreJets && a->coloured() )
+ aId = 21;
+ long bId = b->id();
+ if ( partonsAreJets && b->coloured() )
+ bId = 21;
+ if ( aId != bId )
+ return ( aId < bId );
+ return ( a->momentum().perp() > b->momentum().perp() );
}
};
struct GetName {
+ bool partonsAreJets;
+ explicit GetName(bool newPartonsAreJets = false)
+ : partonsAreJets(newPartonsAreJets) {}
inline string operator()(PPtr p) const {
- return p->PDGName();
+ if ( partonsAreJets && p->coloured() )
+ return "j";
+ string res = p->PDGName();
+ string::size_type pos = res.find("+");
+ while ( pos != string::npos ) {
+ res.replace(pos,1,"plus");
+ pos = res.find("+");
+ }
+ pos = res.find("-");
+ while ( pos != string::npos ) {
+ res.replace(pos,1,"minus");
+ pos = res.find("-");
+ }
+ return res;
}
};
void HardProcessAnalysis::fill(PPair in, ParticleVector out, double weight) {
- sort(out.begin(),out.end(),SortIdEnergy());
+ sort(out.begin(),out.end(),SortedInPt());
vector<string> proc;
- proc.push_back(in.first->PDGName());
- proc.push_back(in.second->PDGName());
+ if ( theSplitInitialStates ) {
+ proc.push_back(GetName()(in.first));
+ proc.push_back(GetName()(in.second));
+ }
std::transform(out.begin(),out.end(),
- back_inserter(proc),GetName());
- vector<Histograms>& data = histogramData[proc];
- if ( data.empty() )
- data.resize(out.size(),Histograms(generator()->maximumCMEnergy()));
+ back_inserter(proc),GetName(thePartonsAreJets));
+ AllHistograms& data = histogramData[proc];
+ if ( data.outgoing.empty() ) {
+ for ( size_t k = 0; k < out.size(); ++k )
+ data.outgoing.push_back(Histograms(generator()->maximumCMEnergy(),theNBins));
+ vector<double> logBins(theNBins+1);
+ double logLow = 1.0e-6;
+ double logUp = 1.0;
+ double cLog = log10(logUp/logLow)/theNBins;
+ for ( size_t k = 0; k < theNBins+1; ++k )
+ logBins[k] = logLow*pow(10.0,cLog*k);
+ data.x1 = new_ptr(Histogram(logBins));
+ data.x2 = new_ptr(Histogram(logBins));
+ logUp = generator()->maximumCMEnergy()/GeV;
+ logLow = 1.0;
+ cLog = log10(logUp/logLow)/theNBins;
+ for ( size_t k = 0; k < theNBins+1; ++k )
+ logBins[k] = logLow*pow(10.0,cLog*k);
+ data.sshat = new_ptr(Histogram(logBins));
+ data.rapidity = new_ptr(Histogram(-7.,7.,theNBins));
+ }
ParticleVector::const_iterator p = out.begin();
- vector<Histograms>::iterator h = data.begin();
+ vector<Histograms>::iterator h = data.outgoing.begin();
for ( ; p != out.end(); ++p, ++h )
h->fill((**p).momentum(),weight);
+ double y = (in.first->momentum() + in.second->momentum()).rapidity();
+ data.rapidity->addWeighted(y,weight);
+ Energy2 shat = (in.first->momentum() + in.second->momentum()).m2();
+ data.sshat->addWeighted(sqrt(shat)/GeV,weight);
+ double tau = shat/sqr(generator()->maximumCMEnergy());
+ double x1 = tau*exp(y);
+ double x2 = tau*exp(-y);
+ data.x1->addWeighted(x1,weight);
+ data.x2->addWeighted(x2,weight);
}
void HardProcessAnalysis::analyze(tEventPtr event, long ieve, int loop, int state) {
AnalysisHandler::analyze(event, ieve, loop, state);
tSubProPtr sub = event->primarySubProcess();
Ptr<SubProcessGroup>::tptr grp =
dynamic_ptr_cast<Ptr<SubProcessGroup>::tptr>(sub);
- fill(sub->incoming(),sub->outgoing(),event->weight()*sub->groupWeight());
+ double weight = !theUnitWeights ? event->weight()*sub->groupWeight() : 1.0;
+ fill(sub->incoming(),sub->outgoing(),weight);
if ( grp ) {
for ( SubProcessVector::const_iterator s = grp->dependent().begin();
s != grp->dependent().end(); ++s ) {
- fill((**s).incoming(),(**s).outgoing(),event->weight()*(**s).groupWeight());
+ weight = !theUnitWeights ? event->weight()*(**s).groupWeight() : 1.0;
+ fill((**s).incoming(),(**s).outgoing(),weight);
}
}
}
void HardProcessAnalysis::dofinish() {
+
AnalysisHandler::dofinish();
- for ( map<vector<string>,vector<Histograms> >::iterator h =
+
+ ofstream dat(!theUnitWeights ? "HardProcessAnalysis.dat" : "HardProcessAnalysisFlat.dat");
+ ofstream plot(!theUnitWeights ? "HardProcessAnalysis.plot" : "HardProcessAnalysisFlat.plot");
+
+ for ( map<vector<string>,AllHistograms>::iterator h =
histogramData.begin(); h != histogramData.end(); ++h ) {
string subpro;
for ( vector<string>::const_iterator p = h->first.begin();
p != h->first.end(); ++p ) {
subpro += *p + (p != --(h->first.end()) ? "_" : "");
}
- for ( size_t k = 0; k < h->second.size(); ++k )
- h->second[k].finalize(subpro,k+2);
+ for ( size_t k = 0; k < h->second.outgoing.size(); ++k )
+ h->second.outgoing[k].finalize(dat,plot,subpro,k+2,
+ generator()->eventHandler()->integratedXSec()/nanobarn,
+ theUnitWeights);
+
+ h->second.x1->prefactor(generator()->eventHandler()->integratedXSec()/nanobarn);
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << subpro << "_x1\n"
+ << "Title=Momentum fraction of first parton in " << subpro << "\n"
+ << "XLabel=" << "$x_1$" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}x_1$/nb" << "\n"
+ << "LogX=1\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
+
+ h->second.x1->rivetOutput(dat,subpro + "_x1",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
+
+ h->second.x2->prefactor(generator()->eventHandler()->integratedXSec()/nanobarn);
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << subpro << "_x2\n"
+ << "Title=Momentum fraction of second parton in " << subpro << "\n"
+ << "XLabel=" << "$x_2$" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}x_2$/nb" << "\n"
+ << "LogX=1\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
+
+ h->second.x2->rivetOutput(dat,subpro + "_x2",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
+
+ h->second.rapidity->prefactor(generator()->eventHandler()->integratedXSec()/nanobarn);
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << subpro << "_y\n"
+ << "Title=Rapidity in " << subpro << "\n"
+ << "XLabel=" << "$y$" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}y$/nb" << "\n"
+ << "LogX=0\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
+
+ h->second.rapidity->rivetOutput(dat,subpro + "_y",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
+
+ h->second.sshat->prefactor(generator()->eventHandler()->integratedXSec()/nanobarn);
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/"
+ << subpro << "_sshat\n"
+ << "Title=Partonic centre of mass energy in " << subpro << "\n"
+ << "XLabel=" << "$\\sqrt{\\hat{s}}$/GeV" << "\n"
+ << "YLabel=" << "${\\rm d}\\sigma/{\\rm d}\\sqrt{\\hat{s}}$/(nb/GeV)" << "\n"
+ << "LogX=1\n"
+ << "LogY=1\n"
+ << "# END PLOT\n\n";
+
+ h->second.sshat->rivetOutput(dat,subpro + "_sshat",!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat");
+ dat << "\n";
+
}
+
+ Energy ECM = generator()->maximumCMEnergy();
+ CrossSection xsec = generator()->eventHandler()->integratedXSec();
+ CrossSection xsecErr = generator()->eventHandler()->integratedXSecErr();
+
+ dat << "# BEGIN HISTOGRAM /"
+ << (!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat")
+ << "/xsec\n"
+ << "AidaPath=/"
+ << (!theUnitWeights ? "HardProcessAnalysis" : "HardProcessAnalysisFlat")
+ << "/xsec\n"
+ << (ECM/GeV - 10.) << "\t"
+ << (ECM/GeV + 10.) << "\t"
+ << (xsec/nanobarn) << "\t"
+ << (xsecErr/nanobarn) << "\n"
+ << "# END HISTOGRAM\n";
+
+ plot << "# BEGIN PLOT /HardProcessAnalysis" << (!theUnitWeights ? "" : "Flat") << "/xsec\n"
+ << "Title=Total cross section\n"
+ << "XLabel=" << "$\\sqrt{S}$/GeV" << "\n"
+ << "YLabel=" << "$\\sigma(\\sqrt(S))$/nb" << "\n"
+ << "LogX=0\n"
+ << "LogY=0\n"
+ << "# END PLOT\n\n";
+
}
void HardProcessAnalysis::doinitrun() {
AnalysisHandler::doinitrun();
// *** ATTENTION *** histogramFactory().registerClient(this); // Initialize histograms.
// *** ATTENTION *** histogramFactory().mkdirs("/SomeDir"); // Put histograms in specal directory.
}
IBPtr HardProcessAnalysis::clone() const {
return new_ptr(*this);
}
IBPtr HardProcessAnalysis::fullclone() const {
return new_ptr(*this);
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
-void HardProcessAnalysis::persistentOutput(PersistentOStream &) const {}
+void HardProcessAnalysis::persistentOutput(PersistentOStream & os) const {
+ os << theNBins << theUnitWeights << theSplitInitialStates << thePartonsAreJets;
+}
-void HardProcessAnalysis::persistentInput(PersistentIStream &, int) {}
+void HardProcessAnalysis::persistentInput(PersistentIStream & is, int) {
+ is >> theNBins >> theUnitWeights >> theSplitInitialStates >> thePartonsAreJets;
+}
// *** 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).
DescribeClass<HardProcessAnalysis,AnalysisHandler>
- describeHerwigHardProcessAnalysis("Herwig::HardProcessAnalysis", "HardProcessAnalysis.so");
+ describeHerwigHardProcessAnalysis("Herwig::HardProcessAnalysis", "HwMatchbox.so");
void HardProcessAnalysis::Init() {
static ClassDocumentation<HardProcessAnalysis> documentation
("There is no documentation for the HardProcessAnalysis class");
+ static Parameter<HardProcessAnalysis,unsigned int> interfaceNBins
+ ("NBins",
+ "The number of bins to use",
+ &HardProcessAnalysis::theNBins, 100, 1, 0,
+ false, false, Interface::lowerlim);
+
+ static Switch<HardProcessAnalysis,bool> interfaceUnitWeights
+ ("UnitWeights",
+ "Use unit weights",
+ &HardProcessAnalysis::theUnitWeights, false, false, false);
+ static SwitchOption interfaceUnitWeightsYes
+ (interfaceUnitWeights,
+ "Yes",
+ "Use unit weights",
+ true);
+ static SwitchOption interfaceUnitWeightsNo
+ (interfaceUnitWeights,
+ "No",
+ "Do not use unit weights",
+ false);
+
+ static Switch<HardProcessAnalysis,bool> interfaceSplitInitialStates
+ ("SplitInitialStates",
+ "Distinguish by initial state",
+ &HardProcessAnalysis::theSplitInitialStates, true, false, false);
+ static SwitchOption interfaceSplitInitialStatesYes
+ (interfaceSplitInitialStates,
+ "Yes",
+ "",
+ true);
+ static SwitchOption interfaceSplitInitialStatesNo
+ (interfaceSplitInitialStates,
+ "No",
+ "",
+ false);
+
+ static Switch<HardProcessAnalysis,bool> interfacePartonsAreJets
+ ("PartonsAreJets",
+ "Treat each parton as a jet.",
+ &HardProcessAnalysis::thePartonsAreJets, false, false, false);
+ static SwitchOption interfacePartonsAreJetsYes
+ (interfacePartonsAreJets,
+ "Yes",
+ "",
+ true);
+ static SwitchOption interfacePartonsAreJetsNo
+ (interfacePartonsAreJets,
+ "No",
+ "",
+ false);
+
}
diff --git a/MatrixElement/Matchbox/Tests/HardProcessAnalysis.h b/MatrixElement/Matchbox/Tests/HardProcessAnalysis.h
--- a/MatrixElement/Matchbox/Tests/HardProcessAnalysis.h
+++ b/MatrixElement/Matchbox/Tests/HardProcessAnalysis.h
@@ -1,201 +1,247 @@
// -*- C++ -*-
#ifndef Herwig_HardProcessAnalysis_H
#define Herwig_HardProcessAnalysis_H
//
// This is the declaration of the HardProcessAnalysis class.
//
#include "ThePEG/Handlers/AnalysisHandler.h"
#include "Herwig++/Utilities/Histogram.h"
namespace Herwig {
using namespace ThePEG;
/**
* Here is the documentation of the HardProcessAnalysis class.
*
* @see \ref HardProcessAnalysisInterfaces "The interfaces"
* defined for HardProcessAnalysis.
*/
class HardProcessAnalysis: public AnalysisHandler {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
HardProcessAnalysis();
/**
* The destructor.
*/
virtual ~HardProcessAnalysis();
//@}
public:
/** @name Virtual functions required by the AnalysisHandler class. */
//@{
/**
* Analyze a given Event. Note that a fully generated event
* may be presented several times, if it has been manipulated in
* between. The default version of this function will call transform
* to make a lorentz transformation of the whole event, then extract
* all final state particles and call analyze(tPVector) of this
* analysis object and those of all associated analysis objects. The
* default version will not, however, do anything on events which
* have not been fully generated, or have been manipulated in any
* way.
* @param event pointer to the Event to be analyzed.
* @param ieve the event number.
* @param loop the number of times this event has been presented.
* If negative the event is now fully generated.
* @param state a number different from zero if the event has been
* manipulated in some way since it was last presented.
*/
virtual void analyze(tEventPtr event, long ieve, int loop, int state);
//@}
protected:
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish();
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.
*/
HardProcessAnalysis & operator=(const HardProcessAnalysis &);
/**
* Differential information per outgoing parton
*/
struct Histograms {
/**
* The constructor
*/
Histograms() {}
/**
* The constructor
*/
- explicit Histograms(Energy ECM);
+ explicit Histograms(Energy ECM, unsigned int theNBins);
/**
* Analyse given momentum
*/
void fill(const Lorentz5Momentum& p, double weight);
/**
* Finalize given process id and cross section.
*/
- void finalize(const string& subpro,
- size_t legid);
-
- /**
- * Energy spectrum
- */
- HistogramPtr energy;
+ void finalize(ostream& dat,
+ ostream& plot,
+ const string& subpro,
+ size_t legid,
+ double norm,
+ bool theUnitWeights);
/**
* Pt spectrum
*/
HistogramPtr transverse;
/**
- * Polar angle distribution
- */
- HistogramPtr cosTheta;
-
- /**
* Rapidity distribution
*/
HistogramPtr rapidity;
/**
* Azimuthal angle distribution
*/
HistogramPtr phi;
};
/**
+ * Outgoing partons and x distributions
+ */
+ struct AllHistograms {
+
+ /**
+ * Outgoing partons
+ */
+ vector<Histograms> outgoing;
+
+ /**
+ * x1 distribution
+ */
+ HistogramPtr x1;
+
+ /**
+ * x2 distribution
+ */
+ HistogramPtr x2;
+
+ /**
+ * sqrt(shat) distribution
+ */
+ HistogramPtr sshat;
+
+ /**
+ * y distribution
+ */
+ HistogramPtr rapidity;
+
+ };
+
+ /**
* Histograms per subprocess
*/
- map<vector<string>,vector<Histograms> > histogramData;
+ map<vector<string>,AllHistograms> histogramData;
/**
* Analyze a given final state
*/
void fill(PPair, ParticleVector, double);
+ /**
+ * The number of bins to use
+ */
+ unsigned int theNBins;
+
+ /**
+ * True, if unit weights should be booked
+ */
+ bool theUnitWeights;
+
+ /**
+ * True, if subprocesses should be distinguished by initial state
+ */
+ bool theSplitInitialStates;
+
+ /**
+ * True, if partons should be handled as jets irrespective of flavour
+ */
+ bool thePartonsAreJets;
+
};
}
#endif /* Herwig_HardProcessAnalysis_H */
diff --git a/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.cc b/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.cc
--- a/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.cc
+++ b/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.cc
@@ -1,96 +1,100 @@
// -*- C++ -*-
//
// MatchboxLeptonMassScale.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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 MatchboxLeptonMassScale class.
//
#include "MatchboxLeptonMassScale.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
MatchboxLeptonMassScale::MatchboxLeptonMassScale() {}
MatchboxLeptonMassScale::~MatchboxLeptonMassScale() {}
IBPtr MatchboxLeptonMassScale::clone() const {
return new_ptr(*this);
}
IBPtr MatchboxLeptonMassScale::fullclone() const {
return new_ptr(*this);
}
Energy2 MatchboxLeptonMassScale::renormalizationScale() const {
int firstLepton = -1;
int secondLepton = -1;
for ( size_t k = 0; k < mePartonData().size(); ++k ) {
if ( abs(mePartonData()[k]->id()) > 10 &&
abs(mePartonData()[k]->id()) < 17 ) {
if ( firstLepton < 0 ) {
firstLepton = k;
} else if ( secondLepton < 0 ) {
secondLepton = k;
} else break;
}
}
if ( (firstLepton < 2 && secondLepton > 1) ||
(firstLepton > 1 && secondLepton < 2) )
return abs((meMomenta()[firstLepton] -
meMomenta()[secondLepton]).m2());
return
(meMomenta()[firstLepton] +
meMomenta()[secondLepton]).m2();
}
Energy2 MatchboxLeptonMassScale::factorizationScale() const {
return renormalizationScale();
}
+Energy2 MatchboxLeptonMassScale::renormalizationScaleQED() const {
+ return renormalizationScale();
+}
+
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void MatchboxLeptonMassScale::persistentOutput(PersistentOStream &) const {}
void MatchboxLeptonMassScale::persistentInput(PersistentIStream &, int) {}
// *** 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).
DescribeClass<MatchboxLeptonMassScale,MatchboxScaleChoice>
describeHerwigMatchboxLeptonMassScale("Herwig::MatchboxLeptonMassScale", "HwMatchbox.so");
void MatchboxLeptonMassScale::Init() {
static ClassDocumentation<MatchboxLeptonMassScale> documentation
("MatchboxLeptonMassScale implements scale choices related "
"to lepton pair invariant masses.");
}
diff --git a/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.h b/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.h
--- a/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.h
+++ b/MatrixElement/Matchbox/Utility/MatchboxLeptonMassScale.h
@@ -1,120 +1,123 @@
// -*- C++ -*-
//
// MatchboxLeptonMassScale.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_MatchboxLeptonMassScale_H
#define Herwig_MatchboxLeptonMassScale_H
//
// This is the declaration of the MatchboxLeptonMassScale class.
//
#include "Herwig++/MatrixElement/Matchbox/Utility/MatchboxScaleChoice.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief MatchboxLeptonMassScale implements scale choices related
* to lepton pair invariant masses.
*
*/
class MatchboxLeptonMassScale: public MatchboxScaleChoice {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
MatchboxLeptonMassScale();
/**
* The destructor.
*/
virtual ~MatchboxLeptonMassScale();
//@}
public:
/**
- * Return the renormalization scale. This default version returns
- * shat.
+ * Return the renormalization scale.
*/
virtual Energy2 renormalizationScale() const;
/**
- * Return the factorization scale. This default version returns
- * shat.
+ * Return the factorization scale.
*/
virtual Energy2 factorizationScale() const;
+ /**
+ * Return the QED renormalization scale.
+ */
+ virtual Energy2 renormalizationScaleQED() const;
+
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.
*/
MatchboxLeptonMassScale & operator=(const MatchboxLeptonMassScale &);
};
}
#endif /* Herwig_MatchboxLeptonMassScale_H */
diff --git a/MatrixElement/Matchbox/Utility/MatchboxLeptonPtScale.h b/MatrixElement/Matchbox/Utility/MatchboxLeptonPtScale.h
--- a/MatrixElement/Matchbox/Utility/MatchboxLeptonPtScale.h
+++ b/MatrixElement/Matchbox/Utility/MatchboxLeptonPtScale.h
@@ -1,127 +1,123 @@
// -*- C++ -*-
//
// MatchboxLeptonPtScale.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_MatchboxLeptonPtScale_H
#define Herwig_MatchboxLeptonPtScale_H
//
// This is the declaration of the MatchboxLeptonPtScale class.
//
#include "Herwig++/MatrixElement/Matchbox/Utility/MatchboxScaleChoice.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief MatchboxLeptonPtScale implements scale choices related
* to lepton pair transverse momenta.
*
*/
class MatchboxLeptonPtScale: public MatchboxScaleChoice {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
MatchboxLeptonPtScale();
/**
* The destructor.
*/
virtual ~MatchboxLeptonPtScale();
//@}
public:
/**
- * Return the renormalization scale. This default version returns
- * shat.
+ * Return the renormalization scale.
*/
virtual Energy2 renormalizationScale() const;
/**
- * Return the factorization scale. This default version returns
- * shat.
+ * Return the factorization scale.
*/
virtual Energy2 factorizationScale() const;
/**
- * Return the QED renormalization scale. This default version returns
- * shat.
+ * Return the QED renormalization scale.
*/
virtual Energy2 renormalizationScaleQED() const;
-
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.
*/
MatchboxLeptonPtScale & operator=(const MatchboxLeptonPtScale &);
};
}
#endif /* Herwig_MatchboxLeptonPtScale_H */
diff --git a/MatrixElement/Matchbox/Utility/MatchboxParticlePtScale.h b/MatrixElement/Matchbox/Utility/MatchboxParticlePtScale.h
--- a/MatrixElement/Matchbox/Utility/MatchboxParticlePtScale.h
+++ b/MatrixElement/Matchbox/Utility/MatchboxParticlePtScale.h
@@ -1,126 +1,124 @@
// -*- C++ -*-
//
// MatchboxParticlePtScale.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_MatchboxParticlePtScale_H
#define Herwig_MatchboxParticlePtScale_H
//
// This is the declaration of the MatchboxParticlePtScale class.
//
#include "Herwig++/MatrixElement/Matchbox/Utility/MatchboxScaleChoice.h"
#include "ThePEG/Cuts/JetFinder.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief MatchboxParticlePtScale implements scale choices related to transverse momenta.
*
*/
class MatchboxParticlePtScale: public MatchboxScaleChoice {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
MatchboxParticlePtScale();
/**
* The destructor.
*/
virtual ~MatchboxParticlePtScale();
//@}
public:
/**
- * Return the renormalization scale. This default version returns
- * shat.
+ * Return the renormalization scale.
*/
virtual Energy2 renormalizationScale() const;
/**
- * Return the factorization scale. This default version returns
- * shat.
+ * Return the factorization scale.
*/
virtual Energy2 factorizationScale() const;
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;
//@}
private:
/**
* Reference to the matcher
*/
Ptr<MatcherBase>::ptr theMatcher;
// 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.
*/
MatchboxParticlePtScale & operator=(const MatchboxParticlePtScale &);
};
}
#endif /* Herwig_MatchboxParticlePtScale_H */
diff --git a/MatrixElement/Matchbox/Utility/MatchboxPtScale.h b/MatrixElement/Matchbox/Utility/MatchboxPtScale.h
--- a/MatrixElement/Matchbox/Utility/MatchboxPtScale.h
+++ b/MatrixElement/Matchbox/Utility/MatchboxPtScale.h
@@ -1,126 +1,124 @@
// -*- C++ -*-
//
// MatchboxPtScale.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 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_MatchboxPtScale_H
#define Herwig_MatchboxPtScale_H
//
// This is the declaration of the MatchboxPtScale class.
//
#include "Herwig++/MatrixElement/Matchbox/Utility/MatchboxScaleChoice.h"
#include "ThePEG/Cuts/JetFinder.h"
namespace Herwig {
using namespace ThePEG;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief MatchboxPtScale implements scale choices related to transverse momenta.
*
*/
class MatchboxPtScale: public MatchboxScaleChoice {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
MatchboxPtScale();
/**
* The destructor.
*/
virtual ~MatchboxPtScale();
//@}
public:
/**
- * Return the renormalization scale. This default version returns
- * shat.
+ * Return the renormalization scale.
*/
virtual Energy2 renormalizationScale() const;
/**
- * Return the factorization scale. This default version returns
- * shat.
+ * Return the factorization scale.
*/
virtual Energy2 factorizationScale() const;
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;
//@}
private:
/**
* Reference to the jet finder
*/
Ptr<JetFinder>::ptr theJetFinder;
// 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.
*/
MatchboxPtScale & operator=(const MatchboxPtScale &);
};
}
#endif /* Herwig_MatchboxPtScale_H */
diff --git a/Models/Transplanckian/Makefile.am b/Models/Transplanckian/Makefile.am
--- a/Models/Transplanckian/Makefile.am
+++ b/Models/Transplanckian/Makefile.am
@@ -1,5 +1,5 @@
if WANT_BSM
pkglib_LTLIBRARIES = HwTransplanck.la
endif
HwTransplanck_la_SOURCES = METRP2to2.cc METRP2to2.h
-HwTransplanck_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 1:1:0
+HwTransplanck_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 2:0:0
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,1256 +1,1285 @@
Herwig++ News (emacs -*- outline -*- format)
+* Herwig++-2.6.2 release: 2013-01-30
+
+** Fixes for PDF and scale choices in POWHEG events
+ Scale settings for MPI and the regular shower are now correct in
+ POWHEG events. This should fix reported anomalies in POWHEG jet rates.
+ NLO PDFs are now also set consistently in the example input files.
+
+** Ticket #373: Branching ratio factors in cross-section
+ If any decay modes are selectively disabled, setting the following
+ post-handler will cause all reported cross-sections to include the
+ branching ratio factor(s) from the previous stages correctly:
+
+ create Herwig::BranchingRatioReweighter BRreweight
+ insert LHCGenerator:EventHandler:PostDecayHandlers 0 BRreweight
+
+** Anomalous vertices now possible in MEfftoVH
+
+** Interactive shell does not quit on error
+
+** Better warning messages for events from inconsistent LHEF files
+
+** Possible division by zero error fixed in BSM branching ratio calculations
+
+** Decayer and ME changes to improve checkpointing
+ The checkpointing changes in ThePEG 1.8.2 are implemented here, too. Regular
+ dump files are consistent now.
+
+
+
* Herwig++-2.6.1 release: 2012-10-16
** Configure switches
The various switches to turn off compilation of BSM models have
been unified into a single '--disable-models'. A new flag
'--disable-dipole' can be used to turn off the compilation of the
Dipole and Matchbox codes.
** Ticket #348: Search path for repository 'read' command
The search path for the 'read' command is configurable on the
command line with the -i and -I switches. By default, the
installation location is now included in the search path, so that
'Herwig++ read LEP.in' will work in an empty directory. The current
working directory will always be searched first.
The rarely used "Herwig++ init" command has been made consistent
with 'read' and 'run' and should now be used without the '-i' flag.
** Width treatment in BSM
The width treatment in BSM decay chains has been greatly improved
and is now switched on by default in the .model files. To get the
old behaviour, use
set /Herwig/NewPhysics/NewModel:WhichOffshell Selected
** New BSM models
Little Higgs models with and without T-parity are now available.
** Resonance photon lifetime
A lifetime bug affecting decays of pi0 to e+e-X was fixed. The
virtual photon is not part of the event record anymore.
** Ticket #371: Hard diffraction FPE
Herwig++ 2.6.0 introduced a bug into the diffraction code which
would abort any runs. This is now fixed.
** O2AlphaS
Support for setting quark masses different from the particle data
objects as introduced in ThePEG 1.8.1 has been enabled.
** Matchbox
Several improvements and bug fixes are included for
Matchbox. Amplitudes relevant to pp -> Z+jet and crossed processes
at NLO are now available, and various scale choices have been added
in a more flexible way. All subtraction dipoles for massive quarks
are now included.
** Dipole shower
Parameters to perform scale variations in the shower have been
added to estimate uncertainties. A bug in showering off gg -> h has
been fixed.
** Minor fixes
*** Two broken colour structures in GeneralHardME
*** Susy Higgs mixing matrix
*** BaryonFactorizedDecayer out-of-bounds access
*** Mass values in SimpleLHCAnalysis
* Herwig++-2.6.0 release: 2012-05-21 (tagged at SVN r7407)
** New NLO framework
Matchbox, a flexible and very general framework for performing NLO
calculations at fixed order or matched to parton showers is
provided with this release.
** Dipole shower algorithm
A first implementation of the coherent dipole shower algorithm by
Plätzer and Gieseke (arXiv:0909.5593 and arXiv:1109.6256) is
available.
** Alternative samplers and the ExSample library
The ExSample library by Plätzer (arXiv:1108.6182) is shipped along
with Herwig++ in an extended version. The extended version provides
SamplerBase objects which can be used alternatively to the default
ACDCSampler.
** New BSM models
*** New colour sextet diquark model
A colour sextet diquark model has been included, as described in
Richardson and Winn (arXiv:1108.6154).
*** Models reproducing the CDF t-tbar asymmetry
Four models that can reproduce the reported t-tbar asymmetry have
been included.
*** Zprime
A simple standard model extension by one additional heavy neutral
vector boson.
** Interface to AlpGen, with MLM merging
The Contrib directory contains a new interface to the AlpGen matrix
element generator. AlpGen events must be preprocessed with the
provided AlpGenToLH.exe tool before they can be used. More
information can be found in the Herwig++ 2.6 release note.
** HiggsVBF Powheg
Higgs boson production by vector boson fusion is available at NLO
in the POWHEG scheme, as described in d'Errico, Richardson
(arXiv:1106.2983). The Powheg DIS processes were available in
Herwig++-2.5.2 already.
** Statistical colour reconnection
Alternative mechanisms to minimize the colour length Sum(m_clu)
before the hadronization stage, based on Metropolis and annealing
algorithms.
** Energy extrapolation of underlying-event tunes
To describe underlying-event data at different c.m. energies, the
energy-dependent parameter pT_min will now be adjusted
automatically, following a power-law. The new tune parameters are
the value at 7000 GeV "MPIHandler:pTmin0", and MPIHandler:Power.
** Ticket #239: Reporting of minimum-bias cross-section
When simulating minimum-bias events using the MEMinBias matrix
element, the correct unitarized cross section can now be reported
via the standard facilities; it is no longer necessary to extract
it from the .log file of the run. The corresponding functionality
is enabled by inserting a MPIXSecReweighter object as a
post-subprocess handler:
create Herwig::MPIXSecReweighter MPIXSecReweighter
insert LHCHandler:PostSubProcessHandlers 0 MPIXSecReweighter
** Dependency on 'boost'
Herwig++ now requires the boost headers to build; if not detected
in standard locations, specify with the --with-boost configure
option.
** Tests directory
The Tests directory now contains input cards for almost all Rivet
analyses. A full comparison run can be initiated with 'make tests'.
** Minor changes
*** Default LHC energy now 8 TeV
All LHC-based defaults have now been updated to use 8 TeV as the
center-of-mass energy.
*** Herwig::ExtraParticleID -> ThePEG::ParticleID
The namespace for additional particles has been unified into
ThePEG::ParticleID
*** MEee2VectorMeson
The e+e- -> vector meson matrix element has moved from Contrib into
HwMELepton.so
*** SUSY numerics fixes
Better handling of rare numerical instabilities.
*** YODA output for Rivet
The built-in histogramming handler can now output data in the YODA
format used by Rivet.
*** Consistency checks in SLHA file reader
Better warnings for inconsistent SusyLHA files
*** better colour flow checking for development
** Bug fixes
*** Extremely offshell W from top decay
Numerical improvements for very off-shell W bosons coming from top
decays.
*** Ticket #367: problems in using SUSY + LHE
Susy events from Les Houches event files are now handled better.
*** Infinite loop in remnant decayer
The remnant decayer will now abort after 100 tries.
*** Fix to HiggsVBF LO diagrams
The diagram structure of HiggsVBF LO matrix elements has been fixed.
*** LEP thrust fix
The calculation of the transverse momentum of a branching from the
evolution variable in final-state radiation can now be
changed. While formally a sub-leading choice this enables a better
description of the thrust distribution in e+e- collisions at
small values of the thrust. Currently the default behaviour, where
the cut-off masses are used in the calculation, remains the same
as previous versions.
* Herwig++-2.5.2 release: 2011-11-01 (tagged at SVN r6928)
** Optional new jet vetoing model
The jet vetoing model by Schofield and Seymour (arXiv:1103.4811) is
available via Evolver:ColourEvolutionMethod,
PartnerFinder:PartnerMethod and SplittingFunction:SplittingColourMethod.
The default behaviour is unchanged.
** MPI tune
Version 3 of the MPI tunes is now the default. Please note that the
pT parameter is energy-dependent and needs to be modified when an
LHC run is not at 7 TeV.
The latest tunes are always available at
http://projects.hepforge.org/herwig/trac/wiki/MB_UE_tunes
** MPI PDFs
MPI PDFs can now be controlled independently.
** Initialization time speedup
A new BSMModel base class was introduced between StandardModel and
the BSM model classes. Together with a restructured decay mode
initialization, this offers significantly faster startup times for
BSM runs. ThreeBodyDecays can now always be switched on without a
large speed penalty.
** Decay mode file
Decay mode files in the SLHA format can now be read separately in
any BSM model with 'set Model:DecayFileName filename'
** Powheg DIS
Charged- and neutral-current DIS processes implementing the POWHEG
method are now available.
** Diffraction models
Xi cut implemented in PomeronFlux
** Ticket #352: Colour reconnection fixed in DIS
** Ticket #353: Improved numerical stability in chargino decays
** Ticket #358: Infinite loop in top events with pT cut in shower
** Ticket #361: Problem with duplicate 2-body modes in BSM
** Tickets #362 / #363: Crashes with baryon number violating models
Particle decays in SUSY models with RPV now work correctly in the
colour 8 -> 3,3,3 case. Colour reshuffling now works for RPV
clusters.
** Improved Fastjet detection
The configure step uses fastjet-config to make sure all header file
paths are seen.
** Darwin 11 / OS X Lion
A configure bug was fixed which prevented 'make check' from
succeeding on OS X Lion.
** Vertex classes
The specification of QED / QCD orders has been moved to the vertex
constructors, to allow ThePEG consistency checks. WWHH vertices in
MSSM and NMSSM were fixed. Some Leptoquark and UED vertices fixed.
** Hadronization
Cleanup of obsolete code.
* Herwig++-2.5.1 release: 2011-06-24 (tagged at SVN r6609)
** Example input files at 7 TeV
All our example input files for LHC now have their beam energy set
to 7 TeV instead of 14 TeV.
** Colour reconnection on by default
The colour reconnection tunes are now the default setup. Version 2
of the tunes replaces the *-1 tunes, which had a problem with LEP
event shapes.
** Run name tags
Aded possibility to add a tag to the run name when running with the
'-t' option. One run file can thus be run with different seeds and
results stored in different output files.
** Floating point exceptions
The new command line option -D enables floating point error checking.
** General improvements to WeakCurrent decays
** Remnant decayer
Hardwired gluon mass was removed.
** WeakCurrentDecayConstructor
Instead of specifying separate Particle1...Particle5 vectors for
the decay modes, the new interface DecayModes can be filled with
decay tags in the standard syntax.
** BSM: improvements to handling of vertex and model initialisation
** Powheg Higgs
Option to use pT or mT as the scale in alphaS and for the
factorization scale in the PDFs
** Ticket #337: Tau polarization wrong in charged Higgs decay
** Ticket #339: Colour flows in GeneralThreeBody Decayers for 3bar -> 8 3bar 1
** Ticket #340: Crash for resonant zero-width particles
** Ticket #341: Varying scale for BSM processes
The scale used is now ResonantProcessConstructor:ScaleFactor or
TwoToTwoProcessConstructor:ScaleFactor multiplied by sHat.
** Ticket #346: Chargino decays
Chargino decayers now automatically switch between the mesonic
decays for mass differences less than 2 GeV and the normal partonic
decays above 2 GeV.
** Ticket #349: Stop by default on input file errors
The '--exitonerror' flag is now the default behaviour for the
Herwig++ binary. To switch back to the old behaviour,
'--noexitonerror' is required.
** Ticket #351: Four-body stop decays
** Tested with gcc-4.6
* Herwig++-2.5.0 release: 2011-02-08 (tagged at SVN r6274)
** Uses ThePEG-1.7.0
Herwig++ 2.5.0 requires ThePEG 1.7.0 to benefit from various
improvements, particularly: handling of diffractive processes;
respecting LD_LIBRARY_PATH when loading dynamic libraries,
including LHAPDF; improvements to repository commands for decay
modes. See ThePEG's NEWS file for more details.
** POWHEG improvements
*** New POWHEG processes
Simulation at NLO accuracy using the POWHEG method is now
available for hadronic diboson production (pp to WW,WZ,ZZ), Higgs
decays to heavy quarks, and e+e- to two jets or ttbar, including
full mass dependence.
*** Input file changes
The input files for setting up POWHEG process simulation have been
simplified. See the example files LHC-Powheg.in and TVT-Powheg.in
for the improved command list.
*** Structural changes
The POWHEG backend in the shower code has been restructured to
make future additions easier: PowhegEvolver has merged with
Evolver; both the matrix element corrections and real corrections
in the POWHEG scheme are implemented directly in the ME or Decayer
classes.
** New processes at leading order
*** Photon initiated processes
We have added a matrix element for dijet production in gamma
hadron collisions.
*** Bottom and charm in heavy quark ME
The option of bottom and charm quarks is now supported for heavy
quark production in MEHeavyQuark.
** Colour reconnection
The cluster hadronization model has been extended by an option to
reconnect coloured constituents between clusters with a given
probability. This new model is different from the colour
reconnection model used in FORTRAN HERWIG, and improves the
description of minimum bias and underlying event data.
** Diffractive Processes
Both single and double diffractive processes are now supported in
Herwig++. The Pomeron PDF is implemented using a fit to HERA data,
and a pion PDF can be used to model reggeon flux.
** BSM physics
*** New models
We have added new BSM models, particularly ADD-type extra
dimension models and the next-to-minimal supersymmetric standard
model (NMSSM). Effects of leptoquarks can as well be simulated.
*** Vertex additions
We have added flavour changing stop interactions (stop -
neutralino - charm) and gravitino interactions with particular
emphasis on numerical stability for very light gravitinos.
Tri-linear Higgs and Higgs-Higgs/Vector-Vector four-vertices are
available as well.
*** Input file changes
The SUSY model can now also extract the SLHA information from the
header of a Les Houches event file: replace the SLHA file name
in the example input files with the LH file name.
*** Structure
The backend structure of the HardProcessConstructor has changed,
to allow easier inclusion of new process constructors. Some 2->3
BSM scattering processes involving neutral higgs bosons are now
included. The spin handling has been improved in the background.
** Shower splitting code reorganized
The selection of spin structures has been decoupled from the choice
of colour structure. This gives more flexibility in implementing
new splittings. Selected splittings can be disabled in the input
files.
** B mixing
B mixing, and indirect CP violation in the B meson system are
included now.
** Looptools
The Looptools directory has been updated to reflect T.Hahn's
Looptools 2.6.
** Contrib changes
The ROOT interface has been removed as deprecated. The MCPWNLO code
has temporarily been removed from the Contrib directory as a major
review of this code is required. Additionally, there are various
fixes to all other codes shipped in Contrib.
** DIS improvements
The momentum reshuffling in DIS events has been improved.
** mu and nu beams
mu, nu_e and nu_mu and their antiparticles are now available as
beam particles. They are all supported in the DIS matrix
elements. mu+ mu- collisions are supported in the general
matrix element code for BSM models, but not yet in the hard-coded
matrix elements for lepton-lepton scattering.
** Structural changes
*** Inline code
Inline code has been merged into the header files, .icc files were
removed.
*** Silent build
By default, Herwig++ now builds with silent build rules. To get
the old behaviour, run 'make V=1'.
*** Debug level
The debug level on the command line will now always have priority.
*** Event counter
The event counter has been simplified.
*** Interpolator persistency
Interpolators can now be written persistently.
** Ticket #307: Momentum violation check in BasicConsistency
Added parameters AbsoluteMomentumTolerance and
RelativeMomentumTolerance
** Example POWHEG input files
The example input files for Powheg processes now set the NLO
alpha_S correctly, and are run as part of 'make check'.
** Truncated shower
A problem which lead to the truncated shower not being applied in
some cases has been fixed.
** Fixes to numerical problems
Minor problems with values close to zero were fixed in several
locations.
** Remove duplicated calculation of event shapes
An accidental duplication in the calculation of event shapes was
removed, they are now only calculated once per event. Several other
minor issues in the event shape calculations have also been fixed.
** MRST PDFs fixed
An initialization problem in the internal MRST PDFs was fixed.
** Vertex scale choice
The scale in the Vertex classes can now be zero where
possible.
** Treatment of -N flag
The Herwig++ main program now correctly treats the -N flag
as optional.
** Numerical stability improved
The numerical stability in the 'RunningMass' and
'QTildeReconstructor' classes has been improved. The
stability of the boosts in the SOPTHY code for the
simulation of QED radiation has been improved.
The accuracy of boosts in the z-direction has been improved to
fix problems with extremely high p_T partons.
** Bugfix in initial state splittings
A bug in the implementation of the PDF weight in initial-state
qbar -> qbar g splittings has been fixed.
** Bugfix in chargino neutralino vertices
A bug in the 'chi+- chi0 W-+' and charged
Higgs-sfermions vertices has been fixed.
** Remove uninitialized variables written to repository
A number of uninitialised variables which were written to the
repository have been initialised to zero to avoid problems on some
systems.
** Fix to QED radiation in hadronic collisions
The longitudinal boost of the centre-of-mass frame in hadronic
collisions is correctly accounted for now in the generation of QED
radiation.
** Fix to numerical problems in two-body decays
Numerical problems have been fixed, which appeared in the rare case
that the three-momenta of the decay products in two-body decays are
zero in the rest frame of the decay particle.
** A problem with forced splittings in the Remnant was fixed.
** ME correction for W+- decays applied properly
The matrix element correction for QCD radiation in W+- decays
which was not being applied is now correctly used.
** Top quark decays from SLHA file
The presence of top quark decay modes in SLHA files is now handled
correctly.
** Exceptional shower reconstruction kinematics
Additional protection against problems due to the shower
reconstruction leading to partons with x>1 has been added.
** Ordering of particles in BSM processes
Changes have been made to allow arbitrary ordering of the outgoing
particles in BSM processes.
** Bugfixes in tau decays
Two bugs involving tau decays have been fixed. The wrong masses
were used in the 'KPiCurrent' class for the scalar form factors
and a mistake in the selection of decay products lead to
tau- --> pi0 K- being generated instead of tau- --> eta K-.
** Avoid crashes in baryon number violating processes.
To avoid crashes, better protection has been introduced for the
case where diquarks cannot be formed from the quarks in a
baryon-number violating process. In addition, the parents of the
baryon-number violating clusters have been changed to avoid
problems with the conversion of the events to HepMC.
** QED radiation in W- decays
A bug in the 'QEDRadiationHandler' class which resulted
in no QED radiation being generated in W- decays has been fixed.
** A number of minor fixes to the SUSY models have been made.
** Partial width calculations in BSM models
A fix for the direction of the incoming particle in the calculation
of two-body partial widths in BSM models has been made.
** LoopTools improvements
The LoopTools cache is now cleared more frequently to
reduce the amount of memory used by the particle.
** Negative gluino masses are now correctly handled.
** A problem with mixing matrices which are not square has been fixed.
** Removed duplicate diagram
The 'MEee2gZ2ll' class has been fixed to only include the
photon exchange diagram once rather than twice as previously.
** Fix for duplicate particles in DecayConstructor
A problem has been fixed which occurred if the same particle was
included in the list of DecayConstructor:DecayParticles.
** Fixes for UED model vertices
A number of minor problems in the vertices for the UED model have
been fixed.
** Include missing symmetry factor
The missing identical-particle symmetry factor in
'MEPP2GammaGamma' has been included.
** Fix floating point problem in top decays
A floating point problem in the matrix element correction for top
decays has been fixed.
* Herwig++-2.4.2 release: 2009-12-11 (tagged at SVN r5022)
** Ticket #292: Tau decay numerical instability
The momentum assignment in tau decays contained numerical
instabilities which have been fixed by postponing the tau decay
until after the parton shower. A new interface setting
DecayHandler:Excluded is available to prevent decays in the shower
step. This is enabled by default for tau only.
** Ticket #290: Missing MSSM colour structure
The missing colour structure for gluino -> gluon neutralino was added.
** Ticket #294: Zero momentum in some decays
Some rare phase space points lead to zero momentum in two-body
decays. This has been fixed.
** Ticket #295: Stability of QED radiation for lepton collider processes
The numerical stability of QED radiation momenta was improved
further.
** Ticket #296: K0 oscillation vertex was wrong
The oscillation from K0 to K0_L/S now takes place at the production
vertex of K0.
** Ticket #289: Undefined variables in repository
On some system configurations, undefined variables were written to
the repository. These have been fixed.
** Fixed QED radiation for hadron processes
The longitudinal boost of the centre-of-mass frame in hadronic
collisions is correctly accounted for now.
** Numerical stability fixes
Small fixes in RunningMass and QTildeReconstructor.
** Powheg example input files
The example input files for Powheg processes now set the NLO
alpha_S correctly, and are run as part of 'make check'.
** OS X builds for Snow Leopard
Snow Leopard machines will now be recognized as a 64bit
architecture.
* Herwig++-2.4.1 release: 2009-11-19 (tagged at SVN r4932)
** Uses ThePEG-1.6.0
Herwig++ now requires ThePEG-1.6.0 to benefit from the improved
helicity code there. If you have self-written vertex classes, see
ThePEG's NEWS file for conversion instructions.
** Vertex improvements
ThePEG's new helicity code allowed major simplification of the vertex
implementations for all Standard Model and BSM physics models.
** New Transplanckian scattering model
An example configuration is in LHC-TRP.in
** BSM ModelGenerator as branching ratio calculator
The BSM ModelGenerator has a new switch to output the branching
ratios for a given SLHA file in SLHA format, which can then be used
elsewhere.
** BSM debugging: HardProcessConstructor
New interface 'Excluded' to exclude certain particles from
intermediate lines.
** Chargino-Neutralino-W vertex fixed
** Spin correlations
are now switched on by default for all perturbative decays.
** Ticket #276: Scale choice in BSM models' HardProcessConstructor
New interface 'ScaleChoice' to choose process scale between
- sHat (default for colour neutral intermediates) and
- transverse mass (default for all other processes).
** Ticket #287: Powheg process scale choice
The default choice is now the mass of the colour-singlet system.
** Ticket #278: QED radiation for BSM
Soft QED radiation is now enabled in BSM decays and all
perturbative decays by default.
** Ticket #279: Full 1-loop QED radiation for Z decays
Soft QED radiation in Z decays is now fully 1-loop by default.
** Ticket #280: Redirect all files to stdout
This is now implemented globally. The files previously ending in
-UE.out and -BSMinfo.out are now appended to the log file. They now
also obey the EventGenerator:UseStdout flag.
** Ticket #270: LaTeX output updated
After each run, a LaTeX file is produced that contains the full
list of citations. Please include the relevant ones in publications.
** Ticket #256: Mac OS X problems
An initialization problem that affected only some configurations has
been identified and fixed.
** Tests directory added
This contains many .in files, to exercise most matrix
elements.
** Minor fixes
*** Prevent rare x>1 partons in shower reconstruction.
*** SUSY-LHA parameter EXTPAR can be used to set tan beta
*** Improved Fastjet detection at configure time
* Herwig++-2.4.0 release: 2009-09-01 (tagged at SVN r4616)
** New matrix elements
We have added a built-in implementation of several new matrix elements:
PP --> WW / WZ / ZZ
PP --> W gamma / Z gamma
PP --> VBF Higgs
PP --> Higgs tt / Higgs bb
e+e- --> WW / ZZ
gamma gamma --> ff / WW
** Base code improvements
*** Ticket #257: Remnant handling
A problem with forced splittings in the Remnant was fixed.
*** Ticket #264: Soft matrix element correction
A problem with emissions form antiquarks was fixed.
** PDF sets
*** New default set
MRST LO** is the new default PDF set. LO* is also available built-in.
*** Shower PDFs can be set separately from the hard process
Use the 'ShowerHandler:PDF' interface.
** Parameter tunes
Shower, hadronization and underlying event parameters were retuned
against LEP and Tevatron data respectively.
** BSM module improvements
*** Ticket #259: read error for some UED models
Arbitrary ordering of outgoing lines in the process description is now
possible.
*** Ticket #266: branching ratio sums
The warning threshold for branching ratios not summing to 1 has
been relaxed. It is now a user interface parameter.
*** Ticket #267: Top decay modes
Top decay modes listed in SLHA files are now handled correctly.
** QED radiation
*** Ticket #241: Soft QED radiation is now enabled by default
*** Ticket #265: Radiation off W+ and W- is now handled correctly
** Interfaces
*** Ticket #243: Fastjet
Fastjet is now the only supported jet finder code. All example
analyses have been converted to use Fastjet.
*** KtJet and CLHEP interfaces have been removed.
*** New interfaces to AcerDet and PGS available in Contrib
*** MCPWnlo distributed in Contrib
*** HepMC and Rivet interfaces moved to ThePEG
** Ticket #239: Inelastic cross-section for MinBias
This information is now available in the ...-UE.out files.
** Technical changes
*** Ticket #186
Configure now looks for ThePEG in the --prefix location first.
*** Configure information
Important configuration information is listed at the end of the
'configure' run and in the file 'config.thepeg'. Please provide
this file in any bug reports.
*** New ZERO object
The ZERO object can be used to set any dimensionful quantity to
zero. This avoids explicit constructs like 0.0*GeV.
*** Exception specifiers removed
Client code changes are needed in doinit() etc., simply remove the
exception specifier after the function name.
*** Ticket #263: Tau polarizations can be forced in TauDecayer
* Herwig++-2.3.2 release: 2009-05-08 (tagged at SVN r4249)
** SUSY enhancements
*** Ticket #245: Select inclusive / exclusive production
Using the new 'HardProcessConstructor:Processes' switch options
'SingleParticleInclusive', 'TwoParticleInclusive' or 'Exclusive'
*** Improved three-body decay generation
Several problems were fixed, incl. tickets #249 #250 #251
Thanks to J.Tattersall and K.Rolbiecki for the stress-testing!
*** Looptools fix
Release 2.3.1 had broken the Looptools initialization.
*** Improved warning message texts
** Ticket #237:
Values of q2last can now be zero where possible.
** Ticket #240:
The Herwig++ main program now correctly treats the -N flag as optional.
** Ticket #246:
Extreme pT partons fixed by improving accuracy of z boosts.
** DIS
Improved parton shower momentum reshuffling.
** Minimum Bias events
The zero-momentum interacting particle used for
bookkeeping is now labelled as a pomeron.
** User Makefile
Makefile-UserModules does not enable -pedantic anymore. User's ROOT
code will not compile otherwise.
** Build system
Small fixes in the build system.
* Herwig++-2.3.1 release: 2009-03-31 (tagged at SVN r4140)
** Initial state showers
The PDF veto was wrongly applied to qbar->qbar g splittings.
** User interaction
The Makefile-UserModules now includes the Herwig version number.
The -N flag to 'Herwig++ run' is optional now, as was always intended.
** Contrib
The contrib directory is now included in the tarball. The omission
was accidental.
** Numerical accuracy
Minor problems with values close to zero were fixed in several
locations.
** LEP event shapes
An accidental duplication was removed, they are now only calculated
once per event.
** MRST PDF code
Initialization problem fixed.
** Mac OS X
The configure script was improved to detect libraries better.
** Libtool
Updated to version 2.2.6
* Herwig++-2.3.0 release: 2008-12-02 (tagged at SVN r3939)
** Major release, with many new features and bug fixes
** Extension to lepton-hadron collisions
** Inclusion of several processes accurate at next-to-leading order
in the POsitive Weight Hardest Emission Generator (POWHEG) scheme
** Inclusion of three-body decays and finite-width effects
in BSM processes
** New procedure for reconstructing kinematics of the parton shower
based on the colour structure of the hard scattering process
** New model for baryon decays including excited baryon multiplets
** Addition of a soft component to the multiple scattering model
of the underlying event and the option to choose more than one hard
scattering explicitly
** New matrix elements for DIS and e+e- processes
** New /Contrib directory added
containing external modules that will hopefully be of use to some
users but are not expected to be needed by most users and are not
supported at the same level as the main Herwig++ code
** Minor changes to improve the physics simulation:
*** IncomingPhotonEvolver added
to allow the simulation of partonic processes with incoming photons
in hadron collisions
*** KTRapidityCut added
to allow cuts on the p_T and rapidity, rather than just the p_T and
pseudorapidity used in SimpleKTCut. This is now used by default for
cuts on massive particles such as the $W^\pm$, $Z^0$ and Higgs
bosons and the top quark
*** Several changes to the decayers of B mesons
both to resolve problems with the modelling of partonic decays and
improve agreement with $\Upsilon(4s)$ data
*** Changes to allow values other than transverse mass of final-state particles as maximum transverse momentum for radiation in parton shower
either SCALUP for Les Houches events or the scale of the hard
process for internally generated hard processes
*** Changed defaults for intrinsic transverse momentum in hadron collisions
to 1.9GeV, 2.1GeV and 2.2GeV for the Tevatron and LHC at 10 TeV and
14 TeV, respectively
*** Pdfinfo object is now created in the HepMC interface
However in order to support all versions of HepMC containing this
feature the PDF set is not specified as not all versions contain
this information
*** New option of only decaying particles with lifetimes below user specified value
*** New options for the cut-off in the shower
and some obsolete parameters removed
*** Added option of switching off certain decay modes in BSM models
*** Added a Matcher for Higgs boson
to allow cuts to be placed on it
*** Diffractive particles deleted from default input files
they were not previously used
** Technical changes:
*** Some AnalysisHandler classes comparing to LEP data have been renamed
e.g. MultiplicityCount becomes LEPMultiplicityCount to avoid
confusion with those supplied in /Contrib for observables at the
Upsilon(4s) resonance
*** Reorganisation to remove the majority of the .icc files
by moving inlined functions to headers in an effort to improve
compile time
*** Restructured the decay libraries to reduce the amount of memory allocation
and de-allocation which improves run-time performance
*** The switch to turn off LoopTools has been removed
because LoopTools is now used by several core modules. As LoopTools
does not work on 64-bit platforms with g77 this build option is not
supported
*** Removed support for obsolete version of HepMC supplied with CLHEP
and improved the support for different units options with HepMC
*** EvtGen interface has been removed until it is more stable
*** Support for ROOT has been removed
it was not previously used
*** CKKW infrastructure has been removed from the release
until a concrete implementation is available
*** Default optimisation has been increased from -O2 to -O3
*** Handling of the fortran compiler has been improved
mainly due to improvements in the autotools
*** Use of FixedAllocator for Particle objects in ThePEG has been removed
as it had no performance benefits
** Bugs fixed:
*** Problems with the mother/daughter relations in the hard process
and diagram selection in W+- and Z0 production in association with a
hard jet
*** In general matrix element code for fermion-vector to fermion-scalar
where the outgoing fermion is coloured and the scalar neutral
*** In the selection of diagrams in some associated squark gaugino processes
*** h0->mu+mu- was being generated when h0->tau+tau-
*** Normalisation in the Histogram class for non unit-weight events
*** Protection against negative PDF values has been improved
these can occur when using NLO PDF sets
*** Lifetime for BSM particles is now automatically calculated
at the same time as the width
*** Hadrons containing a top quark now treated like hadrons containing BSM particles
in order to support this possibility
*** Several ambiguous uses of unsigned int
*** Several variables that may have been used undefined
*** Several memory leaks at initialisation
*** The configuration now aborts if no fortran compiler is found
as this is required to compile Looptools
*** Several minor floating point errors that did not affect results
* Herwig++-2.2.1 release: 2008-07-09 (tagged at SVN r3434)
** Ticket #181: BSM shower with a decay close to threshold
Now fixed.
** Ticket #191: Split SUSY crash
Improved error message.
** Ticket #192: using SCALUP as the pT veto in the shower
Now implemented.
** Ticket #194: production processes of ~chi_1(2)-
Fixed bug in the diagram creation.
** Removed unused particles
DiffractiveParticles.in was removed, they were never produced.
** Hadronization
Top quark clusters now possible, handled as 'exotic' clusters.
** Improved handling of decay modes
See ThePEG-1.3.0. 'defaultparticle' command is now obsolete.
** Multi-Parton interactions
Increased phase space sampling to have less than 1% uncertainty on
average multiplicity.
** New libtool version
gfortran is now used as default if it is available. Set FC=g77 to
override this.
** Fixed several memory leaks
** Memory allocation
Now using plain 'new' and 'delete'.
* Herwig++-2.2.0 release: 2008-04-18 (tagged at SVN r3195)
** Major release: now as stand-alone library
Herwig++ is now a stand-alone dlopen() plugin to ThePEG.
No compile-time linking to Herwig code is required. The Herwig++
binary is a simple executable steering ThePEG, which can
be replaced by other frontends (such as setupThePEG / runThePEG).
** New matrix elements
p p -> W + jet / Z + jet / W + higgs / Z + higgs
e+ e- -> Z + higgs
** Looptools
Updated to version 2.2.
** Ticket #141: segfault from using 'run' command
Fixed by using default allocators in Herwig++, and the
Repository::cleanup() method in ThePEG 1.2.0.
** Ticket #157: broken gsl library path on some 64bit systems
Paths with lib64 are correctly identified now.
** Ticket #159: p_t spectrum of ttbar pair
Fixed identical particle multiplier in Sudakov form factor.
** Ticket #161: glibc segfault
Rare segfault in MPI handler fixed.
** Ticket #165: rare infinite loop in four-body decay
All 4-body decays without dedicated decayers now use the Mambo algorithm.
A loop guard has been introduced to 3-body decays to avoid infinite retries.
** Ticket #166: rare infinite loop in top ME correction
These very rare events (O(1) in 10^7) close to mass threshold
now are discarded.
** Higgs width fixes
** SatPDF
Optionally, the PDF extrapolation behaviour outside a given range
can now be specified.
** gcc 4.3
Herwig++-2.2 compiles cleanly with the new gcc 4.3 series.
* Herwig++-2.1.4 release: 2008-03-03 (tagged at SVN r3024)
** Ticket #152: Vertex positions
All vertex positions of unphysical particles are set to zero until
a fix for the previous nonsensical values can be implemented.
* Herwig++-2.1.3 release: 2008-02-25 (tagged at SVN r2957)
** Ticket #129: Baryon decays
Fix for baryon decay modes.
** Ticket #131: HepMC
Check if IO_GenEvent exists
** Ticket #134: Hadronization
Smearing of hadron directions in cluster decay fixed.
** Ticket #137: HepMC
HepMC conversion allows specification of energy and length units to
be used.
** Ticket #139: Neutral kaons
Ratio K_L / K_S corrected.
** Ticket #140 / #141: Crash on shutdown
Event generation from the 'read' stage or an interface now shuts
down cleanly. Fixes a crash bug introduced in 2.1.1 which affected
external APIs to ThePEG / Herwig.
** Ticket #146: BSM models can be disabled
To save build time, some or all of the BSM models can be disabled
using the '--enable-models' configure switch.
** Reorganised .model files
The .model files now include the model-specific particles, too.
** Re-tune
Re-tuned hadronization parameters to LEP data.
** Other fixes in
QSPAC implementation in Shower; Multi-parton interaction tuning;
MRST initialization
* Herwig++-2.1.2 release: 2008-01-05 (tagged at SVN r2694)
** Ticket #127
Thanks to a patch submitted by Fred Stober, HepMCFile now can
output event files in all supported formats.
** Ticket #128
Fixed incorrect value of pi in histogram limits.
** Other fixes in
CKKW Qtilde clusterers, BSM width cut, SUSY mixing matrices.
* Herwig++-2.1.1 release: 2007-12-08 (tagged at SVN r2589)
** Bug #123
Fixed a bug with particle lifetimes which resulted in nan for some
vertex positions.
** Secondary scatters
Fixed bug which gave intrinsic pT to secondary scatters.
** gcc abs bug detection
configure now checks for and works around
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130
** CKKW reweighting
Fixed wrong check for top quarks.
** MPIHandler
Fixed call order ambiguity.
* Herwig++-2.1.0 release: 2007-11-20 (tagged at SVN r2542)
** Major new release
Herwig++-2.1 includes significant improvements, including
multi-parton interactions, BSM physics and a new hadronic decay
model, tuned to LEP data.
For an overview of the changes, please see the release note
arXiv:0711.3137
* Herwig++-2.0.3 release: 2007-08-21 (tagged at SVN r2101)
** Bug #90
nan in top decay ME corrections fixed.
** unlisted
Colour flow fix in LightClusterDecayer
** unlisted
Updated version of MultiplicityCount analysis handler.
* Herwig++-2.0.2 release: 2007-07-06 (tagged at SVN r1716)
** Bug #80
Separation of HepMC from CLHEP is handled properly now.
** Bug #83
Workaround for OS X header problem
** unlisted
Veto on very hard emissions from Shower.
** unlisted
Detailed documentation in .in files
* Herwig++-2.0.1 release: 2006-12-05 (tagged at SVN r1195)
** Bug #54
ClusterFissioner vertex calculation fixed.
** Bug #57
Crash when showering W+jet events supplied by Les Houches interface.
** Bug #59
Fix for #57 applied to LHC events.
** Bug #60
Segfault when PDF is set to NoPDF.
** Bug #61
Missing weight factor for I=0 mesons
** Bug #62
Spinor vertex calculations broken when spinor rep is not default rep.
** Bug #63
Top decay never produces tau.
** Bug #69
TTbar and HiggsJet analysis handlers fixed.
** unlisted
Reorganization of Hadronization module gives 30% speedup.
Thanks to Vincenzo Innocente at CMS for his profiling work!
** unlisted
cleaner automake files in include/ and src/
** unlisted
Hw64 hadron selection algorithm 'abortnow' fixed.
** unlisted
Top/LeptonDalitzAnalysis removed (only worked with modified code).
** unlisted
removed f'_0 from particle list, decays were not handled
* Herwig++-2.0.0 release: 2006-09-28 (tagged at SVN r1066)
** Full simulation of hadron collisions
diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,61 +1,61 @@
==============
-Herwig++ 2.6.1
+Herwig++ 2.6.2
==============
-This is the release of Herwig++ 2.6.1, a multi purpose event
+This is the release of Herwig++ 2.6.2, a multi purpose event
generator for high energy physics.
The Herwig++ distribution contains an adapted version of LoopTools 2.6
<http://www.feynarts.de/looptools/>.
Please contact <herwig@projects.hepforge.org> to be added to our
list of users. This will allow you to make full use of the Wiki and
bug tracker at http://projects.hepforge.org/herwig/trac/
BUILD AND INSTALL
=================
Generic installation instructions are in the file INSTALL.
Before attempting to build Herwig++, you'll need to get ThePEG
installed.
Herwig++ uses some functions from the GNU scientific library GSL. The
gsl libraries and header files must be available on your system.
Usually they can be found in a package called libgsl-dev.
------
ThePEG
------
-Download ThePEG 1.8.1 or later from
+Download ThePEG 1.8.2 or later from
http://projects.hepforge.org/herwig/versions
Do not build this package inside the Herwig++ source directory!
$ tar xjvf ThePEG-*.tar.bz2
$ cd ThePEG*
$ ./configure --prefix=/path/where/ThePEG/should/be/installed
$ make
$ make check
$ make install
Optional configure switches include --enable-unitchecks for checking
dimensional correctness of physical expressions in the code, and
--with-LHAPDF for linking against the LHAPDF library. See './configure
--help' for more details.
--------
Herwig++
--------
Download Herwig++, then
$ tar xjvf Herwig++-*.tar.bz2
$ cd Herwig++*
$ ./configure --prefix=/path/where/Herwig++/should/be/installed --with-thepeg=/path/where/ThePEG/was/installed
$ make
$ make check
$ make install
More detailed instructions can be found on the Herwig++ home page at
http://projects.hepforge.org/herwig/trac/wiki/HerwigInstallation
diff --git a/Shower/Base/Evolver.cc b/Shower/Base/Evolver.cc
--- a/Shower/Base/Evolver.cc
+++ b/Shower/Base/Evolver.cc
@@ -1,2133 +1,2140 @@
// -*- C++ -*-
//
// Evolver.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2011 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 Evolver class.
//
#include "Evolver.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/RefVector.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "Herwig++/Shower/Base/ShowerParticle.h"
#include "ThePEG/Utilities/EnumIO.h"
#include "ShowerKinematics.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Handlers/EventHandler.h"
#include "ThePEG/Utilities/Throw.h"
#include "ShowerTree.h"
#include "ShowerProgenitor.h"
#include "KinematicsReconstructor.h"
#include "PartnerFinder.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/PDT/DecayMode.h"
#include "Herwig++/Shower/ShowerHandler.h"
#include "ThePEG/Utilities/DescribeClass.h"
using namespace Herwig;
namespace {
void findChildren(tShowerParticlePtr parent,set<ShowerParticlePtr> & fs) {
for(unsigned int ix=0;ix<parent->children().size();++ix) {
tShowerParticlePtr child=
dynamic_ptr_cast<tShowerParticlePtr>(parent->children()[ix]);
if(child) findChildren(child,fs);
}
if(parent->children().empty()) {
if(parent->isFinalState()) fs.insert(parent);
}
}
}
DescribeClass<Evolver,Interfaced>
describeEvolver ("Herwig::Evolver","HwShower.so");
IBPtr Evolver::clone() const {
return new_ptr(*this);
}
IBPtr Evolver::fullclone() const {
return new_ptr(*this);
}
void Evolver::persistentOutput(PersistentOStream & os) const {
os << _model << _splittingGenerator << _maxtry
<< _meCorrMode << _hardVetoMode << _hardVetoRead << _hardVetoReadOption
<< _limitEmissions
<< ounit(_iptrms,GeV) << _beta << ounit(_gamma,GeV) << ounit(_iptmax,GeV)
<< _vetoes << _trunc_Mode << _hardEmissionMode
<< _colourEvolutionMethod << _reconOpt
<< interaction_<< interactions_.size();
for(unsigned int ix=0;ix<interactions_.size();++ix)
os << oenum(interactions_[ix]);
}
void Evolver::persistentInput(PersistentIStream & is, int) {
unsigned int isize;
is >> _model >> _splittingGenerator >> _maxtry
>> _meCorrMode >> _hardVetoMode >> _hardVetoRead >> _hardVetoReadOption
>> _limitEmissions
>> iunit(_iptrms,GeV) >> _beta >> iunit(_gamma,GeV) >> iunit(_iptmax,GeV)
>> _vetoes >> _trunc_Mode >> _hardEmissionMode
>> _colourEvolutionMethod >> _reconOpt
>> interaction_ >> isize;
interactions_.resize(isize);
for(unsigned int ix=0;ix<interactions_.size();++ix)
is >> ienum(interactions_[ix]);
}
void Evolver::doinit() {
Interfaced::doinit();
if(interaction_==0) {
interactions_.push_back(ShowerInteraction::QCD);
interactions_.push_back(ShowerInteraction::QED);
}
else if(interaction_==1) {
interactions_.push_back(ShowerInteraction::QCD);
}
else if(interaction_==2) {
interactions_.push_back(ShowerInteraction::QED);
interactions_.push_back(ShowerInteraction::QCD);
}
else if(interaction_==3) {
interactions_.push_back(ShowerInteraction::QED);
}
else if(interaction_==4) {
interactions_.push_back(ShowerInteraction::Both);
}
}
void Evolver::Init() {
static ClassDocumentation<Evolver> documentation
("This class is responsible for carrying out the showering,",
"including the kinematics reconstruction, in a given scale range,"
"including the option of the POWHEG approach to simulated next-to-leading order"
" radiation\\cite{Nason:2004rx}.",
"%\\cite{Nason:2004rx}\n"
"\\bibitem{Nason:2004rx}\n"
" P.~Nason,\n"
" ``A new method for combining NLO QCD with shower Monte Carlo algorithms,''\n"
" JHEP {\\bf 0411} (2004) 040\n"
" [arXiv:hep-ph/0409146].\n"
" %%CITATION = JHEPA,0411,040;%%\n");
static Reference<Evolver,SplittingGenerator>
interfaceSplitGen("SplittingGenerator",
"A reference to the SplittingGenerator object",
&Herwig::Evolver::_splittingGenerator,
false, false, true, false);
static Reference<Evolver,ShowerModel> interfaceShowerModel
("ShowerModel",
"The pointer to the object which defines the shower evolution model.",
&Evolver::_model, false, false, true, false, false);
static Parameter<Evolver,unsigned int> interfaceMaxTry
("MaxTry",
"The maximum number of attempts to generate the shower from a"
" particular ShowerTree",
&Evolver::_maxtry, 100, 1, 1000,
false, false, Interface::limited);
static Switch<Evolver, unsigned int> ifaceMECorrMode
("MECorrMode",
"Choice of the ME Correction Mode",
&Evolver::_meCorrMode, 1, false, false);
static SwitchOption off
(ifaceMECorrMode,"No","MECorrections off", 0);
static SwitchOption on
(ifaceMECorrMode,"Yes","hard+soft on", 1);
static SwitchOption hard
(ifaceMECorrMode,"Hard","only hard on", 2);
static SwitchOption soft
(ifaceMECorrMode,"Soft","only soft on", 3);
static Switch<Evolver, unsigned int> ifaceHardVetoMode
("HardVetoMode",
"Choice of the Hard Veto Mode",
&Evolver::_hardVetoMode, 1, false, false);
static SwitchOption HVoff
(ifaceHardVetoMode,"No","hard vetos off", 0);
static SwitchOption HVon
(ifaceHardVetoMode,"Yes","hard vetos on", 1);
static SwitchOption HVIS
(ifaceHardVetoMode,"Initial", "only IS emissions vetoed", 2);
static SwitchOption HVFS
(ifaceHardVetoMode,"Final","only FS emissions vetoed", 3);
static Switch<Evolver, unsigned int> ifaceHardVetoRead
("HardVetoScaleSource",
"If hard veto scale is to be read",
&Evolver::_hardVetoRead, 0, false, false);
static SwitchOption HVRcalc
(ifaceHardVetoRead,"Calculate","Calculate from hard process", 0);
static SwitchOption HVRread
(ifaceHardVetoRead,"Read","Read from XComb->lastScale", 1);
static Switch<Evolver, bool> ifaceHardVetoReadOption
("HardVetoReadOption",
"Apply read-in scale veto to all collisions or just the primary one?",
&Evolver::_hardVetoReadOption, false, false, false);
static SwitchOption AllCollisions
(ifaceHardVetoReadOption,
"AllCollisions",
"Read-in pT veto applied to primary and secondary collisions.",
false);
static SwitchOption PrimaryCollision
(ifaceHardVetoReadOption,
"PrimaryCollision",
"Read-in pT veto applied to primary but not secondary collisions.",
true);
static Parameter<Evolver, Energy> ifaceiptrms
("IntrinsicPtGaussian",
"RMS of intrinsic pT of Gaussian distribution:\n"
"2*(1-Beta)*exp(-sqr(intrinsicpT/RMS))/sqr(RMS)",
&Evolver::_iptrms, GeV, ZERO, ZERO, 1000000.0*GeV,
false, false, Interface::limited);
static Parameter<Evolver, double> ifacebeta
("IntrinsicPtBeta",
"Proportion of inverse quadratic distribution in generating intrinsic pT.\n"
"(1-Beta) is the proportion of Gaussian distribution",
&Evolver::_beta, 0, 0, 1,
false, false, Interface::limited);
static Parameter<Evolver, Energy> ifacegamma
("IntrinsicPtGamma",
"Parameter for inverse quadratic:\n"
"2*Beta*Gamma/(sqr(Gamma)+sqr(intrinsicpT))",
&Evolver::_gamma,GeV, ZERO, ZERO, 100000.0*GeV,
false, false, Interface::limited);
static Parameter<Evolver, Energy> ifaceiptmax
("IntrinsicPtIptmax",
"Upper bound on intrinsic pT for inverse quadratic",
&Evolver::_iptmax,GeV, ZERO, ZERO, 100000.0*GeV,
false, false, Interface::limited);
static RefVector<Evolver,ShowerVeto> ifaceVetoes
("Vetoes",
"The vetoes to be checked during showering",
&Evolver::_vetoes, -1,
false,false,true,true,false);
static Switch<Evolver,unsigned int> interfaceLimitEmissions
("LimitEmissions",
"Limit the number and type of emissions for testing",
&Evolver::_limitEmissions, 0, false, false);
static SwitchOption interfaceLimitEmissionsNoLimit
(interfaceLimitEmissions,
"NoLimit",
"Allow an arbitrary number of emissions",
0);
static SwitchOption interfaceLimitEmissionsOneInitialStateEmission
(interfaceLimitEmissions,
"OneInitialStateEmission",
"Allow one emission in the initial state and none in the final state",
1);
static SwitchOption interfaceLimitEmissionsOneFinalStateEmission
(interfaceLimitEmissions,
"OneFinalStateEmission",
"Allow one emission in the final state and none in the initial state",
2);
static SwitchOption interfaceLimitEmissionsHardOnly
(interfaceLimitEmissions,
"HardOnly",
"Only allow radiation from the hard ME correction",
3);
static SwitchOption interfaceLimitEmissionsOneEmission
(interfaceLimitEmissions,
"OneEmission",
"Allow one emission in either the final state or initial state, but not both",
4);
static Switch<Evolver,bool> interfaceTruncMode
("TruncatedShower", "Include the truncated shower?",
&Evolver::_trunc_Mode, 1, false, false);
static SwitchOption interfaceTruncMode0
(interfaceTruncMode,"No","Truncated Shower is OFF", 0);
static SwitchOption interfaceTruncMode1
(interfaceTruncMode,"Yes","Truncated Shower is ON", 1);
static Switch<Evolver,unsigned int> interfaceHardEmissionMode
("HardEmissionMode",
"Whether to use ME corrections or POWHEG for the hardest emission",
&Evolver::_hardEmissionMode, 0, false, false);
static SwitchOption interfaceHardEmissionModeMECorrection
(interfaceHardEmissionMode,
"MECorrection",
"Old fashioned ME correction",
0);
static SwitchOption interfaceHardEmissionModePOWHEG
(interfaceHardEmissionMode,
"POWHEG",
"Powheg style hard emission",
1);
static Switch<Evolver,int> interfaceColourEvolutionMethod
("ColourEvolutionMethod",
"Choice of method for choosing the colour factor in gluon evolution",
&Evolver::_colourEvolutionMethod, 0, false, false);
static SwitchOption interfaceColourEvolutionMethodDefault
(interfaceColourEvolutionMethod,
"Default",
"Colour factor is CA for all scales",
0);
static SwitchOption interfaceColourEvolutionMethodHalfCA
(interfaceColourEvolutionMethod,
"HalfCA",
"Only use half the normal radiation until second scale is reached",
1);
static Switch<Evolver,unsigned int > interfaceInteractions
("Interactions",
"The interactions to be used in the shower",
&Evolver::interaction_, 1, false, false);
static SwitchOption interfaceInteractionsQCDFirst
(interfaceInteractions,
"QCDFirst",
"QCD first then QED",
0);
static SwitchOption interfaceInteractionsQCDOnly
(interfaceInteractions,
"QCDOnly",
"Only QCD",
1);
static SwitchOption interfaceInteractionsQEDFirst
(interfaceInteractions,
"QEDFirst",
"QED first then QCD",
2);
static SwitchOption interfaceInteractionsQEDOnly
(interfaceInteractions,
"QEDOnly",
"Only QED",
3);
static SwitchOption interfaceInteractionsBothAtOnce
(interfaceInteractions,
"BothAtOnce",
"Generate both at the same time",
4);
static Switch<Evolver,unsigned int> interfaceReconstructionOption
("ReconstructionOption",
"Treatment of the reconstruction of the transverse momentum of "
"a branching from the evolution scale.",
&Evolver::_reconOpt, 0, false, false);
static SwitchOption interfaceReconstructionOptionCutOff
(interfaceReconstructionOption,
"CutOff",
"Use the cut-off masses in the calculation",
0);
static SwitchOption interfaceReconstructionOptionOffShell
(interfaceReconstructionOption,
"OffShell",
"Use the off-shell masses in the calculation",
1);
}
void Evolver::generateIntrinsicpT(vector<ShowerProgenitorPtr> particlesToShower) {
_intrinsic.clear();
if ( !ipTon() || !isISRadiationON() ) return;
// don't do anything for the moment for secondary scatters
if( !ShowerHandler::currentHandler()->firstInteraction() ) return;
// generate intrinsic pT
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
// only consider initial-state particles
if(particlesToShower[ix]->progenitor()->isFinalState()) continue;
if(!particlesToShower[ix]->progenitor()->dataPtr()->coloured()) continue;
Energy ipt;
if(UseRandom::rnd() > _beta) {
ipt=_iptrms*sqrt(-log(UseRandom::rnd()));
}
else {
ipt=_gamma*sqrt(pow(1.+sqr(_iptmax/_gamma), UseRandom::rnd())-1.);
}
pair<Energy,double> pt = make_pair(ipt,UseRandom::rnd(Constants::twopi));
_intrinsic[particlesToShower[ix]] = pt;
}
}
-void Evolver::setupMaximumScales(vector<ShowerProgenitorPtr> & p) {
+void Evolver::setupMaximumScales(const vector<ShowerProgenitorPtr> & p,
+ XCPtr xcomb) {
// let POWHEG events radiate freely
if(_hardEmissionMode==1&&hardTree()) {
vector<ShowerProgenitorPtr>::const_iterator ckt = p.begin();
for (; ckt != p.end(); ckt++) (*ckt)->maxHardPt(Constants::MaxEnergy);
return;
}
// return if no vetos
if (!hardVetoOn()) return;
// find out if hard partonic subprocess.
bool isPartonic(false);
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator
cit = _currenttree->incomingLines().begin();
Lorentz5Momentum pcm;
for(; cit!=currentTree()->incomingLines().end(); ++cit) {
pcm += cit->first->progenitor()->momentum();
isPartonic |= cit->first->progenitor()->coloured();
}
// find maximum pt from hard process, the maximum pt from all outgoing
// coloured lines (this is simpler and more general than
// 2stu/(s^2+t^2+u^2)). Maximum scale for scattering processes will
// be transverse mass.
Energy ptmax = -1.0*GeV;
// general case calculate the scale
if (!hardVetoXComb()||
(hardVetoReadOption()&&
!ShowerHandler::currentHandler()->firstInteraction())) {
// scattering process
if(currentTree()->isHard()) {
+ assert(xcomb);
// coloured incoming particles
if (isPartonic) {
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator
cjt = currentTree()->outgoingLines().begin();
for(; cjt!=currentTree()->outgoingLines().end(); ++cjt) {
if (cjt->first->progenitor()->coloured())
ptmax = max(ptmax,cjt->first->progenitor()->momentum().mt());
}
}
if (ptmax < ZERO) ptmax = pcm.m();
if(hardVetoXComb()&&hardVetoReadOption()&&
!ShowerHandler::currentHandler()->firstInteraction()) {
- ptmax=min(ptmax,sqrt(ShowerHandler::currentHandler()
- ->lastXCombPtr()->lastScale()));
+ ptmax=min(ptmax,sqrt(xcomb->lastScale()));
}
}
// decay, incoming() is the decaying particle.
else {
ptmax = currentTree()->incomingLines().begin()->first
->progenitor()->momentum().mass();
}
}
// hepeup.SCALUP is written into the lastXComb by the
// LesHouchesReader itself - use this by user's choice.
// Can be more general than this.
else {
- ptmax = sqrt( ShowerHandler::currentHandler()
- ->lastXCombPtr()->lastScale() );
+ if(currentTree()->isHard()) {
+ assert(xcomb);
+ ptmax = sqrt( xcomb->lastScale() );
+ }
+ else {
+ ptmax = currentTree()->incomingLines().begin()->first
+ ->progenitor()->momentum().mass();
+ }
}
// set maxHardPt for all progenitors. For partonic processes this
// is now the max pt in the FS, for non-partonic processes or
// processes with no coloured FS the invariant mass of the IS
vector<ShowerProgenitorPtr>::const_iterator ckt = p.begin();
for (; ckt != p.end(); ckt++) (*ckt)->maxHardPt(ptmax);
}
void Evolver::showerHardProcess(ShowerTreePtr hard, XCPtr xcomb) {
_hardme = HwMEBasePtr();
// extract the matrix element
tStdXCombPtr lastXC = dynamic_ptr_cast<tStdXCombPtr>(xcomb);
if(lastXC) {
_hardme = dynamic_ptr_cast<HwMEBasePtr>(lastXC->matrixElement());
}
_decayme = HwDecayerBasePtr();
// set the current tree
currentTree(hard);
hardTree(HardTreePtr());
// number of attempts if more than one interaction switched on
unsigned int interactionTry=0;
do {
try {
// generate the showering
- doShowering(true);
+ doShowering(true,xcomb);
// if no vetos return
return;
}
catch (InteractionVeto) {
currentTree()->clear();
++interactionTry;
}
}
while(interactionTry<=5);
throw Exception() << "Too many tries for shower in "
<< "Evolver::showerHardProcess()"
<< Exception::eventerror;
}
void Evolver::hardMatrixElementCorrection(bool hard) {
// set the initial enhancement factors for the soft correction
_initialenhance = 1.;
_finalenhance = 1.;
// if hard matrix element switched off return
if(!MECOn()) return;
// see if we can get the correction from the matrix element
// or decayer
if(hard) {
if(_hardme&&_hardme->hasMECorrection()) {
_hardme->initializeMECorrection(_currenttree,
_initialenhance,_finalenhance);
if(hardMEC())
_hardme->applyHardMatrixElementCorrection(_currenttree);
}
}
else {
if(_decayme&&_decayme->hasMECorrection()) {
_decayme->initializeMECorrection(_currenttree,
_initialenhance,_finalenhance);
if(hardMEC())
_decayme->applyHardMatrixElementCorrection(_currenttree);
}
}
}
bool Evolver::timeLikeShower(tShowerParticlePtr particle,
ShowerInteraction::Type type,
bool first) {
// don't do anything if not needed
if(_limitEmissions == 1 || hardOnly() ||
( _limitEmissions == 2 && _nfs != 0) ||
( _limitEmissions == 4 && _nfs + _nis != 0) ) return false;
ShowerParticleVector theChildren;
int ntry=0;
do {
++ntry;
// generate the emission
Branching fb;
while (true) {
fb=_splittingGenerator->chooseForwardBranching(*particle,_finalenhance,type);
// no emission return
if(!fb.kinematics) return false;
// if emission OK break
if(!timeLikeVetoed(fb,particle)) break;
// otherwise reset scale and continue - SO IS involved in veto algorithm
particle->vetoEmission(fb.type,fb.kinematics->scale());
}
// has emitted
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics(fb.kinematics);
// Assign the splitting function to the emitting particle.
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
tcPDPtr pdata[2];
for(unsigned int ix=0;ix<2;++ix) pdata[ix]=getParticleData(fb.ids[ix+1]);
if(particle->id()!=fb.ids[0]) {
for(unsigned int ix=0;ix<2;++ix) {
tPDPtr cc(pdata[ix]->CC());
if(cc) pdata[ix]=cc;
}
}
theChildren.push_back(new_ptr(ShowerParticle(pdata[0],true)));
theChildren.push_back(new_ptr(ShowerParticle(pdata[1],true)));
// update the children
particle->showerKinematics()->
updateChildren(particle, theChildren,fb.type);
// update number of emissions
++_nfs;
if(_limitEmissions!=0) return true;
// shower the first particle
timeLikeShower(theChildren[0],type,false);
// shower the second particle
timeLikeShower(theChildren[1],type,false);
// that's if for old approach
if(_reconOpt==0) break;
// branching has happened
particle->showerKinematics()->
updateParent(particle, theChildren,fb.type);
// clean up the vetoed emission
if(particle->virtualMass()==ZERO) {
particle->showerKinematics(ShoKinPtr());
for(unsigned int ix=0;ix<theChildren.size();++ix)
particle->abandonChild(theChildren[ix]);
theChildren.clear();
}
}
while(particle->virtualMass()==ZERO&&ntry<50);
if(first)
particle->showerKinematics()->resetChildren(particle,theChildren);
return true;
}
bool
Evolver::spaceLikeShower(tShowerParticlePtr particle, PPtr beam,
ShowerInteraction::Type type) {
//using the pdf's associated with the ShowerHandler assures, that
//modified pdf's are used for the secondary interactions via
//CascadeHandler::resetPDFs(...)
tcPDFPtr pdf;
if(ShowerHandler::currentHandler()->firstPDF().particle() == _beam)
pdf = ShowerHandler::currentHandler()->firstPDF().pdf();
if(ShowerHandler::currentHandler()->secondPDF().particle() == _beam)
pdf = ShowerHandler::currentHandler()->secondPDF().pdf();
Energy freeze = ShowerHandler::currentHandler()->pdfFreezingScale();
// don't do anything if not needed
if(_limitEmissions == 2 || hardOnly() ||
( _limitEmissions == 1 && _nis != 0 ) ||
( _limitEmissions == 4 && _nis + _nfs != 0 ) ) return false;
Branching bb;
// generate branching
while (true) {
bb=_splittingGenerator->chooseBackwardBranching(*particle,beam,
_initialenhance,
_beam,type,
pdf,freeze);
// return if no emission
if(!bb.kinematics) return false;
// if not vetoed break
if(!spaceLikeVetoed(bb,particle)) break;
// otherwise reset scale and continue
particle->vetoEmission(bb.type,bb.kinematics->scale());
}
// assign the splitting function and shower kinematics
particle->showerKinematics(bb.kinematics);
// For the time being we are considering only 1->2 branching
// particles as in Sudakov form factor
tcPDPtr part[2]={getParticleData(bb.ids[0]),
getParticleData(bb.ids[2])};
if(particle->id()!=bb.ids[1]) {
if(part[0]->CC()) part[0]=part[0]->CC();
if(part[1]->CC()) part[1]=part[1]->CC();
}
// Now create the actual particles, make the otherChild a final state
// particle, while the newParent is not
ShowerParticlePtr newParent=new_ptr(ShowerParticle(part[0],false));
ShowerParticlePtr otherChild = new_ptr(ShowerParticle(part[1],true,true));
ShowerParticleVector theChildren;
theChildren.push_back(particle);
theChildren.push_back(otherChild);
//this updates the evolution scale
particle->showerKinematics()->
updateParent(newParent, theChildren,bb.type);
// update the history if needed
_currenttree->updateInitialStateShowerProduct(_progenitor,newParent);
_currenttree->addInitialStateBranching(particle,newParent,otherChild);
// for the reconstruction of kinematics, parent/child
// relationships are according to the branching process:
// now continue the shower
++_nis;
bool emitted = _limitEmissions==0 ?
spaceLikeShower(newParent,beam,type) : false;
// now reconstruct the momentum
if(!emitted) {
if(_intrinsic.find(_progenitor)==_intrinsic.end()) {
bb.kinematics->updateLast(newParent,ZERO,ZERO);
}
else {
pair<Energy,double> kt=_intrinsic[_progenitor];
bb.kinematics->updateLast(newParent,
kt.first*cos(kt.second),
kt.first*sin(kt.second));
}
}
particle->showerKinematics()->
updateChildren(newParent, theChildren,bb.type);
if(_limitEmissions!=0) return true;
// perform the shower of the final-state particle
timeLikeShower(otherChild,type,true);
// return the emitted
return true;
}
void Evolver::showerDecay(ShowerTreePtr decay) {
_decayme = HwDecayerBasePtr();
_hardme = HwMEBasePtr();
// find the decayer
// try the normal way if possible
tDMPtr dm = decay->incomingLines().begin()->first->original() ->decayMode();
if(!dm) dm = decay->incomingLines().begin()->first->copy() ->decayMode();
if(!dm) dm = decay->incomingLines().begin()->first->progenitor()->decayMode();
// otherwise make a string and look it up
if(!dm) {
string tag = decay->incomingLines().begin()->first->original()->dataPtr()->name()
+ "->";
for(map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator
it=decay->outgoingLines().begin();it!=decay->outgoingLines().end();++it) {
if(it!=decay->outgoingLines().begin()) tag += ",";
tag += it->first->original()->dataPtr()->name();
}
tag += ";";
dm = generator()->findDecayMode(tag);
}
if(dm) _decayme = dynamic_ptr_cast<HwDecayerBasePtr>(dm->decayer());
// set the ShowerTree to be showered
currentTree(decay);
decay->applyTransforms();
hardTree(HardTreePtr());
unsigned int interactionTry=0;
do {
try {
// generate the showering
- doShowering(false);
+ doShowering(false,XCPtr());
// if no vetos return
return;
}
catch (InteractionVeto) {
currentTree()->clear();
++interactionTry;
}
}
while(interactionTry<=5);
throw Exception() << "Too many tries for QED shower in Evolver::showerDecay()"
<< Exception::eventerror;
}
bool Evolver::spaceLikeDecayShower(tShowerParticlePtr particle,
const ShowerParticle::EvolutionScales & maxScales,
Energy minmass,ShowerInteraction::Type type) {
Branching fb;
while (true) {
fb=_splittingGenerator->chooseDecayBranching(*particle,maxScales,minmass,
_initialenhance,type);
// return if no radiation
if(!fb.kinematics) return false;
// if not vetoed break
if(!spaceLikeDecayVetoed(fb,particle)) break;
// otherwise reset scale and continue
particle->vetoEmission(fb.type,fb.kinematics->scale());
}
// has emitted
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics(fb.kinematics);
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
tcPDPtr pdata[2];
for(unsigned int ix=0;ix<2;++ix) pdata[ix]=getParticleData(fb.ids[ix+1]);
if(particle->id()!=fb.ids[0]) {
for(unsigned int ix=0;ix<2;++ix) {
tPDPtr cc(pdata[ix]->CC());
if(cc) pdata[ix]=cc;
}
}
ShowerParticleVector theChildren;
theChildren.push_back(new_ptr(ShowerParticle(pdata[0],true)));
theChildren.push_back(new_ptr(ShowerParticle(pdata[1],true)));
// some code moved to updateChildren
particle->showerKinematics()->
updateChildren(particle, theChildren, fb.type);
// In the case of splittings which involves coloured particles,
// set properly the colour flow of the branching.
// update the history if needed
_currenttree->updateInitialStateShowerProduct(_progenitor,theChildren[0]);
_currenttree->addInitialStateBranching(particle,theChildren[0],theChildren[1]);
// shower the first particle
spaceLikeDecayShower(theChildren[0],maxScales,minmass,type);
// shower the second particle
timeLikeShower(theChildren[1],type,true);
// branching has happened
return true;
}
vector<ShowerProgenitorPtr> Evolver::setupShower(bool hard) {
// generate POWHEG hard emission if needed
if(_hardEmissionMode==1) hardestEmission(hard);
ShowerInteraction::Type inter = interactions_[0];
if(_hardtree&&inter!=ShowerInteraction::Both) {
inter = _hardtree->interaction();
}
// set the initial colour partners
setEvolutionPartners(hard,inter,false);
// generate hard me if needed
if(_hardEmissionMode==0) hardMatrixElementCorrection(hard);
// get the particles to be showered
vector<ShowerProgenitorPtr> particlesToShower =
currentTree()->extractProgenitors();
// remake the colour partners if needed
if(_hardEmissionMode==0 && _currenttree->hardMatrixElementCorrection()) {
setEvolutionPartners(hard,interactions_[0],true);
_currenttree->resetShowerProducts();
}
// return the answer
return particlesToShower;
}
void Evolver::setEvolutionPartners(bool hard,ShowerInteraction::Type type,
bool clear) {
// match the particles in the ShowerTree and hardTree
if(hardTree() && !hardTree()->connect(currentTree()))
throw Exception() << "Can't match trees in "
<< "Evolver::setEvolutionPartners()"
<< Exception::eventerror;
// extract the progenitors
vector<ShowerParticlePtr> particles =
currentTree()->extractProgenitorParticles();
// sort out the colour partners
if(hardTree()) {
// find the partner
for(unsigned int ix=0;ix<particles.size();++ix) {
tHardBranchingPtr partner =
hardTree()->particles()[particles[ix]]->colourPartner();
if(!partner) continue;
for(map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
it=hardTree()->particles().begin();
it!=hardTree()->particles().end();++it) {
if(it->second==partner) particles[ix]->partner(it->first);
}
if(!particles[ix]->partner())
throw Exception() << "Can't match partners in "
<< "Evolver::setEvolutionPartners()"
<< Exception::eventerror;
}
}
// Set the initial evolution scales
if(clear) {
for(unsigned int ix=0;ix<particles.size();++ix) {
particles[ix]->partner(ShowerParticlePtr());
particles[ix]->clearPartners();
}
}
showerModel()->partnerFinder()->
setInitialEvolutionScales(particles,!hard,type,!_hardtree);
}
void Evolver::updateHistory(tShowerParticlePtr particle) {
if(!particle->children().empty()) {
ShowerParticleVector theChildren;
for(unsigned int ix=0;ix<particle->children().size();++ix) {
ShowerParticlePtr part = dynamic_ptr_cast<ShowerParticlePtr>
(particle->children()[ix]);
theChildren.push_back(part);
}
// update the history if needed
if(particle==_currenttree->getFinalStateShowerProduct(_progenitor))
_currenttree->updateFinalStateShowerProduct(_progenitor,
particle,theChildren);
_currenttree->addFinalStateBranching(particle,theChildren);
for(unsigned int ix=0;ix<theChildren.size();++ix)
updateHistory(theChildren[ix]);
}
}
bool Evolver::startTimeLikeShower(ShowerInteraction::Type type) {
if(hardTree()) {
map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
eit=hardTree()->particles().end(),
mit = hardTree()->particles().find(progenitor()->progenitor());
if( mit != eit && !mit->second->children().empty() ) {
bool output=truncatedTimeLikeShower(progenitor()->progenitor(),
mit->second ,type);
if(output) updateHistory(progenitor()->progenitor());
return output;
}
}
bool output = hardOnly() ? false :
timeLikeShower(progenitor()->progenitor() ,type,true) ;
if(output) updateHistory(progenitor()->progenitor());
return output;
}
bool Evolver::startSpaceLikeShower(PPtr parent, ShowerInteraction::Type type) {
if(hardTree()) {
map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
eit =hardTree()->particles().end(),
mit = hardTree()->particles().find(progenitor()->progenitor());
if( mit != eit && mit->second->parent() ) {
return truncatedSpaceLikeShower( progenitor()->progenitor(),
parent, mit->second->parent(), type );
}
}
return hardOnly() ? false :
spaceLikeShower(progenitor()->progenitor(),parent,type);
}
bool Evolver::
startSpaceLikeDecayShower(const ShowerParticle::EvolutionScales & maxScales,
Energy minimumMass,ShowerInteraction::Type type) {
if(hardTree()) {
map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
eit =hardTree()->particles().end(),
mit = hardTree()->particles().find(progenitor()->progenitor());
if( mit != eit && mit->second->parent() ) {
HardBranchingPtr branch=mit->second;
while(branch->parent()) branch=branch->parent();
return truncatedSpaceLikeDecayShower(progenitor()->progenitor(),maxScales,
minimumMass, branch ,type);
}
}
return hardOnly() ? false :
spaceLikeDecayShower(progenitor()->progenitor(),maxScales,minimumMass,type);
}
bool Evolver::timeLikeVetoed(const Branching & fb,
ShowerParticlePtr particle) {
// work out type of interaction
ShowerInteraction::Type type = fb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
// check whether emission was harder than largest pt of hard subprocess
if ( hardVetoFS() && fb.kinematics->pT() > _progenitor->maxHardPt() )
return true;
// soft matrix element correction veto
if( softMEC()) {
if(_hardme && _hardme->hasMECorrection()) {
if(_hardme->softMatrixElementVeto(_progenitor,particle,fb))
return true;
}
else if(_decayme && _decayme->hasMECorrection()) {
if(_decayme->softMatrixElementVeto(_progenitor,particle,fb))
return true;
}
}
// veto on maximum pt
if(fb.kinematics->pT()>_progenitor->maximumpT(type)) return true;
// general vetos
if (fb.kinematics && !_vetoes.empty()) {
bool vetoed=false;
for (vector<ShowerVetoPtr>::iterator v = _vetoes.begin();
v != _vetoes.end(); ++v) {
bool test = (**v).vetoTimeLike(_progenitor,particle,fb);
switch((**v).vetoType()) {
case ShowerVeto::Emission:
vetoed |= test;
break;
case ShowerVeto::Shower:
if(test) throw VetoShower();
break;
case ShowerVeto::Event:
if(test) throw Veto();
break;
}
}
if(vetoed) return true;
}
return false;
}
bool Evolver::spaceLikeVetoed(const Branching & bb,
ShowerParticlePtr particle) {
// work out type of interaction
ShowerInteraction::Type type = bb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
// check whether emission was harder than largest pt of hard subprocess
if (hardVetoIS() && bb.kinematics->pT() > _progenitor->maxHardPt())
return true;
// apply the soft correction
if( softMEC() && _hardme && _hardme->hasMECorrection() ) {
if(_hardme->softMatrixElementVeto(_progenitor,particle,bb))
return true;
}
// the more general vetos
// check vs max pt for the shower
if(bb.kinematics->pT()>_progenitor->maximumpT(type)) return true;
if (!_vetoes.empty()) {
bool vetoed=false;
for (vector<ShowerVetoPtr>::iterator v = _vetoes.begin();
v != _vetoes.end(); ++v) {
bool test = (**v).vetoSpaceLike(_progenitor,particle,bb);
switch ((**v).vetoType()) {
case ShowerVeto::Emission:
vetoed |= test;
break;
case ShowerVeto::Shower:
if(test) throw VetoShower();
break;
case ShowerVeto::Event:
if(test) throw Veto();
break;
}
}
if (vetoed) return true;
}
return false;
}
bool Evolver::spaceLikeDecayVetoed( const Branching & fb,
ShowerParticlePtr particle) {
// work out type of interaction
ShowerInteraction::Type type = fb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
// apply the soft correction
if( softMEC() && _decayme && _decayme->hasMECorrection() ) {
if(_decayme->softMatrixElementVeto(_progenitor,particle,fb))
return true;
}
// veto on hardest pt in the shower
if(fb.kinematics->pT()> _progenitor->maximumpT(type)) return true;
// general vetos
if (!_vetoes.empty()) {
bool vetoed=false;
for (vector<ShowerVetoPtr>::iterator v = _vetoes.begin();
v != _vetoes.end(); ++v) {
bool test = (**v).vetoSpaceLike(_progenitor,particle,fb);
switch((**v).vetoType()) {
case ShowerVeto::Emission:
vetoed |= test;
break;
case ShowerVeto::Shower:
if(test) throw VetoShower();
break;
case ShowerVeto::Event:
if(test) throw Veto();
break;
}
if (vetoed) return true;
}
}
return false;
}
void Evolver::hardestEmission(bool hard) {
if( ( _hardme && _hardme->hasPOWHEGCorrection()) ||
(_decayme && _decayme->hasPOWHEGCorrection())) {
if(_hardme) {
assert(hard);
if(interaction_==4) {
vector<ShowerInteraction::Type> inter(2);
inter[0] = ShowerInteraction::QCD;
inter[1] = ShowerInteraction::QED;
_hardtree = _hardme->generateHardest( currentTree(),inter );
}
else {
_hardtree = _hardme->generateHardest( currentTree(),interactions_ );
}
}
else {
assert(!hard);
_hardtree = _decayme->generateHardest( currentTree() );
}
if(!_hardtree) return;
// join up the two trees
connectTrees(currentTree(),_hardtree,hard);
}
else {
_hardtree = ShowerHandler::currentHandler()->generateCKKW(currentTree());
}
}
bool Evolver::truncatedTimeLikeShower(tShowerParticlePtr particle,
HardBranchingPtr branch,
ShowerInteraction::Type type) {
int ntry=0;
do {
++ntry;
Branching fb;
unsigned int iout=0;
tcPDPtr pdata[2];
while (true) {
// no truncated shower break
if(!isTruncatedShowerON()||hardOnly()) break;
// generate emission
fb=splittingGenerator()->chooseForwardBranching(*particle,1.,type);
// no emission break
if(!fb.kinematics) break;
// check haven't evolved too far
if(fb.kinematics->scale() < branch->scale()) {
fb=Branching();
break;
}
// get the particle data objects
for(unsigned int ix=0;ix<2;++ix) pdata[ix]=getParticleData(fb.ids[ix+1]);
if(particle->id()!=fb.ids[0]) {
for(unsigned int ix=0;ix<2;++ix) {
tPDPtr cc(pdata[ix]->CC());
if(cc) pdata[ix]=cc;
}
}
// find the truncated line
iout=0;
if(pdata[0]->id()!=pdata[1]->id()) {
if(pdata[0]->id()==particle->id()) iout=1;
else if (pdata[1]->id()==particle->id()) iout=2;
}
else if(pdata[0]->id()==particle->id()) {
if(fb.kinematics->z()>0.5) iout=1;
else iout=2;
}
// apply the vetos for the truncated shower
// no flavour changing branchings
if(iout==0) {
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
double zsplit = iout==1 ? fb.kinematics->z() : 1-fb.kinematics->z();
// only if same interaction for forced branching
ShowerInteraction::Type type2 = fb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
// and evolution
if(type2==branch->sudakov()->interactionType()) {
if(zsplit < 0.5 || // hardest line veto
fb.kinematics->scale()*zsplit < branch->scale() ) { // angular ordering veto
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
}
// pt veto
if(fb.kinematics->pT() > progenitor()->maximumpT(type2)) {
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
// should do base class vetos as well
if(timeLikeVetoed(fb,particle)) {
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
break;
}
// if no branching force trunctaed emission
if(!fb.kinematics) {
// construct the kinematics for the hard emission
ShoKinPtr showerKin=
branch->sudakov()->createFinalStateBranching(branch->scale(),
branch->children()[0]->z(),
branch->phi(),
branch->children()[0]->pT());
showerKin->initialize( *particle,PPtr() );
IdList idlist(3);
idlist[0] = particle->id();
idlist[1] = branch->children()[0]->branchingParticle()->id();
idlist[2] = branch->children()[1]->branchingParticle()->id();
fb = Branching( showerKin, idlist, branch->sudakov(),branch->type() );
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics( fb.kinematics );
// Assign the splitting function to the emitting particle.
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
ShowerParticleVector theChildren;
theChildren.push_back(new_ptr(ShowerParticle(branch->children()[0]->
branchingParticle()->dataPtr(),true)));
theChildren.push_back(new_ptr(ShowerParticle(branch->children()[1]->
branchingParticle()->dataPtr(),true)));
particle->showerKinematics()->
updateChildren(particle, theChildren,fb.type);
// shower the first particle
if( branch->children()[0]->children().empty() ) {
if( ! hardOnly() )
timeLikeShower(theChildren[0],type,false);
}
else {
truncatedTimeLikeShower( theChildren[0],branch->children()[0],type);
}
// shower the second particle
if( branch->children()[1]->children().empty() ) {
if( ! hardOnly() )
timeLikeShower( theChildren[1] , type,false);
}
else {
truncatedTimeLikeShower( theChildren[1],branch->children()[1] ,type);
}
// that's if for old approach
if(_reconOpt==0) return true;
// branching has happened
particle->showerKinematics()->updateParent(particle, theChildren,fb.type);
// clean up the vetoed emission
if(particle->virtualMass()==ZERO) {
particle->showerKinematics(ShoKinPtr());
for(unsigned int ix=0;ix<theChildren.size();++ix)
particle->abandonChild(theChildren[ix]);
theChildren.clear();
}
else return true;
}
// has emitted
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics(fb.kinematics);
// Assign the splitting function to the emitting particle.
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
ShowerParticleVector theChildren;
theChildren.push_back( new_ptr( ShowerParticle( pdata[0], true ) ) );
theChildren.push_back( new_ptr( ShowerParticle( pdata[1], true ) ) );
particle->showerKinematics()->
updateChildren( particle, theChildren , fb.type);
// shower the first particle
if( iout == 1 ) truncatedTimeLikeShower( theChildren[0], branch , type );
else timeLikeShower( theChildren[0] , type,false);
// shower the second particle
if( iout == 2 ) truncatedTimeLikeShower( theChildren[1], branch , type );
else timeLikeShower( theChildren[1] , type,false);
// that's if for old approach
if(_reconOpt==0) return true;
// branching has happened
particle->showerKinematics()->updateParent(particle, theChildren,fb.type);
// clean up the vetoed emission
if(particle->virtualMass()==ZERO) {
particle->showerKinematics(ShoKinPtr());
for(unsigned int ix=0;ix<theChildren.size();++ix)
particle->abandonChild(theChildren[ix]);
theChildren.clear();
}
else return true;
}
while(ntry<50);
return false;
}
bool Evolver::truncatedSpaceLikeShower(tShowerParticlePtr particle, PPtr beam,
HardBranchingPtr branch,
ShowerInteraction::Type type) {
tcPDFPtr pdf;
if(ShowerHandler::currentHandler()->firstPDF().particle() == beamParticle())
pdf = ShowerHandler::currentHandler()->firstPDF().pdf();
if(ShowerHandler::currentHandler()->secondPDF().particle() == beamParticle())
pdf = ShowerHandler::currentHandler()->secondPDF().pdf();
Energy freeze = ShowerHandler::currentHandler()->pdfFreezingScale();
Branching bb;
// parameters of the force branching
double z(0.);
HardBranchingPtr timelike;
for( unsigned int ix = 0; ix < branch->children().size(); ++ix ) {
if( branch->children()[ix]->status() ==HardBranching::Outgoing) {
timelike = branch->children()[ix];
}
if( branch->children()[ix]->status() ==HardBranching::Incoming )
z = branch->children()[ix]->z();
}
// generate truncated branching
tcPDPtr part[2];
if(z>=0.&&z<=1.) {
while (true) {
if( !isTruncatedShowerON() || hardOnly() ) break;
bb = splittingGenerator()->chooseBackwardBranching( *particle,
beam, 1., beamParticle(),
type , pdf,freeze);
if( !bb.kinematics || bb.kinematics->scale() < branch->scale() ) {
bb = Branching();
break;
}
// particles as in Sudakov form factor
part[0] = getParticleData( bb.ids[0] );
part[1] = getParticleData( bb.ids[2] );
//is emitter anti-particle
if( particle->id() != bb.ids[1]) {
if( part[0]->CC() ) part[0] = part[0]->CC();
if( part[1]->CC() ) part[1] = part[1]->CC();
}
double zsplit = bb.kinematics->z();
// apply the vetos for the truncated shower
// if doesn't carry most of momentum
ShowerInteraction::Type type2 = bb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
if(type2==branch->sudakov()->interactionType() &&
zsplit < 0.5) {
particle->vetoEmission(bb.type,bb.kinematics->scale());
continue;
}
// others
if( part[0]->id() != particle->id() || // if particle changes type
bb.kinematics->pT() > progenitor()->maximumpT(type2) || // pt veto
bb.kinematics->scale() < branch->scale()) { // angular ordering veto
particle->vetoEmission(bb.type,bb.kinematics->scale());
continue;
}
// and those from the base class
if(spaceLikeVetoed(bb,particle)) {
particle->vetoEmission(bb.type,bb.kinematics->scale());
continue;
}
break;
}
}
if( !bb.kinematics ) {
//do the hard emission
ShoKinPtr kinematics =
branch->sudakov()->createInitialStateBranching( branch->scale(), z, branch->phi(),
branch->children()[0]->pT() );
kinematics->initialize( *particle, beam );
// assign the splitting function and shower kinematics
particle->showerKinematics( kinematics );
// For the time being we are considering only 1->2 branching
// Now create the actual particles, make the otherChild a final state
// particle, while the newParent is not
ShowerParticlePtr newParent =
new_ptr( ShowerParticle( branch->branchingParticle()->dataPtr(), false ) );
ShowerParticlePtr otherChild =
new_ptr( ShowerParticle( timelike->branchingParticle()->dataPtr(),
true, true ) );
ShowerParticleVector theChildren;
theChildren.push_back( particle );
theChildren.push_back( otherChild );
particle->showerKinematics()->
updateParent( newParent, theChildren, branch->type());
// update the history if needed
currentTree()->updateInitialStateShowerProduct( progenitor(), newParent );
currentTree()->addInitialStateBranching( particle, newParent, otherChild );
// for the reconstruction of kinematics, parent/child
// relationships are according to the branching process:
// now continue the shower
bool emitted=false;
if(!hardOnly()) {
if( branch->parent() ) {
emitted = truncatedSpaceLikeShower( newParent, beam, branch->parent() , type);
}
else {
emitted = spaceLikeShower( newParent, beam , type);
}
}
if( !emitted ) {
if( intrinsicpT().find( progenitor() ) == intrinsicpT().end() ) {
kinematics->updateLast( newParent, ZERO, ZERO );
}
else {
pair<Energy,double> kt = intrinsicpT()[progenitor()];
kinematics->updateLast( newParent,
kt.first*cos( kt.second ),
kt.first*sin( kt.second ) );
}
}
particle->showerKinematics()->
updateChildren( newParent, theChildren,bb.type);
if(hardOnly()) return true;
// perform the shower of the final-state particle
if( timelike->children().empty() ) {
timeLikeShower( otherChild , type,true);
}
else {
truncatedTimeLikeShower( otherChild, timelike , type);
}
// return the emitted
return true;
}
// assign the splitting function and shower kinematics
particle->showerKinematics( bb.kinematics );
// For the time being we are considering only 1->2 branching
// Now create the actual particles, make the otherChild a final state
// particle, while the newParent is not
ShowerParticlePtr newParent = new_ptr( ShowerParticle( part[0], false ) );
ShowerParticlePtr otherChild = new_ptr( ShowerParticle( part[1], true, true ) );
ShowerParticleVector theChildren;
theChildren.push_back( particle );
theChildren.push_back( otherChild );
particle->showerKinematics()->
updateParent( newParent, theChildren, bb.type);
// update the history if needed
currentTree()->updateInitialStateShowerProduct( progenitor(), newParent );
currentTree()->addInitialStateBranching( particle, newParent, otherChild );
// for the reconstruction of kinematics, parent/child
// relationships are according to the branching process:
// now continue the shower
bool emitted = truncatedSpaceLikeShower( newParent, beam, branch,type);
// now reconstruct the momentum
if( !emitted ) {
if( intrinsicpT().find( progenitor() ) == intrinsicpT().end() ) {
bb.kinematics->updateLast( newParent, ZERO, ZERO );
}
else {
pair<Energy,double> kt = intrinsicpT()[ progenitor() ];
bb.kinematics->updateLast( newParent,
kt.first*cos( kt.second ),
kt.first*sin( kt.second ) );
}
}
particle->showerKinematics()->
updateChildren( newParent, theChildren, bb.type);
// perform the shower of the final-state particle
timeLikeShower( otherChild , type,true);
// return the emitted
return true;
}
bool Evolver::
truncatedSpaceLikeDecayShower(tShowerParticlePtr particle,
const ShowerParticle::EvolutionScales & maxScales,
Energy minmass, HardBranchingPtr branch,
ShowerInteraction::Type type) {
Branching fb;
unsigned int iout=0;
tcPDPtr pdata[2];
while (true) {
// no truncated shower break
if(!isTruncatedShowerON()||hardOnly()) break;
fb=splittingGenerator()->chooseDecayBranching(*particle,maxScales,minmass,1.,type);
// return if no radiation
if(!fb.kinematics) break;
// check haven't evolved too far
if(fb.kinematics->scale() < branch->scale()) {
fb=Branching();
break;
}
// get the particle data objects
for(unsigned int ix=0;ix<2;++ix) pdata[ix]=getParticleData(fb.ids[ix+1]);
if(particle->id()!=fb.ids[0]) {
for(unsigned int ix=0;ix<2;++ix) {
tPDPtr cc(pdata[ix]->CC());
if(cc) pdata[ix]=cc;
}
}
// find the truncated line
iout=0;
if(pdata[0]->id()!=pdata[1]->id()) {
if(pdata[0]->id()==particle->id()) iout=1;
else if (pdata[1]->id()==particle->id()) iout=2;
}
else if(pdata[0]->id()==particle->id()) {
if(fb.kinematics->z()>0.5) iout=1;
else iout=2;
}
// apply the vetos for the truncated shower
// no flavour changing branchings
if(iout==0) {
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
ShowerInteraction::Type type2 = fb.type==ShowerPartnerType::QED ?
ShowerInteraction::QED : ShowerInteraction::QCD;
double zsplit = iout==1 ? fb.kinematics->z() : 1-fb.kinematics->z();
if(type2==branch->sudakov()->interactionType()) {
if(zsplit < 0.5 || // hardest line veto
fb.kinematics->scale()*zsplit < branch->scale() ) { // angular ordering veto
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
}
// pt veto
if(fb.kinematics->pT() > progenitor()->maximumpT(type2)) {
particle->vetoEmission(fb.type,fb.kinematics->scale());
continue;
}
// should do base class vetos as well
// if not vetoed break
if(!spaceLikeDecayVetoed(fb,particle)) break;
// otherwise reset scale and continue
particle->vetoEmission(fb.type,fb.kinematics->scale());
}
// if no branching insert hard emission and continue
if(!fb.kinematics) {
// construct the kinematics for the hard emission
ShoKinPtr showerKin=
branch->sudakov()->createDecayBranching(branch->scale(),
branch->children()[0]->z(),
branch->phi(),
branch->children()[0]->pT());
showerKin->initialize( *particle,PPtr() );
IdList idlist(3);
idlist[0] = particle->id();
idlist[1] = branch->children()[0]->branchingParticle()->id();
idlist[2] = branch->children()[1]->branchingParticle()->id();
assert(false);
fb = Branching( showerKin, idlist, branch->sudakov(),ShowerPartnerType::QCDColourLine );
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics( fb.kinematics );
// Assign the splitting function to the emitting particle.
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
ShowerParticleVector theChildren;
theChildren.push_back(new_ptr(ShowerParticle(branch->children()[0]->
branchingParticle()->dataPtr(),true)));
theChildren.push_back(new_ptr(ShowerParticle(branch->children()[1]->
branchingParticle()->dataPtr(),true)));
particle->showerKinematics()->
updateChildren(particle, theChildren,fb.type);
if(theChildren[0]->id()==particle->id()) {
// update the history if needed
currentTree()->updateInitialStateShowerProduct(progenitor(),theChildren[0]);
currentTree()->addInitialStateBranching(particle,theChildren[0],theChildren[1]);
// shower the space-like particle
if( branch->children()[0]->children().empty() ) {
if( ! hardOnly() ) spaceLikeDecayShower(theChildren[0],maxScales,minmass,type);
}
else {
truncatedSpaceLikeDecayShower( theChildren[0],maxScales,minmass,
branch->children()[0],type);
}
// shower the second particle
if( branch->children()[1]->children().empty() ) {
if( ! hardOnly() ) timeLikeShower( theChildren[1] , type,true);
}
else {
truncatedTimeLikeShower( theChildren[1],branch->children()[1] ,type);
}
}
else {
// update the history if needed
currentTree()->updateInitialStateShowerProduct(progenitor(),theChildren[1]);
currentTree()->addInitialStateBranching(particle,theChildren[0],theChildren[1]);
// shower the space-like particle
if( branch->children()[1]->children().empty() ) {
if( ! hardOnly() ) spaceLikeDecayShower(theChildren[1],maxScales,minmass,type);
}
else {
truncatedSpaceLikeDecayShower( theChildren[1],maxScales,minmass,
branch->children()[1],type);
}
// shower the second particle
if( branch->children()[0]->children().empty() ) {
if( ! hardOnly() ) timeLikeShower( theChildren[0] , type,true);
}
else {
truncatedTimeLikeShower( theChildren[0],branch->children()[0] ,type);
}
}
return true;
}
// has emitted
// Assign the shower kinematics to the emitting particle.
particle->showerKinematics(fb.kinematics);
// For the time being we are considering only 1->2 branching
// Create the ShowerParticle objects for the two children of
// the emitting particle; set the parent/child relationship
// if same as definition create particles, otherwise create cc
ShowerParticleVector theChildren;
theChildren.push_back(new_ptr(ShowerParticle(pdata[0],true)));
theChildren.push_back(new_ptr(ShowerParticle(pdata[1],true)));
particle->showerKinematics()->updateChildren(particle, theChildren,fb.type);
// In the case of splittings which involves coloured particles,
// set properly the colour flow of the branching.
// update the history if needed
currentTree()->updateInitialStateShowerProduct(progenitor(),theChildren[0]);
currentTree()->addInitialStateBranching(particle,theChildren[0],theChildren[1]);
// shower the first particle
truncatedSpaceLikeDecayShower(theChildren[0],maxScales,minmass,branch,type);
// shower the second particle
timeLikeShower(theChildren[1],type,true);
// branching has happened
return true;
}
bool Evolver::constructDecayTree(vector<ShowerProgenitorPtr> & particlesToShower,
ShowerInteraction::Type inter) {
Energy ptmax(-GeV);
// get the maximum pt is all ready a hard tree
if(hardTree()) {
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if(particlesToShower[ix]->maximumpT(inter)>ptmax&&
particlesToShower[ix]->progenitor()->isFinalState())
ptmax = particlesToShower[ix]->maximumpT(inter);
}
}
vector<HardBranchingPtr> spaceBranchings,allBranchings;
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if(particlesToShower[ix]->progenitor()->isFinalState()) {
HardBranchingPtr newBranch;
if(particlesToShower[ix]->hasEmitted()) {
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
particlesToShower[ix]->progenitor()->
showerKinematics()->SudakovFormFactor(),
HardBranchingPtr(),HardBranching::Outgoing));
constructTimeLikeLine(newBranch,particlesToShower[ix]->progenitor());
}
else {
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
SudakovPtr(),HardBranchingPtr(),
HardBranching::Outgoing));
}
allBranchings.push_back(newBranch);
}
else {
HardBranchingPtr newBranch;
if(particlesToShower[ix]->hasEmitted()) {
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
particlesToShower[ix]->progenitor()->
showerKinematics()->SudakovFormFactor(),
HardBranchingPtr(),HardBranching::Decay));
constructTimeLikeLine(newBranch,particlesToShower[ix]->progenitor());
HardBranchingPtr last=newBranch;
do {
for(unsigned int ix=0;ix<last->children().size();++ix) {
if(last->children()[ix]->branchingParticle()->id()==
particlesToShower[ix]->id()) {
last = last->children()[ix];
continue;
}
}
}
while(!last->children().empty());
last->status(HardBranching::Incoming);
spaceBranchings.push_back(newBranch);
allBranchings .push_back(last);
}
else {
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
SudakovPtr(),HardBranchingPtr(),
HardBranching::Incoming));
spaceBranchings.push_back(newBranch);
allBranchings .push_back(newBranch);
}
}
}
HardTreePtr QCDTree = new_ptr(HardTree(allBranchings,spaceBranchings,inter));
// set the charge partners
ShowerParticleVector particles;
particles.push_back(spaceBranchings.back()->branchingParticle());
for(set<HardBranchingPtr>::iterator cit=QCDTree->branchings().begin();
cit!=QCDTree->branchings().end();++cit) {
if((*cit)->status()==HardBranching::Outgoing)
particles.push_back((*cit)->branchingParticle());
}
// get the partners
showerModel()->partnerFinder()->setInitialEvolutionScales(particles,true,inter,true);
// do the inverse recon
if(!showerModel()->kinematicsReconstructor()->
deconstructDecayJets(QCDTree,this,inter)) {
return false;
}
// clear the old shower
currentTree()->clear();
// set the hard tree
hardTree(QCDTree);
// set the charge partners
setEvolutionPartners(false,inter,false);
// get the particles to be showered
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator cit;
map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator cjt;
particlesToShower.clear();
// incoming particles
for(cit=currentTree()->incomingLines().begin();
cit!=currentTree()->incomingLines().end();++cit)
particlesToShower.push_back(((*cit).first));
assert(particlesToShower.size()==1);
// outgoing particles
for(cjt=currentTree()->outgoingLines().begin();
cjt!=currentTree()->outgoingLines().end();++cjt) {
particlesToShower.push_back(((*cjt).first));
if(ptmax>ZERO) particlesToShower.back()->maximumpT(ptmax,inter);
}
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
eit=hardTree()->particles().end(),
mit = hardTree()->particles().find(particlesToShower[ix]->progenitor());
if( mit != eit) {
if(mit->second->status()==HardBranching::Outgoing)
particlesToShower[ix]->progenitor()->set5Momentum(mit->second->pVector());
}
}
return true;
}
bool Evolver::constructHardTree(vector<ShowerProgenitorPtr> & particlesToShower,
ShowerInteraction::Type inter) {
bool noEmission = true;
vector<HardBranchingPtr> spaceBranchings,allBranchings;
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if(particlesToShower[ix]->progenitor()->isFinalState()) {
HardBranchingPtr newBranch;
if(particlesToShower[ix]->hasEmitted()) {
noEmission = false;
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
particlesToShower[ix]->progenitor()->
showerKinematics()->SudakovFormFactor(),
HardBranchingPtr(),HardBranching::Outgoing));
constructTimeLikeLine(newBranch,particlesToShower[ix]->progenitor());
}
else {
newBranch =
new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
SudakovPtr(),HardBranchingPtr(),
HardBranching::Outgoing));
}
allBranchings.push_back(newBranch);
}
else {
HardBranchingPtr first,last;
if(!particlesToShower[ix]->progenitor()->parents().empty()) {
noEmission = false;
constructSpaceLikeLine(particlesToShower[ix]->progenitor(),
first,last,SudakovPtr(),
particlesToShower[ix]->original()->parents()[0]);
}
else {
first = new_ptr(HardBranching(particlesToShower[ix]->progenitor(),
SudakovPtr(),HardBranchingPtr(),
HardBranching::Incoming));
if(particlesToShower[ix]->original()->parents().empty())
first->beam(particlesToShower[ix]->original());
else
first->beam(particlesToShower[ix]->original()->parents()[0]);
last = first;
}
spaceBranchings.push_back(first);
allBranchings.push_back(last);
}
}
if(!noEmission) {
HardTreePtr QCDTree = new_ptr(HardTree(allBranchings,spaceBranchings,
inter));
// set the charge partners
ShowerParticleVector particles;
for(set<HardBranchingPtr>::iterator cit=QCDTree->branchings().begin();
cit!=QCDTree->branchings().end();++cit) {
particles.push_back((*cit)->branchingParticle());
}
// get the partners
showerModel()->partnerFinder()->setInitialEvolutionScales(particles,false,
inter,true);
// do the inverse recon
if(!showerModel()->kinematicsReconstructor()->
deconstructHardJets(QCDTree,this,inter))
throw Exception() << "Can't to shower deconstruction for QED shower in"
<< "QEDEvolver::showerHard" << Exception::eventerror;
// set the hard tree
hardTree(QCDTree);
}
// clear the old shower
currentTree()->clear();
// set the charge partners
setEvolutionPartners(true,inter,false);
// get the particles to be showered
particlesToShower = currentTree()->extractProgenitors();
// reset momenta
if(hardTree()) {
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
map<ShowerParticlePtr,tHardBranchingPtr>::const_iterator
eit=hardTree()->particles().end(),
mit = hardTree()->particles().find(particlesToShower[ix]->progenitor());
if( mit != eit) {
particlesToShower[ix]->progenitor()->set5Momentum(mit->second->showerMomentum());
}
}
}
return true;
}
void Evolver::constructTimeLikeLine(tHardBranchingPtr branch,
tShowerParticlePtr particle) {
for(unsigned int ix=0;ix<particle->children().size();++ix) {
HardBranching::Status status = branch->status();
tShowerParticlePtr child =
dynamic_ptr_cast<ShowerParticlePtr>(particle->children()[ix]);
if(child->children().empty()) {
HardBranchingPtr newBranch =
new_ptr(HardBranching(child,SudakovPtr(),branch,status));
branch->addChild(newBranch);
}
else {
HardBranchingPtr newBranch =
new_ptr(HardBranching(child,child->showerKinematics()->SudakovFormFactor(),
branch,status));
constructTimeLikeLine(newBranch,child);
branch->addChild(newBranch);
}
}
// sort out the type of interaction
if(!branch->children().empty()) {
if(branch->branchingParticle()->id()==ParticleID::gamma ||
branch->children()[0]->branchingParticle()->id()==ParticleID::gamma ||
branch->children()[1]->branchingParticle()->id()==ParticleID::gamma)
branch->type(ShowerPartnerType::QED);
else {
if(branch->branchingParticle()->id()==
branch->children()[0]->branchingParticle()->id()) {
if(branch->branchingParticle()->dataPtr()->iColour()==PDT::Colour8) {
tShowerParticlePtr emittor =
branch->branchingParticle()->showerKinematics()->z()>0.5 ?
branch->children()[0]->branchingParticle() :
branch->children()[1]->branchingParticle();
if(branch->branchingParticle()->colourLine()==emittor->colourLine())
branch->type(ShowerPartnerType::QCDAntiColourLine);
else if(branch->branchingParticle()->antiColourLine()==emittor->antiColourLine())
branch->type(ShowerPartnerType::QCDColourLine);
else
assert(false);
}
else if(branch->branchingParticle()->colourLine()) {
branch->type(ShowerPartnerType::QCDColourLine);
}
else if(branch->branchingParticle()->antiColourLine()) {
branch->type(ShowerPartnerType::QCDAntiColourLine);
}
else
assert(false);
}
else if(branch->branchingParticle()->id()==ParticleID::g &&
branch->children()[0]->branchingParticle()->id()==
-branch->children()[1]->branchingParticle()->id()) {
if(branch->branchingParticle()->showerKinematics()->z()>0.5)
branch->type(ShowerPartnerType::QCDAntiColourLine);
else
branch->type(ShowerPartnerType::QCDColourLine);
}
else
assert(false);
}
}
}
void Evolver::constructSpaceLikeLine(tShowerParticlePtr particle,
HardBranchingPtr & first,
HardBranchingPtr & last,
SudakovPtr sud,PPtr beam) {
if(!particle) return;
if(!particle->parents().empty()) {
tShowerParticlePtr parent =
dynamic_ptr_cast<ShowerParticlePtr>(particle->parents()[0]);
SudakovPtr newSud=particle->showerKinematics()->SudakovFormFactor();
constructSpaceLikeLine(parent,first,last,newSud,beam);
}
HardBranchingPtr newBranch =
new_ptr(HardBranching(particle,sud,last,HardBranching::Incoming));
newBranch->beam(beam);
if(!first) {
first=newBranch;
last =newBranch;
return;
}
last->addChild(newBranch);
tShowerParticlePtr timeChild =
dynamic_ptr_cast<ShowerParticlePtr>(particle->parents()[0]->children()[1]);
HardBranchingPtr timeBranch;
if(!timeChild->children().empty()) {
timeBranch =
new_ptr(HardBranching(timeChild,
timeChild->showerKinematics()->SudakovFormFactor(),
last,HardBranching::Outgoing));
constructTimeLikeLine(timeBranch,timeChild);
}
else {
timeBranch =
new_ptr(HardBranching(timeChild,SudakovPtr(),last,HardBranching::Outgoing));
}
last->addChild(timeBranch);
// sort out the type
if(last->branchingParticle() ->id() == ParticleID::gamma ||
newBranch->branchingParticle() ->id() == ParticleID::gamma ||
timeBranch->branchingParticle()->id() == ParticleID::gamma) {
last->type(ShowerPartnerType::QED);
}
else if(last->branchingParticle()->id()==newBranch->branchingParticle()->id()) {
if(last->branchingParticle()->id()==ParticleID::g) {
if(last->branchingParticle()->colourLine()==
newBranch->branchingParticle()->colourLine()) {
last->type(ShowerPartnerType::QCDAntiColourLine);
}
else {
last->type(ShowerPartnerType::QCDColourLine);
}
}
else if(last->branchingParticle()->hasColour()) {
last->type(ShowerPartnerType::QCDColourLine);
}
else if(last->branchingParticle()->hasAntiColour()) {
last->type(ShowerPartnerType::QCDAntiColourLine);
}
else
assert(false);
}
else if(newBranch->branchingParticle()->id()==ParticleID::g) {
if(last->branchingParticle()->hasColour()) {
last->type(ShowerPartnerType::QCDAntiColourLine);
}
else if(last->branchingParticle()->hasAntiColour()) {
last->type(ShowerPartnerType::QCDColourLine);
}
else
assert(false);
}
else if(newBranch->branchingParticle()->hasColour()) {
last->type(ShowerPartnerType::QCDColourLine);
}
else if(newBranch->branchingParticle()->hasAntiColour()) {
last->type(ShowerPartnerType::QCDAntiColourLine);
}
else {
assert(false);
}
last=newBranch;
}
void Evolver::connectTrees(ShowerTreePtr showerTree,
HardTreePtr hardTree, bool hard ) {
ShowerParticleVector particles;
// find the Sudakovs
for(set<HardBranchingPtr>::iterator cit=hardTree->branchings().begin();
cit!=hardTree->branchings().end();++cit) {
// Sudakovs for ISR
if((**cit).parent()&&(**cit).status()==HardBranching::Incoming) {
++_nis;
IdList br(3);
br[0] = (**cit).parent()->branchingParticle()->id();
br[1] = (**cit). branchingParticle()->id();
br[2] = (**cit).parent()->children()[0]==*cit ?
(**cit).parent()->children()[1]->branchingParticle()->id() :
(**cit).parent()->children()[0]->branchingParticle()->id();
BranchingList branchings = splittingGenerator()->initialStateBranchings();
if(br[1]<0&&br[0]==br[1]) {
br[0] = abs(br[0]);
br[1] = abs(br[1]);
}
else if(br[1]<0) {
br[1] = -br[1];
br[2] = -br[2];
}
long index = abs(br[1]);
SudakovPtr sudakov;
for(BranchingList::const_iterator cjt = branchings.lower_bound(index);
cjt != branchings.upper_bound(index); ++cjt ) {
IdList ids = cjt->second.second;
if(ids[0]==br[0]&&ids[1]==br[1]&&ids[2]==br[2]) {
sudakov=cjt->second.first;
break;
}
}
if(!sudakov) throw Exception() << "Can't find Sudakov for the hard emission in "
<< "Evolver::connectTrees() for ISR"
<< Exception::runerror;
(**cit).parent()->sudakov(sudakov);
}
// Sudakovs for FSR
else if(!(**cit).children().empty()) {
++_nfs;
IdList br(3);
br[0] = (**cit) .branchingParticle()->id();
br[1] = (**cit).children()[0]->branchingParticle()->id();
br[2] = (**cit).children()[1]->branchingParticle()->id();
BranchingList branchings = splittingGenerator()->finalStateBranchings();
if(br[0]<0) {
br[0] = abs(br[0]);
br[1] = abs(br[1]);
br[2] = abs(br[2]);
}
long index = br[0];
SudakovPtr sudakov;
for(BranchingList::const_iterator cjt = branchings.lower_bound(index);
cjt != branchings.upper_bound(index); ++cjt ) {
IdList ids = cjt->second.second;
if(ids[0]==br[0]&&ids[1]==br[1]&&ids[2]==br[2]) {
sudakov=cjt->second.first;
break;
}
}
if(!sudakov) throw Exception() << "Can't find Sudakov for the hard emission in "
<< "Evolver::connectTrees()"
<< Exception::runerror;
(**cit).sudakov(sudakov);
}
}
// calculate the evolution scale
for(set<HardBranchingPtr>::iterator cit=hardTree->branchings().begin();
cit!=hardTree->branchings().end();++cit) {
particles.push_back((*cit)->branchingParticle());
}
showerModel()->partnerFinder()->
setInitialEvolutionScales(particles,!hard,hardTree->interaction(),
!hardTree->partnersSet());
hardTree->partnersSet(true);
// inverse reconstruction
if(hard)
showerModel()->kinematicsReconstructor()->
deconstructHardJets(hardTree,ShowerHandler::currentHandler()->evolver(),
hardTree->interaction());
else
showerModel()->kinematicsReconstructor()->
deconstructDecayJets(hardTree,ShowerHandler::currentHandler()->evolver(),
hardTree->interaction());
// now reset the momenta of the showering particles
vector<ShowerProgenitorPtr> particlesToShower;
for(map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator
cit=showerTree->incomingLines().begin();
cit!=showerTree->incomingLines().end();++cit )
particlesToShower.push_back(cit->first);
// extract the showering particles
for(map<ShowerProgenitorPtr,tShowerParticlePtr>::const_iterator
cit=showerTree->outgoingLines().begin();
cit!=showerTree->outgoingLines().end();++cit )
particlesToShower.push_back(cit->first);
// match them
vector<bool> matched(particlesToShower.size(),false);
for(set<HardBranchingPtr>::const_iterator cit=hardTree->branchings().begin();
cit!=hardTree->branchings().end();++cit) {
Energy2 dmin( 1e30*GeV2 );
int iloc(-1);
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if(matched[ix]) continue;
if( (**cit).branchingParticle()->id() != particlesToShower[ix]->progenitor()->id() ) continue;
if( (**cit).branchingParticle()->isFinalState() !=
particlesToShower[ix]->progenitor()->isFinalState() ) continue;
Energy2 dtest =
sqr( particlesToShower[ix]->progenitor()->momentum().x() - (**cit).showerMomentum().x() ) +
sqr( particlesToShower[ix]->progenitor()->momentum().y() - (**cit).showerMomentum().y() ) +
sqr( particlesToShower[ix]->progenitor()->momentum().z() - (**cit).showerMomentum().z() ) +
sqr( particlesToShower[ix]->progenitor()->momentum().t() - (**cit).showerMomentum().t() );
// add mass difference for identical particles (e.g. Z0 Z0 production)
dtest += 1e10*sqr(particlesToShower[ix]->progenitor()->momentum().m()-
(**cit).showerMomentum().m());
if( dtest < dmin ) {
iloc = ix;
dmin = dtest;
}
}
if(iloc<0) throw Exception() << "Failed to match shower and hard trees in Evolver::hardestEmission"
<< Exception::eventerror;
particlesToShower[iloc]->progenitor()->set5Momentum((**cit).showerMomentum());
matched[iloc] = true;
}
// correction boosts for daughter trees
for(map<tShowerTreePtr,pair<tShowerProgenitorPtr,tShowerParticlePtr> >::const_iterator
tit = showerTree->treelinks().begin();
tit != showerTree->treelinks().end();++tit) {
ShowerTreePtr decayTree = tit->first;
map<ShowerProgenitorPtr,ShowerParticlePtr>::const_iterator
cit = decayTree->incomingLines().begin();
// reset the momentum of the decay particle
Lorentz5Momentum oldMomentum = cit->first->progenitor()->momentum();
Lorentz5Momentum newMomentum = tit->second.second->momentum();
LorentzRotation boost( oldMomentum.findBoostToCM(),oldMomentum.e()/oldMomentum.mass());
boost.boost (-newMomentum.findBoostToCM(),newMomentum.e()/newMomentum.mass());
decayTree->transform(boost,true);
}
}
-void Evolver::doShowering(bool hard) {
+void Evolver::doShowering(bool hard,XCPtr xcomb) {
// order of the interactions
bool showerOrder(true);
// zero number of emissions
_nis = _nfs = 0;
// extract particles to shower
vector<ShowerProgenitorPtr> particlesToShower(setupShower(hard));
// setup the maximum scales for the shower
- setupMaximumScales(particlesToShower);
+ if (hardVetoOn()) setupMaximumScales(particlesToShower,xcomb);
// specifc stuff for hard processes and decays
Energy minmass(ZERO), mIn(ZERO);
// hard process generate the intrinsic p_T once and for all
if(hard) {
generateIntrinsicpT(particlesToShower);
}
// decay compute the minimum mass of the final-state
else {
for(unsigned int ix=0;ix<particlesToShower.size();++ix) {
if(particlesToShower[ix]->progenitor()->isFinalState()) {
if(particlesToShower[ix]->progenitor()->dataPtr()->stable())
minmass += particlesToShower[ix]->progenitor()->dataPtr()->constituentMass();
else
minmass += particlesToShower[ix]->progenitor()->mass();
}
else {
mIn = particlesToShower[ix]->progenitor()->mass();
}
}
// throw exception if decay can't happen
if ( minmass > mIn ) {
throw Exception() << "Evolver.cc: Mass of decaying particle is "
<< "below constituent masses of decay products."
<< Exception::eventerror;
}
}
// check if interactions in right order
if(hardTree() && interaction_!=4 &&
hardTree()->interaction()!=interactions_[0]) {
assert(interactions_.size()==2);
showerOrder = false;
swap(interactions_[0],interactions_[1]);
}
// loop over possible interactions
for(unsigned int inter=0;inter<interactions_.size();++inter) {
// set up for second pass if required
if(inter!=0) {
// zero intrinsic pt so only added first time round
intrinsicpT().clear();
// construct the tree and throw veto if not possible
if(!(hard ?
constructHardTree (particlesToShower,interactions_[inter]) :
constructDecayTree(particlesToShower,interactions_[inter])))
throw InteractionVeto();
}
// main shower loop
unsigned int ntry(0);
bool reconstructed = false;
do {
// clear results of last attempt if needed
if(ntry!=0) {
currentTree()->clear();
setEvolutionPartners(hard,interactions_[inter],false);
_nis = _nfs = 0;
}
// generate the shower
// pick random starting point
unsigned int istart=UseRandom::irnd(particlesToShower.size());
unsigned int istop = particlesToShower.size();
// loop over particles with random starting point
for(unsigned int ix=istart;ix<=istop;++ix) {
if(ix==particlesToShower.size()) {
if(istart!=0) {
istop = istart-1;
ix=0;
}
else break;
}
// extract the progenitor
progenitor(particlesToShower[ix]);
// final-state radiation
if(progenitor()->progenitor()->isFinalState()) {
if(!isFSRadiationON()) continue;
// perform shower
progenitor()->hasEmitted(startTimeLikeShower(interactions_[inter]));
}
// initial-state radiation
else {
if(!isISRadiationON()) continue;
// hard process
if(hard) {
// get the PDF
setBeamParticle(_progenitor->beam());
assert(beamParticle());
// perform the shower
// set the beam particle
tPPtr beamparticle=progenitor()->original();
if(!beamparticle->parents().empty())
beamparticle=beamparticle->parents()[0];
// generate the shower
progenitor()->hasEmitted(startSpaceLikeShower(beamparticle,
interactions_[inter]));
}
// decay
else {
// skip colour and electrically neutral particles
if(!progenitor()->progenitor()->dataPtr()->coloured() &&
!progenitor()->progenitor()->dataPtr()->charged()) {
progenitor()->hasEmitted(false);
continue;
}
// perform shower
// set the scales correctly. The current scale is the maximum scale for
// emission not the starting scale
ShowerParticle::EvolutionScales maxScales(progenitor()->progenitor()->scales());
progenitor()->progenitor()->scales() = ShowerParticle::EvolutionScales();
if(progenitor()->progenitor()->dataPtr()->charged()) {
progenitor()->progenitor()->scales().QED = progenitor()->progenitor()->mass();
progenitor()->progenitor()->scales().QED_noAO = progenitor()->progenitor()->mass();
}
if(progenitor()->progenitor()->hasColour()) {
progenitor()->progenitor()->scales().QCD_c = progenitor()->progenitor()->mass();
progenitor()->progenitor()->scales().QCD_c_noAO = progenitor()->progenitor()->mass();
}
if(progenitor()->progenitor()->hasAntiColour()) {
progenitor()->progenitor()->scales().QCD_ac = progenitor()->progenitor()->mass();
progenitor()->progenitor()->scales().QCD_ac_noAO = progenitor()->progenitor()->mass();
}
// perform the shower
progenitor()->hasEmitted(startSpaceLikeDecayShower(maxScales,minmass,
interactions_[inter]));
}
}
}
// do the kinematic reconstruction, checking if it worked
reconstructed = hard ?
showerModel()->kinematicsReconstructor()->
reconstructHardJets (currentTree(),intrinsicpT(),interactions_[inter]) :
showerModel()->kinematicsReconstructor()->
reconstructDecayJets(currentTree(),interactions_[inter]);
}
while(!reconstructed&&maximumTries()>++ntry);
// check if failed to generate the shower
if(ntry==maximumTries()) {
if(hard)
throw ShowerHandler::ShowerTriesVeto(ntry);
else
throw Exception() << "Failed to generate the shower after "
<< ntry << " attempts in Evolver::showerDecay()"
<< Exception::eventerror;
}
}
// tree has now showered
_currenttree->hasShowered(true);
if(!showerOrder) swap(interactions_[0],interactions_[1]);
hardTree(HardTreePtr());
}
diff --git a/Shower/Base/Evolver.h b/Shower/Base/Evolver.h
--- a/Shower/Base/Evolver.h
+++ b/Shower/Base/Evolver.h
@@ -1,729 +1,729 @@
// -*- C++ -*-
//
// Evolver.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2011 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_Evolver_H
#define HERWIG_Evolver_H
//
// This is the declaration of the Evolver class.
//
#include "ThePEG/Interface/Interfaced.h"
#include "Herwig++/Shower/SplittingFunctions/SplittingGenerator.h"
#include "ShowerModel.h"
#include "ThePEG/PDF/BeamParticleData.h"
#include "ShowerTree.h"
#include "ShowerProgenitor.fh"
#include "Herwig++/Shower/ShowerHandler.fh"
#include "Branching.h"
#include "ShowerVeto.h"
#include "HardTree.h"
#include "ThePEG/Handlers/XComb.h"
#include "Evolver.fh"
#include "Herwig++/MatrixElement/HwMEBase.h"
#include "Herwig++/Decay/HwDecayerBase.h"
namespace Herwig {
using namespace ThePEG;
/**\ingroup Shower
* Exception class
* used to communicate failure of QED shower
*/
struct InteractionVeto {};
/** \ingroup Shower
* The Evolver class class performs the sohwer evolution of hard scattering
* and decay processes in Herwig++.
*
* @see \ref EvolverInterfaces "The interfaces"
* defined for Evolver.
*/
class Evolver: public Interfaced {
/**
* The ShowerHandler is a friend to set some parameters at initialisation
*/
friend class ShowerHandler;
public:
/**
* Pointer to an XComb object
*/
typedef Ptr<XComb>::pointer XCPtr;
public:
/**
* Default Constructor
*/
Evolver() : _maxtry(100), _meCorrMode(1), _hardVetoMode(1),
_hardVetoRead(0), _reconOpt(0), _hardVetoReadOption(false),
_iptrms(ZERO), _beta(0.), _gamma(ZERO), _iptmax(),
_limitEmissions(0), _initialenhance(1.), _finalenhance(1.),
interaction_(1), _trunc_Mode(true), _hardEmissionMode(0),
_colourEvolutionMethod(0)
{}
/**
* Members to perform the shower
*/
//@{
/**
* Perform the shower of the hard process
*/
virtual void showerHardProcess(ShowerTreePtr,XCPtr);
/**
* Perform the shower of a decay
*/
virtual void showerDecay(ShowerTreePtr);
//@}
/**
* Access to the flags and shower variables
*/
//@{
/**
* Is there any showering switched on
*/
bool showeringON() const { return isISRadiationON() || isFSRadiationON(); }
/**
* It returns true/false if the initial-state radiation is on/off.
*/
bool isISRadiationON() const { return _splittingGenerator->isISRadiationON(); }
/**
* It returns true/false if the final-state radiation is on/off.
*/
bool isFSRadiationON() const { return _splittingGenerator->isFSRadiationON(); }
/**
* Get the ShowerModel
*/
ShowerModelPtr showerModel() const {return _model;}
/**
* Get the SplittingGenerator
*/
tSplittingGeneratorPtr splittingGenerator() const { return _splittingGenerator; }
//@}
/**
* Connect the Hard and Shower trees
*/
virtual void connectTrees(ShowerTreePtr showerTree, HardTreePtr hardTree, bool hard );
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:
/**
* Perform the shower
*/
- void doShowering(bool hard);
+ void doShowering(bool hard,XCPtr);
/**
* Generate the hard matrix element correction
*/
virtual void hardMatrixElementCorrection(bool);
/**
* Generate the hardest emission
*/
virtual void hardestEmission(bool hard);
/**
* Extract the particles to be showered, set the evolution scales
* and apply the hard matrix element correction
* @param hard Whether this is a hard process or decay
* @return The particles to be showered
*/
virtual vector<ShowerProgenitorPtr> setupShower(bool hard);
/**
* set the colour partners
*/
virtual void setEvolutionPartners(bool hard,ShowerInteraction::Type,
bool clear);
/**
* Methods to perform the evolution of an individual particle, including
* recursive calling on the products
*/
//@{
/**
* It does the forward evolution of the time-like input particle
* (and recursively for all its radiation products).
* accepting only emissions which conforms to the showerVariables
* and soft matrix element correction.
* If at least one emission has occurred then the method returns true.
* @param particle The particle to be showered
*/
virtual bool timeLikeShower(tShowerParticlePtr particle, ShowerInteraction::Type,
bool first);
/**
* It does the backward evolution of the space-like input particle
* (and recursively for all its time-like radiation products).
* accepting only emissions which conforms to the showerVariables.
* If at least one emission has occurred then the method returns true
* @param particle The particle to be showered
* @param beam The beam particle
*/
virtual bool spaceLikeShower(tShowerParticlePtr particle,PPtr beam,
ShowerInteraction::Type);
/**
* If does the forward evolution of the input on-shell particle
* involved in a decay
* (and recursively for all its time-like radiation products).
* accepting only emissions which conforms to the showerVariables.
* @param particle The particle to be showered
* @param maxscale The maximum scale for the shower.
* @param minimumMass The minimum mass of the final-state system
*/
virtual bool
spaceLikeDecayShower(tShowerParticlePtr particle,
const ShowerParticle::EvolutionScales & maxScales,
Energy minimumMass,ShowerInteraction::Type);
/**
* Truncated shower from a time-like particle
*/
virtual bool truncatedTimeLikeShower(tShowerParticlePtr particle,
HardBranchingPtr branch,
ShowerInteraction::Type type);
/**
* Truncated shower from a space-like particle
*/
virtual bool truncatedSpaceLikeShower(tShowerParticlePtr particle,PPtr beam,
HardBranchingPtr branch,
ShowerInteraction::Type type);
/**
* Truncated shower from a time-like particle
*/
virtual bool truncatedSpaceLikeDecayShower(tShowerParticlePtr particle,
const ShowerParticle::EvolutionScales & maxScales,
Energy minimumMass, HardBranchingPtr branch,
ShowerInteraction::Type type);
//@}
/**
* Switches for matrix element corrections
*/
//@{
/**
* Any ME correction?
*/
bool MECOn() const {
return _meCorrMode > 0 && _hardEmissionMode==0;
}
/**
* Any hard ME correction?
*/
bool hardMEC() const {
return (_meCorrMode == 1 || _meCorrMode == 2) && _hardEmissionMode==0;
}
/**
* Any soft ME correction?
*/
bool softMEC() const {
return (_meCorrMode == 1 || _meCorrMode > 2) && _hardEmissionMode==0;
}
//@}
/**
* Is the truncated shower on?
*/
bool isTruncatedShowerON() const {return _trunc_Mode;}
/**
* Switch for intrinsic pT
*/
//@{
/**
* Any intrinsic pT?
*/
bool ipTon() const {
return _iptrms != ZERO || ( _beta == 1.0 && _gamma != ZERO && _iptmax !=ZERO );
}
//@}
/**@name Additional shower vetoes */
//@{
/**
* Insert a veto.
*/
void addVeto (ShowerVetoPtr v) { _vetoes.push_back(v); }
/**
* Remove a veto.
*/
void removeVeto (ShowerVetoPtr v) {
vector<ShowerVetoPtr>::iterator vit = find(_vetoes.begin(),_vetoes.end(),v);
if (vit != _vetoes.end())
_vetoes.erase(vit);
}
//@}
/**
* Switches for vetoing hard emissions
*/
//@{
/**
* Vetos on?
*/
bool hardVetoOn() const { return _hardVetoMode > 0; }
/**
* veto hard emissions in IS shower?
*/
bool hardVetoIS() const { return _hardVetoMode == 1 || _hardVetoMode == 2; }
/**
* veto hard emissions in FS shower?
*/
bool hardVetoFS() const { return _hardVetoMode == 1 || _hardVetoMode > 2; }
/**
* veto hard emissions according to lastScale from XComb?
*/
bool hardVetoXComb() const {return (_hardVetoRead == 1);}
/**
* Returns true if the hard veto read-in is to be applied to only
* the primary collision and false otherwise.
*/
bool hardVetoReadOption() const {return _hardVetoReadOption;}
//@}
/**
* Enhancement factors for radiation needed to generate the soft matrix
* element correction.
*/
//@{
/**
* Access the enhancement factor for initial-state radiation
*/
double initialStateRadiationEnhancementFactor() const { return _initialenhance; }
/**
* Access the enhancement factor for final-state radiation
*/
double finalStateRadiationEnhancementFactor() const { return _finalenhance; }
/**
* Set the enhancement factor for initial-state radiation
*/
void initialStateRadiationEnhancementFactor(double in) { _initialenhance=in; }
/**
* Set the enhancement factor for final-state radiation
*/
void finalStateRadiationEnhancementFactor(double in) { _finalenhance=in; }
//@}
/**
* Access to set/get the HardTree currently beinging showered
*/
//@{
/**
* The HardTree currently being showered
*/
tHardTreePtr hardTree() {return _hardtree;}
/**
* The HardTree currently being showered
*/
void hardTree(tHardTreePtr in) {_hardtree = in;}
//@}
/**
* Access/set the beam particle for the current initial-state shower
*/
//@{
/**
* Get the beam particle data
*/
Ptr<BeamParticleData>::const_pointer beamParticle() const { return _beam; }
/**
* Set the beam particle data
*/
void setBeamParticle(Ptr<BeamParticleData>::const_pointer in) { _beam=in; }
//@}
/**
* Set/Get the current tree being evolverd for inheriting classes
*/
//@{
/**
* Get the tree
*/
tShowerTreePtr currentTree() { return _currenttree; }
/**
* Set the tree
*/
void currentTree(tShowerTreePtr tree) { _currenttree=tree; }
//@}
/**
* Access the maximum number of attempts to generate the shower
*/
unsigned int maximumTries() const { return _maxtry; }
/**
* Set/Get the ShowerProgenitor for the current shower
*/
//@{
/**
* Access the progenitor
*/
ShowerProgenitorPtr progenitor() { return _progenitor; }
/**
* Set the progenitor
*/
void progenitor(ShowerProgenitorPtr in) { _progenitor=in; }
//@}
/**
* Calculate the intrinsic \f$p_T\f$.
*/
virtual void generateIntrinsicpT(vector<ShowerProgenitorPtr>);
/**
* Access to the intrinsic \f$p_T\f$ for inheriting classes
*/
map<tShowerProgenitorPtr,pair<Energy,double> > & intrinsicpT() { return _intrinsic; }
/**
* find the maximally allowed pt acc to the hard process.
*/
- void setupMaximumScales(vector<ShowerProgenitorPtr> &);
+ void setupMaximumScales(const vector<ShowerProgenitorPtr> &,XCPtr);
protected:
/**
* Start the shower of a timelike particle
*/
virtual bool startTimeLikeShower(ShowerInteraction::Type);
/**
* Update of the time-like stuff
*/
void updateHistory(tShowerParticlePtr particle);
/**
* Start the shower of a spacelike particle
*/
virtual bool startSpaceLikeShower(PPtr,ShowerInteraction::Type);
/**
* Start the shower of a spacelike particle
*/
virtual bool
startSpaceLikeDecayShower(const ShowerParticle::EvolutionScales & maxScales,
Energy minimumMass,ShowerInteraction::Type);
/**
* Vetos for the timelike shower
*/
virtual bool timeLikeVetoed(const Branching &,ShowerParticlePtr);
/**
* Vetos for the spacelike shower
*/
virtual bool spaceLikeVetoed(const Branching &,ShowerParticlePtr);
/**
* Vetos for the spacelike shower
*/
virtual bool spaceLikeDecayVetoed(const Branching &,ShowerParticlePtr);
/**
* Only generate the hard emission, for testing only.
*/
bool hardOnly() const {return _limitEmissions==3;}
/**
* Members to construct the HardTree from the shower if needed
*/
//@{
/**
* Construct the tree for a scattering process
*/
bool constructHardTree(vector<ShowerProgenitorPtr> & particlesToShower,
ShowerInteraction::Type inter);
/**
* Construct the tree for a decay process
*/
bool constructDecayTree(vector<ShowerProgenitorPtr> & particlesToShower,
ShowerInteraction::Type inter);
/**
* Construct a time-like line
*/
void constructTimeLikeLine(tHardBranchingPtr branch,tShowerParticlePtr particle);
/**
* Construct a space-like line
*/
void constructSpaceLikeLine(tShowerParticlePtr particle,
HardBranchingPtr & first, HardBranchingPtr & last,
SudakovPtr sud,PPtr beam);
//@}
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;
//@}
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();
//@}
private:
/**
* Get the octet -> octet octet reduction factor.
*/
double getReductionFactor(tShowerParticlePtr particle);
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
Evolver & operator=(const Evolver &);
private:
/**
* Pointer to the model for the shower evolution model
*/
ShowerModelPtr _model;
/**
* Pointer to the splitting generator
*/
SplittingGeneratorPtr _splittingGenerator;
/**
* Maximum number of tries to generate the shower of a particular tree
*/
unsigned int _maxtry;
/**
* Matrix element correction switch
*/
unsigned int _meCorrMode;
/**
* Hard emission veto switch
*/
unsigned int _hardVetoMode;
/**
* Hard veto to be read switch
*/
unsigned int _hardVetoRead;
/**
* Control of the reconstruction option
*/
unsigned int _reconOpt;
/**
* If hard veto pT scale is being read-in this determines
* whether the read-in value is applied to primary and
* secondary (MPI) scatters or just the primary one, with
* the usual computation of the veto being performed for
* the secondary (MPI) scatters.
*/
bool _hardVetoReadOption;
/**
* rms intrinsic pT of Gaussian distribution
*/
Energy _iptrms;
/**
* Proportion of inverse quadratic intrinsic pT distribution
*/
double _beta;
/**
* Parameter for inverse quadratic: 2*Beta*Gamma/(sqr(Gamma)+sqr(intrinsicpT))
*/
Energy _gamma;
/**
* Upper bound on intrinsic pT for inverse quadratic
*/
Energy _iptmax;
/**
* Limit the number of emissions for testing
*/
unsigned int _limitEmissions;
/**
* The progenitor of the current shower
*/
ShowerProgenitorPtr _progenitor;
/**
* Matrix element
*/
HwMEBasePtr _hardme;
/**
* Decayer
*/
HwDecayerBasePtr _decayme;
/**
* The ShowerTree currently being showered
*/
ShowerTreePtr _currenttree;
/**
* The HardTree currently being showered
*/
HardTreePtr _hardtree;
/**
* Radiation enhancement factors for use with the veto algorithm
* if needed by the soft matrix element correction
*/
//@{
/**
* Enhancement factor for initial-state radiation
*/
double _initialenhance;
/**
* Enhancement factor for final-state radiation
*/
double _finalenhance;
//@}
/**
* The beam particle data for the current initial-state shower
*/
Ptr<BeamParticleData>::const_pointer _beam;
/**
* Storage of the intrinsic \f$p_t\f$ of the particles
*/
map<tShowerProgenitorPtr,pair<Energy,double> > _intrinsic;
/**
* Vetoes
*/
vector<ShowerVetoPtr> _vetoes;
/**
* number of IS emissions
*/
unsigned int _nis;
/**
* Number of FS emissions
*/
unsigned int _nfs;
/**
* The option for wqhich interactions to use
*/
unsigned int interaction_;
/**
* Interactions allowed in the shower
*/
vector<ShowerInteraction::Type> interactions_;
/**
* Truncated shower switch
*/
bool _trunc_Mode;
/**
* Count of the number of truncated emissions
*/
unsigned int _truncEmissions;
/**
* Mode for the hard emissions
*/
unsigned int _hardEmissionMode;
/**
* Colour evolution method
*/
int _colourEvolutionMethod;
};
}
#endif /* HERWIG_Evolver_H */
diff --git a/Shower/Makefile.am b/Shower/Makefile.am
--- a/Shower/Makefile.am
+++ b/Shower/Makefile.am
@@ -1,32 +1,32 @@
SUBDIRS = SplittingFunctions Default Base .
pkglib_LTLIBRARIES = HwShower.la
-HwShower_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 15:1:0
+HwShower_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 16:0:0
HwShower_la_LIBADD = Default/libHwDefaultShower.la \
$(top_builddir)/Shower/SplittingFunctions/libHwSplitting.la \
$(top_builddir)/Shower/Base/libHwShowerBase.la \
$(top_builddir)/PDF/libHwRemDecayer.la \
$(top_builddir)/PDF/libHwMPIPDF.la
HwShower_la_SOURCES = \
UEBase.h UEBase.cc UEBase.fh \
Couplings/ShowerAlphaQCD.h Couplings/ShowerAlphaQCD.cc \
Couplings/ShowerAlphaQED.h Couplings/ShowerAlphaQED.cc\
ShowerHandler.h ShowerHandler.fh ShowerHandler.cc
noinst_LTLIBRARIES = libHwShower.la
libHwShower_la_SOURCES = ShowerConfig.h \
Base/Branching.h \
Base/ShowerParticle.cc Base/ShowerParticle.fh Base/ShowerParticle.h \
Base/ShowerKinematics.fh Base/ShowerKinematics.h Base/ShowerKinematics.cc \
Base/ShowerTree.h Base/ShowerTree.fh Base/ShowerTree.cc \
Base/ShowerProgenitor.fh Base/ShowerProgenitor.h \
Base/HardTree.h Base/HardTree.fh Base/HardTree.cc\
Base/SudakovFormFactor.cc Base/SudakovFormFactor.h Base/SudakovFormFactor.fh \
Base/HardBranching.h Base/HardBranching.fh Base/HardBranching.cc\
Couplings/ShowerAlpha.h Couplings/ShowerAlpha.cc Couplings/ShowerAlpha.fh\
SplittingFunctions/SplittingGenerator.cc SplittingFunctions/SplittingGenerator.h\
SplittingFunctions/SplittingGenerator.fh \
SplittingFunctions/SplittingFunction.h SplittingFunctions/SplittingFunction.fh \
SplittingFunctions/SplittingFunction.cc
diff --git a/Tests/Makefile.am b/Tests/Makefile.am
--- a/Tests/Makefile.am
+++ b/Tests/Makefile.am
@@ -1,318 +1,323 @@
AUTOMAKE_OPTIONS = -Wno-portability
AM_LDFLAGS += -module -avoid-version -rpath /dummy/path/not/used
EXTRA_DIST = Inputs python Rivet
dist-hook:
rm -rf $(distdir)/Inputs/.svn
rm -rf $(distdir)/python/.svn
rm -rf $(distdir)/Rivet/.svn
EXTRA_LTLIBRARIES = LeptonTest.la GammaTest.la HadronTest.la DISTest.la
if WANT_LIBFASTJET
EXTRA_LTLIBRARIES += HadronJetTest.la LeptonJetTest.la
HadronJetTest_la_SOURCES = \
Hadron/VHTest.h Hadron/VHTest.cc\
Hadron/VTest.h Hadron/VTest.cc\
Hadron/HTest.h Hadron/HTest.cc
HadronJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
-I$(FASTJETPATH)
HadronJetTest_la_LIBADD = $(FASTJETLIBS)
LeptonJetTest_la_SOURCES = \
Lepton/TopDecay.h Lepton/TopDecay.cc
LeptonJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
-I$(FASTJETPATH)
LeptonJetTest_la_LIBADD = $(FASTJETLIBS)
endif
LeptonTest_la_SOURCES = \
Lepton/VVTest.h Lepton/VVTest.cc \
Lepton/VBFTest.h Lepton/VBFTest.cc \
Lepton/VHTest.h Lepton/VHTest.cc \
Lepton/FermionTest.h Lepton/FermionTest.cc
GammaTest_la_SOURCES = \
Gamma/GammaMETest.h Gamma/GammaMETest.cc \
Gamma/GammaPMETest.h Gamma/GammaPMETest.cc
DISTest_la_SOURCES = \
DIS/DISTest.h DIS/DISTest.cc
HadronTest_la_SOURCES = \
Hadron/HadronVVTest.h Hadron/HadronVVTest.cc\
Hadron/HadronVBFTest.h Hadron/HadronVBFTest.cc\
Hadron/WHTest.h Hadron/WHTest.cc\
Hadron/ZHTest.h Hadron/ZHTest.cc\
Hadron/VGammaTest.h Hadron/VGammaTest.cc\
Hadron/ZJetTest.h Hadron/ZJetTest.cc\
Hadron/WJetTest.h Hadron/WJetTest.cc\
Hadron/QQHTest.h Hadron/QQHTest.cc
REPO = $(top_builddir)/src/HerwigDefaults.rpo
HERWIG = $(top_builddir)/src/Herwig++
HWREAD = $(HERWIG) read --repo $(REPO) -L $(builddir)/.libs
HWRUN = $(HERWIG) run
tests : tests-LEP tests-DIS tests-LHC tests-Gamma
if WANT_LIBFASTJET
tests-LEP : test-LEP-VV test-LEP-VH test-LEP-VBF test-LEP-BB test-LEP-Quarks test-LEP-Leptons \
test-LEP-default test-LEP-Powheg test-LEP-TopDecay
else
tests-LEP : test-LEP-VV test-LEP-VH test-LEP-VBF test-LEP-BB test-LEP-Quarks test-LEP-Leptons
endif
tests-DIS : test-DIS-Charged test-DIS-Neutral
if WANT_LIBFASTJET
tests-LHC : test-LHC-WW test-LHC-WZ test-LHC-ZZ test-LHC-ZGamma test-LHC-WGamma \
test-LHC-ZH test-LHC-WH test-LHC-ZJet test-LHC-WJet test-LHC-Z test-LHC-W test-LHC-ZZVBF test-LHC-VBF \
test-LHC-WWVBF test-LHC-bbH test-LHC-ttH test-LHC-GammaGamma test-LHC-GammaJet test-LHC-Higgs \
test-LHC-HiggsJet test-LHC-QCDFast test-LHC-QCD test-LHC-Top test-LHC-Bottom \
test-LHC-WHJet test-LHC-ZHJet test-LHC-HJet test-LHC-ZShower test-LHC-WShower\
test-LHC-WHJet-Powheg test-LHC-ZHJet-Powheg test-LHC-HJet-Powheg \
test-LHC-ZShower-Powheg test-LHC-WShower-Powheg
else
tests-LHC : test-LHC-WW test-LHC-WZ test-LHC-ZZ test-LHC-ZGamma test-LHC-WGamma \
test-LHC-ZH test-LHC-WH test-LHC-ZJet test-LHC-WJet test-LHC-Z test-LHC-W test-LHC-ZZVBF test-LHC-VBF \
test-LHC-WWVBF test-LHC-bbH test-LHC-ttH test-LHC-GammaGamma test-LHC-GammaJet test-LHC-Higgs \
test-LHC-HiggsJet test-LHC-QCDFast test-LHC-QCD test-LHC-Top
endif
tests-Gamma : test-Gamma-FF test-Gamma-WW test-Gamma-P
if WANT_LIBFASTJET
test-LEP-% : Inputs/LEP-%.in LeptonTest.la LeptonJetTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
else
test-LEP-% : Inputs/LEP-%.in LeptonTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
endif
Rivet-LEP-% : Rivet/LEP-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-BFactory-% : Rivet/BFactory-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-TVT-% : Rivet/TVT-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-DIS-% : Rivet/DIS-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-LHC-% : Rivet/LHC-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-Star-% : Rivet/Star-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-SppS-% : Rivet/SppS-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-ISR-% : Rivet/ISR-%.in
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
Rivet-LEP: Rivet-LEP-22 Rivet-LEP-35 Rivet-LEP-44 Rivet-LEP-91 \
Rivet-LEP-130 Rivet-LEP-133 Rivet-LEP-136 Rivet-LEP-161 \
Rivet-LEP-172 Rivet-LEP-177 Rivet-LEP-183 Rivet-LEP-189 \
Rivet-LEP-192 Rivet-LEP-196 Rivet-LEP-197 Rivet-LEP-200 \
Rivet-LEP-202 Rivet-LEP-206 Rivet-LEP-14 Rivet-LEP-10\
Rivet-LEP-Powheg-14 Rivet-LEP-Powheg-22 \
Rivet-LEP-Powheg-35 Rivet-LEP-Powheg-44 \
Rivet-LEP-Powheg-91 Rivet-LEP-Powheg-130 \
Rivet-LEP-Powheg-133 Rivet-LEP-Powheg-136 \
Rivet-LEP-Powheg-161 Rivet-LEP-Powheg-172 \
Rivet-LEP-Powheg-177 Rivet-LEP-Powheg-183 \
Rivet-LEP-Powheg-189 Rivet-LEP-Powheg-192 \
Rivet-LEP-Powheg-196 Rivet-LEP-Powheg-197 \
Rivet-LEP-Powheg-200 Rivet-LEP-Powheg-202 \
Rivet-LEP-Powheg-206 Rivet-LEP-Powheg-10
for i in LEP-*.aida; do rivet-rmgaps $$i; done;
rm -rf Rivet-LEP
python/merge-LEP LEP
python/merge-LEP LEP-Powheg
rivet-mkhtml -o Rivet-LEP LEP.aida:Hw++ LEP-Powheg.aida:Hw++-Powheg
Rivet-BFactory: Rivet-BFactory-10.52 Rivet-BFactory-Powheg-10.52 \
Rivet-BFactory-10.52-sym Rivet-BFactory-Powheg-10.52-sym \
Rivet-BFactory-10.54 Rivet-BFactory-Powheg-10.54 \
Rivet-BFactory-10.45 Rivet-BFactory-Powheg-10.45 \
Rivet-BFactory-10.58 Rivet-BFactory-Powheg-10.58 \
Rivet-BFactory-Upsilon Rivet-BFactory-Upsilon2 Rivet-BFactory-Upsilon4 \
Rivet-BFactory-Tau
for i in BFactory-*.aida; do rivet-rmgaps $$i; done;
rm -rf Rivet-BFactory
python/merge-BFactory BFactory
python/merge-BFactory BFactory-Powheg
rivet-mkhtml -o Rivet-BFactory BFactory.aida:Hw++ BFactory-Powheg.aida:Hw++-Powheg
Rivet-DIS: Rivet-DIS-e--LowQ2 \
Rivet-DIS-e+-LowQ2 Rivet-DIS-e+-HighQ2\
Rivet-DIS-Powheg-e--LowQ2 \
Rivet-DIS-Powheg-e+-LowQ2 Rivet-DIS-Powheg-e+-HighQ2\
Rivet-DIS-NoME-e--LowQ2 \
Rivet-DIS-NoME-e+-LowQ2 Rivet-DIS-NoME-e+-HighQ2
rivet-rmgaps DIS-e+-LowQ2.aida
rivet-rmgaps DIS-e--LowQ2.aida
rivet-rmgaps DIS-e+-HighQ2.aida
rivet-rmgaps DIS-Powheg-e+-LowQ2.aida
rivet-rmgaps DIS-Powheg-e--LowQ2.aida
rivet-rmgaps DIS-Powheg-e+-HighQ2.aida
rivet-rmgaps DIS-NoME-e+-LowQ2.aida
rivet-rmgaps DIS-NoME-e--LowQ2.aida
rivet-rmgaps DIS-NoME-e+-HighQ2.aida
python/merge-DIS DIS
python/merge-DIS DIS-Powheg
python/merge-DIS DIS-NoME
rivet-mkhtml -o Rivet-DIS DIS.aida:Hw++ DIS-Powheg.aida:Hw++-Powheg DIS-NoME.aida:Hw++-NoME
Rivet-TVT-WZ: Rivet-TVT-Run-I-Z Rivet-TVT-Powheg-Run-I-Z \
Rivet-TVT-Run-I-W Rivet-TVT-Powheg-Run-I-W \
Rivet-TVT-Run-I-WZ Rivet-TVT-Powheg-Run-I-WZ\
Rivet-TVT-Run-II-Z-e Rivet-TVT-Powheg-Run-II-Z-e \
Rivet-TVT-Run-II-Z-mu Rivet-TVT-Powheg-Run-II-Z-mu \
Rivet-TVT-Run-II-W Rivet-TVT-Powheg-Run-II-W
rivet-rmgaps TVT-Run-II-Z-e.aida;
rivet-rmgaps TVT-Powheg-Run-II-Z-e.aida;
rm -rf Rivet-TVT-WZ
python/merge-TVT-EW TVT-Run-II-W.aida TVT-Run-II-Z-{e,mu}.aida\
TVT-Run-I-{W,Z,WZ}.aida -o TVT-WZ.aida
python/merge-TVT-EW TVT-Powheg-Run-II-W.aida TVT-Powheg-Run-II-Z-{e,mu}.aida\
TVT-Powheg-Run-I-{W,Z,WZ}.aida -o TVT-Powheg-WZ.aida
rivet-mkhtml -o Rivet-TVT-WZ TVT-WZ.aida:Hw++ TVT-Powheg-WZ.aida:Hw++-Powheg
Rivet-TVT-Photon: Rivet-TVT-Run-II-PromptPhoton \
Rivet-TVT-Run-II-DiPhoton-GammaGamma Rivet-TVT-Run-II-DiPhoton-GammaJet \
Rivet-TVT-Powheg-Run-II-DiPhoton-GammaGamma Rivet-TVT-Powheg-Run-II-DiPhoton-GammaJet
# Rivet-TVT-Run-I-PromptPhoton
rm -rf Rivet-TVT-Photon
python/add-aida Rivet-TVT-Run-II-DiPhoton-GammaGamma Rivet-TVT-Run-II-DiPhoton-GammaJet --add -o TVT-Run-II-DiPhoton.aida
python/add-aida Rivet-TVT-Powheg-Run-II-DiPhoton-GammaGamma Rivet-TVT-Powheg-Run-II-DiPhoton-GammaJet --add -o TVT-Powheg-Run-II-DiPhoton.aida
python/merge-aida TVT-Run-II-DiPhoton.aida TVT-Run-II-PromptPhoton.aida\
-o TVT-Photon.aida
rivet-mkhtml -o Rivet-TVT-Photon TVT-Photon.aida:Hw++
rivet-mkhtml -o Rivet-TVT-Photon TVT-Photon.aida:Hw++ TVT-Powheg-Run-II-DiPhoton.aida:Hw++-Powheg
Rivet-TVT-Jets: Rivet-TVT-Run-II-Jets-1 Rivet-TVT-Run-II-Jets-2 \
Rivet-TVT-Run-II-Jets-3 Rivet-TVT-Run-II-Jets-4 \
Rivet-TVT-Run-II-Jets-5 Rivet-TVT-Run-II-Jets-6 \
Rivet-TVT-Run-II-Jets-7 Rivet-TVT-Run-II-Jets-8 \
Rivet-TVT-Run-II-Jets-9 Rivet-TVT-Run-II-Jets-10\
Rivet-TVT-Run-II-Jets-11 Rivet-TVT-Run-II-UE \
Rivet-TVT-Run-I-Jets-1 Rivet-TVT-Run-I-Jets-2 \
Rivet-TVT-Run-I-Jets-3 Rivet-TVT-Run-I-Jets-4 \
Rivet-TVT-Run-I-Jets-5 Rivet-TVT-Run-I-Jets-6 \
Rivet-TVT-Run-I-Jets-7 Rivet-TVT-Run-I-Jets-8\
- Rivet-TVT-Run-I-UE\
- Rivet-TVT-630-UE Rivet-TVT-630-Jets-1 \
- Rivet-TVT-630-Jets-2 Rivet-TVT-630-Jets-3
+ Rivet-TVT-Run-I-UE Rivet-TVT-Run-II-Jets-0\
+ Rivet-TVT-630-UE Rivet-TVT-630-Jets-1 \
+ Rivet-TVT-630-Jets-2 Rivet-TVT-630-Jets-3 \
+ Rivet-TVT-300-UE Rivet-TVT-300-Jets-1 \
+ Rivet-TVT-900-UE Rivet-TVT-900-Jets-1
rivet-rmgaps TVT-Run-I-Jets-4.aida
+ python/merge-TVT-Energy TVT
+ rivet-merge-CDF_2012_NOTE10874 TVT-300-Energy.aida TVT-900-Energy.aida TVT-1960-Energy.aida
+ flat2aida RatioPlots.dat -o TVT-RatioPlots.aida
rm -rf Rivet-TVT-Jets
python/merge-TVT-Jets TVT
rivet-mkhtml -o Rivet-TVT-Jets TVT-Jets.aida:Hw++
Rivet-LHC-Jets: Rivet-LHC-7-Jets-0 Rivet-LHC-7-Jets-1 Rivet-LHC-7-Jets-2 \
Rivet-LHC-7-Jets-3 Rivet-LHC-7-Jets-4 \
Rivet-LHC-7-Jets-5 Rivet-LHC-7-Jets-6 \
Rivet-LHC-7-Jets-7 Rivet-LHC-7-Jets-8 \
Rivet-LHC-7-Jets-9 Rivet-LHC-7-Jets-10 \
Rivet-LHC-7-Jets-11 Rivet-LHC-7-Jets-12 \
Rivet-LHC-7-Jets-13 Rivet-LHC-7-UE \
Rivet-LHC-2360-UE Rivet-LHC-900-UE Rivet-LHC-2760-UE \
Rivet-LHC-7-Heavy-0 \
Rivet-LHC-7-Heavy-1 Rivet-LHC-7-Heavy-2 \
Rivet-LHC-7-Heavy-3 Rivet-LHC-7-Heavy-4 \
Rivet-LHC-7-Heavy-5 Rivet-LHC-7-Top-L \
Rivet-LHC-7-Top-SL \
Rivet-LHC-7-UE-Long Rivet-LHC-900-UE-Long \
Rivet-LHC-7-Jets-All-1 Rivet-LHC-7-Jets-All-2 \
Rivet-LHC-7-Jets-All-3 Rivet-LHC-7-Jets-All-4 \
Rivet-LHC-7-Jets-All-5
rm -rf Rivet-LHC-Jets
python/merge-LHC-Jets
rivet-mkhtml -o Rivet-LHC-Jets LHC-Jets.aida:Hw++
Rivet-Star: Rivet-Star-UE Rivet-Star-Jets-1 \
Rivet-Star-Jets-2 Rivet-Star-Jets-3 \
Rivet-Star-Jets-4
rm -rf Rivet-Star
rivet-rmgaps Star-UE.aida
python/merge-Star Star
rivet-mkhtml -o Rivet-Star Star.aida
Rivet-SppS: Rivet-ISR-44-UE Rivet-ISR-63-UE \
Rivet-SppS-63-UE Rivet-ISR-30-UE \
Rivet-ISR-53-UE Rivet-SppS-200-UE \
Rivet-SppS-500-UE Rivet-SppS-900-UE \
Rivet-SppS-546-UE Rivet-SppS-53-UE
rm -rf Rivet-SppS
python/merge-aida ISR-44-UE.aida ISR-63-UE.aida SppS-63-UE.aida ISR-30-UE.aida \
ISR-53-UE.aida SppS-200-UE.aida SppS-500-UE.aida SppS-900-UE.aida \
SppS-546-UE.aida SppS-53-UE.aida -o SppS.aida
rivet-mkhtml -o Rivet-SppS SppS.aida
Rivet-LHC-EW: Rivet-LHC-W-e Rivet-LHC-Powheg-W-e \
Rivet-LHC-W-mu Rivet-LHC-Powheg-W-mu \
Rivet-LHC-Z-e Rivet-LHC-Powheg-Z-e \
Rivet-LHC-Z-mu Rivet-LHC-Powheg-Z-mu \
Rivet-LHC-WZ Rivet-LHC-Powheg-WZ\
Rivet-LHC-WW Rivet-LHC-Powheg-WW\
Rivet-LHC-ZZ Rivet-LHC-Powheg-ZZ
rm -rf Rivet-LHC-EW;
python/merge-LHC-EW LHC-{W-e,W-mu,Z-e,Z-mu,WW,WZ,ZZ}.aida -o LHC-EW.aida;
python/merge-LHC-EW LHC-Powheg-{W-e,W-mu,Z-e,Z-mu,WW,WZ,ZZ}.aida -o LHC-Powheg-EW.aida;
rivet-mkhtml -o Rivet-LHC-EW LHC-EW.aida:Hw++ LHC-Powheg-EW.aida:Hw++-Powheg;
Rivet-LHC-Photon: Rivet-LHC-7-PromptPhoton \
Rivet-LHC-7-DiPhoton-GammaGamma Rivet-LHC-7-DiPhoton-GammaJet \
Rivet-LHC-Powheg-7-DiPhoton-GammaGamma Rivet-LHC-Powheg-7-DiPhoton-GammaJet
rm -rf Rivet-LHC-Photon
python/add-aida LHC-7-DiPhoton-GammaGamma.aida LHC-7-DiPhoton-GammaJet.aida --add -o LHC-7-DiPhoton.aida
python/add-aida LHC-Powheg-7-DiPhoton-GammaGamma.aida LHC-7-Powheg-DiPhoton-GammaJet.aida --add -o LHC-Powheg-7-DiPhoton.aida
python/merge-aida LHC-7-PromptPhoton.aida LHC-7-DiPhoton.aida -o LHC-Photon.aida
rivet-mkhtml -o Rivet-LHC-Photon LHC-Photon.aida:Hw++ LHC-Powheg-7-DiPhoton.aida:Hw++-Powheg
Rivet-LHC-Higgs: Rivet-LHC-Powheg-ggH Rivet-LHC-ggH Rivet-LHC-ggHJet \
Rivet-LHC-Powheg-VBF Rivet-LHC-VBF Rivet-LHC-WH Rivet-LHC-ZH \
Rivet-LHC-Powheg-WH Rivet-LHC-Powheg-ZH
rm -rf Rivet-LHC-Higgs
rivet-mkhtml -o Rivet-LHC-Higgs LHC-Powheg-ggH.aida:gg-Powheg LHC-ggH.aida:gg LHC-ggHJet.aida:HJet \
LHC-Powheg-VBF.aida:VBF-Powheg LHC-VBF.aida:VBF LHC-WH.aida:WH LHC-ZH.aida:ZH \
LHC-Powheg-WH.aida:WH-Powheg LHC-Powheg-ZH.aida:ZH-Powheg
tests-Rivet : Rivet-LEP Rivet-BFactory Rivet-DIS Rivet-TVT-WZ Rivet-TVT-Photon Rivet-TVT-Jets Rivet-LHC-Jets Rivet-Star Rivet-SppS Rivet-LHC-EW Rivet-LHC-Photon
test-Gamma-% : Inputs/Gamma-%.in GammaTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
test-DIS-% : Inputs/DIS-%.in DISTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
if WANT_LIBFASTJET
test-LHC-% : Inputs/LHC-%.in HadronTest.la GammaTest.la HadronJetTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
else
test-LHC-% : Inputs/LHC-%.in HadronTest.la GammaTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<)) -N $${NUMEVENTS:-10000}
endif
clean-local:
rm -f *.out *.log *.tex *.top *.run *.dump *.mult *.Bmult *.aida
diff --git a/Tests/Rivet/BFactory-10.58.in b/Tests/Rivet/BFactory-10.58.in
--- a/Tests/Rivet/BFactory-10.58.in
+++ b/Tests/Rivet/BFactory-10.58.in
@@ -1,40 +1,41 @@
##################################################
# Rivet analyses at the Z pole
##################################################
read LEPBase.in
create ThePEG::LuminosityFunction BFactoryLuminosity
set BFactoryLuminosity:BeamEMaxA 3.5*GeV
set BFactoryLuminosity:BeamEMaxB 8.*GeV
set /Herwig/Cuts/EECuts:MHatMin 10.58299
#set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
#set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
set /Herwig/EventHandlers/LEPHandler:LuminosityFunction BFactoryLuminosity
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/MatrixElements
set /Herwig/MatrixElements/MEee2gZ2qq:MinimumFlavour 1
set /Herwig/MatrixElements/MEee2gZ2qq:MaximumFlavour 4
create Herwig::MEee2VectorMeson MEUpsilon HwMELepton.so
set MEUpsilon:VectorMeson /Herwig/Particles/Upsilon(4S)
set MEUpsilon:Coupling 0.0004151809
insert SimpleEE:MatrixElements 0 MEUpsilon
insert /Herwig/NewPhysics/DecayHandler:Excluded 0 /Herwig/Particles/Upsilon(4S)
cd /Herwig/Generators
##################################################
# select the analyses
##################################################
# BELLE charm hadron production
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 BELLE_2006_S6265367
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 BELLE_2001_S4598261
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 BABAR_2005_S6181155
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 BABAR_2007_S6895344
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 BABAR_2003_I593379
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
saverun BFactory-10.58 LEPGenerator
diff --git a/Tests/Rivet/TVT-630-Jets-1.in b/Tests/Rivet/TVT-300-Jets-1.in
copy from Tests/Rivet/TVT-630-Jets-1.in
copy to Tests/Rivet/TVT-300-Jets-1.in
--- a/Tests/Rivet/TVT-630-Jets-1.in
+++ b/Tests/Rivet/TVT-300-Jets-1.in
@@ -1,34 +1,34 @@
###################################################
# Rivet analyses at the Z pole
##################################################
read TVTBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
-set LHCGenerator:EventHandler:LuminosityFunction:Energy 630.0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 300.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
insert SimpleQCD:MatrixElements[0] MEQCD2to2
set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE 0
-set /Herwig/Cuts/JetKtCut:MinKT 20.
+set /Herwig/Cuts/JetKtCut:MinKT 6.
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
##################################################
# select the analyses
##################################################
# run I CDF UE
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2004_S5839831
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
-saverun TVT-630-Jets-1 LHCGenerator
+saverun TVT-300-Jets-1 LHCGenerator
diff --git a/Tests/Rivet/TVT-630-UE.in b/Tests/Rivet/TVT-300-UE.in
copy from Tests/Rivet/TVT-630-UE.in
copy to Tests/Rivet/TVT-300-UE.in
--- a/Tests/Rivet/TVT-630-UE.in
+++ b/Tests/Rivet/TVT-300-UE.in
@@ -1,42 +1,39 @@
##################################################
# Rivet analyses at the Z pole
##################################################
read TVT-UEBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
-set LHCGenerator:EventHandler:LuminosityFunction:Energy 630.0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 300.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
# min bias
insert SimpleQCD:MatrixElements[0] MEMinBias
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
# min ibas cuts
set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
set /Herwig/Cuts/QCDCuts:MHatMin 0.0*GeV
set /Herwig/Cuts/QCDCuts:X1Min 0.01
set /Herwig/Cuts/QCDCuts:X2Min 0.01
##################################################
# select the analyses
##################################################
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_1988_S1865951
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_1990_S2089246
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2002_S4796047
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2004_S5839831
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
# get the cross section right
create Herwig::MPIXSecReweighter MPIXSecReweighter
insert LHCGenerator:EventHandler:PostSubProcessHandlers 0 MPIXSecReweighter
-saverun TVT-630-UE LHCGenerator
+saverun TVT-300-UE LHCGenerator
diff --git a/Tests/Rivet/TVT-630-Jets-1.in b/Tests/Rivet/TVT-900-Jets-1.in
copy from Tests/Rivet/TVT-630-Jets-1.in
copy to Tests/Rivet/TVT-900-Jets-1.in
--- a/Tests/Rivet/TVT-630-Jets-1.in
+++ b/Tests/Rivet/TVT-900-Jets-1.in
@@ -1,34 +1,34 @@
###################################################
# Rivet analyses at the Z pole
##################################################
read TVTBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
-set LHCGenerator:EventHandler:LuminosityFunction:Energy 630.0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 900.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
insert SimpleQCD:MatrixElements[0] MEQCD2to2
set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE 0
-set /Herwig/Cuts/JetKtCut:MinKT 20.
+set /Herwig/Cuts/JetKtCut:MinKT 10.
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
##################################################
# select the analyses
##################################################
# run I CDF UE
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2004_S5839831
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
-saverun TVT-630-Jets-1 LHCGenerator
+saverun TVT-900-Jets-1 LHCGenerator
diff --git a/Tests/Rivet/TVT-630-UE.in b/Tests/Rivet/TVT-900-UE.in
copy from Tests/Rivet/TVT-630-UE.in
copy to Tests/Rivet/TVT-900-UE.in
--- a/Tests/Rivet/TVT-630-UE.in
+++ b/Tests/Rivet/TVT-900-UE.in
@@ -1,42 +1,39 @@
##################################################
# Rivet analyses at the Z pole
##################################################
read TVT-UEBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
-set LHCGenerator:EventHandler:LuminosityFunction:Energy 630.0
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 900.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
# min bias
insert SimpleQCD:MatrixElements[0] MEMinBias
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
# min ibas cuts
set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
set /Herwig/Cuts/QCDCuts:MHatMin 0.0*GeV
set /Herwig/Cuts/QCDCuts:X1Min 0.01
set /Herwig/Cuts/QCDCuts:X2Min 0.01
##################################################
# select the analyses
##################################################
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_1988_S1865951
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_1990_S2089246
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2002_S4796047
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2004_S5839831
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
# get the cross section right
create Herwig::MPIXSecReweighter MPIXSecReweighter
insert LHCGenerator:EventHandler:PostSubProcessHandlers 0 MPIXSecReweighter
-saverun TVT-630-UE LHCGenerator
+saverun TVT-900-UE LHCGenerator
diff --git a/Tests/Rivet/TVT-Run-II-Jets-0.in b/Tests/Rivet/TVT-Run-II-Jets-0.in
new file mode 100644
--- /dev/null
+++ b/Tests/Rivet/TVT-Run-II-Jets-0.in
@@ -0,0 +1,34 @@
+##################################################
+# Rivet analyses at the Z pole
+##################################################
+read TVTBase.in
+
+##################################################
+# LEP physics parameters (override defaults)
+##################################################
+cd /Herwig/Generators
+set LHCGenerator:EventHandler:LuminosityFunction:Energy 1960.0
+
+##################################################
+# Use the q qbar matrix element
+##################################################
+cd /Herwig/MatrixElements
+insert SimpleQCD:MatrixElements[0] MEQCD2to2
+set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE 0
+set /Herwig/Cuts/JetKtCut:MinKT 15.
+
+# No QED radiation
+erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
+
+##################################################
+# select the analyses
+##################################################
+
+# CDF jet shapes
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
+
+##################################################
+# Save run for later usage with 'Herwig++ run'
+##################################################
+cd /Herwig/Generators
+saverun TVT-Run-II-Jets-0 LHCGenerator
diff --git a/Tests/Rivet/TVT-Run-II-Jets-5.in b/Tests/Rivet/TVT-Run-II-Jets-5.in
--- a/Tests/Rivet/TVT-Run-II-Jets-5.in
+++ b/Tests/Rivet/TVT-Run-II-Jets-5.in
@@ -1,48 +1,50 @@
##################################################
# Rivet analyses at the Z pole
##################################################
read TVTBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
set LHCGenerator:EventHandler:LuminosityFunction:Energy 1960.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
insert SimpleQCD:MatrixElements[0] MEQCD2to2
set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE 0
set /Herwig/Cuts/JetKtCut:MinKT 110.
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
##################################################
# select the analyses
##################################################
# CDF jet shapes
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2005_S6217184
# not ready
# insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2009_S8057893
# CDF inclusive jet kt
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2007_S7057202
# CDF inclusive jet cone
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2006_S6450792
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2008_S7828950
# run II UE analysis
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2008_LEADINGJETS
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2010_S8591881_QCD
# dijet decorrelations
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 D0_2004_S5992206
# inclusive jet cross section
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 D0_2008_S7662670
+# D0 three-jets analysis
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 D0_2011_I895662
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
saverun TVT-Run-II-Jets-5 LHCGenerator
diff --git a/Tests/Rivet/TVT-Run-II-UE.in b/Tests/Rivet/TVT-Run-II-UE.in
--- a/Tests/Rivet/TVT-Run-II-UE.in
+++ b/Tests/Rivet/TVT-Run-II-UE.in
@@ -1,44 +1,45 @@
##################################################
# Rivet analyses at the Z pole
##################################################
read TVT-UEBase.in
##################################################
# LEP physics parameters (override defaults)
##################################################
cd /Herwig/Generators
set LHCGenerator:EventHandler:LuminosityFunction:Energy 1960.0
##################################################
# Use the q qbar matrix element
##################################################
cd /Herwig/MatrixElements
# min bias
insert SimpleQCD:MatrixElements[0] MEMinBias
# No QED radiation
erase /Herwig/EventHandlers/LHCHandler:PostSubProcessHandlers 0
# min ibas cuts
set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
set /Herwig/Cuts/QCDCuts:MHatMin 0.0*GeV
set /Herwig/Cuts/QCDCuts:X1Min 0.01
set /Herwig/Cuts/QCDCuts:X2Min 0.01
##################################################
# select the analyses
##################################################
# run II UE analysis
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2008_LEADINGJETS
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2010_S8591881_QCD
# run II charged multiplicity
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2009_NOTE_9936
insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2009_S8233977
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CDF_2012_NOTE10874
##################################################
# Save run for later usage with 'Herwig++ run'
##################################################
cd /Herwig/Generators
# get the cross section right
create Herwig::MPIXSecReweighter MPIXSecReweighter
insert LHCGenerator:EventHandler:PostSubProcessHandlers 0 MPIXSecReweighter
saverun TVT-Run-II-UE LHCGenerator
diff --git a/Tests/python/merge-TVT-Energy b/Tests/python/merge-TVT-Energy
new file mode 100755
--- /dev/null
+++ b/Tests/python/merge-TVT-Energy
@@ -0,0 +1,189 @@
+#! /usr/bin/env python
+import lighthisto
+import logging
+import sys
+
+if sys.version_info[:3] < (2,4,0):
+ print "rivet scripts require Python version >= 2.4.0... exiting"
+ sys.exit(1)
+
+import os, copy, re
+from math import sqrt
+
+## Try to load faster but non-standard cElementTree module
+try:
+ import xml.etree.cElementTree as ET
+except ImportError:
+ try:
+ import cElementTree as ET
+ except ImportError:
+ try:
+ import xml.etree.ElementTree as ET
+ except:
+ sys.stderr.write("Can't load the ElementTree XML parser: please install it!\n")
+ sys.exit(1)
+
+# #############################################
+
+def fillAbove(desthisto, sourcehistosbyptmin):
+ for i,b in enumerate(desthisto.getBins()):
+ ## Fill bins with pT-ordered histos (so that 'highest always wins')
+ for ptmin, h in sorted(sourcehistosbyptmin.iteritems()):
+ newb = h.getBin(i)
+ if newb.xlow >= ptmin:
+ b.val = newb.val
+ b.errplus = newb.errplus
+ b.errminus = newb.errminus
+ b._focus= newb._focus
+
+def mergeByPt(hpath, sqrts):
+ global inhistos
+ global outhistos
+ try:
+ fillAbove(outhistos[hpath], inhistos[hpath][float(sqrts)])
+ except:
+ pass
+
+def useOnePt(hpath, sqrts, ptmin):
+ global inhistos
+ global outhistos
+ try:
+ ## Find best pT_min match
+ ptmins = inhistos[hpath][float(sqrts)].keys()
+ closest_ptmin = None
+ for ptm in ptmins:
+ if closest_ptmin is None or \
+ abs(ptm-float(ptmin)) < abs(closest_ptmin-float(ptmin)):
+ closest_ptmin = ptm
+ if closest_ptmin != float(ptmin):
+ logging.warning("Inexact match for requested pTmin=%s: " % ptmin + \
+ "using pTmin=%e instead" % closest_ptmin)
+ outhistos[hpath] = inhistos[hpath][float(sqrts)][closest_ptmin]
+ except:
+ pass
+
+# #######################################
+
+if __name__ == "__main__":
+ import logging
+ from optparse import OptionParser, OptionGroup
+ parser = OptionParser(usage="%prog name")
+ verbgroup = OptionGroup(parser, "Verbosity control")
+ verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
+ default=logging.INFO, help="print debug (very verbose) messages")
+ verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
+ default=logging.INFO, help="be very quiet")
+ parser.add_option_group(verbgroup)
+ (opts, args) = parser.parse_args()
+ logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
+
+
+ ## Prefix used in dat file headers
+ headerprefix = "# "
+
+
+ ## Check args
+ if len(args) < 1:
+ logging.error("Must specify at least the name of the files")
+ sys.exit(1)
+
+aidafiles=["-Run-II-UE.aida","-Run-II-Jets-0.aida",
+ "-300-UE.aida" ,"-300-Jets-1.aida" ,
+ "-900-UE.aida" ,"-900-Jets-1.aida" ]
+
+## Get histos
+inhistos = {}
+outhistos={}
+weights = {}
+for f in aidafiles:
+ file=args[0]+f
+ if(file.find("Run-II-UE")>0) :
+ sqrts=1960
+ ptmin=0.
+ elif(file.find("Run-II-Jets-0")>0) :
+ sqrts=1960
+ ptmin=15
+ elif(file.find("300-UE")>0) :
+ sqrts=300
+ ptmin=0.
+ elif(file.find("300-Jets-1")>0) :
+ sqrts=300
+ ptmin=6.
+ elif(file.find("900-UE")>0) :
+ sqrts=900
+ ptmin=0.
+ elif(file.find("900-Jets-1")>0) :
+ sqrts=900
+ ptmin=10.
+ if not os.access(file, os.R_OK):
+ logging.error("%s can not be read" % file)
+ break
+ try:
+ tree = ET.parse(file)
+ except:
+ logging.error("%s can not be parsed as XML" % file)
+ break
+ tree = ET.parse(file)
+ ## Get histos from this AIDA file
+ for dps in tree.findall("dataPointSet"):
+ h = lighthisto.Histo.fromDPS(dps)
+ # di-jet decorrelations
+ # jet shapes
+ if(h.fullPath().find("NOTE10874")<0) : continue
+ if not inhistos.has_key(h.fullPath()):
+ inhistos[h.fullPath()] = {}
+ tmpE = inhistos[h.fullPath()]
+ if not tmpE.has_key(sqrts):
+ tmpE[sqrts] = {}
+ tmpP = tmpE[sqrts]
+ if not tmpP.has_key(ptmin):
+ tmpP[ptmin] = h
+ else:
+ raise Exception("A set with ptmin = %s already exists" % ( ptmin))
+
+## Make empty output histos if needed
+for hpath,hsets in inhistos.iteritems():
+ workhisto = copy.deepcopy(hsets.values()[0].values()[0])
+ outhistos[hpath] = workhisto
+ ## Empty the bin set for histos which we're going to merge
+ for b in outhistos[hpath]:
+ b.val = 0
+ b.errplus = 0
+ b.errminus = 0
+ b._focus= None
+
+## Field analysis
+logging.info("Processing CDF_2012_NOTE10874")
+## Angular distributions in different pT bins
+mergeByPt("/CDF_2012_NOTE10874/d01-x01-y01", "300")
+mergeByPt("/CDF_2012_NOTE10874/d01-x01-y02", "900")
+mergeByPt("/CDF_2012_NOTE10874/d01-x01-y03","1960")
+mergeByPt("/CDF_2012_NOTE10874/d02-x01-y01", "300")
+mergeByPt("/CDF_2012_NOTE10874/d02-x01-y02", "900")
+mergeByPt("/CDF_2012_NOTE10874/d02-x01-y03","1960")
+mergeByPt("/CDF_2012_NOTE10874/d03-x01-y01", "300")
+mergeByPt("/CDF_2012_NOTE10874/d03-x01-y02", "900")
+mergeByPt("/CDF_2012_NOTE10874/d03-x01-y03","1960")
+
+# Choose output file
+for i in range(1,4) :
+ print i
+ if(i==1) :
+ name = args[0]+"-300-Energy.aida"
+ elif(i==2) :
+ name = args[0]+"-900-Energy.aida"
+ elif(i==3) :
+ name = args[0]+"-1960-Energy.aida"
+ out = open(name, "w")
+ ## Write out merged histos
+ out.write('<?xml version="1.0" encoding="ISO-8859-1" ?>\n')
+ out.write('<!DOCTYPE aida SYSTEM "http://aida.freehep.org/schemas/3.3/aida.dtd">\n')
+ out.write('<aida version="3.3">\n')
+ out.write(' <implementation version="1.1" package="FreeHEP"/>\n')
+ for hpath, h in sorted(outhistos.iteritems()):
+ if(hpath.find("d0"+str(i))>0) :
+ logging.debug("hpath = %s" % hpath)
+ out.write(h.asAIDA() + "\n\n")
+ out.write('</aida>\n')
+
+sys.exit(0)
diff --git a/Tests/python/merge-TVT-Jets b/Tests/python/merge-TVT-Jets
--- a/Tests/python/merge-TVT-Jets
+++ b/Tests/python/merge-TVT-Jets
@@ -1,513 +1,515 @@
#! /usr/bin/env python
import lighthisto
import logging
import sys
if sys.version_info[:3] < (2,4,0):
print "rivet scripts require Python version >= 2.4.0... exiting"
sys.exit(1)
import os, copy, re
from math import sqrt
## Try to load faster but non-standard cElementTree module
try:
import xml.etree.cElementTree as ET
except ImportError:
try:
import cElementTree as ET
except ImportError:
try:
import xml.etree.ElementTree as ET
except:
sys.stderr.write("Can't load the ElementTree XML parser: please install it!\n")
sys.exit(1)
# #############################################
def fillAbove(desthisto, sourcehistosbyptmin):
for i,b in enumerate(desthisto.getBins()):
## Fill bins with pT-ordered histos (so that 'highest always wins')
for ptmin, h in sorted(sourcehistosbyptmin.iteritems()):
newb = h.getBin(i)
if newb.xlow >= ptmin:
b.val = newb.val
b.errplus = newb.errplus
b.errminus = newb.errminus
b._focus= newb._focus
def mergeByPt(hpath, sqrts):
global inhistos
global outhistos
try:
fillAbove(outhistos[hpath], inhistos[hpath][float(sqrts)])
except:
pass
def useOnePt(hpath, sqrts, ptmin):
global inhistos
global outhistos
try:
## Find best pT_min match
ptmins = inhistos[hpath][float(sqrts)].keys()
closest_ptmin = None
for ptm in ptmins:
if closest_ptmin is None or \
abs(ptm-float(ptmin)) < abs(closest_ptmin-float(ptmin)):
closest_ptmin = ptm
if closest_ptmin != float(ptmin):
logging.warning("Inexact match for requested pTmin=%s: " % ptmin + \
"using pTmin=%e instead" % closest_ptmin)
outhistos[hpath] = inhistos[hpath][float(sqrts)][closest_ptmin]
except:
pass
# #######################################
if __name__ == "__main__":
import logging
from optparse import OptionParser, OptionGroup
parser = OptionParser(usage="%prog name")
verbgroup = OptionGroup(parser, "Verbosity control")
verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
default=logging.INFO, help="print debug (very verbose) messages")
verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
default=logging.INFO, help="be very quiet")
parser.add_option_group(verbgroup)
(opts, args) = parser.parse_args()
logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
## Prefix used in dat file headers
headerprefix = "# "
## Check args
if len(args) < 1:
logging.error("Must specify at least the name of the files")
sys.exit(1)
aidafiles=["-Run-II-UE.aida" ,"-Run-II-Jets-1.aida","-Run-II-Jets-2.aida",\
"-Run-II-Jets-3.aida","-Run-II-Jets-4.aida","-Run-II-Jets-5.aida",\
"-Run-II-Jets-6.aida","-Run-II-Jets-7.aida",\
"-Run-I-UE.aida" ,"-Run-I-Jets-1.aida","-Run-I-Jets-2.aida",\
"-Run-I-Jets-3.aida","-Run-I-Jets-4.aida","-Run-I-Jets-5.aida",\
"-630-UE.aida" ,"-630-Jets-1.aida" ,"-630-Jets-2.aida" ,\
- "-630-Jets-3.aida"]
+ "-630-Jets-3.aida", "-300-Energy.aida", "-900-Energy.aida", "-1960-Energy.aida",
+ "-RatioPlots.aida"]
## Get histos
inhistos = {}
outhistos={}
weights = {}
for f in aidafiles:
file=args[0]+f
if(file.find("Run-II-UE")>0) :
sqrts=1960
ptmin=0.
elif(file.find("Run-II-Jets-1")>0) :
sqrts=1960
ptmin=36.
elif(file.find("Run-II-Jets-2")>0) :
sqrts=1960
ptmin=55.
elif(file.find("Run-II-Jets-3")>0) :
sqrts=1960
ptmin=75.
elif(file.find("Run-II-Jets-4")>0) :
sqrts=1960
ptmin=100.
elif(file.find("Run-II-Jets-5")>0) :
sqrts=1960
ptmin=125.
elif(file.find("Run-II-Jets-6")>0) :
ptmin=175.
sqrts=1960
elif(file.find("Run-II-Jets-7")>0) :
sqrts=1960
ptmin=265.
elif(file.find("630-UE")>0) :
sqrts=630
ptmin=0.
elif(file.find("630-Jets-1")>0) :
sqrts=630
ptmin=30.
elif(file.find("630-Jets-2")>0) :
sqrts=630
ptmin=55.
elif(file.find("630-Jets-3")>0) :
sqrts=630
ptmin=90.
elif(file.find("Run-I-UE")>0) :
sqrts=1800
ptmin=0.
elif(file.find("Run-I-Jets-1")>0) :
sqrts=1800
ptmin=30.
elif(file.find("Run-I-Jets-2")>0) :
sqrts=1800
ptmin=55.
elif(file.find("Run-I-Jets-3")>0) :
sqrts=1800
ptmin=80.
elif(file.find("Run-I-Jets-4")>0) :
sqrts=1800
ptmin=105.
elif(file.find("Run-I-Jets-5")>0) :
sqrts=1800
ptmin=175.
if not os.access(file, os.R_OK):
logging.error("%s can not be read" % file)
break
try:
tree = ET.parse(file)
except:
logging.error("%s can not be parsed as XML" % file)
break
tree = ET.parse(file)
## Get histos from this AIDA file
for dps in tree.findall("dataPointSet"):
h = lighthisto.Histo.fromDPS(dps)
# di-jet decorrelations
# jet shapes
if(h.fullPath().find("5992206")>0 or h.fullPath().find("6217184")>0 or
h.fullPath().find("LEADINGJETS")>0 or h.fullPath().find("7662670")>0 or
h.fullPath().find("7057202")>0 or h.fullPath().find("6450792")>0 or
h.fullPath().find("7828950")>0 or h.fullPath().find("4751469")>0 or
h.fullPath().find("5839831")>0 or h.fullPath().find("4563131")>0 or
h.fullPath().find("4517016")>0 or h.fullPath().find("3618439")>0 or
h.fullPath().find("8591881")>0) :
if not inhistos.has_key(h.fullPath()):
inhistos[h.fullPath()] = {}
tmpE = inhistos[h.fullPath()]
if not tmpE.has_key(sqrts):
tmpE[sqrts] = {}
tmpP = tmpE[sqrts]
if not tmpP.has_key(ptmin):
tmpP[ptmin] = h
else:
raise Exception("A set with ptmin = %s already exists" % ( ptmin))
elif(h.fullPath().find("8233977")>0 or h.fullPath().find("NOTE_9936")>0 or
h.fullPath().find("3905616")>0 or h.fullPath().find("3324664")>0 or
h.fullPath().find("4796047")>0 or h.fullPath().find("1865951")>0 or
h.fullPath().find("2089246")>0 or h.fullPath().find("3108457")>0 or
h.fullPath().find("3349578")>0 or h.fullPath().find("3541940")>0 or
- h.fullPath().find("3214044")>0 or h.fullPath().find("2952106")>0 ) :
+ h.fullPath().find("3214044")>0 or h.fullPath().find("2952106")>0 or
+ h.fullPath().find("NOTE10874")>0 or h.fullPath().find("895662")>0 ) :
outhistos[h.fullPath()] = h
aidafiles=["-Run-II-Jets-8.aida","-Run-II-Jets-9.aida","-Run-II-Jets-10.aida","-Run-II-Jets-11.aida",\
"-Run-I-Jets-6.aida","-Run-I-Jets-7.aida","-Run-I-Jets-8.aida"]
for f in aidafiles:
file=args[0]+f
if(file.find("Run-II-Jets-8")>0) :
sqrts=1960
ptmin=0.150
elif(file.find("Run-II-Jets-9")>0) :
sqrts=1960
ptmin=0.400
elif(file.find("Run-II-Jets-10")>0) :
sqrts=1960
ptmin=0.600
elif(file.find("Run-II-Jets-11")>0) :
sqrts=1960
ptmin=1.000
elif(file.find("Run-I-Jets-6")>0) :
sqrts=1800
ptmin=0.150
elif(file.find("Run-I-Jets-7")>0) :
sqrts=1800
ptmin=0.5
elif(file.find("Run-I-Jets-8")>0) :
sqrts=1800
ptmin=0.8
if not os.access(file, os.R_OK):
logging.error("%s can not be read" % file)
break
try:
tree = ET.parse(file)
except:
logging.error("%s can not be parsed as XML" % file)
break
tree = ET.parse(file)
## Get histos from this AIDA file
for dps in tree.findall("dataPointSet"):
h = lighthisto.Histo.fromDPS(dps)
if(h.fullPath().find("8566488")>0 or h.fullPath().find("8320160")>0) :
if not inhistos.has_key(h.fullPath()):
inhistos[h.fullPath()] = {}
tmpE = inhistos[h.fullPath()]
if not tmpE.has_key(sqrts):
tmpE[sqrts] = {}
tmpP = tmpE[sqrts]
if not tmpP.has_key(ptmin):
tmpP[ptmin] = h
else:
raise Exception("A set with ptmin = %s already exists" % ( ptmin))
elif(h.fullPath().find("8093652")>0 or h.fullPath().find("3418421")>0 or
h.fullPath().find("4266730")>0) :
if not inhistos.has_key(h.fullPath()):
inhistos[h.fullPath()] = {}
tmpE = inhistos[h.fullPath()]
if not tmpE.has_key(sqrts):
tmpE[sqrts] = {}
tmpP = tmpE[sqrts]
if not tmpP.has_key(1000.*ptmin):
tmpP[1000.*ptmin] = h
else:
raise Exception("A set with ptmin = %s already exists" % ( 1000.*ptmin))
## Make empty output histos if needed
for hpath,hsets in inhistos.iteritems():
if( (hpath.find("6217184")>0 and hpath.find("d13-x01-y01")>0 ) or
hpath.find("LEADINGJETS")>0 or hpath.find("7662670")>0 or
hpath.find("7057202")>0 or hpath.find("6450792")>0 or
hpath.find("7828950")>0 or hpath.find("8566488")>0 or
hpath.find("8320160")>0 or hpath.find("8093652")>0 or
hpath.find("4751469")>0 or hpath.find("5839831")>0 or
hpath.find("4563131")>0 or hpath.find("4517016")>0 or
hpath.find("3618439")>0 or hpath.find("4266730")>0 or
hpath.find("3418421")>0 or hpath.find("8591881")>0) :
workhisto = copy.deepcopy(hsets.values()[0].values()[0])
outhistos[hpath] = workhisto
## Empty the bin set for histos which we're going to merge
for b in outhistos[hpath]:
b.val = 0
b.errplus = 0
b.errminus = 0
b._focus= None
## Field analysis
logging.info("Processing CDF_2001_S4751469")
## Angular distributions in different pT bins
useOnePt("/CDF_2001_S4751469/d01-x01-y01", "1800", "0")
useOnePt("/CDF_2001_S4751469/d01-x01-y02", "1800", "0")
useOnePt("/CDF_2001_S4751469/d01-x01-y03", "1800", "30")
useOnePt("/CDF_2001_S4751469/d02-x01-y01", "1800", "0")
useOnePt("/CDF_2001_S4751469/d02-x01-y02", "1800", "0")
useOnePt("/CDF_2001_S4751469/d02-x01-y03", "1800", "30")
## Number, profile in pT_lead (True?)
useOnePt("/CDF_2001_S4751469/d03-x01-y01", "1800", "0")
useOnePt("/CDF_2001_S4751469/d03-x01-y02", "1800", "0")
useOnePt("/CDF_2001_S4751469/d03-x01-y03", "1800", "0")
#mergeByPt("/CDF_2001_S4751469/d04-x01-y01", "1800")
#mergeByPt("/CDF_2001_S4751469/d04-x01-y02", "1800")
#mergeByPt("/CDF_2001_S4751469/d04-x01-y03", "1800")
useOnePt("/CDF_2001_S4751469/d04-x01-y01", "1800", "30")
useOnePt("/CDF_2001_S4751469/d04-x01-y02", "1800", "30")
useOnePt("/CDF_2001_S4751469/d04-x01-y03", "1800", "30")
## pT sums, profile in pT_lead (True?)
useOnePt("/CDF_2001_S4751469/d05-x01-y01", "1800", "0")
useOnePt("/CDF_2001_S4751469/d05-x01-y02", "1800", "0")
useOnePt("/CDF_2001_S4751469/d05-x01-y03", "1800", "0")
# mergeByPt("/CDF_2001_S4751469/d06-x01-y01", "1800")
# mergeByPt("/CDF_2001_S4751469/d06-x01-y02", "1800")
# mergeByPt("/CDF_2001_S4751469/d06-x01-y03", "1800")
useOnePt("/CDF_2001_S4751469/d06-x01-y01", "1800", "30")
useOnePt("/CDF_2001_S4751469/d06-x01-y02", "1800", "30")
useOnePt("/CDF_2001_S4751469/d06-x01-y03", "1800", "30")
## pT distributions (use a specific pT cut run?)
useOnePt("/CDF_2001_S4751469/d07-x01-y01", "1800", "0")
useOnePt("/CDF_2001_S4751469/d07-x01-y02", "1800", "0")
useOnePt("/CDF_2001_S4751469/d07-x01-y03", "1800", "30")
## Acosta analysis
logging.info("Processing CDF_2004_S5839831")
## Mean pT, profile in ET_lead
mergeByPt("/CDF_2004_S5839831/d01-x01-y01", "1800")
mergeByPt("/CDF_2004_S5839831/d01-x01-y02", "1800")
## pT_max,min, profiles in ET_lead
mergeByPt("/CDF_2004_S5839831/d02-x01-y01", "1800")
mergeByPt("/CDF_2004_S5839831/d02-x01-y02", "1800")
mergeByPt("/CDF_2004_S5839831/d02-x01-y03", "1800")
## pT distributions (want to use a specific pT cut run)
useOnePt("/CDF_2004_S5839831/d03-x01-y01", "1800", "30")
useOnePt("/CDF_2004_S5839831/d03-x01-y02", "1800", "80")
useOnePt("/CDF_2004_S5839831/d03-x01-y03", "1800", "105")
useOnePt("/CDF_2004_S5839831/d03-x01-y04", "1800", "105")
useOnePt("/CDF_2004_S5839831/d03-x01-y05", "1800", "175")
## N_max,min, profiles in ET_lead
mergeByPt("/CDF_2004_S5839831/d04-x01-y01", "1800")
mergeByPt("/CDF_2004_S5839831/d04-x01-y02", "1800")
## Min bias dbs (want to use min bias pT cut)
useOnePt("/CDF_2004_S5839831/d05-x01-y01", "1800", "0")
useOnePt("/CDF_2004_S5839831/d06-x01-y01", "1800", "0")
## Swiss Cheese, profile in ET_lead
mergeByPt("/CDF_2004_S5839831/d07-x01-y01", "1800")
mergeByPt("/CDF_2004_S5839831/d07-x01-y02", "1800")
## pT_max,min, profiles in ET_lead
mergeByPt("/CDF_2004_S5839831/d08-x01-y01", "630")
mergeByPt("/CDF_2004_S5839831/d08-x01-y02", "630")
mergeByPt("/CDF_2004_S5839831/d08-x01-y03", "630")
## Swiss Cheese, profile in ET_lead
mergeByPt("/CDF_2004_S5839831/d09-x01-y01", "630")
mergeByPt("/CDF_2004_S5839831/d09-x01-y02", "630")
## Min bias dbs (want to use min bias pT cut)
useOnePt("/CDF_2004_S5839831/d10-x01-y01", "630", "0")
useOnePt("/CDF_2004_S5839831/d11-x01-y01", "630", "0")
## CDF jet shape analysis
logging.info("Processing CDF_2005_S6217184")
useOnePt("/CDF_2005_S6217184/d01-x01-y01", "1960", "36" )
useOnePt("/CDF_2005_S6217184/d01-x01-y02", "1960", "36" )
useOnePt("/CDF_2005_S6217184/d01-x01-y03", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d02-x01-y01", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d02-x01-y02", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d02-x01-y03", "1960", "75" )
useOnePt("/CDF_2005_S6217184/d03-x01-y01", "1960", "75" )
useOnePt("/CDF_2005_S6217184/d03-x01-y02", "1960", "100")
useOnePt("/CDF_2005_S6217184/d03-x01-y03", "1960", "100")
useOnePt("/CDF_2005_S6217184/d04-x01-y01", "1960", "125")
useOnePt("/CDF_2005_S6217184/d04-x01-y02", "1960", "125")
useOnePt("/CDF_2005_S6217184/d04-x01-y03", "1960", "175")
useOnePt("/CDF_2005_S6217184/d05-x01-y01", "1960", "175")
useOnePt("/CDF_2005_S6217184/d05-x01-y02", "1960", "175")
useOnePt("/CDF_2005_S6217184/d05-x01-y03", "1960", "175")
useOnePt("/CDF_2005_S6217184/d06-x01-y01", "1960", "265")
useOnePt("/CDF_2005_S6217184/d06-x01-y02", "1960", "265")
useOnePt("/CDF_2005_S6217184/d06-x01-y03", "1960", "265")
useOnePt("/CDF_2005_S6217184/d07-x01-y01", "1960", "36" )
useOnePt("/CDF_2005_S6217184/d07-x01-y02", "1960", "36" )
useOnePt("/CDF_2005_S6217184/d07-x01-y03", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d08-x01-y01", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d08-x01-y02", "1960", "55" )
useOnePt("/CDF_2005_S6217184/d08-x01-y03", "1960", "75" )
useOnePt("/CDF_2005_S6217184/d09-x01-y01", "1960", "75" )
useOnePt("/CDF_2005_S6217184/d09-x01-y02", "1960", "100")
useOnePt("/CDF_2005_S6217184/d09-x01-y03", "1960", "100")
useOnePt("/CDF_2005_S6217184/d10-x01-y01", "1960", "125")
useOnePt("/CDF_2005_S6217184/d10-x01-y02", "1960", "125")
useOnePt("/CDF_2005_S6217184/d10-x01-y03", "1960", "175")
useOnePt("/CDF_2005_S6217184/d11-x01-y01", "1960", "175")
useOnePt("/CDF_2005_S6217184/d11-x01-y02", "1960", "175")
useOnePt("/CDF_2005_S6217184/d11-x01-y03", "1960", "175")
useOnePt("/CDF_2005_S6217184/d12-x01-y01", "1960", "265")
useOnePt("/CDF_2005_S6217184/d12-x01-y02", "1960", "265")
useOnePt("/CDF_2005_S6217184/d12-x01-y03", "1960", "265")
mergeByPt("/CDF_2005_S6217184/d13-x01-y01", "1960")
# ## CDF dijet mass spectrum
mergeByPt("/CDF_2008_S8093652/d01-x01-y01", "1960")
## Rick Field Run-II Leading Jets analysis
logging.info("Processing CDF_2008_LEADINGJETS")
## charged particle density
mergeByPt("/CDF_2008_LEADINGJETS/d01-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d02-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d03-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d04-x01-y01", "1960")
## pT sum density
mergeByPt("/CDF_2008_LEADINGJETS/d05-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d06-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d07-x01-y01", "1960")
mergeByPt("/CDF_2008_LEADINGJETS/d08-x01-y01", "1960")
## mean pT
mergeByPt("/CDF_2008_LEADINGJETS/d09-x01-y01", "1960")
## newer version
logging.info("Processing CDF_2010_S8591881_QCD")
mergeByPt("/CDF_2010_S8591881_QCD/d10-x01-y01", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d10-x01-y02", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d10-x01-y03", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d11-x01-y01", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d11-x01-y02", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d11-x01-y03", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d12-x01-y01", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d12-x01-y02", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d12-x01-y03", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d13-x01-y01", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d13-x01-y02", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d13-x01-y03", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d14-x01-y01", "1960")
mergeByPt("/CDF_2010_S8591881_QCD/d15-x01-y01", "1960")
## D0 dijet correlation analysis
logging.info("Processing D0_2004_S5992206")
useOnePt("/D0_2004_S5992206/d01-x02-y01", "1960", "75")
useOnePt("/D0_2004_S5992206/d02-x02-y01", "1960", "100")
useOnePt("/D0_2004_S5992206/d03-x02-y01", "1960", "125")
useOnePt("/D0_2004_S5992206/d04-x02-y01", "1960", "175")
## D0 incl jet cross-section analysis
logging.info("Processing D0_2008_S7662670")
mergeByPt("/D0_2008_S7662670/d01-x01-y01", "1960")
mergeByPt("/D0_2008_S7662670/d02-x01-y01", "1960")
mergeByPt("/D0_2008_S7662670/d03-x01-y01", "1960")
mergeByPt("/D0_2008_S7662670/d04-x01-y01", "1960")
mergeByPt("/D0_2008_S7662670/d05-x01-y01", "1960")
mergeByPt("/D0_2008_S7662670/d06-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d01-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d02-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d03-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d04-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d05-x01-y01", "1960")
mergeByPt("/D0_2010_S8566488/d06-x01-y01", "1960")
# CDF jet cross section
mergeByPt("/CDF_2001_S4563131/d01-x01-y01", "1800")
mergeByPt("/CDF_2001_S4517016/d01-x01-y01", "1800")
mergeByPt("/CDF_2001_S4517016/d02-x01-y01", "1800")
mergeByPt("/CDF_2001_S4517016/d03-x01-y01", "1800")
mergeByPt("/CDF_2001_S4517016/d04-x01-y01", "1800")
useOnePt("/CDF_1998_S3618439/d01-x01-y01", "1800","105")
useOnePt("/CDF_1998_S3618439/d01-x01-y02", "1800","105")
mergeByPt("/CDF_2008_S7828950/d01-x01-y01", "1960")
mergeByPt("/CDF_2008_S7828950/d02-x01-y01", "1960")
mergeByPt("/CDF_2008_S7828950/d03-x01-y01", "1960")
mergeByPt("/CDF_2008_S7828950/d04-x01-y01", "1960")
mergeByPt("/CDF_2008_S7828950/d05-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d01-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d02-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d03-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d04-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d05-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d06-x01-y01", "1960")
mergeByPt("/CDF_2007_S7057202/d07-x01-y01", "1960")
mergeByPt("/CDF_2006_S6450792/d01-x01-y01", "1960")
mergeByPt("/CDF_2000_S4266730/d01-x01-y01", "1800")
useOnePt("/CDF_1996_S3418421/d01-x01-y01","1800","150")
useOnePt("/CDF_1996_S3418421/d01-x01-y02","1800","150")
useOnePt("/CDF_1996_S3418421/d01-x01-y03","1800","150")
useOnePt("/CDF_1996_S3418421/d01-x01-y04","1800","500")
useOnePt("/CDF_1996_S3418421/d01-x01-y05","1800","500")
mergeByPt("/CDF_1996_S3418421/d02-x01-y01","1800")
useOnePt("/D0_2009_S8320160/d01-x01-y01", "1960", "0.15" )
useOnePt("/D0_2009_S8320160/d02-x01-y01", "1960", "0.15" )
useOnePt("/D0_2009_S8320160/d03-x01-y01", "1960", "0.4" )
useOnePt("/D0_2009_S8320160/d04-x01-y01", "1960", "0.4" )
useOnePt("/D0_2009_S8320160/d05-x01-y01", "1960", "0.6" )
useOnePt("/D0_2009_S8320160/d06-x01-y01", "1960", "0.6" )
useOnePt("/D0_2009_S8320160/d07-x01-y01", "1960", "0.6" )
useOnePt("/D0_2009_S8320160/d08-x01-y01", "1960", "0.6" )
useOnePt("/D0_2009_S8320160/d09-x01-y01", "1960", "1.0" )
useOnePt("/D0_2009_S8320160/d10-x01-y01", "1960", "1.0" )
# Choose output file
name = args[0]+"-Jets.aida"
out = open(name, "w")
## Write out merged histos
out.write('<?xml version="1.0" encoding="ISO-8859-1" ?>\n')
out.write('<!DOCTYPE aida SYSTEM "http://aida.freehep.org/schemas/3.3/aida.dtd">\n')
out.write('<aida version="3.3">\n')
out.write(' <implementation version="1.1" package="FreeHEP"/>\n')
for hpath, h in sorted(outhistos.iteritems()):
logging.debug("hpath = %s" % hpath)
out.write(h.asAIDA() + "\n\n")
out.write('</aida>\n')
sys.exit(0)
diff --git a/UnderlyingEvent/Makefile.am b/UnderlyingEvent/Makefile.am
--- a/UnderlyingEvent/Makefile.am
+++ b/UnderlyingEvent/Makefile.am
@@ -1,15 +1,15 @@
pkglib_LTLIBRARIES = HwUA5.la
HwUA5_la_SOURCES = UA5Handler.cc UA5Handler.h UA5Handler.icc
HwUA5_la_LDFLAGS= $(AM_LDFLAGS) -module -version-info 5:1:0
pkglib_LTLIBRARIES += HwMPI.la
HwMPI_la_SOURCES = MPISampler.cc MPISampler.h MPISampler.icc \
MPISampler.fh MPIHandler.cc \
MPIHandler.fh MPIHandler.h \
ProcessHandler.cc ProcessHandler.icc \
ProcessHandler.fh ProcessHandler.h \
MPIXSecReweighter.h MPIXSecReweighter.cc \
stat.h
-HwMPI_la_LDFLAGS= $(AM_LDFLAGS) -module -version-info 10:0:0
+HwMPI_la_LDFLAGS= $(AM_LDFLAGS) -module -version-info 11:0:0
HwMPI_la_LIBADD= $(GSLLIBS)
HwMPI_la_CPPFLAGS= $(AM_CPPFLAGS) $(GSLINCLUDE)
diff --git a/lib/Makefile.am b/lib/Makefile.am
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,32 +1,32 @@
pkglib_LTLIBRARIES = Herwig.la
Herwig_la_SOURCES =
Herwig_la_LIBTOOLFLAGS = --tag=CXX
-Herwig_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 12:0:0
+Herwig_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 13:0:0
Herwig_la_LDFLAGS += $(THEPEGLDFLAGS) $(FCLIBS)
Herwig_la_LIBADD = \
$(top_builddir)/Hadronization/libHwHadronization.la \
$(top_builddir)/Models/StandardModel/libHwStandardModel.la \
$(top_builddir)/Decay/libHwDecay.la \
$(top_builddir)/Decay/FormFactors/libHwFormFactor.la \
$(top_builddir)/Decay/Radiation/libHwDecRad.la \
$(top_builddir)/Utilities/libHwUtils.la \
$(top_builddir)/Models/General/libHwModelGenerator.la \
$(top_builddir)/Decay/General/libHwGeneralDecay.la \
$(top_builddir)/MatrixElement/General/libHwGeneralME.la \
$(top_builddir)/MatrixElement/libHwME.la \
$(top_builddir)/Decay/WeakCurrents/libHwWeakCurrent.la \
$(top_builddir)/Looptools/libHwLooptools.la \
$(top_builddir)/Shower/libHwShower.la \
$(THEPEGLIB) -ldl
all-local: done-all-links
done-all-links: Herwig.la
if test ! -L Herwig++ ; then $(LN_S) -f . Herwig++ ; fi
find $(top_builddir) \( -name '*.so.*' -or -name '*.so' \) \
-not -name 'lib*' -not -path '$(top_builddir)/lib/*' -exec $(LN_S) -f \{\} \;
$(LN_S) -f .libs/Herwig*so* .
echo "stamp" > done-all-links
clean-local:
rm -f *.so *.so.* done-all-links
diff --git a/src/DIS-Matchbox.in b/src/DIS-Matchbox.in
--- a/src/DIS-Matchbox.in
+++ b/src/DIS-Matchbox.in
@@ -1,101 +1,148 @@
read Matchbox.in
################################################################################
# setup the shower
#
# use -LO.in or -NLO.in for LO/NLO simulations, respectively.
#
################################################################################
read DipoleShower.in
# read DipoleShowerParameters-LO.in
read DipoleShowerParameters-NLO.in
################################################################################
# setup matrix element and matching
#
# uncomment the desired calculation
#
################################################################################
cd /Herwig/EventHandlers
set DISHandler:BeamA /Herwig/Particles/e+
set DISLuminosity:BeamEMaxA 27.5.*GeV
set DISHandler:BeamB /Herwig/Particles/p+
set DISLuminosity:BeamEMaxB 820.*GeV
cd /Herwig/MatrixElements/Matchbox
insert /Herwig/Generators/DISGenerator:EventHandler:SubProcessHandlers[0] DISFactory
+
+################################################################################
+# 1+1 jets
+################################################################################
+
+set DISFactory:OrderInAlphaS 0
do DISFactory:Process e+ p e+ j
################################################################################
+# 2+1 jets
+################################################################################
+
+# set DISFactory:OrderInAlphaS 1
+# do DISFactory:Process e+ p e+ j j
+
+# set DISFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/MaxPtScale
+
+# set /Herwig/Cuts/JetFinder:Variant SphericalKt
+# set /Herwig/Cuts/JetFinder:RecombinationScheme E
+# set /Herwig/Cuts/JetFinder:Mode Inclusive
+# set /Herwig/Cuts/JetFinder:ConeRadius 0.7
+
+# insert /Herwig/Cuts/JetCuts:JetRegions 0 /Herwig/Cuts/FirstJet
+# insert /Herwig/Cuts/JetCuts:JetRegions 1 /Herwig/Cuts/SecondJet
+
+# set /Herwig/Cuts/DISCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/DISCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
+# 3+1 jets (leading order only)
+################################################################################
+
+# set DISFactory:OrderInAlphaS 2
+# do DISFactory:Process e+ p e+ j j j
+
+# set DISFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/MaxPtScale
+
+# set /Herwig/Cuts/JetFinder:Variant SphericalKt
+# set /Herwig/Cuts/JetFinder:RecombinationScheme E
+# set /Herwig/Cuts/JetFinder:Mode Inclusive
+# set /Herwig/Cuts/JetFinder:ConeRadius 0.7
+
+# insert /Herwig/Cuts/JetCuts:JetRegions 0 /Herwig/Cuts/FirstJet
+# insert /Herwig/Cuts/JetCuts:JetRegions 1 /Herwig/Cuts/SecondJet
+# insert /Herwig/Cuts/JetCuts:JetRegions 1 /Herwig/Cuts/ThirdJet
+
+# set /Herwig/Cuts/DISCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/DISCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
# leading order
################################################################################
# set DISFactory:VirtualContributions Off
# set DISFactory:RealContributions Off
################################################################################
# MC@NLO-type next-to-leading order
################################################################################
set DISFactory:ShowerApproximation DipoleMatching
################################################################################
# POWHEG-type next-to-leading order
################################################################################
# set DISFactory:ShowerApproximation MEMatching
# insert /Herwig/Generators/LEPGenerator:EventHandler:PostSubProcessHandlers[0] MEMatching
################################################################################
# scale variations
#
# see Matchbox.in for different scale choices
#
################################################################################
################################################################################
# hard process scale variations
################################################################################
-set /Herwig/MatrixElement/Matchbox/DISFactory:RenormalizationScaleFactor 1.0
-set /Herwig/MatrixElement/Matchbox/DISFactory:FactorizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/DISFactory:RenormalizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/DISFactory:FactorizationScaleFactor 1.0
################################################################################
# shower scale variations
################################################################################
set /Herwig/DipoleShower/DipoleShowerHandler:RenormalizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:FactorizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleFactor 1.0
################################################################################
# setup generator and analysis
#
#
#
################################################################################
cd /Herwig/Generators
set DISGenerator:EventHandler:CascadeHandler /Herwig/DipoleShower/DipoleShowerHandler
set DISGenerator:EventHandler:CascadeHandler:MPIHandler NULL
set DISGenerator:NumberOfEvents 100000000
set DISGenerator:RandomNumberGenerator:Seed 31122001
set DISGenerator:DebugLevel 1
set DISGenerator:PrintEvent 10
set DISGenerator:MaxErrors 1000000
cd /Herwig/Generators
#insert DISGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
set /Herwig/Analysis/HepMCFile:PrintEvent 2000000
set /Herwig/Analysis/HepMCFile:Format GenEvent
set /Herwig/Analysis/HepMCFile:Units GeV_mm
set /Herwig/Analysis/HepMCFile:Filename events.fifo
saverun DIS DISGenerator
diff --git a/src/LEP-Matchbox.in b/src/LEP-Matchbox.in
--- a/src/LEP-Matchbox.in
+++ b/src/LEP-Matchbox.in
@@ -1,96 +1,138 @@
read Matchbox.in
################################################################################
# setup the shower
#
# use -LO.in or -NLO.in for LO/NLO simulations, respectively.
#
################################################################################
read DipoleShower.in
# read DipoleShowerParameters-LO.in
read DipoleShowerParameters-NLO.in
################################################################################
# setup matrix element and matching
#
# uncomment the desired calculation
#
################################################################################
cd /Herwig/MatrixElements/Matchbox
insert /Herwig/Generators/LEPGenerator:EventHandler:SubProcessHandlers[0] EEFactory
+
+################################################################################
+# two jets
+################################################################################
+
+set EEFactory:OrderInAlphaS 0
do EEFactory:Process e- e+ j j
################################################################################
+# three jets
+################################################################################
+
+# set EEFactory:OrderInAlphaS 1
+# do EEFactory:Process e- e+ j j j
+
+# set /Herwig/Cuts/JetFinder:Variant SphericalKt
+# set /Herwig/Cuts/JetFinder:RecombinationScheme E
+# set /Herwig/Cuts/JetFinder:Mode Exclusive
+# set /Herwig/Cuts/JetFinder:ConeRadius 6.283185307
+# set /Herwig/Cuts/JetFinder:DCut 50*GeV2
+
+# set /Herwig/Cuts/NJetsCut:NJetsMin 3
+
+# set /Herwig/Cuts/EECuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/EECuts:MultiCuts 0 /Herwig/Cuts/NJetsCut
+
+################################################################################
+# four jets (leading order only)
+################################################################################
+
+# set EEFactory:OrderInAlphaS 2
+# do EEFactory:Process e- e+ j j j
+
+# set /Herwig/Cuts/JetFinder:Variant SphericalKt
+# set /Herwig/Cuts/JetFinder:RecombinationScheme E
+# set /Herwig/Cuts/JetFinder:Mode Exclusive
+# set /Herwig/Cuts/JetFinder:ConeRadius 6.283185307
+# set /Herwig/Cuts/JetFinder:DCut 50*GeV2
+
+# set /Herwig/Cuts/NJetsCut:NJetsMin 4
+
+# set /Herwig/Cuts/EECuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/EECuts:MultiCuts 0 /Herwig/Cuts/NJetsCut
+
+################################################################################
# leading order
################################################################################
# set EEFactory:VirtualContributions Off
# set EEFactory:RealContributions Off
################################################################################
# MC@NLO-type next-to-leading order
################################################################################
set EEFactory:ShowerApproximation DipoleMatching
################################################################################
# POWHEG-type next-to-leading order
################################################################################
# set EEFactory:ShowerApproximation MEMatching
# insert /Herwig/Generators/LEPGenerator:EventHandler:PostSubProcessHandlers[0] MEMatching
################################################################################
# scale variations
#
# see Matchbox.in for different scale choices
#
################################################################################
################################################################################
# hard process scale variations
################################################################################
-set /Herwig/MatrixElement/Matchbox/EEFactory:RenormalizationScaleFactor 1.0
-set /Herwig/MatrixElement/Matchbox/EEFactory:FactorizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/EEFactory:RenormalizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/EEFactory:FactorizationScaleFactor 1.0
################################################################################
# shower scale variations
################################################################################
set /Herwig/DipoleShower/DipoleShowerHandler:RenormalizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:FactorizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleFactor 1.0
################################################################################
# setup generator and analysis
#
#
#
################################################################################
cd /Herwig/Generators
set LEPGenerator:EventHandler:CascadeHandler /Herwig/DipoleShower/DipoleShowerHandler
set LEPGenerator:EventHandler:CascadeHandler:MPIHandler NULL
set LEPGenerator:NumberOfEvents 100000000
set LEPGenerator:RandomNumberGenerator:Seed 31122001
set LEPGenerator:DebugLevel 1
set LEPGenerator:PrintEvent 10
set LEPGenerator:MaxErrors 10000
set LEPGenerator:EventHandler:LuminosityFunction:Energy 91.2
cd /Herwig/Generators
#insert LEPGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
set /Herwig/Analysis/HepMCFile:PrintEvent 1000000
set /Herwig/Analysis/HepMCFile:Format GenEvent
set /Herwig/Analysis/HepMCFile:Units GeV_mm
set /Herwig/Analysis/HepMCFile:Filename events.fifo
saverun LEP LEPGenerator
diff --git a/src/LHC-Matchbox.in b/src/LHC-Matchbox.in
--- a/src/LHC-Matchbox.in
+++ b/src/LHC-Matchbox.in
@@ -1,97 +1,132 @@
read Matchbox.in
################################################################################
# setup the shower
#
# use -LO.in or -NLO.in for LO/NLO simulations, respectively.
#
################################################################################
read DipoleShower.in
# read DipoleShowerParameters-LO.in
read DipoleShowerParameters-NLO.in
################################################################################
# setup matrix element and matching
#
# uncomment the desired calculation
#
################################################################################
cd /Herwig/EventHandlers
set LHCHandler:LuminosityFunction:Energy 8000.0*GeV
cd /Herwig/MatrixElements/Matchbox
insert /Herwig/Generators/LHCGenerator:EventHandler:SubProcessHandlers[0] PPFactory
+
+################################################################################
+# inclusive Drell-Yan
+################################################################################
+
+set PPFactory:OrderInAlphaS 0
do PPFactory:Process p p e+ e-
################################################################################
+# Z+1 jet
+################################################################################
+
+# set PPFactory:OrderInAlphaS 1
+# do PPFactory:Process p p e+ e- j
+
+# set PPFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPtScale
+
+# insert /Herwig/Cuts/JetCuts:JetRegions 0 /Herwig/Cuts/FirstJet
+
+# set /Herwig/Cuts/QCDCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/QCDCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
+# Z+2 jets (leading order only)
+################################################################################
+
+# set PPFactory:OrderInAlphaS 2
+# do PPFactory:Process p p e+ e- j j
+
+# set PPFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPtScale
+
+# insert /Herwig/Cuts/JetCuts:JetRegions 0 /Herwig/Cuts/FirstJet
+# insert /Herwig/Cuts/JetCuts:JetRegions 1 /Herwig/Cuts/SecondJet
+
+# set /Herwig/Cuts/QCDCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/QCDCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
# leading order
################################################################################
# set PPFactory:VirtualContributions Off
# set PPFactory:RealContributions Off
################################################################################
# MC@NLO-type next-to-leading order
################################################################################
set PPFactory:ShowerApproximation DipoleMatching
################################################################################
# POWHEG-type next-to-leading order
################################################################################
# set PPFactory:ShowerApproximation MEMatching
# insert /Herwig/Generators/LEPGenerator:EventHandler:PostSubProcessHandlers[0] MEMatching
################################################################################
# scale variations
#
# see Matchbox.in for different scale choices
#
################################################################################
################################################################################
# hard process scale variations
################################################################################
-set /Herwig/MatrixElement/Matchbox/PPFactory:RenormalizationScaleFactor 1.0
-set /Herwig/MatrixElement/Matchbox/PPFactory:FactorizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/PPFactory:RenormalizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/PPFactory:FactorizationScaleFactor 1.0
################################################################################
# shower scale variations
################################################################################
set /Herwig/DipoleShower/DipoleShowerHandler:RenormalizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:FactorizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleFactor 1.0
################################################################################
# setup generator and analysis
#
#
#
################################################################################
cd /Herwig/Generators
set LHCGenerator:EventHandler:CascadeHandler /Herwig/DipoleShower/DipoleShowerHandler
set LHCGenerator:NumberOfEvents 100000000
set LHCGenerator:RandomNumberGenerator:Seed 31122001
set LHCGenerator:DebugLevel 1
set LHCGenerator:PrintEvent 10
set LHCGenerator:MaxErrors 4000000
cd /Herwig/Generators
#insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
set /Herwig/Analysis/HepMCFile:PrintEvent 10000000
set /Herwig/Analysis/HepMCFile:Format GenEvent
set /Herwig/Analysis/HepMCFile:Units GeV_mm
set /Herwig/Analysis/HepMCFile:Filename events.fifo
saverun LHC LHCGenerator
diff --git a/src/TVT-Matchbox.in b/src/TVT-Matchbox.in
--- a/src/TVT-Matchbox.in
+++ b/src/TVT-Matchbox.in
@@ -1,98 +1,133 @@
read Matchbox.in
################################################################################
# setup the shower
#
# use -LO.in or -NLO.in for LO/NLO simulations, respectively.
#
################################################################################
read DipoleShower.in
# read DipoleShowerParameters-LO.in
read DipoleShowerParameters-NLO.in
################################################################################
# setup matrix element and matching
#
# uncomment the desired calculation
#
################################################################################
cd /Herwig/EventHandlers
set LHCHandler:LuminosityFunction:Energy 1960.0*GeV
set LHCHandler:BeamB /Herwig/Particles/pbar-
cd /Herwig/MatrixElements/Matchbox
insert /Herwig/Generators/LHCGenerator:EventHandler:SubProcessHandlers[0] PPFactory
+
+################################################################################
+# inclusive Drell-Yan
+################################################################################
+
+set PPFactory:OrderInAlphaS 0
do PPFactory:Process p p e+ e-
################################################################################
+# Z+1 jet
+################################################################################
+
+# set PPFactory:OrderInAlphaS 1
+# do PPFactory:Process p p e+ e- j
+
+# set PPFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPtScale
+
+# insert /Herwig/Cuts/JetFinder:JetRegions 0 /Herwig/Cuts/FirstJet
+
+# set /Herwig/Cuts/QCDCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/QCDCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
+# Z+2 jets (leading order only)
+################################################################################
+
+# set PPFactory:OrderInAlphaS 2
+# do PPFactory:Process p p e+ e- j j
+
+# set PPFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPtScale
+
+# insert /Herwig/Cuts/JetFinder:JetRegions 0 /Herwig/Cuts/FirstJet
+# insert /Herwig/Cuts/JetFinder:JetRegions 1 /Herwig/Cuts/SecondJet
+
+# set /Herwig/Cuts/QCDCuts:JetFinder /Herwig/Cuts/JetFinder
+# insert /Herwig/Cuts/QCDCuts:MultiCuts 0 /Herwig/Cuts/JetCuts
+
+################################################################################
# leading order
################################################################################
# set PPFactory:VirtualContributions Off
# set PPFactory:RealContributions Off
################################################################################
# MC@NLO-type next-to-leading order
################################################################################
set PPFactory:ShowerApproximation DipoleMatching
################################################################################
# POWHEG-type next-to-leading order
################################################################################
# set PPFactory:ShowerApproximation MEMatching
# insert /Herwig/Generators/LEPGenerator:EventHandler:PostSubProcessHandlers[0] MEMatching
################################################################################
# scale variations
#
# see Matchbox.in for different scale choices
#
################################################################################
################################################################################
# hard process scale variations
################################################################################
-set /Herwig/MatrixElement/Matchbox/PPFactory:RenormalizationScaleFactor 1.0
-set /Herwig/MatrixElement/Matchbox/PPFactory:FactorizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/PPFactory:RenormalizationScaleFactor 1.0
+set /Herwig/MatrixElements/Matchbox/PPFactory:FactorizationScaleFactor 1.0
################################################################################
# shower scale variations
################################################################################
set /Herwig/DipoleShower/DipoleShowerHandler:RenormalizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:FactorizationScaleFactor 1.0
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleFactor 1.0
################################################################################
# setup generator and analysis
#
#
#
################################################################################
cd /Herwig/Generators
set LHCGenerator:EventHandler:CascadeHandler /Herwig/DipoleShower/DipoleShowerHandler
set LHCGenerator:NumberOfEvents 100000000
set LHCGenerator:RandomNumberGenerator:Seed 31122001
set LHCGenerator:DebugLevel 1
set LHCGenerator:PrintEvent 10
set LHCGenerator:MaxErrors 4000000
cd /Herwig/Generators
#insert LHCGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
set /Herwig/Analysis/HepMCFile:PrintEvent 10000000
set /Herwig/Analysis/HepMCFile:Format GenEvent
set /Herwig/Analysis/HepMCFile:Units GeV_mm
set /Herwig/Analysis/HepMCFile:Filename events.fifo
saverun TVT LHCGenerator
diff --git a/src/defaults/Matchbox.in b/src/defaults/Matchbox.in
--- a/src/defaults/Matchbox.in
+++ b/src/defaults/Matchbox.in
@@ -1,341 +1,356 @@
################################################################################
# Input file to setup Matchbox NLO matrix elements
################################################################################
################################################################################
#
# /!\ Nothing to be done below here, except you exactly know
# what you're doing.
#
# Really.
#
################################################################################
# .....
# ....
# ...
# ..
# .
#
################################################################################
# Load libraries
################################################################################
library HwExsample2.so
library HwMatchbox.so
library JetCuts.so
-library KTJetFinder.so
+library FastJetFinder.so
mkdir /Herwig/MatrixElements/Matchbox
cd /Herwig/MatrixElements/Matchbox
################################################################################
# For the moment, we can only deal with massless partons
################################################################################
set /Herwig/Particles/d:NominalMass 0*GeV
set /Herwig/Particles/dbar:NominalMass 0*GeV
set /Herwig/Particles/u:NominalMass 0*GeV
set /Herwig/Particles/ubar:NominalMass 0*GeV
set /Herwig/Particles/s:NominalMass 0*GeV
set /Herwig/Particles/sbar:NominalMass 0*GeV
set /Herwig/Particles/c:NominalMass 0*GeV
set /Herwig/Particles/cbar:NominalMass 0*GeV
set /Herwig/Particles/b:NominalMass 0*GeV
set /Herwig/Particles/bbar:NominalMass 0*GeV
################################################################################
# Cleanup some Herwig++ defaults
################################################################################
set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV
set /Herwig/Cuts/QCDCuts:MHatMin 0.0*GeV
set /Herwig/Cuts/NeutralCurrentCut:MinW2 0.0*GeV2
set /Herwig/Cuts/DISCuts:MHatMin 0.0*GeV
set /Herwig/Generators/LEPGenerator:EventHandler:CollisionCuts Off
set /Herwig/Generators/DISGenerator:EventHandler:CollisionCuts Off
set /Herwig/Generators/LHCGenerator:EventHandler:CollisionCuts Off
################################################################################
# Integration/sampling
################################################################################
mkdir /Herwig/Samplers
cd /Herwig/Samplers
create Herwig::ExSampler ExBinSampler
create Herwig::GeneralSampler ExSampler
set ExBinSampler:presampling_points 10000
set ExSampler:BinSampler ExBinSampler
set ExSampler:Verbose On
create Herwig::BinSampler FlatBinSampler
set FlatBinSampler:InitialPoints 10000
create Herwig::ProjectingSampler ProjectingBinSampler
set ProjectingBinSampler:InitialPoints 1250
set ProjectingBinSampler:NIterations 4
set ProjectingBinSampler:EnhancementFactor 4.0
set ProjectingBinSampler:NBins 8
create Herwig::GeneralSampler Sampler
set Sampler:BinSampler ExBinSampler
set Sampler:UpdateAfter 1000
set /Herwig/EventHandlers/LEPHandler:Sampler Sampler
set /Herwig/EventHandlers/DISHandler:Sampler Sampler
set /Herwig/EventHandlers/LHCHandler:Sampler Sampler
################################################################################
# Setup the factory object
################################################################################
cd /Herwig/MatrixElements/Matchbox
create Herwig::MatchboxFactory Factory
set Factory:OrderInAlphaEW 2
set Factory:OrderInAlphaS 0
do Factory:StartParticleGroup p
insert Factory:ParticleGroup 0 /Herwig/Particles/b
insert Factory:ParticleGroup 0 /Herwig/Particles/bbar
insert Factory:ParticleGroup 0 /Herwig/Particles/c
insert Factory:ParticleGroup 0 /Herwig/Particles/cbar
insert Factory:ParticleGroup 0 /Herwig/Particles/s
insert Factory:ParticleGroup 0 /Herwig/Particles/sbar
insert Factory:ParticleGroup 0 /Herwig/Particles/d
insert Factory:ParticleGroup 0 /Herwig/Particles/dbar
insert Factory:ParticleGroup 0 /Herwig/Particles/u
insert Factory:ParticleGroup 0 /Herwig/Particles/ubar
insert Factory:ParticleGroup 0 /Herwig/Particles/g
do Factory:EndParticleGroup
do Factory:StartParticleGroup j
insert Factory:ParticleGroup 0 /Herwig/Particles/b
insert Factory:ParticleGroup 0 /Herwig/Particles/bbar
insert Factory:ParticleGroup 0 /Herwig/Particles/c
insert Factory:ParticleGroup 0 /Herwig/Particles/cbar
insert Factory:ParticleGroup 0 /Herwig/Particles/s
insert Factory:ParticleGroup 0 /Herwig/Particles/sbar
insert Factory:ParticleGroup 0 /Herwig/Particles/d
insert Factory:ParticleGroup 0 /Herwig/Particles/dbar
insert Factory:ParticleGroup 0 /Herwig/Particles/u
insert Factory:ParticleGroup 0 /Herwig/Particles/ubar
insert Factory:ParticleGroup 0 /Herwig/Particles/g
do Factory:EndParticleGroup
do Factory:StartParticleGroup h0
insert Factory:ParticleGroup 0 /Herwig/Particles/h0
do Factory:EndParticleGroup
do Factory:StartParticleGroup e+
insert Factory:ParticleGroup 0 /Herwig/Particles/e+
do Factory:EndParticleGroup
do Factory:StartParticleGroup e-
insert Factory:ParticleGroup 0 /Herwig/Particles/e-
do Factory:EndParticleGroup
do Factory:StartParticleGroup mu+
insert Factory:ParticleGroup 0 /Herwig/Particles/mu+
do Factory:EndParticleGroup
do Factory:StartParticleGroup mu-
insert Factory:ParticleGroup 0 /Herwig/Particles/mu-
do Factory:EndParticleGroup
do Factory:StartParticleGroup l+
insert Factory:ParticleGroup 0 /Herwig/Particles/e+
insert Factory:ParticleGroup 0 /Herwig/Particles/mu+
do Factory:EndParticleGroup
do Factory:StartParticleGroup l-
insert Factory:ParticleGroup 0 /Herwig/Particles/e-
insert Factory:ParticleGroup 0 /Herwig/Particles/mu-
do Factory:EndParticleGroup
################################################################################
# Setup amplitudes
################################################################################
cd /Herwig/MatrixElements/Matchbox
mkdir Amplitudes
cd Amplitudes
create Herwig::SimpleColourBasis SimpleColourBasis
create Herwig::MatchboxAmplitudellbarqqbar Amplitudellbarqqbar
set Amplitudellbarqqbar:ColourBasis SimpleColourBasis
create Herwig::MatchboxAmplitudellbarqqbarg Amplitudellbarqqbarg
set Amplitudellbarqqbarg:ColourBasis SimpleColourBasis
create Herwig::MatchboxAmplitudellbarqqbargg Amplitudellbarqqbargg
set Amplitudellbarqqbargg:ColourBasis SimpleColourBasis
create Herwig::MatchboxAmplitudellbarqqbarqqbar Amplitudellbarqqbarqqbar
set Amplitudellbarqqbarqqbar:ColourBasis SimpleColourBasis
insert /Herwig/MatrixElements/Matchbox/Factory:Amplitudes 0 Amplitudellbarqqbar
insert /Herwig/MatrixElements/Matchbox/Factory:Amplitudes 0 Amplitudellbarqqbarg
insert /Herwig/MatrixElements/Matchbox/Factory:Amplitudes 0 Amplitudellbarqqbargg
insert /Herwig/MatrixElements/Matchbox/Factory:Amplitudes 0 Amplitudellbarqqbarqqbar
################################################################################
# Setup utilities for matching
################################################################################
cd /Herwig/MatrixElements/Matchbox
create Herwig::MEMatching MEMatching
set MEMatching:RestrictPhasespace Off
set MEMatching:FFPtCut 1.0*GeV
set MEMatching:FIPtCut 1.0*GeV
set MEMatching:IIPtCut 1.0*GeV
create Herwig::DipoleMatching DipoleMatching
set DipoleMatching:RestrictPhasespace On
set DipoleMatching:FFPtCut 1.0*GeV
set DipoleMatching:FIPtCut 1.0*GeV
set DipoleMatching:IIPtCut 1.0*GeV
################################################################################
# Setup utilities for process generation
################################################################################
cd /Herwig/MatrixElements/Matchbox
mkdir Utility
cd Utility
create Herwig::SimpleColourBasis SimpleColourBasis
create Herwig::Tree2toNGenerator DiagramGenerator
insert DiagramGenerator:Vertices 0 /Herwig/Vertices/FFGVertex
insert DiagramGenerator:Vertices 0 /Herwig/Vertices/FFPVertex
insert DiagramGenerator:Vertices 0 /Herwig/Vertices/FFZVertex
insert DiagramGenerator:Vertices 0 /Herwig/Vertices/GGGVertex
create Herwig::ProcessData ProcessData
set /Herwig/MatrixElements/Matchbox/Factory:DiagramGenerator DiagramGenerator
set /Herwig/MatrixElements/Matchbox/Factory:ProcessData ProcessData
################################################################################
# Setup phasespace generators
################################################################################
cd /Herwig/MatrixElements/Matchbox
mkdir Phasespace
cd Phasespace
create Herwig::MatchboxRambo Rambo
+create Herwig::FlatInvertiblePhasespace DetPhasespace
+
create Herwig::TreePhasespaceChannels TreePhasespaceChannels
create Herwig::TreePhasespace TreePhasespace
set TreePhasespace:ChannelMap TreePhasespaceChannels
set TreePhasespace:M0 1*GeV
set TreePhasespace:MC 0.01*GeV
set /Herwig/MatrixElements/Matchbox/Factory:Phasespace TreePhasespace
################################################################################
# Setup cuts
################################################################################
cd /Herwig/Cuts
-create ThePEG::KTJetFinder JetFinder
+create ThePEG::FastJetFinder JetFinder
set JetFinder:UnresolvedMatcher /Herwig/Matchers/StandardQCDParton
set JetFinder:Variant AntiKt
set JetFinder:RecombinationScheme E
set JetFinder:Mode Inclusive
set JetFinder:ConeRadius 0.7
create ThePEG::JetRegion FirstJet
set FirstJet:PtMin 20.*GeV
do FirstJet:YRange -5.0 5.0
insert FirstJet:Accepts[0] 1
create ThePEG::JetRegion SecondJet
set SecondJet:PtMin 20.*GeV
do SecondJet:YRange -5.0 5.0
insert SecondJet:Accepts[0] 2
+create ThePEG::JetRegion ThirdJet
+set ThirdJet:PtMin 20.*GeV
+do ThirdJet:YRange -5.0 5.0
+insert ThirdJet:Accepts[0] 3
+
+create ThePEG::NJetsCut NJetsCut
+set NJetsCut:UnresolvedMatcher /Herwig/Matchers/StandardQCDParton
+set NJetsCut:NJetsMin 2
+
+create ThePEG::JetCuts JetCuts
+set JetCuts:UnresolvedMatcher /Herwig/Matchers/StandardQCDParton
+set JetCuts:Ordering OrderPt
+
################################################################################
# Setup scale choices
################################################################################
cd /Herwig/MatrixElements/Matchbox
mkdir Scales
cd Scales
create Herwig::MatchboxScaleChoice SHatScale
cp SHatScale FixedScale
set FixedScale:FixedScale 100.*GeV
create Herwig::MatchboxPtScale MaxPtScale
set MaxPtScale:JetFinder /Herwig/Cuts/JetFinder
create Herwig::MatchboxLeptonMassScale LeptonMassScale
create Herwig::MatchboxLeptonPtScale LeptonPtScale
set /Herwig/MatrixElements/Matchbox/Factory:ScaleChoice LeptonMassScale
################################################################################
# AlphaS
################################################################################
cd /Herwig/MatrixElements/Matchbox
mkdir AlphaS
cd AlphaS
library HwDipoleShowerAlphaS.so
create matchbox::lo_alpha_s LOAlphaS
set LOAlphaS:min_active_flavours 5
create matchbox::nlo_alpha_s NLOAlphaS
set NLOAlphaS:exact_evaluation large_scale
set NLOAlphaS:min_active_flavours 5
################################################################################
# Factories for different colliders
################################################################################
cd /Herwig/MatrixElements/Matchbox
cp Factory EEFactory
set EEFactory:PartonExtractor /Herwig/Partons/EEExtractor
set EEFactory:Cuts /Herwig/Cuts/EECuts
cp Factory DISFactory
set DISFactory:PartonExtractor /Herwig/Partons/DISExtractor
set DISFactory:Cuts /Herwig/Cuts/DISCuts
cp Factory PPFactory
set PPFactory:PartonExtractor /Herwig/Partons/QCDExtractor
set PPFactory:Cuts /Herwig/Cuts/QCDCuts
cd /

File Metadata

Mime Type
text/x-diff
Expires
Mon, Jan 20, 9:16 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242458
Default Alt Text
(405 KB)

Event Timeline