[Rivet-svn] r3439 - in branches/2011-07-aida2yoda: . bin data/anainfo src/Analyses test

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Oct 12 23:45:19 BST 2011


Author: buckley
Date: Wed Oct 12 23:45:19 2011
New Revision: 3439

Log:
Merging trunk changes from r3410:3437

Added:
   branches/2011-07-aida2yoda/test/testMath.cc
      - copied unchanged from r3437, trunk/test/testMath.cc
Modified:
   branches/2011-07-aida2yoda/ChangeLog
   branches/2011-07-aida2yoda/bin/rivet-buildplugin.in
   branches/2011-07-aida2yoda/bin/rivet-mkhtml
   branches/2011-07-aida2yoda/bin/root2flat
   branches/2011-07-aida2yoda/data/anainfo/MC_TTBAR.info
   branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc
   branches/2011-07-aida2yoda/src/Analyses/Makefile.am
   branches/2011-07-aida2yoda/test/Makefile.am
   branches/2011-07-aida2yoda/test/testMatVec.cc

Modified: branches/2011-07-aida2yoda/ChangeLog
==============================================================================
--- branches/2011-07-aida2yoda/ChangeLog	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/ChangeLog	Wed Oct 12 23:45:19 2011	(r3439)
@@ -1,10 +1,26 @@
+2011-10-12  Andy Buckley  <andy at insectnation.org>
+
+	* Adding a separate test program for non-matrix/vector math
+	functions, and adding a new set of int/float literal arg tests for
+	the inRange functions in it.
+
+	* Adding a jet multiplicity plot for jets with pT > 30 GeV to
+	MC_TTBAR.
+
 2011-10-11  Andy Buckley  <andy at insectnation.org>
 
 	* Removing SVertex.
 
+2011-10-11  James Monk    <jmonk at cern.ch>
+
+	* root2flat was missing the first bin (plus spurious last bin)
+
+	* My version of bash does not understand the pipe syntax |& in rivet-buildplugin
+
 2011-09-30  James Monk    <jmonk at cern.ch>
 
-	* Fix bug in ATLAS_2010_S8817804 that misidentified the akt4 jets as akt6
+	* Fix bug in ATLAS_2010_S8817804 that misidentified the akt4 jets
+	as akt6
 
 2011-09-29  Andy Buckley  <andy at insectnation.org>
 

Modified: branches/2011-07-aida2yoda/bin/rivet-buildplugin.in
==============================================================================
--- branches/2011-07-aida2yoda/bin/rivet-buildplugin.in	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/bin/rivet-buildplugin.in	Wed Oct 12 23:45:19 2011	(r3439)
@@ -1,10 +1,10 @@
-#! /usr/bin/env bash
+#!/usr/bin/env bash
 ## -*- sh -*-
 ## @configure_input@
 
 ## Print help
 PROG=$(basename $0)
-tmp=$(echo $* |& egrep -- '--\<help\>|-\<h\>')
+tmp=$(echo $* | egrep -- '--\<help\>|-\<h\>')
 if test $# -lt 1 || test -n "$tmp"; then
     echo "$PROG: compilation helper for Rivet analysis plugins"
     echo
@@ -81,8 +81,8 @@
 
 ## Get and check the library name
 libname=$1
-match1=$(basename "$libname" |& egrep '^.*\.so')
-match2=$(basename "$libname" |& egrep '^Rivet.*\.so')
+match1=$(basename "$libname" | egrep '^.*\.so')
+match2=$(basename "$libname" | egrep '^Rivet.*\.so')
 if test -n "$match1"; then
     if test -z "$match2"; then
         echo "Library name '$libname' does not have the required 'Rivet*.so' name pattern" 1>&2

Modified: branches/2011-07-aida2yoda/bin/rivet-mkhtml
==============================================================================
--- branches/2011-07-aida2yoda/bin/rivet-mkhtml	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/bin/rivet-mkhtml	Wed Oct 12 23:45:19 2011	(r3439)
@@ -53,6 +53,8 @@
                   default="PDF", help="use PDF as the vector plot format.")
 parser.add_option("--ps", dest="VECTORFORMAT", action="store_const", const="PS",
                   default="PDF", help="use PostScript as the vector plot format.")
