[Rivet-svn] rivet: Intermediate commit.

Rivet Mercurial rivet at projects.hepforge.org
Tue Oct 25 15:15:01 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/b8ac7d6452f1
branches:  multiweight
changeset: 5573:b8ac7d6452f1
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Tue Oct 25 15:12:59 2016 +0100
description:
Intermediate commit.

diffs (truncated from 98 to 50 lines):

--- a/src/Tools/RivetYODA.cc	Tue Oct 25 14:54:40 2016 +0100
+++ b/src/Tools/RivetYODA.cc	Tue Oct 25 15:12:59 2016 +0100
@@ -58,7 +58,9 @@
       persistent[m]->fill( x, w * weight[m] );
     }
   }
-    double get_window_size(const YODA::Histo1DPtr & histo,
+
+    template <class T>
+    double get_window_size(const typename T::Ptr & histo,
                          double x) {
         // the bin index we fall in
         const auto binidx = histo->binIndexAt(x);
@@ -71,7 +73,7 @@
 
         // if we don't have a valid neighbouring bin,
         // we use infinite width
-        YODA::HistoBin1D b1(-1.0/0.0, 1.0/0.0);
+        typename T::Bin b1(-1.0/0.0, 1.0/0.0);
 
         // points in the top half compare to the upper neighbour
         if ( x > b.xMid() ) {
@@ -96,7 +98,7 @@
       double maxwindow = 0.0;
       for ( const auto & xi : x ) {
         // check for NOFILL here
-        double window = get_window_size(persistent, xi.first);
+        double window = get_window_size<T>(persistent, xi.first);
         if ( window > maxwindow )
           maxwindow = window;
       }
@@ -134,6 +136,14 @@
         persistent->fill( get<0>(f), get<1>(f), get<2>(f)/sumf );
         // Note the scaling to one single fill
     }
+  }
+
+    template <class T>
+    T distance(T a, T b) {
+      return abs(a - b);
+    }
+
+
 }
 
 
@@ -173,7 +183,7 @@
       if ( subev[i] == NOFILL ) continue;
       int j = i;
       while ( j + 1 < maxfill && subev[j + 1] == NOFILL &&


More information about the Rivet-svn mailing list