Page MenuHomeHEPForge

No OneTemporary

Size
52 KB
Referenced Files
None
Subscribers
None
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog (revision 814)
+++ trunk/ChangeLog (revision 815)
@@ -1,734 +1,740 @@
+2011-06-14 Andy Buckley <andy@insectnation.org>
+
+ * Rewriting HERWIG status codes to better match the HepMC
+ standard: HERWIG status 2 is for partons -> status 3, and HERWIG
+ 195->199 are unstable hadrons -> status 2.
+
2011-06-06 Andy Buckley <andy@insectnation.org>
* Testing maximal HepMC event chopping and adding --filter to the
command line completion
* Adding support for LHEF file reading in FPythia.
2011-05-09 Andy Buckley <andy@insectnation.org>
* Fixes to AlpGenFHerwig and AlpGenFHerwigJimmy vetoing behaviour
from Gavin Hesketh.
2011-04-25 Andy Buckley <andy@insectnation.org>
* Exclude the "." and ".." directory entries from generator version searches.
2011-04-06 Andy Buckley <andy@insectnation.org>
* Release 1.2.2!
* Fixes to the Charybdis interfaces.
2011-04-05 Andy Buckley <andy@insectnation.org>
* Getting the list of available generator versions (HERWIG,
PYTHIA, AlpGen, RapGap, & CASCADE) automatically (and being
careful about the .2 and .3 suffixes and duplicate removal).
2011-02-22 Andy Buckley <andy@insectnation.org>
* Fix AlpGenFHerwigJimmy to actually call JIMMY, based on
integrating the AlpGen veto function into the FHerwigJimmy
event-building calls.
2011-02-02 Andy Buckley <andy@insectnation.org>
* Trying to get the list of available LHAPDF versions
automatically (from a Genser-like file structure).
2011-01-31 Andy Buckley <andy@insectnation.org>
* Fix the IPROC setting in AlpGen + Herwig (+ Jimmy) -- thanks to
Gavin Hesketh for finding the problem and supplying the solution!
* Fix the Python event loop to *not* allocate an unused array the
size of the maximum number of events! This has a big effect on
memory for >= 1M events. Thanks to Gavin Hesketh for finding the problem.
2011-01-28 Andy Buckley <andy@insectnation.org>
* Add new Pythia params files for Z -> e e, mu mu and W -> mu nu
and W -> mu nu, e nu.
* Adapt fpythia-Z*.params files to only control the decays, not
the MSEL/MSUB process selection.
2011-01-25 Andy Buckley <andy@insectnation.org>
* Make FPythia and FHerwig set their beam particles' statuses = 4,
as per the HepMC standard.
* Update LHAPDF version list to include 5.8.4.
2010-12-18 Andy Buckley <andy@insectnation.org>
* AGILe 1.2.1 release.
2010-12-09 Andy Buckley <andy@insectnation.org>
* Converting supplied beam energies to momenta in FHerwig as
required by the HERWIG interface (the EBEAM1/2 params seemed to
not be used when I tried). It's a really nasty hack: rather than
have a lookup table of masses for this unimportant effect, I just
subtract 1 GeV**2 from the energy**2 if that beam particle is a
proton, antiproton or neutron. Someone else can do it properly ;-)
* Adding HERWIG 6.520 to the list of supported generators, since
Genser now has one. No idea what is in that -- the various
reported and long-overdue bug-fixes I guess. Almost certainly the
last HERWIG release! (Also adding more PYTHIA version
codes... just because.) Automatically detecting the available
versions would be nice so we don't have to do this.
* Converting Generator::getName() to use a member variable, which
is set in the various generator interfaces.
* More FHerwig clean-ups.
* HERWIG problem fixed... at the cost of having to completely
restructure the FHerwig param and seed handling! Since IPROC and
the beam params need to be defined before HWIGIN is called, and we
want to be able to run HERWIG without *having* to specify an
IPROC, the other params need to be stored and applied
post-HWIGIN. If they were applied before, the HWIGIN
initialisation would just overwrite them. Argh!
* Include matrix element MC integration seeds in FHerwig::setSeed().
* Bump ABI version for 1.2.1 release.
* Move FHerwig HWIGIN call to initialize() -- trying to make sure
that initial state is known at time that initialisation is
called. Still not working for me.
* Make Pythia call PYTUNE immediately on setting the PYTUNE or
MSTP(5) variable, and never re-call it in PYINIT.
* Adding MSG_* logging macros.
* Adding correct SWIG compiler flags to SWIG test.
* Renaming fpythia-atlas params file to fpythia-atlas-mc08.
2010-10-20 Andy Buckley <andy@insectnation.org>
* Removing bad-idea default param files for PYTHIA and HERWIG.
2010-10-14 Andy Buckley <andy@insectnation.org>
* Removing dysfunctional weighting function for PYTHIA.
2010-09-24 Andy Buckley <andy@insectnation.org>
* Releasing AGILe 1.2.0 -- major new features are PYTHIA/HERWIG
event enhancement/weighting and the Cascade/Rapgap interfaces.
2010-07-19 Andy Buckley <andy@insectnation.org>
* Adding official API functions for path and LCG platform tag
getting.
2010-07-16 Andy Buckley <andy@insectnation.org>
* Restructuring SWIG module to a more general package with a SWIG
core.
* Requiring Python >= 2.4.
2010-06-10 Andy Buckley <andy@insectnation.org>
* Releasing AGILe 1.1.6.
* Now using Boost lexical_cast instead of stringstream for safety
and convenience.
2010-06-01 Andy Buckley <andy@insectnation.org>
* Upgrading the Python and SWIG checks to the cleverer ones from
recent Rivet releases.
* Fixing Loader to pick up Herwig, Charybdis and Cascade from
changed Genser locations, and to ensure that Jimmy and Herwig are
both picked from the ".3" Genser sub-version, and hence have the
same HEPEVT common block size: this fixes a memory corruption
issue which was making HW+JM exit with an error after only a small
number of events. Note that as a result of fixing these Genser
versions, the AGILe command-line name for Herwig has changed from
"Herwig:6510" to "Herwig:6.510".
2010-05-07 Andy Buckley <andy@insectnation.org>
* Adding params files for ALEPH and DELPHI PYTHIA tunes, thanks to
Sarka Todorova.
* Fix missing usage message on agile-runmc.
* Changing generator search path to only fall back to hard-coded
Genser AFS area if AGILE_GEN_PATH is not set. Spurred by wanting
to avoid AFS timeouts on systems with /afs mounted where there is
no valid token... the initialisation slowdown from this timeout
puzzled me for a *long* time, before I worked out that it was
connected to me having added AFS mounting to my laptop!
2010-04-22 Andy Buckley <andy@insectnation.org>
* Using unit conversion for all generators reading from
HEPEVT (i.e. all generators!).
* Adding HepMCTools.hh internal header, containing units
conversion routine for converting HEPEVT-dumped events in GeV/mm
convention to the current event's units if required.
* Holger added Cascade interface.
2010-03-15 Andy Buckley <andy@insectnation.org>
* Adding build of omitted libAGILeAlpGen.so library.
* Moved core components into src/Core to improve build flexibility.
* Holger added RapGap interface.
2009-11-11 Andy Buckley <andy@insectnation.org>
* Making params evaluate in order given on the command line / in
param files. The first occurence position is used if a parameter
is specified more than once, but the last-specified _value_ will
be used.
2009-11-10 Andy Buckley <andy@insectnation.org>
* Removing all traces of C++ generators, since I don't want to
give anyone the impression that this is a good way to run them.
* Adding --filter option to strip unphysical particles out of the
event record.
* Using shared_ptr to automatically manage the Run I/O pointers.
2009-11-08 Andy Buckley <andy@insectnation.org>
* Splitting Charybdis processing as for AlpGen, and hence adding a
proper CharybdisJimmy interface (and registering it in the Loader).
* Adding proper AlpGenJimmy library support to Loader.
2009-10-23 Andy Buckley <andy@insectnation.org>
* Writing event weights (and estimated errors) into HepMC (if
supported) for Fortran HERWIG.
2009-10-21 Andy Buckley <andy@insectnation.org>
* Completing documentation of HERWIG params.
* Adding errors to Pythia 6 cross-section estimate filling.
2009-10-16 Andy Buckley <andy@insectnation.org>
* Creating new Run object, to allow removal of Python HepMC
interface (which is no bad thing, but if forces a SWIG dependence
on the HepMC version, and SL doesn't have a sufficiently
functional copy of SWIG to be relied on.
* Using AlpGen interface by composition rather than inheritance:
AlpGenHerwigJimmy should now work.
2009-06-10 Andy Buckley <andy@insectnation.org>
* Using "embedded" hepmc.i in AGILe.i, as for rivet.i, to make an
1.1.4 alpha tarball which will work on lxplus and can be
bootstrapped with Rivet.
2009-06-03 Andy Buckley <andy@insectnation.org>
* Putting SWIG-generated source files under version control, to
make life easier for people who check out the SVN head but don't
have an up to date (or any) copy of SWIG.
2009-04-07 Andy Buckley <andy@insectnation.org>
* Adding $(DESTDIR) prefix to call to Python module "setup.py
install"
2009-03-04 Andy Buckley <andy@insectnation.org>
* Adding AGILE_DEBUG environment variable.
* Fixing SWIG build to allow reliable interchange of HepMC objects.
2009-02-25 Andy Buckley <andy@insectnation.org>
* Make Python extension etc. build by default.
2009-01-22 Andy Buckley <andy@insectnation.org>
* agile-runmc: added handling of an RG:Generator param, and hence
the ability to dump out a whole gen config, including run
conditions and generator name, using --list-used-analyses.
2009-01-15 Andy Buckley <andy@insectnation.org>
* Converting Python build system to bundle SWIG output in tarball.
2009-01-05 Andy Buckley <andy@insectnation.org>
* Python: replaced Python extension build process with a more
portable version based on distutils and newer m4 macros. Breaks
distcheck until distutils SWIG support is improved to support
multi-dir builds.
2008-11-28 Andy Buckley <andy@insectnation.org>
* Replaced binreloc with an upgraded and symbol-independent copy.
2008-11-21 Andy Buckley <andy@insectnation.org>
* Pre-emptively recognise Pythia 6.420, since we know there will
be one (it will include the Skands + Professor tune + Peter's
other 'Perugia' tunes).
* Moved RivetGun params into AGILe.
* Various command line tweaks, bug fixes and cosmetic improvements.
2008-11-18 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Recognise Pythia 6.419
2008-11-04 Andy Buckley <andy@insectnation.org>
* Added bash completion file, minor UI bug fixes, and more
complete beam string handling.
2008-10-30 Andy Buckley <andy@insectnation.org>
* Added param file search path handling ("." + AGILE_PARAM_PATH),
and also support for an "include" statement in param files.
2008-10-28 Andy Buckley <andy@insectnation.org>
* Added Python access to AGILe log system, param dumping, RNG seed
control and flexible initial state energy, num events and beam
specification.
2008-10-21 Andy Buckley <andy@insectnation.org>
* Making Herwig++ call its initial-state setting before any params
are passed, since the AGILeGenerator object must be set up first.
* All generators will now try to load a "HEAD" version if
available.
2008-10-09 Andy Buckley <andy@insectnation.org>
* Fixed bug in FHerwigJimmy which meant that the event loop was
infinite.
2008-10-07 Andy Buckley <andy@insectnation.org>
* Added SWIG Python interface --- just mapping Loader and
Generator (ignoring GeneratorState). Seems to work!
* Added missing TinyXML source files --- Python refused to load
the library since the symbols weren't defined.
2008-08-24 Andy Buckley <andy@insectnation.org>
* Fixed Sherpa detection --- boostrapping now works on lxplus.
* Added unindexed MODPDF and AUTPDF param names to FHerwig, since
you usually want both particles to have the same PDF setup, and
this is a nice bit of syntactic sugar.
* Herwig++ setup now uses the flags suggested by the herwig-config
script, and --with-thepeg is no longer used.
* Set default FHerwig process to be QCD 2->2.
* Removed FHerwig MAXEV and MAXER param handling, since their role
is irrelevant within AGILe.
* Added error-handling loops to FHerwig and FHerwigJimmy, so that
Herwig errors are caught and the event is re-generated until it
behaves itself.
2008-08-12 Andy Buckley <andy@insectnation.org>
* Added a AGILE_USE_AFS variable which can be set to "no" to stop
AGILe's generator loader from automatically inserting GENSER's AFS
path into the gen search path.
* Removed default matrix elements from Herwig++.
2008-08-11 Andy Buckley <andy@insectnation.org>
* src/Loader.cc: Every call to getenv now uses a separate "const
char*" return variable. CMTCONFIG env variable no longer used,
since it was not there unless using an ATLAS/LHCb build shell and
was in the wrong tag format anyway.
* src/CCHerwig/CCHerwig.cc: Added handling of a special INFILE
parameter, which is used as the argument to a ThePEG "read"
command.
* src/Loader.cc: Factorized findGenLib function into several
smaller functions to aid memory problem investigation.
2008-08-08 Andy Buckley <abuckley@cern.ch>
* C++ generator configure now fails gracefully.
* AlpGen and Charybdis now work with both Herwig and Pythia from
the Genser versions. Hurrah!
2008-08-05 Andy Buckley <andy@insectnation.org>
* Removed setting of Sherpa EVENT_MODE and ANALYSIS switches, as
recommended by Frank Siegert.
2008-08-04 Andy Buckley <andy@insectnation.org>
* Changed AlpGen and Charybdis to load using the Genser names. Get
segfaults at the moment, but the libs are at least detected on
lxplus.
* Loader tries to find LHAPDF library in both the Genser structure
and as a fallback to the normal $prefix type area.
2008-07-29 Andy Buckley <andy@insectnation.org>
* Loader now prefers the '.2' versions of Genser gens if possible,
since for the Fortran gens these are compiled with the larger
10000-entry HEPEVT common blocks (as opposed to the default 4000)
* Automated Herwig and Pythia's acquiring common block sizes -
fixes a problem with CERN Pythia installations.
* Fixed wrong flags on agile-config
2008-07-27 Andy Buckley <andy@insectnation.org>
* Added better tests for Boost headers.
* Added testing for -ansi, -pedantic and -Wall compiler flags.
* Removed Status returns from the interface.
2008-07-23 Andy Buckley <andy@insectnation.org>
* Added explicit Boost header checks, since old versions may not
have all the necessary headers.
2008-07-16 Andy Buckley <andy@insectnation.org>
* Improved debug info in the loader (again!)
* Tries to fall back to more Genser directories, such as
$GENSER/MCGenerators (for forward compatibility with Genser
boostrap script with mkGenserArea), and also to try the old
lib<gen><version>.<ext> convention.
* Now uses Boost foreach (if Rivet can, so can AGILe!)
2008-07-09 Andy Buckley <andy@insectnation.org>
* Loader improvements: LHAPDF availability is now tested as for
generators, and is done only once.
* Upgraded Sherpa to use new HepMC interface fixes. This requires
the unreleased Sherpa 1.1.2, either from trunk or beta tarball.
* Replaced cout and cerr with proper logging classes.
2008-07-07 Andy Buckley <andy@insectnation.org>
* Added "AGILE_" namespacing to all header guards.
* Added flag to Sherpa build to disable warnings about deprecated
"const char*" to "char*" implicit conversions. We can't do
anything about this and it's not a "real" problem at the binary
level.
* Compatibility fixes for GCC 4.3.
2008-07-04 Andy Buckley <andy@insectnation.org>
* Loader now only tests that libraries are present rather than
dlopen/dlclosing them when building the "available gens"
list. This solves the problems we've seen where Sherpa being
present breaks all the other generators (for reasons not fully
understood.)
* More Sherpa improvements: SHERPA_CPP_PATH and RESULTS_DIRECTORY
are now created if they weren't already present.
2008-06-19 Andy Buckley <andy@insectnation.org>
* Fix to Sherpa interface - changed header name in Sherpa version
1.1.1.
2008-06-11 Andy Buckley <andy@insectnation.org>
* AGILe 1.1.1 release.
2008-06-11 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Fixed dynamic loader for "enhanced" Herwigs to also load the
basic libAGILeFHerwig AGILe module.
* Added HWBEAM and HWUIDT param wrappers.
2008-06-10 Andy Buckley <andy@insectnation.org>
* Re-added assigning of the agilehandler variable in the library
loader. This had been accidentally removed but worked as a fluke
on Linux systems because dlsym seems to treat a null pointer as
meaning RTLD_DEFAULT: it broke on Mac OS X.
2008-06-06 Andy Buckley <andy@insectnation.org>
* Changed generator names to use a closer match to the Genser
convention, which means that Genser-convention version numbers can
be extracted. This fixes the problem with loading Pythia6 and
Pythia8 on CERN AFS.
2008-06-03 Andy Buckley <andy@insectnation.org>
* 1.1.0 release.
2008-05-28 Andy Buckley <andy@insectnation.org>
* Added conditional compilation of C++ generator Loader.cc entries
based on configure results, to avoid problems with AFS version of
SHERPA.
2008-05-15 Andy Buckley <andy@insectnation.org>
* Disabled loading f(py/hw)_dummies for AlgGen and Charybdis
interfaces, since they specialise the up* routines.
* Added LHAPDF loading to C++ gens.
* Fixed loading of LHAPDF in FHerwig and FPythia with fallback to
PDF dummy libs.
2008-05-13 Andy Buckley <andy@insectnation.org>
* Improved logging interface: log levels are now integers (for
cross-library compatibility and level setting also applies to
existing loggers.
2008-05-09 Andy Buckley <andy@insectnation.org>
* Added agile-config script.
* Merged Herwig++ 2.1 -> 2.2 implementation changes.
2008-04-23 Andy Buckley <andy@insectnation.org>
* Added a hack to make libtool able to use gfortran, thinking that
it's the F77 compiler.
2008-03-19 Andy Buckley <andy@insectnation.org>
* Added library versioning flags in the configure.ac file.
* Re-organised directory structure to allow builds of single
generators by "cd"ing to the appropriate subdirectory, and to
remove the redundant "Generators" layer.
2008-03-19 Andy Buckley <andy@insectnation.org>
* FPythia parameter passing now converts the param name to upper
case before passing to PYGIVE, since weird behaviour has been
noticed when passing the MDME params with lower-case names.
2008-03-18 Andy Buckley <andy@insectnation.org>
* Fixes to the Sherpa interface to make the paths work, to handle
the "normal makelibs exception" a bit better, and other general
tweaks. It now works, but SHERPA itself needs a patch to enable
the HepMC filling - this will be in the next version. HepMC >=
2.3.6 is required for the GenEvent copying to work properly.
2008-02-08 Andy Buckley <andy@insectnation.org>
* Fixes and extensions for HERA running added to FPythia and
FHerwig.
2008-01-22 Andy Buckley <andy@insectnation.org>
* FPythia now changed to use the Genser HEPEVT size of 10000 (the
mismatch with the previous default value of 4000 resulted in
generating lots of events with no momenta)
2008-01-17 Andy Buckley <andy@insectnation.org>
* Loader now tries to use the Genser liblinks area by default,
using a precomputed value and the CMTCONFIG variable as guesses
for the non-programmatic 'LGC platform tag'
* Fixed loader so that the FHerwig dummy HWAEND symbol gets
exported - FHerwig now works again.
* Added more configurable generator library loading, including new
AGILE_GEN_PATH variable.
* Added binreloc path detection.
2007-11-26 Andy Buckley <andy@insectnation.org>
* Removing RivetGun components and re-branding this project as
pure AGILe.
* Splitting generator library detection into AGIle
2007-10-31 Andy Buckley <andy@insectnation.org>
* Tagging as 1.0b3 for HERA-LHC meeting.
* Now dlopening LHAPDF all the time - this is because LHADF uses
some FPythia common blocks and the loading order is therefore
significant.
2007-10-29 Andy Buckley <andy@insectnation.org>
* Fixed FHerwigJimmy event loop: this aborted at the wrong point
and didn't handle MSPARM == 0 properly (it trapped it in an
infinite loop until the failure counter overflowed).
* Fixed istringstream handling of params by introducing the
templated as<T> functions and their asInt/Double/Bool wrappers in
Utils.hh. Previously the stream was being used many times, often
through stream failures, which led to nonsense results. The new
approach makes a new inline stream each time.
* Now linking LHAPDF against rivetgun executable.
* Got Charybdis working with FHerwig and loading properly (but not
running correctly) with FPythia.
2007-10-28 Andy Buckley <andy@insectnation.org>
* Using a vector of dlopen handles to allow arbitrary numbers of
libs to be dynamically loaded (dlopened).
2007-10-23 Andy Buckley <andy@insectnation.org>
* rivetgun now throws an error if it can't read a specified config
file.
2007-10-18 Andy Buckley <andy@insectnation.org>
* Removed default build of rivetgun-static.
* Using HepMC::GenEvent::clear() method.
* Removed defunct tests.
* Conversion of setParam methods to only implement the
string-valued one and to use stringstreams for type conversions
where needed.
* Added methods to Generator to perform common functionality:
these are conventionally called as utility functions by the
derived class implementations.
* Huge overhaul of generator classes: renames of Herwig++ class to
CCHerwig, introduction of AGILe namespace and header area, removal
of *Mod libraries, reworking of AlpGen, Jimmy and Charybdis
interfaces via inheritance, interface improvements to rivetgun.
2007-10-16 James Monk
* Fixed dynamic loading for Mac OS X.
2007-10-03 Andy Buckley <andy@insectnation.org>
* Added more Herwig++ features: now works but leaks memory per
event.
2007-10-02 Andy Buckley <andy@insectnation.org>
* Removed explicit FPythia::setParam and Herwig::setParam methods,
except for inlined versions to call the Generator::setParam
defaults.
* Made Generator::makeEvent and Generator::setSeed methods pure
virtual, since throwing a runtime_error by default wasn't
producing any helpful hints to interface implementers.
2007-09-28 Andy Buckley <andy@insectnation.org>
* Added portable paths to the Herwig++ tester and moved the new
Herwig++ control code into the existing Herwig class, which
doesn't really do what we want.
2007-09-26 Andy Buckley <andy@insectnation.org>
* Added autoconf Fortran portability features to RivetGun
executables and the Fortran Herwig, Pythia, AlpGen and Charybdis
generators.
2007-09-21 Andy Buckley <andy@insectnation.org>
* rivetgun executable now tests for ability to dlopen() each
potential generator library when building the command line list of
valid generators.
2007-06-24 Andy Buckley <andy@insectnation.org>
* Changed the logging of event numbers to use a specific logger
and to assign different log levels to every 100th and 1000th
event. Most event numbers are now at the DEBUG level and so won't
be shown by default.
* src/Test/RivetGunInterfaceStatic.cc: Moved the available
generators code into a new include/RivetGun/AvailableGenerators.hh
2007-06-16 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Make Pythia 6.411 the latest default.
2007-06-01 Doug Gingrich <gingrich@ualberta.ca>
* Added Charybdis interfaces, not yet linking them.
2007-05-23 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Added a local event counter for FPythia.
2007-05-17 Andy Buckley <andy@insectnation.org>
* Added convenience LTDL library, based on instructions at
http://www.gnu.org/software/libtool/manual.html#Distributing-libltdl
2007-02-09 Leif Lönnblad <Leif.Lonnblad@thep.lu.se>
* src/Test/RivetGunInterfaceStatic.cc: Now includes Generator.hh
to avoid compilation errors if stupid people try to compile
without any generators.
2006-12-19 Andy Buckley <andy.buckley@durham.ac.uk>
* Added src/Test/RivetGunInterfaceStatic.cc with command line
parsing handled by TCLAP (Templated Command Line Argument Parser).
2005-12-27 Leif Lönnblad <Leif.Lonnblad@thep.lu.se>
* configure.ac: Added -I$THEPEGPATH/include to AM_CPPFLAGS.
* Config/Rivet.h: Added some std incudes and using std::
declaration.
* Analysis/RivetInfo.*: Fixed some bugs. The RivetInfo facility
now works, although it has not been thoroughly tested.
* Analysis/Examples/TestMultiplicity.*: Re-introduced
FinalStateHCM for testing purposes but commented it away again.
* .: Made a number of changes to implement handling of RivetInfo
objects.
Index: trunk/src/FHerwig/FHerwig.cc
===================================================================
--- trunk/src/FHerwig/FHerwig.cc (revision 814)
+++ trunk/src/FHerwig/FHerwig.cc (revision 815)
@@ -1,644 +1,650 @@
// -*- C++ -*-
#include "AGILe/FHerwig/FHerwig.hh"
#include "AGILe/FHerwig/FHerwigWrapper65.hh"
#include "AGILe/Utils.hh"
#include "AGILe/HepMCTools.hh"
namespace AGILe {
namespace {
const size_t AUTPDF_LENGTH = 20;
const int SEED_OFFSET = 1799;
}
// Standard constructor
FHerwig::FHerwig()
: _doHadronise(true), _unitWeight(true), _iprocset(false)
{
_myName = "Herwig";
/// Herwig 6.5 uses HEPEVT with 4000/10000 entries and 8-byte floats
HepMC::HEPEVT_Wrapper::set_max_number_entries(FC_HWGETHEPEVTSIZE());
HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
// Set up particle names map: note that they must be 8 characters long
_particleNames[ELECTRON] = "E- ";
_particleNames[POSITRON] = "E+ ";
_particleNames[PROTON] = "P ";
_particleNames[ANTIPROTON] = "PBAR ";
_particleNames[NEUTRON] = "N ";
_particleNames[ANTINEUTRON] = "NBAR ";
_particleNames[PHOTON] = "GAMMA ";
_particleNames[MUON] = "MU- ";
_particleNames[ANTIMUON] = "MU+ ";
// TAU, ANTITAU
_particleNames[NU_E] = "NU_E ";
_particleNames[NU_EBAR] = "NU_EBAR ";
_particleNames[NU_MU] = "NU_MU ";
_particleNames[NU_MUBAR] = "NU_MUBAR";
_particleNames[NU_TAU] = "NU_TAU ";
_particleNames[NU_TAUBAR] = "NU_TAUBR";
_particleNames[PIPLUS] = "PI+ ";
_particleNames[PIMINUS] = "PI- ";
// PIZERO
// PHOTOELECTRON, PHOTOPOSITRON,
// PHOTOMUON, PHOTOANTIMUON,
// PHOTOTAU, PHOTOANTITAU,
// Start counting events at 1.
_nevt = 1;
}
// Set up initial state from supplied params
void FHerwig::setGenSpecificInitialState(int p1, double e1, int p2, double e2) {
MSG_DEBUG("Setting initial state...");
// Herwig's initial state particles specification must be 8 chars long
for (size_t i = 0; i < 8; ++i) {
FC_HWBMCH.PART1[i] = _particleNames[ParticleName(p1)].c_str()[i];
FC_HWBMCH.PART2[i] = _particleNames[ParticleName(p2)].c_str()[i];
}
// Set momenta / energies
// NB. Beam ordering is significant (segfault if "wrong") for HERA-like initial states
// Subtraction of (very rough!) beam particle masses to get momenta rather than energies
if (p1 == PROTON || p1 == ANTIPROTON || p1 == NEUTRON) e1 = sqrt(e1*e1 - 1.0);
if (p2 == PROTON || p2 == ANTIPROTON || p2 == NEUTRON) e2 = sqrt(e2*e2 - 1.0);
// And set the common block values
FC_HWPROC.PBEAM1 = e1;
FC_HWPROC.PBEAM2 = e2;
}
// Run generator initialization
void FHerwig::initialize() {
Generator::initialize();
// Use QCD 2->2 as the default process
if (!_iprocset) FC_HWPROC.IPROC = 1500;
// Print banner and initialise common blocks (requires initial state and IPROC to have been set)
FC_HWIGIN();
// for (size_t idhw = 1; idhw <= 458; ++idhw) {
// std::cout << idhw << " " << FC_HWPROP.IDPDG[idhw] << std::endl;
// }
// Set banner printout control params
FC_HWPRAM.IPRINT = 1; // Type of info to print
FC_HWPRAM.PRNDEF = 1; // Enable/disable ASCII output
// Set some system params which HWIGIN has initialised to silly values
FC_HWPROC.MAXEV = 10000000; // Maximum number of events (irrelevant!)
FC_HWEVNT.MAXER = 10000000; // Maximum number of allowed errors
FC_HWEVNT.MAXPR = 0; // Number of events to print
// Apply stored parameters
_processParams();
// Compute parameter-dependent constants
FC_HWUINC();
// Initialise elementary process
FC_HWEINI();
_initialized = true;
}
// Set random number seed
void FHerwig::setSeed(const int value) {
Generator::setSeed(value);
setParam("SEED", value);
}
// Gather user-provided parameters, applying only IPROC and the beam params
bool FHerwig::setParam(const string& name, const string& value) {
Generator::setParam(name, value);
if (name == "IPROC") {
// 1610 = gg -> H -> WW; 1706 = qq -> ttbar; 2510 = ttH -> ttWW, ...
MSG_INFO("Setting process code (IPROC) = " << asInt(value));
FC_HWPROC.IPROC = asInt(value);
_iprocset = true;
} else if (name == "PBEAM1") {
MSG_INFO("Setting beam 1 momentum (PBEAM1) = " << asDouble(value));
FC_HWPROC.PBEAM1 = asDouble(value);
} else if (name == "PBEAM2") {
MSG_INFO("Setting beam 2 momentum (PBEAM2) = " << asDouble(value));
FC_HWPROC.PBEAM2 = asDouble(value);
// } else if (name == "EBEAM1") {
// MSG_INFO("Setting beam 1 energy (EBEAM1) = " << asDouble(value));
// FC_HWPROC.EBEAM1 = asDouble(value);
// } else if (name == "EBEAM2") {
// MSG_INFO("Setting beam 2 energy (EBEAM2) = " << asDouble(value));
// FC_HWPROC.EBEAM2 = asDouble(value);
} else {
_storedParams[name] = value;
}
return SUCCESS;
}
// Set parameters.
bool FHerwig::_processParams() {
typedef pair<string,string> strpair;
foreach (const strpair& kv, _storedParams) {
const string& name = kv.first;
const string& value = kv.second;
// Strings
if (name.find("AUTPDF") != string::npos) {
if (name == "AUTPDF(1)" || name == "AUTPDF") {
MSG_INFO("Setting AUTPDF(1) = " << value);
const size_t nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
for (size_t i = 0; i < AUTPDF_LENGTH; ++i) {
if (i < nch) {
FC_HWPRCH.AUTPDF[0][i] = value.data()[i];
} else {
FC_HWPRCH.AUTPDF[0][i] = ' ';
}
}
}
if (name == "AUTPDF(2)" || name == "AUTPDF") {
MSG_INFO("Setting AUTPDF(2) = " << value);
const size_t nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
for (size_t i = 0; i < AUTPDF_LENGTH; ++i) {
if (i < nch) {
FC_HWPRCH.AUTPDF[1][i] = value.data()[i];
} else {
FC_HWPRCH.AUTPDF[1][i] = ' ';
}
}
}
}
// Integers (other than IPROC)
else if (name == "SEED") {
const int baseseed = asInt(value);
MSG_INFO("Setting random seeds based on this value (SEED) = " << baseseed);
FC_HWEVNT.NRN[0] = baseseed;
FC_HWEVNT.NRN[1] = baseseed + SEED_OFFSET;
FC_HWHARD.IBRN[0] = baseseed + 2*SEED_OFFSET;
FC_HWHARD.IBRN[1] = baseseed + 3*SEED_OFFSET;
} else if (name == "MAXPR") {
MSG_INFO("Setting max event printouts (MAXPR) = " << asInt(value));
FC_HWEVNT.MAXPR = asInt(value);
} else if (name == "IPRINT") {
MSG_INFO("Setting printout info code (IPRINT) = " << asInt(value));
FC_HWPRAM.IPRINT = asInt(value);
} else if (name == "CLDIR1") {
MSG_INFO("Setting smearing of perturbative quark pT in light cluster fission (CLDIR(1)) = " << asInt(value));
FC_HWPRAM.CLDIR[0] = asInt(value);
} else if (name == "CLDIR2") {
MSG_INFO("Setting smearing of perturbative quark pT in b cluster fission (CLDIR(2)) = " << asInt(value));
FC_HWPRAM.CLDIR[1] = asInt(value);
} else if (name == "IOPREM") {
MSG_INFO("Setting model for treatment of remnant clusters (IOPREM) = " << asInt(value));
FC_HWPRAM.IOPREM = asInt(value);
} else if (name == "ISPAC") {
MSG_INFO("Setting ISR forced branching IR behaviour (ISPAC) = " << asInt(value));
FC_HWPRAM.ISPAC = asInt(value);
} else if (name == "NFLAV") {
MSG_INFO("Setting number of flavours (NFLAV) = " << asInt(value));
FC_HWPRAM.NFLAV = asInt(value);
} else if (name == "NSTRU") {
MSG_INFO("Setting internal PDF ID... are you sure? (NSTRU) = " << asInt(value));
FC_HWPRAM.NSTRU = asInt(value);
} else if (name == "MODPDF") {
MSG_INFO("Setting PDFLIB IDs for both beams (MODPDF(1&2)) = " << asInt(value));
FC_HWPRAM.MODPDF[0] = asInt(value);
FC_HWPRAM.MODPDF[1] = asInt(value);
} else if (name == "MODPDF(1)") {
MSG_INFO("Setting PDFLIB ID for beam 1 (MODPDF(1)) = " << asInt(value));
FC_HWPRAM.MODPDF[0] = asInt(value);
} else if (name == "MODPDF(2)") {
MSG_INFO("Setting PDFLIB ID for beam 2 (MODPDF(2)) = " << asInt(value));
FC_HWPRAM.MODPDF[1] = asInt(value);
} else if (name == "IFLMAX") {
MSG_INFO("Setting max quark flavour in photoproduction (IFLMAX) = " << asInt(value));
FC_HWHARD.IFLMAX = asInt(value);
} else if (name == "LRSUD") {
MSG_INFO("Setting unit for reading Sudakov table (LRSUD) = " << asInt(value));
FC_HWPRAM.LRSUD = asInt(value);
} else if (name == "LWSUD") {
MSG_INFO("Setting unit for writing Sudakov table (LWSUD) = " << asInt(value));
FC_HWPRAM.LWSUD = asInt(value);
// } else if (name == "MODBOS") {
// MSG_INFO("Setting MODBOS = " << asInt(value));
// FC_HWBOSC.MODBOS[0] = asInt(value);
// Doubles
} else if (name == "ALPHEM") {
MSG_INFO("Setting alpha_EM (ALPHEM) = " << asDouble(value));
FC_HWPRAM.ALPHEM = asDouble(value);
} else if (name == "PTMIN") {
MSG_INFO("Setting minimum hard pt (PTMIN) = " << asDouble(value));
FC_HWHARD.PTMIN = asDouble(value);
} else if (name == "PTMAX") {
MSG_INFO("Setting maximum hard pt (PTMAX) = " << asDouble(value));
FC_HWHARD.PTMAX = asDouble(value);
} else if (name == "PTPOW") {
MSG_INFO("Setting power for reweight (PTPOW) = " << asDouble(value));
FC_HWHARD.PTPOW = asDouble(value);
} else if (name == "Q2WWMN") {
MSG_INFO("Setting minimum Q2 in equivalent photon approximation (Q2WWMN) = " << asDouble(value));
FC_HWHARD.Q2WWMN = asDouble(value);
} else if (name == "Q2WWMX") {
MSG_INFO("Setting maximum Q2 in equivalent photon approximation (Q2WWMX) = " << asDouble(value));
FC_HWHARD.Q2WWMX = asDouble(value);
} else if (name == "YWWMIN") {
MSG_INFO("Setting minimum photon light-cone fraction in equivalent photon approximation (YWWMIN) = " << asDouble(value));
FC_HWHARD.YWWMIN = asDouble(value);
} else if (name == "YWWMAX") {
MSG_INFO("Setting maximum photon light-cone fraction in equivalent photon approximation (YWWMAX) = " << asDouble(value));
FC_HWHARD.YWWMAX = asDouble(value);
} else if ( name =="WHMIN") {
MSG_INFO("Setting min hadronic mass in photon-induced (DIS) processes (WHMIN) = " << asDouble(value));
FC_HWHARD.WHMIN = asDouble(value);
} else if ( name =="EMMIN") {
MSG_INFO("Setting minimum DY boson mass (EMMIN) = "<< asDouble(value));
FC_HWHARD.EMMIN = asDouble(value);
} else if ( name =="EMMAX") {
MSG_INFO("Setting maximum DY boson mass (EMMIN) = "<< asDouble(value));
FC_HWHARD.EMMAX = asDouble(value);
} else if ( name =="EMPOW") {
MSG_INFO("Setting power for EM reweighting (EMPOW) = "<< asDouble(value));
FC_HWHARD.EMPOW = asDouble(value);
} else if ( name =="EMSCA") {
MSG_INFO("Setting ??? for EM (EMSCA) = "<< asDouble(value));
FC_HWHARD.EMSCA = asDouble(value);
} else if (name == "PRECO") {
MSG_INFO("Setting probability of cluster colour reassignment (PRECO) = " << asDouble(value));
FC_HWUCLU.PRECO = asDouble(value);
} else if (name == "PDFX0") {
MSG_INFO("Setting maximum x for saturation effects (PDFX0) = " << asDouble(value));
FC_HW6506.PDFX0 = asDouble(value);
} else if (name == "PDFPOW") {
MSG_INFO("Setting suppression of PDFs below x0 (PDFPOW) = " << asDouble(value));
FC_HW6506.PDFPOW = asDouble(value);
} else if (name == "BTCLM") {
MSG_INFO("Setting remnant cluster mass param adjustment (BTCLM) = " << asDouble(value));
FC_HWPRAM.BTCLM = asDouble(value);
} else if (name == "CLMAX") {
MSG_INFO("Setting cluster mass offset (CLMAX) = " << asDouble(value));
FC_HWPRAM.CLMAX = asDouble(value);
} else if (name == "CLPOW") {
MSG_INFO("Setting exponent of cluster fission (CLPOW) = " << asDouble(value));
FC_HWPRAM.CLPOW = asDouble(value);
} else if (name == "CLSMR1") {
MSG_INFO("Setting Gaussian quark pT smearing width for light clusters (CLSMR(1)) = " << asDouble(value));
FC_HWPRAM.CLSMR[0] = asDouble(value);
} else if (name == "CLSMR2") {
MSG_INFO("Setting Gaussian quark pT smearing width for b clusters (CLSMR(2)) = " << asDouble(value));
FC_HWPRAM.CLSMR[1] = asDouble(value);
} else if (name == "PRSOF") {
MSG_INFO("Setting probablility of soft scatters (PRSOF) = " << asDouble(value));
FC_HWPRAM.PRSOF = asDouble(value);
} else if (name == "PSPLT1") {
MSG_INFO("Setting cluster mass spectrum exponent for light clusters (PSPLT(1)) = " << asDouble(value));
FC_HWPRAM.PSPLT[0] = asDouble(value);
} else if (name == "PSPLT2") {
MSG_INFO("Setting cluster mass spectrum exponent for b clusters (PSPLT(2)) = " << asDouble(value));
FC_HWPRAM.PSPLT[1] = asDouble(value);
}
// Following params are useful for MPI/ISR tunes:
else if (name == "PTRMS") {
MSG_INFO("Setting intrinsic kT (PTRMS) = " << asDouble(value));
FC_HWPRAM.PTRMS = asDouble(value);
} else if (name == "QCDLAM") {
MSG_INFO("Setting Lambda_QCD for alpha_s running (QCDLAM) = " << asDouble(value));
FC_HWPRAM.QCDLAM = asDouble(value);
} else if (name == "QSPAC") {
MSG_INFO("Setting Q cutoff for spacelike (ISR) shower (QSPAC) = " << asDouble(value));
FC_HWPRAM.QSPAC = asDouble(value);
} else if (name == "VGCUT") {
MSG_INFO("Setting gluon virtuality cutoff in parton showers (VGCUT) = " << asDouble(value));
FC_HWPRAM.VGCUT = asDouble(value);
} else if (name == "VQCUT") {
MSG_INFO("Setting quark virtuality cutoff in parton showers (VQCUT) = " << asDouble(value));
FC_HWPRAM.VQCUT = asDouble(value);
} else if (name == "ZMXISR") {
MSG_INFO("Setting max. momentum fraction for photon ISR (ZMXISR) = " << asDouble(value));
FC_HWHARD.ZMXISR = asDouble(value);
}
// End MPI/ISR tune params
else if (name == "VPCUT") {
MSG_INFO("Setting photon virtuality cutoff (VPCUT) = " << asDouble(value));
FC_HWPRAM.VPCUT = asDouble(value);
} else if (name == "OMEGA0") {
MSG_INFO("Setting omega_0 param in Mueller-Tang pomeron for IPROC=2400 (OMEGA0) = " << asDouble(value));
FC_HWHARD.OMEGA0 = asDouble(value);
} else if (name == "ASFIXD") {
MSG_INFO("Setting a_s param in Mueller-Tang pomeron for IPROC=2400 (ASFIXD) = " << asDouble(value));
FC_HWHARD.ASFIXD = asDouble(value);
} else if (name == "Q2MIN") {
MSG_INFO("Setting minimum DIS Q2 (Q2MIN) = " << asDouble(value));
FC_HWHARD.Q2MIN = asDouble(value);
} else if (name == "Q2MAX") {
MSG_INFO("Setting maximum DIS Q2 (Q2MAX) = " << asDouble(value));
FC_HWHARD.Q2MAX = asDouble(value);
} else if (name == "Q2POW") {
MSG_INFO("Setting reweighting power in DIS Q2 (Q2POW) = " << asDouble(value));
FC_HWHARD.Q2POW = asDouble(value);
} else if (name == "Q2WWMN") {
MSG_INFO("Setting Q2WWMN (Q2WWMN) = " << asDouble(value));
FC_HWHARD.Q2WWMN = asDouble(value);
} else if (name == "Q2WWMX") {
MSG_INFO("Setting Q2WWMX (Q2WWMX) = " << asDouble(value));
FC_HWHARD.Q2WWMX = asDouble(value);
} else if (name == "QLIM") {
MSG_INFO("Setting QLIM (QLIM) = " << asDouble(value));
FC_HWHARD.QLIM = asDouble(value);
} else if (name == "YBMIN") {
MSG_INFO("Setting minimum Bjorken y=Q2/xs (YBMIN) = " << asDouble(value));
FC_HWHARD.YBMIN = asDouble(value);
} else if (name == "YBMAX") {
MSG_INFO("Setting maximum Bjorken y=Q2/xs (YBMAX) = " << asDouble(value));
FC_HWHARD.YBMAX = asDouble(value);
} else if (name == "YJMIN") {
MSG_INFO("Setting minimum ??? (YJMIN) = " << asDouble(value));
FC_HWHARD.YJMIN = asDouble(value);
} else if (name == "YJMAX") {
MSG_INFO("Setting maximum ??? (YJMAX) = " << asDouble(value));
FC_HWHARD.YJMAX = asDouble(value);
} else if (name == "YWWMIN") {
MSG_INFO("Setting minimum ??? (YWWMIN) = " << asDouble(value));
FC_HWHARD.YWWMIN = asDouble(value);
} else if (name == "YWWMAX") {
MSG_INFO("Setting maximum ??? (YWWMAX) = " << asDouble(value));
FC_HWHARD.YWWMAX = asDouble(value);
} else if (name == "XX1") {
MSG_INFO("Setting ??? (XX(1)) = " << asDouble(value));
FC_HWHARD.XX[0] = asDouble(value);
} else if (name == "XX2") {
MSG_INFO("Setting ??? (XX(2)) = " << asDouble(value));
FC_HWHARD.XX[1] = asDouble(value);
} else if (name == "XLMIN") {
MSG_INFO("Setting minimum ??? (XLMIN) = " << asDouble(value));
FC_HWHARD.XLMIN = asDouble(value);
} else if (name == "XXMIN") {
MSG_INFO("Setting minimum ??? (XXMIN) = " << asDouble(value));
FC_HWHARD.XXMIN = asDouble(value);
} else if (name == "WHMIN") {
MSG_INFO("Setting minimum ??? (WHMIN) = " << asDouble(value));
FC_HWHARD.WHMIN = asDouble(value);
} else if (name == "ZJMAX") {
MSG_INFO("Setting maximum ??? (ZJMAX) = " << asDouble(value));
FC_HWHARD.ZJMAX = asDouble(value);
} else if (name == "TMNISR") {
MSG_INFO("Setting minimum ??? (TMNISR) = " << asDouble(value));
FC_HWHARD.TMNISR = asDouble(value);
} else if (name == "ZMXISR") {
MSG_INFO("Setting maximum ??? in ISR (ZMXISR) = " << asDouble(value));
FC_HWHARD.ZMXISR = asDouble(value);
} else if (name == "THMAX") {
MSG_INFO("Setting maximum ??? (THMAX) = " << asDouble(value));
FC_HWHARD.THMAX = asDouble(value);
} else if (name == "Y4JT") {
MSG_INFO("Setting ??? (Y4JT) = " << asDouble(value));
FC_HWHARD.Y4JT = asDouble(value);
} else if (name == "SINS") {
MSG_INFO("Setting ??? (SINS) = " << asDouble(value));
FC_HWHARD.SINS = asDouble(value);
} else if (name == "PLTCUT") {
MSG_INFO("Setting lifetime cut (PLTCUT) = " << asDouble(value));
FC_HWDIST.PLTCUT = asDouble(value);
} else if (name == "GAMW") {
MSG_INFO("Setting W width (GAMW) = " << asDouble(value));
FC_HWPRAM.GAMW = asDouble(value);
} else if (name == "GAMZ") {
MSG_INFO("Setting Z0 width (GAMZ) = " << asDouble(value));
FC_HWPRAM.GAMZ = asDouble(value);
} else if (name == "GAMZP") {
MSG_INFO("Setting Z0/gamma width (GAMZP) = " << asDouble(value));
FC_HWPRAM.GAMZP = asDouble(value);
} else if (name == "H1MIX") {
/// @todo Add meaning of param (Higgs mixing angle?)
MSG_INFO("Setting H1MIX (H1MIX) = " << asDouble(value));
FC_HWPRAM.H1MIX = asDouble(value);
} else if (name == "PHIMIX") {
/// @todo Add meaning of param (??? mixing angle?)
MSG_INFO("Setting PHIMIX (PHIMIX) = " << asDouble(value));
FC_HWPRAM.PHIMIX = asDouble(value);
}
// NB. The -1 C-Fortran array offset does not apply for RMASS, which is declared as (0:NMXRES).
else if (name == "RMASS(1)") {
MSG_INFO("Setting down mass (RMASS(1)) = " << asDouble(value));
FC_HWPROP.RMASS[1] = asDouble(value);
} else if (name == "RMASS(2)") {
MSG_INFO("Setting up mass (RMASS(2)) = " << asDouble(value));
FC_HWPROP.RMASS[2] = asDouble(value);
} else if (name == "RMASS(3)") {
MSG_INFO("Setting strange mass (RMASS(3)) = " << asDouble(value));
FC_HWPROP.RMASS[3] = asDouble(value);
} else if (name == "RMASS(4)") {
MSG_INFO("Setting charm mass (RMASS(4)) = " << asDouble(value));
FC_HWPROP.RMASS[4] = asDouble(value);
} else if (name == "RMASS(5)") {
MSG_INFO("Setting bottom mass (RMASS(5)) = " << asDouble(value));
FC_HWPROP.RMASS[5] = asDouble(value);
} else if (name == "RMASS(6)") {
MSG_INFO("Setting top mass (RMASS(6)) = " << asDouble(value));
FC_HWPROP.RMASS[6] = asDouble(value);
} else if (name == "RMASS(198)") {
MSG_INFO("Setting W+ mass (RMASS(198)) = " << asDouble(value));
FC_HWPROP.RMASS[198] = asDouble(value);
} else if (name == "RMASS(199)") {
MSG_INFO("Setting W- mass (RMASS(199)) = " << asDouble(value));
FC_HWPROP.RMASS[199] = asDouble(value);
} else if (name == "RMASS(200)") {
MSG_INFO("Setting Z0 mass (RMASS(200)) = " << asDouble(value));
FC_HWPROP.RMASS[200] = asDouble(value);
} //...
// Booleans (done as ints in Fortran)
else if (name == "GENSOF") {
MSG_INFO("Setting ... (GENSOF) = " << asInt(value));
FC_HWEVNT.GENSOF = asInt(value);
} else if (name == "AZSOFT") {
MSG_INFO("Setting use of soft gluon azimuthal corellations on/off (AZSOFT) = " << asInt(value));
FC_HWPRAM.AZSOFT = asInt(value);
} else if (name == "CLRECO") {
MSG_INFO("Setting inclusion of colour rearrangement on/off (CLRECO) = " << asInt(value));
FC_HWUCLU.CLRECO = asInt(value);
} else if (name == "AZSPIN") {
MSG_INFO("Setting use of gloun spin azimuthal correlations on/off (AZSPIN) = " << asInt(value));
FC_HWPRAM.AZSPIN = asInt(value);
} else if (name == "ZPRIME") {
MSG_INFO("Setting Z' flag (ZPRIME) = " << asInt(value));
FC_HWPRAM.ZPRIME = asInt(value);
} else if (name == "HARDME") {
MSG_INFO("Setting hard matrix element flag (HARDME) = " << asInt(value));
FC_HWPRAM.HARDME = asInt(value);
} else if (name == "SOFTME") {
MSG_INFO("Setting soft matrix element flag (SOFTME) = " << asInt(value));
FC_HWPRAM.SOFTME = asInt(value);
} else if (name == "NOSPAC") {
MSG_INFO("Setting spacelike showers on/off (NOSPAC) = " << asInt(value));
FC_HWPRAM.NOSPAC = asInt(value);
} else if (name == "PRVTX") {
MSG_INFO("Setting inclusion of vertex info in event printout on/off (PRVTX) = " << asInt(value));
FC_HWPRAM.PRVTX = asInt(value);
} else if (name == "PRNDEC") {
MSG_INFO("Setting use of decimal in event printout (PRNDEC) = " << asInt(value));
FC_HWPRAM.PRNDEC = asInt(value);
} else if (name == "PRNDEF") {
MSG_INFO("Setting stdout printout on/off (PRNDEF) = " << asInt(value));
FC_HWPRAM.PRNDEF = asInt(value);
} else if (name == "PRNTEX") {
MSG_INFO("Setting LaTeX output on/off (PRNTEX) = " << asInt(value));
FC_HWPRAM.PRNTEX = asInt(value);
} else if (name == "PRNWEB") {
MSG_INFO("Setting HTML output on/off (PRNWEB) = " << asInt(value));
FC_HWPRAM.PRNWEB = asInt(value);
} else if (name == "MIXING") {
MSG_INFO("Setting neutral B mixing on/off (MIXING) = " << asInt(value));
FC_HWDIST.MIXING = asInt(value);
} else if (name == "NOWGT") {
MSG_INFO("Setting unweighted generation (NOWGT) = " << asInt(value));
FC_HWEVNT.NOWGT = asInt(value);
} else if (name == "DoHadronisation") {
MSG_INFO("Do hadronisation = " << value);
_doHadronise = asBool(value);//...
} else if (name == "unitWeight") {
MSG_INFO("Using a weight value of 1 in unweighted events = " << value);
_unitWeight = asBool(value);
// Error
} else {
MSG_ERROR("Herwig doesn't have a parameter called " << name);
return FAILURE;
}
}
return SUCCESS;
}
// Run the generator for one event
void FHerwig::makeEvent(HepMC::GenEvent& evt) {
// Loop until event works
while (true) {
Generator::makeEvent(evt);
FC_HWUINE(); // Initialize event
FC_HWEPRO(); // Generate hard subprocess
FC_HWBGEN(); // Generate parton cascade
FC_HWDHOB(); // Do heavy quark decays
if(_doHadronise){
FC_HWCFOR(); // Do cluster formation
FC_HWCDEC(); // Do cluster decays
FC_HWDHAD(); // Do unstable particle decays
FC_HWDHVY(); // Do heavy flavor decays
}
FC_HWMEVT(); // Add soft underlying event
FC_HWUFNE(); // Finish event
if (FC_HWEVNT.IERROR == 0) break;
}
// Fill event from HEPEVT
fillEvent(evt);
// Increment an event counter (Pythia does not count for itself).
_nevt++;
}
/// Fill a HepMC event
void FHerwig::fillEvent(HepMC::GenEvent& evt) {
HepMC::IO_HERWIG hepevt;
hepevt.fill_next_event(&evt);
fixHepMCUnitsFromGeVmm(evt);
evt.set_event_number(_nevt);
// Set beam particle status = 4
if (evt.valid_beam_particles()) {
evt.beam_particles().first->set_status(4);
evt.beam_particles().second->set_status(4);
}
+ // Rewrite status codes to match HepMC standard (2 -> 3, 195-199 -> 2)
+ for (HepMC::GenEvent::particle_const_iterator p = evt.particles_begin(); p != evt.particles_end(); ++p) {
+ if ((*p)->status() == 2) (*p)->set_status(3);
+ if ((*p)->status() >= 195 && (*p)->status() <= 199) (*p)->set_status(2);
+ }
+
//IO_HERWIG::fillEvent does not fill the weight
evt.weights().clear();
if(FC_HWEVNT.NOWGT == 0 || !_unitWeight){
evt.weights().push_back(FC_HWEVNT.EVWGT);
}else{
evt.weights().push_back(1.0);
}
// Cross-section
#ifdef HEPMC_HAS_CROSS_SECTION
HepMC::GenCrossSection xsec;
const double xsecval = getCrossSection();
const double xsecerr = getCrossSection() / std::sqrt(_nevt);
MSG_DEBUG("Writing cross-section = " << xsecval << " +- " << xsecerr);
xsec.set_cross_section(xsecval, xsecerr);
evt.set_cross_section(xsec);
#endif
}
// Return the beam number (0 or 1) of a particle.
// Return -1 if not a beam particle
int FHerwig::_beamNumber(PdgCode pid) {
string pName = _particleNames[pid];
string beamName = "";
for (int i = 0; i < 8; ++i) {
beamName += FC_HWBMCH.PART1[i];
}
if (beamName.compare(pName) == 0) return 0;
for (int i = 0; i < 8; ++i) {
beamName += FC_HWBMCH.PART2[i];
}
if (beamName.compare(pName) == 0) return 1;
return -1;
}
string FHerwig::getPDFSet(PdgCode pid){
const int beamNum = _beamNumber(pid);
if (beamNum < 0) {
throw runtime_error("PDFSet unknown for PDG code " + pid);
}
string autString = "";
for (size_t ii = 0; ii != AUTPDF_LENGTH; ++ii) {
autString += FC_HWPRCH.AUTPDF[beamNum][ii];
}
return autString;
}
int FHerwig::getPDFMember(PdgCode pid){
const int beamNum = _beamNumber(pid);
if (beamNum < 0) {
throw runtime_error("PDFMember unknown for PDG code "+ pid);
}
const int member = FC_HWPRAM.MODPDF[beamNum];
return member;
}
string FHerwig::getPDFScheme(PdgCode pid) const {
return "LHAPDF";
}
const double FHerwig::getCrossSection(){
_crossSection = 1000.0 * FC_HWEVNT.WGTSUM / ((float)FC_HWEVNT.NWGTS);
return _crossSection;
}
/// Tidy up, print out run stats, etc.
void FHerwig::finalize() {
MSG_DEBUG("Finalising...");
FC_HWEFIN();
}
}
// Class factory
extern "C" {
AGILe::Generator* create() { return new AGILe::FHerwig(); }
void destroy(AGILe::Generator* gen) { delete gen; }
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Sep 30, 5:43 AM (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6566289
Default Alt Text
(52 KB)

Event Timeline