Page MenuHomeHEPForge

No OneTemporary

diff --git a/MatrixElement/FxFx/FxFxEventHandler.h b/MatrixElement/FxFx/FxFxEventHandler.h
--- a/MatrixElement/FxFx/FxFxEventHandler.h
+++ b/MatrixElement/FxFx/FxFxEventHandler.h
@@ -1,448 +1,448 @@
// -*- C++ -*-
//
// FxFxEventHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef THEPEG_FxFxEventHandler_H
#define THEPEG_FxFxEventHandler_H
//
// This is the declaration of the FxFxEventHandler class.
//
#include "ThePEG/Handlers/EventHandler.h"
#include "FxFxEventHandler.fh"
#include "FxFxReader.fh"
#include "FxFxAnalysis.h"
#include "ThePEG/Utilities/CompSelector.h"
#include "ThePEG/Utilities/XSecStat.h"
namespace ThePEG {
/**
* The FxFxEventHandler inherits from the general EventHandler
* class and administers the reading of events generated by external
* matrix element generator programs according to the Les Houches
* accord.
*
* The class has a list of <code>FxFxReader</code>s which
* typically are connected to files with event data produced by
* external matrix element generator programs. When an event is
* requested by FxFxEventHandler, one of the readers are chosen,
* an event is read in and then passed to the different
* <code>StepHandler</code> defined in the underlying
* EventHandler class.
*
* @see \ref FxFxEventHandlerInterfaces "The interfaces"
* defined for FxFxEventHandler.
*/
class FxFxEventHandler: public EventHandler {
public:
/**
* A vector of FxFxReader objects.
*/
typedef vector<FxFxReaderPtr> ReaderVector;
/**
* A selector of readers.
*/
typedef CompSelector<int,CrossSection> ReaderSelector;
/**
* Enumerate the weighting options.
*/
enum WeightOpt {
unitweight = 1, /**< All events have unit weight. */
unitnegweight = -1, /**< All events have wight +/- 1. */
varweight = 2, /**< Varying positive weights. */
varnegweight = -2 /**< Varying positive or negative weights. */
};
friend class FxFxHandler;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
FxFxEventHandler()
: theWeightOption(unitweight), theUnitTolerance(1.0e-6), warnPNum(true), theNormWeight(0)
{
selector().tolerance(unitTolerance());
}
/**
* The destructor.
*/
virtual ~FxFxEventHandler();
//@}
public:
/** @name Initialization and finalization functions. */
//@{
/**
* Initialize this event handler and all related objects needed to
* generate events.
*/
virtual void initialize();
/**
* Write out accumulated statistics about intergrated cross sections
* and stuff.
*/
virtual void statistics(ostream &) const;
/**
* Histogram scale. A histogram bin which has been filled with the
* weights associated with the Event objects should be scaled by
* this factor to give the correct cross section.
*/
virtual CrossSection histogramScale() const;
/**
* The estimated total integrated cross section of the processes
* generated in this run.
* @return 0 if no integrated cross section could be estimated.
*/
virtual CrossSection integratedXSec() const;
virtual int ntriesinternal() const;
/**
* The estimated error in the total integrated cross section of the
* processes generated in this run.
* @return 0 if no integrated cross section error could be estimated.
*/
virtual CrossSection integratedXSecErr() const;
virtual map<string,CrossSection> optintegratedXSecMap() const;
//@}
/** @name Functions used for the actual generation */
//@{
/**
* Generate an event.
*/
virtual EventPtr generateEvent();
/**
* Create the Event and Collision objects. Used by the
* generateEvent() function.
*/
virtual tCollPtr performCollision();
/**
* Continue generating an event if the generation has been stopped
* before finishing.
*/
virtual EventPtr continueEvent();
//@}
/** @name Functions to manipulate statistics. */
//@{
/**
* An event has been selected. Signal that an event has been
* selected with the given \a weight. If unit weights are requested,
* the event will be accepted with that weight. This also takes care
* of the statistics collection of the selected reader object.
*/
void select(double weight);
/**
* Accept the current event, taking care of the statistics
* collection of the corresponding reader objects.
*/
void accept();
/**
* Reject the current event, taking care of the statistics
* collection of the corresponding reader objects.
*/
void reject(double weight);
/**
* Increase the overestimated cross section for the selected reader.
*/
void increaseMaxXSec(CrossSection maxxsec);
/**
* Skip some events. To ensure a reader file is scanned an even
* number of times, skip a number of events for the selected reader.
*/
void skipEvents();
//@}
/** @name Simple access functions. */
//@{
/**
* The way weights are to be treated.
*/
WeightOpt weightOption() const { return theWeightOption; }
/**
* If the weight option is set to unit weight, do not start
* compensating unless the weight is this much larger than unity.
*/
double unitTolerance() const { return theUnitTolerance; }
/**
* Access the list of readers.
*/
const ReaderVector & readers() const { return theReaders; }
/**
* The selector to choose readers according to their overestimated
* cross section.
*/
const ReaderSelector & selector() const { return theSelector; }
/**
* The currently selected reader object.
*/
tFxFxReaderPtr currentReader() const { return theCurrentReader; }
/**
* Set the currently selected reader object.
*/
void currentReader(tFxFxReaderPtr x) { theCurrentReader = x; }
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
/**
* The currently selected reader object.
*/
tFxFxReaderPtr theCurrentReader;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish();
//@}
protected:
/**
* Access the list of readers.
*/
ReaderVector & readers() { return theReaders; }
/**
* The selector to choose readers according to their overestimated
* cross section.
*/
ReaderSelector & selector() { return theSelector; }
/**
* Helper function for the interface;
*/
void setUnitTolerance(double);
/**
* Collect statistics for this event handler.
*/
XSecStat stats;
map<string,XSecStat> optstats;
map<string,CrossSection> optxs;
int ntries;
map<string,XSecStat> OptStatsFunc() { return optstats; }
map<string,CrossSection> OptXsFunc() { return optxs; }
/**
* Collect statistics for this event handler. To be used for
* histogram scaling.
*/
XSecStat histStats;
map<string,XSecStat> opthistStats;
/*
* The weight identifiers for the events
*/
vector<string> weightnames;
private:
/**
* The list of readers.
*/
ReaderVector theReaders;
/**
* The selector to choose readers according to their overestimated
* cross section.
*/
ReaderSelector theSelector;
/**
* The way weights are to be treated.
*/
WeightOpt theWeightOption;
/**
* If the weight option is set to unit weight, do not start
* compensating unless the weight is this much larger than unity.
*/
double theUnitTolerance;
/**
* Warn if the same process number is used in more than one
* FxFxReader.
*/
bool warnPNum;
/**
* How to normalize the weights
*/
unsigned int theNormWeight;
public:
/** @cond EXCEPTIONCLASSES */
/**
* Exception class used if no readers were assigned.
*/
class FxFxInitError: public InitException {};
/**
* Exception class used if the same process number is used by more
* than ne reader.
*/
class FxFxPNumException: public InitException {};
/** @endcond */
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<FxFxEventHandler> initFxFxEventHandler;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
FxFxEventHandler & operator=(const FxFxEventHandler &) = delete;
};
}
// CLASSDOC OFF
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of FxFxEventHandler. */
template <>
struct BaseClassTrait<FxFxEventHandler,1> {
/** Typedef of the first base class of FxFxEventHandler. */
typedef EventHandler NthBase;
};
/** This template specialization informs ThePEG about the name of
* the FxFxEventHandler class and the shared object where it is defined. */
template <>
struct ClassTraits<FxFxEventHandler>
: public ClassTraitsBase<FxFxEventHandler> {
/** Return a platform-independent class name */
static string className() { return "Herwig::FxFxEventHandler"; }
/** Return the name of the shared library be loaded to get access to
* the FxFxEventHandler class and every other class it uses
* (except the base class). */
- static string library() { return "FxFx.so"; }
+ static string library() { return "HwFxFx.so"; }
};
/** @endcond */
}
#endif /* THEPEG_FxFxEventHandler_H */
diff --git a/MatrixElement/FxFx/FxFxFileReader.h b/MatrixElement/FxFx/FxFxFileReader.h
--- a/MatrixElement/FxFx/FxFxFileReader.h
+++ b/MatrixElement/FxFx/FxFxFileReader.h
@@ -1,333 +1,333 @@
// -*- C++ -*-
//
// FxFxFileReader.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef THEPEG_FxFxFileReader_H
#define THEPEG_FxFxFileReader_H
// This is the declaration of the FxFxFileReader class.
#include "FxFxReader.h"
#include "FxFxFileReader.fh"
#include "ThePEG/PDT/Decayer.h"
#include "ThePEG/Utilities/CFileLineReader.h"
#include <stdio.h>
namespace ThePEG {
/**
* FxFxFileReader is an base class to be used for objects which
* reads event files from matrix element generators. It inherits from
* FxFxReader and extends it by defining a file handle to be
* read from, which is opened and closed by the open() and close()
* functions. Note that the file handle is a standard C filehandle and
* not a C++ stream. This is because there is no standard way in C++
* to connect a pipe to a stream for reading eg. gzipped files. This
* class is able to read plain event files conforming to the Les
* Houches Event File accord.
*
* @see \ref FxFxFileReaderInterfaces "The interfaces"
* defined for FxFxFileReader.
* @see Event
* @see FxFxReader
*/
class FxFxFileReader: public FxFxReader {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
FxFxFileReader() : neve(0), ieve(0), theQNumbers(false), theIncludeFxFxTags(true),
theIncludeCentral(false) {}
/**
* Copy-constructor. Note that a file which is opened in the object
* copied from will have to be reopened in this.
*/
FxFxFileReader(const FxFxFileReader &);
/**
* Destructor.
*/
virtual ~FxFxFileReader();
//@}
public:
/** @name Virtual functions specified by the FxFxReader base class. */
//@{
/**
* Initialize. This function is called by the FxFxEventHandler
* to which this object is assigned.
*/
virtual void initialize(FxFxEventHandler & eh);
/**
* Open a file with events. Derived classes should overwrite it and
* first calling it before reading in the run information into the
* corresponding protected variables.
*/
virtual void open();
/**
* Close the file from which events have been read.
*/
virtual void close();
/**
* Read the next event from the file or stream into the
* corresponding protected variables. Return false if there is no
* more events or if this was not a LHF event file.
*/
virtual bool doReadEvent();
//@}
/**
* Return the name of the file from where to read events.
*/
string filename() const { return theFileName; }
/* vector<string> optionalWeightsNames;
virtual vector<string> optWeightNamesFunc();*/
virtual vector<string> optWeightsNamesFunc();
/**
* Erases all occurences of a substring from a string
*/
void erase_substr(std::string& subject, const std::string& search);
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
/** @name Standard (and non-standard) Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Return true if this object needs to be initialized before all
* other objects because it needs to extract PDFs from the event file.
*/
virtual bool preInitialize() const;
//@
protected:
/**
* The wrapper around the C FILE stream from which to read
*/
CFileLineReader cfile;
protected:
/**
* The number of events in this file.
*/
long neve;
/**
* The current event number.
*/
long ieve;
/**
* If the file is a standard Les Houches formatted file (LHF) this
* is its version number. If empty, this is not a Les Houches
* formatted file
*/
string LHFVersion;
/**
* If LHF. All lines (since the last open() or readEvent()) outside
* the header, init and event tags.
*/
string outsideBlock;
/**
* If LHF. All lines from the header block.
*/
string headerBlock;
/**
* If LHF. Additional comments found in the init block.
*/
string initComments;
/**
* If LHF. Map of attributes (name-value pairs) found in the init
* tag.
*/
map<string,string> initAttributes;
/**
* If LHF. Additional comments found with the last read event.
*/
string eventComments;
/**
* If LHF. Map of attributes (name-value pairs) found in the last
* event tag.
*/
map<string,string> eventAttributes;
private:
/**
* The name of the file from where to read events.
*/
string theFileName;
/**
* Whether or not to search for QNUMBERS stuff
*/
bool theQNumbers;
/**
* Include/Read FxFx tags
*/
bool theIncludeFxFxTags;
/**
* Include central weight (for backup use)
*/
bool theIncludeCentral;
/**
* Decayer for any decay modes read from the file
*/
DecayerPtr theDecayer;
/**
* Further information on the weights
*/
map<string,string> scalemap;
/**
* Temporary holder for optional weights
*/
map<string,double> optionalWeightsTemp;
private:
/**
* Describe an abstract base class with persistent data.
*/
static ClassDescription<FxFxFileReader> initFxFxFileReader;
/**
* Private and non-existent assignment operator.
*/
FxFxFileReader & operator=(const FxFxFileReader &) = delete;
public:
/** @cond EXCEPTIONCLASSES */
/** Exception class used by FxFxFileReader if reading the file
* fails. */
class FxFxFileError: public Exception {};
/** @endcond */
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* This template specialization informs ThePEG about the
* base class of FxFxFileReader.
*/
template <>
struct BaseClassTrait<FxFxFileReader,1>: public ClassTraitsType {
/** Typedef of the base class of FxFxFileReader. */
typedef FxFxReader NthBase;
};
/**
* This template specialization informs ThePEG about the name of the
* FxFxFileReader class and the shared object where it is
* defined.
*/
template <>
struct ClassTraits<FxFxFileReader>
: public ClassTraitsBase<FxFxFileReader> {
/**
* Return the class name.
*/
static string className() { return "Herwig::FxFxFileReader"; }
/**
* Return the name of the shared library to be loaded to get access
* to the FxFxFileReader class and every other class it uses
* (except the base class).
*/
- static string library() { return "FxFx.so"; }
+ static string library() { return "HwFxFx.so"; }
};
/** @endcond */
}
#endif /* THEPEG_FxFxFileReader_H */
diff --git a/MatrixElement/FxFx/FxFxHandler.h b/MatrixElement/FxFx/FxFxHandler.h
--- a/MatrixElement/FxFx/FxFxHandler.h
+++ b/MatrixElement/FxFx/FxFxHandler.h
@@ -1,658 +1,658 @@
// -*- C++ -*-
#ifndef HERWIG_FxFxHandler_H
#define HERWIG_FxFxHandler_H
//
// This is the declaration of the FxFxHandler class.
//
#include "Herwig/Shower/QTilde/QTildeShowerHandler.h"
#include "Herwig/Shower/ShowerHandler.h"
#include "ThePEG/Config/Pointers.h"
#include "Herwig/Shower/ShowerAlpha.h"
#include "fastjet/PseudoJet.hh"
#include "fastjet/ClusterSequence.hh"
#include "ThePEG/Utilities/CompSelector.h"
#include "ThePEG/Utilities/XSecStat.h"
namespace Herwig {
class FxFxHandler;
}
//declaration of thepeg ptr
namespace ThePEG {
ThePEG_DECLARE_POINTERS(Herwig::FxFxHandler,FxFxHandlerPtr);
}
namespace Herwig {
using namespace ThePEG;
typedef vector< string > split_vector_type;
/**
* Here is the documentation of the FxFxHandler class.
*
* @see \ref FxFxHandlerInterfaces "The interfaces"
* defined for FxFxHandler.
*/
class FxFxHandler: public QTildeShowerHandler {
/**
* FxFxHandler should have access to our private parts.
*/
friend class FxFxEventHandler;
friend class FxFxReader;
public:
/**
* The default constructor.
*/
FxFxHandler();
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Finalize the object
*/
virtual void dofinish();
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
//@}
public:
/**
* Hook to allow vetoing of event after showering hard sub-process
* as in e.g. MLM merging.
*/
virtual bool showerHardProcessVeto() const;
/**
* information for FxFx merging
*/
mutable int npLO_;
mutable int npNLO_;
/**
* information for tree-level merging
*/
mutable vector<double> ptclust_;
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
private:
/*
* whether a heavy quark has been found in the merging
*/
mutable bool hvqfound = false;
/*
* Run MLM jet-parton matching on the 'extra' jets.
*/
bool lightJetPartonVeto();
/*
* Function that calculates deltaR between a parton and a jet
*/
double partonJetDeltaR(ThePEG::tPPtr partonptr, LorentzMomentum jetmom) const;
/*
* Function that calculates deltaR between two jets
*/
double partonJetDeltaR(LorentzMomentum jetmom1, LorentzMomentum jetmom2) const;
/**
* Find jets using the FastJet package on particlesToCluster_.
*/
void getFastJets(double rjet, Energy ejcut, double etajcut) const;
/**
* Find jets using the FastJet package on particlesToCluster_.
*/
void getFastJetsToMatch(double rjet) const;
/**
* Deletes particles from partonsToMatch_ and particlesToCluster_
* vectors so that these contain only the partons to match to the
* jets and the particles used to build jets respectively. By and
* large the candidates for deletion are: vector bosons and their
* decay products, Higgs bosons, photons as well as _primary_, i.e.
* present in the lowest multiplicity process, heavy quarks and
* any related decay products.
*/
void caldel_m() const;
/**
* Deletes particles from partonsToMatch_ and particlesToCluster_
* vectors so that these contain only the partons to match to the
* jets and the particles used to build jets respectively. The candidates
* are chosen according to the information passed from madgraph.
*/
void caldel_mg() const;
/**
* c++ translation of subroutine of same name from alpsho.f.
* Label all particles with status between ISTLO and ISTHI
* (until a particle with status ISTOP is found) as final-state,
* call calsim_m and then put labels back to normal. This
* version keeps only all IST=1 particles rejected by caldel as
* daughters of vetoed heavy-quark mothers: jets complementary
* to those reconstructed by caldel.
*/
void caldel_hvq() const;
/**
* get the MG5_aMC information required for FxFx merging
*/
void getnpFxFx() const;
/**
* get the MG5_aMC information required for FxFx merging
*/
void getECOM() const;
/**
* get the MG5_aMC information required for tree-level merging
*/
void getptclust() const;
/**
* Erases all occurences of a substring from a string
*/
void erase_substr(std::string& subject, const std::string& search) const;
/**
* Get the particles from lastXCombPtr filling the pair
* preshowerISPs_ and particle pointer vector preshowerFSPs_.
*/
void getPreshowerParticles() const;
/**
* Get the particles from eventHandler()->currentEvent()->...
* filling the particle pairs showeredISHs_, showeredISPs_,
* showeredRems_ and the particle pointer vector showeredFSPs_.
*/
void getShoweredParticles() const;
/**
* Allows printing of debug output and sanity checks like
* total momentum consrvation to be carried out.
* debugLevel = -1, 0, ...5
* = no debugging, minimal debugging, ... verbose.
*/
void doSanityChecks(int debugLevel) const;
/**
* Given a pointer to a particle this finds all its final state
* descendents.
*/
void getDescendents(PPtr theParticle) const;
/**
* Accumulates all descendents of tops down to the b and W
* but not including them.
*/
void getTopRadiation(PPtr theParticle) const;
/**
* Sorts a given vector of particles by descending pT or ETJET
*/
ParticleVector pTsort(ParticleVector unsortedVec);
pair< vector<Energy>, vector<Lorentz5Momentum> > ETsort(vector<Energy> unsortedetjet, vector<Lorentz5Momentum> unsortedVec);
/*
* A function that prints a vector of Lorentz5Momenta in a fancy way
*/
void printMomVec(vector<Lorentz5Momentum> momVec);
/*
* A probability function for varying etclus_ about the mean value
*/
Energy etclusran_(double petc) const;
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<FxFxHandler> initFxFxHandler;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
FxFxHandler & operator=(const FxFxHandler &) = delete;
private:
/**
* Initial-state incoming partons prior to showering
* (i.e. from lastXCombPtr).
*/
mutable PPair preshowerISPs_;
/**
* Final-state outgoing partICLEs prior to showering
* (i.e. from lastXCombPtr).
*/
mutable ParticleVector preshowerFSPs_;
/**
* Final-state outgoing partICLEs prior to showering _to_be_removed_
* from preShowerFSPs_ prior to the light-parton-light-jet matching
* step. This same list is the starting point for determining
* partonsToMatch_ for the case of merging in heavy quark production.
*/
mutable ParticleVector preshowerFSPsToDelete_;
/**
* Initial-state incoming hadrons after shower of hard process
* (eventHandler()->currentEvent()->incoming()).
*/
mutable PPair showeredISHs_;
/**
* Initial-state incoming partons after shower of hard process
* (look for partonic children of showeredISHs_).
*/
mutable PPair showeredISPs_;
/**
* Final-state outgoing partICLEs after shower of hard process
* (eventHandler()->currentEvent()->getFinalState()).
*/
mutable tPVector showeredFSPs_;
/**
* Final-state outgoing partICLEs after shower of hard process
* _to_be_removed_ from showeredFSPs_ prior to the
* light-parton-light-jet matching step. This same list is the
* starting point for determining particlesToCluster_ for the
* case of merging in heavy quark production.
*/
mutable ParticleVector showeredFSPsToDelete_;
/**
* ONLY the final-state partons from preshowerFSPs_ that are
* supposed to enter the jet-parton matching.
*/
mutable ParticleVector partonsToMatch_;
/*
* The shower progenitors
*/
mutable PPtr theProgenitor;
mutable PPtr theLastProgenitor;
/**
* ONLY the final-state particles from showeredFSPs_ (and maybe
* also showeredRems_) that are supposed to go for jet clustering.
*/
mutable tPVector particlesToCluster_;
/**
* Final-state remnants after shower of hard process
* (look for remnants initially in showeredFSPs_).
*/
mutable PPair showeredRems_;
/**
* the COM of the incoming hadrons
*/
mutable double ECOM_;
/**
* Pointer to the object calculating the strong coupling
*/
ShowerAlphaPtr alphaS_;
/**
* Information extracted from the XComb object
*/
//@{
/**
* The fixed factorization scale used in the MEs.
*/
Energy pdfScale_;
/**
* Centre of mass energy
*/
Energy2 sHat_;
/**
* Constant alphaS used to generate LH events - if not already
* using CKKW scale (ickkw = 1 in AlpGen for example).
*/
double alphaSME_;
//@}
/*
* Number of rapidity segments of the calorimeter.
*/
unsigned int ncy_;
/*
* Number of phi segments of the calorimeter.
*/
unsigned int ncphi_;
/*
* Heavy flavour in WQQ,ZQQ,2Q etc (4=c, 5=b, 6=t).
*/
int ihvy_;
/*
* Number of photons in the AlpGen process.
*/
int nph_;
/*
* Number of higgses in the AlpGen process.
*/
int nh_;
/*
* Jet ET cut to apply in jet clustering (in merging).
*/
mutable Energy etclus_;
/*
* The merging mode (FxFx vs tree-level) used.
*/
int mergemode_;
/*
* Allows the vetoing on heavy quark decay products to be turned off.
*/
bool vetoHeavyQ_;
/*
* Allows vetoing of heavy flavour
*/
bool vetoHeavyFlavour_;
/*
* Mean Jet ET cut to apply in jet clustering (in merging).
*/
Energy etclusmean_;
/*
* The jet algorithm used for parton-jet matching in the MLM procedure.
*/
int jetAlgorithm_;
/*
* Allows the vetoing to be turned off completely - just for convenience.
*/
bool vetoIsTurnedOff_;
/*
* Veto if there exist softer unmatched jets than matched
*/
bool vetoSoftThanMatched_;
/*
* This flags whether the etclus_ (merging scale) should be fixed or variable according to a prob. distribution around the mean
*/
bool etclusfixed_;
/*
* maximum deviation from mean Jet ET cut to apply in jet clustering (in merging).
*/
Energy epsetclus_;
/*
* Cone size used in jet clustering (in merging).
*/
double rclus_;
/*
* Max |eta| for jets in clustering (in merging).
*/
double etaclmax_;
/*
* Default 1.5 factor used to decide if a jet matches a parton
* in merging: if DR(parton,jet)<rclusfactor*rclus the parton
* and jet are said to have been matched.
*/
double rclusfactor_;
/*
* Determines whether to detect the hard process or to manually determine which particles
* to include in the merging. If False, then the ihrd code below is used.
*/
bool hpdetect_;
/*
* The AlpGen hard process code. Relation to the AlpGen process names:
* 1: wqq, 2: zqq, 3: wjet, 4: zjet, 5: vbjet, 6: 2Q, 8: QQh, 9: Njet,
* 10: wcjet, 11: phjet, 12: hjet, 13: top, 14: wphjet, 15: wphqq,
* 16: 2Qph.
*/
int ihrd_;
/*
* The number of light jets in the AlpGen process (i.e. the 'extra' ones).
*/
int njets_;
/*
* Mimimum parton-parton R-sep used for generation (used for hvq merging).
*/
double drjmin_;
/*
* This flags that the highest multiplicity ME-level process is
* being processed.
*/
mutable bool highestMultiplicity_;
/*
* The forwards rapidity span of the calorimeter.
*/
double ycmax_;
/*
* The backwards rapidity span of the calorimeter.
*/
double ycmin_;
/*
* Cosine of phi values of calorimeter cell centres.
* Goes phi~=0 to phi~=2*pi (index = 0 ---> ncphi).
* ==> Cosine goes from +1 ---> +1 (index = 0 ---> ncphi).
*/
vector<double> cphcal_;
/*
* Sine of phi values of calorimeter cell centres.
* Goes phi~=0 to phi~=2*pi (index = 0 ---> ncphi).
* ==> Sine goes 0 -> 1 -> 0 -> -1 -> 0 (index = 0 ---> ncphi).
*/
vector<double> sphcal_;
/*
* Cosine of theta values of calorimeter cell centres in Y.
* Goes bwds th~=pi to fwds th~=0 (index = 0 ---> ncy).
* ==> Cosine goes from -1 ---> +1 (index = 0 ---> ncy).
*/
vector<double> cthcal_;
/*
* Sine of theta values of calorimeter cell centres in Y.
* Goes bwds th~=pi to fwds th~=0 (index = 0 ---> ncy).
* ==> Sine goes from 0 ---> +1 ---> 0 (index = 0 ---> ncy).
*/
vector<double> sthcal_;
/*
* Transverse energy deposit in a given calorimeter cell.
* First array index corresponds to rapidity index of cell,
* second array index corresponds to phi cell index.
*/
vector<vector<Energy> > et_;
/*
* For a given calorimeter cell this holds the index of the jet
* that the cell was clustered into.
*/
vector<vector<int> > jetIdx_;
/*
* Vector holding the Lorentz 5 momenta of each jet.
*/
mutable vector<Lorentz5Momentum> pjet_;
/*
* Vector holding the Lorentz 5 momenta of each jet from ME partons
*/
mutable vector<Lorentz5Momentum> pjetME_;
/*
* Vector holding the list of FS particles resulting from
* the particle input to getDescendents.
*/
mutable ParticleVector tmpList_;
/*
* Variables for the C++ translation of the calini_m(), calsim_m(),
* getjet_m(...) and caldel_m() functions
*/
mutable vector<Energy> etjet_;
vector<Energy> etjetME_;
mutable double dely_, delphi_;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of FxFxHandler. */
template <>
struct BaseClassTrait<Herwig::FxFxHandler,1> {
/** Typedef of the first base class of FxFxHandler. */
typedef Herwig::QTildeShowerHandler NthBase;
};
/** This template specialization informs ThePEG about the name of
* the FxFxHandler class and the shared object where it is defined. */
template <>
struct ClassTraits<Herwig::FxFxHandler>
: public ClassTraitsBase<Herwig::FxFxHandler> {
/** Return a platform-independent class name */
static string className() { return "Herwig::FxFxHandler"; }
/**
* The name of a file containing the dynamic library where the class
* FxFxHandler is implemented. It may also include several, space-separated,
* libraries if the class FxFxHandler depends on other classes (base classes
* excepted). In this case the listed libraries will be dynamically
* linked in the order they are specified.
*/
- static string library() { return "FxFxHandler.so"; }
+ static string library() { return "HwFxFxHandler.so"; }
};
/** @endcond */
}
#endif /* HERWIG_FxFxHandler_H */
diff --git a/MatrixElement/FxFx/FxFxReader.h b/MatrixElement/FxFx/FxFxReader.h
--- a/MatrixElement/FxFx/FxFxReader.h
+++ b/MatrixElement/FxFx/FxFxReader.h
@@ -1,1006 +1,1006 @@
// -*- C++ -*-
//
// FxFxReader.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef THEPEG_FxFxReader_H
#define THEPEG_FxFxReader_H
// This is the declaration of the FxFxReader class.
#include "FxFx.h"
#include "ThePEG/Handlers/HandlerBase.h"
#include "ThePEG/Utilities/ObjectIndexer.h"
#include "ThePEG/Utilities/Exception.h"
#include "ThePEG/Utilities/XSecStat.h"
#include "ThePEG/PDF/PartonBinInstance.h"
#include "ThePEG/PDF/PartonBin.fh"
#include "ThePEG/MatrixElement/ReweightBase.h"
#include "FxFxEventHandler.fh"
#include "FxFxReader.fh"
#include "ThePEG/Utilities/CFile.h"
#include <cstdio>
#include <cstring>
namespace ThePEG {
/**
* FxFxReader is an abstract base class to be used for objects
* which reads event files or streams from matrix element
* generators. Derived classes must at least implement the open() and
* doReadEvent() methods to read in information about the whole run into
* the HEPRUP variable and next event into the HEPEUP variable
* respectively. Also the close() function to close the file or stream
* read must be implemented. Although these functions are named as if
* we are reading from event files, they could just as well implement
* the actual generation of events.
*
* After filling the HEPRUP and HEPEUP variables, which are protected
* and easily accesible from the sub-class, this base class will then
* be responsible for transforming this data to the ThePEG Event
* record in the getEvent() method. <code>FxFxReader</code>s can
* only be used inside FxFxEventHandler objects.
*
* In the initialization the virtual open() and scan() functions are
* called. Here the derived class must provide the information about
* the processes in the variables corresponding to the HEPRUP common
* block. Note that the IDWTUP is required to be +/- 1, and sub
* classes are required to change the information accordingly to
* ensure the correct corss section sampling. Note also that the
* controlling FxFxEventHandler may choose to generate weighted
* events even if IDWTUP is 1.
*
* Note that the information given per process in e.g. the XSECUP and
* XMAXUP vectors is not used by the FxFxEventHandler and by
* default the FxFxReader is not assumed to be able to actively
* choose between the sub-processes. Instead, the
* FxFxEventHandler can handle several FxFxReader objects
* and choose between them. However, a sub-class of FxFxReader
* may set the flag isActive, in which case it is assumed to be able
* to select between its sub-processes itself.
*
* The FxFxReader may be assigned a number ReweightBase objects
* which either completely reweights the events produced (in the
* reweights vector), or only biases the selection without influencing
* the cross section (in the preweights vector). Note that it is the
* responsibility of a sub-class to call the reweight() function and
* multiply the weight according to its return value (typically done
* in the readEvent() function).
*
* @see \ref FxFxReaderInterfaces "The interfaces"
* defined for FxFxReader.
* @see Event
* @see FxFxEventHandler
*/
class FxFxReader: public HandlerBase, public LastXCombInfo<> {
/**
* FxFxEventHandler should have access to our private parts.
*/
friend class FxFxEventHandler;
/**
* Map for accumulating statistics of cross sections per process
* number.
*/
typedef map<int,XSecStat> StatMap;
/**
* Map of XComb objects describing the incoming partons indexed by
* the corresponding PartonBin pair.
*/
typedef map<tcPBPair,XCombPtr> XCombMap;
/**
* A vector of pointers to ReweightBase objects.
*/
typedef vector<ReweightPtr> ReweightVector;
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor. If the optional argument is true, the reader
* is assumed to be able to produce events on demand for a given
* process.
*/
FxFxReader(bool active = false);
/**
* Copy-constructor.
*/
FxFxReader(const FxFxReader &);
/**
* Destructor.
*/
virtual ~FxFxReader();
//@}
public:
/** @name Main virtual fuctions to be overridden in
* sub-classes. They are named as if we are reading from event
* files, but could equally well implement the actual generation of
* events. */
//@{
/**
* Open a file or stream with events and read in the run information
* into the heprup variable.
*/
virtual void open() = 0;
/**
* Read the next event from the file or stream into the
* corresponding protected variables. Return false if there is no
* more events.
*/
virtual bool doReadEvent() = 0;
/**
* Close the file or stream from which events have been read.
*/
virtual void close() = 0;
/**
* return the weight names
*/
// virtual vector<string> optWeightsNamesFunc();
virtual vector<string> optWeightsNamesFunc() = 0;
//virtual vector<string*> optWeightNamesFunc() = 0;
vector<string> optionalWeightsNames;
/**
* The ID (e.g. 100x, 2001) for the weight
*/
// vector<string> optionalWeightsNames;
//@}
/** @name Other important function which may be overridden in
* sub-classes which wants to bypass the basic HEPRUP or HEPEUP
* variables or otherwise facilitate the conversion to ThePEG
* objects. */
//@{
/**
* Initialize. This function is called by the FxFxEventHandler
* to which this object is assigned.
*/
virtual void initialize(FxFxEventHandler & eh);
/**
* Calls readEvent() or uncacheEvent() to read information into the
* FxFx common block variables. This function is called by the
* FxFxEventHandler if this reader has been selectod to
* produce an event.
*
* @return the weight asociated with this event. If negative weights
* are allowed it should be between -1 and 1, otherwise between 0
* and 1. If outside these limits the previously estimated maximum
* is violated. Note that the estimated maximum then should be
* updated from the outside.
*/
virtual double getEvent();
/**
* Calls doReadEvent() and performs pre-defined reweightings. A
* sub-class overrides this function it must make sure that the
* corresponding reweightings are done.
*/
virtual bool readEvent();
/**
* Skip \a n events. Used by FxFxEventHandler to make sure
* that a file is scanned an even number of times in case the events
* are not ramdomly distributed in the file.
*/
virtual void skip(long n);
/**
* Get an XComb object. Converts the information in the Les Houches
* common block variables to an XComb object describing the sub
* process. This is the way information is conveyed from the reader
* to the controlling FxFxEventHandler.
*/
tXCombPtr getXComb();
/**
* Get a SubProcess object corresponding to the information in the
* Les Houches common block variables.
*/
tSubProPtr getSubProcess();
/**
* Scan the file or stream to obtain information about cross section
* weights and particles etc. This function should fill the
* variables corresponding to the /HEPRUP/ common block. The
* function returns the number of events scanned.
*/
virtual long scan();
/**
* Take the information corresponding to the HEPRUP common block and
* initialize the statistics for this reader.
*/
virtual void initStat();
/**
* Reweights the current event using the reweights and preweights
* vectors. It is the responsibility of the sub-class to call this
* function after the HEPEUP information has been retrieved.
*/
double reweight();
/**
* Converts the information in the Les Houches common block
* variables into a Particle objects.
*/
virtual void fillEvent();
/**
* Removes the particles created in the last generated event,
* preparing to produce a new one.
*/
void reset();
/**
* Possibility for subclasses to recover from non-conformant
* settings of XMAXUP when an event file has been scanned with \a
* neve events. Should set weightScale so that the average XMAXUP
* times weightScale gives the cross section for a process. (This is
* needed for MadEvent).
*/
virtual void setWeightScale(long neve);
//@}
/** @name Access information about the current event. */
//@{
/**
* Return the size of this event in bytes. To be used for the cache
* file. \a npart is the number of particles. If \a npart is 0, the
* number is taken from NUP.
*/
static size_t eventSize(int N) {
return (N + 1)*sizeof(int) + // IDPRUP, ISTUP
(7*N + 4)*sizeof(double) + // XWGTUP, SCALUP, AQEDUP, AQCDUP, PUP,
// VTIMUP, SPINUP
N*sizeof(long) + // IDUP
2*N*sizeof(pair<int,int>) + // MOTHUP, ICOLUP
sizeof(pair<double,double>) + // XPDWUP.
2*sizeof(double); // lastweight and preweight
}
/**
* The current event weight given by XWGTUP times possible
* reweighting. Note that this is not necessarily the same as what
* is returned by getEvent(), which is scaled with the maximum
* weight.
*/
double eventWeight() const { return hepeup.XWGTUP*lastweight; }
/**
* Return the optional named weights associated to the current event.
*/
const map<string,double>& optionalEventWeights() const { return optionalWeights; }
/**
* Return the optional npLO and npNLO
*/
const int& optionalEventnpLO() const { return optionalnpLO; }
const int& optionalEventnpNLO() const { return optionalnpNLO; }
/**
* The pair of PartonBinInstance objects describing the current
* incoming partons in the event.
*/
const PBIPair & partonBinInstances() const { return thePartonBinInstances; }
/**
* Return the instances of the beam particles for the current event.
*/
const PPair & beams() const { return theBeams; }
/**
* Return the instances of the incoming particles to the sub process
* for the current event.
*/
const PPair & incoming() const { return theIncoming; }
/**
* Return the instances of the outgoing particles from the sub process
* for the current event.
*/
const PVector & outgoing() const { return theOutgoing; }
/**
* Return the instances of the intermediate particles in the sub
* process for the current event.
*/
const PVector & intermediates() const { return theIntermediates; }
/**
* If this reader is to be used (possibly together with others) for
* CKKW reweighting and veto, this should give the multiplicity of
* outgoing particles in the highest multiplicity matrix element in
* the group.
*/
int maxMultCKKW() const { return theMaxMultCKKW; }
/**
* If this reader is to be used (possibly together with others) for
* CKKW reweighting and veto, this should give the multiplicity of
* outgoing particles in the lowest multiplicity matrix element in
* the group.
*/
int minMultCKKW() const { return theMinMultCKKW; } //@}
/** @name Other inlined access functions. */
//@{
/**
* The number of events found in this reader. If less than zero the
* number of events are unlimited.
*/
long NEvents() const { return theNEvents; }
/**
* The number of events produced so far. Is reset to zero if an
* event file is reopened.
*/
long currentPosition() const { return position; }
/**
* The maximum number of events to scan to collect information about
* processes and cross sections. If less than 0, all events will be
* scanned.
*/
long maxScan() const { return theMaxScan; }
/**
* Return true if this reader is active.
*/
bool active() const { return isActive; }
/**
* True if negative weights may be produced.
*/
bool negativeWeights() const { return heprup.IDWTUP < 0; }
/**
* The collected cross section statistics for this reader.
*/
const XSecStat & xSecStats() const { return stats; }
/**
* Collected statistics about the individual processes.
*/
const StatMap & processStats() const { return statmap; }
/**
* Select the current event. It will later be rejected with a
* probability given by \a weight.
*/
void select(double weight) {
stats.select(weight);
statmap[hepeup.IDPRUP].select(weight);
}
/**
* Accept the current event assuming it was previously selcted.
*/
void accept() {
stats.accept();
statmap[hepeup.IDPRUP].accept();
}
/**
* Reject the current event assuming it was previously accepted.
*/
void reject(double w) {
stats.reject(w);
statmap[hepeup.IDPRUP].reject(w);
}
/**
* Increase the overestimated cross section for this reader.
*/
virtual void increaseMaxXSec(CrossSection maxxsec);
/**
* The PartonExtractor object used to construct remnants.
*/
tPExtrPtr partonExtractor() const { return thePartonExtractor; }
/**
* Return a possibly null pointer to a CascadeHandler to be used for
* CKKW-reweighting.
*/
tCascHdlPtr CKKWHandler() const { return theCKKW; }
/**
* The pairs of PartonBin objects describing the partons which can
* be extracted by the PartonExtractor object.
*/
const PartonPairVec & partonBins() const { return thePartonBins; }
/**
* The map of XComb objects indexed by the corresponding PartonBin
* pair.
*/
const XCombMap & xCombs() const { return theXCombs; }
/**
* The Cuts object to be used for this reader.
*/
const Cuts & cuts() const { return *theCuts; }
//@}
protected:
/** @name Functions for manipulating cache files. */
//@{
/**
* Name of file used to cache the events form the reader in a
* fast-readable form. If empty, no cache file will be generated.
*/
string cacheFileName() const { return theCacheFileName; }
/**
* Determines whether to apply cuts to events converting them to
* ThePEG format.
*/
bool cutEarly() const { return doCutEarly; }
/**
* File stream for the cache.
*/
CFile cacheFile() const { return theCacheFile;}
/**
* Open the cache file for reading.
*/
void openReadCacheFile();
/**
* Open the cache file for writing.
*/
void openWriteCacheFile();
/**
* Close the cache file;
*/
void closeCacheFile();
/**
* Write the current event to the cache file.
*/
void cacheEvent() const;
/**
* Read an event from the cache file. Return false if something went wrong.
*/
bool uncacheEvent();
/**
* Reopen a reader. If we have reached the end of an event file,
* reopen it and issue a warning if we have used up a large fraction
* of it.
*/
void reopen();
/**
* Helper function to write a variable to a memory location
*/
template <typename T>
static char * mwrite(char * pos, const T & t, size_t n = 1) {
std::memcpy(pos, &t, n*sizeof(T));
return pos + n*sizeof(T);
}
/**
* Helper function to read a variable from a memory location
*/
template <typename T>
static const char * mread(const char * pos, T & t, size_t n = 1) {
std::memcpy(&t, pos, n*sizeof(T));
return pos + n*sizeof(T);
}
//@}
/** @name Auxilliary virtual methods which may be verridden by sub-classes. */
//@{
/**
* Check the existence of a pair of PartonBin objects corresponding
* to the current event.
*
* @return false if no pair of suitable PartonBin objects was found.
*/
virtual bool checkPartonBin();
/**
* Create instances of all particles in the event and store them
* in particleIndex.
*/
virtual void createParticles();
/**
* Using the already created particles create a pair of
* PartonBinInstance objects corresponding to the incoming
* partons. Return the corresponding PartonBin objects.
*/
virtual tcPBPair createPartonBinInstances();
/**
* Create instances of the incoming beams in the event and store
* them in particleIndex. If no beam particles are included in the
* event they are created from the run info.
*/
virtual void createBeams();
/**
* Go through the mother indices and connect up the Particles.
*/
virtual void connectMothers();
//@}
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* Standard Init function used to initialize the interfaces.
*/
static void Init();
protected:
/** @name Set functions for some variables not in the Les Houches accord. */
//@{
/**
* The number of events in this reader. If less than zero the number
* of events is unlimited.
*/
void NEvents(long x) { theNEvents = x; }
/**
* The map of XComb objects indexed by the corresponding PartonBin
* pair.
*/
XCombMap & xCombs() { return theXCombs; }
//@}
/** @name Standard (and non-standard) Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish() {
close();
HandlerBase::dofinish();
}
/**
* Return true if this object needs to be initialized before all
* other objects because it needs to extract PDFs from the event file.
*/
virtual bool preInitialize() const;
/**
* Called from doinit() to extract PDFs from the event file and add
* the corresponding objects to the current EventGenerator.
*/
virtual void initPDFs();
//@}
protected:
/**
* The HEPRUP common block.
*/
HEPRUP heprup;
/**
* The HEPEUP common block.
*/
HEPEUP hepeup;
/**
* The ParticleData objects corresponding to the incoming particles.
*/
tcPDPair inData;
/**
* The PDFBase objects which has been used for the beam particle
* when generating the events being read. Specified in the interface
* or derived from PDFGUP and PDFSUP.
*/
pair<PDFPtr,PDFPtr> inPDF;
/**
* The PDFBase object to be used in the subsequent generation.
*/
pair<cPDFPtr,cPDFPtr> outPDF;
/**
* The PartonExtractor object used to construct remnants.
*/
PExtrPtr thePartonExtractor;
/**
* A pointer to a CascadeHandler to be used for CKKW-reweighting.
*/
tCascHdlPtr theCKKW;
/**
* The pairs of PartonBin objects describing the partons which can
* be extracted by the PartonExtractor object.
*/
PartonPairVec thePartonBins;
/**
* The map of XComb objects indexed by the corresponding PartonBin
* pair.
*/
XCombMap theXCombs;
/**
* The Cuts object to be used for this reader.
*/
CutsPtr theCuts;
/**
* The number of events in this reader. If less than zero the number
* of events is unlimited.
*/
long theNEvents;
/**
* The number of events produced by this reader so far. Is reset
* every time an event file is reopened.
*/
long position;
/**
* The number of times this reader has been reopened.
*/
int reopened;
/**
* The maximum number of events to scan to collect information about
* processes and cross sections. If less than 0, all events will be
* scanned.
*/
long theMaxScan;
/**
* Flag to tell whether we are in the process of scanning.
*/
bool scanning;
/**
* True if this is an active reader.
*/
bool isActive;
/**
* Name of file used to cache the events form the reader in a
* fast-readable form. If empty, no cache file will be generated.
*/
string theCacheFileName;
/**
* Determines whether to apply cuts to events before converting them
* to ThePEG format.
*/
bool doCutEarly;
/**
* Collect statistics for this reader.
*/
XSecStat stats;
/**
* Collect statistics for each individual process.
*/
StatMap statmap;
/**
* The pair of PartonBinInstance objects describing the current
* incoming partons in the event.
*/
PBIPair thePartonBinInstances;
/**
* Association between ColourLines and colour indices in the current
* translation.
*/
ObjectIndexer<long,ColourLine> colourIndex;
/**
* Association between Particles and indices in the current
* translation.
*/
ObjectIndexer<long,Particle> particleIndex;
/**
* The instances of the beam particles for the current event.
*/
PPair theBeams;
/**
* The instances of the incoming particles to the sub process for
* the current event.
*/
PPair theIncoming;
/**
* The instances of the outgoing particles from the sub process for
* the current event.
*/
PVector theOutgoing;
/**
* The instances of the intermediate particles in the sub process for
* the current event.
*/
PVector theIntermediates;
/**
* File stream for the cache.
*/
CFile theCacheFile;
/**
* The reweight objects modifying the weights of this reader.
*/
ReweightVector reweights;
/**
* The preweight objects modifying the weights of this reader.
*/
ReweightVector preweights;
/**
* The factor with which this reader was last pre-weighted.
*/
double preweight;
/**
* Should the event be reweighted by PDFs used by the PartonExtractor?
*/
bool reweightPDF;
/**
* Should PDFBase objects be constructed from the information in the
* event file in the initialization?
*/
bool doInitPDFs;
/**
* If this reader is to be used (possibly together with others) for
* CKKW reweighting and veto, this should give the multiplicity of
* outgoing particles in the highest multiplicity matrix element in
* the group.
*/
int theMaxMultCKKW;
/**
* If this reader is to be used (possibly together with others) for
* CKKW reweighting and veto, this should give the multiplicity of
* outgoing particles in the lowest multiplicity matrix element in
* the group.
*/
int theMinMultCKKW;
/**
* The weight multiplying the last read event due to PDF
* reweighting, CKKW reweighting or assigned reweight and preweight
* objects.
*/
double lastweight;
/**
* The optional weights associated to the last read events.
*/
map<string,double> optionalWeights;
/**
* If the maximum cross section of this reader has been increased
* with increaseMaxXSec(), this is the total factor with which it
* has been increased.
*/
double maxFactor;
/**
* npLO for FxFx merging
*/
int optionalnpLO;
/**
* npNLO for FxFx merging
*/
int optionalnpNLO;
/**
* The (reweighted) XWGTUP value should be scaled with this cross
* section when compared to the overestimated cross section.
*/
CrossSection weightScale;
/**
* Individual scales for different sub-processes if reweighted.
*/
vector<double> xSecWeights;
/**
* Individual maximum weights for individual (possibly reweighted)
* processes.
*/
map<int,double> maxWeights;
/**
* Is set to true when getEvent() is called from skip(int).
*/
bool skipping;
/**
* Option for the treatment of the momenta supplied
*/
unsigned int theMomentumTreatment;
/**
* Set to true if warnings about possible weight incompatibilities
* should be issued.
*/
bool useWeightWarnings;
/**
* Option to allow reopening of the file
*/
bool theReOpenAllowed;
/**
* Use the spin information
*/
bool theIncludeSpin;
private:
/** Access function for the interface. */
void setBeamA(long id);
/** Access function for the interface. */
long getBeamA() const;
/** Access function for the interface. */
void setBeamB(long id);
/** Access function for the interface. */
long getBeamB() const;
/** Access function for the interface. */
void setEBeamA(Energy e);
/** Access function for the interface. */
Energy getEBeamA() const;
/** Access function for the interface. */
void setEBeamB(Energy e);
/** Access function for the interface. */
Energy getEBeamB() const;
/** Access function for the interface. */
void setPDFA(PDFPtr);
/** Access function for the interface. */
PDFPtr getPDFA() const;
/** Access function for the interface. */
void setPDFB(PDFPtr);
/** Access function for the interface. */
PDFPtr getPDFB() const;
private:
/**
* Describe an abstract base class with persistent data.
*/
static AbstractClassDescription<FxFxReader> initFxFxReader;
/**
* Private and non-existent assignment operator.
*/
FxFxReader & operator=(const FxFxReader &) = delete;
public:
/** @cond EXCEPTIONCLASSES */
/** Exception class used by FxFxReader in case inconsistencies
* are encountered. */
class FxFxInconsistencyError: public Exception {};
/** Exception class used by FxFxReader in case more events
than available are requested. */
class FxFxReopenWarning: public Exception {};
/** Exception class used by FxFxReader in case reopening an
event file fails. */
class FxFxReopenError: public Exception {};
/** Exception class used by FxFxReader in case there is
information missing in the initialization phase. */
class FxFxInitError: public InitException {};
/** @endcond */
};
/// Stream output for HEPEUP
ostream & operator<<(ostream & os, const HEPEUP & h);
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/**
* This template specialization informs ThePEG about the
* base class of FxFxReader.
*/
template <>
struct BaseClassTrait<FxFxReader,1>: public ClassTraitsType {
/** Typedef of the base class of FxFxReader. */
typedef HandlerBase NthBase;
};
/**
* This template specialization informs ThePEG about the name of the
* FxFxReader class and the shared object where it is
* defined.
*/
template <>
struct ClassTraits<FxFxReader>
: public ClassTraitsBase<FxFxReader> {
/**
* Return the class name.
*/
static string className() { return "Herwig::FxFxReader"; }
/**
* Return the name of the shared library to be loaded to get access
* to the FxFxReader class and every other class it uses
* (except the base class).
*/
- static string library() { return "FxFx.so"; }
+ static string library() { return "HwFxFx.so"; }
};
/** @endcond */
}
#endif /* THEPEG_FxFxReader_H */
diff --git a/MatrixElement/FxFx/Makefile.am b/MatrixElement/FxFx/Makefile.am
--- a/MatrixElement/FxFx/Makefile.am
+++ b/MatrixElement/FxFx/Makefile.am
@@ -1,18 +1,18 @@
pkglib_LTLIBRARIES = HwFxFx.la HwFxFxHandler.la
HwFxFx_la_SOURCES = \
FxFxFileReader.cc FxFxFileReader.fh FxFxFileReader.h\
FxFxEventHandler.cc FxFxEventHandler.h\
FxFxReader.cc FxFxReader.fh FxFxReader.h\
FxFx.h
HwFxFx_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 1:0:0
HwFxFxHandler_la_SOURCES = \
FxFxHandler.cc FxFxHandler.h
HwFxFxHandler_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 1:0:0
-if HAVE_RIVET
- pkglib_LTLIBRARIES += HwFxFxAnalysis.la
- HwFxFxAnalysis_la_SOURCES = \
- FxFxAnalysis.cc FxFxAnalysis.h
- HwFxFxAnalysis_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 1:0:0
-endif
+#if HAVE_RIVET
+# pkglib_LTLIBRARIES += HwFxFxAnalysis.la
+# HwFxFxAnalysis_la_SOURCES = \
+# FxFxAnalysis.cc FxFxAnalysis.h
+# HwFxFxAnalysis_la_LDFLAGS = $(AM_LDFLAGS) -module -version-info 1:0:0
+#endif
diff --git a/MatrixElement/Hadron/MEMinBias.cc b/MatrixElement/Hadron/MEMinBias.cc
--- a/MatrixElement/Hadron/MEMinBias.cc
+++ b/MatrixElement/Hadron/MEMinBias.cc
@@ -1,174 +1,174 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MEMinBias class.
//
#include "MEMinBias.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
//#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
#include "ThePEG/PDT/EnumParticles.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
void MEMinBias::getDiagrams() const {
int maxflav(2);
// Pomeron data
tcPDPtr pom = getParticleData(990);
for ( int i = 1; i <= maxflav; ++i ) {
for( int j=1; j <= i; ++j){
tcPDPtr q1 = getParticleData(i);
tcPDPtr q1b = q1->CC();
tcPDPtr q2 = getParticleData(j);
tcPDPtr q2b = q2->CC();
// For each flavour we add:
//qq -> qq
add(new_ptr((Tree2toNDiagram(3), q1, pom, q2, 1, q1, 2, q2, -1)));
//qqb -> qqb
add(new_ptr((Tree2toNDiagram(3), q1, pom, q2b, 1, q1, 2, q2b, -2)));
//qbqb -> qbqb
add(new_ptr((Tree2toNDiagram(3), q1b, pom, q2b, 1, q1b, 2, q2b, -3)));
}
}
}
Energy2 MEMinBias::scale() const {
return sqr(Scale_);
}
int MEMinBias::nDim() const {
return 0;
}
void MEMinBias::setKinematics() {
HwMEBase::setKinematics(); // Always call the base class method first.
}
bool MEMinBias::generateKinematics(const double *) {
// generate the masses of the particles
for ( int i = 2, N = meMomenta().size(); i < N; ++i ) {
meMomenta()[i] = Lorentz5Momentum(mePartonData()[i]->generateMass());
}
Energy q = ZERO;
try {
q = SimplePhaseSpace::
getMagnitude(sHat(), meMomenta()[2].mass(), meMomenta()[3].mass());
} catch ( ImpossibleKinematics & e ) {
return false;
}
Energy pt = ZERO;
meMomenta()[2].setVect(Momentum3( pt, pt, q));
meMomenta()[3].setVect(Momentum3(-pt, -pt, -q));
meMomenta()[2].rescaleEnergy();
meMomenta()[3].rescaleEnergy();
jacobian(1.0);
return true;
}
double MEMinBias::me2() const {
//tuned so it gives the correct normalization for xmin = 0.11
return csNorm_*(sqr(generator()->maximumCMEnergy())/GeV2);
}
CrossSection MEMinBias::dSigHatDR() const {
return me2()*jacobian()/sHat()*sqr(hbarc);
}
unsigned int MEMinBias::orderInAlphaS() const {
return 2;
}
unsigned int MEMinBias::orderInAlphaEW() const {
return 0;
}
Selector<MEBase::DiagramIndex>
MEMinBias::diagrams(const DiagramVector & diags) const {
Selector<DiagramIndex> sel;
for ( DiagramIndex i = 0; i < diags.size(); ++i )
sel.insert(1.0, i);
return sel;
}
Selector<const ColourLines *>
MEMinBias::colourGeometries(tcDiagPtr diag) const {
static ColourLines qq("1 4, 3 5");
static ColourLines qqb("1 4, -3 -5");
static ColourLines qbqb("-1 -4, -3 -5");
Selector<const ColourLines *> sel;
switch(diag->id()){
case -1:
sel.insert(1.0, &qq);
break;
case -2:
sel.insert(1.0, &qqb);
break;
case -3:
sel.insert(1.0, &qbqb);
break;
}
return sel;
}
IBPtr MEMinBias::clone() const {
return new_ptr(*this);
}
IBPtr MEMinBias::fullclone() const {
return new_ptr(*this);
}
// The following static variable is needed for the type
// description system in ThePEG.
DescribeClass<MEMinBias,HwMEBase>
describeHerwigMEMinBias("Herwig::MEMinBias", "HwMEHadron.so");
void MEMinBias::persistentOutput(PersistentOStream & os) const {
- os << csNorm_;
+ os << csNorm_ << ounit(Scale_,GeV);;
}
void MEMinBias::persistentInput(PersistentIStream & is, int) {
- is >> csNorm_;
+ is >> csNorm_ >> iunit(Scale_,GeV);
}
void MEMinBias::Init() {
static ClassDocumentation<MEMinBias> documentation
("There is no documentation for the MEMinBias class");
static Parameter<MEMinBias,double> interfacecsNorm
("csNorm",
"Normalization of the min-bias cross section.",
&MEMinBias::csNorm_,
1.0, 0.0, 100.0,
false, false, Interface::limited);
static Parameter<MEMinBias,Energy> interfaceScale
("Scale",
"Scale for the Min Bias matrix element.",
&MEMinBias::Scale_,GeV,
- 1.0*GeV, 0.0*GeV, 100.0*GeV,
+ 2.0*GeV, 0.0*GeV, 100.0*GeV,
false, false, Interface::limited);
}
diff --git a/MatrixElement/Makefile.am b/MatrixElement/Makefile.am
--- a/MatrixElement/Makefile.am
+++ b/MatrixElement/Makefile.am
@@ -1,12 +1,12 @@
-SUBDIRS = General Lepton Hadron DIS Powheg Gamma Matchbox Reweighters FxFx
+SUBDIRS = General Lepton Hadron DIS Powheg Gamma Matchbox Reweighters
noinst_LTLIBRARIES = libHwME.la
libHwME_la_SOURCES = \
HwMEBase.h HwMEBase.fh HwMEBase.cc \
MEfftoVH.h MEfftoVH.cc \
MEfftoffH.h MEfftoffH.cc \
HardVertex.fh HardVertex.h HardVertex.cc \
ProductionMatrixElement.h ProductionMatrixElement.cc \
DrellYanBase.h DrellYanBase.cc \
BlobME.h BlobME.cc
diff --git a/MatrixElement/Matchbox/Phasespace/Makefile.am b/MatrixElement/Matchbox/Phasespace/Makefile.am
--- a/MatrixElement/Matchbox/Phasespace/Makefile.am
+++ b/MatrixElement/Matchbox/Phasespace/Makefile.am
@@ -1,72 +1,72 @@
noinst_LTLIBRARIES = libHwMatchboxPhasespace.la
nodist_libHwMatchboxPhasespace_la_SOURCES = \
Phasespace__all.cc
BUILT_SOURCES = Phasespace__all.cc
CLEANFILES = Phasespace__all.cc
Phasespace__all.cc : $(DIR_H_FILES) $(DIR_CC_FILES) Makefile
@echo "Concatenating .cc files into $@"
@$(top_srcdir)/cat_with_cpplines $(DIR_CC_FILES) > $@
EXTRA_DIST = $(ALL_H_FILES) $(ALL_CC_FILES)
DIR_H_FILES = $(addprefix $(srcdir)/,$(ALL_H_FILES))
ALL_H_FILES = \
FFLightInvertedTildeKinematics.h \
FFLightTildeKinematics.h \
FFMassiveInvertedTildeKinematics.h \
FFMassiveTildeKinematics.h \
FILightInvertedTildeKinematics.h \
FILightTildeKinematics.h \
FIMassiveInvertedTildeKinematics.h \
FIMassiveTildeKinematics.h \
IFLightInvertedTildeKinematics.h \
IFLightTildeKinematics.h \
IFMassiveInvertedTildeKinematics.h \
IFMassiveTildeKinematics.h \
IILightInvertedTildeKinematics.h \
IILightTildeKinematics.h \
InvertedTildeKinematics.fh \
InvertedTildeKinematics.h \
MatchboxPhasespace.h \
MatchboxRambo.h \
PhasespaceHelpers.h \
RandomHelpers.h \
TildeKinematics.fh \
TildeKinematics.h \
TreePhasespace.h \
TreePhasespaceChannels.h \
MatchboxReference.h \
FlatInvertiblePhasespace.h \
FlatInvertibleLabframePhasespace.h \
-PhasespaceCouplings.h
+PhasespaceCouplings.h
DIR_CC_FILES = $(addprefix $(srcdir)/,$(ALL_CC_FILES))
ALL_CC_FILES = \
FFLightInvertedTildeKinematics.cc \
FFLightTildeKinematics.cc \
FFMassiveInvertedTildeKinematics.cc \
FFMassiveTildeKinematics.cc \
FILightInvertedTildeKinematics.cc \
FILightTildeKinematics.cc \
FIMassiveInvertedTildeKinematics.cc \
FIMassiveTildeKinematics.cc \
IFLightInvertedTildeKinematics.cc \
IFLightTildeKinematics.cc \
IFMassiveInvertedTildeKinematics.cc \
IFMassiveTildeKinematics.cc \
IILightInvertedTildeKinematics.cc \
IILightTildeKinematics.cc \
InvertedTildeKinematics.cc \
MatchboxPhasespace.cc \
MatchboxRambo.cc \
PhasespaceHelpers.cc \
TildeKinematics.cc \
TreePhasespace.cc \
TreePhasespaceChannels.cc \
MatchboxReference.cc \
FlatInvertiblePhasespace.cc \
FlatInvertibleLabframePhasespace.cc \
PhasespaceCouplings.cc
diff --git a/src/FxFx-Tree.in b/src/FxFx-Tree.in
new file mode 100644
--- /dev/null
+++ b/src/FxFx-Tree.in
@@ -0,0 +1,173 @@
+
+#############################################################
+# Create an event generator taking the default EventGenerator #
+# as the starting point ... #
+#############################################################
+cd /Herwig/Generators
+# Copy the default EventGenerator with its settings to a new
+# which will be the basis of the one we use for showering:
+cp EventGenerator theGenerator
+
+#############################################################
+# Create a LH event handler (set up & assigned below) ... #
+#############################################################
+cd /Herwig/EventHandlers
+library HwFxFx.so
+create Herwig::FxFxEventHandler theLesHouchesHandler
+
+#############################################################
+# Create a LH reader (set up & assigned below) ... #
+#############################################################
+cd /Herwig/EventHandlers
+library HwFxFx.so
+create Herwig::FxFxFileReader theLHReader
+
+#############################################################
+# Create an FxFxHandler (set up & assigned below) ... #
+#############################################################
+cd /Herwig/Shower
+library HwFxFxHandler.so
+create Herwig::FxFxHandler FxFxHandler
+set /Herwig/Shower/FxFxHandler:SplittingGenerator /Herwig/Shower/SplittingGenerator
+set /Herwig/Shower/FxFxHandler:KinematicsReconstructor /Herwig/Shower/KinematicsReconstructor
+set /Herwig/Shower/FxFxHandler:PartnerFinder /Herwig/Shower/PartnerFinder
+
+#############################################################
+# Create an LHAPDF (set up & assigned below) ... #
+#############################################################
+cd /Herwig/Partons
+create ThePEG::LHAPDF thePDFset ThePEGLHAPDF.so
+
+############################################################
+# Create a cuts object ... #
+############################################################
+cd /Herwig/EventHandlers
+create ThePEG::Cuts /Herwig/Cuts/NoCuts
+
+#############################################################
+# Setup the LH event handler ... #
+#############################################################
+cd /Herwig/EventHandlers
+insert theLesHouchesHandler:FxFxReaders[0] theLHReader
+set theLesHouchesHandler:WeightOption VarNegWeight
+set theLesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor
+set theLesHouchesHandler:CascadeHandler /Herwig/Shower/FxFxHandler
+set theLesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
+set theLesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler
+############################################################
+
+##################################################
+# Shower parameters
+##################################################
+# normally, you want
+# the scale supplied in the event files (SCALUP)
+# to be used as a pT veto scale in the parton shower
+set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
+set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
+
+############################################################
+
+#############################################################
+# Set up the LH reader ... #
+#############################################################
+cd /Herwig/EventHandlers
+set theLHReader:WeightWarnings false
+# Input event file name:
+# 10 k
+set theLHReader:FileName NAME_OF_FILE #(the file can be compressed (gziped,bziped))
+set theLHReader:MomentumTreatment RescaleEnergy
+set theLHReader:Cuts /Herwig/Cuts/NoCuts
+
+####################################################
+# Set up the generator ... #
+####################################################
+cd /Herwig/Generators
+set theGenerator:EventHandler /Herwig/EventHandlers/theLesHouchesHandler
+set theGenerator:NumberOfEvents 100000000
+set theGenerator:RandomNumberGenerator:Seed 31122001
+set theGenerator:PrintEvent 1
+set theGenerator:MaxErrors 10000
+
+#########################################################
+# Option to off shower / hadronization / decays / MPI. #
+#########################################################
+cd /Herwig/EventHandlers
+# set theLesHouchesHandler:CascadeHandler NULL
+#set theLesHouchesHandler:HadronizationHandler NULL
+# remove the quark check in case hadronization is turned off
+# set /Herwig/Analysis/Basics:CheckQuark false
+#set theLesHouchesHandler:DecayHandler NULL
+# The handler for multiple parton interactions
+#set /Herwig/Shower/FxFxHandler:MPIHandler NULL
+
+#############################################################
+# Set up the FxFxHandler ... #
+#############################################################
+cd /Herwig/Shower
+set /Herwig/Shower/FxFxHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
+set /Herwig/Shower/FxFxHandler:RemDecayer /Herwig/Partons/RemnantDecayer
+set /Herwig/Shower/FxFxHandler:ShowerAlpha AlphaQCD
+# set the heavy quark decay product vetoing process on/off
+set FxFxHandler:HeavyQVeto Yes
+# Automatic detection of the hard process (experimental)
+set FxFxHandler:HardProcessDetection Automatic
+set FxFxHandler:ihrd 3
+# No. of light jets in maximum-multiplicity FxFx process
+set FxFxHandler:njetsmax 1 # Make sure this is set correctly!
+# Mimimum parton-parton R-sep used for generation.
+set FxFxHandler:drjmin 0
+
+#########################################################
+# Recommended key merging parameters below #
+#########################################################
+cd /Herwig/Shower
+# turn the Vetoing On or Off completely
+set FxFxHandler:VetoIsTurnedOff VetoingIsOn
+# merging mode: in this case Tree level with MG5 information:
+set FxFxHandler:MergeMode TreeMG5
+# merging scale
+set FxFxHandler:ETClus 25*GeV
+# jet radius used in clustering in merging.
+set FxFxHandler:RClus 1.0
+# Max |eta| for jets in clustering in merging.
+set FxFxHandler:EtaClusMax 10
+# Default 1.5 factor used to decide if a jet matches a parton
+# in merging: if DR(parton,jet)<rclusfactor*rclus the parton
+# and jet are said to have been matched.
+set FxFxHandler:RClusFactor 1.5
+
+#########################################################
+# Rivet settings and other analyses #
+#########################################################
+cd /Herwig/Generators
+# Stuff for rivet:
+#create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
+#insert /Herwig/Analysis/RivetAnalysis:Analyses 0 MC_XS
+#insert /Herwig/Analysis/RivetAnalysis:Analyses 1 ATLAS_2011_I928289_Z
+
+cd /Herwig/Generators
+# Stuff for rivet:
+#create ThePEG::FxFxAnalysis /Herwig/Analysis/FxFxAnalysis FxFxAnalysis.so
+# use the optional weights (WARNING: runs rivet multiple times!)
+#set /Herwig/Analysis/FxFxAnalysis:UseOptWeights No
+#set /Herwig/Analysis/FxFxAnalysis:NormOptWeights Yes # different normalization for weights
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/FxFxAnalysis
+#insert /Herwig/Analysis/FxFxAnalysis:Analyses 0 MC_XS
+
+
+# A HepMC dump file (requires --with-hepmc to be set at configure time)
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
+#set /Herwig/Analysis/HepMCFile:PrintEvent 100
+#set /Herwig/Analysis/HepMCFile:Format GenEvent
+#set /Herwig/Analysis/HepMCFile:Units GeV_mm
+
+# set the weight normalization
+#set /Herwig/EventHandlers/theLesHouchesHandler:WeightNormalization CrossSection
+
+################
+# Save the run #
+################
+cd /Herwig/Generators
+
+saverun FxFx-Tree theGenerator
diff --git a/src/FxFx.in b/src/FxFx.in
new file mode 100644
--- /dev/null
+++ b/src/FxFx.in
@@ -0,0 +1,185 @@
+
+#############################################################
+# Create an event generator taking the default EventGenerator #
+# as the starting point ... #
+#############################################################
+cd /Herwig/Generators
+# Copy the default EventGenerator with its settings to a new
+# which will be the basis of the one we use for showering:
+cp EventGenerator theGenerator
+
+#############################################################
+# Create a LH event handler (set up & assigned below) ... #
+#############################################################
+cd /Herwig/EventHandlers
+library HwFxFx.so
+create Herwig::FxFxEventHandler theLesHouchesHandler
+
+#############################################################
+# Create a LH reader (set up & assigned below) ... #
+#############################################################
+cd /Herwig/EventHandlers
+#library HwFxFx.so
+create Herwig::FxFxFileReader theLHReader
+
+#############################################################
+# Create an FxFxHandler (set up & assigned below) ... #
+#############################################################
+cd /Herwig/Shower
+library HwFxFxHandler.so
+create Herwig::FxFxHandler FxFxHandler
+set /Herwig/Shower/FxFxHandler:SplittingGenerator /Herwig/Shower/SplittingGenerator
+set /Herwig/Shower/FxFxHandler:KinematicsReconstructor /Herwig/Shower/KinematicsReconstructor
+set /Herwig/Shower/FxFxHandler:PartnerFinder /Herwig/Shower/PartnerFinder
+
+#############################################################
+# Create an LHAPDF (set up & assigned below) ... #
+#############################################################
+cd /Herwig/Partons
+create ThePEG::LHAPDF thePDFset ThePEGLHAPDF.so
+
+############################################################
+# Create a cuts object ... #
+############################################################
+cd /Herwig/EventHandlers
+create ThePEG::Cuts /Herwig/Cuts/NoCuts
+
+#############################################################
+# Setup the LH event handler ... #\
+#############################################################
+cd /Herwig/EventHandlers
+insert theLesHouchesHandler:FxFxReaders[0] theLHReader
+set theLesHouchesHandler:WeightOption VarNegWeight
+set theLesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor
+set theLesHouchesHandler:CascadeHandler /Herwig/Shower/FxFxHandler
+set theLesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
+set theLesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler
+
+############################################################
+
+##################################################
+# Shower parameters
+##################################################
+# normally, you want
+# the scale supplied in the event files (SCALUP)
+# to be used as a pT veto scale in the parton shower
+set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
+set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
+# Shower parameters
+# treatment of wide angle radiation
+set /Herwig/Shower/PartnerFinder:PartnerMethod Random
+set /Herwig/Shower/PartnerFinder:ScaleChoice Partner
+# with MC@NLO these parameters are required for consistency of the subtraction terms
+# suggested parameters
+set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost
+set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption General
+set /Herwig/Shower/KinematicsReconstructor:InitialStateReconOption Rapidity
+set /Herwig/Shower/ShowerHandler:SpinCorrelations No
+
+############################################################
+
+#############################################################
+# Set up the LH reader ... #
+#############################################################
+cd /Herwig/EventHandlers
+set theLHReader:WeightWarnings false
+# Input event file name:
+# 100 k
+set theLHReader:FileName NAME_OF_FILE #(the file can be compressed (gziped,bziped))
+set theLHReader:MomentumTreatment RescaleEnergy
+set theLHReader:Cuts /Herwig/Cuts/NoCuts
+
+####################################################
+# Set up the generator ... #
+####################################################
+cd /Herwig/Generators
+set theGenerator:EventHandler /Herwig/EventHandlers/theLesHouchesHandler
+set theGenerator:NumberOfEvents 100000000
+set theGenerator:RandomNumberGenerator:Seed 31122001
+set theGenerator:PrintEvent 1
+set theGenerator:MaxErrors 10000
+
+#########################################################
+# Option to off shower / hadronization / decays / MPI. #
+#########################################################
+cd /Herwig/EventHandlers
+# set theLesHouchesHandler:CascadeHandler NULL
+#set theLesHouchesHandler:HadronizationHandler NULL
+# remove the quark check in case hadronization is turned off
+# set /Herwig/Analysis/Basics:CheckQuark false
+#set theLesHouchesHandler:DecayHandler NULL
+# The handler for multiple parton interactions
+#set /Herwig/Shower/FxFxHandler:MPIHandler NULL
+
+#############################################################
+# Set up the FxFxHandler ... #
+#############################################################
+cd /Herwig/Shower
+set /Herwig/Shower/FxFxHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
+set /Herwig/Shower/FxFxHandler:RemDecayer /Herwig/Partons/RemnantDecayer
+set /Herwig/Shower/FxFxHandler:ShowerAlpha AlphaQCD
+# set the heavy quark decay product vetoing process on/off
+set FxFxHandler:HeavyQVeto Yes
+# Automatic detection of the hard process (experimental)
+set FxFxHandler:HardProcessDetection Automatic
+# No. of light jets in maximum-multiplicity FxFx process
+set FxFxHandler:njetsmax 1 # Make sure this is set correctly!
+# Mimimum parton-parton R-sep used for generation.
+set FxFxHandler:drjmin 0
+
+#########################################################
+# Recommended key merging parameters below #
+#########################################################
+cd /Herwig/Shower
+# turn the Vetoing On or Off completely
+set FxFxHandler:VetoIsTurnedOff VetoingIsOn
+# merging mode: in this case FxFx:
+set FxFxHandler:MergeMode FxFx
+# merging scale
+set FxFxHandler:ETClus 25*GeV
+# jet radius used in clustering in merging.
+set FxFxHandler:RClus 1.0
+# Max |eta| for jets in clustering in merging.
+set FxFxHandler:EtaClusMax 10
+# Default 1.5 factor used to decide if a jet matches a parton
+# in merging: if DR(parton,jet)<rclusfactor*rclus the parton
+# and jet are said to have been matched.
+set FxFxHandler:RClusFactor 1.5
+
+#########################################################
+# Rivet settings and other analyses #
+#########################################################
+cd /Herwig/Generators
+# Stuff for rivet:
+#create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
+#insert /Herwig/Analysis/RivetAnalysis:Analyses 0 MC_XS
+#insert /Herwig/Analysis/RivetAnalysis:Analyses 1 ATLAS_2017_I1514251
+
+
+cd /Herwig/Generators
+# Stuff for rivet:
+#create ThePEG::FxFxAnalysis /Herwig/Analysis/FxFxAnalysis FxFxAnalysis.so
+# use the optional weights (WARNING: runs rivet multiple times!)
+#set /Herwig/Analysis/FxFxAnalysis:UseOptWeights No
+#set /Herwig/Analysis/FxFxAnalysis:NormOptWeights Yes # different normalization for weights
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/FxFxAnalysis
+#insert /Herwig/Analysis/FxFxAnalysis:Analyses 0 MC_XS
+#insert /Herwig/Analysis/RivetAnalysis:Analyses 1 ATLAS_2017_I1514251
+
+
+# A HepMC dump file (requires --with-hepmc to be set at configure time)
+#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
+#set /Herwig/Analysis/HepMCFile:PrintEvent 100
+#set /Herwig/Analysis/HepMCFile:Format GenEvent
+#set /Herwig/Analysis/HepMCFile:Units GeV_mm
+
+# set the weight normalization
+set /Herwig/EventHandlers/theLesHouchesHandler:WeightNormalization CrossSection
+
+################
+# Save the run #
+################
+cd /Herwig/Generators
+
+saverun FxFx theGenerator
diff --git a/src/HW7-Zjets-FxFx-FxFx.in b/src/HW7-Zjets-FxFx-FxFx.in
deleted file mode 100644
--- a/src/HW7-Zjets-FxFx-FxFx.in
+++ /dev/null
@@ -1,194 +0,0 @@
-
-#############################################################
-# Create an event generator taking the default EventGenerator #
-# as the starting point ... #
-#############################################################
-cd /Herwig/Generators
-# Copy the default EventGenerator with its settings to a new
-# which will be the basis of the one we use for showering:
-cp EventGenerator theGenerator
-
-#############################################################
-# Create a LH event handler (set up & assigned below) ... #
-#############################################################
-cd /Herwig/EventHandlers
-library FxFx.so
-create Herwig::FxFxEventHandler theLesHouchesHandler
-
-#############################################################
-# Create a LH reader (set up & assigned below) ... #
-#############################################################
-cd /Herwig/EventHandlers
-library FxFx.so
-create Herwig::FxFxFileReader theLHReader
-
-#############################################################
-# Create an FxFxHandler (set up & assigned below) ... #
-#############################################################
-cd /Herwig/Shower
-library FxFxHandler.so
-create Herwig::FxFxHandler FxFxHandler
-set /Herwig/Shower/FxFxHandler:ShowerModel /Herwig/Shower/ShowerModel
-set /Herwig/Shower/FxFxHandler:SplittingGenerator /Herwig/Shower/SplittingGenerator
-
-#############################################################
-# Create an LHAPDF (set up & assigned below) ... #
-#############################################################
-cd /Herwig/Partons
-create ThePEG::LHAPDF thePDFset ThePEGLHAPDF.so
-
-############################################################
-# Create a cuts object ... #
-############################################################
-cd /Herwig/EventHandlers
-create ThePEG::Cuts /Herwig/Cuts/NoCuts
-
-#############################################################
-# Setup the LH event handler ... #\
-#############################################################
-cd /Herwig/EventHandlers
-insert theLesHouchesHandler:FxFxReaders[0] theLHReader
-set theLesHouchesHandler:WeightOption VarNegWeight
-set theLesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor
-set theLesHouchesHandler:CascadeHandler /Herwig/Shower/FxFxHandler
-set theLesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
-set theLesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler
-
-############################################################
-
-##################################################
-# Shower parameters
-##################################################
-# normally, you want
-# the scale supplied in the event files (SCALUP)
-# to be used as a pT veto scale in the parton shower
-set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
-set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
-# Shower parameters
-# treatment of wide angle radiation
-set /Herwig/Shower/PartnerFinder:PartnerMethod Random
-set /Herwig/Shower/PartnerFinder:ScaleChoice Partner
-# fix issue before 7.0.5 (not needed after this)
-#set /Herwig/Shower/GtoQQbarSplitFn:AngularOrdered Yes
-#set /Herwig/Shower/GammatoQQbarSplitFn:AngularOrdered Yes
-# with MC@NLO these parameters are required for consistency of the subtraction terms
-# suggested parameters
-set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost
-set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption General
-set /Herwig/Shower/KinematicsReconstructor:FinalStateReconOption Default
-set /Herwig/Shower/KinematicsReconstructor:InitialStateReconOption Rapidity
-set /Herwig/Shower/ShowerHandler:SpinCorrelations No
-
-############################################################
-
-#############################################################
-# Set up the LH reader ... #
-#############################################################
-cd /Herwig/EventHandlers
-set theLHReader:WeightWarnings false
-# Input event file name:
-# 100 k
-set theLHReader:FileName events.lhe.gz
-set theLHReader:MomentumTreatment RescaleEnergy
-set theLHReader:Cuts /Herwig/Cuts/NoCuts
-
-####################################################
-# Set up the generator ... #
-####################################################
-cd /Herwig/Generators
-set theGenerator:EventHandler /Herwig/EventHandlers/theLesHouchesHandler
-set theGenerator:NumberOfEvents 100000000
-set theGenerator:RandomNumberGenerator:Seed 31122001
-set theGenerator:PrintEvent 1
-set theGenerator:MaxErrors 10000
-
-#########################################################
-# Option to off shower / hadronization / decays / MPI. #
-#########################################################
-cd /Herwig/EventHandlers
-# set theLesHouchesHandler:CascadeHandler NULL
-#set theLesHouchesHandler:HadronizationHandler NULL
-# remove the quark check in case hadronization is turned off
-# set /Herwig/Analysis/Basics:CheckQuark false
-#set theLesHouchesHandler:DecayHandler NULL
-# The handler for multiple parton interactions
-#set /Herwig/Shower/FxFxHandler:MPIHandler NULL
-
-#############################################################
-# Set up the FxFxHandler ... #
-#############################################################
-cd /Herwig/Shower
-set /Herwig/Shower/FxFxHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
-set /Herwig/Shower/FxFxHandler:RemDecayer /Herwig/Partons/RemnantDecayer
-set /Herwig/Shower/FxFxHandler:ShowerAlpha AlphaQCD
-# set the heavy quark decay product vetoing process on/off
-set FxFxHandler:HeavyQVeto Yes
-# Automatic detection of the hard process (experimental)
-set FxFxHandler:HardProcessDetection Automatic
-# No. of light jets in maximum-multiplicity FxFx process
-set FxFxHandler:njetsmax 1 # Make sure this is set correctly!
-# Mimimum parton-parton R-sep used for generation.
-set FxFxHandler:drjmin 0
-
-#########################################################
-# Recommended key merging parameters below #
-#########################################################
-cd /Herwig/Shower
-# turn the Vetoing On or Off completely
-set FxFxHandler:VetoIsTurnedOff VetoingIsOn
-# merging mode: in this case FxFx:
-set FxFxHandler:MergeMode FxFx
-# merging scale
-set FxFxHandler:ETClus 25*GeV
-# jet radius used in clustering in merging.
-set FxFxHandler:RClus 1.0
-# Max |eta| for jets in clustering in merging.
-set FxFxHandler:EtaClusMax 10
-# Default 1.5 factor used to decide if a jet matches a parton
-# in merging: if DR(parton,jet)<rclusfactor*rclus the parton
-# and jet are said to have been matched.
-set FxFxHandler:RClusFactor 1.5
-
-#########################################################
-# Rivet settings and other analyses #
-#########################################################
-cd /Herwig/Generators
-# Stuff for rivet:
-create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
-insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 MC_XS
-insert /Herwig/Analysis/RivetAnalysis:Analyses 1 ATLAS_2011_I928289_Z
-insert /Herwig/Analysis/RivetAnalysis:Analyses 2 ATLAS_2011_I945498
-insert /Herwig/Analysis/RivetAnalysis:Analyses 3 ATLAS_2011_S9131140
-insert /Herwig/Analysis/RivetAnalysis:Analyses 4 ATLAS_2013_I1230812
-insert /Herwig/Analysis/RivetAnalysis:Analyses 5 ATLAS_2014_I1315949
-
-cd /Herwig/Generators
-# Stuff for rivet:
-#create ThePEG::FxFxAnalysis /Herwig/Analysis/FxFxAnalysis FxFxAnalysis.so
-# use the optional weights (WARNING: runs rivet multiple times!)
-#set /Herwig/Analysis/FxFxAnalysis:UseOptWeights No
-#set /Herwig/Analysis/FxFxAnalysis:NormOptWeights Yes # different normalization for weights
-#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/FxFxAnalysis
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 0 MC_XS
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 1 MC_TTBAR
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 2 ATLAS_2014_I1304289
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 2 ATLAS_2013_I1243871
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 3 ATLAS_2014_I1304688
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 4 ATLAS_2015_I1345452
-
-# A HepMC dump file (requires --with-hepmc to be set at configure time)
-#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
-#set /Herwig/Analysis/HepMCFile:PrintEvent 100
-#set /Herwig/Analysis/HepMCFile:Format GenEvent
-#set /Herwig/Analysis/HepMCFile:Units GeV_mm
-
-# set the weight normalization
-set /Herwig/EventHandlers/theLesHouchesHandler:WeightNormalization CrossSection
-
-################
-# Save the run #
-################
-cd /Herwig/Generators
-
-saverun HW7-Zjets-FxFx-FxFx theGenerator
diff --git a/src/HW7-Zjets-FxFx-Tree.in b/src/HW7-Zjets-FxFx-Tree.in
deleted file mode 100644
--- a/src/HW7-Zjets-FxFx-Tree.in
+++ /dev/null
@@ -1,198 +0,0 @@
-
-#############################################################
-# Create an event generator taking the default EventGenerator #
-# as the starting point ... #
-#############################################################
-cd /Herwig/Generators
-# Copy the default EventGenerator with its settings to a new
-# which will be the basis of the one we use for showering:
-cp EventGenerator theGenerator
-
-#############################################################
-# Create a LH event handler (set up & assigned below) ... #
-#############################################################
-cd /Herwig/EventHandlers
-library FxFx.so
-create Herwig::FxFxEventHandler theLesHouchesHandler
-
-#############################################################
-# Create a LH reader (set up & assigned below) ... #
-#############################################################
-cd /Herwig/EventHandlers
-library FxFx.so
-create Herwig::FxFxFileReader theLHReader
-
-#############################################################
-# Create an FxFxHandler (set up & assigned below) ... #
-#############################################################
-cd /Herwig/Shower
-library FxFxHandler.so
-create Herwig::FxFxHandler FxFxHandler
-set /Herwig/Shower/FxFxHandler:ShowerModel /Herwig/Shower/ShowerModel
-set /Herwig/Shower/FxFxHandler:SplittingGenerator /Herwig/Shower/SplittingGenerator
-
-#############################################################
-# Create an LHAPDF (set up & assigned below) ... #
-#############################################################
-cd /Herwig/Partons
-create ThePEG::LHAPDF thePDFset ThePEGLHAPDF.so
-
-############################################################
-# Create a cuts object ... #
-############################################################
-cd /Herwig/EventHandlers
-create ThePEG::Cuts /Herwig/Cuts/NoCuts
-
-#############################################################
-# Setup the LH event handler ... #
-#############################################################
-cd /Herwig/EventHandlers
-insert theLesHouchesHandler:FxFxReaders[0] theLHReader
-set theLesHouchesHandler:WeightOption VarNegWeight
-set theLesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor
-set theLesHouchesHandler:CascadeHandler /Herwig/Shower/FxFxHandler
-set theLesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
-set theLesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler
-############################################################
-
-##################################################
-# Shower parameters
-##################################################
-# normally, you want
-# the scale supplied in the event files (SCALUP)
-# to be used as a pT veto scale in the parton shower
-set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
-set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
-# Shower parameters
-# treatment of wide angle radiation
-set /Herwig/Shower/PartnerFinder:PartnerMethod Random
-set /Herwig/Shower/PartnerFinder:ScaleChoice Partner
-# fix issue before 7.0.5 (not needed after this)
-#set /Herwig/Shower/GtoQQbarSplitFn:AngularOrdered Yes
-#set /Herwig/Shower/GammatoQQbarSplitFn:AngularOrdered Yes
-# with MC@NLO these parameters are required for consistency of the subtraction terms
-# suggested parameters
-#set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost
-#set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption General
-#set /Herwig/Shower/KinematicsReconstructor:FinalStateReconOption Default
-#set /Herwig/Shower/KinematicsReconstructor:InitialStateReconOption Rapidity
-#set /Herwig/Shower/ShowerHandler:SpinCorrelations No
-############################################################
-
-#############################################################
-# Set up the LH reader ... #
-#############################################################
-cd /Herwig/EventHandlers
-set theLHReader:WeightWarnings false
-# Input event file name:
-# 10 k
-set theLHReader:FileName unweighted_events.lhe.gz
-set theLHReader:MomentumTreatment RescaleEnergy
-set theLHReader:Cuts /Herwig/Cuts/NoCuts
-
-####################################################
-# Set up the generator ... #
-####################################################
-cd /Herwig/Generators
-set theGenerator:EventHandler /Herwig/EventHandlers/theLesHouchesHandler
-set theGenerator:NumberOfEvents 100000000
-set theGenerator:RandomNumberGenerator:Seed 31122001
-set theGenerator:PrintEvent 1
-set theGenerator:MaxErrors 10000
-
-#########################################################
-# Option to off shower / hadronization / decays / MPI. #
-#########################################################
-cd /Herwig/EventHandlers
-# set theLesHouchesHandler:CascadeHandler NULL
-#set theLesHouchesHandler:HadronizationHandler NULL
-# remove the quark check in case hadronization is turned off
-# set /Herwig/Analysis/Basics:CheckQuark false
-#set theLesHouchesHandler:DecayHandler NULL
-# The handler for multiple parton interactions
-#set /Herwig/Shower/FxFxHandler:MPIHandler NULL
-
-#############################################################
-# Set up the FxFxHandler ... #
-#############################################################
-cd /Herwig/Shower
-set /Herwig/Shower/FxFxHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler
-set /Herwig/Shower/FxFxHandler:RemDecayer /Herwig/Partons/RemnantDecayer
-set /Herwig/Shower/FxFxHandler:ShowerAlpha AlphaQCD
-# set the heavy quark decay product vetoing process on/off
-set FxFxHandler:HeavyQVeto Yes
-# Automatic detection of the hard process (experimental)
-set FxFxHandler:HardProcessDetection Automatic
-set FxFxHandler:ihrd 3
-# No. of light jets in maximum-multiplicity FxFx process
-set FxFxHandler:njetsmax 1 # Make sure this is set correctly!
-# Mimimum parton-parton R-sep used for generation.
-set FxFxHandler:drjmin 0
-
-#########################################################
-# Recommended key merging parameters below #
-#########################################################
-cd /Herwig/Shower
-# turn the Vetoing On or Off completely
-set FxFxHandler:VetoIsTurnedOff VetoingIsOn
-# merging mode: in this case Tree level with MG5 information:
-set FxFxHandler:MergeMode TreeMG5
-# merging scale
-set FxFxHandler:ETClus 25*GeV
-# jet radius used in clustering in merging.
-set FxFxHandler:RClus 1.0
-# Max |eta| for jets in clustering in merging.
-set FxFxHandler:EtaClusMax 10
-# Default 1.5 factor used to decide if a jet matches a parton
-# in merging: if DR(parton,jet)<rclusfactor*rclus the parton
-# and jet are said to have been matched.
-set FxFxHandler:RClusFactor 1.5
-
-#########################################################
-# Rivet settings and other analyses #
-#########################################################
-cd /Herwig/Generators
-# Stuff for rivet:
-create ThePEG::RivetAnalysis /Herwig/Analysis/RivetAnalysis RivetAnalysis.so
-insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/RivetAnalysis
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 MC_XS
-insert /Herwig/Analysis/RivetAnalysis:Analyses 1 ATLAS_2011_I928289_Z
-insert /Herwig/Analysis/RivetAnalysis:Analyses 2 ATLAS_2011_I945498
-insert /Herwig/Analysis/RivetAnalysis:Analyses 3 ATLAS_2011_S9131140
-insert /Herwig/Analysis/RivetAnalysis:Analyses 4 ATLAS_2013_I1230812
-insert /Herwig/Analysis/RivetAnalysis:Analyses 5 ATLAS_2014_I1315949
-#insert /Herwig/Analysis/RivetAnalysis:Analyses 1 MC_TTBAR
-#insert /Herwig/Analysis/RivetAnalysis:Analyses 2 ATLAS_2014_I1304289
-#insert /Herwig/Analysis/RivetAnalysis:Analyses 2 ATLAS_2013_I1243871
-#insert /Herwig/Analysis/RivetAnalysis:Analyses 3 ATLAS_2014_I1304688
-#insert /Herwig/Analysis/RivetAnalysis:Analyses 4 ATLAS_2015_I1345452
-
-cd /Herwig/Generators
-# Stuff for rivet:
-#create ThePEG::FxFxAnalysis /Herwig/Analysis/FxFxAnalysis FxFxAnalysis.so
-# use the optional weights (WARNING: runs rivet multiple times!)
-#set /Herwig/Analysis/FxFxAnalysis:UseOptWeights No
-#set /Herwig/Analysis/FxFxAnalysis:NormOptWeights Yes # different normalization for weights
-#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/FxFxAnalysis
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 0 MC_XS
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 1 MC_TTBAR
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 2 ATLAS_2014_I1304289
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 2 ATLAS_2013_I1243871
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 3 ATLAS_2014_I1304688
-#insert /Herwig/Analysis/FxFxAnalysis:Analyses 4 ATLAS_2015_I1345452
-
-# A HepMC dump file (requires --with-hepmc to be set at configure time)
-#insert theGenerator:AnalysisHandlers 0 /Herwig/Analysis/HepMCFile
-#set /Herwig/Analysis/HepMCFile:PrintEvent 100
-#set /Herwig/Analysis/HepMCFile:Format GenEvent
-#set /Herwig/Analysis/HepMCFile:Units GeV_mm
-
-# set the weight normalization
-#set /Herwig/EventHandlers/theLesHouchesHandler:WeightNormalization CrossSection
-
-################
-# Save the run #
-################
-cd /Herwig/Generators
-
-saverun HW7-Zjets-FxFx-Tree theGenerator
diff --git a/src/LHE.in b/src/LHE.in
--- a/src/LHE.in
+++ b/src/LHE.in
@@ -1,100 +1,96 @@
##################################################
# Example generator based on LHC parameters
# usage: Herwig read LHE.in
##################################################
read snippets/PPCollider.in
##################################################
# Technical parameters for this run
##################################################
cd /Herwig/Generators
set EventGenerator:NumberOfEvents 10000000
set EventGenerator:RandomNumberGenerator:Seed 31122001
set EventGenerator:DebugLevel 0
set EventGenerator:PrintEvent 10
set EventGenerator:MaxErrors 10000
##################################################
# Create the Les Houches file handler and reader
##################################################
cd /Herwig/EventHandlers
library LesHouches.so
# create the event handler
create ThePEG::LesHouchesEventHandler LesHouchesHandler
# set the various step handlers
set LesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor
set LesHouchesHandler:CascadeHandler /Herwig/Shower/ShowerHandler
set LesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler
set LesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler
# set the weight option (e.g. for MC@NLO)
set LesHouchesHandler:WeightOption VarNegWeight
# set event hander as one to be used
set /Herwig/Generators/EventGenerator:EventHandler /Herwig/EventHandlers/LesHouchesHandler
# Set up an EMPTY CUTS object
# Normally you will have imposed any cuts you want
# when generating the event file and don't want any more
# in particular for POWHEG and MC@NLO you must not apply cuts on the
# the extra jet
create ThePEG::Cuts /Herwig/Cuts/NoCuts
# You may wish to use the same PDF as the events were generated with
create ThePEG::LHAPDF /Herwig/Partons/LHAPDF ThePEGLHAPDF.so
set /Herwig/Partons/LHAPDF:PDFName NAME_OF_PDF
set /Herwig/Partons/LHAPDF:RemnantHandler /Herwig/Partons/HadronRemnants
set /Herwig/Particles/p+:PDF /Herwig/Partons/LHAPDF
set /Herwig/Particles/pbar-:PDF /Herwig/Partons/LHAPDF
set /Herwig/Partons/PPExtractor:FirstPDF /Herwig/Partons/LHAPDF
set /Herwig/Partons/PPExtractor:SecondPDF /Herwig/Partons/LHAPDF
# We would recommend the shower uses the default PDFs with which it was tuned.
# However it can be argued that the same set as for the sample should be used for
# matched samples, i.e. MC@NLO (and less so POWHEG)
#set /Herwig/Shower/ShowerHandler:PDFA /Herwig/Partons/LHAPDF
#set /Herwig/Shower/ShowerHandler:PDFB /Herwig/Partons/LHAPDF
# You can in principle also change the PDFs for the remnant extraction and
# multiple scattering. As the generator was tuned with the default values
# this is STRONGLY DISCOURAGED without retuning the MPI parameters
# create the reader and set cuts
create ThePEG::LesHouchesFileReader LesHouchesReader
set LesHouchesReader:FileName NAME_OF_FILE #(the file can be compressed (gziped,bziped))
set LesHouchesReader:AllowedToReOpen No
set LesHouchesReader:InitPDFs 0
set LesHouchesReader:Cuts /Herwig/Cuts/NoCuts
# option to ensure momentum conservation is O.K. due rounding errors (recommended)
set LesHouchesReader:MomentumTreatment RescaleEnergy
# set the pdfs
set LesHouchesReader:PDFA /Herwig/Partons/LHAPDF
set LesHouchesReader:PDFB /Herwig/Partons/LHAPDF
# if using BSM models with QNUMBER info
#set LesHouchesReader:QNumbers Yes
#set LesHouchesReader:Decayer /Herwig/Decays/Mambo
# and add to handler
insert LesHouchesHandler:LesHouchesReaders 0 LesHouchesReader
##################################################
# Shower parameters
##################################################
# normally, especially for POWHEG, you want
# the scale supplied in the event files (SCALUP)
# to be used as a pT veto scale in the parton shower
set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes
set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes
# Shower parameters
# treatment of wide angle radiation
set /Herwig/Shower/PartnerFinder:PartnerMethod Random
set /Herwig/Shower/PartnerFinder:ScaleChoice Partner
-# fix issue before 7.0.5 (not needed after this)
-set /Herwig/Shower/GtoQQbarSplitFn:AngularOrdered Yes
-set /Herwig/Shower/GammatoQQbarSplitFn:AngularOrdered Yes
# with MC@NLO these parameters are required for consistency of the subtraction terms
# suggested parameters (give worse physics results with POWHEG)
#set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost
#set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption General
-#set /Herwig/Shower/KinematicsReconstructor:FinalStateReconOption Default
#set /Herwig/Shower/KinematicsReconstructor:InitialStateReconOption Rapidity
#set /Herwig/Shower/ShowerHandler:SpinCorrelations No
##################################################
# LHC physics parameters (override defaults here)
##################################################
# e.g if different top mass used
#set /Herwig/Particles/t:NominalMass 173.0
##################################################
# Save run for later usage with 'Herwig run'
##################################################
cd /Herwig/Generators
saverun LHE EventGenerator
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,228 +1,228 @@
SUBDIRS = defaults snippets Matchbox Merging
defaultsdir = ${pkgdatadir}/defaults
bin_PROGRAMS = Herwig
Herwig_SOURCES = \
HerwigMain.cc HerwigCLI.cc HerwigCLI.h \
herwigopts.c herwigopts.h
BUILT_SOURCES = herwigopts.c herwigopts.h
Herwig_LDFLAGS = $(AM_LDFLAGS) -export-dynamic $(THEPEGLDFLAGS)
Herwig_LDADD = $(THEPEGLIB) -ldl \
$(top_builddir)/API/libHerwigAPI.la
bin_SCRIPTS = herwig-config
HELPERFILES = \
CMSSM40.1.1.slha \
NMSSM.spc \
ADD.model \
Leptoquark.model \
LH.model \
LHTP.model \
MSSM.model \
MUED.model \
NMSSM.model \
RPV-Bi.model \
RPV-Tri.model \
RS.model \
Sextet.model \
TTBA.model \
Zprime.model \
RPV-BI.slha \
RPV-TRI.slha \
RPV-UDD.slha
INPUTFILES = \
DIS.in \
DIS-Matchbox.in \
GammaGamma.in \
ILC.in \
ILC-MSSM.in \
ILC-MUED.in \
ILC-RS.in \
LEP.in \
LEP-Matchbox.in \
LHC-ADD.in \
LHC-CEX.in \
LHC-GammaGamma.in \
LHC-ResolvedGammaGamma.in \
LHC.in \
LHC-Matchbox.in \
LHC-LQ.in \
LHC-MSSM.in \
LHC-MUED.in \
LHC-NMSSM.in \
LHC-Powheg.in \
LHC-RPV.in \
LHC-RS.in \
LHC-Sextet.in \
LHC-TRP.in \
LHC-TTBA.in \
LHC-MB.in \
LHC-ZP.in \
TVT.in \
TVT-Powheg.in \
TVT-TTBA.in \
LHC-LH.in \
LHC-LHTP.in \
LHE.in \
-HW7-Zjets-FxFx-FxFx.in\
-HW7-Zjets-FxFx-Tree.in
+FxFx.in\
+FxFx-Tree.in
dist_pkgdata_DATA = $(INPUTFILES) $(HELPERFILES)
pkgdata_DATA = Makefile-UserModules
CLEANFILES = HerwigDefaults.rpo \
*.run *.log *.out *.tex \
multi.test *.output probs.test chisq.value \
LHC-RS-BR.spc LHC-MSSM-BR.spc LHC-RPV-BR.spc
clean-local:
-rm -rf Herwig
## checking targets ##
HerwigDefaults.rpo: Herwig $(srcdir)/defaults/*.in defaults/PDF.in defaults/Analysis.in $(top_builddir)/lib/*.so
./Herwig init -L$(top_builddir)/lib defaults/HerwigDefaults.in -D
check_BSM_Full=
check_BSM=
if WANT_BSM
check_BSM += check-LHC-RPV check-LHC-RS
check_BSM_Full += \
check-LHC-RPV check-LHC-MSSM check-ILC-MSSM \
check-LHC-NMSSM \
check-LHC-MUED check-ILC-MUED \
check-LHC-RS check-ILC-RS check-LHC-ADD \
check-LHC-LH check-LHC-LHTP \
check-LHC-TRP \
check-LHC-TTBA check-TVT-TTBA \
check-LHC-ZP \
check-LHC-LQ \
check-LHC-Sextet
endif
check_BSM_Full_valgrind = $(subst check,check-valgrind,$(check_BSM_Full))
check_BSM_valgrind = $(subst check,check-valgrind,$(check_BSM))
check-local: check-LEP check-LHC $(check_BSM) check-DIS check-ILC check-GammaGamma check-LHC-Powheg
check-valgrind-local: check-valgrind-LEP check-valgrind-LHC $(check_BSM_valgrind) check-valgrind-DIS check-valgrind-ILC check-valgrind-GammaGamma check-valgrind-LHC-Powheg
check-Powheg: check-LHC-Powheg check-TVT-Powheg
check-valgrind-Powheg: check-valgrind-LHC-Powheg check-valgrind-TVT-Powheg
check-BSM: $(check_BSM_Full)
check-valgrind-BSM: $(check_BSM_Full_valgrind)
check_Matchbox= \
check-LEP-Matchbox check-DIS-Matchbox check-LHC-Matchbox
check_Matchbox_valgrind = $(subst check,check-valgrind,$(check_Matchbox))
check-Matchbox: $(check_Matchbox)
check-valgrind-Matchbox: $(check_Matchbox_valgrind)
check-extra: check-LHC-CEX check-LHC-GammaGamma check-LHC-ResolvedGammaGamma check-LHC-MB check-TVT
check-valgrind-extra: check-valgrind-LHC-CEX check-valgrind-LHC-GammaGamma check-valgrind-LHC-MB check-valgrind-TVT
check-all: check-local check-Powheg check-BSM check-Matchbox check-extra
check-valgrind-all: check-valgrind-local check-valgrind-Powheg check-valgrind-BSM check-valgrind-Matchbox check-valgrind-extra
link-helper-files:
@for i in $(HELPERFILES); do \
if test -f $(srcdir)/$$i -a ! -e $$i; then \
$(LN_S) -f $(srcdir)/$$i; fi; done
## valgrind targets ##
VALGRIND=valgrind --leak-check=full --num-callers=25 --freelist-vol=100000000 --leak-resolution=med --trace-children=yes
check-valgrind-%: $(srcdir)/%.in HerwigDefaults.rpo link-helper-files
$(VALGRIND) ./Herwig read -d1 -D $< &> valgrind-$(notdir $(subst .in,,$<))-read.log
$(VALGRIND) ./Herwig run $(notdir $(subst .in,.run,$<)) -N 500 -d1 -D &> valgrind-$(notdir $(subst .in,,$<))-run.log
valgrind: valgrind-init valgrind-read valgrind-run
valgrind-init:
$(VALGRIND) ./Herwig init -d1 -D -L$(top_builddir)/lib defaults/HerwigDefaults.in \
&> /tmp/valgrind-init.log
valgrind-read:
$(VALGRIND) ./Herwig read -d1 -D LHC.in &> /tmp/valgrind-read.log
valgrind-run:
$(VALGRIND) ./Herwig run -d1 -D -N5 LHC.run &> /tmp/valgrind-run.log
CHECKCOMMAND = ./Herwig run $(notdir $(subst .in,.run,$<)) -N500 -d1 -D
check-%: $(srcdir)/%.in HerwigDefaults.rpo link-helper-files
./Herwig read -i . $< -D
@echo $(CHECKCOMMAND)
@$(CHECKCOMMAND) && echo "# $@ OK #" \
|| (echo "###### $@ BAD ######"; false)
SETUPTHEPEG=$(THEPEGPATH)/bin/setupThePEG
THEPEGREPO=$(THEPEGLIBPATH)/ThePEGDefaults.rpo
install-data-hook:
@echo Creating repository
@./Herwig init -L$(DESTDIR)$(pkglibdir) -i$(DESTDIR)$(pkgdatadir) -i$(DESTDIR)$(pkgdatadir)/snippets $(DESTDIR)$(defaultsdir)/HerwigDefaults.in --repo=$(DESTDIR)$(pkgdatadir)/HerwigDefaults.rpo
@if test -n "$(DESTDIR)"; \
then sed -i.bak -e "s@$(DESTDIR)@@g" $(DESTDIR)$(pkgdatadir)/HerwigDefaults.rpo; \
rm -f $(DESTDIR)$(pkgdatadir)/HerwigDefaults.rpo.bak; \
fi
uninstall-hook:
rm -f $(DESTDIR)$(pkgdatadir)/HerwigDefaults.rpo
register: register-with-thepeg-repo
register-with-thepeg-repo:
@if test -x "$(SETUPTHEPEG)" -a -w "$(THEPEGREPO)"; \
then echo Registering with ThePEG; \
"$(SETUPTHEPEG)" --init \
$(DESTDIR)$(defaultsdir)/HerwigDefaults.in \
-r "$(THEPEGREPO)" -o "$(THEPEGREPO)" \
-i $(DESTDIR)$(pkgdatadir) \
-l$(DESTDIR)$(pkglibdir) ; \
if test -n "$(DESTDIR)"; \
then sed -i -e "s@$(DESTDIR)@@g" "$(THEPEGREPO)" ; fi ; \
fi
unregister : unregister-from-thepeg-repo
unregister-from-thepeg-repo:
@if test -x "$(SETUPTHEPEG)" -a -w "$(THEPEGREPO)"; \
then echo Unregistering with ThePEG; \
"$(SETUPTHEPEG)" --init defaults/HerwigCleanup.in \
-r "$(THEPEGREPO)" -o "$(THEPEGREPO)" \
-l$(DESTDIR)$(pkglibdir) ; \
fi
EXTRA_DIST = herwigopts.ggo
nodist_Herwig_SOURCES = hgstamp.inc
BUILT_SOURCES += hgstamp.inc
CLEANFILES += hgstamp.inc
HGVERSION := $(shell hg -R $(top_srcdir) parents --template '"Herwig {node|short} ({branch})"' 2> /dev/null || echo \"$(PACKAGE_STRING)\" || true )
.PHONY: update_hgstamp
hgstamp.inc: update_hgstamp
@[ -f $@ ] || touch $@
@echo '$(HGVERSION)' | cmp -s $@ - || echo '$(HGVERSION)' > $@
GENGETOPT = gengetopt
%opts.h %opts.c : %opts.ggo
$(GENGETOPT) < $<

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 3:07 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3801835
Default Alt Text
(117 KB)

Event Timeline