|
[Rivet-svn] r4318 - trunk/testblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue May 28 20:11:09 BST 2013
Author: buckley Date: Tue May 28 20:11:09 2013 New Revision: 4318 Log: Improving/fixing the test program builds Modified: trunk/test/Makefile.am trunk/test/testApi.cc Modified: trunk/test/Makefile.am ============================================================================== --- trunk/test/Makefile.am Tue May 28 19:33:30 2013 (r4317) +++ trunk/test/Makefile.am Tue May 28 20:11:09 2013 (r4318) @@ -1,25 +1,18 @@ check_PROGRAMS = testMath testMatVec testBoost testCmp testApi testNaN -testBoost_SOURCES = testBoost.cc -testBoost_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) +AM_LDFLAGS = -L$(top_srcdir)/src -L$(prefix)/lib $(BOOST_LDFLAGS) $(YAMLCPP_LDFLAGS) $(YODA_LDFLAGS) +LIBS = -lm $(GSL_LDFLAGS) -lYODA +testBoost_SOURCES = testBoost.cc testMath_SOURCES = testMath.cc -testMath_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) - testMatVec_SOURCES = testMatVec.cc -testMatVec_LDADD = -lm $(GSL_LDFLAGS) -testMatVec_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) testCmp_SOURCES = testCmp.cc -testCmp_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) - +testCmp_LDADD = $(top_builddir)/src/libRivet.la $(HEPMCLDFLAGS) $(HEPMCLDLIBS) testApi_SOURCES = testApi.cc -testApi_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) -testApi_LDADD = ../src/libRivet.la $(HEPMCLDFLAGS) $(HEPMCLDLIBS) - +testApi_LDADD = $(top_builddir)/src/libRivet.la $(HEPMCLDFLAGS) $(HEPMCLDLIBS) testNaN_SOURCES = testNaN.cc -testNaN_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS) -testNaN_LDADD = ../src/libRivet.la $(HEPMCLDFLAGS) $(HEPMCLDLIBS) +testNaN_LDADD = $(top_builddir)/src/libRivet.la $(HEPMCLDFLAGS) $(HEPMCLDLIBS) TESTS_ENVIRONMENT = \ RIVET_REF_PATH=$(top_builddir)/data/refdata \ Modified: trunk/test/testApi.cc ============================================================================== --- trunk/test/testApi.cc Tue May 28 19:33:30 2013 (r4317) +++ trunk/test/testApi.cc Tue May 28 20:11:09 2013 (r4318) @@ -5,16 +5,12 @@ using namespace std; int main() { - // New type - Rivet::AnalysisHandler rivet; + Rivet::AnalysisHandler ah; // Specify the analyses to be used - rivet.addAnalysis("EXAMPLE"); - // rivet.addAnalysis("D0_2008_S7554427"); - - //vector<string> moreanalyses(1, "D0_2007_S7075677"); + ah.addAnalysis("EXAMPLE"); vector<string> moreanalyses(1, "MC_JETS"); - rivet.addAnalyses(moreanalyses); + ah.addAnalyses(moreanalyses); std::istream* file = new std::fstream("testApi.hepmc", std::ios::in); HepMC::IO_GenEvent hepmcio(*file); @@ -22,7 +18,7 @@ double sum_of_weights = 0.0; while (evt) { // Analyse current event - rivet.analyze(*evt); + ah.analyze(*evt); sum_of_weights += evt->weights()[0]; // Clean up and get next event @@ -31,10 +27,10 @@ } delete file; file = 0; - rivet.setCrossSection(1.0); - rivet.setSumOfWeights(sum_of_weights); //< Not necessary, but allowed - rivet.finalize(); - rivet.writeData("out.aida"); + ah.setCrossSection(1.0); + ah.setSumOfWeights(sum_of_weights); //< Not necessary, but allowed + ah.finalize(); + ah.writeData("out.yoda"); return 0; }
More information about the Rivet-svn mailing list |