Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7879741
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
115 KB
Subscribers
None
View Options
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,112 +1,112 @@
Makefile$
Makefile\.in$
\.deps$
\.libs$
\.l[ao]$
\.so$
\.so\.
\.o$
~$
\.pyc$
\.codereplace$
\.orig$
\.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/compile$
^Config/install-sh$
^Config/missing$
^Config/stamp-h1$
^Config/ar-lib$
^Contrib/make_makefiles.sh$
^Contrib/.*/.*\.(log|out|tex|run)$
^Utilities/hgstamp.inc$
^Doc/HerwigDefaults.in$
^Doc/refman-html$
^Doc/fixinterfaces.pl$
^Doc/refman.conf$
^Doc/refman.h$
^Doc/AllInterfaces.h$
^Doc/HerwigDefaults.rpo$
^Doc/Herwig-refman.tag$
^Doc/tagfileThePEG.tag$
^Doc/.*\.log$
^INSTALL$
^aclocal.m4$
^confdefs.h$
^conftest.c$
^conftest.err$
^include/done-all-links$
^libtool$
\.dirstamp$
^src/hgstamp.inc$
^src/herwigopts.h$
^src/herwigopts.c$
^src/defaults/Analysis.in$
^src/defaults/Decays.in$
^src/defaults/decayers.in$
^src/herwig-config$
^src/.*\.(run|tex|out|log|rpo|spc|top|dump|dot|aux|pdf|ps|png|svg|hepmc|dvi)$
^src/Makefile-UserModules$
^lib/done-all-links$
^lib/apple-fixes$
^src/defaults/PDF.in$
^src/defaults/done-all-links$
^src/tune$
^src/Herwig$
-^src/Herwig-scratch$
+^src/Herwig-cache$
^src/tests/.*\.(time|mult|Bmult|chisq)$
^src/Merging/test/*yoda
^src/Merging/test/Herwig*
^src/Merging/test/L*
^src/Merging/test/done-all-links
^src/Merging/done-all-links
^Tests/.*/.*\.(top|ps|pyc|info|dat|pdf|png)$
^Tests/.*\.(top|ps|pyc|info|dat|pdf|png|log|out)$
^Tests/.*\.(top|run|tex|mult|Bmult|aida|yoda)$
^Tests/Rivet-.*$
-^Tests/Herwig-scratch$
+^Tests/.cache$
^Tests/Rivet/(LEP|DIS|LHC|TVT|Star|BFactory|ISR|SppS)-.*\.in$
^Tests/plots$
^Tests/Herwig$
^Tests/.*index.html$
^Herwig\-
^Models/Feynrules/python/Makefile-FR$
-^MatrixElement/Matchbox/External/MadGraph/mg2herwig.py$
+^MatrixElement/Matchbox/External/MadGraph/mg2herwig$
^MatrixElement/Matchbox/Scales/MatchboxScale.cc$
^Utilities/Statistics/herwig-combinedistributions$
^Utilities/Statistics/herwig-combineruns$
^Utilities/Statistics/herwig-makedistributions$
^src/defaults/MatchboxDefaults.in$
^src/defaults/setup.gosam.in$
^src/Matchbox/LO-DefaultShower.in$
^src/Matchbox/LO-DipoleShower.in$
^src/Matchbox/LO-NoShower.in$
^src/Matchbox/MCatLO-DefaultShower.in$
^src/Matchbox/MCatLO-DipoleShower.in$
^src/Matchbox/MCatNLO-DefaultShower.in$
^src/Matchbox/MCatNLO-DipoleShower.in$
^src/Matchbox/NLO-NoShower.in$
^src/Matchbox/Powheg-DefaultShower.in$
^src/Matchbox/Powheg-DipoleShower.in$
^src/defaults/MatchboxMergingDefaults.in
^src/Matchbox/done-all-links$
^src/snippets/done-all-links$
^Utilities/XML/xml_test$
^Utilities/utilities_test$
^Utilities/versionstring.h$
test\.(log|trs)$
test-suite\.log$
^Config/test-driver$
param_card\.dat$
__all.cc$
-.ccR$
\ No newline at end of file
+.ccR$
diff --git a/API/RunDirectories.cc b/API/RunDirectories.cc
--- a/API/RunDirectories.cc
+++ b/API/RunDirectories.cc
@@ -1,114 +1,114 @@
// -*- C++ -*-
//
// RunDirectories.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2017 The Herwig Collaboration
//
// Herwig is licenced under version 3 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#include "RunDirectories.h"
#include "ThePEG/Utilities/Exception.h"
#include "ThePEG/Handlers/SamplerBase.h"
#include "Filesystem.h"
using namespace ThePEG;
using namespace Herwig;
using std::string;
using std::list;
void RunDirectories::prefix(string p) {
if ( *p.rbegin() != '/' )
p += "/";
thePrefix() = p;
}
const string& RunDirectories::prefix() {
return thePrefix();
}
string& RunDirectories::thePrefix() {
- static string p = "./Herwig-scratch/";
+ static string p = "./Herwig-cache/";
return p;
}
string& RunDirectories::theBuildStorage() {
static string builds = "";
return builds;
}
const string& RunDirectories::buildStorage() {
if ( !theBuildStorage().empty() )
return theBuildStorage();
theBuildStorage() = prefix();
if ( theBuildStorage().empty() )
- theBuildStorage() = "./Herwig-scratch/";
+ theBuildStorage() = "./Herwig-cache/";
else if ( *theBuildStorage().rbegin() != '/' )
theBuildStorage() += "/";
theBuildStorage() += "Build/";
if ( filesystem::exists(theBuildStorage()) ) {
if ( !filesystem::is_directory(theBuildStorage()) )
throw Exception() << "Herwig build storage '"
<< theBuildStorage() << "' exists but not a directory."
<< Exception::abortnow;
} else {
filesystem::create_directory(theBuildStorage());
}
return theBuildStorage();
}
bool RunDirectories::empty() {
return theRunDirectories().empty();
}
list<string>& RunDirectories::theRunDirectories() {
static list<string> rundirs;
return rundirs;
}
const string& RunDirectories::runStorage() {
if ( theRunDirectories().empty() )
throw Exception() << "No run directory stack has been allocated."
<< Exception::abortnow;
if ( filesystem::exists(theRunDirectories().front()) ) {
if ( !filesystem::is_directory(theRunDirectories().front()) )
throw Exception() << "Herwig run storage '"
<< theRunDirectories().front() << "' exists but not a directory."
<< Exception::abortnow;
} else {
filesystem::create_directory(theRunDirectories().front());
}
return theRunDirectories().front();
}
const string& RunDirectories::interfaceStorage() {
if ( SamplerBase::runLevel() == SamplerBase::IntegrationMode ||
SamplerBase::runLevel() == SamplerBase::RunMode )
return runStorage();
return buildStorage();
}
void RunDirectories::pushRunId(string p) {
if ( *p.rbegin() != '/' )
p += "/";
if ( theRunDirectories().empty() ) {
theRunDirectories().push_front(prefix() + p);
return;
}
theRunDirectories().push_front(theRunDirectories().front() + p);
}
RunDirectories::RunDirectories()
: directoriesLeft(theRunDirectories()) {}
string RunDirectories::nextRunStorage() {
if ( directoriesLeft.empty() )
throw Exception() << "No more run directories left to try."
<< Exception::abortnow;
string res = directoriesLeft.front();
directoriesLeft.pop_front();
return res;
}
diff --git a/MatrixElement/Matchbox/External/MadGraph/InterfaceMadGraph.f.in b/MatrixElement/Matchbox/External/MadGraph/InterfaceMadGraph.f.in
--- a/MatrixElement/Matchbox/External/MadGraph/InterfaceMadGraph.f.in
+++ b/MatrixElement/Matchbox/External/MadGraph/InterfaceMadGraph.f.in
@@ -1,92 +1,92 @@
!This file gets filled from mg2herwig
!///////////////////////////////////////////////////////////////////////
subroutine MGInitProc(file_card)
IMPLICIT NONE
character*(*) file_card
C print*,"Reading inputs from: "
C print*, TRIM(file_card)
CALL setpara(file_card)
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_Calculate_wavefunctions_virt(proc, momenta, virt)
$ bind(c, name="MG_Calculate_wavefunctions_virt")
IMPLICIT NONE
REAL*8 momenta(0:40),virt(20)
INTEGER proc
-MG_CalculateVIRTtxt
+{MG_CalculateVIRTtxt}
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_Calculate_wavefunctions_born(proc, momenta, hel)
$ bind(c, name="MG_Calculate_wavefunctions_born")
IMPLICIT NONE
REAL*8 momenta(0:40)
INTEGER hel(0:10),proc
-MG_CalculateBORNtxt
+{MG_CalculateBORNtxt}
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_Jamp(proc ,color,amp)
$ bind(c, name="MG_Jamp")
IMPLICIT NONE
INTEGER proc,color
REAL*8 amp(0:1)
COMPLEX*16 Jamp
-MG_Jamptxt
+{MG_Jamptxt}
amp(0)=real(Jamp)
amp(1)=aimag(Jamp)
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_LNJamp(proc ,color,amp)
$ bind(c, name="MG_LNJamp")
IMPLICIT NONE
INTEGER proc,color
REAL*8 amp(0:1)
COMPLEX*16 Jamp
-MG_LNJamptxt
+{MG_LNJamptxt}
amp(0)=real(Jamp)
amp(1)=aimag(Jamp)
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_NCol(proc ,color)
$ bind(c, name="MG_NCol")
IMPLICIT NONE
INTEGER proc,color
-MG_NColtxt
+{MG_NColtxt}
END
!///////////////////////////////////////////////////////////////////////
subroutine MG_Colour(proc,i,j ,color)
$ bind(c, name="MG_Colour")
IMPLICIT NONE
INTEGER proc,color,i,j
-MG_ColourMattxt
+{MG_ColourMattxt}
END
!///////////////////////////////////////////////////////////////////////
-MG_vxxxxxtxt
+{MG_vxxxxxtxt}
diff --git a/MatrixElement/Matchbox/External/MadGraph/MadGraphAmplitude.cc b/MatrixElement/Matchbox/External/MadGraph/MadGraphAmplitude.cc
--- a/MatrixElement/Matchbox/External/MadGraph/MadGraphAmplitude.cc
+++ b/MatrixElement/Matchbox/External/MadGraph/MadGraphAmplitude.cc
@@ -1,908 +1,911 @@
// -*- C++ -*-
//
// MadGraphAmplitude.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2017 The Herwig Collaboration
//
// Herwig is licenced under version 3 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 MadGraphAmplitude class.
//
#include "MadGraphAmplitude.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "Herwig/MatrixElement/Matchbox/MatchboxFactory.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/PDT/EnumParticles.h"
#include "Herwig/API/Filesystem.h"
+#include "Herwig/API/RunDirectories.h"
#include <cstdlib>
#include <dlfcn.h>
#include <errno.h>
#include <sstream>
using namespace Herwig;
#ifndef HERWIG_BINDIR
#error Makefile.am needs to define HERWIG_BINDIR
#endif
#ifndef HERWIG_PKGDATADIR
#error Makefile.am needs to define HERWIG_PKGDATADIR
#endif
#ifndef MADGRAPH_PREFIX
#error Makefile.am needs to define MADGRAPH_PREFIX
#endif
extern "C" void mginitproc_(char *i,int);
extern "C" void MG_Calculate_wavefunctions_virt(int* proc,double*,double*);
extern "C" void MG_Calculate_wavefunctions_born(int* proc,double*, int*);
extern "C" void MG_Jamp (int* proc,int*, double*);
extern "C" void MG_LNJamp (int* proc,int*, double*);
extern "C" void MG_Virt (int* proc,double*);
extern "C" void MG_NCol (int* proc,int*);
extern "C" void MG_vxxxxx (double* p,double* n,int* inc,double* );
extern "C" void MG_Colour (int* proc,int* i,int* j ,int* color);
MadGraphAmplitude::MadGraphAmplitude()
: keepinputtopmass(false){ }
MadGraphAmplitude::~MadGraphAmplitude() {
}
string MadGraphAmplitude::theProcessPath="";
string MadGraphAmplitude::madgraphPrefix_=MADGRAPH_PREFIX;
string MadGraphAmplitude::theMGmodel="loop_sm";
string MadGraphAmplitude::bindir_=HERWIG_BINDIR;
string MadGraphAmplitude::includedir_=HERWIG_INCLUDEDIR;
string MadGraphAmplitude::pkgdatadir_=HERWIG_PKGDATADIR;
IBPtr MadGraphAmplitude::clone() const {
return new_ptr(*this);
}
IBPtr MadGraphAmplitude::fullclone() const {
return new_ptr(*this);
}
bool MadGraphAmplitude::initializedMad=false;
vector<string> MadGraphAmplitude::BornAmplitudes=vector<string>();
vector<string> MadGraphAmplitude::VirtAmplitudes=vector<string>();
void MadGraphAmplitude::initProcess(const cPDVector& ) {
if ( lastMatchboxXComb()->initialized() )
return;
if ( !DynamicLoader::load(mgProcLibPath()+"InterfaceMadGraph.so") )
throw Exception() << "MadGraphAmplitude: Failed to load MadGraph amplitudes\n"
<< DynamicLoader::lastErrorMessage
<< Exception::runerror;
if (!initializedMad){
string mstr=(factory()->runStorage()+"MadGraphAmplitudes"+"/param_card"+((theMGmodel=="loop_sm")?"":("_"+theMGmodel))+".dat");
if( theMGmodel[0]=='/')mstr="param_card.dat";
size_t len = mstr.size();
mginitproc_(const_cast<char*>(mstr.c_str()),len);
initializedMad=true;
}
lastMatchboxXComb()->isInitialized();
}
bool MadGraphAmplitude::writeAmplitudesDat(){
bool res=false;
string born= mgProcLibPath()+"BornAmplitudes.dat";
if ( !filesystem::exists(born) ) {
ofstream borns(born.c_str());
for (vector<string>::iterator amps=BornAmplitudes.begin();amps!=BornAmplitudes.end();amps++)
borns<<*amps<<endl;
borns.close();
res=true;
}
string virt= mgProcLibPath()+"VirtAmplitudes.dat";
if ( !filesystem::exists(virt) ) {
ofstream virts(virt.c_str());
for (vector<string>::iterator amps=VirtAmplitudes.begin();amps!=VirtAmplitudes.end();amps++)
virts<<*amps<<endl;
virts.flush();
virts.close();
res=true;
}
return res;
}
bool MadGraphAmplitude::checkAmplitudes(){
string born= mgProcLibPath()+"BornAmplitudes.dat";
string virt= mgProcLibPath()+"VirtAmplitudes.dat";
assert ( filesystem::exists(born)|| filesystem::exists(virt));
bool foundallborns=true;
for (vector<string>::iterator amps=BornAmplitudes.begin();amps!=BornAmplitudes.end();amps++){
ifstream borns(born.c_str());
string line;
bool foundthisborn=false;
while (std::getline(borns, line)) {
if(line==*amps)foundthisborn=true;
}
foundallborns&=foundthisborn;
}
bool foundallvirts=true;
for (vector<string>::iterator amps=VirtAmplitudes.begin();amps!=VirtAmplitudes.end();amps++){
ifstream virts(virt.c_str());
string line;
bool foundthisvirt=false;
while (std::getline(virts, line)) {
if(line==*amps)foundthisvirt=true;
}
foundallvirts&=foundthisvirt;
}
if (!foundallborns||!foundallvirts)
throw Exception() << "MadGraphAmplitude: The MadGraph amplitudes did not match the process.\n"
<< " Please remove:"<<mgProcLibPath()<< "\n"
<< " or set a process path via the interface:\n"
<< " set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath ..."
<< Exception::runerror;
return foundallborns && foundallvirts;
}
string MadGraphAmplitude::mgProcLibPath(){
string res=theProcessPath == "" ? factory()->buildStorage()+"MadGraphAmplitudes" : theProcessPath;
if (res.at(res.length()-1) != '/') res.append("/");
return res;
}
bool MadGraphAmplitude::initializeExternal() {
if ( filesystem::exists(mgProcLibPath()) ) {
if ( !filesystem::is_directory(mgProcLibPath()) )
throw Exception() << "MadGraphAmplitude: MadGraph amplitude storage '"
<< mgProcLibPath() << "' existing but not a directory."
<< Exception::runerror;
} else {
filesystem::create_directory(mgProcLibPath());
}
string runAmplitudes = factory()->runStorage() + "/MadGraphAmplitudes";
if ( filesystem::exists(runAmplitudes) ) {
if ( !filesystem::is_directory(runAmplitudes) )
throw Exception() << "MadGraphAmplitude: MadGraph amplitude storage '"
<< runAmplitudes << "' existing but not a directory."
<< Exception::runerror;
} else {
filesystem::create_directory(runAmplitudes);
}
//EW-consistency check:
Energy MW=getParticleData(ParticleID::Wplus)->hardProcessMass();
Energy MZ=getParticleData(ParticleID::Z0)->hardProcessMass();
if( MW!= sqrt(MZ*MZ/2.0+sqrt(MZ*MZ*MZ*MZ/4.0-Constants::pi*SM().alphaEMMZ()*MZ*MZ/ sqrt(2.0)/SM().fermiConstant()))){
generator()->log()<<"\n\n-----!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-----";
generator()->log() << "\nYou are using a EW scheme which is inconsistent with the MadGraph parametisation:\n\n"
<<MW/GeV<< " GeV==MW!= sqrt(MZ^2/2+sqrt(MZ^4/4.0-pi*alphaEMMZ*MZ^2/ sqrt(2)/G_f))=="<<
sqrt(MZ*MZ/2.0+sqrt(MZ*MZ*MZ*MZ/4.0-Constants::pi*SM().alphaEMMZ()*MZ*MZ/ sqrt(2.0)/SM().fermiConstant()))/GeV
<<" GeV\n\n-----!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-----\n";
}
string para= factory()->runStorage()+"/MadGraphAmplitudes"+"/MG-Parameter.dat";
ofstream params(para.c_str());
params<<"$WZ$ " <<std::setiosflags(ios::scientific) <<getParticleData(ParticleID::Z0)->hardProcessWidth() /GeV;
params<<"\n$WW$ " <<std::setiosflags(ios::scientific) <<getParticleData(ParticleID::Wplus)->hardProcessWidth()/GeV;
params<<"\n$alphas$ " <<std::setiosflags(ios::scientific) <<SM().alphaS();
params<<"\n$GF$ " <<std::setiosflags(ios::scientific) <<SM().fermiConstant()*GeV2 ;
params<<"\n$alphaMZ$ " <<std::setiosflags(ios::scientific) <<1/SM().alphaEMMZ();
params<<"\n$MZ$ " <<std::setiosflags(ios::scientific) <<getParticleData(ParticleID::Z0)->hardProcessMass() /GeV<<flush;
params<<"\n$MW$ " <<std::setiosflags(ios::scientific) <<getParticleData(ParticleID::Wplus)->hardProcessMass() /GeV<<flush;
params<<"\n$sw2$ " <<std::setiosflags(ios::scientific) << SM().sin2ThetaW() <<flush;
if(theMGmodel=="heft"&&!keepinputtopmass){
if ( factory()->initVerbose() ) {
generator()->log()<<"\n---------------------------------------------------------------";
generator()->log()<<"\n---------------------------------------------------------------";
generator()->log()<<"\nNote: You are using the Higgs Effective model (heft) in ";
generator()->log()<<"\n Madgraph. We assume you try to calculate NLO with ";
generator()->log()<<"\n the GoSam virtual amplitudes. To match the models we ";
generator()->log()<<"\n therefore set the topmass to 10000000 GeV.";
generator()->log()<<"\n\n For more information see the \\tau parameter in:";
generator()->log()<<"\n https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Models/HiggsEffective";
generator()->log()<<"\n\n The Effective Higgs model in Gosam is using mT=infinity";
generator()->log()<<"\n\n\n If you want to use the LO matrixelements of MadGraph with finite' topmass you need to add: ";
generator()->log()<<"\n\n set Madgraph:KeepInputTopMass Yes";
generator()->log()<<"\n\n to your input file.";
generator()->log()<<"\n---------------------------------------------------------------";
generator()->log()<<"\n---------------------------------------------------------------\n";
}
params<<"\n$MT$ 10000000." <<flush;
}else{
params<<"\n$MT$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::t)->hardProcessMass() /GeV <<flush;
}
params<<"\n$WT$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::t)->hardProcessWidth() /GeV <<flush;
params<<"\n$MB$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::b)->hardProcessMass() /GeV <<flush;
params<<"\n$MH$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::h0)->hardProcessMass() /GeV <<flush;
params<<"\n$WH$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::h0)->hardProcessWidth() /GeV <<flush;
params<<"\n$MTA$ " <<std::setiosflags(ios::scientific) << getParticleData(ParticleID::tauplus)->hardProcessMass() /GeV <<flush;
string cmd = "python " + bindir_ + "/mg2herwig ";
cmd +=" --buildpath "+mgProcLibPath();
cmd += !theProcessPath.empty() ? " --absolute-links" : "";
cmd +=" --model "+theMGmodel;
cmd +=" --runpath "+factory()->runStorage()+"/MadGraphAmplitudes ";
cmd +=" --datadir "+pkgdatadir_;
cmd +=" --includedir "+includedir_;
+ cmd +=" --cacheprefix "+RunDirectories::prefix();
std::stringstream as,aem;
as << factory()->orderInAlphaS();
cmd +=" --orderas "+as.str() ;
aem <<factory()->orderInAlphaEW();
cmd +=" --orderew "+aem.str();
// TODO move to boost::system
writeAmplitudesDat();
if (filesystem::exists(mgProcLibPath()+"InterfaceMadGraph.so") ){
//set the parameters
checkAmplitudes();
std::system(cmd.c_str());
ranMadGraphInitializeExternal = true;
return true;
}
char cwd[1024];
if ( !getcwd(cwd,sizeof(cwd)) )
throw Exception() << "MadGraphAmplitude: failed to determine current working directory\n"
<< Exception::runerror;
cmd +=" --madgraph " + madgraphPrefix_ + "/bin " ;
cmd +="--build > ";
cmd += mgProcLibPath()+"MG.log 2>&1";
generator()->log() << "\n>>> Compiling MadGraph amplitudes. This may take some time -- please be patient.\n"
<< ">>> In case of problems see " << mgProcLibPath() << "MG.log for details.\n\n"
<< flush;
std::system(cmd.c_str());
cmd = "python " + bindir_ + "/mg2herwig ";
cmd +=" --buildpath "+mgProcLibPath();
cmd +=" --model "+theMGmodel;
cmd +=" --runpath "+factory()->runStorage()+"/MadGraphAmplitudes ";
cmd +=" --datadir "+pkgdatadir_;
+ cmd +=" --cacheprefix "+RunDirectories::prefix();
as.clear();
aem.clear();
as << factory()->orderInAlphaS();
cmd +=" --orderas "+as.str() ;
aem <<factory()->orderInAlphaEW();
cmd +=" --orderew "+aem.str();
std::system(cmd.c_str());
ranMadGraphInitializeExternal = true;
return filesystem::exists(mgProcLibPath()+"InterfaceMadGraph.so");
}
int MadGraphAmplitude::externalId(const cPDVector& proc) {
for (int i=0;i<100;i++){
colourindex.push_back(-2);
}
assert(!BornAmplitudes.empty()||!VirtAmplitudes.empty());
writeAmplitudesDat();
int res=0;
string amp="";
int k=0;
for (cPDVector::const_iterator it=proc.begin();it!=proc.end();it++,k++){
amp+=std::to_string( (*it)->id())+" ";if (k==1)amp+=" > ";
}
string born= mgProcLibPath()+"BornAmplitudes.dat";
string virt= mgProcLibPath()+"VirtAmplitudes.dat";
assert ( filesystem::exists(born)|| filesystem::exists(virt));
ifstream borns(born.c_str());
string line;
while (std::getline(borns, line)) {
res+=1;
if(line==amp)return res;
}
ifstream virts(virt.c_str());
while (std::getline(virts, line)) {
res+=1;
if(line==amp)return res;
}
throw Exception() << "MadGraphAmplitude: One amplitude has no externalId. Please remove the MadGraphAmplitude-folder and rebuild.\n" << Exception::runerror;
return res;
}
bool MadGraphAmplitude::ranMadGraphInitializeExternal = false;
void MadGraphAmplitude::doinit() {
if ( !ranMadGraphInitializeExternal ) {
initializeExternal();
}
MatchboxAmplitude::doinit();
}
void MadGraphAmplitude::doinitrun() {
if ( !ranMadGraphInitializeExternal ) {
initializeExternal();
}
MatchboxAmplitude::doinitrun();
}
bool MadGraphAmplitude::canHandle(const PDVector& p,
Ptr<MatchboxFactory>::tptr factory,
bool virt) const {
if ( factory->processData()->diagramMap().find(p) !=
factory->processData()->diagramMap().end() )
return true;
vector<Ptr<Tree2toNDiagram>::ptr> diags =
factory->diagramGenerator()->generate(p,orderInGs(),orderInGem());
if ( diags.empty() )
return false;
factory->processData()->diagramMap()[p] = diags;
string amp="";
int k=0;
for (PDVector::const_iterator it=p.begin();it!=p.end();it++,k++){
amp+=std::to_string( (*it)->id())+" ";if (k==1)amp+=" > ";
}
if (virt && factory->highestVirt()>=p.size()){
VirtAmplitudes.push_back(amp);
}else{
BornAmplitudes.push_back(amp);
}
return true;
}
void MadGraphAmplitude::prepareAmplitudes(Ptr<MatchboxMEBase>::tcptr me) {
useMe();
if ( !calculateTreeAmplitudes() ) {
MatchboxAmplitude::prepareAmplitudes(me);
return;
}
if (colourindex.empty()) {
for (int i=0;i<100;i++){
colourindex.push_back(-2);
}
}
lastMatchboxXComb()->clearheljamp();
lastMatchboxXComb()->clearhelLNjamp();
initProcess(mePartonData());
MatchboxAmplitude::prepareAmplitudes(me);
}
Complex MadGraphAmplitude::evaluate(size_t i, const vector<int>& hel, Complex& largeN) {
//find the colourline:
int ii = -1;
int xx=lastMatchboxXComb()->externalId();
if (colourindex.size()<=i) {
colourindex.clear();
for (size_t l=0;l<=i+10;l++){
colourindex.push_back(-2);
}
}
if(colourindex[i]!=-2){
ii = colourindex[i];
if (ii==-1) {
largeN = Complex(0.0);
return Complex(0.0);
}
} else {
set<vector<size_t> > a ;
if(lastMatchboxXComb()->colourBasisDim()>0)a=colourOrdering(i);
int ncol=-1;
MG_NCol(&xx,&ncol);
assert(ncol!=-1);
for( int it = 0; it < ncol; it++ ){
int n = 0;
for ( cPDVector::const_iterator nx = mePartonData().begin();
nx != mePartonData().end(); nx++ )
if ( (*nx)->coloured() ) n++;
set<vector<size_t> > tmpset;
vector<size_t> tmpvek;
for ( int it2 = 0; it2 < n; it2++ ) {
int ret=-2;
MG_Colour(&xx,&it,&it2,&ret);
assert(ret !=-2);
if (ret== -1)
break;
if ( ret == 0 ) {
n++;
tmpset.insert(tmpvek);
tmpvek.clear();
} else {
tmpvek.push_back(ret-1);
}
if( it2 == n-1 ) tmpset.insert(tmpvek);
}
bool found_all = true;
for ( set<vector<size_t> >::iterator it3 = a.begin(); it3 != a.end(); it3++ ) {
bool found_it3=false;
for ( set<vector<size_t> >::iterator it4 = tmpset.begin(); it4 != tmpset.end(); it4++ ) {
vector<size_t> it3tmp = gluonsFirst(*it3);
vector<size_t> it4tmp = (*it4);
if ( it3tmp.size() != it4tmp.size() ) continue;
if ( it3tmp == it4tmp ) found_it3 = true;
}
found_all = found_all && found_it3;
}
if ( found_all ) {
colourindex[i]=it;
ii=it;
}
}
}
if ( ii == -1 ){
colourindex[i]=ii;
largeN = Complex(0.0);
return Complex(0.0);
}
const map<vector<int>,vector < complex<double> > >& tmp = lastMatchboxXComb()->heljamp();
const map<vector<int>,vector < complex<double> > >& tmpLN = lastMatchboxXComb()->helLNjamp();
if( tmp.find(hel) != tmp.end()) {
largeN = tmpLN.find(hel)->second[ii];
return tmp.find(hel)->second[ii];;
}
double units = pow(sqrt(lastSHat())/GeV,int(hel.size())-4);
int heltmp[10];
for(size_t j=0;j<hel.size();j++){
int cross=crossingMap()[j];
if( (cross>1&&j<=1)||(cross<=1&&j>1)){
heltmp[cross]=-1*hel[j];}
else{heltmp[cross]=hel[j];}
}
vector<Lorentz5Momentum> reshuffled = meMomenta();
if ( !reshuffleMasses().empty() && reshuffled.size() > 3 ) {
const cPDVector& pdata = mePartonData();
const map<long,Energy>& masses = reshuffleMasses();
lastMatchboxXComb()->reshuffle(reshuffled,pdata,masses);
}
double momenta[50];
size_t j=0;
for (size_t i=0;i<mePartonData().size();i++){
momenta[j]=abs(reshuffled[i].e()/GeV)<1.e-13?0.:double(reshuffled[i].e()/GeV);
momenta[j+1]=abs(reshuffled[i].x()/GeV)<1.e-13?0.:double(reshuffled[i].x()/GeV);
momenta[j+2]=abs(reshuffled[i].y()/GeV)<1.e-13?0.:double(reshuffled[i].y()/GeV);
momenta[j+3]=abs(reshuffled[i].z()/GeV)<1.e-13?0.:double(reshuffled[i].z()/GeV);
if(momenta[j ] == 0. && momenta[j+1] == 0. &&
momenta[j+2] == 0. && momenta[j+3] == 0. )
return 0.;
j+=4;
}
MG_Calculate_wavefunctions_born(&xx, &momenta[0], &heltmp[0]);
int ncol=-1;
MG_NCol(&xx,&ncol);
Complex res;
Complex resLN;
for( int it = 0; it < ncol; it++ ){
double dd[2];
MG_Jamp(&xx,&it,&dd[0]);
Complex d(dd[0],dd[1]);
if(it==ii)res=d*units;
lastMatchboxXComb()->pushheljamp(hel,d*units);
double ddLN[2];
MG_LNJamp(&xx,&it,&ddLN[0]);
Complex dLN(ddLN[0],ddLN[1]);
if(it==ii)resLN=dLN*units;
lastMatchboxXComb()->pushhelLNjamp(hel,dLN*units);
}
largeN = resLN;
return res;
}
vector<unsigned int> MadGraphAmplitude::physicalHelicities(const vector<int>& hel) const {
vector<unsigned int> res(hel.size(),0);
for ( size_t j = 0; j < hel.size(); ++j ) {
int cross = crossingMap()[j];
int xhel = 0;
if ( (cross > 1 && j <= 1) || (cross <= 1 && j > 1) )
xhel = -1*hel[j];
else
xhel = hel[j];
if ( mePartonData()[cross]->iSpin() == PDT::Spin1Half )
res[cross] = (xhel == -1 ? 0 : 1);
else if ( mePartonData()[cross]->iSpin() == PDT::Spin1 )
res[cross] = (unsigned int)(xhel + 1);
else if ( mePartonData()[cross]->iSpin() == PDT::Spin0 )
res[cross] = 0;
else assert(false);
}
return res;
}
LorentzVector<Complex> MadGraphAmplitude::plusPolarization(const Lorentz5Momentum& p,
const Lorentz5Momentum& n,
int i) const {
int tmp=i;
double pg[4],ng[4],poltmp[8];
pg[0]=p.e()/GeV;pg[1]=p.x()/GeV;pg[2]=p.y()/GeV;pg[3]=p.z()/GeV;
ng[0]=n.e()/GeV;ng[1]=n.x()/GeV;ng[2]=n.y()/GeV;ng[3]=n.z()/GeV;
MG_vxxxxx(&pg[0],&ng[0],&tmp,&poltmp[0]);
complex<double> pol[6];
pol[0]=Complex(poltmp[0],poltmp[1]);
pol[1]=Complex(poltmp[2],poltmp[3]);
pol[2]=Complex(poltmp[4],poltmp[5]);
pol[3]=Complex(poltmp[6],poltmp[7]);
LorentzVector<Complex> polarization(pol[1],pol[2],pol[3],pol[0]);
return polarization;
}
bool equalsModulo(unsigned int i, const vector<int>& a, const vector<int>& b) {
assert(a.size()==b.size());
if ( a[i] == b[i] )
return false;
for ( unsigned int k = 0; k < a.size(); ++k ) {
if ( k == i )
continue;
if ( a[k] != b[k] )
return false;
}
return true;
}
vector<size_t> MadGraphAmplitude::gluonsFirst(vector<size_t> vec) {
vector<size_t> vecout;
for(vector<size_t>::iterator it= vec.begin();it!= vec.end();++it)
if ( mePartonData()[crossingMap()[*it]]->id()==21)
vecout.push_back(crossingMap()[*it]);
for(vector<size_t>::iterator it= vec.begin();it!= vec.end();++it)
if ( mePartonData()[crossingMap()[*it]]->id()!=21)
vecout.push_back(crossingMap()[*it]);
return vecout;
}
double MadGraphAmplitude::spinColourCorrelatedME2(pair<int,int> ij,
const SpinCorrelationTensor& c) const {
vector<Lorentz5Momentum> reshuffled = meMomenta();
if ( !reshuffleMasses().empty() && reshuffled.size() > 3 ) {
const cPDVector& pdata = mePartonData();
const map<long,Energy>& masses = reshuffleMasses();
lastMatchboxXComb()->reshuffle(reshuffled,pdata,masses);
}
Lorentz5Momentum p = reshuffled[ij.first];
Lorentz5Momentum n = reshuffled[ij.second];
LorentzVector<Complex> polarization = plusPolarization(p,n,ij.first<2?-1:1);
int iCrossed = -1;
for ( unsigned int k = 0; k < crossingMap().size(); ++k )
if ( crossingMap()[k] == ij.first ) {
iCrossed = k;
break;
}
assert(iCrossed!=-1);
if(ij.first>1) polarization =polarization.conjugate();
if(iCrossed<2) polarization =polarization.conjugate();
Complex pFactor = (polarization*c.momentum())/sqrt(abs(c.scale()));
double avg =
colourCorrelatedME2(ij)*(-c.diagonal()+ (c.scale() > ZERO ? 1. : -1.)*norm(pFactor));
Complex csCorr = 0.0;
if ( calculateColourSpinCorrelator(ij) ) {
set<const CVector*> done;
for ( AmplitudeConstIterator a = lastAmplitudes().begin();
a != lastAmplitudes().end(); ++a ) {
if ( done.find(&(a->second)) != done.end() )
continue;
AmplitudeConstIterator b = lastAmplitudes().begin();
while ( !equalsModulo(iCrossed,a->first,b->first) )
if ( ++b == lastAmplitudes().end() )
break;
if ( b == lastAmplitudes().end() || done.find(&(b->second)) != done.end() )
continue;
done.insert(&(a->second)); done.insert(&(b->second));
if ( a->first[iCrossed] == 1 )
swap(a,b);
csCorr -= colourBasis()->colourCorrelatedInterference(ij,mePartonData(),a->second,b->second);
}
lastColourSpinCorrelator(ij,csCorr);
} else {
csCorr = lastColourSpinCorrelator(ij);
}
double corr =
2.*real(csCorr*sqr(pFactor));
double Nc = generator()->standardModel()->Nc();
double cfac = 1.;
if ( mePartonData()[ij.first]->iColour() == PDT::Colour8 ) {
cfac = Nc;
} else if ( mePartonData()[ij.first]->iColour() == PDT::Colour3 ||
mePartonData()[ij.first]->iColour() == PDT::Colour3bar ) {
cfac = (sqr(Nc)-1.)/(2.*Nc);
} else assert(false);
return
( avg +(c.scale() > ZERO ? 1. : -1.)*corr/cfac);
}
void MadGraphAmplitude::prepareOneLoopAmplitudes(Ptr<MatchboxMEBase>::tcptr ){
assert(false);
}
double MadGraphAmplitude::oneLoopInterference() const {
if ( !calculateOneLoopInterference() )
return lastOneLoopInterference();
evaloneLoopInterference();
return lastOneLoopInterference();
}
void MadGraphAmplitude::evaloneLoopInterference() const {
double units = pow(lastSHat()/GeV2,int(mePartonData().size())-4);
vector<Lorentz5Momentum> reshuffled = meMomenta();
if ( !reshuffleMasses().empty() && reshuffled.size() > 3 ) {
const cPDVector& pdata = mePartonData();
const map<long,Energy>& masses = reshuffleMasses();
lastMatchboxXComb()->reshuffle(reshuffled,pdata,masses);
}
double virt[20];
double momenta[50];
size_t j=0;
for (size_t i=0;i<mePartonData().size();i++){
momenta[j]=abs(reshuffled[i].e()/GeV)<1.e-13?0.:double(reshuffled[i].e()/GeV);
momenta[j+1]=abs(reshuffled[i].x()/GeV)<1.e-13?0.:double(reshuffled[i].x()/GeV);
momenta[j+2]=abs(reshuffled[i].y()/GeV)<1.e-13?0.:double(reshuffled[i].y()/GeV);
momenta[j+3]=abs(reshuffled[i].z()/GeV)<1.e-13?0.:double(reshuffled[i].z()/GeV);
j+=4;
}
int xx=lastMatchboxXComb()->externalId();
MG_Calculate_wavefunctions_virt(&xx,&momenta[0],&virt[0]);
double ifact = 1.;
ifact = 1./4.;
if (lastMatchboxXComb()->matchboxME()->mePartonData()[0]->iColour() == PDT::Colour3 ||
lastMatchboxXComb()->matchboxME()->mePartonData()[0]->iColour() == PDT::Colour3bar )
ifact /= SM().Nc();
else if ( lastMatchboxXComb()->matchboxME()->mePartonData()[0]->iColour() == PDT::Colour8 )
ifact /= (SM().Nc()*SM().Nc()-1.);
if ( lastMatchboxXComb()->matchboxME()->mePartonData()[1]->iColour() == PDT::Colour3 ||
lastMatchboxXComb()->matchboxME()->mePartonData()[1]->iColour() == PDT::Colour3bar )
ifact /= SM().Nc();
else if ( mePartonData()[1]->iColour() == PDT::Colour8 )
ifact /= (SM().Nc()*SM().Nc()-1.);
ifact *= lastMatchboxXComb()->matchboxME()->finalStateSymmetry();
lastOneLoopInterference(virt[1]/ifact*units);
lastOneLoopPoles(pair<double, double>(virt[2]/ifact*units,virt[3]/ifact*units));
}
void MadGraphAmplitude::persistentOutput(PersistentOStream & os) const {
os << theOrderInGs << theOrderInGem << BornAmplitudes << VirtAmplitudes
<< colourindex<<crossing << theProcessPath << theMGmodel << bindir_
<< pkgdatadir_ << madgraphPrefix_;
}
void MadGraphAmplitude::persistentInput(PersistentIStream & is, int) {
is >> theOrderInGs >> theOrderInGem >> BornAmplitudes >> VirtAmplitudes
>> colourindex>>crossing >> theProcessPath >> theMGmodel >> bindir_
>> pkgdatadir_ >> madgraphPrefix_;
}
void MadGraphAmplitude::setProcessPath(string p){
theProcessPath=p;
}
string MadGraphAmplitude::getProcessPath() const{
return theProcessPath;
}
void MadGraphAmplitude::setBinDir(string p){
bindir_=p;
}
string MadGraphAmplitude::getBinDir() const {
return bindir_;
}
void MadGraphAmplitude::setDataDir(string p){
pkgdatadir_=p;
}
string MadGraphAmplitude::getDataDir() const {
return pkgdatadir_;
}
void MadGraphAmplitude::setModel(string p) {
theMGmodel=p;
}
string MadGraphAmplitude::getModel() const {
return theMGmodel;
}
void MadGraphAmplitude::setMadgraphPrefix(string p) {
madgraphPrefix_=p;
}
string MadGraphAmplitude::getMadgraphPrefix() const {
return madgraphPrefix_;
}
// *** 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<MadGraphAmplitude,MatchboxAmplitude>
describeHerwigMadGraphAmplitude("Herwig::MadGraphAmplitude", "HwMatchboxMadGraph.so");
void MadGraphAmplitude::Init() {
static ClassDocumentation<MadGraphAmplitude>
documentation("MadGraphAmplitude",
"Matrix elements have been calculated using MadGraph5 \\cite{Alwall:2011uj}",
"%\\cite{Alwall:2011uj}\n"
"\\bibitem{Alwall:2011uj}\n"
"J. Alwall et al.,\n"
"``MadGraph 5 : Going Beyond,''\n"
"arXiv:1106.0522 [hep-ph].\n"
"%%CITATION = ARXIV:1106.0522;%%");
static Parameter<MadGraphAmplitude,string> interfaceProcessPath
("ProcessPath",
"The Process Path.",
0 , "",false, false,
&MadGraphAmplitude::setProcessPath,
&MadGraphAmplitude::getProcessPath);
static Parameter<MadGraphAmplitude,string> interfaceModel
("Model",
"The MadGraph-Model.",
0, "loop_sm",false, false,
&MadGraphAmplitude::setModel,
&MadGraphAmplitude::getModel);
static Switch<MadGraphAmplitude,bool> interfacekeepinputtopmass
("KeepInputTopMass",
"Switch On/Off formopt",
&MadGraphAmplitude::keepinputtopmass, false, false, false);
static SwitchOption interfacekeepinputtopmassYes
(interfacekeepinputtopmass,
"Yes",
"Yes",
true);
static SwitchOption interfacekeepinputtopmassNo
(interfacekeepinputtopmass,
"No",
"No",
false);
static Parameter<MadGraphAmplitude,string> interfaceMadgraphPrefix
("MadgraphPrefix",
"The prefix for the location of MadGraph",
0, string(MADGRAPH_PREFIX),
false, false,
&MadGraphAmplitude::setMadgraphPrefix,
&MadGraphAmplitude::getMadgraphPrefix);
/// JB: I don't know why these should be needed:
static Parameter<MadGraphAmplitude,string> interfaceBinDir
("BinDir",
"The location for the installed executable",
0, string(HERWIG_BINDIR),
false, false,
&MadGraphAmplitude::setBinDir,
&MadGraphAmplitude::getBinDir);
static Parameter<MadGraphAmplitude,string> interfacePKGDATADIR
("DataDir",
"The location for the installed Herwig data files",
0, string(HERWIG_PKGDATADIR),
false, false,
&MadGraphAmplitude::setDataDir,
&MadGraphAmplitude::getDataDir);
}
diff --git a/MatrixElement/Matchbox/External/MadGraph/Makefile.am b/MatrixElement/Matchbox/External/MadGraph/Makefile.am
--- a/MatrixElement/Matchbox/External/MadGraph/Makefile.am
+++ b/MatrixElement/Matchbox/External/MadGraph/Makefile.am
@@ -1,22 +1,14 @@
EXTRA_DIST = \
MadGraphAmplitude.h \
-MadGraphAmplitude.cc \
-mg2herwig.py
-
+MadGraphAmplitude.cc
madgraphdir = ${pkgdatadir}/MadGraphInterface
INPUTFILES = \
InterfaceMadGraph.f.in \
param_card.dat.in \
param_card_heft.dat.in
dist_madgraph_DATA = $(INPUTFILES)
-
-
-install-exec-local:
- $(install_sh_SCRIPT) $(builddir)/mg2herwig.py $(DESTDIR)$(bindir)/mg2herwig
-
-uninstall-local:
- rm -f $(DESTDIR)$(bindir)/mg2herwig
+bin_SCRIPTS = mg2herwig
diff --git a/MatrixElement/Matchbox/External/MadGraph/mg2herwig.py.in b/MatrixElement/Matchbox/External/MadGraph/mg2herwig.in
rename from MatrixElement/Matchbox/External/MadGraph/mg2herwig.py.in
rename to MatrixElement/Matchbox/External/MadGraph/mg2herwig.in
--- a/MatrixElement/Matchbox/External/MadGraph/mg2herwig.py.in
+++ b/MatrixElement/Matchbox/External/MadGraph/mg2herwig.in
@@ -1,395 +1,365 @@
#! /usr/bin/env python
-import os,sys,glob,errno,shutil,time,fnmatch #argparse
+import os,sys,glob,errno,shutil,time,fnmatch,tempfile
from optparse import OptionParser
-# helper to replace all sourceText in fileName with replaceText
-def replacetext(fileName, sourceText, replaceText):
- file = open(fileName, "r")
- text = file.read()
- file.close()
- file = open(fileName, "w")
- file.write(text.replace(sourceText, replaceText))
- file.close()
+def mkdir_p(path):
+ """Recursive mkdir"""
+ if not os.path.isdir(path):
+ os.makedirs(path)
-# helper to build recursivly path
-def mkdir_p(path):
- try:
- os.makedirs(path)
- except OSError as exc: # Python >2.5
- if exc.errno == errno.EEXIST and os.path.isdir(path):
- pass
- else: raise
-
-# helper to find all files of with name in path
-def find(name, path):
- for root, dirs, files in os.walk(path):
- if name in files:
- return os.path.join(root, name)
-
-# helper to find all file paths which contain file names matching filepattern
-def finddirs(filepattern, path):
- founddirs = []
- for root, dirs, files in os.walk(path):
- if fnmatch.filter(files, filepattern):
- founddirs.append(root)
- return founddirs
+def finddirs(pattern, path):
+ """Find all paths which contain a filename matching 'pattern'"""
+ result = [
+ root
+ for root, _, files in os.walk(path)
+ if fnmatch.filter(files, pattern)
+ ]
+ return result
# fill the proc.dat file from BornAmplitudes.dat and VirtAmplitudes.dat.
def fillprocs(model,oras,orew):
- bornlist=[]
- virtlist=[]
- fileproc=open("proc.dat","w")
- fileproc.write("set fortran_compiler @FC@ --no_save\n")
- fileproc.write("import model "+model+"\n")
- borns="BornAmplitudes.dat"
- virts="VirtAmplitudes.dat"
- first=True
- procnr=0
- virtlines=""
- bornlines=""
+ """Fill proc.dat from BornAmplitudes.dat and VirtAmplitudes.dat"""
+ oras=int(oras)
+ orew=int(orew)
+
+ bornlist=[]
+ virtlist=[]
+ result = []
+ result.append('set fortran_compiler @FC@ --no_save')
+ result.append("import model "+model)
+ borns="BornAmplitudes.dat"
+ virts="VirtAmplitudes.dat"
+ procnr=0
+ virtlines=[]
+ bornlines=[]
-
+ # first pass to work out leg numbers
+ minlegs=100
+ legs=0
+ for i in [borns, virts]:
+ with open(i, "r") as f:
+ for line in f:
+ line = line.split(" ")
+ N = len(line)
+ if N < minlegs:
+ minlegs = N
+ for it in line:
+ if it.replace("-","").isdigit():
+ legs += 1
- minlegs=100
- legs=0
- for i in [borns, virts]:
- file = open(i, "r")
- for line in file:
- if (len(line.split(" "))<minlegs):
- minlegs=len(line.split(" "))
- for it in line.split(" "):
- if it.replace("-","").isdigit():
- legs+=1
-
- file.close()
+ #conversion for heft model to go from (2QCD+1QED)->1HIG for each FS HIGGS.
+ if model=="heft":
+ HIG = oras+orew-legs+2
+ if HIG % 2 == 0:
+ HIG = HIG//2
+ else:
+ sys.stderr.write("Warning: No possible coupling power:(int(oras)+int(orew)-legs+2)%2!=0\n")
+ exit(1)
+ else:
+ HIG = 0
-
-
- #conversion for heft model to go from (2QCD+1QED)->1HIG for each FS HIGGS.
- HIG=0
- if (model=="heft"):
- HIG=(int(oras)+int(orew)-legs+2)/2
-
- if (int(oras)+int(orew)-legs+2)%2!=0:
- print "Warning: No possible coupling power:(int(oras)+int(orew)-legs+2)%2!=0 "
- exit()
- return
+ with open(borns, "r") as f:
+ for i, line in enumerate(f):
+ #this assumes extra QCD emmissions
+ addalphas = len(line.split(" ")) - minlegs
+ line = line.rstrip()
+ procnr += 1
+ bornlist.append(str(procnr))
+ cmd = "generate " if i==0 else "add process"
+ hig = ""
+ qcd = oras+addalphas
+ qed = orew
+ if HIG:
+ hig = "HIG=%s" % HIG
+ qcd -= 2*HIG
+ qed -= HIG
+ bornlines.append("{cmd} {line} {hig} QCD<={qcd} QED<={qed} @{procnr}".format(**locals()))
-
-
-
-
- file = open(borns, "r")
- for line in file:
- #this assumes extra QCD emmissions
- addalphas=len(line.split(" "))-minlegs
- linetmp=line.rstrip()
- procnr+=1
- bornlist+=[str(procnr)]
- if first:
- if HIG ==0 :
- bornlines+="generate "+linetmp+" QCD="+str(int(oras)+addalphas)+" QED="+str(orew)+" @"+str(procnr)+"\n"
- else:
- bornlines+="generate "+linetmp+" HIG="+str(HIG)+" QCD="+str(int(oras)+addalphas-2*HIG)+" QED="+str(int(orew)-HIG)+" @"+str(procnr)+"\n"
- first=False
- else:
- if HIG ==0 :
- bornlines+="add process "+linetmp+" QCD="+str(int(oras)+addalphas)+" QED="+str(orew)+" @"+str(procnr)+"\n"
- else:
- bornlines+="add process "+linetmp+" HIG="+str(HIG)+" QCD="+str(int(oras)+addalphas-2*HIG)+" QED="+str(int(orew)-HIG)+" @"+str(procnr)+"\n"
-
- file.close()
- first=True
- file = open(virts, "r")
- for line in file:
- addalphas=len(line.split(" "))-minlegs
- linetmp=line.rstrip()+" QCD="+str(int(oras)+addalphas)+" QED="+str(int(orew))+" [ virt=QCD ]"
- procnr+=1
- virtlist+=[str(procnr)]
- if first:
- virtlines+="generate "+linetmp+" @"+str(procnr)+"\n"
- first=False
- else:
- virtlines+="add process "+linetmp+" @"+str(procnr)+"\n"
- file.close()
+ result.extend(bornlines)
- fileproc.write(bornlines)
- if virtlines!="" and bornlines!="":
- fileproc.write("output matchbox MG5 --postpone_model\n")
- fileproc.write(virtlines)
- fileproc.write("output matchbox MG5 -f\n")
- fileproc.close()
- return bornlist,virtlist
+ with open(virts, "r") as f:
+ for i, line in enumerate(f):
+ addalphas = len(line.split(" ")) - minlegs
+ line = line.rstrip()
+ procnr += 1
+ virtlist.append(str(procnr))
+ cmd = "generate " if i==0 else "add process"
+ qcd = oras+addalphas
+ qed = orew
+ virtlines.append("{cmd} {line} QCD<={qcd} QED<={qed} [ virt=QCD ] @{procnr}".format(**locals()))
+
+ if virtlines and bornlines:
+ result.append("output matchbox MG5 --postpone_model")
+
+ result.extend(virtlines)
+
+ result.append("output matchbox MG5 -f\n")
+
+ with open("proc.dat","w") as f:
+ f.write('\n'.join(result))
+
+ return bornlist,virtlist
+
+
+
def build_matchbox_tmp(pwd,buildpath,absolute_links):
- cwd=os.getcwd()
- os.chdir(pwd)
- mkdir_p(pwd+"/Herwig-scratch/MG_tmp/")
- if not buildpath.startswith("/"):
- buildpath=pwd+"/"+buildpath.lstrip("./")
- if not buildpath.endswith("/"):
- buildpath=buildpath + "/"
- resources=glob.glob(buildpath +"MG5/SubProcesses/MadLoop5_resources/*")
- resources+=glob.glob(buildpath +"MG5/Cards/*")
- resources+=glob.glob(buildpath +"MG5/Cards/SubProcesses/*")
- for i in resources:
- if not os.path.isfile( pwd+"/Herwig-scratch/MG_tmp/"+os.path.basename(i)) \
- and not os.path.islink( pwd+"/Herwig-scratch/MG_tmp/"+os.path.basename(i)):
- if not absolute_links:
- source=os.path.dirname(i)
- dest=pwd+"/Herwig-scratch/MG_tmp/"
- os.chdir(dest)
- os.symlink(os.path.relpath(source,dest)+"/"+os.path.basename(i),"./" + os.path.basename(i))
- else:
- os.symlink(i, pwd+"/Herwig-scratch/MG_tmp/"+os.path.basename(i))
- os.chdir(cwd)
+ """Create the working directories and link the required files from central MG"""
+ pwd = os.path.abspath(pwd)
+
+ if not os.path.isabs(buildpath):
+ buildpath = os.path.join(pwd,buildpath)
+
+ resources =glob.glob(os.path.join(buildpath,"MG5","SubProcesses","MadLoop5_resources","*"))
+ resources+=glob.glob(os.path.join(buildpath,"MG5","Cards","*"))
+ resources+=glob.glob(os.path.join(buildpath,"MG5","Cards","SubProcesses","*"))
+
+ for i in resources:
+ f = os.path.join(MG_TMP, os.path.basename(i))
+ if not os.path.isfile(f) and not os.path.islink(f):
+ if absolute_links:
+ os.symlink(i,f)
+ else:
+ os.symlink(os.path.relpath(i,MG_TMP), f)
+
+
+
parser = OptionParser()
parser.add_option("-a", "--buildpath", dest="buildpath",help="Do not use this script. Only for Herwig internal use. ")
parser.add_option("-b", "--build", action="store_true", dest="build", default=True,help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-c", "--madgraph", dest="madgraph",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-d", "--runpath", dest="runpath",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-e", "--model", dest="model",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-f", "--orderas", dest="orderas",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-g", "--orderew", dest="orderew",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-i", "--datadir",dest="datadir",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-I", "--includedir",dest="includedir",help="Do not use this script. Only for Herwig internal use.")
parser.add_option("-l", "--absolute-links",action="store_true", dest="absolute_links", default=False,\
help="Do not use this script. Only for Herwig internal use.")
-
+parser.add_option("--cacheprefix", dest="cacheprefix",help="Do not use this script. Only for Herwig internal use.")
(options, args) = parser.parse_args()
+if not options.cacheprefix:
+ sys.stderr.write("Need a value for --cacheprefix\n")
+ exit(1)
+cachedir = os.path.abspath(options.cacheprefix)
+mkdir_p(cachedir)
-#parser = argparse.ArgumentParser()
-#parser.add_argument('--buildpath', help='installpath')
-#parser.add_argument('--build', help='build', action="store_true")
-#parser.add_argument('--madgraph', help='madgraph_installpath')
-#parser.add_argument('--runpath', help='runpath')
-#parser.add_argument('--model', help='model')
-#parser.add_argument('--orderas', help='orderas')
-#parser.add_argument('--orderew', help='orderew')
-#parser.add_argument('--datadir', help='datadir')
-#args = parser.parse_args()
-
-
-
-
-
+#MG_TMP = tempfile.mkdtemp(prefix='MG_tmp_',dir=cachedir)
+MG_TMP = os.path.join(cachedir, 'MG_tmp')
+mkdir_p(MG_TMP)
pwd=os.getcwd()
-
param_card=""
-mkdir_p(pwd+"/Herwig-scratch/MG_tmp/")
if options.model=="loop_sm" or options.model=="heft":
if options.model=="loop_sm":
param_card="param_card.dat"
else:
param_card="param_card_"+options.model+".dat"
file = open("%s/MadGraphInterface/%s.in" % (options.datadir,param_card) , "r")
paramcard = file.read()
file.close()
file = open(options.runpath+"/"+param_card, "w")
params=open(options.runpath+"/MG-Parameter.dat", "r")
for line in params:
a=line.split()
paramcard=paramcard.replace(a[0],a[1])
params.close()
file.write(paramcard)
file.close()
elif options.model.startswith("/"):
os.system("python %s/write_param_card.py " % options.model)
else:
print "---------------------------------------------------------------"
print "---------------------------------------------------------------"
print "Warning: The model set for the MadGraph Interface "
print " needs a parameter setting by hand."
print " Please fill the param_card_"+options.model+".dat"
print " with your favourite assumptions."
print " And make sure Herwig uses the same parameters."
print "---------------------------------------------------------------"
print "---------------------------------------------------------------"
if os.path.isfile(options.buildpath +"/MG5/Cards/param_card.dat") and not os.path.isfile(options.runpath+"/"+"param_card_"+options.model+".dat"):
shutil.copyfile(options.buildpath +"/MG5/Cards/param_card.dat", options.runpath+"/"+"param_card_"+options.model+".dat")
time.sleep(1)
if not os.path.isdir(options.buildpath):
- print "The MadGraph Install path was not existend. It has been created for you."
+ print "The MadGraph Install path did not exist. It has been created for you."
print "Just start Herwig read again.."
mkdir_p(options.buildpath)
exit()
os.chdir(options.buildpath)
if os.path.isfile("InterfaceMadGraph.so"):
build_matchbox_tmp(pwd,options.buildpath,options.absolute_links)
exit()
Bornlist,Virtlist=fillprocs(options.model,options.orderas,options.orderew)
if not options.madgraph and not os.path.isfile("InterfaceMadGraph.so"):
- print "*** warning *** MadGraph build failed, check logfile for details"
- print "Known issue: If this is your first NLO calculation with pure Madgraph Amplitudes"
- print " the CutTools compilation can result in a non usable configuration."
- print " Please open $HERWIG_ENV/opt/madgraph/vendor/CutTools/makefile"
- print " and add a \\ after FC=gfortran... in the ARGS variable."
- print " Then run make clean && make in the CutTools folder. "
- exit()
+ sys.stderr.write("*** MadGraph build failed, check logfile for details ***")
+ exit(1)
os.system("python "+options.madgraph+"/mg5_aMC proc.dat")
-routines=[["","BORN(momenta,hel)"],
- ["","SLOOPMATRIX(momenta,virt)"],
- ["","GET_JAMP(color,Jamp)"],
- ["","GET_LNJAMP(color,Jamp)"],
- ["","GET_NCOL(color)"],
- ["","GET_NCOLOR(i,j,color)"]]
-for routine in routines:
- for i in Bornlist + list(set(Virtlist) - set(Bornlist)):
- if routine[1]=="Virt(amp)" or routine[1]=="SLOOPMATRIX(momenta,virt)" and i not in Virtlist:
- continue
- if routine[0]=="":
- routine[0]+=" SELECT CASE (proc) \n"
- routine[0]+=" CASE("+i+") \n CALL "
- routine[0]+= "MG5_"+i+"_"+routine[1]+"\n"
+
+def make_case_stmts(func):
+ """Create Fortran case statements for all processes"""
+ result = []
+ # add a case option for each item
+ for i in Bornlist + list(set(Virtlist) - set(Bornlist)):
+ if func == "SLOOPMATRIX(momenta,virt)" and i not in Virtlist:
+ continue
+ result.append(" CASE(%s)" % i)
+ result.append(" CALL MG5_%s_%s" % (i,func))
+
+ # if we have anything, add header and footer
+ if result:
+ result.insert(0,
+ " SELECT CASE (proc)")
+ result.append(" CASE DEFAULT")
+ result.append(" WRITE(*,*) '##W02A WARNING No id found '")
+ result.append(" END SELECT ")
+ return "\n".join(result)
else:
- routine[0]+=" CASE("+i+") \n"\
- " CALL "
- routine[0]+= "MG5_"+i+"_"+routine[1]+"\n"
- if routine[0]!="":
- routine[0]+=" CASE DEFAULT\n"
- routine[0]+=" WRITE(*,*) '##W02A WARNING No id found '\n"
- routine[0]+=" END SELECT \n"
-
-shutil.copyfile("%s/MadGraphInterface/InterfaceMadGraph.f.in" % options.datadir, "InterfaceMadGraph.f")
+ return ""
-replacetext("InterfaceMadGraph.f","MG_CalculateBORNtxt",routines[0][0])
-replacetext("InterfaceMadGraph.f","MG_CalculateVIRTtxt",routines[1][0])
-replacetext("InterfaceMadGraph.f","MG_Jamptxt", routines[2][0])
-replacetext("InterfaceMadGraph.f","MG_LNJamptxt", routines[3][0])
-replacetext("InterfaceMadGraph.f","MG_NColtxt", routines[4][0])
-replacetext("InterfaceMadGraph.f","MG_ColourMattxt",routines[5][0])
+def write_interfaceMG():
+ """Create the InterfaceMadGraph.f FORTRAN file"""
+ subs = {
+ "MG_CalculateBORNtxt" : make_case_stmts("BORN(momenta,hel)"),
+ "MG_CalculateVIRTtxt" : make_case_stmts("SLOOPMATRIX(momenta,virt)"),
+ "MG_Jamptxt" : make_case_stmts("GET_JAMP(color,Jamp)"),
+ "MG_LNJamptxt" : make_case_stmts("GET_LNJAMP(color,Jamp)"),
+ "MG_NColtxt" : make_case_stmts("GET_NCOL(color)"),
+ "MG_ColourMattxt" : make_case_stmts("GET_NCOLOR(i,j,color)"),
+ }
-MG_vxxxxxtxt=""
-if routines[1][0]!="":
- MG_vxxxxxtxt=""" subroutine MG_vxxxxx(p, n,inc,VC)
- $ bind(c, name='MG_vxxxxx')
- IMPLICIT NONE
- double precision p(0:3)
- double precision n(0:3)
- INTEGER inc
- double precision VC(0:7)
- double complex VCtmp(8)
- call vxxxxx(p, 0d0,1,inc ,VCtmp)
- VC(0)= real(VCtmp(5))
- VC(1)=aimag(VCtmp(5))
- VC(2)= real(VCtmp(6))
- VC(3)=aimag(VCtmp(6))
- VC(4)= real(VCtmp(7))
- VC(5)=aimag(VCtmp(7))
- VC(6)= real(VCtmp(8))
- VC(7)=aimag(VCtmp(8))
- END"""
-else:
- MG_vxxxxxtxt=""" subroutine MG_vxxxxx(p, n,inc,VC)
- $ bind(c, name='MG_vxxxxx')
- IMPLICIT NONE
- double precision p(0:3)
- double precision n(0:3)
- INTEGER inc
- double precision VC(0:7)
- double complex VCtmp(6)
- call vxxxxx(p, 0d0,1,inc ,VCtmp)
- VC(0)= real(VCtmp(3))
- VC(1)=aimag(VCtmp(3))
- VC(2)= real(VCtmp(4))
- VC(3)=aimag(VCtmp(4))
- VC(4)= real(VCtmp(5))
- VC(5)=aimag(VCtmp(5))
- VC(6)= real(VCtmp(6))
- VC(7)=aimag(VCtmp(6))
- END"""
-replacetext("InterfaceMadGraph.f","MG_vxxxxxtxt",MG_vxxxxxtxt)
+ baseN = 5 if subs["MG_CalculateVIRTtxt"] else 3
+ subs["MG_vxxxxxtxt"] = """\
+ subroutine MG_vxxxxx(p, n,inc,VC)
+ $ bind(c, name='MG_vxxxxx')
+ IMPLICIT NONE
+ double precision p(0:3)
+ double precision n(0:3)
+ INTEGER inc
+ double precision VC(0:7)
+ double complex VCtmp({d})
+ call vxxxxx(p, 0d0,1,inc ,VCtmp)
+ VC(0)= real(VCtmp({a}))
+ VC(1)=aimag(VCtmp({a}))
+ VC(2)= real(VCtmp({b}))
+ VC(3)=aimag(VCtmp({b}))
+ VC(4)= real(VCtmp({c}))
+ VC(5)=aimag(VCtmp({c}))
+ VC(6)= real(VCtmp({d}))
+ VC(7)=aimag(VCtmp({d}))
+ END
+ """.format(a=baseN, b=baseN+1, c=baseN+2, d=baseN+3)
+
+ fname = os.path.join(
+ options.datadir,
+ "MadGraphInterface",
+ "InterfaceMadGraph.f.in"
+ )
+ with open(fname, 'r') as f:
+ tmp = f.read()
+ with open("InterfaceMadGraph.f", 'w') as f:
+ f.write(tmp.format(**subs))
+
+write_interfaceMG()
make=" "
fortanfiles=glob.glob('*/*/*.f')+glob.glob('*/*/*/*.f')
for i in fortanfiles:
if "check_sa" not in i and "f2py_wrapper" not in i:
if not os.path.islink(i):
make += " "+i+"\\\n "
incfiles=glob.glob('*/*/*.inc')+glob.glob('*/*/*/*.inc')
coefdir=""
for i in incfiles:
if "nexternal.inc" in i:
coefdir+=" -I"+i.replace("nexternal.inc"," ")
file=open("makefile","w")
file.write("include MG5/Source/make_opts ")
if Virtlist!=[]:
file.write("\nLIBDIR = MG5/lib\nLINKLIBS = -L$(LIBDIR) -lcts -liregi -L$(LIBDIR)/golem95_lib -lgolem")
file.write("\nLIBS = $(LIBDIR)libcts.$(libext) $(LIBDIR)libgolem.$(libext) $(LIBDIR)libiregi.$(libext)")
-file.write("\nPROCESS= InterfaceMadGraph.f "+make+"\n\nall: \n\t @FC@ @FFLAGS@ -w -fbounds-check -ffixed-line-length-132 -fPIC -fno-f2c -shared -s -o InterfaceMadGraph.so -IMG5/SubProcesses/" )
+file.write("\nPROCESS= InterfaceMadGraph.f "+make+"\n\nall: \n\t @FC@ @FFLAGS@ -w -fbounds-check -ffixed-line-length-none -fPIC -fno-f2c -shared -s -o InterfaceMadGraph.so -IMG5/SubProcesses/" )
if Virtlist!=[]:
file.write(" -IMG5/lib/golem95_include ")
# Find all .mod files also in /usr/include if golem was build there.
# There can be an error message in the MadGraph output to add the golem include path to the makefiles.
# Usually MadGraph finds the path if its Golem was build in an separate dictionary.
# Our bootstrap script installs golem with gosam beside boost. Here MadGraph creates a link (->errormessage).
# If we can find the modfiles easily the user doesn't need to change the makefiles.
moddirs=finddirs('*.mod',options.includedir)
for moddir in moddirs:
file.write(" -I%s " % moddir)
if os.path.isdir("/usr/include"):
moddirs=finddirs('*.mod',"/usr/include")
for moddir in moddirs:
file.write(" -I%s " % moddir)
if coefdir != "":
file.write(coefdir)
file.write(" $(PROCESS) $(LINKLIBS) ")
file.close()
+def replacetext(filename, sourceText, replaceText):
+ """Replace text in existing file."""
+ with open(filename, "r") as f:
+ text = f.read()
+ with open(filename, "w") as f:
+ f.write(text.replace(sourceText, replaceText))
+
os.chdir(pwd)
os.chdir(options.buildpath)
-replacetext("MG5/Source/MODEL/lha_read.f", "ident_card.dat","Herwig-scratch/MG_tmp/ident_card.dat")
-replacetext("MG5/Source/MODEL/lha_read.f", "param.log","Herwig-scratch/MG_tmp/param.log")
-if Virtlist!=[]:
- replacetext("MG5/SubProcesses/MadLoopCommons.f", "PREFIX='./'","PREFIX='./Herwig-scratch/MG_tmp/'")
+replacetext("MG5/Source/MODEL/lha_read.f", "ident_card.dat", os.path.join(MG_TMP,"ident_card.dat"))
+replacetext("MG5/Source/MODEL/lha_read.f", "param.log", os.path.join(MG_TMP,"param.log"))
+if Virtlist:
+ replacetext("MG5/SubProcesses/MadLoopCommons.f",
+ "PREFIX='./'",
+ "PREFIX='%s'" % MG_TMP)
os.system("make")
if not os.path.isfile("InterfaceMadGraph.so"):
print "Second trial to make MadGraph Interface. "
print "Needed if new .mod files are produced by make."
os.system("make")
build_matchbox_tmp(pwd,options.buildpath,options.absolute_links)
diff --git a/Sampling/herwig-mergegrids.py b/Sampling/herwig-mergegrids.py
--- a/Sampling/herwig-mergegrids.py
+++ b/Sampling/herwig-mergegrids.py
@@ -1,70 +1,75 @@
#! /usr/bin/env python
import os
import sys
import glob
"""\
%prog [--setupfile=FILE] [--tag=TAG] RUNNAME
Combine Herwig grid files
"""
if __name__ == '__main__':
from optparse import OptionParser
parser = OptionParser(usage=__doc__)
parser.add_option('-x', '--setupfile', type='string',
help='Specify the setup file which has been used.',
default='',
dest='setupFile')
parser.add_option('-t', '--tag', type='string',
help='Specify the tag name which has been used.',
default='',
dest='tagName')
+ parser.add_option('-c', '--cachedir', type='string',
+ help='Specify the cache directory which has been used.',
+ default='Herwig-cache',
+ dest='cacheDir')
+
opts, args = parser.parse_args()
if len(args) < 1:
sys.stderr.write('Please specify a run name\n')
sys.exit(1)
runName=args[0]
if runName.endswith('.run'):
runName = runName[:-4]
setupName=opts.setupFile
tagName=opts.tagName
if setupName:
runName = runName + '/' + setupName
if tagName:
runName = runName + '/' + tagName
- gridId = 'Herwig-scratch/' + runName
+ gridId = os.path.join(opts.cacheDir,runName)
# print 'Looking in ' + gridId
gridFiles=sorted(glob.glob(gridId + '/integrationJob*/HerwigGrids.xml'))
if not gridFiles:
sys.stderr.write('No grid files have been found to combine\n')
sys.exit(1)
# print gridFiles
gridCombined = open(gridId + '/HerwigGrids.xml','w')
gridCombined.write('<Grids>\n')
for gridFile in gridFiles:
grid = open(gridFile,'r')
print(gridFile)
gridContent = grid.read()
gridContent = gridContent.replace('<Grids>\n','')
gridContent = gridContent.replace('</Grids>\n','')
gridCombined.write(gridContent)
grid.close()
gridCombined.write('</Grids>\n')
diff --git a/Tests/Makefile.am b/Tests/Makefile.am
--- a/Tests/Makefile.am
+++ b/Tests/Makefile.am
@@ -1,402 +1,400 @@
AM_LDFLAGS += -module -avoid-version -rpath /dummy/path/not/used
EXTRA_DIST = Inputs python Rivet
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 -i $(top_builddir)/src
HWBUILD = $(HERWIG) build --repo $(REPO) -L $(builddir)/.libs -i $(top_builddir)/src
HWINTEGRATE = $(HERWIG) integrate
HWRUN = $(HERWIG) run -N $${NUMEVENTS:-10000}
tests : tests-LEP tests-DIS tests-LHC tests-Gamma
LEPDEPS = \
test-LEP-VV \
test-LEP-VH \
test-LEP-VBF \
test-LEP-BB \
test-LEP-Quarks \
test-LEP-Leptons
if WANT_LIBFASTJET
LEPDEPS += test-LEP-TopDecay
endif
tests-LEP : $(LEPDEPS)
tests-DIS : test-DIS-Charged test-DIS-Neutral
LHCDEPS = \
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
if WANT_LIBFASTJET
LHCDEPS += \
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
endif
tests-LHC : $(LHCDEPS)
tests-Gamma : test-Gamma-FF test-Gamma-WW test-Gamma-P
LEPLIBS = LeptonTest.la
HADLIBS = HadronTest.la
if WANT_LIBFASTJET
LEPLIBS += LeptonJetTest.la
HADLIBS += HadronJetTest.la
endif
test-LEP-% : Inputs/LEP-%.in $(LEPLIBS)
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<))
test-Gamma-% : Inputs/Gamma-%.in GammaTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<))
test-DIS-% : Inputs/DIS-%.in DISTest.la
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<))
test-LHC-% : Inputs/LHC-%.in GammaTest.la $(HADLIBS)
$(HWREAD) $<
$(HWRUN) $(notdir $(subst .in,.run,$<))
tests-Rivet : Rivet-LEP Rivet-BFactory Rivet-DIS Rivet-Star Rivet-SppS \
Rivet-TVT-WZ Rivet-TVT-Photon Rivet-TVT-Jets \
Rivet-LHC-Jets Rivet-LHC-EW Rivet-LHC-Photon Rivet-LHC-Higgs
Rivet-%.run : Rivet/%.in
- $(HWBUILD) $<
+ $(HWBUILD) -c .cache/$(subst .run,,$@) $<
-Herwig-scratch/Rivet-%/HerwigGrids.xml : Rivet-%.run
- $(HWINTEGRATE) $<
+Rivet-Matchbox-%.yoda : Rivet-Matchbox-%.run
+ $(HWINTEGRATE) -c .cache/$(subst .run,,$<) $<
+ $(HWRUN) -c .cache/$(subst .run,,$<) $<
Rivet-%.yoda : Rivet-%.run
$(HWRUN) $<
-Rivet-Matchbox-%.yoda : Rivet-Matchbox-%.run Herwig-scratch/Rivet-Matchbox-%/HerwigGrids.xml
- $(HWRUN) $<
-
Rivet/%.in :
python/make_input_files.py $(notdir $(subst .in,,$@))
Rivet-inputfiles: $(shell echo Rivet/LEP{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{9.4,12,13,17,27.6,29,30.2,30.7,30.75,30,31.3,34.8,43.6,50,52,55,56,57,60.8,60,61.4,10,12.8,22,26.8,35,44,48.0,91,93.0,130,133,136,161,172,177,183,189,192,196,197,200,202,206,91-nopi}.in) \
$(shell echo Rivet/LEP{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Powheg,-Matchbox-Powheg}-14.in) \
$(shell echo Rivet/LEP{,-Dipole}-{10.5,11.96,12.8,13.96,16.86,21.84,26.8,28.48,35.44,48.0,97.0}-gg.in) \
$(shell echo Rivet/BFactory{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg}-{10.52,10.52-sym,10.54,10.45}.in) \
$(shell echo Rivet/BFactory{,-Dipole}-{Upsilon,Upsilon2,Upsilon4,Tau,10.58-res}.in) \
$(shell echo Rivet/DIS{,-NoME,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{e--LowQ2,e+-LowQ2,e+-HighQ2}.in) \
$(shell echo Rivet/TVT{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{Run-I-Z,Run-I-W,Run-I-WZ,Run-II-Z-e,Run-II-Z-{,LowMass-,HighMass-}mu,Run-II-W}.in) \
$(shell echo Rivet/TVT{,-Dipole}-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet,PromptPhoton}.in) \
$(shell echo Rivet/TVT-Powheg-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.in) \
$(shell echo Rivet/TVT{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{Run-II-Jets-{0..11},Run-I-Jets-{1..8}}.in ) \
$(shell echo Rivet/TVT{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{630-Jets-{1..3},300-Jets-1,900-Jets-1}.in ) \
$(shell echo Rivet/TVT{,-Dipole}-{Run-I,Run-II,300,630,900}-UE.in) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-DiJets-{1..7}-{A,B,C}.in ) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{7,8,13}-Jets-{0..10}.in ) \
$(shell echo Rivet/LHC{,-Dipole}-{900,2360,2760,7,8,13}-UE.in ) \
$(shell echo Rivet/LHC{,-Dipole}-{900,7,13}-UE-Long.in ) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Charm-{1..5}.in) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Bottom-{0..8}.in) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Top-{L,SL}.in) \
$(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{7,8,13}-Top-All.in) \
$(shell echo Rivet/Star{,-Dipole}-{UE,Jets-{1..4}}.in ) \
$(shell echo Rivet/SppS{,-Dipole}-{200,500,900,546}-UE.in ) \
$(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{W-{e,mu},13-Z-{e,mu},Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},Z-{e,mu,mu-SOPHTY},Z-LowMass-{e,mu},Z-MedMass-e,WZ,WW-{emu,ll},ZZ-{ll,lv},8-ZZ-lv,8-WW-ll,W-Z-{e,mu}}.in) \
$(shell echo Rivet/LHC{,-Dipole}-7-{W,Z}Gamma-{e,mu}.in) \
$(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{7-W-Jet-{1..3}-e,7-Z-Jet-{0..3}-e,7-Z-Jet-0-mu}.in) \
$(shell echo Rivet/LHC{-Matchbox,-Matchbox-Powheg,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{Z-b,Z-bb,W-b,8-Z-jj}.in) \
$(shell echo Rivet/LHC{,-Dipole}-{7,8}-PromptPhoton-{1..4}.in) Rivet/LHC-GammaGamma-7.in \
$(shell echo Rivet/LHC{,-Powheg}-{7,8}-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.in) \
$(shell echo Rivet/LHC{,-Powheg,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{ggH,VBF,WH,ZH}.in) \
$(shell echo Rivet/LHC{,-Powheg,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-8-{{ggH,VBF,WH,ZH}{,-GammaGamma},ggH-WW}.in) \
$(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-ggHJet.in)
# $(shell echo Rivet/ISR-{30,44,53,62}-UE.in ) $(shell echo Rivet/SppS-{53,63}-UE.in )
Rivet-LEP : Rivet-LEP/done
touch $@
Rivet-LEP/done : $(shell echo Rivet{,-Powheg,-Matchbox,-Dipole}-LEP-{9.4,12,13,17,27.6,29,30.2,30.7,30.75,30,31.3,34.8,43.6,50,52,55,56,57,60.8,60,61.4,10,12.8,22,26.8,35,44,48.0,91,93.0,130,133,136,161,172,177,183,189,192,196,197,200,202,206,91-nopi}.yoda) \
$(shell echo Rivet-LEP-{10.5,11.96,12.8,13.96,16.86,21.84,26.8,28.48,35.44,48.0,97.0}-gg.yoda) \
$(shell echo Rivet{,-Powheg,-Matchbox,-Matchbox-Powheg,-Dipole}-LEP-14.yoda)
rm -rf Rivet-LEP
python/merge-LEP --with-gg LEP
python/merge-LEP Powheg-LEP
python/merge-LEP Matchbox-LEP
python/merge-LEP Dipole-LEP
rivet-mkhtml -o Rivet-LEP LEP.yoda:Hw Powheg-LEP.yoda:Hw-Powheg Matchbox-LEP.yoda:Hw-Matchbox Dipole-LEP.yoda:Hw-Dipole
touch $@
Rivet-BFactory : Rivet-BFactory/done
touch $@
Rivet-BFactory/done: $(shell echo Rivet{,-Powheg,-Matchbox,-Dipole}-BFactory-{10.52,10.52-sym,10.54,10.45}.yoda) \
$(shell echo Rivet-BFactory-{Upsilon,Upsilon2,Upsilon4,Tau,10.58-res,10.58}.yoda)
rm -rf Rivet-BFactory
python/merge-BFactory BFactory
python/merge-BFactory Powheg-BFactory
python/merge-BFactory Matchbox-BFactory
python/merge-BFactory Dipole-BFactory
rivet-mkhtml -o Rivet-BFactory BFactory.yoda:Hw Powheg-BFactory.yoda:Hw-Powheg Matchbox-BFactory.yoda:Hw-Matchbox Dipole-BFactory.yoda:Hw-Dipole
touch $@
Rivet-DIS : Rivet-DIS/done
touch $@
Rivet-DIS/done: $(shell echo Rivet{-DIS,-DIS-NoME,-Powheg-DIS,-Matchbox-DIS,-Dipole-DIS}-{e--LowQ2,e+-LowQ2,e+-HighQ2}.yoda)
rm -rf Rivet-DIS
python/merge-DIS DIS
python/merge-DIS Powheg-DIS
python/merge-DIS DIS-NoME
python/merge-DIS Matchbox-DIS
python/merge-DIS Dipole-DIS
rivet-mkhtml -o Rivet-DIS DIS.yoda:Hw Powheg-DIS.yoda:Hw-Powheg DIS-NoME.yoda:Hw-NoME Matchbox-DIS.yoda:Hw-Matchbox Dipole-DIS.yoda:Hw-Dipole
touch $@
Rivet-TVT-WZ : Rivet-TVT-WZ/done
touch $@
Rivet-TVT-WZ/done: $(shell echo Rivet{,-Powheg,-Matchbox,-Dipole}-TVT-{Run-I-Z,Run-I-W,Run-I-WZ,Run-II-Z-{e,{,LowMass-,HighMass-}mu},Run-II-W}.yoda)
rm -rf Rivet-TVT-WZ
python/merge-TVT-EW Rivet-TVT-Run-II-W.yoda Rivet-TVT-Run-II-Z-{e,{,LowMass-,HighMass-}mu}.yoda\
Rivet-TVT-Run-I-{W,Z,WZ}.yoda -o TVT-WZ.yoda
python/merge-TVT-EW Rivet-TVT-Powheg-Run-II-W.yoda Rivet-TVT-Powheg-Run-II-Z-{e,{,LowMass-,HighMass-}mu}.yoda\
Rivet-TVT-Powheg-Run-I-{W,Z,WZ}.yoda -o TVT-Powheg-WZ.yoda
python/merge-TVT-EW Rivet-TVT-Matchbox-Run-II-W.yoda Rivet-TVT-Matchbox-Run-II-Z-{e,{,LowMass-,HighMass-}mu}.yoda\
Rivet-TVT-Matchbox-Run-I-{W,Z,WZ}.yoda -o TVT-Matchbox-WZ.yoda
python/merge-TVT-EW Rivet-TVT-Dipole-Run-II-W.yoda Rivet-TVT-Dipole-Run-II-Z-{e,{,LowMass-,HighMass-}mu}.yoda\
Rivet-TVT-Dipole-Run-I-{W,Z,WZ}.yoda -o TVT-Dipole-WZ.yoda
rivet-mkhtml -o Rivet-TVT-WZ TVT-WZ.yoda:Hw TVT-Powheg-WZ.yoda:Hw-Powheg TVT-Matchbox-WZ.yoda:Hw-Matchbox TVT-Dipole-WZ.yoda:Hw-Dipole
touch $@
Rivet-TVT-Photon : Rivet-TVT-Photon/done
touch $@
Rivet-TVT-Photon/done: $(shell echo Rivet-TVT-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet,PromptPhoton}.yoda) \
$(shell echo Rivet-Powheg-TVT-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.yoda)
rm -rf Rivet-TVT-Photon
python/merge-TVT-Photon TVT -o TVT-Photon.yoda
python/merge-TVT-Photon TVT-Powheg -o TVT-Powheg-Photon.yoda
rivet-mkhtml -o Rivet-TVT-Photon TVT-Photon.yoda:Hw TVT-Powheg-Photon.yoda:Hw-Powheg
touch $@
Rivet-TVT-Jets : Rivet-TVT-Jets/done
touch $@
Rivet-TVT-Jets/done: $(shell echo Rivet-TVT-{Run-II-Jets-{0..11},Run-I-Jets-{1..8}}.yoda ) \
$(shell echo Rivet-TVT-{630-Jets-{1..3},300-Jets-1,900-Jets-1}.yoda ) \
$(shell echo Rivet-TVT-{Run-I,Run-II,300,630,900}-UE.yoda)
rm -rf Rivet-TVT-Jets
python/merge-TVT-Jets TVT
rivet-mkhtml -o Rivet-TVT-Jets TVT-Jets.yoda:Hw
touch $@
#python/merge-TVT-Energy TVT
#rivet-merge-CDF_2012_NOTE10874 TVT-300-Energy.yoda TVT-900-Energy.yoda TVT-1960-Energy.yoda
#flat2yoda RatioPlots.dat -o TVT-RatioPlots.yoda
Rivet-Star : Rivet-Star/done
touch $@
Rivet-Star/done : $(shell echo Rivet-Star-{UE,Jets-{1..4}}.yoda )
rm -rf Rivet-Star
python/merge-Star Star
## broken DVI? ## rivet-mkhtml -v -o Rivet-Star Star.yoda
mkdir -p Rivet-Star # remove when fixed
touch $@
Rivet-SppS : Rivet-SppS/done
touch $@
## $(shell echo Rivet-ISR-{30,44,53,62}-UE.yoda ) \
## {53,63,200,500,900,546}
Rivet-SppS/done : $(shell echo Rivet-SppS-{200,500,900,546}-UE.yoda )
rm -rf Rivet-SppS
python/merge-SppS SppS
rivet-mkhtml -o Rivet-SppS SppS.yoda
touch $@
Rivet-LHC-Jets : Rivet-LHC-Jets/done
touch $@
Rivet-LHC-Jets/done : \
$(shell echo Rivet-LHC-7-DiJets-{1..7}-{A,B,C}.yoda ) \
$(shell echo Rivet-LHC-{7,8,13}-Jets-{0..10}.yoda ) \
$(shell echo Rivet-LHC-{900,2360,2760,7,8,13}-UE.yoda ) \
$(shell echo Rivet-LHC-{900,7,13}-UE-Long.yoda ) \
$(shell echo Rivet-LHC-7-Charm-{1..5}.yoda ) \
$(shell echo Rivet-LHC-7-Bottom-{0..8}.yoda ) \
$(shell echo Rivet-LHC-7-Top-{L,SL}.yoda ) \
$(shell echo Rivet-LHC-{7,8,13}-Top-All.yoda )
rm -rf Rivet-LHC-Jets
python/merge-LHC-Jets LHC
rivet-mkhtml -o Rivet-LHC-Jets LHC-Jets.yoda:Hw
touch $@
Rivet-LHC-EW : Rivet-LHC-EW/done
touch $@
Rivet-LHC-EW/done: \
$(shell echo Rivet{,-Matchbox,-Powheg,-Dipole}-LHC-{13-Z-{e,mu},Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},W-{e,mu},Z-{e,mu,mu-SOPHTY},Z-LowMass-{e,mu},Z-MedMass-e,WZ,WW-{emu,ll},ZZ-{ll,lv},8-ZZ-lv,8-WW-ll,W-Z-{e,mu}}.yoda) \
$(shell echo Rivet{,-Matchbox,-Dipole}-LHC-{7-W-Jet-{1..3}-e,7-Z-Jet-{0..3}-e,7-Z-Jet-0-mu}.yoda) \
$(shell echo Rivet{-Matchbox,-Dipole}-LHC-{Z-b,Z-bb,W-b,8-Z-jj}.yoda) \
$(shell echo Rivet-LHC-7-{W,Z}Gamma-{e,mu}.yoda)
rm -rf Rivet-LHC-EW;
python/merge-LHC-EW Rivet-LHC-{13-Z-{e,mu},Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},W-{e,mu},Z-{e,mu,mu-Short},Z-LowMass-{e,mu},Z-MedMass-e,W-Z-{e,mu},WW-{emu,ll},WZ,ZZ-{ll,lv},8-ZZ-lv,8-WW-ll}.yoda Rivet-LHC-7-{W,Z}-Jet-{1,2,3}-e.yoda Rivet-LHC-7-{W,Z}Gamma-{e,mu}.yoda -o LHC-EW.yoda;
python/merge-LHC-EW Rivet-Matchbox-LHC-{13-Z-{e,mu},Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},W-{e,mu},Z-{e,mu,mu-Short},Z-LowMass-{e,mu},Z-MedMass-e,W-Z-{e,mu},WW-{emu,ll},WZ,ZZ-{ll,lv},8-ZZ-lv,8-WW-ll}.yoda Rivet-LHC-Matchbox-7-{W,Z}-Jet-{1,2,3}-e.yoda -o LHC-Matchbox-EW.yoda;
python/merge-LHC-EW Rivet-Dipole-LHC-{13-Z-{e,mu},Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},W-{e,mu},Z-{e,mu,mu-Short},Z-LowMass-{e,mu},Z-MedMass-e,W-Z-{e,mu},WW-{emu,ll},WZ,ZZ-{ll,lv},8-ZZ-lv,8-WW-ll}.yoda Rivet-LHC-Dipole-7-{W,Z}-Jet-{1,2,3}-e.yoda -o LHC-Dipole-EW.yoda;
python/merge-LHC-EW Rivet-Powheg-LHC-{W-{e,mu},Z-{e,mu},Z-LowMass-{e,mu},Z-MedMass-e,W-Z-{e,mu},WW-{emu,ll},WZ,ZZ-{ll,lv},8-ZZ-lv,8-WW-ll}.yoda -o LHC-Powheg-EW.yoda;
rivet-mkhtml -o Rivet-LHC-EW LHC-EW.yoda:Hw LHC-Powheg-EW.yoda:Hw-Powheg LHC-Matchbox-EW.yoda:Hw-Matchbox LHC-Matchbox-Z-b.yoda:Hw-Matchbox-Zb \
LHC-Matchbox-Z-bb.yoda:Hw-Matchbox-Zbb LHC-Matchbox-W-b.yoda:Hw-Matchbox-W-bb LHC-Dipole-EW.yoda:Hw-Dipole \
LHC-Dipole-Z-b.yoda:Hw-Dipole-Zb LHC-Dipole-Z-bb.yoda:Hw-Dipole-Zbb LHC-Dipole-W-b.yoda:Hw-Dipole-W-bb \
LHC-Z-mu-SOPHTY.yoda:Hw LHC-Powheg-Z-mu-SOPHTY.yoda:Hw-Powheg LHC-Matchbox-Z-mu-SOPHTY.yoda:Hw-Matchbox
touch $@
Rivet-LHC-Photon : Rivet-LHC-Photon/done
touch $@
Rivet-LHC-Photon/done: \
$(shell echo Rivet-LHC-{7,8}-PromptPhoton-{1..4}.yoda) \
Rivet-LHC-GammaGamma-7.yoda \
$(shell echo Rivet{,-Powheg}-LHC-{7,8}-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.yoda)
rm -rf Rivet-LHC-Photon
python/merge-LHC-Photon LHC -o LHC-Photon.yoda
python/merge-LHC-Photon LHC-Powheg -o LHC-Powheg-Photon.yoda
rivet-mkhtml -o Rivet-LHC-Photon LHC-Photon.yoda:Hw LHC-Powheg-Photon.yoda:Hw-Powheg
touch $@
Rivet-LHC-Higgs : Rivet-LHC-Higgs/done
touch $@
Rivet-LHC-Higgs/done: \
$(shell echo Rivet{,-Powheg}-LHC-{ggH,VBF,WH,ZH}.yoda) \
$(shell echo Rivet{,-Powheg}-LHC-8-{{ggH,VBF,WH,ZH}{,-GammaGamma},ggH-WW}.yoda) \
Rivet-LHC-ggHJet.yoda
rm -rf Rivet-LHC-Higgs
rivet-mkhtml -o Rivet-LHC-Higgs LHC-Powheg-ggH.yoda:gg-Powheg LHC-ggH.yoda:gg LHC-ggHJet.yoda:HJet \
LHC-Powheg-VBF.yoda:VBF-Powheg LHC-VBF.yoda:VBF LHC-WH.yoda:WH LHC-ZH.yoda:ZH \
LHC-Powheg-WH.yoda:WH-Powheg LHC-Powheg-ZH.yoda:ZH-Powheg
touch $@
clean-local:
rm -f *.out *.log *.tex *.top *.run *.dump *.mult *.Bmult *.yoda Rivet/*.in
rm -rf Rivet-*
distclean-local:
- rm -rf Herwig-scratch
+ rm -rf .cache
diff --git a/Tests/Rivet/Templates/DIS-Matchbox.in b/Tests/Rivet/Templates/DIS-Matchbox.in
--- a/Tests/Rivet/Templates/DIS-Matchbox.in
+++ b/Tests/Rivet/Templates/DIS-Matchbox.in
@@ -1,56 +1,55 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read snippets/Matchbox.in
read snippets/EPCollider.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonQ2Scale
${shower}
${bscheme}
read Matchbox/MMHT2014.in
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
# switch off initial state QED radiation
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
# create the Rivet analysis
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
read ${parameterFile}
## Select the process
cd /Herwig/MatrixElements/Matchbox
${process}
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/Tests/Rivet/Templates/DIS-Merging.in b/Tests/Rivet/Templates/DIS-Merging.in
--- a/Tests/Rivet/Templates/DIS-Merging.in
+++ b/Tests/Rivet/Templates/DIS-Merging.in
@@ -1,66 +1,65 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read snippets/DipoleMerging.in
read snippets/EPCollider.in
read snippets/MonacoSampler.in
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
read Matchbox/MadGraph-OpenLoops.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
set /Herwig/Merging/MergingFactory:OrderInAlphaS 0
set /Herwig/Merging/MergingFactory:OrderInAlphaEW 2
set /Herwig/Merging/MergingFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonQ2Scale
##################################################
## PDF and AlphaS choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
read Merging/FactorCMWScheme.in
# switch off initial state QED radiation
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
# create the Rivet analysis
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
read ${parameterFile}
## Select the process
cd /Herwig/Merging/
set Merger:MergingScale 10.*GeV
${process}
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/Tests/Rivet/Templates/Hadron-Matchbox.in b/Tests/Rivet/Templates/Hadron-Matchbox.in
--- a/Tests/Rivet/Templates/Hadron-Matchbox.in
+++ b/Tests/Rivet/Templates/Hadron-Matchbox.in
@@ -1,51 +1,50 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Collider type
##################################################
read snippets/Matchbox.in
read snippets/PPCollider.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
##################################################
## Matrix element library selection
##################################################
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
${nlo}
##################################################
## Matching and shower selection
## Please also see flavour scheme settings
## towards the end of the input file.
##################################################
${shower}
##################################################
## PDF choice
##################################################
${bscheme}
read Matchbox/MMHT2014.in
##################################################
# Create the Herwig analysis
##################################################
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
set /Herwig/Analysis/RivetAnalysis:Debug No
set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm
##################################################
## Save the generator
##################################################
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
## Select the process
cd /Herwig/MatrixElements/Matchbox
${process}
read ${parameterFile}
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/Tests/Rivet/Templates/Hadron-Merging.in b/Tests/Rivet/Templates/Hadron-Merging.in
--- a/Tests/Rivet/Templates/Hadron-Merging.in
+++ b/Tests/Rivet/Templates/Hadron-Merging.in
@@ -1,51 +1,50 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Collider type
##################################################
read snippets/DipoleMerging.in
read snippets/PPCollider.in
read snippets/MonacoSampler.in
##################################################
## Matrix element library selection
##################################################
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
read Matchbox/MadGraph-OpenLoops.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
##################################################
## PDF and AlphaS choice
##################################################
read Matchbox/FiveFlavourNoBMassScheme.in
read Matchbox/MMHT2014.in
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
read Merging/FactorCMWScheme.in
##################################################
# Create the Herwig analysis
##################################################
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
set /Herwig/Analysis/RivetAnalysis:Debug No
set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm
## Select the process
cd /Herwig/Merging/
set Merger:MergingScale 15.*GeV
${process}
read ${parameterFile}
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/Tests/Rivet/Templates/LEP-Matchbox.in b/Tests/Rivet/Templates/LEP-Matchbox.in
--- a/Tests/Rivet/Templates/LEP-Matchbox.in
+++ b/Tests/Rivet/Templates/LEP-Matchbox.in
@@ -1,62 +1,61 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Collider type
##################################################
read snippets/Matchbox.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
read snippets/EECollider.in
##################################################
## Process selection
##################################################
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## Matching and shower selection
##################################################
${shower}
##################################################
# Switch off ISR
##################################################
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
##################################################
# Create the Herwig analysis
##################################################
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
## Select the process
cd /Herwig/MatrixElements/Matchbox
${process}
read ${parameterFile}
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/Tests/Rivet/Templates/LEP-Merging.in b/Tests/Rivet/Templates/LEP-Merging.in
--- a/Tests/Rivet/Templates/LEP-Merging.in
+++ b/Tests/Rivet/Templates/LEP-Merging.in
@@ -1,68 +1,67 @@
# -*- ThePEG-repository -*-
#
# DO NOT EDIT - autogenerated by make_input_files.py
#
##################################################
## Collider type
##################################################
read snippets/DipoleMerging.in
read snippets/EECollider.in
read snippets/MonacoSampler.in
##################################################
## Process selection
##################################################
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/Merging/
set MergingFactory:OrderInAlphaS 0
set MergingFactory:OrderInAlphaEW 2
##################################################
## Matrix element library selection
##################################################
read Matchbox/MadGraph-OpenLoops.in
-set /Herwig/MatrixElements/Matchbox/Amplitudes/MadGraph:ProcessPath Herwig-scratch/${runname}-MGpath
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/Merging/
set MergingFactory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## PDF and AlphaS choice
##################################################
set /Herwig/Couplings/NLOAlphaS:input_alpha_s 0.118
read Merging/FactorCMWScheme.in
##################################################
# Switch off ISR
##################################################
set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF
set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF
##################################################
# Create the Herwig analysis
##################################################
create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
## Select the process
cd /Herwig/Merging/
set Merger:MergingScale 5.*GeV
${process}
read ${parameterFile}
##################################################
## Save the generator
##################################################
do /Herwig/Merging/MergingFactory:ProductionMode
cd /Herwig/Generators
set EventGenerator:MaxErrors 1000000
saverun ${runname} EventGenerator
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,242 +1,242 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([Herwig],[devel],[herwig@projects.hepforge.org],[Herwig])
AC_CONFIG_SRCDIR([Utilities/HerwigStrategy.cc])
AC_CONFIG_AUX_DIR([Config])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([Config/config.h])
dnl AC_PRESERVE_HELP_ORDER
AC_CANONICAL_HOST
dnl === disable debug symbols by default =====
if test "x$CXXFLAGS" = "x"; then
CXXFLAGS=-O2
fi
if test "x$CFLAGS" = "x"; then
CFLAGS=-O2
fi
AC_LANG([C++])
AM_INIT_AUTOMAKE([1.11 subdir-objects gnu dist-bzip2 no-dist-gzip -Wall -Wno-portability])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
dnl Checks for C++ compiler. Handle C++11 flags.
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX([11],[noext],[mandatory])
dnl check for POSIX
AC_CHECK_HEADER([unistd.h],[],
[AC_MSG_ERROR([Herwig needs "unistd.h". Non-POSIX systems are not supported.])])
AC_CHECK_HEADER([sys/stat.h],[],
[AC_MSG_ERROR([Herwig needs "sys/stat.h". Non-POSIX systems are not supported.])])
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
dnl modified search order
AC_PROG_FC([gfortran g95 g77])
dnl xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 xlf f77 frt pgf77 cf77 fort77 fl32 af77])
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([if the Fortran compiler ($FC) works])
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([],[ print *[,]"Hello"]),
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([A Fortran compiler is required to build Herwig.])
]
)
AC_LANG_POP([Fortran])
LT_PREREQ([2.2.6])
LT_INIT([disable-static dlopen pic-only])
dnl ####################################
dnl ####################################
dnl for Doc/fixinterfaces.pl
AC_PATH_PROG(PERL, perl)
dnl for Models/Feynrules
AM_PATH_PYTHON([2.6],, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "x$PYTHON" != "x:"])
HERWIG_CHECK_GSL
HERWIG_CHECK_THEPEG
BOOST_REQUIRE([1.41])
BOOST_FIND_HEADER([boost/numeric/ublas/io.hpp])
dnl Boost 1.64 is missing a required header to make these work
dnl we just assume they're there if io.hpp has been found OK above
dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix.hpp])
dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix_proxy.hpp])
dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix_sparse.hpp])
dnl BOOST_FIND_HEADER([boost/numeric/ublas/symmetric.hpp])
dnl BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
BOOST_FIND_HEADER([boost/operators.hpp])
BOOST_TEST()
HERWIG_CHECK_VBFNLO
HERWIG_CHECK_NJET
HERWIG_CHECK_GOSAM
HERWIG_CHECK_GOSAM_CONTRIB
HERWIG_CHECK_OPENLOOPS
HERWIG_CHECK_MADGRAPH
HERWIG_CHECK_EVTGEN
HERWIG_CHECK_PYTHIA
HERWIG_COMPILERFLAGS
HERWIG_LOOPTOOLS
FASTJET_CHECK_FASTJET
HERWIG_ENABLE_MODELS
SHARED_FLAG=-shared
AM_CONDITIONAL(NEED_APPLE_FIXES,
[test "xx${host/darwin/foundit}xx" != "xx${host}xx"])
if test "xx${host/darwin/foundit}xx" != "xx${host}xx"; then
APPLE_DSO_FLAGS=-Wl,-undefined,dynamic_lookup
SHARED_FLAG=-bundle
fi
AC_SUBST([APPLE_DSO_FLAGS])
AC_SUBST([SHARED_FLAG])
AC_CONFIG_FILES([UnderlyingEvent/Makefile
Models/Makefile
Models/StandardModel/Makefile
Models/RSModel/Makefile
Models/General/Makefile
Models/Susy/Makefile
Models/Susy/NMSSM/Makefile
Models/Susy/RPV/Makefile
Models/UED/Makefile
Models/LH/Makefile
Models/LHTP/Makefile
Models/Transplanckian/Makefile
Models/Leptoquarks/Makefile
Models/Zprime/Makefile
Models/TTbAsymm/Makefile
Models/Feynrules/Makefile
Models/Feynrules/python/Makefile-FR
Models/ADD/Makefile
Models/Sextet/Makefile
Decay/Makefile
Decay/FormFactors/Makefile
Decay/Tau/Makefile
Decay/Baryon/Makefile
Decay/VectorMeson/Makefile
Decay/Perturbative/Makefile
Decay/ScalarMeson/Makefile
Decay/TensorMeson/Makefile
Decay/WeakCurrents/Makefile
Decay/Partonic/Makefile
Decay/General/Makefile
Decay/Radiation/Makefile
Decay/EvtGen/Makefile
Doc/refman.conf
Doc/refman.h
PDT/Makefile
PDF/Makefile
MatrixElement/Makefile
MatrixElement/General/Makefile
MatrixElement/Lepton/Makefile
MatrixElement/Hadron/Makefile
MatrixElement/DIS/Makefile
MatrixElement/Powheg/Makefile
MatrixElement/Gamma/Makefile
MatrixElement/Reweighters/Makefile
MatrixElement/Matchbox/Makefile
MatrixElement/Matchbox/Base/Makefile
MatrixElement/Matchbox/Utility/Makefile
MatrixElement/Matchbox/Phasespace/Makefile
MatrixElement/Matchbox/Dipoles/Makefile
MatrixElement/Matchbox/InsertionOperators/Makefile
MatrixElement/Matchbox/Matching/Makefile
MatrixElement/Matchbox/Cuts/Makefile
MatrixElement/Matchbox/Scales/Makefile
MatrixElement/Matchbox/ColorFull/Makefile
MatrixElement/Matchbox/CVolver/Makefile
MatrixElement/Matchbox/Builtin/Makefile
MatrixElement/Matchbox/Builtin/Amplitudes/Makefile
MatrixElement/Matchbox/Tests/Makefile
MatrixElement/Matchbox/External/Makefile
MatrixElement/Matchbox/External/BLHAGeneric/Makefile
MatrixElement/Matchbox/External/VBFNLO/Makefile
MatrixElement/Matchbox/External/NJet/Makefile
MatrixElement/Matchbox/External/GoSam/Makefile
MatrixElement/Matchbox/External/OpenLoops/Makefile
MatrixElement/Matchbox/External/MadGraph/Makefile
- MatrixElement/Matchbox/External/MadGraph/mg2herwig.py
+ MatrixElement/Matchbox/External/MadGraph/mg2herwig
Sampling/Makefile
Sampling/CellGrids/Makefile
Shower/Makefile
Shower/QTilde/Makefile
Shower/QTilde/Matching/Makefile
Shower/Dipole/Makefile
Shower/Dipole/Base/Makefile
Shower/Dipole/Kernels/Makefile
Shower/Dipole/Kinematics/Makefile
Shower/Dipole/Utility/Makefile
Shower/Dipole/AlphaS/Makefile
Utilities/Makefile
Utilities/XML/Makefile
Utilities/Statistics/Makefile
Hadronization/Makefile
lib/Makefile
include/Makefile
src/Makefile
src/defaults/Makefile
src/snippets/Makefile
src/Matchbox/Makefile
src/herwig-config
Doc/Makefile
Doc/HerwigDefaults.in
Looptools/Makefile
Analysis/Makefile
API/Makefile
src/Makefile-UserModules
src/defaults/Analysis.in
src/defaults/MatchboxDefaults.in
src/defaults/Decays.in
src/defaults/decayers.in
src/defaults/setup.gosam.in
src/Matchbox/LO-DefaultShower.in
src/Matchbox/LO-DipoleShower.in
src/Matchbox/MCatLO-DefaultShower.in
src/Matchbox/MCatLO-DipoleShower.in
src/Matchbox/LO-NoShower.in
src/Matchbox/MCatNLO-DefaultShower.in
src/Matchbox/MCatNLO-DipoleShower.in
src/Matchbox/NLO-NoShower.in
src/Matchbox/Powheg-DefaultShower.in
src/Matchbox/Powheg-DipoleShower.in
src/Merging/Makefile
Shower/Dipole/Merging/Makefile
src/defaults/MatchboxMergingDefaults.in
Contrib/Makefile
Contrib/make_makefiles.sh
Tests/Makefile
Makefile])
AC_CONFIG_LINKS([Doc/BSMlibs.in:Doc/BSMlibs.in])
AC_CONFIG_FILES([Doc/fixinterfaces.pl],[chmod +x Doc/fixinterfaces.pl])
HERWIG_OVERVIEW
AC_CONFIG_COMMANDS([summary],[cat config.herwig])
AC_OUTPUT
diff --git a/src/HerwigCLI.cc b/src/HerwigCLI.cc
--- a/src/HerwigCLI.cc
+++ b/src/HerwigCLI.cc
@@ -1,165 +1,170 @@
// -*- C++ -*-
//
// HerwigCLI.cc is a part of Herwig - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2017 The Herwig Collaboration
//
// Herwig is licenced under version 3 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#include "HerwigCLI.h"
#include "herwigopts.h"
+#include "Herwig/API/RunDirectories.h"
#include <ThePEG/Utilities/DynamicLoader.h>
#include <ThePEG/Utilities/Debug.h>
#include <ThePEG/Repository/Repository.h>
#include <ThePEG/Handlers/SamplerBase.h>
namespace Herwig {
void HerwigCLI::quitWithHelp() const {
std::cerr << gengetopt_args_info_usage << '\n';
quit();
}
void HerwigCLI::quit() const {
ThePEG::Repository::cleanup();
exit( EXIT_FAILURE );
}
HerwigCLI::~HerwigCLI() {
ThePEG::Repository::cleanup();
}
HerwigCLI::HerwigCLI(int argc, char * argv[])
: runMode_(RunMode::ERROR),
resume_(false), tics_(true), tag_(),
inputfile_(), repository_(), setupfile_(),
integrationList_(),
N_(-1), seed_(0), jobs_(1),
jobsize_(0), maxjobs_(0)
{
gengetopt_args_info args_info;
if ( cmdline_parser( argc, argv, &args_info ) != 0 ) {
std::cerr << "Could not parse command line.\n";
return;
}
if ( args_info.version_given ) {
std::cout <<
#include "hgstamp.inc"
"" << '\n';
std::cout << ThePEG::Repository::version() << std::endl;
cmdline_parser_free( &args_info );
exit( EXIT_SUCCESS );
}
// require one command
if ( args_info.inputs_num < 1 )
quitWithHelp();
// Define runMode of program
std::string tmpRunMode = args_info.inputs[0];
if ( tmpRunMode == "init" ) { runMode_ = RunMode::INIT; }
else if ( tmpRunMode == "read" ) { runMode_ = RunMode::READ; }
else if ( tmpRunMode == "build" ) { runMode_ = RunMode::BUILD; }
else if ( tmpRunMode == "integrate" ) { runMode_ = RunMode::INTEGRATE; }
else if ( tmpRunMode == "mergegrids" ) { runMode_ = RunMode::MERGEGRIDS; }
else if ( tmpRunMode == "run" ) { runMode_ = RunMode::RUN; }
else {
runMode_ = RunMode::ERROR;
quitWithHelp();
}
// Use second argument as input- or runfile name
if ( args_info.inputs_num > 1 )
inputfile_ = args_info.inputs[1];
// Defaults for these filenames are set in the ggo file
repository_ = args_info.repo_arg;
// Number of events
if ( args_info.numevents_given )
N_ = args_info.numevents_arg;
// RNG seed
if ( args_info.seed_given ) {
seed_ = args_info.seed_arg;
}
// run name tag (default given in ggo file)
tag_ = args_info.tag_arg;
// run modification file
if ( args_info.setupfile_given )
setupfile_ = args_info.setupfile_arg;
// parallel jobs
if ( args_info.jobs_given )
jobs_ = args_info.jobs_arg;
+ // Cache directory for Matchbox
+ if ( args_info.cachedir_given )
+ Herwig::RunDirectories::prefix(args_info.cachedir_arg);
+
// Directories from which Herwig reads filesystemfor ( size_t i = 0; i < args_info.append_read_given; ++i )
for ( size_t i = 0; i < args_info.append_read_given; ++i )
appendReadDirectories_.push_back( args_info.append_read_arg[i] );
for ( size_t i = 0; i < args_info.prepend_read_given; ++i )
prependReadDirectories_.push_back( args_info.prepend_read_arg[i] );
// Library search path for dlopen()
for ( size_t i = 0; i < args_info.append_given; ++i )
ThePEG::DynamicLoader::appendPath( args_info.append_arg[i] );
for ( size_t i = 0; i < args_info.prepend_given; ++i )
ThePEG::DynamicLoader::prependPath( args_info.prepend_arg[i] );
// Debugging level
if ( args_info.debug_given )
ThePEG::Debug::setDebug( args_info.debug_arg );
// Floating point exceptions
if ( args_info.debug_fpe_flag )
ThePEG::Debug::unmaskFpuErrors();
// Exit-on-error flag
if ( ! args_info.noexitonerror_flag )
ThePEG::Repository::exitOnError() = 1;
// Tics
if ( args_info.quiet_flag )
tics_ = false;
// integration list
if ( args_info.jobid_given ) {
integrationList_ = "integrationJob" + std::string(args_info.jobid_arg);
}
// job size
if ( args_info.jobsize_given ) {
if ( runMode_ != RunMode::BUILD ) {
std::cerr << "--jobsize option is only available in 'build' mode.\n";
quitWithHelp();
}
jobsize_ = args_info.jobsize_arg;
ThePEG::SamplerBase::setIntegratePerJob(jobsize_);
}
// max integration jobs
if ( args_info.maxjobs_given ) {
if ( runMode_ != RunMode::BUILD ) {
std::cerr << "--maxjobs option is only available in 'build' mode.\n";
quitWithHelp();
}
maxjobs_ = args_info.maxjobs_arg;
ThePEG::SamplerBase::setIntegrationJobs(maxjobs_);
}
// Resume
if ( args_info.resume_flag )
resume_ = true;
cmdline_parser_free( &args_info );
}
}
diff --git a/src/LEP-Matchbox.in b/src/LEP-Matchbox.in
--- a/src/LEP-Matchbox.in
+++ b/src/LEP-Matchbox.in
@@ -1,144 +1,144 @@
# -*- ThePEG-repository -*-
##################################################
## Herwig/Matchbox example input file
##################################################
##################################################
## Collider type
##################################################
read snippets/Matchbox.in
read snippets/EECollider.in
##################################################
## Beam energy sqrt(s)
##################################################
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 91.2*GeV
##################################################
## Process selection
##################################################
## Note that event generation may fail if no matching matrix element has
## been found. Coupling orders are with respect to the Born process,
## i.e. NLO QCD does not require an additional power of alphas.
## Model assumptions
read Matchbox/StandardModelLike.in
read Matchbox/DiagonalCKM.in
## Set the order of the couplings
cd /Herwig/MatrixElements/Matchbox
set Factory:OrderInAlphaS 0
set Factory:OrderInAlphaEW 2
## Select the process
## You may use identifiers such as p, pbar, j, l, mu+, h0 etc.
do Factory:Process e- e+ -> j j
## Special settings required for on-shell production of unstable particles
## enable for on-shell top production
# read Matchbox/OnShellTopProduction.in
## enable for on-shell W, Z or h production
# read Matchbox/OnShellWProduction.in
# read Matchbox/OnShellZProduction.in
# read Matchbox/OnShellHProduction.in
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
-# read Matchbox/MadGraph-OpenLoops.in
+read Matchbox/MadGraph-OpenLoops.in
## Uncomment this to use ggh effective couplings
## currently only supported by MadGraph-GoSam
# read Matchbox/HiggsEffective.in
##################################################
## Cut selection
## See the documentation for more options
##################################################
## cuts on additional jets
# cd /Herwig/Cuts
# read Matchbox/DefaultEEJets.in
# set NJetsCut:NJetsMin 3
##################################################
## Scale choice
## See the documentation for more options
##################################################
cd /Herwig/MatrixElements/Matchbox
set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/SHatScale
##################################################
## Matching and shower selection
##################################################
read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
# read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
##################################################
## Scale uncertainties
##################################################
# read Matchbox/MuDown.in
# read Matchbox/MuUp.in
##################################################
## Shower scale uncertainties
##################################################
# read Matchbox/MuQDown.in
# read Matchbox/MuQUp.in
##################################################
## Analyses
##################################################
# cd /Herwig/Analysis
# insert Rivet:Analyses 0 XXX_2015_ABC123
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 Rivet
# insert /Herwig/Generators/EventGenerator:AnalysisHandlers 0 HepMC
##################################################
## Do not apply profile scales for LEP as hard
## scale coincides with kinematic limit
##################################################
set /Herwig/Shower/ShowerHandler:HardScaleProfile NULL
set /Herwig/DipoleShower/DipoleShowerHandler:HardScaleProfile NULL
##################################################
## Save the generator
##################################################
do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode
cd /Herwig/Generators
saverun LEP-Matchbox EventGenerator
diff --git a/src/herwigopts.ggo b/src/herwigopts.ggo
--- a/src/herwigopts.ggo
+++ b/src/herwigopts.ggo
@@ -1,102 +1,104 @@
## args for the gengetopt call in Makefile.am
args "--file-name=herwigopts --unamed-opts --long-help --no-handle-version"
##################################################
purpose "Herwig is a multi-purpose Monte-Carlo event generator \
for particle physics. See arXiv:0803.0883 for a detailed manual, \
or arXiv:1101.2599 for a more general description of the physics \
behind MC event generation."
usage " (read|build|integrate|mergegrids|run) [OPTIONS]... [FILE]"
description "One of the commands 'read', 'build', 'integrate', 'mergegrids' or 'run' is required:
read - reads an input file and creates a run file,
build - reads an input file and creates matrix elements,
integrate - integrate subprocesses after running `build',
mergegrids - combine integration grids from parallel adaption,
run - reads a run file and generates events."
section "Event generation options"
-text ""
option "numevents" N "Number of events to generate."
long optional
option "seed" s "The random number generator seed."
int optional
option "tag" t "A tag to append to the run name."
typestr="TAG"
string optional default=""
option "debug" d "Set the ThePEG debug level."
int optional
option "debug-fpe" D "Enable floating point exceptions."
flag off
option "quiet" q "Disable event counter."
flag off
option "jobs" j "Number of jobs to run in parallel (max 10)."
int optional
option "setupfile" x "An input file to modify run parameters."
typestr="FILE"
string optional
section "Build and integration options"
-text "
- -x, --setupfile=FILE An input file to modify run parameters.
- -t, --tag=TAG A tag to append to the run name (default=`')"
+
+option "cachedir" c "Matchbox cache directory."
+ typestr="DIR"
+ string optional default="Herwig-cache"
option "jobsize" z "The number of subprocesses to integrate per job (build only)."
typestr="NUMBER"
long optional
option "maxjobs" y "The maximum number of integration jobs to be created (build only)."
typestr="NUMBER"
long optional
option "jobid" n "Integrate the given integration job."
typestr="NUMBER"
string optional
+text "\
+ -x, --setupfile=FILE An input file to modify run parameters.
+ -t, --tag=TAG A tag to append to the run name (default=`')"
+
section "Repository options"
-text ""
option "append-read" i "Append a search path for the read command."
typestr="PATH"
string optional multiple
option "prepend-read" I "Prepend a search path for the read command."
typestr="PATH"
string optional multiple
section "Plugin library options"
-text ""
option "append" l "Append a search path for dynamically loaded libraries."
typestr="PATH"
string optional multiple
option "prepend" L "Prepend a search path for dynamically loaded libraries."
typestr="PATH"
string optional multiple
text "\nUsage: Herwig init [OPTIONS] FILE\n"
text " creates a new default repository (not useful for end users).\n"
section "Advanced options"
option "repo" - "Repository file to use."
typestr="FILE"
string optional default="HerwigDefaults.rpo" hidden
option "noexitonerror" - "If set, ThePEG will not try to recover from \
failures, but will exit with a non-zero return code."
flag off hidden
option "resume" - "Try to resume execution from an earlier interrupted run."
flag off hidden
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:51 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3806164
Default Alt Text
(115 KB)
Attached To
R563 testingHerwigHG
Event Timeline
Log In to Comment