Page MenuHomeHEPForge

No OneTemporary

diff --git a/Exsample2/BinSampler.cc b/Exsample2/BinSampler.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/BinSampler.cc
@@ -0,0 +1,164 @@
+// -*- C++ -*-
+//
+// BinSampler.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the BinSampler class.
+//
+
+#include "BinSampler.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Repository/UseRandom.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/Utilities/DescribeClass.h"
+
+#include "ThePEG/Interface/Parameter.h"
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+#include "ThePEG/Handlers/StandardEventHandler.h"
+#include "ThePEG/Handlers/StandardXComb.h"
+
+#include <boost/progress.hpp>
+
+using namespace Herwig;
+
+BinSampler::BinSampler()
+ : Interfaced(), MultiIterationStatistics(),
+ theInitialPoints(1000000), theBin(-1),
+ theInitialized(false) {}
+
+BinSampler::~BinSampler() {}
+
+IBPtr BinSampler::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr BinSampler::fullclone() const {
+ return new_ptr(*this);
+}
+
+string BinSampler::process() const {
+ ostringstream os("");
+ const StandardEventHandler& eh = *theEventHandler;
+ const StandardXComb& xc = *eh.xCombs()[theBin];
+ os << xc.matrixElement()->name() << " : ";
+ os << xc.mePartonData()[0]->PDGName() << " "
+ << xc.mePartonData()[1]->PDGName() << " -> ";
+ for ( cPDVector::const_iterator pid =
+ xc.mePartonData().begin() + 2;
+ pid != xc.mePartonData().end(); ++pid )
+ os << (**pid).PDGName() << " ";
+ return os.str();
+}
+
+void BinSampler::generate(bool noMaxInfo) {
+ double w = 1.;
+ for ( size_t k = 0; k < lastPoint().size(); ++k ) {
+ lastPoint()[k] = UseRandom::rnd();
+ }
+ try {
+ w = theEventHandler->dSigDR(lastPoint()) / nanobarn;
+ } catch (Veto&) {
+ w = 0.0;
+ } catch (...) {
+ throw;
+ }
+ if ( abs(w) > maxWeight() && !noMaxInfo ) {
+ double old = maxWeight();
+ select(w);
+ throw NewMaximum(old,abs(w));
+ }
+ select(w);
+}
+
+void BinSampler::runIteration(unsigned long points, bool progress) {
+
+ boost::progress_display* progressBar = 0;
+ if ( progress ) {
+ cout << "integrating " << process() << " , iteration "
+ << (iterations().size() + 1);
+ progressBar = new boost::progress_display(points,cout);
+ }
+
+ for ( unsigned long k = 0; k < points; ++k ) {
+
+ generate(true);
+
+ if ( progress ) {
+ ++(*progressBar);
+ }
+
+ }
+
+ if ( !iterations().empty() )
+ chi2(iterations().back());
+
+ if ( progress ) {
+ cout << "integrated ( "
+ << averageWeight() << " +/- " << sqrt(averageWeightVariance())
+ << " ) nb\nepsilon = "
+ << averageAbsWeight()/abs(maxWeight());
+ if ( chi2() >= 0. )
+ cout << " chi2 = " << chi2();
+ cout << "\n";
+ cout << "--------------------------------------------------------------------------------\n";
+ }
+
+ if ( progressBar )
+ delete progressBar;
+
+}
+
+void BinSampler::initialize(bool progress) {
+ if ( initialized() )
+ return;
+ lastPoint().resize(dimension());
+ runIteration(initialPoints(),progress);
+ isInitialized();
+}
+
+// If needed, insert default implementations of virtual function defined
+// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+
+
+void BinSampler::persistentOutput(PersistentOStream & os) const {
+ MultiIterationStatistics::put(os);
+ os << theInitialPoints << theBin << theInitialized << theLastPoint;
+}
+
+void BinSampler::persistentInput(PersistentIStream & is, int) {
+ MultiIterationStatistics::get(is);
+ is >> theInitialPoints >> theBin >> theInitialized >> theLastPoint;
+}
+
+
+// *** Attention *** The following static variable is needed for the type
+// description system in ThePEG. Please check that the template arguments
+// are correct (the class and its base class), and that the constructor
+// arguments are correct (the class name and the name of the dynamically
+// loadable library where the class implementation can be found).
+DescribeClass<BinSampler,Interfaced>
+ describeHerwigBinSampler("Herwig::BinSampler", "HwExsample2.so");
+
+void BinSampler::Init() {
+
+ static ClassDocumentation<BinSampler> documentation
+ ("BinSampler samples XCombs bins. This default implementation performs flat MC integration.");
+
+
+ static Parameter<BinSampler,unsigned long> interfaceInitialPoints
+ ("InitialPoints",
+ "The number of points to use for initial integration.",
+ &BinSampler::theInitialPoints, 1000000, 1, 0,
+ false, false, Interface::lowerlim);
+
+}
+
diff --git a/Exsample2/BinSampler.h b/Exsample2/BinSampler.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/BinSampler.h
@@ -0,0 +1,257 @@
+// -*- C++ -*-
+//
+// BinSampler.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_BinSampler_H
+#define Herwig_BinSampler_H
+//
+// This is the declaration of the BinSampler class.
+//
+
+#include "ThePEG/Handlers/StandardEventHandler.h"
+#include "ThePEG/Utilities/Exception.h"
+#include "ThePEG/Repository/UseRandom.h"
+
+#include "MultiIterationStatistics.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ *
+ * \brief BinSampler samples XCombs bins. This default implementation
+ * performs flat MC integration.
+ *
+ * @see \ref BinSamplerInterfaces "The interfaces"
+ * defined for BinSampler.
+ */
+class BinSampler: public Interfaced, public Herwig::MultiIterationStatistics {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ BinSampler();
+
+ /**
+ * The destructor.
+ */
+ virtual ~BinSampler();
+ //@}
+
+public:
+
+ /**
+ * Clone this object.
+ */
+ Ptr<BinSampler>::ptr cloneMe() const {
+ return dynamic_ptr_cast<Ptr<BinSampler>::ptr>(clone());
+ }
+
+public:
+
+ /**
+ * Set the event handler
+ */
+ void eventHandler(tStdEHPtr eh) { theEventHandler = eh; }
+
+ /**
+ * Return the event handler
+ */
+ tStdEHPtr eventHandler() const { return theEventHandler; }
+
+ /**
+ * Return the bin
+ */
+ int bin() const { return theBin; }
+
+ /**
+ * Set the bin
+ */
+ void bin(int b) { theBin = b; }
+
+ /**
+ * Return a string describing the process handled by this sampler.
+ */
+ string process() const;
+
+ /**
+ * Return the last generated point.
+ */
+ const vector<double>& lastPoint() const { return theLastPoint; }
+
+ /**
+ * Access the last generated point.
+ */
+ vector<double>& lastPoint() { return theLastPoint; }
+
+ /**
+ * Return true, if this bin sampler produces unweighted events.
+ */
+ virtual bool isUnweighting() const { return false; }
+
+ /**
+ * Return true, if this sampler is in a compensating mode.
+ */
+ virtual bool compensating() const { return false; }
+
+ /**
+ * Exception to be thrown, if a new maximum weight has been encountered
+ * which should be taken care of by the unweighting performed in GeneralSampler
+ */
+ struct NewMaximum {
+ double oldMaxWeight;
+ double newMaxWeight;
+ NewMaximum(double oldm, double newm)
+ : oldMaxWeight(oldm), newMaxWeight(newm) {}
+ };
+
+ /**
+ * Exception to be thrown if cross section information should be updated.
+ */
+ struct UpdateCrossSections {};
+
+ /**
+ * Generate the next point; store the point in lastPoint() and its
+ * weight using select(); if noMaxInfo is true, do not throw
+ * NewMaximum or UpdateCrossSections exceptions.
+ */
+ virtual void generate(bool noMaxInfo = false);
+
+ /**
+ * Run a single iteration of n points, optionally printing a
+ * progress bar to cout. Calls generate n times.
+ */
+ void runIteration(unsigned long n, bool progress);
+
+ /**
+ * Initialize this bin sampler. This default version calls runIteration.
+ */
+ virtual void initialize(bool progress);
+
+ /**
+ * Return true, if this sampler has already been initialized.
+ */
+ bool initialized() const { return theInitialized; }
+
+ /**
+ * Indicate that this sampler has already been initialized.
+ */
+ void isInitialized() { theInitialized = true; }
+
+ /**
+ * Finalize this sampler.
+ */
+ virtual void finalize(bool) {}
+
+public:
+
+ /**
+ * Return the dimension.
+ */
+ int dimension() const { return theEventHandler->nDim(bin()); }
+
+ /**
+ * Return the number of points to be used for initial integration.
+ */
+ unsigned long initialPoints() const { return theInitialPoints; }
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * The standard Init function used to initialize the interfaces.
+ * Called exactly once for each class by the class description system
+ * before the main function starts or
+ * when this class is dynamically loaded.
+ */
+ static void Init();
+
+protected:
+
+ /** @name Clone Methods. */
+ //@{
+ /**
+ * Make a simple clone of this object.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+// If needed, insert declarations of virtual function defined in the
+// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
+
+private:
+
+ /**
+ * The number of points to use for initial integration.
+ */
+ unsigned long theInitialPoints;
+
+ /**
+ * The bin to be sampled.
+ */
+ int theBin;
+
+ /**
+ * Wether or not this sampler has already been initialized.
+ */
+ bool theInitialized;
+
+ /**
+ * The last generated point.
+ */
+ vector<double> theLastPoint;
+
+protected:
+
+ /**
+ * The event handler to be used.
+ */
+ tStdEHPtr theEventHandler;
+
+private:
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ BinSampler & operator=(const BinSampler &);
+
+};
+
+}
+
+#endif /* Herwig_BinSampler_H */
diff --git a/Exsample2/BinnedStatistics.cc b/Exsample2/BinnedStatistics.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/BinnedStatistics.cc
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+//
+// GeneralStatictis.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the BinnedStatistics class.
+//
+
+#include "BinnedStatistics.h"
+
+#include <boost/utility.hpp>
+using boost::next;
+using boost::prior;
+
+using namespace Herwig;
+
+BinnedStatistics::~BinnedStatistics() {}
+
+void BinnedStatistics::put(PersistentOStream & os) const {
+ os << statisticsMap << weightMap
+ << selectorMap << lastPoint;
+}
+
+void BinnedStatistics::get(PersistentIStream & is) {
+ is >> statisticsMap >> weightMap
+ >> selectorMap >> lastPoint;
+ lastStatistics = &(statisticsMap.upper_bound(lastPoint)->second);
+}
+
+void BinnedStatistics::initialize(unsigned int bins) {
+ weightMap[1.] = 1.;
+ selectorMap[1.] = make_pair(0.,1.);
+ double step = 1./bins;
+ for ( unsigned int i = 1; i <= bins; ++i ) {
+ statisticsMap[i*step] = GeneralStatistics();
+ }
+}
+
diff --git a/Exsample2/BinnedStatistics.h b/Exsample2/BinnedStatistics.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/BinnedStatistics.h
@@ -0,0 +1,225 @@
+// -*- C++ -*-
+//
+// GeneralStatictis.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_BinnedStatistics_H
+#define Herwig_BinnedStatistics_H
+//
+// This is the declaration of the BinnedStatistics class.
+//
+
+#include "GeneralStatistics.h"
+#include "ThePEG/Repository/UseRandom.h"
+
+#include <boost/utility.hpp>
+using boost::next;
+using boost::prior;
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ *
+ * \brief Aka histogram, yet not intented for analyses.
+ *
+ */
+class BinnedStatistics {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ BinnedStatistics()
+ : lastPoint(0.), lastStatistics(0) {}
+
+ /**
+ * The standard constructor.
+ */
+ BinnedStatistics(unsigned int bins)
+ : lastPoint(0.), lastStatistics(0) {
+ initialize(bins);
+ }
+
+ /**
+ * The destructor.
+ */
+ virtual ~BinnedStatistics();
+ //@}
+
+public:
+
+ /**
+ * Sample a point and return its weight to be divided out as a bias.
+ */
+ double sample(double& point) {
+ const pair<double,double>& range =
+ selectorMap.upper_bound(UseRandom::rnd())->second;
+ lastPoint = UseRandom::rnd(range.first,range.second);
+ point = lastPoint;
+ lastStatistics = &(statisticsMap.upper_bound(lastPoint)->second);
+ double weight = weightMap.upper_bound(lastPoint)->second;
+ return 1./weight;
+ }
+
+ /**
+ * Get a bin corresponding to a given point.
+ */
+ void bin(double point) {
+ lastPoint = point;
+ lastStatistics = &(statisticsMap.upper_bound(lastPoint)->second);
+ }
+
+ /**
+ * Select the last sampled point with a given weight.
+ */
+ void select(double w) {
+ lastStatistics->select(w);
+ }
+
+ /**
+ * Accept the last sampled point.
+ */
+ void accept() {
+ lastStatistics->accept();
+ }
+
+ /**
+ * Reject the last sampled point.
+ */
+ void reject() {
+ lastStatistics->reject();
+ }
+
+ /**
+ * Initialize with flat sampling over the complete range,
+ * using the given number of bins to accumulate statistics.
+ */
+ void initialize(unsigned int bins);
+
+ /**
+ * Return the bins.
+ */
+ const map<double,GeneralStatistics>& statistics() const {
+ return statisticsMap;
+ }
+
+ /**
+ * Update the sampling bins to reflect the accumulated statistics and
+ * binning used.
+ */
+ template<class Adaptor>
+ void update(const Adaptor& ap) {
+ weightMap.clear();
+ double norm = 0.;
+ for ( map<double,GeneralStatistics>::const_iterator s =
+ statisticsMap.begin(); s != statisticsMap.end(); ++s ) {
+ double weight = ap.importanceMeasure(s->second);
+ if ( weight == 0.0 )
+ weight = 1000.*Constants::epsilon;
+ weightMap[s->first] = weight;
+ norm +=
+ weight *
+ (s != statisticsMap.begin() ? (s->first - prior(s)->first) : s->first);
+ }
+ selectorMap.clear();
+ double current = 0.;
+ for ( map<double,double>::iterator bw = weightMap.begin();
+ bw != weightMap.end(); ++bw ) {
+ bw->second /= norm;
+ pair<double,double> range =
+ make_pair(bw != weightMap.begin() ? prior(bw)->first : 0.,
+ bw->first);
+ current += bw->second*(range.second-range.first);
+ selectorMap[current] = range;
+ }
+ }
+
+ /**
+ * Half those bins, which meet the given predicate
+ * and update the statistics.
+ */
+ template<class Adaptor>
+ void adapt(const Adaptor& ap) {
+ update(ap);
+ map<double,GeneralStatistics> newBins;
+ for ( map<double,GeneralStatistics>::const_iterator b
+ = statisticsMap.begin(); b != statisticsMap.end(); ++b ) {
+ newBins[b->first] = GeneralStatistics();
+ if ( ap.adapt(b->second) ) {
+ double bound =
+ b != statisticsMap.begin() ? (prior(b)->first + b->first)/2. : b->first/2.;
+ newBins[bound] = GeneralStatistics();
+ }
+ }
+ statisticsMap = newBins;
+ }
+
+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 put(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 get(PersistentIStream & is);
+ //@}
+
+private:
+
+ /**
+ * Map upper bin boundaries to statistics contained.
+ * The lower bin boundary is always 0.
+ */
+ map<double,GeneralStatistics> statisticsMap;
+
+ /**
+ * Map upper bin boundaries to bin weights currently used.
+ */
+ map<double,double> weightMap;
+
+ /**
+ * Selector map to sample a point
+ */
+ map<double,pair<double,double> > selectorMap;
+
+ /**
+ * The last sampled point.
+ */
+ double lastPoint;
+
+ /**
+ * The statistics relevant to the last sampled point.
+ */
+ GeneralStatistics* lastStatistics;
+
+};
+
+inline PersistentOStream& operator<<(PersistentOStream& os, const BinnedStatistics& s) {
+ s.put(os); return os;
+}
+
+inline PersistentIStream& operator>>(PersistentIStream& is, BinnedStatistics& s) {
+ s.get(is); return is;
+}
+
+}
+
+#endif /* Herwig_BinnedStatistics_H */
diff --git a/Exsample2/ExSampler2.cc b/Exsample2/ExSampler2.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/ExSampler2.cc
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+//
+// ExSampler.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the ExSampler class.
+//
+
+#include "ExSampler2.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Interface/Parameter.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Repository/UseRandom.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/Utilities/DescribeClass.h"
+
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+#include "GeneralSampler.h"
+
+using namespace Herwig;
+using namespace exsample;
+
+ExSampler::ExSampler()
+ : presampling_points_(1000),
+ freeze_grid_(0),
+ efficiency_threshold_(.95),
+ gain_threshold_(.1) {}
+
+ExSampler::~ExSampler() {}
+
+IBPtr ExSampler::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr ExSampler::fullclone() const {
+ return new_ptr(*this);
+}
+
+void ExSampler::generate(bool) {
+
+ while (true) {
+ try {
+ generator_.generate(*this);
+ lastPoint() = generator_.last_point();
+ break;
+
+ } catch(selection_maxtry&) {
+ throw GeneralSampler::MaxTryException()
+ << "The maximum number of attempts to select a cell was exceeded\n"
+ << "for process " << process()
+ << Exception::eventerror;
+ } catch(hit_and_miss_maxtry&) {
+ throw GeneralSampler::MaxTryException()
+ << "The maximum number of attempts to select an event was exceeded\n"
+ << "for process " << process()
+ << Exception::eventerror;
+ } catch(generator_update&) {
+ throw UpdateCrossSections();
+ } catch(...) {
+ throw;
+ }
+ }
+
+}
+
+void ExSampler::initialize(bool progress) {
+
+ if ( progress ) {
+ cout << "initializing sampler for "
+ << process() << "\n";
+ }
+
+ generator_.function(this);
+
+ generator_.sampling_parameters().presampling_points = presampling_points_;
+ generator_.sampling_parameters().freeze_grid = freeze_grid_;
+ generator_.sampling_parameters().maxtry = eventHandler()->maxLoop();
+ generator_.sampling_parameters().efficiency_threshold = efficiency_threshold_;
+ generator_.sampling_parameters().gain_threshold = gain_threshold_;
+
+ generator_.initialize(*this);
+
+ if ( progress ) {
+ cout << "estimated cross section is ( "
+ << averageWeight() << " +/- " << sqrt(averageWeightVariance())
+ << " ) nb\n";
+ }
+
+}
+
+void ExSampler::finalize(bool) {
+ generator_.finalize();
+}
+
+// If needed, insert default implementations of virtual function defined
+// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+
+void ExSampler::persistentOutput(PersistentOStream & os) const {
+ os << presampling_points_ << freeze_grid_
+ << efficiency_threshold_ << gain_threshold_;
+ generator_.put(os);
+}
+
+void ExSampler::persistentInput(PersistentIStream & is, int) {
+ is >> presampling_points_ >> freeze_grid_
+ >> efficiency_threshold_ >> gain_threshold_;
+ generator_.get(is);
+}
+
+
+// *** Attention *** The following static variable is needed for the type
+// description system in ThePEG. Please check that the template arguments
+// are correct (the class and its base class), and that the constructor
+// arguments are correct (the class name and the name of the dynamically
+// loadable library where the class implementation can be found).
+DescribeClass<ExSampler,Herwig::BinSampler>
+ describeHerwigExSampler("Herwig::ExSampler", "HwExsample2.so");
+
+void ExSampler::Init() {
+
+ static ClassDocumentation<ExSampler> documentation
+ ("ExSampler interfaces to the exsample library.",
+ "Events have been sampled using "
+ "the ExSample library \\cite{Platzer:2011dr}",
+ "%\\cite{Platzer:2011dr}\n"
+ "\\bibitem{Platzer:2011dr}\n"
+ "S.~Platzer,\n"
+ "``ExSample -- A Library for Sampling Sudakov-Type Distributions,''\n"
+ "arXiv:1108.6182 [hep-ph].\n"
+ "%%CITATION = ARXIV:1108.6182;%%");
+
+ static ThePEG::Parameter<ExSampler,unsigned long> interfacepresampling_points
+ ("presampling_points",
+ "Set the number of presampling points per cell",
+ &ExSampler::presampling_points_, 1000, 0, 0,
+ false, false, ThePEG::Interface::lowerlim);
+
+ static ThePEG::Parameter<ExSampler,unsigned long> interfacefreeze_grid
+ ("freeze_grid",
+ "Set the number of events after which the grid should be frozen",
+ &ExSampler::freeze_grid_, 0, 0, 0,
+ false, false, ThePEG::Interface::lowerlim);
+
+ static ThePEG::Parameter<ExSampler,double> interfaceefficiency_threshold
+ ("efficiency_threshold",
+ "Set the efficiency threshold",
+ &ExSampler::efficiency_threshold_, .95, 0., 1.,
+ false, false, ThePEG::Interface::limited);
+
+ static ThePEG::Parameter<ExSampler,double> interfacegain_threshold
+ ("gain_threshold",
+ "Set the gain threshold",
+ &ExSampler::gain_threshold_, .1, 0., 1.,
+ false, false, ThePEG::Interface::limited);
+
+}
+
diff --git a/Exsample2/ExSampler2.h b/Exsample2/ExSampler2.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/ExSampler2.h
@@ -0,0 +1,209 @@
+// -*- C++ -*-
+//
+// ExSampler.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_ExSampler_H
+#define Herwig_ExSampler_H
+//
+// This is the declaration of the ExSampler class.
+//
+
+#include "BinSampler.h"
+#include "Herwig++/Exsample2/exsample/generator.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \brief Interface to the exsample generator.
+ * \author Simon Platzer
+ *
+ * @see \ref ExSamplerInterfaces "The interfaces"
+ * defined for ExSampler.
+ */
+class ExSampler: public Herwig::BinSampler {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ ExSampler();
+
+ /**
+ * The destructor.
+ */
+ virtual ~ExSampler();
+ //@}
+
+public:
+
+ /**
+ * Return true, if this bin sampler produces unweighted events.
+ */
+ virtual bool isUnweighting() const { return true; }
+
+ /**
+ * Return true, if this sampler is in a compensating mode.
+ */
+ virtual bool compensating() const { return generator_.compensating(); }
+
+ /**
+ * Generate the next point; store the point in lastPoint() and its
+ * weight using select(); if noMaxInfo is true, do not throw
+ * NewMaximum or UpdateCrossSections exceptions.
+ */
+ virtual void generate(bool noMaxInfo = false);
+
+ /**
+ * Initialize this bin sampler. This default version calls runIteration.
+ */
+ virtual void initialize(bool progress);
+
+ /**
+ * Finalize this sampler.
+ */
+ virtual void finalize(bool verbose);
+
+public:
+
+ /**
+ * Reject an event.
+ */
+ virtual void reject() {
+ GeneralStatistics::reject();
+ generator_.reject();
+ }
+
+public:
+
+ /**
+ * Evaluate with given random numbers.
+ */
+ double evaluate(const vector<double>& p) const {
+ double ret;
+ try {
+ ret = eventHandler()->dSigDR(p) / nanobarn;
+ } catch (Veto&) {
+ ret = 0.0;
+ } catch (...) {
+ throw;
+ }
+ return ret;
+ }
+
+ /**
+ * Return the lower left and upper right
+ * corners of the support of this function
+ */
+ pair<vector<double>,vector<double> > support() const {
+ vector<double> lower(dimension(),0.);
+ vector<double> upper(dimension(),1.);
+ return make_pair(lower,upper);
+ }
+
+ /**
+ * Indicate start of presampling
+ */
+ void start_presampling() { }
+
+ /**
+ * Indicate end of presampling
+ */
+ void stop_presampling() { }
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * The standard Init function used to initialize the interfaces.
+ * Called exactly once for each class by the class description system
+ * before the main function starts or
+ * when this class is dynamically loaded.
+ */
+ static void Init();
+
+protected:
+
+ /** @name Clone Methods. */
+ //@{
+ /**
+ * Make a simple clone of this object.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+// If needed, insert declarations of virtual function defined in the
+// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
+
+private:
+
+ /**
+ * The number of presampling points.
+ */
+ unsigned long presampling_points_;
+
+ /**
+ * The number of points below which the grid is frozen
+ */
+ unsigned long freeze_grid_;
+
+ /**
+ * The efficiency threshold
+ */
+ double efficiency_threshold_;
+
+ /**
+ * The gains threshold.
+ */
+ double gain_threshold_;
+
+ /**
+ * The generator used.
+ */
+ exsample::generator<ExSampler,UseRandom> generator_;
+
+private:
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ ExSampler & operator=(const ExSampler &);
+
+};
+
+}
+
+#endif /* Herwig_ExSampler_H */
diff --git a/Exsample2/GeneralSampler.cc b/Exsample2/GeneralSampler.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/GeneralSampler.cc
@@ -0,0 +1,478 @@
+// -*- C++ -*-
+//
+// GeneralSampler.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the GeneralSampler class.
+//
+
+#include "GeneralSampler.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Repository/UseRandom.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/Utilities/DescribeClass.h"
+#include "ThePEG/Utilities/LoopGuard.h"
+#include "ThePEG/Interface/Reference.h"
+#include "ThePEG/Interface/Switch.h"
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+#include <boost/progress.hpp>
+
+using namespace Herwig;
+
+GeneralSampler::GeneralSampler()
+ : theVerbose(false), theFlatSubprocesses(false),
+ isSampling(false),
+ theIntegratedXSec(0.), theIntegratedXSecErr(0.),
+ theSumWeights(0.), norm(0.) {}
+
+GeneralSampler::~GeneralSampler() {}
+
+IBPtr GeneralSampler::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr GeneralSampler::fullclone() const {
+ return new_ptr(*this);
+}
+
+double sign(double x) {
+ return x >= 0. ? 1. : -1.;
+}
+
+void GeneralSampler::initialize() {
+
+ if ( theBinSampler->isUnweighting() && eventHandler()->weighted() ) {
+ throw InitException() << "weighted events requested from unweighting bin sampler object.";
+ }
+
+ if ( !samplers.empty() )
+ return;
+
+ boost::progress_display* progressBar = 0;
+ if ( !theVerbose ) {
+ cout << "integrating subprocesses";
+ progressBar = new boost::progress_display(eventHandler()->nBins(),cout);
+ }
+
+ for ( int b = 0; b < eventHandler()->nBins(); ++b ) {
+ Ptr<BinSampler>::ptr s = theBinSampler->cloneMe();
+ s->eventHandler(eventHandler());
+ s->bin(b);
+ lastSampler = s;
+ s->initialize(theVerbose);
+ samplers[b] = s;
+ if ( !theVerbose )
+ ++(*progressBar);
+ if ( s->nanPoints() && theVerbose ) {
+ cout << "warning: "
+ << s->nanPoints() << " of "
+ << s->allPoints() << " points with nan or inf weight.\n"
+ << flush;
+ }
+ }
+
+ updateCrossSections(true);
+
+ cout << "total integrated cross section is ( "
+ << integratedXSec()/nanobarn << " +/- "
+ << integratedXSecErr()/nanobarn << " ) nb\n" << flush;
+
+ if ( progressBar )
+ delete progressBar;
+
+}
+
+double GeneralSampler::generate() {
+
+ long tries = 0;
+ long excptTries = 0;
+
+ if ( !theFlatSubprocesses )
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ else {
+ map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ advance(s,(size_t)(UseRandom::rnd()*samplers.size()));
+ lastSampler = s->second;
+ }
+
+ while ( true ) {
+
+ try {
+ lastSampler->generate(eventHandler()->weighted());
+ } catch (BinSampler::NewMaximum& update) {
+ if ( !eventHandler()->weighted() ) {
+ unsigned long skip =
+ (unsigned long)(lastSampler->acceptedPoints()*(1.-update.oldMaxWeight/update.newMaxWeight));
+ map<Ptr<BinSampler>::tptr,unsigned long>::iterator s = skipMap.find(lastSampler);
+ if ( s != skipMap.end() )
+ s->second += skip;
+ else
+ skipMap[lastSampler] = skip;
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ tries = 0;
+ if ( ++excptTries == eventHandler()->maxLoop() )
+ break;
+ continue;
+ }
+ } catch(BinSampler::UpdateCrossSections) {
+ updateCrossSections();
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ tries = 0;
+ if ( ++excptTries == eventHandler()->maxLoop() )
+ break;
+ continue;
+ } catch (...) {
+ throw;
+ }
+
+ if ( isnan(lastSampler->lastWeight()) || isinf(lastSampler->lastWeight()) ) {
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ tries = 0;
+ if ( ++excptTries == eventHandler()->maxLoop() )
+ break;
+ continue;
+ }
+
+ if ( eventHandler()->weighted() && lastSampler->lastWeight() == 0.0 ) {
+ lastSampler->accept();
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ tries = 0;
+ if ( ++excptTries == eventHandler()->maxLoop() )
+ break;
+ continue;
+ }
+
+ if ( eventHandler()->weighted() || lastSampler->isUnweighting() )
+ break;
+
+ if ( abs(lastSampler->lastWeight())/lastSampler->maxWeight() > UseRandom::rnd() ) {
+ if ( skipMap.empty() )
+ break;
+ map<Ptr<BinSampler>::tptr,unsigned long>::iterator s = skipMap.find(lastSampler);
+ if ( s == skipMap.end() )
+ break;
+ s->second -= 1;
+ if ( s->second == 0 )
+ skipMap.erase(s);
+ lastSampler = samplers.upper_bound(UseRandom::rnd())->second;
+ tries = 0;
+ if ( ++excptTries == eventHandler()->maxLoop() )
+ break;
+ continue;
+ }
+
+ if ( ++tries == eventHandler()->maxLoop() ) {
+ throw MaxTryException()
+ << "Maximum number of unweighting tries reached in GeneralSampler::generate()\n"
+ << "for process " << lastSampler->process()
+ << Exception::eventerror;
+ }
+
+ }
+
+ if ( excptTries == eventHandler()->maxLoop() )
+ throw Exception()
+ << "GeneralSampler::generate() : Maximum number of tries to re-run event "
+ << "selection reached. Aborting now." << Exception::runerror;
+
+ lastPoint() = lastSampler->lastPoint();
+ lastSampler->accept();
+
+ if ( !eventHandler()->weighted() ) {
+ theSumWeights += sign(lastSampler->lastWeight());
+ return sign(lastSampler->lastWeight());
+ } else {
+ double w = lastSampler->lastWeight()/(norm*lastSampler->bias());
+ theSumWeights += w;
+ return w;
+ }
+ return 0.;
+
+}
+
+void GeneralSampler::rejectLast() {
+ lastSampler->reject();
+ if ( !eventHandler()->weighted() ) {
+ theSumWeights -= sign(lastSampler->lastWeight());
+ } else {
+ theSumWeights -=
+ lastSampler->lastWeight()/(norm*lastSampler->bias());
+ }
+}
+
+void GeneralSampler::currentCrossSections() const {
+
+ if ( !isSampling )
+ return;
+
+ double xsec = 0.;
+ double var = 0.;
+
+ for ( map<double,Ptr<BinSampler>::ptr>::const_iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ size_t n = nIterationsMap.find(s->second)->second;
+ if ( !s->second->selectedPoints() ) {
+ xsec += sumWeightsMap.find(s->second)->second.first/n;
+ var += sumWeightsMap.find(s->second)->second.second/n;
+ continue;
+ }
+ double trySum =
+ ( sumWeightsMap.find(s->second)->second.first + s->second->averageWeight() )/
+ ( n + 1 );
+ double trySumVariance =
+ ( sumWeightsMap.find(s->second)->second.second + s->second->averageWeightVariance() )/
+ ( n + 1 );
+ if ( trySumVariance < sumWeightsMap.find(s->second)->second.second/n ) {
+ xsec += trySum;
+ var += trySumVariance;
+ } else {
+ xsec += sumWeightsMap.find(s->second)->second.first/n;
+ var += sumWeightsMap.find(s->second)->second.second/n;
+ }
+ }
+
+ theIntegratedXSec = xsec;
+ theIntegratedXSecErr = sqrt(var);
+
+}
+
+void GeneralSampler::updateCrossSections(bool firstTime) {
+
+ if ( isSampling ) {
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ if ( !s->second->selectedPoints() )
+ continue;
+ double trySumVariance =
+ ( sumWeightsMap[s->second].second + s->second->averageWeightVariance() )/
+ ( nIterationsMap[s->second] + 1 );
+ if ( trySumVariance < sumWeightsMap[s->second].second/nIterationsMap[s->second] ) {
+ sumWeightsMap[s->second].first += s->second->averageWeight();
+ sumWeightsMap[s->second].second += s->second->averageWeightVariance();
+ sumAbsWeightsMap[s->second].first += s->second->averageAbsWeight();
+ sumAbsWeightsMap[s->second].second += s->second->averageAbsWeightVariance();
+ nIterationsMap[s->second] += 1;
+ }
+ }
+ } else {
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ if ( !firstTime ) {
+ if ( s->second->averageWeightVariance() <
+ sumWeightsMap[s->second].second && s->second->selectedPoints() ) {
+ sumWeightsMap[s->second] =
+ make_pair(s->second->averageWeight(),s->second->averageWeightVariance());
+ sumAbsWeightsMap[s->second] =
+ make_pair(s->second->averageAbsWeight(),s->second->averageAbsWeightVariance());
+ }
+ } else {
+ sumWeightsMap[s->second] =
+ make_pair(s->second->averageWeight(),s->second->averageWeightVariance());
+ sumAbsWeightsMap[s->second] =
+ make_pair(s->second->averageAbsWeight(),s->second->averageAbsWeightVariance());
+ nIterationsMap[s->second] = 1;
+ }
+ }
+ }
+
+ double xsec = 0.;
+ double var = 0.;
+ double sumbias = 0.;
+
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ xsec += sumWeightsMap[s->second].first/nIterationsMap[s->second];
+ var += sumWeightsMap[s->second].second/nIterationsMap[s->second];
+ sumbias += sumAbsWeightsMap[s->second].first/nIterationsMap[s->second];
+ }
+
+ theIntegratedXSec = xsec;
+ theIntegratedXSecErr = sqrt(var);
+ norm = sumbias;
+
+ map<double,Ptr<BinSampler>::ptr> newSamplers;
+ double current = 0.;
+
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ double abssw =
+ sumAbsWeightsMap[s->second].first/nIterationsMap[s->second];
+ if ( (isSampling && s->second == lastSampler) ||
+ !isSampling )
+ s->second->nextIteration();
+ s->second->bias(abssw/sumbias);
+ current += abssw;
+ newSamplers[current/sumbias] = s->second;
+ }
+
+ samplers = newSamplers;
+
+}
+
+// If needed, insert default implementations of virtual function defined
+// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+
+void GeneralSampler::dofinish() {
+ set<string> compensating;
+ for ( map<double,Ptr<BinSampler>::ptr>::const_iterator s =
+ samplers.begin(); s != samplers.end(); ++s ) {
+ if ( s->second->compensating() ||
+ skipMap.find(s->second) != skipMap.end() ) {
+ compensating.insert(s->second->process());
+ }
+ if ( s->second->nanPoints() ) {
+ generator()->logWarning(Exception()
+ << "warning: "
+ << s->second->nanPoints() << " of "
+ << s->second->allPoints() << " points with nan or inf weight\n"
+ << "in " << s->second->process() << Exception::warning);
+ if ( theVerbose ) {
+ cout << "warning: "
+ << s->second->nanPoints() << " of "
+ << s->second->allPoints() << " points with nan or inf weight\n"
+ << "in " << s->second->process() << "\n";
+ }
+ }
+ s->second->finalize(theVerbose);
+ }
+ updateCrossSections();
+ if ( theVerbose ) {
+ if ( !compensating.empty() ) {
+ cout << "warning: sampling for the following processes is still compensating:\n";
+ for ( set<string>::const_iterator c = compensating.begin();
+ c != compensating.end(); ++c )
+ cout << *c << "\n";
+ }
+ cout << "final integrated cross section is ( "
+ << integratedXSec()/nanobarn << " +/- "
+ << integratedXSecErr()/nanobarn << " ) nb\n" << flush;
+ }
+ if ( !compensating.empty() ) {
+ generator()->logWarning(Exception()
+ << "Warning: Some samplers are still in compensating mode."
+ << Exception::warning);
+ }
+ SamplerBase::dofinish();
+}
+
+void GeneralSampler::doinitrun() {
+ SamplerBase::doinitrun();
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s = samplers.begin();
+ s != samplers.end(); ++s ) {
+ s->second->eventHandler(eventHandler());
+ s->second->initialize(false);
+ assert( !s->second->iterations().empty() );
+ s->second->maxWeight(s->second->iterations().back().maxWeight());
+ s->second->minWeight(s->second->iterations().back().minWeight());
+ }
+ isSampling = true;
+}
+
+void GeneralSampler::rebind(const TranslationMap & trans) {
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s =
+ samplers.begin(); s != samplers.end(); ++s )
+ s->second = trans.translate(s->second);
+ map<Ptr<BinSampler>::tptr,pair<double,double> > nsummap;
+ for ( map<Ptr<BinSampler>::tptr,pair<double,double> >::const_iterator
+ s = sumWeightsMap.begin(); s != sumWeightsMap.end(); ++s )
+ nsummap[trans.translate(s->first)] = s->second;
+ sumWeightsMap = nsummap;
+ nsummap.clear();
+ for ( map<Ptr<BinSampler>::tptr,pair<double,double> >::const_iterator
+ s = sumAbsWeightsMap.begin(); s != sumAbsWeightsMap.end(); ++s )
+ nsummap[trans.translate(s->first)] = s->second;
+ sumAbsWeightsMap = nsummap;
+ map<Ptr<BinSampler>::tptr,size_t> nitmap;
+ for ( map<Ptr<BinSampler>::tptr,size_t>::const_iterator
+ s = nIterationsMap.begin(); s != nIterationsMap.end(); ++s )
+ nitmap[trans.translate(s->first)] = s->second;
+ nIterationsMap = nitmap;
+ SamplerBase::rebind(trans);
+}
+
+IVector GeneralSampler::getReferences() {
+ IVector ret = SamplerBase::getReferences();
+ for ( map<double,Ptr<BinSampler>::ptr>::iterator s =
+ samplers.begin(); s != samplers.end(); ++s )
+ ret.push_back(s->second);
+ return ret;
+}
+
+void GeneralSampler::persistentOutput(PersistentOStream & os) const {
+ os << theBinSampler << theVerbose << theFlatSubprocesses
+ << samplers << sumWeightsMap << sumAbsWeightsMap << nIterationsMap << lastSampler
+ << theIntegratedXSec << theIntegratedXSecErr << theSumWeights
+ << norm;
+}
+
+void GeneralSampler::persistentInput(PersistentIStream & is, int) {
+ is >> theBinSampler >> theVerbose >> theFlatSubprocesses
+ >> samplers >> sumWeightsMap >> sumAbsWeightsMap >> nIterationsMap >> lastSampler
+ >> theIntegratedXSec >> theIntegratedXSecErr >> theSumWeights
+ >> norm;
+}
+
+
+// *** Attention *** The following static variable is needed for the type
+// description system in ThePEG. Please check that the template arguments
+// are correct (the class and its base class), and that the constructor
+// arguments are correct (the class name and the name of the dynamically
+// loadable library where the class implementation can be found).
+DescribeClass<GeneralSampler,SamplerBase>
+ describeHerwigGeneralSampler("Herwig::GeneralSampler", "HwExsample2.so");
+
+void GeneralSampler::Init() {
+
+ static ClassDocumentation<GeneralSampler> documentation
+ ("A GeneralSampler class");
+
+
+ static Reference<GeneralSampler,BinSampler> interfaceBinSampler
+ ("BinSampler",
+ "The bin sampler to be used.",
+ &GeneralSampler::theBinSampler, false, false, true, false, false);
+
+
+ static Switch<GeneralSampler,bool> interfaceVerbose
+ ("Verbose",
+ "",
+ &GeneralSampler::theVerbose, false, false, false);
+ static SwitchOption interfaceVerboseOn
+ (interfaceVerbose,
+ "On",
+ "",
+ true);
+ static SwitchOption interfaceVerboseOff
+ (interfaceVerbose,
+ "Off",
+ "",
+ false);
+
+ static Switch<GeneralSampler,bool> interfaceFlatSubprocesses
+ ("FlatSubprocesses",
+ "[debug] ",
+ &GeneralSampler::theFlatSubprocesses, false, false, false);
+ static SwitchOption interfaceFlatSubprocessesOn
+ (interfaceFlatSubprocesses,
+ "On",
+ "",
+ true);
+ static SwitchOption interfaceFlatSubprocessesOff
+ (interfaceFlatSubprocesses,
+ "Off",
+ "",
+ false);
+
+ interfaceFlatSubprocesses.rank(-1);
+
+}
+
diff --git a/Exsample2/GeneralSampler.h b/Exsample2/GeneralSampler.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/GeneralSampler.h
@@ -0,0 +1,296 @@
+// -*- C++ -*-
+//
+// GeneralSampler.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_GeneralSampler_H
+#define Herwig_GeneralSampler_H
+//
+// This is the declaration of the GeneralSampler class.
+//
+
+#include "ThePEG/Handlers/SamplerBase.h"
+#include "BinSampler.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ *
+ * \brief A GeneralSampler class
+ *
+ * @see \ref GeneralSamplerInterfaces "The interfaces"
+ * defined for GeneralSampler.
+ */
+class GeneralSampler: public SamplerBase {
+
+public:
+
+ /**
+ * Exception thrown in case too many attempts to unweight an event.
+ */
+ struct MaxTryException : public ThePEG::Exception {};
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ GeneralSampler();
+
+ /**
+ * The destructor.
+ */
+ virtual ~GeneralSampler();
+ //@}
+
+public:
+
+ /** @name Virtual functions from SamplerBase. */
+ //@{
+ /**
+ * Initialize the the sampler, possibly doing presampling of the
+ * phase space.
+ */
+ virtual void initialize();
+
+ /**
+ * Generarate a new phase space point and return a weight associated
+ * with it. This weight should preferably be 1.
+ */
+ virtual double generate();
+
+ /**
+ * Reject the last chosen phase space point.
+ */
+ virtual void rejectLast();
+
+ /**
+ * If the sampler is able to sample several different functions
+ * separately, this function should return the last chosen
+ * function. This default version always returns 0.
+ */
+ virtual int lastBin() const { return lastSampler ? lastSampler->bin() : 0; }
+
+ /**
+ * Return the total integrated cross section determined from the
+ * Monte Carlo sampling so far.
+ */
+ virtual CrossSection integratedXSec() const {
+ currentCrossSections();
+ return theIntegratedXSec * nanobarn;
+ }
+
+ /**
+ * Return the error on the total integrated cross section determined
+ * from the Monte Carlo sampling so far.
+ */
+ virtual CrossSection integratedXSecErr() const {
+ currentCrossSections();
+ return theIntegratedXSecErr * nanobarn;
+ }
+
+ /**
+ * Return the overestimated integrated cross section.
+ */
+ virtual CrossSection maxXSec() const {
+ currentCrossSections();
+ return abs(theIntegratedXSec) * nanobarn;
+ }
+
+ /**
+ * Return the sum of the weights returned by generate() so far (of
+ * the events that were not rejeted).
+ */
+ virtual double sumWeights() const {
+ return theSumWeights;
+ }
+ //@}
+
+protected:
+
+ /**
+ * Calculate cross sections from samplers, assuming the start of a
+ * new iteration.
+ */
+ void updateCrossSections(bool firstTime = false);
+
+ /**
+ * Calculate cross sections from samplers at current state.
+ */
+ void currentCrossSections() const;
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * The standard Init function used to initialize the interfaces.
+ * Called exactly once for each class by the class description system
+ * before the main function starts or
+ * when this class is dynamically loaded.
+ */
+ static void Init();
+
+protected:
+
+ /** @name Clone Methods. */
+ //@{
+ /**
+ * Make a simple clone of this object.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+// If needed, insert declarations of virtual function defined in the
+// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
+
+
+protected:
+
+ /**
+ * Initialize this object. Called in the run phase just before
+ * a run begins.
+ */
+ virtual void doinitrun();
+
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ virtual void dofinish();
+
+ /**
+ * Rebind pointer to other Interfaced objects. Called in the setup phase
+ * after all objects used in an EventGenerator has been cloned so that
+ * the pointers will refer to the cloned objects afterwards.
+ * @param trans a TranslationMap relating the original objects to
+ * their respective clones.
+ * @throws RebindException if no cloned object was found for a given
+ * pointer.
+ */
+ virtual void rebind(const TranslationMap & trans);
+
+ /**
+ * Return a vector of all pointers to Interfaced objects used in this
+ * object.
+ * @return a vector of pointers.
+ */
+ virtual IVector getReferences();
+
+private:
+
+ /**
+ * The bin sampler to use.
+ */
+ Ptr<BinSampler>::ptr theBinSampler;
+
+ /**
+ * Whether or not additional information should be printed to cout.
+ */
+ bool theVerbose;
+
+ /**
+ * True, if subprocesses should be selected flat. This is a debug
+ * flag, cross section information and distributions will not be
+ * correct.
+ */
+ bool theFlatSubprocesses;
+
+ /**
+ * True, if we are generating events.
+ */
+ bool isSampling;
+
+ /**
+ * The sum of weights per sampler.
+ */
+ map<Ptr<BinSampler>::tptr,pair<double,double> > sumWeightsMap;
+
+ /**
+ * The sum of absolute weights per sampler.
+ */
+ map<Ptr<BinSampler>::tptr,pair<double,double> > sumAbsWeightsMap;
+
+ /**
+ * The number of iterations per sampler after the adaption phase.
+ */
+ map<Ptr<BinSampler>::tptr,size_t> nIterationsMap;
+
+ /**
+ * The selector map for the bin samplers.
+ */
+ map<double,Ptr<BinSampler>::ptr> samplers;
+
+ /**
+ * The last selected bin sampler.
+ */
+ Ptr<BinSampler>::tptr lastSampler;
+
+ /**
+ * The integrated cross section in nanobarn
+ */
+ mutable double theIntegratedXSec;
+
+ /**
+ * The integrated cross section error in nanobarn
+ */
+ mutable double theIntegratedXSecErr;
+
+ /**
+ * The sum of weights
+ */
+ double theSumWeights;
+
+ /**
+ * The sum of absolute cross section.
+ */
+ double norm;
+
+ /**
+ * Map samplers to events to be skipped owing to encounter of a new
+ * maximum.
+ */
+ map<Ptr<BinSampler>::tptr,unsigned long> skipMap;
+
+private:
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ GeneralSampler & operator=(const GeneralSampler &);
+
+};
+
+}
+
+#endif /* Herwig_GeneralSampler_H */
diff --git a/Exsample2/GeneralStatistics.cc b/Exsample2/GeneralStatistics.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/GeneralStatistics.cc
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+//
+// GeneralStatictis.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the GeneralStatistics class.
+//
+
+#include "GeneralStatistics.h"
+
+using namespace Herwig;
+
+GeneralStatistics::~GeneralStatistics() {}
+
+void GeneralStatistics::put(PersistentOStream & os) const {
+ os << theBias << theMaxWeight
+ << theMinWeight << theSumWeights
+ << theSumSquaredWeights << theSumAbsWeights
+ << theSelectedPoints << theAcceptedPoints
+ << theNanPoints << theAllPoints << theChi2 << theLastWeight;
+}
+
+void GeneralStatistics::get(PersistentIStream & is) {
+ is >> theBias >> theMaxWeight
+ >> theMinWeight >> theSumWeights
+ >> theSumSquaredWeights >> theSumAbsWeights
+ >> theSelectedPoints >> theAcceptedPoints
+ >> theNanPoints >> theAllPoints >> theChi2 >> theLastWeight;
+}
+
diff --git a/Exsample2/GeneralStatistics.h b/Exsample2/GeneralStatistics.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/GeneralStatistics.h
@@ -0,0 +1,336 @@
+// -*- C++ -*-
+//
+// GeneralStatictis.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_GeneralStatistics_H
+#define Herwig_GeneralStatistics_H
+//
+// This is the declaration of the GeneralStatistics class.
+//
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ *
+ * \brief General Monte Carlo statistics.
+ *
+ */
+class GeneralStatistics {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ GeneralStatistics()
+ : theBias(1.), theMaxWeight(0.),
+ theMinWeight(Constants::MaxDouble), theSumWeights(0.),
+ theSumSquaredWeights(0.), theSumAbsWeights(0.),
+ theSelectedPoints(0), theAcceptedPoints(0),
+ theNanPoints(0), theAllPoints(0),
+ theChi2(-1.), theLastWeight(0.) {}
+
+ /**
+ * The destructor.
+ */
+ virtual ~GeneralStatistics();
+ //@}
+
+public:
+
+ /**
+ * Set the weight by which events entering this statistics have been
+ * biased.
+ */
+ void bias(double w) { theBias = w; }
+
+ /**
+ * Return the weight by which events entering this statistics have been
+ * biased.
+ */
+ double bias() const { return theBias; }
+
+ /**
+ * Calculate a chi^2 taking this statistics as hypothesis for the
+ * given statistics.
+ */
+ void chi2(const GeneralStatistics& x) {
+ theChi2 =
+ sqr(averageWeight()-x.averageWeight())/
+ (averageWeightVariance()+x.averageWeightVariance());
+ }
+
+ /**
+ * Return the last calculated chi^2.
+ */
+ double chi2() const { return theChi2; }
+
+ /**
+ * Reset these statistics.
+ */
+ void reset() {
+ *this = GeneralStatistics();
+ }
+
+public:
+
+ /**
+ * Return the last weight encountered.
+ */
+ double lastWeight() const { return theLastWeight; }
+
+ /**
+ * Return the maximum absolute weight
+ */
+ double maxWeight() const { return theMaxWeight; }
+
+ /**
+ * Return the minimum absolute weight
+ */
+ double minWeight() const { return theMinWeight; }
+
+ /**
+ * Set the maximum absolute weight
+ */
+ void maxWeight(double w) { theMaxWeight = w; }
+
+ /**
+ * Set the minimum absolute weight
+ */
+ void minWeight(double w) { theMinWeight = w; }
+
+ /**
+ * Return the sum of weights
+ */
+ double sumWeights() const { return theSumWeights; }
+
+ /**
+ * Return the sum of squared weights
+ */
+ double sumSquaredWeights() const { return theSumSquaredWeights; }
+
+ /**
+ * Return the sum of absolute weights
+ */
+ double sumAbsWeights() const { return theSumAbsWeights; }
+
+ /**
+ * Return the number of selected points.
+ */
+ unsigned long selectedPoints() const { return theSelectedPoints; }
+
+ /**
+ * Return the nnumber of accepted points.
+ */
+ unsigned long acceptedPoints() const { return theAcceptedPoints; }
+
+ /**
+ * Return the number of points where a nan or inf weight has been
+ * encountered.
+ */
+ unsigned long nanPoints() const { return theNanPoints; }
+
+ /**
+ * Return the number of all points.
+ */
+ unsigned long allPoints() const { return theAllPoints; }
+
+ /**
+ * Return the average weight.
+ */
+ double averageWeight() const {
+ return selectedPoints() > 0 ? sumWeights()/selectedPoints() : 0.;
+ }
+
+ /**
+ * Return the average absolute weight.
+ */
+ double averageAbsWeight() const {
+ return selectedPoints() > 0 ? sumAbsWeights()/selectedPoints() : 0.;
+ }
+
+ /**
+ * Return the variance of weights.
+ */
+ double weightVariance() const {
+ return
+ selectedPoints() > 1 ?
+ abs(sumSquaredWeights() - sqr(sumWeights()/selectedPoints()))/(selectedPoints()-1) : 0.;
+ }
+
+ /**
+ * Return the variance of absolute weights.
+ */
+ double absWeightVariance() const {
+ return
+ selectedPoints() > 1 ?
+ abs(sumSquaredWeights() - sqr(sumAbsWeights())/selectedPoints())/(selectedPoints()-1) : 0.;
+ }
+
+ /**
+ * Return the variance of the average weight.
+ */
+ double averageWeightVariance() const {
+ return selectedPoints() > 1 ? weightVariance()/selectedPoints() : 0.;
+ }
+
+ /**
+ * Return the variance of the average absolute weight.
+ */
+ double averageAbsWeightVariance() const {
+ return selectedPoints() > 1 ? absWeightVariance()/selectedPoints() : 0;
+ }
+
+ /**
+ * Select an event
+ */
+ virtual void select(double weight, bool doIntegral = true) {
+ if ( isnan(weight) || isinf(weight) ) {
+ theLastWeight = weight;
+ theNanPoints += 1;
+ theAllPoints += 1;
+ return;
+ }
+ theLastWeight = weight;
+ theMaxWeight = max(theMaxWeight,abs(weight));
+ theMinWeight = min(theMinWeight,abs(weight));
+ if ( !doIntegral )
+ return;
+ theSumWeights += weight;
+ theSumSquaredWeights += sqr(weight);
+ theSumAbsWeights += abs(weight);
+ theSelectedPoints += 1;
+ theAllPoints += 1;
+ }
+
+ /**
+ * Accept an event.
+ */
+ virtual void accept() {
+ theAcceptedPoints += 1;
+ }
+
+ /**
+ * Reject an event.
+ */
+ virtual void reject() {
+ if ( isnan(lastWeight()) || isinf(lastWeight()) ) {
+ theNanPoints -= 1;
+ theAllPoints -= 1;
+ return;
+ }
+ theSumWeights -= lastWeight();
+ theSumSquaredWeights -= sqr(lastWeight());
+ theSumAbsWeights -= abs(lastWeight());
+ theSelectedPoints -= 1;
+ theAcceptedPoints -= 1;
+ theAllPoints -= 1;
+ }
+
+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 put(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 get(PersistentIStream & is);
+ //@}
+
+private:
+
+ /**
+ * A weight by which events entering this statistics have been
+ * biased.
+ */
+ double theBias;
+
+ /**
+ * The maximum weight encountered.
+ */
+ double theMaxWeight;
+
+ /**
+ * The minimum weight encountered.
+ */
+ double theMinWeight;
+
+ /**
+ * The sum of weights.
+ */
+ double theSumWeights;
+
+ /**
+ * The sum of weights squared.
+ */
+ double theSumSquaredWeights;
+
+ /**
+ * The sum of absolute values of weights
+ */
+ double theSumAbsWeights;
+
+ /**
+ * The number of selected points
+ */
+ unsigned long theSelectedPoints;
+
+ /**
+ * The number of accepted points
+ */
+ unsigned long theAcceptedPoints;
+
+ /**
+ * The number of points where an nan or inf weight was encountered.
+ */
+ unsigned long theNanPoints;
+
+ /**
+ * The number of all points.
+ */
+ unsigned long theAllPoints;
+
+ /**
+ * The last chi^2 calculated.
+ */
+ double theChi2;
+
+ /**
+ * The last weight encountered
+ */
+ double theLastWeight;
+
+};
+
+inline PersistentOStream& operator<<(PersistentOStream& os, const GeneralStatistics& s) {
+ s.put(os); return os;
+}
+
+inline PersistentIStream& operator>>(PersistentIStream& is, GeneralStatistics& s) {
+ s.get(is); return is;
+}
+
+}
+
+#endif /* Herwig_GeneralStatistics_H */
diff --git a/Exsample2/Makefile.am b/Exsample2/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Exsample2/Makefile.am
@@ -0,0 +1,10 @@
+pkglib_LTLIBRARIES = HwExsample2.la
+HwExsample2_la_LDFLAGS = -module -version-info 11:1:0
+HwExsample2_la_SOURCES = \
+GeneralStatistics.h GeneralStatistics.cc \
+BinnedStatistics.h BinnedStatistics.cc \
+MultiIterationStatistics.h MultiIterationStatistics.cc \
+BinSampler.h BinSampler.cc \
+ProjectingSampler.h ProjectingSampler.cc \
+GeneralSampler.h GeneralSampler.cc \
+ExSampler2.h ExSampler2.cc
diff --git a/Exsample2/MultiIterationStatistics.cc b/Exsample2/MultiIterationStatistics.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/MultiIterationStatistics.cc
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// MultiIterationStatictis.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the MultiIterationStatistics class.
+//
+
+#include "MultiIterationStatistics.h"
+
+using namespace Herwig;
+
+MultiIterationStatistics::MultiIterationStatistics()
+ : GeneralStatistics() {}
+
+MultiIterationStatistics::~MultiIterationStatistics() {}
+
+void MultiIterationStatistics::put(PersistentOStream & os) const {
+ GeneralStatistics::put(os);
+ os << theIterations;
+}
+
+void MultiIterationStatistics::get(PersistentIStream & is) {
+ GeneralStatistics::get(is);
+ is >> theIterations;
+}
+
diff --git a/Exsample2/MultiIterationStatistics.h b/Exsample2/MultiIterationStatistics.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/MultiIterationStatistics.h
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+//
+// MultiIterationStatictis.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_MultiIterationStatistics_H
+#define Herwig_MultiIterationStatistics_H
+//
+// This is the declaration of the MultiIterationStatistics class.
+//
+
+#include "GeneralStatistics.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ * \brief Monte Carlo statistics for multiple iterations
+ */
+class MultiIterationStatistics: public Herwig::GeneralStatistics {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ MultiIterationStatistics();
+
+ /**
+ * The destructor.
+ */
+ virtual ~MultiIterationStatistics();
+ //@}
+
+public:
+
+ /**
+ * Indicate the start of a new iteration
+ */
+ void nextIteration() {
+ iterations().push_back(GeneralStatistics(*this));
+ reset();
+ }
+
+ /**
+ * Return the iterations done so far.
+ */
+ const vector<GeneralStatistics>& iterations() const {
+ return theIterations;
+ }
+
+ /**
+ * Access the iterations done so far.
+ */
+ vector<GeneralStatistics>& iterations() {
+ return theIterations;
+ }
+
+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 put(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 get(PersistentIStream & is);
+ //@}
+
+private:
+
+ /**
+ * The currently accumulated iterations.
+ */
+ vector<GeneralStatistics> theIterations;
+
+};
+
+inline PersistentOStream& operator<<(PersistentOStream& os, const MultiIterationStatistics& s) {
+ s.put(os); return os;
+}
+
+inline PersistentIStream& operator>>(PersistentIStream& is, MultiIterationStatistics& s) {
+ s.get(is); return is;
+}
+
+}
+
+#endif /* Herwig_MultiIterationStatistics_H */
diff --git a/Exsample2/ProjectingSampler.cc b/Exsample2/ProjectingSampler.cc
new file mode 100644
--- /dev/null
+++ b/Exsample2/ProjectingSampler.cc
@@ -0,0 +1,223 @@
+// -*- C++ -*-
+//
+// ProjectingSampler.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the ProjectingSampler class.
+//
+
+#include "ProjectingSampler.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Interface/Parameter.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Repository/UseRandom.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/Utilities/DescribeClass.h"
+
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+using namespace Herwig;
+
+ProjectingSampler::ProjectingSampler()
+ : theFirstIteration(true), theNIterations(4),
+ theEnhancementFactor(2.0), theNBins(8),
+ theEpsilon(0.5), theLastNPoints(0) {}
+
+ProjectingSampler::~ProjectingSampler() {}
+
+IBPtr ProjectingSampler::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr ProjectingSampler::fullclone() const {
+ return new_ptr(*this);
+}
+
+void ProjectingSampler::select(double weight) {
+ for ( size_t k = 0; k < lastPoint().size(); ++k ) {
+ if ( theFirstIteration ) {
+ theProjections[k].bin(lastPoint()[k]);
+ }
+ theProjections[k].select(theLastValue);
+ }
+ GeneralStatistics::select(weight);
+}
+
+void ProjectingSampler::accept() {
+ for ( size_t k = 0; k < lastPoint().size(); ++k ) {
+ theProjections[k].accept();
+ }
+ GeneralStatistics::accept();
+}
+
+void ProjectingSampler::reject() {
+ for ( size_t k = 0; k < lastPoint().size(); ++k ) {
+ theProjections[k].reject();
+ }
+ GeneralStatistics::reject();
+}
+
+void ProjectingSampler::generate(bool noMaxInfo) {
+ double w = 1.;
+ if ( !theFirstIteration ) {
+ for ( size_t k = 0; k < lastPoint().size(); ++k ) {
+ w *= theProjections[k].sample(lastPoint()[k]);
+ }
+ } else {
+ for ( size_t k = 0; k < lastPoint().size(); ++k )
+ lastPoint()[k] = UseRandom::rnd();
+ }
+ try {
+ theLastValue = theEventHandler->dSigDR(lastPoint()) / nanobarn;
+ w *= theLastValue;
+ } catch (Veto&) {
+ theLastValue = 0.0;
+ w = 0.0;
+ } catch (...) {
+ throw;
+ }
+ if ( abs(w) > maxWeight() && !noMaxInfo ) {
+ double old = maxWeight();
+ select(w);
+ throw NewMaximum(old,abs(w));
+ }
+ select(w);
+ if ( !noMaxInfo &&
+ selectedPoints() == theLastNPoints ) {
+ theLastNPoints = (unsigned long)(theLastNPoints*theEnhancementFactor);
+ adapt();
+ throw UpdateCrossSections();
+ }
+}
+
+void ProjectingSampler::initialize(bool progress) {
+ if ( initialized() )
+ return;
+ lastPoint().resize(dimension());
+ theProjections.resize(dimension(),BinnedStatistics(theNBins));
+ theLastNPoints = initialPoints();
+ theFirstIteration = true;
+ runIteration(theLastNPoints,progress);
+ theLastNPoints = (unsigned long)(theLastNPoints*theEnhancementFactor);
+ adapt();
+ nextIteration();
+ theFirstIteration = false;
+ for ( unsigned long k = 1; k < theNIterations-1; ++k ) {
+ runIteration(theLastNPoints,progress);
+ theLastNPoints = (unsigned long)(theLastNPoints*theEnhancementFactor);
+ adapt();
+ nextIteration();
+ }
+ runIteration(theLastNPoints,progress);
+ theLastNPoints = (unsigned long)(theLastNPoints*theEnhancementFactor);
+ adapt();
+ isInitialized();
+}
+
+struct ProjectingAdaptor {
+
+ double variance;
+ double epsilon;
+
+ double importanceMeasure(const GeneralStatistics& s) const {
+ return s.averageAbsWeight();
+ }
+
+ bool adapt(const GeneralStatistics& s) const {
+ return s.averageAbsWeightVariance()/variance > epsilon;
+ }
+
+};
+
+void ProjectingSampler::adapt() {
+
+ ProjectingAdaptor adaptor;
+ adaptor.variance = 0.;
+ for ( vector<BinnedStatistics>::iterator s =
+ theProjections.begin(); s != theProjections.end(); ++s ) {
+ double variance = 0.;
+ for ( map<double,GeneralStatistics>::const_iterator k =
+ s->statistics().begin(); k != s->statistics().end(); ++k ) {
+ variance += k->second.averageAbsWeightVariance();
+ }
+ adaptor.variance += variance/s->statistics().size();
+ }
+ adaptor.variance /= theProjections.size();
+ adaptor.epsilon = theEpsilon;
+
+ size_t count = 0;
+ for ( vector<BinnedStatistics>::iterator s =
+ theProjections.begin(); s != theProjections.end(); ++s, ++count ) {
+ s->adapt(adaptor);
+ }
+
+}
+
+// If needed, insert default implementations of virtual function defined
+// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+
+
+void ProjectingSampler::persistentOutput(PersistentOStream & os) const {
+ os << theFirstIteration << theNIterations << theEnhancementFactor
+ << theNBins << theEpsilon << theLastNPoints
+ << theProjections;
+}
+
+void ProjectingSampler::persistentInput(PersistentIStream & is, int) {
+ is >> theFirstIteration >> theNIterations >> theEnhancementFactor
+ >> theNBins >> theEpsilon >> theLastNPoints
+ >> theProjections;
+}
+
+
+// *** Attention *** The following static variable is needed for the type
+// description system in ThePEG. Please check that the template arguments
+// are correct (the class and its base class), and that the constructor
+// arguments are correct (the class name and the name of the dynamically
+// loadable library where the class implementation can be found).
+DescribeClass<ProjectingSampler,Herwig::BinSampler>
+ describeHerwigProjectingSampler("Herwig::ProjectingSampler", "HwExsample2.so");
+
+void ProjectingSampler::Init() {
+
+ static ClassDocumentation<ProjectingSampler> documentation
+ ("ProjectingSampler does adaption from projections of the integrand.");
+
+
+ static Parameter<ProjectingSampler,unsigned long> interfaceNIterations
+ ("NIterations",
+ "The number of iterations to perform initially.",
+ &ProjectingSampler::theNIterations, 4, 1, 0,
+ false, false, Interface::lowerlim);
+
+
+ static Parameter<ProjectingSampler,double> interfaceEnhancementFactor
+ ("EnhancementFactor",
+ "The enhancement factor for the number of points in the next iteration.",
+ &ProjectingSampler::theEnhancementFactor, 2.0, 1.0, 0,
+ false, false, Interface::lowerlim);
+
+
+ static Parameter<ProjectingSampler,unsigned int> interfaceNBins
+ ("NBins",
+ "The number of projection bins to consider initially.",
+ &ProjectingSampler::theNBins, 8, 1, 0,
+ false, false, Interface::lowerlim);
+
+
+ static Parameter<ProjectingSampler,double> interfaceEpsilon
+ ("Epsilon",
+ "The adaption threshold.",
+ &ProjectingSampler::theEpsilon, 0.5, 0.0, 0,
+ false, false, Interface::lowerlim);
+
+
+}
+
diff --git a/Exsample2/ProjectingSampler.h b/Exsample2/ProjectingSampler.h
new file mode 100644
--- /dev/null
+++ b/Exsample2/ProjectingSampler.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+//
+// ProjectingSampler.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2012 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef Herwig_ProjectingSampler_H
+#define Herwig_ProjectingSampler_H
+//
+// This is the declaration of the ProjectingSampler class.
+//
+
+#include "BinSampler.h"
+#include "BinnedStatistics.h"
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * \ingroup Matchbox
+ * \author Simon Platzer
+ *
+ * \brief ProjectingSampler does adaption from projections of the integrand.
+ *
+ * @see \ref ProjectingSamplerInterfaces "The interfaces"
+ * defined for ProjectingSampler.
+ */
+class ProjectingSampler: public Herwig::BinSampler {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ ProjectingSampler();
+
+ /**
+ * The destructor.
+ */
+ virtual ~ProjectingSampler();
+ //@}
+
+public:
+
+ /**
+ * Generate the next point; store the point in lastPoint() and its
+ * weight using select(); if noMaxInfo is true, do not throw
+ * NewMaximum or UpdateCrossSections exceptions.
+ */
+ virtual void generate(bool noMaxInfo = false);
+
+ /**
+ * Initialize this bin sampler. This default version calls runIteration.
+ */
+ virtual void initialize(bool progress);
+
+ /**
+ * Finish an iteration, performing the adaption.
+ */
+ void adapt();
+
+public:
+
+ /**
+ * Select an event
+ */
+ virtual void select(double weight);
+
+ /**
+ * Accept an event.
+ */
+ virtual void accept();
+
+ /**
+ * Reject an event.
+ */
+ virtual void reject();
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * The standard Init function used to initialize the interfaces.
+ * Called exactly once for each class by the class description system
+ * before the main function starts or
+ * when this class is dynamically loaded.
+ */
+ static void Init();
+
+protected:
+
+ /** @name Clone Methods. */
+ //@{
+ /**
+ * Make a simple clone of this object.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+// If needed, insert declarations of virtual function defined in the
+// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
+
+
+private:
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ ProjectingSampler & operator=(const ProjectingSampler &);
+
+ /**
+ * True, if we're running the first iteration.
+ */
+ bool theFirstIteration;
+
+ /**
+ * The number of iterations to be considered for initialization.
+ */
+ unsigned long theNIterations;
+
+ /**
+ * Factor to enhance the number of points for the next iteration.
+ */
+ double theEnhancementFactor;
+
+ /**
+ * The initial number of bins to use.
+ */
+ unsigned int theNBins;
+
+ /**
+ * The adaption threshold.
+ */
+ double theEpsilon;
+
+ /**
+ * The number of points used for the last iteration.
+ */
+ unsigned long theLastNPoints;
+
+ /**
+ * The projections to use.
+ */
+ vector<BinnedStatistics> theProjections;
+
+ /**
+ * The last integrand value.
+ */
+ double theLastValue;
+
+};
+
+}
+
+#endif /* Herwig_ProjectingSampler_H */
diff --git a/Exsample2/exsample/generator.icc b/Exsample2/exsample/generator.icc
--- a/Exsample2/exsample/generator.icc
+++ b/Exsample2/exsample/generator.icc
@@ -1,178 +1,177 @@
// -*- C++ -*-
//
// generator.icc is part of ExSample -- A Library for Sampling Sudakov-Type Distributions
//
// Copyright (C) 2008-2011 Simon Platzer -- simon.plaetzer@desy.de
//
// ExSample is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
namespace exsample {
template<class Function, class Random>
template<class SlaveStatistics>
void generator<Function,Random>::initialize(SlaveStatistics& opt) {
adaption_info_.dimension = function_->dimension();
adaption_info_.lower_left = function_->support().first;
adaption_info_.upper_right = function_->support().second;
if (adaption_info_.adapt.empty())
adaption_info_.adapt = std::vector<bool>(adaption_info_.dimension,true);
last_point_.resize(adaption_info_.dimension);
if (initialized_) return;
root_cell_ =
binary_tree<cell>(cell(adaption_info_.lower_left,
adaption_info_.upper_right,
adaption_info_));
root_cell_.value().info().explore(rnd_gen_,adaption_info_,function_,&statistics_,opt);
root_cell_.value().integral(root_cell_.value().info().volume() * root_cell_.value().info().overestimate());
statistics_.reset();
check_events_ = adaption_info_.presampling_points;
initialized_ = true;
}
template<class Function, class Random>
bool generator<Function,Random>::split() {
if (adaption_info_.freeze_grid < statistics_.accepted() &&
adaption_info_.freeze_grid != 0)
return false;
if (compensating_) return false;
if (!(*last_cell_).info().bad(adaption_info_)) return false;
bool dosplit = false;
std::pair<std::size_t,double> sp =
(*last_cell_).info().get_split(adaption_info_,dosplit);
if (!dosplit || !adaption_info_.adapt[sp.first]) {
return false;
}
- std::pair<binary_tree<cell>::iterator,binary_tree<cell>::iterator> spit =
- last_cell_.node().split((*last_cell_).split(sp,rnd_gen_,function_,adaption_info_));
+ last_cell_.node().split((*last_cell_).split(sp,rnd_gen_,function_,adaption_info_));
integral_accessor iacc;
root_cell_.tree_accumulate(iacc,std::plus<double>());
did_split_ = true;
statistics_.reset();
return true;
}
template<class Function, class Random>
void generator<Function,Random>::compensate() {
if (!did_split_) {
root_cell_.value().info().overestimate(std::abs(last_value_),last_point_);
root_cell_.value().integral(root_cell_.value().info().volume() * root_cell_.value().info().overestimate());
return;
}
double old_norm = root_cell_.value().integral();
double new_norm = old_norm - (*last_cell_).integral() + std::abs(last_value_) * (*last_cell_).info().volume();
compensating_ = false;
last_cell_->missing_events() +=
static_cast<int>(round(((std::abs(last_value_) * old_norm)/(last_cell_->info().overestimate() * new_norm) - 1.) *
(last_cell_->info().attempted())));
if (last_cell_->missing_events() != 0)
compensating_ = true;
last_cell_->info().overestimate(std::abs(last_value_),last_point_);
last_cell_->integral(last_cell_->info().volume() * last_cell_->info().overestimate());
for (binary_tree<cell>::iterator it = root_cell_.begin();
it != root_cell_.end(); ++it)
if (it != last_cell_) {
it->missing_events() += static_cast<int>(round((old_norm/new_norm - 1.) * (it->info().attempted())));
if (it->missing_events() != 0) {
compensating_ = true;
}
}
integral_accessor iacc;
root_cell_.tree_accumulate(iacc,std::plus<double>());
statistics_.reset();
root_cell_.tree_accumulate(missing_accessor(),std::plus<int>());
}
template<class Function, class Random>
template<class SlaveStatistics>
double generator<Function,Random>::generate(SlaveStatistics& opt) {
unsigned long n_hit_miss = 0;
unsigned long n_select = 0;
sampling_selector<rnd_generator<Random> > sampler (rnd_gen_,compensating_);
missing_accessor macc;
if (compensating_) {
compensating_ = false;
for (binary_tree<cell>::iterator it = root_cell_.begin();
it != root_cell_.end(); ++it)
if (it->missing_events() != 0) {
compensating_ = true;
break;
}
}
while (true) {
sampler.compensate = compensating_;
n_select = 0;
if (did_split_)
while ((last_cell_ = root_cell_.select(sampler)) == root_cell_.end()) {
root_cell_.tree_accumulate(macc,std::plus<int>());
if(++n_select > adaption_info_.maxtry)
throw selection_maxtry();
}
else
last_cell_ = root_cell_.begin();
last_cell_->info().select(rnd_gen_,last_point_);
last_value_ = function_->evaluate(last_point_);
last_cell_->info().selected(last_point_,std::abs(last_value_),adaption_info_);
if (std::abs(last_value_) > last_cell_->info().overestimate()) {
if ( std::abs(last_value_)/last_cell_->info().overestimate() > 2. ) {
last_value_ =
last_value_*(1.+exp(2.*(2.-std::abs(last_value_)/last_cell_->info().overestimate())));
}
compensate();
n_hit_miss = 0;
continue;
}
- if (last_cell_->info().attempted() % check_events_ == 0) {
+ if (last_cell_->info().attempted() > check_events_) {
if (split()) {
throw generator_update();
}
}
if (did_split_) {
statistics_.select(last_value_ * root_cell_.value().integral() /
last_cell_->info().overestimate(), !compensating_);
opt.select(last_value_ * root_cell_.value().integral() /
last_cell_->info().overestimate(), !compensating_);
} else {
statistics_.select(last_value_, !compensating_);
opt.select(last_value_, !compensating_);
}
if (std::abs(last_value_)/last_cell_->info().overestimate() > rnd_gen_())
break;
if(++n_hit_miss > adaption_info_.maxtry)
throw hit_and_miss_maxtry();
}
last_cell_->info().accept();
if (did_split_)
last_value_ *= root_cell_.value().integral() / last_cell_->info().overestimate();
statistics_.accept(last_value_);
++check_events_;
if (last_value_ < 0.)
return -1.;
return 1.;
}
template<class Function, class Random>
template<class OStream>
void generator<Function,Random>::put (OStream& os) const {
adaption_info_.put(os);
root_cell_.put(os);
statistics_.put(os);
os << check_events_;
ostream_traits<OStream>::separator(os);
os << did_split_;
ostream_traits<OStream>::separator(os);
os << initialized_;
ostream_traits<OStream>::separator(os);
}
template<class Function, class Random>
template<class IStream>
void generator<Function,Random>::get (IStream& is) {
adaption_info_.get(is);
root_cell_.get(is);
statistics_.get(is);
is >> check_events_ >> did_split_ >> initialized_;
}
}
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,28 +1,28 @@
SUBDIRS = include \
Utilities PDT Decay PDF Models \
Shower DipoleShower Hadronization MatrixElement \
- UnderlyingEvent Analysis Looptools \
+ UnderlyingEvent Analysis Looptools Exsample2 \
lib src Doc Contrib Tests
EXTRA_DIST = GUIDELINES
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --with-thepeg=$(THEPEGPATH)
ACLOCAL_AMFLAGS = -I m4
DISTCLEANFILES = config.herwig
libclean:
find . -name '*.la' -print0 | xargs -0 rm -rf
cd lib && $(MAKE) $(AM_MAKEFLAGS) clean
cd src && $(MAKE) $(AM_MAKEFLAGS) clean
tests:
cd Tests && $(MAKE) $(AM_MAKEFLAGS) tests
## ThePEG registration
unregister:
cd src && $(MAKE) $(AM_MAKEFLAGS) unregister
register:
cd src && $(MAKE) $(AM_MAKEFLAGS) register
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,181 +1,182 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT([Herwig++],[SVN],[herwig@projects.hepforge.org],[Herwig++])
AC_CONFIG_SRCDIR([Utilities/HerwigStrategy.cc])
AC_CONFIG_AUX_DIR([Config])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([Config/config.h])
dnl AC_PRESERVE_HELP_ORDER
AC_CANONICAL_HOST
case "${host}" in
*-darwin[[0156]].*)
AC_MSG_ERROR([Herwig++ requires OS X 10.3 or later])
;;
*-darwin7.*)
if test "x$MACOSX_DEPLOYMENT_TARGET" != "x10.3"; then
AC_MSG_ERROR(
[Please add 'MACOSX_DEPLOYMENT_TARGET=10.3' to the configure line.])
fi
;;
esac
dnl === disable debug symbols by default =====
if test "x$CXXFLAGS" = "x"; then
CXXFLAGS=-O3
fi
if test "x$CFLAGS" = "x"; then
CFLAGS=-O3
fi
dnl Looptools manual requires optimization off
if test "x$FCFLAGS" = "x"; then
FCFLAGS=-O0
fi
dnl ==========================================
AC_LANG([C++])
AM_INIT_AUTOMAKE([1.9 gnu dist-bzip2 -Wall])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Checks for programs.
AC_PROG_CXX([g++])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
dnl modified search order
AC_PROG_FC([gfortran g95 g77])
dnl xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 xlf f77 frt pgf77 cf77 fort77 fl32 af77])
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([if the Fortran compiler ($FC) works])
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([],[ print *[,]"Hello"]),
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([A Fortran compiler is required to build Herwig++.])
]
)
AC_LANG_POP([Fortran])
LT_PREREQ([2.2])
LT_INIT([disable-static dlopen pic-only])
dnl ####################################
dnl ####################################
dnl for Doc/fixinterfaces.pl
AC_PATH_PROG(PERL, perl)
HERWIG_CHECK_GSL
HERWIG_CHECK_THEPEG
HERWIG_CHECK_BOOST
HERWIG_COMPILERFLAGS
HERWIG_LOOPTOOLS
HERWIG_PDF_PATH
FASTJET_CHECK_FASTJET
HERWIG_VERSIONSTRING
HERWIG_CHECK_ABS_BUG
HERWIG_ENABLE_MODELS
SHARED_FLAG=-shared
AM_CONDITIONAL(NEED_APPLE_FIXES,
[test "xx${host/darwin/foundit}xx" != "xx${host}xx"])
if test "xx${host/darwin/foundit}xx" != "xx${host}xx"; then
APPLE_DSO_FLAGS=-Wl,-undefined,dynamic_lookup
SHARED_FLAG=-bundle
fi
AC_SUBST([APPLE_DSO_FLAGS])
AC_SUBST([SHARED_FLAG])
AC_CONFIG_FILES([UnderlyingEvent/Makefile
Models/Makefile
Models/StandardModel/Makefile
Models/RSModel/Makefile
Models/General/Makefile
Models/Susy/Makefile
Models/Susy/NMSSM/Makefile
Models/UED/Makefile
Models/Transplanckian/Makefile
Models/Leptoquarks/Makefile
Models/Zprime/Makefile
Models/TTbAsymm/Makefile
Models/ADD/Makefile
Models/Sextet/Makefile
Decay/Makefile
Decay/FormFactors/Makefile
Decay/Tau/Makefile
Decay/Baryon/Makefile
Decay/VectorMeson/Makefile
Decay/Perturbative/Makefile
Decay/ScalarMeson/Makefile
Decay/TensorMeson/Makefile
Decay/WeakCurrents/Makefile
Decay/Partonic/Makefile
Decay/General/Makefile
Decay/Radiation/Makefile
Doc/refman.conf
Doc/refman.h
PDT/Makefile
PDF/Makefile
MatrixElement/Makefile
MatrixElement/General/Makefile
MatrixElement/Lepton/Makefile
MatrixElement/Hadron/Makefile
MatrixElement/DIS/Makefile
MatrixElement/Powheg/Makefile
MatrixElement/Gamma/Makefile
MatrixElement/Matchbox/Makefile
MatrixElement/Matchbox/Base/Makefile
MatrixElement/Matchbox/Utility/Makefile
MatrixElement/Matchbox/Phasespace/Makefile
MatrixElement/Matchbox/Dipoles/Makefile
MatrixElement/Matchbox/InsertionOperators/Makefile
MatrixElement/Matchbox/Powheg/Makefile
MatrixElement/Matchbox/Builtin/Makefile
MatrixElement/Matchbox/Builtin/Processes/Makefile
+ Exsample2/Makefile
Shower/SplittingFunctions/Makefile
Shower/Default/Makefile
Shower/Base/Makefile
Shower/Makefile
DipoleShower/Makefile
DipoleShower/Base/Makefile
DipoleShower/Kernels/Makefile
DipoleShower/Kinematics/Makefile
DipoleShower/Utility/Makefile
DipoleShower/AlphaS/Makefile
Utilities/Makefile
Hadronization/Makefile
lib/Makefile
include/Makefile
src/Makefile
src/defaults/Makefile
src/herwig-config
Doc/Makefile
Doc/HerwigDefaults.in
Looptools/Makefile
Analysis/Makefile
src/Makefile-UserModules
src/defaults/Analysis.in
Contrib/Makefile
Contrib/make_makefiles.sh
Tests/Makefile
Makefile])
AC_CONFIG_FILES([Doc/fixinterfaces.pl],[chmod +x Doc/fixinterfaces.pl])
HERWIG_OVERVIEW
AC_CONFIG_COMMANDS([summary],[cat config.herwig])
AC_OUTPUT

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 5:45 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805443
Default Alt Text
(87 KB)

Event Timeline