Page MenuHomeHEPForge

No OneTemporary

diff --git a/Cuts/FastJetFinder.cc b/Cuts/FastJetFinder.cc
new file mode 100644
--- /dev/null
+++ b/Cuts/FastJetFinder.cc
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+//
+// KTJetFinder.h is a part of ThePEG - Toolkit for HEP Event Generation
+// Copyright (C) 1999-2007 Leif Lonnblad
+// Copyright (C) 2009-2012 Simon Platzer
+//
+// ThePEG 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 FastJetFinder class.
+//
+
+#include "FastJetFinder.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Interface/Parameter.h"
+#include "ThePEG/Interface/Switch.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Repository/UseRandom.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/Utilities/DescribeClass.h"
+#include "ThePEG/Cuts/Cuts.h"
+#include "fastjet/ClusterSequence.hh"
+
+
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+
+using namespace ThePEG;
+
+FastJetFinder::FastJetFinder()
+ : theDCut(ZERO), theConeRadius(0.7),
+ theVariant(kt), theMode(inclusive),
+ theRecombination(recoE) {}
+
+FastJetFinder::~FastJetFinder() {}
+
+IBPtr FastJetFinder::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr FastJetFinder::fullclone() const {
+ return new_ptr(*this);
+}
+
+bool FastJetFinder::cluster(tcPDVector & ptype, vector<LorentzMomentum> & p,
+ tcCutsPtr, tcPDPtr, tcPDPtr) const {
+ if ( ptype.size() <= minOutgoing() ){
+ return false;
+ }
+
+ tcPDVector::iterator di = ptype.begin();
+ vector<LorentzMomentum>::iterator pi = p.begin();
+ size_t index = 0;
+
+ vector<fastjet::PseudoJet> recombinables;
+ tcPDVector ptypeBuffer;
+ vector<LorentzMomentum> pBuffer;
+ for ( ; di != ptype.end(); ++di, ++pi, index++ ) {
+ if ( !unresolvedMatcher()->check(**di) ) {
+ ptypeBuffer.push_back(*di);
+ pBuffer.push_back(*pi);
+ continue;
+ }
+ recombinables.push_back(fastjet::PseudoJet( (*pi).x()/GeV,(*pi).y()/GeV,(*pi).z()/GeV, (*pi).t()/GeV ));
+ recombinables.back().set_user_index(index);
+ }
+
+ fastjet::Strategy strategy = fastjet::Best;
+
+ fastjet::RecombinationScheme recomb_scheme;
+ if ( theRecombination == recoE )
+ recomb_scheme = fastjet::E_scheme;
+ else if ( theRecombination == recoPt)
+ recomb_scheme = fastjet::pt_scheme;
+ else assert(false);
+
+ fastjet::JetAlgorithm jet_algorithm;
+ if ( theVariant == kt ) {
+ jet_algorithm = fastjet::kt_algorithm;
+ } else if ( theVariant == ca ) {
+ jet_algorithm = fastjet::cambridge_algorithm;
+ } else if ( theVariant == antikt ) {
+ jet_algorithm = fastjet::antikt_algorithm;
+ }
+ fastjet::JetDefinition jet_def(fastjet::kt_algorithm, theConeRadius, recomb_scheme, strategy);
+ fastjet::ClusterSequence clust_seq(recombinables, jet_def);
+
+ double dcut = 0.0;
+
+ if ( theVariant != antikt ) {
+ dcut = theDCut/GeV2;
+ } else {
+ dcut = GeV2/theDCut;
+ }
+
+ vector<fastjet::PseudoJet> recoJets;
+ if ( theMode == inclusive )
+ recoJets = clust_seq.inclusive_jets();
+ else if ( theMode == exclusive )
+ recoJets = clust_seq.exclusive_jets(dcut);
+
+
+ if ( recoJets.size() + pBuffer.size() == p.size() ){
+ return false;
+ }
+ else {
+ tcPDVector ptypeNew;
+ vector<LorentzMomentum> pNew;
+ for (vector<fastjet::PseudoJet>::const_iterator iter = recoJets.begin();
+ iter != recoJets.end(); iter++){
+ ptypeNew.push_back(ptype[iter->constituents().begin()->user_index()]);
+ pNew.push_back(LorentzMomentum(iter->px()*GeV, iter->py()*GeV, iter->pz()*GeV, iter->E()*GeV));
+ }
+
+ di = ptypeBuffer.begin();
+ pi = pBuffer.begin();
+ for (; di != ptypeBuffer.end(); di++, pi++){
+ ptypeNew.push_back(*di);
+ pNew.push_back(*pi);
+ }
+ ptype = ptypeNew;
+ p = pNew;
+ return true;
+ }
+}
+
+
+// If needed, insert default implementations of virtual function defined
+// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+
+
+void FastJetFinder::persistentOutput(PersistentOStream & os) const {
+ os << ounit(theDCut,GeV2) << theConeRadius << theVariant << theMode
+ << theRecombination;
+}
+
+void FastJetFinder::persistentInput(PersistentIStream & is, int) {
+ is >> iunit(theDCut,GeV2) >> theConeRadius >> theVariant >> theMode
+ >> theRecombination;
+}
+
+
+// *** 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<FastJetFinder,JetFinder>
+ describeFastJetFinder("ThePEG::FastJetFinder", "FastJetFinder.so");
+
+void FastJetFinder::Init() {
+
+ static ClassDocumentation<FastJetFinder> documentation
+ ("FastJetFinder implements the class of longitudinally invariant kt "
+ "jet clustering algorithms, as relevant for cuts on the real "
+ "emission contribution to a NLO calculation. Recombination is "
+ "exclusively performed using the pt scheme.");
+
+
+ static Parameter<FastJetFinder,Energy2> interfaceDCut
+ ("DCut",
+ "The distance cut, when acting exclusively. "
+ "The inverse is taken for the anti-kt algorithm, "
+ "while for the Cambridge/Aachen variant dCut/GeV2 is used.",
+ &FastJetFinder::theDCut, GeV2, 0.0*GeV2, 0.0*GeV2, 0*GeV2,
+ false, false, Interface::lowerlim);
+
+
+ static Parameter<FastJetFinder,double> interfaceConeRadius
+ ("ConeRadius",
+ "The cone radius R used in inclusive mode.",
+ &FastJetFinder::theConeRadius, 0.7, 0.0, 1.0,
+ false, false, Interface::limited);
+
+ static Switch<FastJetFinder,int> interfaceVariant
+ ("Variant",
+ "The variant to use.",
+ &FastJetFinder::theVariant, kt, false, false);
+ static SwitchOption interfaceVariantKt
+ (interfaceVariant,
+ "Kt",
+ "Kt algorithm.",
+ kt);
+ static SwitchOption interfaceVariantCA
+ (interfaceVariant,
+ "CA",
+ "Cambridge/Aachen algorithm.",
+ ca);
+ static SwitchOption interfaceVariantAntiKt
+ (interfaceVariant,
+ "AntiKt",
+ "Anti kt algorithm.",
+ antikt);
+
+
+ static Switch<FastJetFinder,int> interfaceMode
+ ("Mode",
+ "The mode to use.",
+ &FastJetFinder::theMode, inclusive, false, false);
+ static SwitchOption interfaceModeInclusive
+ (interfaceMode,
+ "Inclusive",
+ "Find inclusive jets.",
+ inclusive);
+ static SwitchOption interfaceModeExclusive
+ (interfaceMode,
+ "Exclusive",
+ "Find exclusive jets.",
+ exclusive);
+
+ static Switch<FastJetFinder,int> interfaceRecombination
+ ("RecombinationScheme",
+ "The recombination scheme to use.",
+ &FastJetFinder::theRecombination, recoE, false, false);
+ static SwitchOption interfaceRecombinationPt
+ (interfaceRecombination,
+ "Pt",
+ "Add transverse momenta",
+ recoPt);
+ static SwitchOption interfaceRecombinationE
+ (interfaceRecombination,
+ "E",
+ "Add the four-momenta",
+ recoE);
+
+}
+
diff --git a/Cuts/FastJetFinder.h b/Cuts/FastJetFinder.h
new file mode 100644
--- /dev/null
+++ b/Cuts/FastJetFinder.h
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+//
+// FastJetFinder.h is a part of ThePEG - Toolkit for HEP Event Generation
+// Copyright (C) 1999-2007 Leif Lonnblad
+// Copyright (C) 2009-2012 Simon Platzer
+//
+// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef THEPEG_FastJetFinder_H
+#define THEPEG_FastJetFinder_H
+//
+// This is the declaration of the FastJetFinder class.
+//
+
+#include "ThePEG/Cuts/JetFinder.h"
+
+namespace ThePEG {
+
+/**
+ * FastJetFinder implements the class of longitudinally invariant kt
+ * jet clustering algorithms.
+ *
+ * @see \ref FastJetFinderInterfaces "The interfaces"
+ * defined for FastJetFinder.
+ */
+class FastJetFinder: public JetFinder {
+
+public:
+
+ /** @name Standard constructors and destructors. */
+ //@{
+ /**
+ * The default constructor.
+ */
+ FastJetFinder();
+
+ /**
+ * The destructor.
+ */
+ virtual ~FastJetFinder();
+ //@}
+
+public:
+
+ /**
+ * Perform jet clustering on the given outgoing particles.
+ * Optionally, information on the incoming particles is provided.
+ * Return true, if a clustering has been performed.
+ */
+ virtual bool cluster(tcPDVector & ptype, vector<LorentzMomentum> & p,
+ tcCutsPtr parent, tcPDPtr t1 = tcPDPtr(),
+ tcPDPtr t2 = tcPDPtr()) const;
+
+public:
+
+ /** @name Functions used by the persistent I/O system. */
+ //@{
+ /**
+ * Function used to write out object persistently.
+ * @param os the persistent output stream written to.
+ */
+ void persistentOutput(PersistentOStream & os) const;
+
+ /**
+ * Function used to read in object persistently.
+ * @param is the persistent input stream read from.
+ * @param version the version number of the object when written.
+ */
+ void persistentInput(PersistentIStream & is, int version);
+ //@}
+
+ /**
+ * The standard Init function used to initialize the interfaces.
+ * Called exactly once for each class by the class description system
+ * before the main function starts or
+ * when this class is dynamically loaded.
+ */
+ static void Init();
+
+protected:
+
+ /** @name Clone Methods. */
+ //@{
+ /**
+ * Make a simple clone of this object.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr clone() const;
+
+ /** Make a clone of this object, possibly modifying the cloned object
+ * to make it sane.
+ * @return a pointer to the new object.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+
+// If needed, insert declarations of virtual function defined in the
+// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
+
+private:
+
+ /**
+ * The resolution cut. Ignored, if algorithm is to act inclusively.
+ */
+ Energy2 theDCut;
+
+ /**
+ * The `cone radius' R. Ignored (R=1), if algorithm is to act
+ * exclusively.
+ */
+ double theConeRadius;
+
+ /**
+ * The possible variants.
+ */
+ enum variants {
+ kt = 1,
+ ca = 2,
+ antikt = 3
+ };
+
+ /**
+ * The variant.
+ */
+ int theVariant;
+
+ /**
+ * The possible modes.
+ */
+ enum modes {
+ inclusive = 1,
+ exclusive = 2
+ };
+
+ /**
+ * The mode.
+ */
+ int theMode;
+
+ /**
+ * The possible recombination schemes.
+ */
+ enum recombinations {
+ recoPt = 1,
+ recoE = 2
+ };
+
+ /**
+ * The recombination scheme
+ */
+ int theRecombination;
+
+private:
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ FastJetFinder & operator=(const FastJetFinder &);
+
+};
+
+}
+
+#endif /* THEPEG_FastJetFinder_H */
diff --git a/Cuts/Makefile.am b/Cuts/Makefile.am
--- a/Cuts/Makefile.am
+++ b/Cuts/Makefile.am
@@ -1,44 +1,53 @@
mySOURCES = Cuts.cc OneCutBase.cc TwoCutBase.cc MultiCutBase.cc JetFinder.cc
DOCFILES = Cuts.h OneCutBase.h TwoCutBase.h MultiCutBase.h JetFinder.h
INCLUDEFILES = $(DOCFILES) Cuts.fh OneCutBase.fh \
TwoCutBase.fh MultiCutBase.fh
noinst_LTLIBRARIES = libThePEGCuts.la
# pkglib_LTLIBRARIES = JetKTClusCuts.la
libThePEGCuts_la_SOURCES = $(mySOURCES) $(INCLUDEFILES)
pkglib_LTLIBRARIES = SimpleKTCut.la KTClus.la V2LeptonsCut.la SimpleDISCut.la \
- KTRapidityCut.la KTJetFinder.la DeltaMeasureCuts.la JetCuts.la
+ KTRapidityCut.la KTJetFinder.la DeltaMeasureCuts.la JetCuts.la \
+ FastJetFinder.la
SimpleKTCut_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
SimpleKTCut_la_SOURCES = SimpleKTCut.cc SimpleKTCut.h
KTRapidityCut_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
KTRapidityCut_la_SOURCES = KTRapidityCut.cc KTRapidityCut.h
KTClus_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
KTClus_la_SOURCES = KTClus.cc KTClus.h
V2LeptonsCut_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
V2LeptonsCut_la_SOURCES = V2LeptonsCut.cc V2LeptonsCut.h
SimpleDISCut_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
SimpleDISCut_la_SOURCES = SimpleDISCut.cc SimpleDISCut.h
KTJetFinder_la_LDFLAGS = -module $(LIBTOOLVERSIONINFO)
KTJetFinder_la_SOURCES = KTJetFinder.cc KTJetFinder.h
JetCuts_la_LDFLAGS = -module $(LIBTOOLVERSIONINFO)
JetCuts_la_SOURCES = \
OneJetCut.h OneJetCut.cc NJetsCut.h NJetsCut.cc \
JetRegion.h JetRegion.cc JetPairRegion.h JetPairRegion.cc \
MultiJetRegion.h MultiJetRegion.cc JetCuts.h JetCuts.cc
DeltaMeasureCuts_la_LDFLAGS = -module $(LIBTOOLVERSIONINFO)
DeltaMeasureCuts_la_SOURCES = DeltaMeasureCuts.cc DeltaMeasureCuts.h
+if WANT_LIBFASTJET
+FastJetFinder_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
+-I$(FASTJETPATH)
+FastJetFinder_la_LIBADD = $(FASTJETLIBS)
+FastJetFinder_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
+FastJetFinder_la_SOURCES = FastJetFinder.cc FastJetFinder.h
+endif
+
include $(top_srcdir)/Config/Makefile.aminclude
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,154 +1,155 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT([ThePEG],[SVN],[http://www.thep.lu.se/ThePEG/],[ThePEG])
AC_CONFIG_AUX_DIR([Config])
AC_CONFIG_MACRO_DIR([m4])
THEPEG_LIBTOOL_VERSION_INFO(15,0,0)
AC_CONFIG_SRCDIR([EventRecord/SubProcess.h])
AC_CONFIG_HEADERS([Config/config.h Config/LWH.h Config/ThePEG_Qty.h:Config/ThePEG_Qty.h.a:Config/ThePEG_Qty.h.in:Config/ThePEG_Qty.h.b])
AC_CANONICAL_HOST
case "${host}" in
*-darwin[[0156]].*)
AC_MSG_ERROR([ThePEG requires OS X 10.3 or later])
;;
*-darwin7.*)
if test "x$MACOSX_DEPLOYMENT_TARGET" != "x10.3"; then
AC_MSG_ERROR(
[Please export the MACOSX_DEPLOYMENT_TARGET variable, set to 10.3])
fi
;;
esac
AC_LANG(C++)
AM_INIT_AUTOMAKE([1.9 gnu dist-bzip2 -Wall])
dnl also include std-options once --version and --help exist
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
LT_PREREQ([2.2])
LT_INIT([disable-static dlopen pic-only])
VL_LIB_READLINE
THEPEG_UNIT_CHECKING
THEPEG_CHECK_GSL
THEPEG_SEARCH_LHAPDF
THEPEG_CHECK_HEPMC
THEPEG_CHECK_RIVET
+FASTJET_CHECK_FASTJET
AX_CHECK_ZLIB
dnl AX_CHECK_BZ2LIB
THEPEG_DEFINE_ENVDEFAULT(ThePEG_GZREAD_FILE,GZREAD_FILE,gunzip -c,[The command which, taking the name of a gzipped file as argument, unzips it and prints it to stdout. Default is "gunzip -c"])
THEPEG_DEFINE_ENVDEFAULT(ThePEG_GZWRITE_FILE,GZWRITE_FILE,[gzip -c > ],[The command which, taking the name of a gzipped file as argument, reads stdin, zips it and writes it to the file. Default is "gzip -c > ".])
THEPEG_DEFINE_ENVDEFAULT(ThePEG_BZ2READ_FILE,BZ2READ_FILE,bunzip2 -c,[The command which, taking the name of a bzipped file as argument, unzips it and prints it to stdout. Default is "bunzip2 -c".])
THEPEG_DEFINE_ENVDEFAULT(ThePEG_BZ2WRITE_FILE,BZ2WRITE_FILE,[bzip2 -c > ],[The command which, taking the name of a bzipped file as argument, reads stdin, zips it and writes it to the file. Default is "bzip2 -c > ".])
THEPEG_CHECK_EXPM1
THEPEG_CHECK_LOG1P
THEPEG_CHECK_DLOPEN
THEPEG_CHECK_FPUCONTROL
THEPEG_CHECK_FENV
THEPEG_CHECK_AIDA
AM_CPPFLAGS="-I\$(top_builddir)/include \$(GSLINCLUDE)"
AX_COMPILER_VENDOR
case "${ax_cv_cxx_compiler_vendor}" in
gnu)
AM_CXXFLAGS="-ansi -pedantic -Wall -W"
;;
clang)
AM_CXXFLAGS="-ansi -pedantic -Wall -Wno-overloaded-virtual -Wno-unused-function"
dnl -Wno-unneeded-internal-declaration
;;
intel)
AM_CXXFLAGS="-strict-ansi -Wall -wd13000,1418,981,444,383,1599,1572,2259,980"
;;
esac
THEPEG_CHECK_ABS_BUG
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
dnl do an actual capability check on ld instead of this workaround
case "${host}" in
*-darwin*)
;;
*)
AM_LDFLAGS="-Wl,--enable-new-dtags"
;;
esac
AC_SUBST(AM_LDFLAGS)
THEPEG_EMPTY_SUBST
AC_PATH_PROG(PERL, perl)
AC_ARG_WITH(javagui,
[ --with-javagui Compile and install the java-based GUI.])
if test "x$with_javagui" != "xno"; then
THEPEG_HAS_JAVA([1.4], [], [with_javagui=no; AC_MSG_NOTICE([Java GUI disabled])])
fi
AM_CONDITIONAL([JAVAGUI], [test "x$with_javagui" != "xno"])
AC_CONFIG_FILES([Helicity/Makefile
Helicity/WaveFunction/Makefile
Helicity/Vertex/Makefile
Helicity/Vertex/Scalar/Makefile
Helicity/Vertex/Vector/Makefile
Helicity/Vertex/Tensor/Makefile
Utilities/Makefile
include/Makefile
Interface/Makefile
LesHouches/Makefile
Vectors/Makefile
PDT/Makefile
PDF/Makefile
Persistency/Makefile
Config/Makefile
Handlers/Makefile
MatrixElement/Makefile
Pointer/Makefile
lib/Makefile
lib/Makefile.common.install
src/Makefile
ACDC/Makefile
Repository/Makefile
EventRecord/Makefile
StandardModel/Makefile
Cuts/Makefile
Analysis/Makefile
Doc/Makefile
Doc/MakeDocs.in
Doc/refman.h
Doc/refman.conf
java/Makefile
Makefile])
AC_CONFIG_FILES([Doc/fixinterfaces.pl],[chmod +x Doc/fixinterfaces.pl])
THEPEG_OVERVIEW
AC_CONFIG_COMMANDS([summary],[cat config.thepeg])
AC_OUTPUT
diff --git a/m4/fastjet.m4 b/m4/fastjet.m4
new file mode 100644
--- /dev/null
+++ b/m4/fastjet.m4
@@ -0,0 +1,80 @@
+dnl CHECK FASTJET BEGIN
+dnl
+dnl This script can be used in configure scripts to check for the
+dnl usability of the FastJet librarty.
+dnl
+dnl By defaults, it searches the FastJet library in standard system
+dnl locations but an alternative path can be specified using the
+dnl --with-fastjet=... configure option
+dnl
+dnl If FastJet is found and functional, the variables FASTJET_CXXFLAGS
+dnl and FASTJET_LIBS are set
+dnl
+dnl modified for Herwig++ 2011-10-04 D.Grellscheid
+dnl
+AC_DEFUN([FASTJET_CHECK_FASTJET],
+[
+dnl ckeck if a directory is specified for FastJet
+AC_ARG_WITH(fastjet,
+ [AC_HELP_STRING([--with-fastjet=dir],
+ [Assume the given directory for FastJet])])
+
+dnl search for the fastjet-config script
+if test "$with_fastjet" = ""; then
+ AC_PATH_PROG(fjconfig, fastjet-config, no)
+else
+ AC_PATH_PROG(fjconfig, fastjet-config, no, ${with_fastjet}/bin)
+fi
+
+LOAD_FASTJET=""
+CREATE_FASTJET="#create"
+
+if test "${fjconfig}" = "no"; then
+ AC_MSG_CHECKING(FastJet)
+ AC_MSG_RESULT(no);
+ $2
+else
+
+ dnl now see if FastJet is functional
+ save_CXXFLAGS="$CXXFLAGS"
+ save_LIBS="$LIBS"
+
+ CXXFLAGS="${CXXFLAGS} `${fjconfig} --cxxflags`"
+ LIBS="${LIBS} `${fjconfig} --libs --plugins`"
+
+ AC_MSG_CHECKING([if FastJet is functional])
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
+#include <fastjet/ClusterSequence.hh>
+ ]], [[
+fastjet::PseudoJet pj=fastjet::PtYPhiM(10.0,0.5,1.0,0.0);
+ ]]), [fjok='yes'], [fjok='no'])
+ AC_MSG_RESULT([$fjok])
+ AC_LANG_POP()
+ CXXFLAGS="$save_CXXFLAGS"
+ LIBS="$save_LIBS"
+
+ AC_MSG_CHECKING(FastJet)
+ if test "${fjok}" = "yes"; then
+ FASTJET_CXXFLAGS="`${fjconfig} --cxxflags`"
+ FASTJET_LIBS="`${fjconfig} --libs --plugins`"
+ LOAD_FASTJET="library HwLEPJetAnalysis.so"
+ CREATE_FASTJET="create"
+ AC_MSG_RESULT(yes)
+ $1
+ else
+ AC_MSG_RESULT(no)
+ $2
+ fi
+fi
+
+
+AC_SUBST(FASTJETINCLUDE,[$FASTJET_CXXFLAGS])
+AC_SUBST(CREATE_FASTJET)
+AC_SUBST(LOAD_FASTJET)
+AC_SUBST(FASTJETLIBS,[${FASTJET_LIBS/-Wl,-rpath,/-R}])
+
+AM_CONDITIONAL(WANT_LIBFASTJET,[test "x$CREATE_FASTJET" = "xcreate"])
+])
+
+dnl CHECK FASTJET END
diff --git a/m4/thepeg.m4 b/m4/thepeg.m4
--- a/m4/thepeg.m4
+++ b/m4/thepeg.m4
@@ -1,512 +1,513 @@
# check for gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130
AC_DEFUN([THEPEG_CHECK_ABS_BUG],
[
if test "$GCC" = "yes"; then
AC_MSG_CHECKING([for gcc abs bug])
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[ int foo (int i) { return -2 * __builtin_abs(i - 2); } ]],
[[ if ( foo(1) != -2 || foo(3) != -2 ) return 1; ]]
)],
[ AC_MSG_RESULT([not found. Compiler is ok.]) ],
[
AC_MSG_RESULT([found. Builtin abs() is buggy.])
AC_MSG_CHECKING([if -fno-builtin-abs works])
oldcxxflags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -fno-builtin-abs"
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[
#include <cstdlib>
int foo (int i) { return -2 * std::abs(i - 2); }
]],
[[
if (foo(1) != -2 || foo(3) != -2) return 1;
]]
)],
[
AC_MSG_RESULT([yes. Setting -fno-builtin-abs.])
AM_CXXFLAGS="$AM_CXXFLAGS -fno-builtin-abs"
AM_CFLAGS="$AM_CFLAGS -fno-builtin-abs"
],
[
AC_MSG_RESULT([no. Setting -fno-builtin.])
AC_MSG_WARN([
*****************************************************************************
For this version of gcc, -fno-builtin-abs alone did not work to avoid the
gcc abs() bug. Instead, all gcc builtin functions are now disabled.
Update gcc if possible.
*****************************************************************************])
AM_CXXFLAGS="$AM_CXXFLAGS -fno-builtin"
AM_CFLAGS="$AM_CFLAGS -fno-builtin"
]
)
CXXFLAGS=$oldcxxflags
]
)
fi
])
# Search for LHAPDF and g77 compiler in standard directories
AC_DEFUN([THEPEG_SEARCH_LHAPDF],
[
AC_MSG_CHECKING([if LHAPDF is present and works])
HAS_LHAPDF="yes"
LHAPDF_LIBDIR=""
LOAD_LHAPDF=""
AC_ARG_WITH(LHAPDF,[ --without-LHAPDF do not use LHAPDF package (requires g77 compiler)
(included by default --with-LHAPDF=path to specify
where the LHAPDF shared library is located)], [if test -n "$with_LHAPDF" -a "x$with_LHAPDF" != "xyes" -a "x$with_LHAPDF" != "xno"; then LHAPDF_LIBDIR="$with_LHAPDF"; elif test "x$with_LHAPDF" == "xno"; then HAS_LHAPDF="no"; fi])
LHAPDF_LDFLAGS=""
if test -n "$LHAPDF_LIBDIR"; then
if test -e $LHAPDF_LIBDIR/libLHAPDF.so -o -e $LHAPDF_LIBDIR/libLHAPDF.dylib
then
LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR"
elif test "${host_cpu}" == "x86_64" -a -e $LHAPDF_LIBDIR/lib64/libLHAPDF.so
then
LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR/lib64"
elif test -e $LHAPDF_LIBDIR/lib/libLHAPDF.so -o -e $LHAPDF_LIBDIR/lib/libLHAPDF.dylib
then
LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR/lib"
else
HAS_LHAPDF="no"
fi
fi
LHAPDF_LIBS="-lLHAPDF"
oldLIB="$LIBS"
oldLDFLAGS="$LDFLAGS"
if test "$HAS_LHAPDF" == "yes"; then
dnl Now lets see if the libraries work properly
LIBS="$LIBS $LHAPDF_LIBS"
LDFLAGS="$LDFLAGS $LHAPDF_LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { void initpdf_(int&); }]],
[[int i = 1; initpdf_(i);]])], ,
HAS_LHAPDF="no")
fi
LIBS="$oldLIB"
LDFLAGS="$oldLDFLAGS"
if test "$HAS_LHAPDF" == "yes"; then
AC_MSG_RESULT([yes])
LHAPDF_PKGDATADIR="$LHAPDF_LIBDIR/../share/lhapdf"
LOAD_LHAPDF="library ThePEGLHAPDF.so"
dnl don't need to check for existence of LHAPDF_PKGDATADIR
dnl if this location is invalid, we'll use ThePEG's index file anyway
elif test "x$with_LHAPDF" == "xno" -o "x$with_LHAPDF" == "x"; then
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([LHAPDF was requested but the library was not found.])
fi
AC_SUBST(LHAPDF_LIBS)
AC_SUBST(LOAD_LHAPDF)
AC_SUBST(LHAPDF_LDFLAGS)
AC_SUBST(LHAPDF_PKGDATADIR)
AM_CONDITIONAL([USELHAPDF], [test "x$HAS_LHAPDF" == "xyes"])
])
# Check for ThePEG.
AC_DEFUN([THEPEG_CHECK_THEPEG],
[THEPEGBUILD="no"
AC_MSG_CHECKING([if THEPEGPATH is set])
if test -z "$THEPEGPATH"; then
if test -f "../ThePEG/Config/config.h"; then
THEPEGPATH="\$(top_builddir)/../ThePEG"
THEPEGBUILD="yes"
AC_MSG_RESULT([no (using ../ThePEG)])
AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_builddir)/../ThePEG/include "
SETUPTHEPEG="$THEPEGPATH/src/setupThePEG -L $THEPEGPATH/lib"
RUNTHEPEG="$THEPEGPATH/src/runThePEG -L $THEPEGPATH/lib"
THEPEGDOC="\$(top_builddir)/../ThePEG/Doc"
THEPEGLIB="\$(top_builddir)/../ThePEG/lib"
else
if test "x$prefix" == "xNONE"; then
THEPEGPATH=$ac_default_prefix
else
THEPEGPATH=$prefix
fi
AC_MSG_RESULT([no (using $THEPEGPATH)])
fi
else
AC_MSG_RESULT([yes ($THEPEGPATH)])
fi
if test "$THEPEGBUILD" == "no"; then
AM_CPPFLAGS="-I\$(top_builddir)/include -I$THEPEGPATH/include "
SETUPTHEPEG="$THEPEGPATH/bin/setupThePEG"
RUNTHEPEG="$THEPEGPATH/bin/runThePEG"
THEPEGDOC="$THEPEGPATH/share/ThePEG/Doc"
THEPEGLIB="$THEPEGPATH/lib/ThePEG"
AC_MSG_CHECKING([if the installed ThePEG works])
if test -x $SETUPTHEPEG && $SETUPTHEPEG /dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(ThePEG must be installed and THEPEGPATH set properly.)
fi
fi
AC_ARG_VAR(THEPEGPATH,[The path to where ThePEG is installed. Default is $prefix unless we are working in a sister of the build directory of ThePEG.])
pkglibdir="\$(libdir)/ThePEG"
AC_SUBST(pkglibdir)
AC_SUBST(THEPEGPATH)
AC_SUBST(THEPEGINCLUDE)
AC_SUBST(THEPEGDOC)
AC_SUBST(THEPEGLIB)
AC_SUBST(SETUPTHEPEG)
AC_SUBST(RUNTHEPEG)
AC_SUBST(AM_CPPFLAGS)
])
# Search for ThePEG in standard places.
AC_DEFUN([THEPEG_SEARCH_THEPEG],
[THEPEGBUILD="no"
AC_MSG_CHECKING([if THEPEGPATH is set])
if test -z "$THEPEGPATH"; then
if test -f "../ThePEG/Config/config.h"; then
THEPEGPATH="\$(top_builddir)/../ThePEG"
THEPEGBUILD="yes"
AC_MSG_RESULT([no (found ../ThePEG)])
AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_builddir)/../ThePEG/include "
SETUPTHEPEG="$THEPEGPATH/src/setupThePEG -L $THEPEGPATH/lib"
RUNTHEPEG="$THEPEGPATH/src/runThePEG -L $THEPEGPATH/lib"
THEPEGDOC="\$(top_builddir)/../ThePEG/Doc"
THEPEGLIB="\$(top_builddir)/../ThePEG/lib"
else
for dirbase in / /usr $ac_default_prefix $prefix; do
if test -f $dirbase/include/ThePEG/Config/config.h; then
THEPEGPATH=$dirbase
fi
done
if test -z "$THEPEGPATH"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR(Could not find a valid ThePEG installation or build directory)
else
AC_MSG_RESULT([no (found $THEPEGPATH)])
fi
fi
else
AC_MSG_RESULT([yes ($THEPEGPATH)])
fi
if test "$THEPEGBUILD" == "no"; then
AM_CPPFLAGS="-I\$(top_builddir)/include -I$THEPEGPATH/include "
SETUPTHEPEG="$THEPEGPATH/bin/setupThePEG"
RUNTHEPEG="$THEPEGPATH/bin/runThePEG"
THEPEGDOC="$THEPEGPATH/share/ThePEG/Doc"
THEPEGLIB="$THEPEGPATH/lib/ThePEG"
AC_MSG_CHECKING([if the installed ThePEG works])
if test -x $SETUPTHEPEG && $SETUPTHEPEG /dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(ThePEG must be installed and THEPEGPATH set properly.)
fi
fi
AC_ARG_VAR(THEPEGPATH,[The path to where ThePEG is installed. Default is $prefix unless we are working in a sister of the build directory of ThePEG.])
pkglibdir="\$(libdir)/ThePEG"
AC_SUBST(pkglibdir)
AC_SUBST(THEPEGPATH)
AC_SUBST(THEPEGINCLUDE)
AC_SUBST(THEPEGDOC)
AC_SUBST(THEPEGLIB)
AC_SUBST(SETUPTHEPEG)
AC_SUBST(RUNTHEPEG)
AC_SUBST(AM_CPPFLAGS)
])
AC_DEFUN([THEPEG_EMPTY_SUBST],
[EMPTY=""
AC_SUBST(EMPTY)
])
AC_DEFUN([THEPEG_SEARCH_PREFIXDIR_FILES],
[AC_MSG_CHECKING([if $1 and $2 is set])
if test -z "$$1"; then
for dirbase in / /usr $ac_default_prefix $prefix; do
if test -z "$$2"; then
for filename in $4; do
if test -f $dirbase/$3/$filename; then
$1=$dirbase/$3
$2=$filename
fi
done
else
if test -f $dirbase/$3/$$2; then
$1=$dirbase/$3
fi
fi
done
if test -z "$$1" -o -z "$$2"; then
AC_MSG_ERROR(no. Could not guess appropriate value for $1 and $2)
else
AC_MSG_RESULT([no (found $$1 and $$2)])
fi
else
if test -z "$$2"; then
for filename in $4; do
if test -f $$1/$filename; then
$2=$filename
fi
done
AC_MSG_RESULT([no (found $$1 and $$2)])
else
if test -f $$1/$$2; then
AC_MSG_RESULT([yes ($$1 and $$2)])
else
AC_MSG_ERROR(no. Could not guess appropriate value for $1 and $2)
fi
fi
fi
AC_ARG_VAR($1,[$5])
AC_ARG_VAR($2,[$6])
])
AC_DEFUN([THEPEG_CHECK_PREFIXDIR],
[AC_MSG_CHECKING([if $1 is set])
if test -z "$$1"; then
if test -d $prefix/$2; then
$1=$prefix/$2
elif test -d $ac_default_prefix/$2; then
$1=$ac_default_prefix/$2
elif test -d /usr/$2; then
$1=/usr/$2
elif test -d /$2; then
$1=/$2
else
AC_MSG_ERROR(no. Could not guess appropriate value for $1)
fi
AC_MSG_RESULT([no (using $$1)])
else
AC_MSG_RESULT([yes ($$1)])
fi
AC_ARG_VAR($1,[$3])
])
AC_DEFUN([THEPEG_CHECK_ENVDEFAULT],
[AC_MSG_CHECKING([if $1 is set])
if test -z "$$1"; then
$1="$2"
AC_MSG_RESULT([no (using $$1)])
else
AC_MSG_RESULT([yes ($$1)])
fi
AC_ARG_VAR($1,[$3])
])
AC_DEFUN([THEPEG_DEFINE_ENVDEFAULT],
[AC_MSG_CHECKING([if $2 is set])
if test -z "$$2"; then
$2="$3"
AC_MSG_RESULT([no (using $$2)])
else
AC_MSG_RESULT([yes ($$2)])
fi
AC_ARG_VAR($2,[$4])
AC_DEFINE_UNQUOTED($1,"$$2",[$4])
])
AC_DEFUN([THEPEG_CHECK_EXPM1],
[echo $ECHO_N "checking for expm1... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>
]], [[expm1(1.0);
]])],[AC_DEFINE(ThePEG_HAS_EXPM1,1,define if expm1 is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_LOG1P],
[echo $ECHO_N "checking for log1p... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>
]], [[log1p(1.0);
]])],[AC_DEFINE(ThePEG_HAS_LOG1P,1,define if log1p is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_AIDA],
[
AC_REQUIRE([THEPEG_CHECK_RIVET])
echo $ECHO_N "checking for installed AIDA headers... $ECHO_C" 1>&6
dnl if test "x$with_rivet" != "xno"; then
dnl echo "using rivet aida"
dnl LWHINCLUDE="\$(RIVETINCLUDE)/LWH"
dnl else
LWHINCLUDE="-I\$(top_builddir)/include/ThePEG/Analysis/LWH"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "AIDA/IAnalysisFactory.h"
]], [[AIDA::IAnalysisFactory * af;
]])],[AC_DEFINE(LWH_USING_AIDA,1,define if AIDA headers are installed)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])
dnl fi
AC_SUBST([LWHINCLUDE])
])
AC_DEFUN([THEPEG_CHECK_DLOPEN],
[echo $ECHO_N "checking for dlopen... $ECHO_C" 1>&6
# do this with libtool!
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>
]], [[dlopen("", 1);
]])],[AC_DEFINE(ThePEG_HAS_DLOPEN,1,define if dlopen is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_SSTREAM],
[echo $ECHO_N "checking for <sstream>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sstream>
]], [[std::ostringstream os;
]])],[AC_DEFINE(ThePEG_HAS_SSTREAM,1,define if sstream is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_FPUCONTROL],
[echo $ECHO_N "checking for <fpu_control>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fpu_control.h>
]], [[fpu_control_t cw; _FPU_GETCW(cw); cw &= ~(_FPU_MASK_IM|_FPU_MASK_DM|_FPU_MASK_ZM|_FPU_MASK_OM); _FPU_SETCW(cw);
]])],[AC_DEFINE(ThePEG_HAS_FPU_CONTROL,1,define if fpucontrol is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_FENV],
[echo $ECHO_N "checking for <fenv.h>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fenv.h>
]], [[feenableexcept(FE_DIVBYZERO|FE_OVERFLOW|FE_INVALID);]])],[AC_DEFINE(ThePEG_HAS_FENV,1,define if fenv is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_ADD_THEPEG_PATH],
[if test "$THEPEGBUILD" == "yes"; then
if test -f "../$2/Config/config.h"; then
$1="\$(top_builddir)/../$2/lib"
SETUPTHEPEG="$SETUPTHEPEG -L\$(top_builddir)/../$2/lib"
RUNTHEPEG="$RUNTHEPEG -L\$(top_builddir)/../$2/lib"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)/../$2/include"
fi
else
$1="$THEPEGLIB"
fi
AC_SUBST($1)
])
AC_DEFUN([THEPEG_HAS_JAVA],
[ hasjava=yes
AC_PATH_PROG(JAVAC, javac)
AC_PATH_PROG(JAVA, java)
AC_PATH_PROG(JAR, jar)
if test -z "$JAR" -o -z "$JAVA" -o -z "$JAVAC"; then hasjava=no; else
AC_MSG_CHECKING([if java works])
echo 'public class conftest { public static void main(String[[]]arg){}}' > conftest.java
$JAVAC -source $1 conftest.java 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
echo "Main-Class: conftest" > conftest.manifest
$JAR cmf conftest.manifest conftest.jar conftest.class 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
$JAVA -jar conftest.jar 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
rm -f conftest.java conftest.err conftest.class conftest.manifest conftest.jar
fi
if test "x$hasjava" != "xno"; then
AC_MSG_RESULT([yes])
$2
else
AC_MSG_RESULT([no])
$3
fi
])
AC_DEFUN([THEPEG_LIBTOOL_VERSION_INFO],
[ LIBTOOLVERSIONINFO="-version-info $1:$2:$3"
AC_SUBST(LIBTOOLVERSIONINFO)])
AC_DEFUN([THEPEG_UNIT_CHECKING],
[
AC_MSG_CHECKING([whether to include dimension checking])
AC_ARG_ENABLE(unitchecks,
AC_HELP_STRING([--enable-unitchecks],[turns on dimension checking for physical quantities.]),
[],
[enable_unitchecks=no]
)
AC_MSG_RESULT([$enable_unitchecks])
if test "x$enable_unitchecks" = "xyes"; then
AC_DEFINE([ThePEG_HAS_UNITS_CHECKING],[1],[define if units should be checked])
fi
])
AC_DEFUN([THEPEG_CHECK_GSL],
[
AC_MSG_CHECKING([for gsl location])
GSLINCLUDE=""
GSLLIBS=""
AC_ARG_WITH(gsl,
AC_HELP_STRING([--with-gsl=path],[location of gsl installation. Default: system lib]),
[],
[with_gsl=system])
if test "x$with_gsl" = "xno"; then
AC_MSG_ERROR([libgsl is required. Please install the GNU scientific library and header files.])
fi
if test "x$with_gsl" = "xsystem"; then
AC_MSG_RESULT([in system libraries])
oldlibs="$LIBS"
AC_CHECK_LIB(m,sqrt)
AC_CHECK_LIB(gslcblas,cblas_srot)
AC_CHECK_LIB(gsl,gsl_ran_poisson,[],
[
AC_MSG_ERROR([Cannot find libgsl. Please install the GNU scientific library.])
]
)
GSLLIBS="$LIBS"
LIBS=$oldlibs
else
if test "`uname -m`" = "x86_64" -a -e "$with_gsl/lib64/libgsl.a" -a -d "$with_gsl/include/gsl"; then
AC_MSG_RESULT([found in $with_gsl])
GSLLIBS="-L$with_gsl/lib64 -R$with_gsl/lib64 -lgsl -lgslcblas"
GSLINCLUDE="-I$with_gsl/include"
elif test -e "$with_gsl/lib/libgsl.a" -a -d "$with_gsl/include/gsl"; then
AC_MSG_RESULT([found in $with_gsl])
GSLLIBS="-L$with_gsl/lib -R$with_gsl/lib -lgsl -lgslcblas"
GSLINCLUDE="-I$with_gsl/include"
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Can't find $with_gsl/lib/libgsl.a or the headers in $with_gsl/include])
fi
fi
dnl AM_CONDITIONAL(HAVE_GSL,[test "x$with_HepMC" != "xno"])
AC_SUBST(GSLINCLUDE)
AC_SUBST(GSLLIBS)
])
AC_DEFUN([THEPEG_OVERVIEW],
[
CXXSTRING=`$CXX --version | head -1`
cat << _THEPEG_EOF_ > config.thepeg
*****************************************************
*** $PACKAGE_STRING configuration summary
*** Please include this information in bug reports!
***--------------------------------------------------
*** Prefix: $prefix
***
*** Dimension checks: $enable_unitchecks
***
*** GSL: $with_gsl
***
*** LHAPDF: $with_LHAPDF
*** HepMC: $with_hepmc
*** Rivet: $with_rivet
+*** FastJet: $with_fastjet
***
*** Host: $host
*** CXX: $CXXSTRING
*****************************************************
_THEPEG_EOF_
])

File Metadata

Mime Type
text/x-diff
Expires
Sun, Feb 23, 3:07 PM (28 m, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4486849
Default Alt Text
(35 KB)

Event Timeline