[Rivet-svn] rivet: Start to template new fill machinery.

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


details:   https://rivet.hepforge.org/hg/rivet/rev/20da11cc3921
branches:  multiweight
changeset: 5572:20da11cc3921
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Tue Oct 25 14:54:40 2016 +0100
description:
Start to template new fill machinery.

diffs (truncated from 151 to 50 lines):

--- a/include/Rivet/Tools/RivetYODA.hh	Tue Oct 25 14:24:15 2016 +0100
+++ b/include/Rivet/Tools/RivetYODA.hh	Tue Oct 25 14:54:40 2016 +0100
@@ -140,8 +140,14 @@
             virtual YODA::AnalysisObjectPtr activeYODAPtr() const = 0;
     };
 
-    typedef pair<double,double> Fill;
-    typedef multiset<pair<double,double>> Fills;
+
+
+template <class T>
+    using Fill = pair<typename T::FillType, double>;
+
+template <class T>
+    using Fills = multiset<Fill<T>>;
+
 
 class Histo1DTuple : public YODA::Histo1D {
 public:
@@ -156,13 +162,21 @@
         fills_.clear();
     }
 
-    const Fills & fills() const { return fills_; }
+    const Fills<YODA::Histo1D> & fills() const { return fills_; }
 
 private:
     // x / weight pairs 
-    Fills fills_;
+    Fills<YODA::Histo1D> fills_;
 };
 
+
+
+
+
+
+
+
+
 #define RIVETAOPTR_COMMON(YODATYPE)                                            \
     typedef shared_ptr<YODATYPE##Tuple> YODATYPE##TuplePtr;                    \
                                                                                \
--- a/src/Tools/RivetYODA.cc	Tue Oct 25 14:24:15 2016 +0100
+++ b/src/Tools/RivetYODA.cc	Tue Oct 25 14:54:40 2016 +0100
@@ -50,8 +50,10 @@
   using Rivet::Fill;
   using Rivet::Fills;
 
-  void fillAllPersistent(const vector<YODA::Histo1DPtr> & persistent, 


More information about the Rivet-svn mailing list