diff --git a/Tests/python/merge-SppS.in b/Tests/python/merge-SppS.in new file mode 100644 --- /dev/null +++ b/Tests/python/merge-SppS.in @@ -0,0 +1,174 @@ +#! @PYTHON@ +from __future__ import print_function +import logging, sys, math + +if sys.version_info[:3] < (2,4,0): + print ("rivet scripts require Python version >= 2.4.0... exiting") + sys.exit(1) + +import os, yoda, copy + +# # ############################################# + +def useOne(hpath, sqrts): + global inhistos + global outhistos + try: + outhistos[hpath] = inhistos[hpath][float(sqrts)] + except: + pass + +if __name__ == "__main__": + import logging + from optparse import OptionParser, OptionGroup + parser = OptionParser(usage="%prog name") + verbgroup = OptionGroup(parser, "Verbosity control") + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", + default=logging.INFO, help="print debug (very verbose) messages") + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", + default=logging.INFO, help="be very quiet") + parser.add_option_group(verbgroup) + (opts, args) = parser.parse_args() + logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s") + + ## Check args + if len(args) < 1: + logging.error("Must specify at least the name of the files") + sys.exit(1) + +####################################### + +name=args[0].replace("SppS","") +yodafiles=["ISR%s-44-UE.yoda" %name, + "ISR%s-62-UE.yoda" %name, + "SppS%s-63-UE.yoda" %name, + "ISR%s-30-UE.yoda" %name, + "ISR%s-53-UE.yoda" %name, + "SppS%s-200-UE.yoda"%name, + "SppS%s-500-UE.yoda"%name, + "SppS%s-900-UE.yoda"%name, + "SppS%s-546-UE.yoda"%name, + "SppS%s-53-UE.yoda" %name, + "EHS%s-UE.yoda" %name] + +## Get histos +inhistos = {} +outhistos={} +for fname in yodafiles: + file = 'Rivet-'+fname + if(file.find("44")>0) : + sqrts=44 + elif(file.find("63")>0) : + sqrts=63 + elif(file.find("30")>0) : + sqrts=30 + elif(file.find("53")>0) : + sqrts=53 + elif(file.find("200")>0) : + sqrts=200 + elif(file.find("500")>0) : + sqrts=500 + elif(file.find("900")>0) : + sqrts=900 + elif(file.find("546")>0) : + sqrts=546 + elif(file.find("53")>0) : + sqrts=53 + elif(file.find("EHS")>0) : + sqrts=math.sqrt(2.*.938*250.) + if not os.access(file, os.R_OK): + logging.error("%s can not be read" % file) + continue + try: + aos = yoda.read(file) + except: + logging.error("%s can not be parsed as yoda" % file) + continue + ## Get histos from this YODA file + for aopath, ao in aos.items() : + if("RAW" in aopath) :continue + if(aopath.find("1926373")>0 or aopath.find("1867512")>0 or + aopath.find("1583476")>0 or aopath.find("2044935")>0 or + aopath.find("1178091")>0 ) : + if aopath not in inhistos: + inhistos[aopath] = {} + if sqrts not in inhistos: + inhistos[aopath][sqrts] = ao + else: + raise Exception("A set with sqrts = %s already exists" % ( sqrts)) + else : + outhistos[aopath] = ao + +# UA5_1989_S1926373 +useOne("/UA5_1989_S1926373/d01-x01-y01","200") +useOne("/UA5_1989_S1926373/d02-x01-y01","900") +useOne("/UA5_1989_S1926373/d03-x01-y01","200") +useOne("/UA5_1989_S1926373/d04-x01-y01","200") +useOne("/UA5_1989_S1926373/d05-x01-y01","200") +useOne("/UA5_1989_S1926373/d06-x01-y01","200") +useOne("/UA5_1989_S1926373/d07-x01-y01","900") +useOne("/UA5_1989_S1926373/d08-x01-y01","900") +useOne("/UA5_1989_S1926373/d09-x01-y01","900") +useOne("/UA5_1989_S1926373/d10-x01-y01","900") +useOne("/UA5_1989_S1926373/d11-x01-y01","200") +useOne("/UA5_1989_S1926373/d12-x01-y01","900") +# UA5_1988_S1867512 +useOne("/UA5_1988_S1867512/d02-x01-y01","200") +useOne("/UA5_1988_S1867512/d02-x01-y02","546") +useOne("/UA5_1988_S1867512/d02-x01-y03","900") +useOne("/UA5_1988_S1867512/d03-x01-y01","200") +useOne("/UA5_1988_S1867512/d03-x01-y02","546") +useOne("/UA5_1988_S1867512/d03-x01-y03","900") +# UA5_1986_S1583476 +useOne("/UA5_1986_S1583476/d01-x01-y01","200") +useOne("/UA5_1986_S1583476/d01-x01-y02","200") +useOne("/UA5_1986_S1583476/d01-x01-y03","900") +useOne("/UA5_1986_S1583476/d01-x01-y04","900") +useOne("/UA5_1986_S1583476/d02-x01-y01","200") +useOne("/UA5_1986_S1583476/d02-x01-y02","200") +useOne("/UA5_1986_S1583476/d02-x01-y03","200") +useOne("/UA5_1986_S1583476/d02-x01-y04","200") +useOne("/UA5_1986_S1583476/d02-x01-y05","200") +useOne("/UA5_1986_S1583476/d02-x01-y06","200") +useOne("/UA5_1986_S1583476/d03-x01-y01","900") +useOne("/UA5_1986_S1583476/d03-x01-y02","900") +useOne("/UA5_1986_S1583476/d03-x01-y03","900") +useOne("/UA5_1986_S1583476/d03-x01-y04","900") +useOne("/UA5_1986_S1583476/d03-x01-y05","900") +useOne("/UA5_1986_S1583476/d03-x01-y06","900") +useOne("/UA5_1986_S1583476/d03-x01-y07","900") +useOne("/UA5_1986_S1583476/d03-x01-y08","900") +useOne("/UA5_1986_S1583476/d03-x01-y09","900") +# UA1_1990_S2044935 +useOne("/UA1_1990_S2044935/d01-x01-y01","200") +useOne("/UA1_1990_S2044935/d01-x01-y02","500") +useOne("/UA1_1990_S2044935/d01-x01-y03","900") +useOne("/UA1_1990_S2044935/d02-x01-y01","200") +useOne("/UA1_1990_S2044935/d02-x01-y02","500") +useOne("/UA1_1990_S2044935/d02-x01-y03","900") +useOne("/UA1_1990_S2044935/d03-x01-y01","900") +useOne("/UA1_1990_S2044935/d04-x01-y01","900") +useOne("/UA1_1990_S2044935/d05-x01-y01","900") +useOne("/UA1_1990_S2044935/d06-x01-y01","200") +useOne("/UA1_1990_S2044935/d07-x01-y01","900") +useOne("/UA1_1990_S2044935/d08-x01-y01","63") +useOne("/UA1_1990_S2044935/d09-x01-y01","200") +useOne("/UA1_1990_S2044935/d10-x01-y01","500") +useOne("/UA1_1990_S2044935/d11-x01-y01","900") +useOne("/UA1_1990_S2044935/d12-x01-y01","200") +useOne("/UA1_1990_S2044935/d12-x01-y02","500") +useOne("/UA1_1990_S2044935/d12-x01-y03","900") +# SFM_1984_S1178091 +useOne("/SFM_1984_S1178091/d01-x01-y01","30") +useOne("/SFM_1984_S1178091/d01-x01-y02","44") +useOne("/SFM_1984_S1178091/d01-x01-y03","53") +useOne("/SFM_1984_S1178091/d01-x01-y04","63") +useOne("/SFM_1984_S1178091/d02-x01-y01","30") +useOne("/SFM_1984_S1178091/d02-x01-y02","44") +useOne("/SFM_1984_S1178091/d02-x01-y03","53") +useOne("/SFM_1984_S1178091/d02-x01-y04","63") +# Choose output file +name = args[0]+".yoda" +# output the yoda file +yoda.writeYODA(outhistos,name) +sys.exit(0) diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1,270 +1,271 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) AC_INIT([Herwig],[devel],[herwig@projects.hepforge.org],[Herwig]) AC_CONFIG_SRCDIR([Utilities/HerwigStrategy.cc]) AC_CONFIG_AUX_DIR([Config]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([Config/config.h]) dnl AC_PRESERVE_HELP_ORDER AC_CANONICAL_HOST dnl === disable debug symbols by default ===== if test "x$CXXFLAGS" = "x"; then CXXFLAGS="-O2 -DBOOST_UBLAS_NDEBUG" fi if test "x$CFLAGS" = "x"; then CFLAGS=-O2 fi AC_LANG([C++]) AM_INIT_AUTOMAKE([1.11 subdir-objects gnu dist-bzip2 no-dist-gzip -Wall -Wno-portability]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Checks for C++ compiler. Handle C++11 flags. AC_PROG_CXX AX_CXX_COMPILE_STDCXX([11],[noext],[mandatory]) dnl check for POSIX AC_CHECK_HEADER([unistd.h],[], [AC_MSG_ERROR([Herwig needs "unistd.h". Non-POSIX systems are not supported.])]) AC_CHECK_HEADER([sys/stat.h],[], [AC_MSG_ERROR([Herwig needs "sys/stat.h". Non-POSIX systems are not supported.])]) dnl Checks for programs. AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S dnl modified search order AC_PROG_FC([gfortran g95 g77]) dnl xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 xlf f77 frt pgf77 cf77 fort77 fl32 af77]) AC_LANG_PUSH([Fortran]) AC_MSG_CHECKING([if the Fortran compiler ($FC) works]) AC_COMPILE_IFELSE( AC_LANG_PROGRAM([],[ print *[,]"Hello"]), [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([A Fortran compiler is required to build Herwig.]) ] ) AC_LANG_POP([Fortran]) AC_FC_WRAPPERS LT_PREREQ([2.2.6]) LT_INIT([disable-static dlopen pic-only]) dnl #################################### dnl #################################### dnl for Doc/fixinterfaces.pl AC_PATH_PROG(PERL, perl) dnl for Models/Feynrules AM_PATH_PYTHON([2.6],, [:]) AM_CONDITIONAL([HAVE_PYTHON], [test "x$PYTHON" != "x:"]) HERWIG_CHECK_GSL HERWIG_CHECK_THEPEG BOOST_REQUIRE([1.41]) BOOST_FIND_HEADER([boost/numeric/ublas/io.hpp]) dnl Boost 1.64 is missing a required header to make these work dnl we just assume they're there if io.hpp has been found OK above dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix.hpp]) dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix_proxy.hpp]) dnl BOOST_FIND_HEADER([boost/numeric/ublas/matrix_sparse.hpp]) dnl BOOST_FIND_HEADER([boost/numeric/ublas/symmetric.hpp]) dnl BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) BOOST_FIND_HEADER([boost/operators.hpp]) BOOST_TEST() HERWIG_CHECK_VBFNLO HERWIG_CHECK_NJET HERWIG_CHECK_GOSAM HERWIG_CHECK_GOSAM_CONTRIB HERWIG_CHECK_OPENLOOPS HERWIG_CHECK_MADGRAPH HERWIG_CHECK_EVTGEN HERWIG_CHECK_PYTHIA HERWIG_COMPILERFLAGS HERWIG_LOOPTOOLS FASTJET_CHECK_FASTJET HERWIG_ENABLE_MODELS SHARED_FLAG=-shared AM_CONDITIONAL(NEED_APPLE_FIXES, [test "xx${host/darwin/foundit}xx" != "xx${host}xx"]) if test "xx${host/darwin/foundit}xx" != "xx${host}xx"; then APPLE_DSO_FLAGS=-Wl,-undefined,dynamic_lookup SHARED_FLAG=-bundle fi AC_SUBST([APPLE_DSO_FLAGS]) AC_SUBST([SHARED_FLAG]) AC_SUBST([PYTHON]) AC_CONFIG_FILES([UnderlyingEvent/Makefile Models/Makefile Models/StandardModel/Makefile Models/RSModel/Makefile Models/General/Makefile Models/Susy/Makefile Models/Susy/NMSSM/Makefile Models/Susy/RPV/Makefile Models/UED/Makefile Models/LH/Makefile Models/DarkMatter/Makefile Models/LHTP/Makefile Models/Transplanckian/Makefile Models/Leptoquarks/Makefile Models/Zprime/Makefile Models/TTbAsymm/Makefile Models/Feynrules/Makefile Models/Feynrules/python/Makefile-FR Models/ADD/Makefile Models/Sextet/Makefile Decay/Makefile Decay/FormFactors/Makefile Decay/Tau/Makefile Decay/Baryon/Makefile Decay/VectorMeson/Makefile Decay/Perturbative/Makefile Decay/HeavyMeson/Makefile Decay/ScalarMeson/Makefile Decay/Dalitz/Makefile Decay/TensorMeson/Makefile Decay/WeakCurrents/Makefile Decay/Partonic/Makefile Decay/General/Makefile Decay/Radiation/Makefile Decay/EvtGen/Makefile Doc/refman.conf Doc/refman.h PDT/Makefile PDF/Makefile MatrixElement/Makefile MatrixElement/General/Makefile MatrixElement/Lepton/Makefile MatrixElement/Hadron/Makefile MatrixElement/DIS/Makefile MatrixElement/Powheg/Makefile MatrixElement/Gamma/Makefile MatrixElement/Reweighters/Makefile MatrixElement/Matchbox/Makefile MatrixElement/Matchbox/Base/Makefile MatrixElement/Matchbox/Utility/Makefile MatrixElement/Matchbox/Phasespace/Makefile MatrixElement/Matchbox/Dipoles/Makefile MatrixElement/Matchbox/InsertionOperators/Makefile MatrixElement/Matchbox/Matching/Makefile MatrixElement/Matchbox/Cuts/Makefile MatrixElement/Matchbox/Scales/Makefile MatrixElement/Matchbox/ColorFull/Makefile MatrixElement/Matchbox/CVolver/Makefile MatrixElement/Matchbox/Builtin/Makefile MatrixElement/Matchbox/Builtin/Amplitudes/Makefile MatrixElement/Matchbox/Tests/Makefile MatrixElement/Matchbox/External/Makefile MatrixElement/Matchbox/External/BLHAGeneric/Makefile MatrixElement/Matchbox/External/VBFNLO/Makefile MatrixElement/Matchbox/External/NJet/Makefile MatrixElement/Matchbox/External/GoSam/Makefile MatrixElement/Matchbox/External/OpenLoops/Makefile MatrixElement/Matchbox/External/MadGraph/Makefile MatrixElement/Matchbox/External/MadGraph/mg2herwig MatrixElement/Matchbox/External/GoSam/gosam2herwig.py MatrixElement/FxFx/Makefile Sampling/Makefile Sampling/CellGrids/Makefile Shower/Makefile Shower/QTilde/Makefile Shower/QTilde/Matching/Makefile Shower/Dipole/Makefile Shower/Dipole/Base/Makefile Shower/Dipole/Kernels/Makefile Shower/Dipole/Kinematics/Makefile Shower/Dipole/Utility/Makefile Shower/Dipole/AlphaS/Makefile Shower/Dipole/SpinCorrelations/Makefile Utilities/Makefile Utilities/XML/Makefile Utilities/Statistics/Makefile Hadronization/Makefile lib/Makefile include/Makefile src/Makefile src/defaults/Makefile src/snippets/Makefile src/Matchbox/Makefile src/herwig-config Doc/Makefile Doc/HerwigDefaults.in Looptools/Makefile Analysis/Makefile API/Makefile src/Makefile-UserModules src/defaults/Analysis.in src/defaults/MatchboxDefaults.in src/defaults/Decays.in src/defaults/decayers.in src/defaults/setup.gosam.in src/Matchbox/LO-DefaultShower.in src/Matchbox/LO-DipoleShower.in src/Matchbox/MCatLO-DefaultShower.in src/Matchbox/MCatLO-DipoleShower.in src/Matchbox/LO-NoShower.in src/Matchbox/MCatNLO-DefaultShower.in src/Matchbox/MCatNLO-DipoleShower.in src/Matchbox/NLO-NoShower.in src/Matchbox/Powheg-DefaultShower.in src/Matchbox/Powheg-DipoleShower.in src/Merging/Makefile Shower/Dipole/Merging/Makefile src/defaults/MatchboxMergingDefaults.in Contrib/Makefile Contrib/make_makefiles.sh Tests/Makefile Makefile]) AC_CONFIG_FILES([Tests/python/rivet_check ],[chmod +x Tests/python/rivet_check ]) AC_CONFIG_FILES([Tests/python/LowEnergy-EE.py ],[chmod +x Tests/python/LowEnergy-EE.py ]) AC_CONFIG_FILES([Tests/python/LowEnergy-Photon.py],[chmod +x Tests/python/LowEnergy-Photon.py]) AC_CONFIG_FILES([Tests/python/make_input_files.py],[chmod +x Tests/python/make_input_files.py]) AC_CONFIG_FILES([Tests/python/merge-DIS ],[chmod +x Tests/python/merge-DIS ]) AC_CONFIG_FILES([Tests/python/merge-EE ],[chmod +x Tests/python/merge-EE ]) AC_CONFIG_FILES([Tests/python/merge-EE-Gamma ],[chmod +x Tests/python/merge-EE-Gamma ]) AC_CONFIG_FILES([Tests/python/merge-Fixed ],[chmod +x Tests/python/merge-Fixed ]) AC_CONFIG_FILES([Tests/python/merge-GammaGamma ],[chmod +x Tests/python/merge-GammaGamma ]) AC_CONFIG_FILES([Tests/python/merge-LHC-EW ],[chmod +x Tests/python/merge-LHC-EW ]) AC_CONFIG_FILES([Tests/python/merge-LHC-Jets ],[chmod +x Tests/python/merge-LHC-Jets ]) AC_CONFIG_FILES([Tests/python/merge-LHC-Photon ],[chmod +x Tests/python/merge-LHC-Photon ]) AC_CONFIG_FILES([Tests/python/mergeLowEnergy.py ],[chmod +x Tests/python/mergeLowEnergy.py ]) AC_CONFIG_FILES([Tests/python/merge-Star ],[chmod +x Tests/python/merge-Star ]) +AC_CONFIG_FILES([Tests/python/merge-SppS ],[chmod +x Tests/python/merge-SppS ]) AC_CONFIG_FILES([Tests/python/merge-TVT-EW ],[chmod +x Tests/python/merge-TVT-EW ]) AC_CONFIG_FILES([Tests/python/merge-TVT-Jets ],[chmod +x Tests/python/merge-TVT-Jets ]) AC_CONFIG_FILES([Tests/python/merge-TVT-Photon ],[chmod +x Tests/python/merge-TVT-Photon ]) AC_CONFIG_FILES([Tests/python/plot-EE ],[chmod +x Tests/python/plot-EE ]) AC_CONFIG_FILES([Tests/python/R.py ],[chmod +x Tests/python/R.py ]) AC_CONFIG_FILES([Sampling/herwig-mergegrids.py ],[chmod +x Sampling/herwig-mergegrids.py ]) AC_CONFIG_LINKS([Doc/BSMlibs.in:Doc/BSMlibs.in]) AC_CONFIG_FILES([Doc/fixinterfaces.pl],[chmod +x Doc/fixinterfaces.pl]) AC_CONFIG_HEADERS([PDF/SaSPhotonPDF.cc]) HERWIG_OVERVIEW AC_CONFIG_COMMANDS([summary],[cat config.herwig]) AC_OUTPUT