diff --git a/Tests/Makefile.am b/Tests/Makefile.am
--- a/Tests/Makefile.am
+++ b/Tests/Makefile.am
@@ -1,373 +1,379 @@
 AM_LDFLAGS += -module -avoid-version -rpath /dummy/path/not/used
 
 EXTRA_DIST = Inputs python Rivet 
 
 EXTRA_LTLIBRARIES = LeptonTest.la GammaTest.la HadronTest.la DISTest.la
 
 if WANT_LIBFASTJET
 EXTRA_LTLIBRARIES += HadronJetTest.la LeptonJetTest.la
 HadronJetTest_la_SOURCES = \
 Hadron/VHTest.h Hadron/VHTest.cc\
 Hadron/VTest.h Hadron/VTest.cc\
 Hadron/HTest.h Hadron/HTest.cc
 HadronJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
 -I$(FASTJETPATH)
 HadronJetTest_la_LIBADD = $(FASTJETLIBS) 
 LeptonJetTest_la_SOURCES = \
 Lepton/TopDecay.h Lepton/TopDecay.cc
 LeptonJetTest_la_CPPFLAGS = $(AM_CPPFLAGS) $(FASTJETINCLUDE) \
 -I$(FASTJETPATH)
 LeptonJetTest_la_LIBADD = $(FASTJETLIBS) 
 endif
 
 LeptonTest_la_SOURCES = \
 Lepton/VVTest.h Lepton/VVTest.cc \
 Lepton/VBFTest.h Lepton/VBFTest.cc \
 Lepton/VHTest.h Lepton/VHTest.cc \
 Lepton/FermionTest.h Lepton/FermionTest.cc
 
 GammaTest_la_SOURCES = \
 Gamma/GammaMETest.h  Gamma/GammaMETest.cc \
 Gamma/GammaPMETest.h Gamma/GammaPMETest.cc
 
 DISTest_la_SOURCES = \
 DIS/DISTest.h  DIS/DISTest.cc
 
 HadronTest_la_SOURCES = \
 Hadron/HadronVVTest.h  Hadron/HadronVVTest.cc\
 Hadron/HadronVBFTest.h  Hadron/HadronVBFTest.cc\
 Hadron/WHTest.h  Hadron/WHTest.cc\
 Hadron/ZHTest.h  Hadron/ZHTest.cc\
 Hadron/VGammaTest.h  Hadron/VGammaTest.cc\
 Hadron/ZJetTest.h  Hadron/ZJetTest.cc\
 Hadron/WJetTest.h  Hadron/WJetTest.cc\
 Hadron/QQHTest.h  Hadron/QQHTest.cc
 
 
 REPO = $(top_builddir)/src/HerwigDefaults.rpo
 HERWIG = $(top_builddir)/src/Herwig
 HWREAD = $(HERWIG) read --repo $(REPO) -L $(builddir)/.libs -i $(top_builddir)/src
 HWBUILD = $(HERWIG) build --repo $(REPO) -L $(builddir)/.libs -i $(top_builddir)/src
 HWINTEGRATE = $(HERWIG) integrate
 HWRUN = $(HERWIG) run -N $${NUMEVENTS:-10000}
 
 
 tests : tests-LEP tests-DIS tests-LHC tests-Gamma
 
 
 LEPDEPS = \
 test-LEP-VV \
 test-LEP-VH \
 test-LEP-VBF \
 test-LEP-BB \
 test-LEP-Quarks \
 test-LEP-Leptons
 
 if WANT_LIBFASTJET
 LEPDEPS += test-LEP-TopDecay
 endif
 
 tests-LEP : $(LEPDEPS)
 
 tests-DIS : test-DIS-Charged test-DIS-Neutral
 
 
 LHCDEPS = \
 test-LHC-WW test-LHC-WZ test-LHC-ZZ \
 test-LHC-ZGamma test-LHC-WGamma \
 test-LHC-ZH test-LHC-WH \
 test-LHC-ZJet test-LHC-WJet \
 test-LHC-Z test-LHC-W \
 test-LHC-ZZVBF test-LHC-VBF \
 test-LHC-WWVBF \
 test-LHC-bbH test-LHC-ttH \
 test-LHC-GammaGamma test-LHC-GammaJet \
 test-LHC-Higgs test-LHC-HiggsJet \
 test-LHC-QCDFast test-LHC-QCD \
 test-LHC-Top
 
 
 if WANT_LIBFASTJET
 LHCDEPS += \
 test-LHC-Bottom \
 test-LHC-WHJet test-LHC-ZHJet test-LHC-HJet \
 test-LHC-ZShower test-LHC-WShower \
 test-LHC-WHJet-Powheg test-LHC-ZHJet-Powheg test-LHC-HJet-Powheg \
 test-LHC-ZShower-Powheg test-LHC-WShower-Powheg
 endif
 
 tests-LHC : $(LHCDEPS) 
 
 tests-Gamma : test-Gamma-FF test-Gamma-WW test-Gamma-P
 
 
 
 LEPLIBS = LeptonTest.la
 HADLIBS = HadronTest.la
 
 if WANT_LIBFASTJET 
 LEPLIBS += LeptonJetTest.la
 HADLIBS += HadronJetTest.la
 endif
 
 
 test-LEP-% : Inputs/LEP-%.in $(LEPLIBS)
 	$(HWREAD) $<
 	$(HWRUN) $(notdir $(subst .in,.run,$<))
 
 test-Gamma-% : Inputs/Gamma-%.in GammaTest.la
 	$(HWREAD) $<
 	$(HWRUN) $(notdir $(subst .in,.run,$<))
 
 test-DIS-% : Inputs/DIS-%.in DISTest.la
 	$(HWREAD) $<
 	$(HWRUN) $(notdir $(subst .in,.run,$<))
 
 test-LHC-% : Inputs/LHC-%.in GammaTest.la $(HADLIBS)
 	$(HWREAD) $<
 	$(HWRUN) $(notdir $(subst .in,.run,$<))
 
 
 
 tests-Rivet : Rivet-LEP Rivet-BFactory Rivet-DIS Rivet-Star Rivet-SppS \
 	      Rivet-TVT-WZ Rivet-TVT-Photon Rivet-TVT-Jets \
 	      Rivet-LHC-Jets Rivet-LHC-EW Rivet-LHC-Photon Rivet-LHC-Higgs
 
 Rivet-%.run : Rivet/%.in
 	$(HWBUILD) -c .cache/$(subst .run,,$@) $<
 
 Rivet-Matchbox-%.yoda : Rivet-Matchbox-%.run
 	$(HWINTEGRATE) -c .cache/$(subst .run,,$<) $<
 	$(HWRUN)       -c .cache/$(subst .run,,$<) $<
 
 Rivet-%.yoda : Rivet-%.run
 	$(HWRUN) $<
 
 Rivet/%.in :
 	python/make_input_files.py $(notdir $(subst .in,,$@))
 
 
 
 Rivet-inputfiles: $(shell echo Rivet/LEP{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{9.4,12,13,17,27.6,29,30.2,30.7,30.75,30,31.3,34.8,43.6,50,52,55,56,57,60.8,60,61.4,10,12.8,22,26.8,35,44,48.0,91,93.0,130,133,136,161,172,177,183,189,192,196,197,200,202,206,91-nopi}.in) \
                   $(shell echo Rivet/LEP{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Powheg,-Matchbox-Powheg}-14.in) \
 	          $(shell echo Rivet/LEP{,-Dipole}-{10.5,11.96,12.8,13.96,16.86,21.84,26.8,28.48,35.44,48.0,97.0}-gg.in) \
                   $(shell echo Rivet/BFactory{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg}-{10.52,10.52-sym,10.54,10.45}.in) \
                   $(shell echo Rivet/BFactory{,-Dipole}-{Upsilon,Upsilon2,Upsilon4,Tau,Phi,10.58-res}.in) \
                   $(shell echo Rivet/DIS{,-NoME,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{e--LowQ2,e+-LowQ2,e+-HighQ2}.in) \
                   $(shell echo Rivet/TVT{,-Powheg,-Matchbox,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox-Powheg,-Merging}-{Run-I-Z,Run-I-W,Run-I-WZ,Run-II-Z-e,Run-II-Z-{,LowMass-,HighMass-}mu,Run-II-W}.in) \
 	          $(shell echo Rivet/TVT{,-Dipole}-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet,PromptPhoton}.in) \
 	          $(shell echo Rivet/TVT-Powheg-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.in) \
                   $(shell echo Rivet/TVT{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{Run-II-Jets-{0..11},Run-I-Jets-{1..8}}.in ) \
 	          $(shell echo Rivet/TVT{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{630-Jets-{1..3},300-Jets-1,900-Jets-1}.in ) \
                   $(shell echo Rivet/TVT{,-Dipole}-{Run-I,Run-II,300,630,900}-UE.in) \
                   $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-DiJets-{1..7}-{A,B,C}.in ) \
                   $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-13-DiJets-{6..11}-A.in ) \
                   $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{7,8,13}-Jets-{0..10}.in ) \
 	          $(shell echo Rivet/LHC{,-Dipole}-{900,2360,2760,7,8,13}-UE.in ) \
 	          $(shell echo Rivet/LHC{,-Dipole}-{900,7,13}-UE-Long.in ) \
 		  $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Charm-{1..5}.in) \
 		  $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Bottom-{0..9}.in) \
 		  $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-7-Top-{L,SL}.in) \
 		  $(shell echo Rivet/LHC{,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Matchbox,-Matchbox-Powheg,-Merging}-{8,13}-Top-{All,L,SL}.in) \
                   $(shell echo Rivet/Star{,-Dipole}-{UE,Jets-{1..4}}.in ) \
 	          $(shell echo Rivet/SppS{,-Dipole}-{200,500,900,546}-UE.in ) \
                   $(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{W-{e,mu},13-Z-{e,mu},Z-HighMass{1,2}-e,{8,13}-W-mu,8-Z-Mass{1..4}-{e,mu},Z-{e,mu,mu-SOPHTY},Z-LowMass-{e,mu},Z-MedMass-e,WZ,WW-{emu,ll},ZZ-{ll,lv},{8,13}-WZ,8-ZZ-lv,8-WW-ll,Z-mu-Short}.in) \
                   $(shell echo Rivet/LHC{,-Dipole}-7-{W,Z}Gamma-{e,mu}.in) \
                   $(shell echo Rivet/LHC{,-Dipole}-8-ZGamma-{e,mu}.in) \
 	          $(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{7-W-Jet-{1..3}-e,7-Z-Jet-{0..3}-e,7-Z-Jet-0-mu}.in) \
 	          $(shell echo Rivet/LHC{-Matchbox,-Matchbox-Powheg,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{Z-b,Z-bb,8-Z-b,8-Z-bb,W-b,8-Z-jj}.in) \
 		  $(shell echo Rivet/LHC{,-Dipole}-{7,8,13}-PromptPhoton-{1..4}.in) Rivet/LHC-GammaGamma-7.in \
 	          $(shell echo Rivet/LHC{,-Powheg}-{7,8}-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.in) \
 	          $(shell echo Rivet/LHC{,-Powheg,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-{ggH,VBF,WH,ZH}.in) \
                   $(shell echo Rivet/LHC{,-Powheg,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-8-{{ggH,VBF,WH,ZH}{,-GammaGamma},ggH-WW}.in) \
                   $(shell echo Rivet/LHC{,-Matchbox,-Matchbox-Powheg,-Dipole,-Dipole-MCatNLO,-Dipole-Matchbox-Powheg,-Merging}-ggHJet.in)
 #                  $(shell echo Rivet/ISR-{30,44,53,62}-UE.in ) $(shell echo Rivet/SppS-{53,63}-UE.in )
 
 
 
 Rivet-LEP : Rivet-LEP/done
 	touch $@
 
 Rivet-LEP/done : $(shell echo Rivet{,-Powheg}-LEP-{9.4,12,13,14,17,27.6,29,30.2,30.7,30.75,30,31.3,34.8,43.6,50,52,55,56,57,60.8,60,61.4,10,12.8,22,26.8,35,44,48.0,91,93.0,130,133,136,161,172,177,183,189,192,196,197,200,202,206,91-nopi}.yoda) \
 	   $(shell echo Rivet-LEP-{10.5,11.96,12.8,13.96,16.86,21.84,26.8,28.48,35.44,48.0,97.0}-gg.yoda)
 	rm -rf Rivet-LEP
 	python/merge-LEP --with-gg LEP
 	python/merge-LEP LEP-Powheg
 	rivet-mkhtml -o Rivet-LEP LEP.yoda:Hw LEP-Powheg.yoda:Hw-Powheg
 	touch $@
 
 Rivet-LowEnergy-%.yoda:
 	$(HWBUILD) -c .cache/$(subst .yoda,,$@) Rivet/$(subst .yoda,.in,$@)
 	$(HWRUN)  $(subst .yoda,.run,$@) 
 
 Rivet-LowEnergy-%:
-	OUTPUT=`python/LowEnergy.py --process $(subst Rivet-LowEnergy-,,$@) --path ~/montecarlo/herwig/common/low-energy/lowenergy/rivet/ --non-perturbative --perturbative`; make -j12 $$OUTPUT NUMEVENTS=$${NUMEVENTS:-10000};
+	OUTPUT=`python/LowEnergy.py --process $(subst Rivet-LowEnergy-,,$@) --non-perturbative --perturbative`; make -j12 $$OUTPUT NUMEVENTS=$${NUMEVENTS:-10000};
 	python/mergeLowEnergy.py $(subst Rivet-LowEnergy-,,$@)
 	rivet-mkhtml -o Rivet-LowEnergy-$(subst Rivet-LowEnergy-,,$@) LowEnergy-EE-NonPerturbative-$(subst Rivet-LowEnergy-,,$@).yoda:"Non-Pert" LowEnergy-EE-Perturbative-$(subst Rivet-LowEnergy-,,$@).yoda:"Pert"
 
+Rivet-R:
+	OUTPUT=`python/R.py --perturbative`; make -j12 $$OUTPUT NUMEVENTS=$${NUMEVENTS:-10000};
+	python/mergeLowEnergy.py R
+	rivet-mkhtml -o Rivet-R LowEnergy-EE-Perturbative-R.yoda:"Pert"
+#LowEnergy-EE-NonPerturbative-R.yoda:"Non-Pert" 
+
 Rivet-BFactory : Rivet-BFactory/done
 	touch $@
 
 Rivet-BFactory/done: $(shell echo Rivet-BFactory-{10.52,10.52-sym,10.54,10.45,Upsilon,Upsilon2,Upsilon4,Tau,Phi,10.58-res,10.58}.yoda)
 	rm -rf Rivet-BFactory
 	python/merge-BFactory BFactory
 	rivet-mkhtml -o Rivet-BFactory BFactory.yoda:Hw
 	touch $@
 
 
 
 Rivet-DIS : Rivet-DIS/done
 	touch $@
 
 Rivet-DIS/done: $(shell echo Rivet{-DIS,-DIS-NoME,-Powheg-DIS}-{e--LowQ2,e+-LowQ2,e+-HighQ2}.yoda)
 	rm -rf Rivet-DIS
 	python/merge-DIS DIS 
 	python/merge-DIS Powheg-DIS
 	python/merge-DIS DIS-NoME
 	rivet-mkhtml -o Rivet-DIS DIS.yoda:Hw Powheg-DIS.yoda:Hw-Powheg DIS-NoME.yoda:Hw-NoME
 	touch $@
 
 
 
 Rivet-TVT-EW : Rivet-TVT-EW/done
 	touch $@
 
 Rivet-TVT-EW/done:  $(shell echo Rivet{,-Powheg}-TVT-{Run-I-Z,Run-I-W,Run-I-WZ,Run-II-Z-{e,{,LowMass-,HighMass-}mu},Run-II-W}.yoda)
 	rm -rf Rivet-TVT-EW
 	python/merge-TVT-EW TVT
 	python/merge-TVT-EW Powheg-TVT
 	rivet-mkhtml -o Rivet-TVT-EW TVT-EW.yoda:Hw Powheg-TVT-EW.yoda:Hw-Powheg
 	touch $@
 
 Rivet-TVT-Photon : Rivet-TVT-Photon/done
 	touch $@
 
 Rivet-TVT-Photon/done: $(shell echo Rivet{,-Powheg}-TVT-Run-II-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.yoda Rivet-TVT-Run-II-PromptPhoton.yoda)
 	rm -rf Rivet-TVT-Photon
 	python/merge-TVT-Photon TVT
 	python/merge-TVT-Photon Powheg-TVT
 	rivet-mkhtml -o Rivet-TVT-Photon TVT-Photon.yoda:Hw Powheg-TVT-Photon.yoda:Hw-Powheg
 	touch $@
 
 
 
 Rivet-TVT-Jets : Rivet-TVT-Jets/done
 	touch $@
 
 Rivet-TVT-Jets/done:  $(shell echo Rivet-TVT-{Run-II-Jets-{0..11},Run-I-Jets-{1..8}}.yoda ) \
 	         $(shell echo Rivet-TVT-{630-Jets-{1..3},300-Jets-1,900-Jets-1}.yoda ) \
                  $(shell echo Rivet-TVT-{Run-I,Run-II,300,630,900}-UE.yoda)
 	rm -rf Rivet-TVT-Jets
 	python/merge-TVT-Jets TVT
 	rivet-mkhtml -o Rivet-TVT-Jets TVT-Jets.yoda:Hw
 	touch $@
 
 Rivet-Star : Rivet-Star/done
 	touch $@
 
 Rivet-Star/done : $(shell echo Rivet-Star-{UE,Jets-{1..4}}.yoda ) 
 	rm -rf Rivet-Star
 	python/merge-Star Star
 	rivet-mkhtml -o Rivet-Star Star.yoda:Hw
 	touch $@
 
 
 
 Rivet-SppS : Rivet-SppS/done
 	touch $@
 
 ## $(shell echo Rivet-ISR-{30,44,53,62}-UE.yoda ) \
 ## {53,63,200,500,900,546} EHS-UE
 
 Rivet-SppS/done : $(shell echo Rivet-SppS-{200,500,900,546}-UE.yoda )
 	rm -rf Rivet-SppS
 	python/merge-SppS SppS
 	rivet-mkhtml -o Rivet-SppS SppS.yoda:Hw
 	touch $@
 
 
 
 
 
 
 Rivet-LHC-Jets : Rivet-LHC-Jets/done
 	touch $@
 
 Rivet-LHC-Jets/done : \
 	        $(shell echo Rivet-LHC-7-DiJets-{1..7}-{A,B,C}.yoda   ) \
 	        $(shell echo Rivet-LHC-13-DiJets-{6..11}-A.yoda   ) \
 	        $(shell echo Rivet-LHC-{7,8,13}-Jets-{0..10}.yoda     ) \
 	        $(shell echo Rivet-LHC-2760-Jets-{1..3}.yoda     ) \
 	        $(shell echo Rivet-LHC-{900,2360,2760,7,8,13}-UE.yoda ) \
 	        $(shell echo Rivet-LHC-{900,7,13}-UE-Long.yoda        ) \
 		$(shell echo Rivet-LHC-7-Charm-{1..5}.yoda            ) \
 		$(shell echo Rivet-LHC-7-Bottom-{0..9}.yoda           ) \
 		$(shell echo Rivet-LHC-{7,8,13}-Top-{L,SL}.yoda ) \
 		$(shell echo Rivet-LHC-{8,13}-Top-All.yoda )
 	rm -rf Rivet-LHC-Jets
 	python/merge-LHC-Jets LHC
 	rivet-mkhtml -o Rivet-LHC-Jets LHC-Jets.yoda:Hw
 	touch $@
 
 
 
 Rivet-LHC-EW : Rivet-LHC-EW/done
 	touch $@
 
 Rivet-LHC-EW/done: \
 		$(shell echo Rivet{,-Powheg}-LHC-{13-Z-{e,mu},{8,13}-W-mu,Z-HighMass{1,2}-e,8-Z-Mass{1..4}-{e,mu},W-{e,mu},Z-{e,mu,mu-SOPHTY},Z-LowMass-{e,mu},Z-MedMass-e,WZ,WW-{emu,ll},ZZ-{ll,lv},{8,13}-WZ,8-ZZ-lv,8-WW-ll,Z-mu-Short}.yoda) \
 		$(shell echo Rivet-LHC-{7-W-Jet-{1..3}-e,7-Z-Jet-{0..3}-e,7-Z-Jet-0-mu}.yoda) \
 		$(shell echo Rivet-LHC-7-{W,Z}Gamma-{e,mu}.yoda) \
 		$(shell echo Rivet-LHC-8-ZGamma-{e,mu}.yoda) 
 	rm -rf Rivet-LHC-EW;
 	python/merge-LHC-EW LHC
 	python/merge-LHC-EW Powheg-LHC
 	rivet-mkhtml -o Rivet-LHC-EW LHC-EW.yoda:Hw Powheg-LHC-EW.yoda:Hw-Powheg \
                                      Rivet-LHC-Z-mu-SOPHTY.yoda:Hw Rivet-Powheg-LHC-Z-mu-SOPHTY.yoda:Hw-Powheg
 	touch $@
 
 
 
 
 Rivet-LHC-Photon : Rivet-LHC-Photon/done
 	touch $@
 
 Rivet-LHC-Photon/done: \
 		$(shell echo Rivet-LHC-{7,8,13}-PromptPhoton-{1..4}.yoda) \
 		Rivet-LHC-GammaGamma-7.yoda \
 	    $(shell echo Rivet{,-Powheg}-LHC-{7,8}-{DiPhoton-GammaGamma,DiPhoton-GammaJet}.yoda)
 	rm -rf Rivet-LHC-Photon
 	python/merge-LHC-Photon LHC
 	python/merge-LHC-Photon Powheg-LHC
 	rivet-mkhtml -o Rivet-LHC-Photon LHC-Photon.yoda:Hw Powheg-LHC-Photon.yoda:Hw-Powheg
 	touch $@
 
 
 
 
 Rivet-LHC-Higgs : Rivet-LHC-Higgs/done
 	touch $@
 
 Rivet-LHC-Higgs/done:  \
 		$(shell echo Rivet{,-Powheg}-LHC-{ggH,VBF,WH,ZH}.yoda) \
         $(shell echo Rivet{,-Powheg}-LHC-8-{{ggH,VBF,WH,ZH}{,-GammaGamma},ggH-WW}.yoda) \
         Rivet-LHC-ggHJet.yoda
 	yodamerge --add Rivet-Powheg-LHC-8-{ggH{-GammaGamma,-WW,},{VBF,ZH,WH}{,-GammaGamma}}.yoda -o Powheg-LHC-Higgs.yoda
 	yodamerge --add Rivet-LHC-8-{ggH{-GammaGamma,-WW,},{VBF,ZH,WH}{,-GammaGamma}}.yoda -o LHC-Higgs.yoda
 	rm -rf Rivet-LHC-Higgs
 	rivet-mkhtml -o Rivet-LHC-Higgs Powheg-LHC-Higgs.yoda:Hw-Powheg LHC-Higgs.yoda:Hw\
 	                Rivet-Powheg-LHC-ggH.yoda:gg-Powheg Rivet-LHC-ggH.yoda:gg Rivet-LHC-ggHJet.yoda:HJet \
                         Rivet-Powheg-LHC-VBF.yoda:VBF-Powheg Rivet-LHC-VBF.yoda:VBF Rivet-LHC-WH.yoda:WH Rivet-LHC-ZH.yoda:ZH \
                         Rivet-Powheg-LHC-WH.yoda:WH-Powheg Rivet-Powheg-LHC-ZH.yoda:ZH-Powheg
 	touch $@
 
 
 
 
 
 clean-local:
 	rm -f *.out *.log *.tex *.top *.run *.dump *.mult *.Bmult *.yoda Rivet/*.in 
 	rm -rf Rivet-*
 
 distclean-local:
 	rm -rf .cache
diff --git a/Tests/python/R.py b/Tests/python/R.py
new file mode 100755
--- /dev/null
+++ b/Tests/python/R.py
@@ -0,0 +1,184 @@
+#! /usr/bin/env python
+import yoda,os,math,subprocess,optparse
+from string import Template
+# get the path for the rivet data
+p = subprocess.Popen(["rivet-config", "--datadir"],stdout=subprocess.PIPE)
+path=p.communicate()[0].strip()
+#Define the arguments
+op = optparse.OptionParser(usage=__doc__)
+op.add_option("--process"         , dest="processes"       , default=[], action="append")
+op.add_option("--path"            , dest="path"            , default=path)
+op.add_option("--non-perturbative", dest="nonPerturbative" , default=False, action="store_true")
+op.add_option("--perturbative"    , dest="perturbative"    , default=False, action="store_true")
+op.add_option("--dest"            , dest="dest"            , default="Rivet")
+opts, args = op.parse_args()
+path=opts.path
+# list of analyses
+analyses={}
+analyses["CLEO_2007_I753556"] = ["d01-x01-y01"]
+analyses["DASP_1978_I129715"] = ["d01-x01-y01"]
+analyses["CLEO_1984_I193577"] = ["d01-x01-y01"]
+analyses["AMY_1990_I294525" ] = ["d01-x01-y01"]
+analyses["BABAR_2009_I797507"] = ["d01-x01-y01"]
+analyses["TASSO_1982_I176887"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01"]
+analyses["CRYSTAL_BALL_1986_I238081"] = ["d01-x01-y01"]
+analyses["CRYSTAL_BALL_1990_I294419"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["CRYSTAL_BALL_1988_I261078"] = ["d01-x01-y01"]
+analyses["TOPAZ_1990_I283003"] = ["d01-x01-y01"]
+analyses["TOPAZ_1993_I353845"] = ["d02-x01-y01"]
+analyses["TOPAZ_1995_I381777"] = ["d01-x01-y01"]
+analyses["VENUS_1987_I251274"] = ["d01-x01-y01"]
+analyses["VENUS_1990_I283774"] = ["d01-x01-y01"]
+analyses["VENUS_1990_I296392"] = ["d03-x01-y01"]
+analyses["VENUS_1999_I500179"] = ["d01-x01-y01"]
+analyses["MD1_1986_I364141"] = ["d01-x01-y01"]
+analyses["MUPI_1972_I84978"] = ["d01-x01-y01"]
+analyses["MUPI_1973_I95215"] = ["d01-x01-y01"]
+analyses["NMD_1974_I745"] = ["d01-x01-y01"]
+analyses["GAMMAGAMMA_1979_I141722"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["MARKI_1975_I100733"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["MARKI_1977_I119979"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["MARKI_1976_I108144"] = ["d01-x01-y01"]
+analyses["DASP_1982_I178613"] = ["d02-x01-y01"]
+analyses["DESY147_1980_I153896"] = ["d01-x01-y01"]
+analyses["DESY147_1978_I131524"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["CLEO_1983_I188805"] = ["d01-x01-y01"]
+analyses["CLEO_1998_I445351"] = ["d01-x01-y01"]
+analyses["CLEO_1983_I188803"] = ["d02-x01-y01"]
+analyses["CLEOC_2008_I777917"] = ["d06-x01-y01","d06-x01-y02"]
+analyses["CLEO_2006_I700665"] = ["d01-x01-y01"]
+analyses["CUSB_1982_I180613"] = ["d03-x01-y01"]
+analyses["MAC_1985_I206052"] = ["d01-x01-y01"]
+analyses["MARKII_1991_I295286"] = ["d01-x01-y01"]
+analyses["MARKJ_1979_I141976"] = ["d01-x01-y01"]
+analyses["MARKJ_1980_I158857"] = ["d01-x01-y01"]
+analyses["MARKJ_1982_I166369"] = ["d01-x01-y01"]
+analyses["MARKJ_1983_I182337"] = ["d04-x01-y01"]
+analyses["MARKJ_1984_I196567"] = ["d01-x01-y01"]
+analyses["MARKJ_1986_I230297"] = ["d01-x01-y01"]
+analyses["LENA_1982_I179431"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01"]
+analyses["MARKII_1979_I143939"] = ["d02-x01-y01","d03-x01-y01"]
+analyses["ARGUS_1992_I319102"] = ["d01-x01-y01"]
+analyses["CELLO_1981_I166365"] = ["d01-x01-y01"]
+analyses["CELLO_1984_I202783"] = ["d02-x01-y01"]
+analyses["CELLO_1987_I236981"] = ["d01-x01-y01"]
+analyses["TASSO_1979_I140303"] = ["d01-x01-y01"]
+analyses["TASSO_1980_I143690"] = ["d01-x01-y01"]
+analyses["TASSO_1984_I199468"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["JADE_1987_I234905"] = ["d01-x01-y01"]
+analyses["PLUTO_1982_I166799"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["PLUTO_1979_I142517"] = ["d01-x01-y01"]
+analyses["PLUTO_1979_I140818"] = ["d02-x01-y01"]
+analyses["PLUTO_1979_I140294"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["PLUTO_1980_I152291"] = ["d01-x01-y01","d02-x01-y01"]
+analyses["BBAR_1980_I152630"] = ["d01-x01-y01"]
+analyses["BESII_2000_I505323"] = ["d01-x01-y01"]
+analyses["BESII_2002_I552757"] = ["d01-x01-y01"]
+analyses["BES_1995_I39870"] = ["d01-x01-y01"]
+analyses["BESII_2009_I814778"] = ["d01-x01-y01"]
+analyses["BESII_2006_I717665"] = ["d02-x01-y01"]
+analyses["GAMMAGAMMA_1979_I133588"] = ["d01-x01-y01","d01-x01-y02"]
+analyses["GAMMAGAMMA_1975_I100016"] = ["d01-x01-y01","d01-x01-y02"]
+analyses["GAMMAGAMMA_1973_I84794"] = ["d03-x01-y01","d04-x01-y01"]
+analyses["GAMMAGAMMA_1981_I158474"] = ["d02-x01-y01","d02-x01-y02","d01-x01-y05","d01-x01-y06"]
+analyses["TASSO_1984_I195333"] = ["d01-x01-y01","d04-x01-y01"]
+
+energies={}
+def nearestEnergy(en) :
+    Emin=0
+    delta=1e30
+    anals=[]
+    for val in energies :
+        if(abs(val-en)<delta) :
+            delta = abs(val-en)
+            Emin = val
+            anals=energies[val]
+    return (Emin,delta,anals)
+
+for analysis in analyses :
+    aos=yoda.read(os.path.join(os.path.join(os.getcwd(),path),analysis+".yoda"))
+    if(len(aos)==0) : continue
+    for plot in analyses[analysis] :
+        histo = aos["/REF/%s/%s" %(analysis,plot)]
+        for point in histo.points :
+            energy = point.x
+            if(energy>200) :
+                energy *= 0.001
+            emin,delta,anals = nearestEnergy(energy)
+            if(energy in energies) :
+                if(analysis not in energies[energy]) :
+                    energies[energy].append(analysis)
+            elif(delta<1e-7) :
+                if(analysis not in anals) :
+                    anals.append(analysis)
+            else :
+                energies[energy]=[analysis]
+
+if "MARKI_1975_I100733" in analyses :
+    for val in [3.0,4.8, 7.4] :
+        if val in energies :
+            if "MARKI_1975_I100733" not in energies[val] :
+               energies[val].append("MARKI_1975_I100733")
+        else:
+            energies[val] = ["MARKI_1975_I100733"]
+            
+if "ARGUS_1992_I319102" in analyses :
+    for val in [10.47,10.575] :
+        if val in energies :
+            if "ARGUS_1992_I319102" not in energies[val] :
+               energies[val].append("ARGUS_1992_I319102")
+        else:
+            energies[val] = ["ARGUS_1992_I319102"]
+
+if "BESII_2004_I622224" in analyses :
+    for val in [2.2,2.6,3.0,3.2,4.6,4.8] :
+        if val in energies :
+            energies[val].append("BESII_2004_I622224")
+        else:
+            energies[val] = ["BESII_2004_I622224"]
+
+if 10.52 in energies :
+    energies[10.52].append("BELLE_2017_I1606201")
+else :
+    energies[10.52] = ["BELLE_2017_I1606201"]
+
+
+# set up the templates
+with open("python/LowEnergy-EE-Perturbative.in", 'r') as f:
+    templateText = f.read()
+perturbative=Template( templateText )
+with open("python/LowEnergy-EE-NonPerturbative.in", 'r') as f:
+    templateText = f.read()
+nonPerturbative=Template( templateText )
+
+
+# lepton matrix element
+lepton_me="insert SubProcess:MatrixElements 0 MEee2gZ2ll\nset MEee2gZ2ll:Allowed Muon\n"
+# low energy matrix element
+mes = ["MEee2Pions","MEee2Kaons","MEee3Pions","MEee4Pions",
+       "MEee2EtaPiPi","MEee2OmegaPi","MEee2PhiPi","MEee2PiGamma",
+       "MEee2EtaGamma","MEee2ppbar","MEee2KStarK"]
+proc=lepton_me
+for matrix in mes :
+    proc+="insert SubProcess:MatrixElements 0 %s\n" % matrix
+
+targets=""
+for energy in sorted(energies) :
+    anal=""
+    for analysis in energies[energy]: 
+        anal+= "insert /Herwig/Analysis/Rivet:Analyses 0 %s\n" %analysis
+    # input file for perturbative QCD
+    if(opts.perturbative) :
+        inputPerturbative = perturbative.substitute({"ECMS" : "%8.6f" % energy, "ANALYSES" : anal,
+                                                     "lepton" : lepton_me})
+        with open(opts.dest+"/Rivet-LowEnergy-EE-Perturbative-%8.6f.in" % energy ,'w') as f:
+            f.write(inputPerturbative)
+        targets += "Rivet-LowEnergy-EE-Perturbative-%8.6f.yoda " % energy
+    # input file for currents
+    if(opts.nonPerturbative) :
+        inputNonPerturbative = nonPerturbative.substitute({"ECMS" : "%8.6f" % energy, "ANALYSES" : anal,
+                                                           "processes" : proc})
+        with open(opts.dest+"/Rivet-LowEnergy-EE-NonPerturbative-%8.6f.in" % energy ,'w') as f:
+            f.write(inputNonPerturbative)
+        targets += "Rivet-LowEnergy-EE-NonPerturbative-%8.6f.yoda " % energy
+print targets
diff --git a/Tests/python/mergeLowEnergy.py b/Tests/python/mergeLowEnergy.py
--- a/Tests/python/mergeLowEnergy.py
+++ b/Tests/python/mergeLowEnergy.py
@@ -1,63 +1,65 @@
 #! /usr/bin/env python
 import yoda,glob,math,optparse
 op = optparse.OptionParser(usage=__doc__)
 
 opts, args = op.parse_args()
 
 if(len(args)!=1) :
     print 'Must be one and only 1 name'
     quit()
 
 
 for runType in ["NonPerturbative","Perturbative"]:
     outhistos={}
     for fileName in glob.glob("Rivet-LowEnergy-EE-%s-*.yoda" % runType):
         energy = float(fileName.split("-")[-1].strip(".yoda"))
         energyMeV = energy*1000.
         aos = yoda.read(fileName)
         for hpath,histo in aos.iteritems():
             if("/_" in hpath or "TMP" in hpath) : continue
+            if(type(histo)==yoda.core.Histo1D) :
+                outhistos[hpath] = histo
+                continue
             # create histo if it doesn't exist
-            if(hpath not in outhistos) :
+            elif(hpath not in outhistos) :
                 outhistos[hpath] = yoda.core.Scatter2D(histo.path,
                                                        histo.title)
             matched = False
             for i in range(0,aos[hpath].numPoints) :
                 x = aos[hpath].points[i].x
                 delta=1e-5
                 if("KLOE_2009_I797438" in hpath or "KLOE_2005_I655225" in hpath or
                    "FENICE_1994_I377833" in hpath):
                    x=math.sqrt(x)
                    delta=1e-3
                 if(abs(x-energy)<1e-3*delta or abs(x-energyMeV)<delta) :
                     duplicate = False
                     for j in range(0,outhistos[hpath].numPoints) :
                         if(outhistos[hpath].points[j].x==aos[hpath].points[i].x) :
                             duplicate = True
                             break
                     if(not duplicate) :
                         outhistos[hpath].addPoint(aos[hpath].points[i])
                     matched = True
                     break
             if(matched) : continue
             for i in range(0,aos[hpath].numPoints) :
                 xmin = aos[hpath].points[i].xMin
                 xmax = aos[hpath].points[i].xMax
                 if("KLOE_2009_I797438" in hpath or "KLOE_2005_I655225" in hpath or
                    "FENICE_1994_I377833" in hpath) :
                    xmin=math.sqrt(xmin)
                    xmax=math.sqrt(xmax)
                 if((energy    > xmin and energy    < xmax) or
                    (energyMeV > xmin and energyMeV < xmax) ) :
                     duplicate = False
-                    print 'found point',energy,xmin,xmax
                     for j in range(0,outhistos[hpath].numPoints) :
                         if(outhistos[hpath].points[j].x==aos[hpath].points[i].x) :
                             duplicate = True
                             break
                     if(not duplicate) :
                         outhistos[hpath].addPoint(aos[hpath].points[i])
                     break
     if len(outhistos) == 0: continue
     yoda.writeYODA(outhistos,"LowEnergy-EE-%s-%s.yoda" % (runType,args[0]))