+parser.add_option("--booklet", dest="BOOKLET", action="store_true",
+                  default=False, help="create booklet (currently only available for PDF with pdftk).")
 parser.add_option("-i", "--ignore-unvalidated", dest="IGNORE_UNVALIDATED", action="store_true",
                   default=False, help="ignore unvalidated analyses.")
 parser.add_option("-m", "--match", action="append", dest="PATHPATTERNS",
@@ -71,7 +73,7 @@
 
 
 ## Make output directory
-if os.path.exists(opts.OUTPUTDIR):
+if os.path.exists(opts.OUTPUTDIR) and not os.path.realpath(opts.OUTPUTDIR)==os.getcwd():
     import shutil
     shutil.rmtree(opts.OUTPUTDIR)
 try:
@@ -184,7 +186,10 @@
 
 index = open(os.path.join(opts.OUTPUTDIR, "index.html"), "w")
 index.write('<html>\n<head>\n<title>%s</title>\n%s</head>\n<body>' % (opts.TITLE, style))
-index.write('<h2>%s</h2>\n\n' % opts.TITLE)
+if opts.BOOKLET and opts.VECTORFORMAT=="PDF":
+    index.write('<h2><a href="booklet.pdf">%s</a></h2>\n\n' % opts.TITLE)
+else:
+    index.write('<h2>%s</h2>\n\n' % opts.TITLE)
 
 if opts.SINGLE:
     ## Write table of contents
@@ -293,3 +298,11 @@
         print "Calling make-plots with the following options:"
         print mp_cmd
     Popen(mp_cmd).wait()
+    if opts.BOOKLET and opts.VECTORFORMAT=="PDF":
+        bookletcmd = ["pdftk"]
+        for analysis in analyses:
+            anapath = os.path.join(opts.OUTPUTDIR, analysis)
+            bookletcmd += sorted(glob.glob("%s/*.pdf" % anapath))
+        bookletcmd += ["cat", "output", "%s/booklet.pdf" % opts.OUTPUTDIR]
+        print bookletcmd
+        Popen(bookletcmd).wait()

Modified: branches/2011-07-aida2yoda/bin/root2flat
==============================================================================
--- branches/2011-07-aida2yoda/bin/root2flat	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/bin/root2flat	Wed Oct 12 23:45:19 2011	(r3439)
@@ -149,7 +149,7 @@
     X = TGraph.GetX()
     Y = TGraph.GetY()
     for ii in xrange(TGraph.GetN()):
-        i = ii + 1
+        i = ii #+ 1
         xlow  = X[i] - TGraph.GetErrorXlow(i)
         xhigh = X[i] + TGraph.GetErrorXhigh(i)
         y     = Y[i]

Modified: branches/2011-07-aida2yoda/data/anainfo/MC_TTBAR.info
==============================================================================
--- branches/2011-07-aida2yoda/data/anainfo/MC_TTBAR.info	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/data/anainfo/MC_TTBAR.info	Wed Oct 12 23:45:19 2011	(r3439)
@@ -1,6 +1,6 @@
 Name: MC_TTBAR
 Summary: MC analysis for ttbar studies
-Status: UNVALIDATED
+Status: VALIDATED
 Authors:
  - Hendrik Hoeth <hendrik.hoeth at cern.ch>
  - Andy Buckley <andy.buckley at cern.ch>

Modified: branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc	Wed Oct 12 23:45:19 2011	(r3439)
@@ -39,6 +39,8 @@
       addProjection(MissingMomentum(fs), "MissingET");
 
       // Booking of histograms
+      _h_njets = bookHisto1D("jet_mult", 11, -0.5, 10.5);
+      //
       _h_jet_1_pT = bookHisto1D("jet_1_pT", 50, 0, 500);
       _h_jet_2_pT = bookHisto1D("jet_2_pT", 50, 0, 400);
       _h_jet_3_pT = bookHisto1D("jet_3_pT", 50, 0, 300);
@@ -103,6 +105,7 @@
       // Insist that the hardest 4 jets pass pT hardness cuts. If we don't find
       // at least 4 such jets, we abandon this event.
       const Jets jets = jetpro.jetsByPt(30*GeV);
+      _h_njets->fill(jets.size(), weight);
       double ht = 0.0;
       foreach (const Jet& j, jets) { ht += j.momentum().pT(); }
       _h_jet_HT->fill(ht/GeV, weight);
@@ -194,6 +197,7 @@
 
 
     void finalize() {
+      scale(_h_njets, 1/_sumwPassedLepJetMET);
       scale(_h_jet_1_pT, 1/_sumwPassedLepJetMET);
       scale(_h_jet_2_pT, 1/_sumwPassedLepJetMET);
       scale(_h_jet_3_pT, 1/_sumwPassedLepJetMET);
@@ -219,6 +223,7 @@
     // @name Histogram data members
     //@{
 
+    Histo1DPtr _h_njets;
     Histo1DPtr _h_jet_1_pT, _h_jet_2_pT, _h_jet_3_pT, _h_jet_4_pT;
     Histo1DPtr _h_jet_HT;
     Histo1DPtr _h_bjet_1_pT, _h_bjet_2_pT;

Modified: branches/2011-07-aida2yoda/src/Analyses/Makefile.am
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/Makefile.am	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/src/Analyses/Makefile.am	Wed Oct 12 23:45:19 2011	(r3439)
@@ -256,11 +256,11 @@
     MC_ZZJETS.cc \
     MC_LEADINGJETS.cc \
     MC_DIPHOTON.cc \
-    MC_SUSY.cc
+    MC_SUSY.cc \
+    MC_TTBAR.cc \
+    MC_XS.cc
 if ENABLE_UNVALIDATED
 RivetMCAnalyses_la_SOURCES += \
     MC_DIJET.cc \
-    MC_PHOTONJETUE.cc \
-    MC_TTBAR.cc \
-    MC_XS.cc
+    MC_PHOTONJETUE.cc
 endif

Modified: branches/2011-07-aida2yoda/test/Makefile.am
==============================================================================
--- branches/2011-07-aida2yoda/test/Makefile.am	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/test/Makefile.am	Wed Oct 12 23:45:19 2011	(r3439)
@@ -1,8 +1,11 @@
-check_PROGRAMS = testMatVec testBoost testCmp testApi
+check_PROGRAMS = testMath testMatVec testBoost testCmp testApi
 
 testBoost_SOURCES = testBoost.cc
 testBoost_CPPFLAGS = -I$(top_srcdir)/include $(AM_CPPFLAGS)
 
+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)
@@ -22,7 +25,7 @@
   PYTHON_BUILD_DIR=$(top_builddir)/pyext/build \
   PATH=$(top_builddir)/bin:$(PATH)
 
-TESTS = testMatVec testBoost testCmp testApi testCmdLine.sh
+TESTS = testMath testMatVec testBoost testCmp testApi testCmdLine.sh
 
 EXTRA_DIST = testApi.hepmc testCmdLine.sh
 

Modified: branches/2011-07-aida2yoda/test/testMatVec.cc
==============================================================================
--- branches/2011-07-aida2yoda/test/testMatVec.cc	Wed Oct 12 23:38:27 2011	(r3438)
+++ branches/2011-07-aida2yoda/test/testMatVec.cc	Wed Oct 12 23:45:19 2011	(r3439)
@@ -7,9 +7,9 @@
 #include "Rivet/Math/Matrices.hh"
 
 using namespace std;
+using namespace Rivet;
 
 int main() {
-  using namespace Rivet;
 
   FourVector a(1,0,0,0);
   cout << a << ": interval = " << a.invariant() << endl;
@@ -140,27 +140,5 @@
   cout << (ltY * ltX).boost() << endl;
   cout << (ltX * ltX.inverse()).boost() << endl;
 
-  ////////////
-
-  // Angle tests
-  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,1))/M_PI, 0.0));
-  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,1,0))/M_PI, 0.5));
-  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,-1))/M_PI, 1.0));
-  // Test with vectors of different magnitude
-  assert(fuzzyEquals(angle(FourMomentum(3,0,0,3), FourMomentum(1,0,0,1))/M_PI, 0.0));
-  assert(fuzzyEquals(angle(FourMomentum(5,0,0,5), FourMomentum(1,0,1,0))/M_PI, 0.5));
-  assert(fuzzyEquals(angle(FourMomentum(7,0,0,7), FourMomentum(1,0,0,-1))/M_PI, 1.0));
-
-  ////////////
-
-  linspace(0, 10, 50);
-  logspace(0.000001, 1.0, 50);
-
-  assert(isZero(1e-15));
-  assert(fuzzyEquals(1e-15, 0.0));
-  assert(fuzzyEquals(2.0, 2.0));
-  assert(!fuzzyEquals(1, 2.0));
-  assert(fuzzyGtrEquals(1.0, 1.0 - 1e-15));
-
   return EXIT_SUCCESS;
 }

