[Rivet-svn] rivet: adding TupleWrapper instance for Histo1D and removing def...

Rivet Mercurial rivet at projects.hepforge.org
Wed Oct 26 11:00:02 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/3fd56ea219e3
branches:  multiweight
changeset: 5578:3fd56ea219e3
user:      Chris Pollard <cspollard at gmail.com>
date:      Wed Oct 26 10:45:44 2016 +0100
description:
adding TupleWrapper instance for Histo1D and removing default implementation.

diffs (40 lines):

--- a/include/Rivet/Tools/RivetYODA.hh	Wed Oct 26 10:38:13 2016 +0100
+++ b/include/Rivet/Tools/RivetYODA.hh	Wed Oct 26 10:45:44 2016 +0100
@@ -157,26 +157,22 @@
 // TODO TODO TODO
 
 template <class T>
-class TupleWrapper : public T {
+class TupleWrapper;
+
+template<>
+class TupleWrapper<YODA::Histo1D> : public YODA::Histo1D {
 public:
-    typedef shared_ptr<TupleWrapper> Ptr;
-
-    TupleWrapper(const T & h) : T(h) {}
-
+    typedef shared_ptr<TupleWrapper<YODA::Histo1D>> Ptr;
+    TupleWrapper(const YODA::Histo1D & h) : YODA::Histo1D(h) {}
     // todo: do we need to deal with users using fractions directly?
-    void fill(typename T::FillType x, double weight=1.0, double fraction=1.0) {
-        fills_.insert( {x, weight} );
+    void fill( double x, double weight=1.0, double fraction=1.0 ) {
+        fills_.insert( { x , weight } );
     }
-
-    void reset() {
-        fills_.clear();
-    }
-
-    const Fills<T> & fills() const { return fills_; }
-
+    void reset() { fills_.clear(); }
+    const Fills<YODA::Histo1D> & fills() const { return fills_; }
 private:
     // x / weight pairs 
-    Fills<T> fills_;
+    Fills<YODA::Histo1D> fills_;
 };
 
 template<>


More information about the Rivet-svn mailing list