[Rivet-svn] r3847 - in trunk: . bin include/Rivet/Math

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Jul 24 09:07:10 BST 2012


Author: buckley
Date: Tue Jul 24 09:07:09 2012
New Revision: 3847

Log:
Improvements/migrations to rivet-mkhtml and rivet-mkanalysis.

Modified:
   trunk/ChangeLog
   trunk/bin/rivet-mkanalysis
   trunk/bin/rivet-mkhtml
   trunk/include/Rivet/Math/Vector4.hh

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Mon Jul 23 20:52:14 2012	(r3846)
+++ trunk/ChangeLog	Tue Jul 24 09:07:09 2012	(r3847)
@@ -1,3 +1,7 @@
+2012-07-24  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Improvements/migrations to rivet-mkhtml and rivet-mkanalysis.
+
 2012-07-12  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Fix rivet-mkanalysis a bit for YODA compatibility.

Modified: trunk/bin/rivet-mkanalysis
==============================================================================
--- trunk/bin/rivet-mkanalysis	Mon Jul 23 20:52:14 2012	(r3846)
+++ trunk/bin/rivet-mkanalysis	Tue Jul 24 09:07:09 2012	(r3847)
@@ -163,7 +163,7 @@
     src = """\
 // -*- C++ -*-
 #include "Rivet/Analysis.hh"
-#include "Rivet/RivetAIDA.hh"
+#include "Rivet/RivetYODA.hh"
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/Projections/FinalState.hh"
 /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder...
@@ -216,7 +216,7 @@
 
       /// @todo Normalise, scale and otherwise manipulate histograms here
 
-      // scale(_h_YYYY, crossSection()/sumOfWeights()); # norm to cross section
+      // scale(_h_YYYY, crossSection()/sumOfWeights()); // norm to cross section
       // normalize(_h_YYYY); # normalize to unity
 
     }
@@ -234,7 +234,7 @@
     /// @name Histograms
     //@{
     Profile1DPtr _h_XXXX;
-    Histogram1DPtr _h_YYYY;
+    Histo1DPtr _h_YYYY;
     //@}
 %(INLINEMETHODS)s
 

Modified: trunk/bin/rivet-mkhtml
==============================================================================
--- trunk/bin/rivet-mkhtml	Mon Jul 23 20:52:14 2012	(r3846)
+++ trunk/bin/rivet-mkhtml	Tue Jul 24 09:07:09 2012	(r3847)
@@ -215,6 +215,8 @@
 import datetime
 timestamp = '<p>Generated at %s</p>\n' % datetime.datetime.now().strftime("%A, %d. %B %Y %I:%M%p")
 
+def _htmlify(s):
+    return s.replace("<","<").replace(">",">")
 
 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))
@@ -233,7 +235,7 @@
             summary = "%s (%s)" % (ana.summary(), analysis)
             if opts.IGNORE_UNVALIDATED and ana.status() != "VALIDATED":
                 continue
-        index.write('<li><a href="#%s">%s</a>\n' % (analysis, summary) )
+        index.write('<li><a href="#%s">%s</a>\n' % (analysis, _htmlify(summary)) )
     index.write('</ul>\n')
 
 for analysis in analyses:
@@ -258,9 +260,9 @@
         if opts.IGNORE_UNVALIDATED and ana.status().upper() != "VALIDATED":
             continue
     if opts.SINGLE:
-        index.write('\n<h3 style="clear:left; padding-top:2em;"><a name="%s">%s</a></h3>\n' % (analysis, summary) )
+        index.write('\n<h3 style="clear:left; padding-top:2em;"><a name="%s">%s</a></h3>\n' % (analysis, _htmlify(summary)) )
     else:
-        index.write('\n<h3><a href="%s/index.html" style="text-decoration:none;">%s</a></h3>\n' % (analysis, summary))
+        index.write('\n<h3><a href="%s/index.html" style="text-decoration:none;">%s</a></h3>\n' % (analysis, _htmlify(summary)))
     reflist = []
     if inspireid and inspireid !="NONE":
         reflist.append('<a href="http://inspirehep.net/record/%s">Spires</a>' % spiresid)
@@ -268,7 +270,7 @@
         reflist.append('<a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/hep/www?irn+%s">Spires</a>' % spiresid)
     reflist += references
     index.write('<p>%s</p>\n' % " | ".join(reflist))
-    index.write('<p style="font-size:smaller;">%s</p>\n' % description.replace("<","<").replace(">",">"))
+    index.write('<p style="font-size:smaller;">%s</p>\n' % _htmlify(description))
     anapath = os.path.join(opts.OUTPUTDIR, analysis)
     if not opts.SINGLE:
         if not os.path.exists(anapath):
@@ -282,11 +284,13 @@
                        (opts.OUTPUTDIR, analysis, style))
         anaindex.write('<h3>%s</h3>\n' % analysis)
         anaindex.write('<p><a href="../index.html">Back to index</a></p>\n')
-        anaindex.write('<p>\n  %s\n</p>\n' % summary)
+        anaindex.write('<p>\n  %s\n</p>\n' % _htmlify(summary))
     else:
         anaindex = index
 
     datfiles = glob.glob("%s/*.dat" % anapath)
+
+    anaindex.write('<div style="float:none; overflow:auto; width:100%">\n')
     for datfile in sorted(datfiles):
         obsname = os.path.basename(datfile).replace(".dat", "")
         pngfile = obsname+".png"
@@ -301,9 +305,10 @@
         anaindex.write('      <img src="%s">\n' % pngfile )
         anaindex.write('    </a></a>\n')
         anaindex.write('  </div>\n')
+    anaindex.write('</div>\n')
 
     if not opts.SINGLE:
-        anaindex.write("<br>%s</body>\n</html>\n" % timestamp)
+        anaindex.write('<div style="float:none">%s</body>\n</html></div>\n' % timestamp)
         anaindex.close()
 index.write('<br>%s</body>\n</html>' % timestamp)
 index.close()

Modified: trunk/include/Rivet/Math/Vector4.hh
==============================================================================
--- trunk/include/Rivet/Math/Vector4.hh	Mon Jul 23 20:52:14 2012	(r3846)
+++ trunk/include/Rivet/Math/Vector4.hh	Tue Jul 24 09:07:09 2012	(r3847)
@@ -903,7 +903,7 @@
   //@{
 
   /// Render a 4-vector as a string.
-  inline const string toString(const FourVector& lv) {
+  inline std::string toString(const FourVector& lv) {
     ostringstream out;
     out << "("  << (fabs(lv.t()) < 1E-30 ? 0.0 : lv.t())
         << "; " << (fabs(lv.x()) < 1E-30 ? 0.0 : lv.x())


More information about the Rivet-svn mailing list