Copied: branches/2011-07-aida2yoda/test/testMath.cc (from r3437, trunk/test/testMath.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2011-07-aida2yoda/test/testMath.cc	Wed Oct 12 23:45:19 2011	(r3439, copy of r3437, trunk/test/testMath.cc)
@@ -0,0 +1,43 @@
+#include <iostream>
+#include <limits>
+#include <cassert>
+
+#include "Rivet/Math/MathUtils.hh"
+#include "Rivet/Math/Vectors.hh"
+
+using namespace std;
+using namespace Rivet;
+
+int main() {
+
+  // Angle tests
+  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,1))/M_PI, 0.0));
+  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,1,0))/M_PI, 0.5));
+  assert(fuzzyEquals(angle(FourMomentum(1,0,0,1), FourMomentum(1,0,0,-1))/M_PI, 1.0));
+  // Test with vectors of different magnitude
+  assert(fuzzyEquals(angle(FourMomentum(3,0,0,3), FourMomentum(1,0,0,1))/M_PI, 0.0));
+  assert(fuzzyEquals(angle(FourMomentum(5,0,0,5), FourMomentum(1,0,1,0))/M_PI, 0.5));
+  assert(fuzzyEquals(angle(FourMomentum(7,0,0,7), FourMomentum(1,0,0,-1))/M_PI, 1.0));
+
+  ////////////
+
+  linspace(0, 10, 50);
+  logspace(0.000001, 1.0, 50);
+
+  inRange(1, 0, 2);
+  inRange(1, 0.0, 2);
+  inRange(1, 0, 2.0);
+  inRange(1, 0.0, 2.0);
+  inRange(1.0, 0, 2);
+  inRange(1.0, 0.0, 2);
+  inRange(1.0, 0, 2.0);
+  inRange(1.0, 0.0, 2.0);
+
+  assert(isZero(1e-15));
+  assert(fuzzyEquals(1e-15, 0.0));
+  assert(fuzzyEquals(2.0, 2.0));
+  assert(!fuzzyEquals(1, 2.0));
+  assert(fuzzyGtrEquals(1.0, 1.0 - 1e-15));
+
+  return EXIT_SUCCESS;
+}


More information about the Rivet-svn mailing list