[Rivet-svn] rivet: Store genevent weights as valarray.

Rivet Mercurial rivet at projects.hepforge.org
Thu Oct 27 00:00:01 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/81bfdc1c7d6e
branches:  multiweight
changeset: 5588:81bfdc1c7d6e
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Wed Oct 26 23:59:06 2016 +0100
description:
Store genevent weights as valarray.

diffs (truncated from 147 to 50 lines):

--- a/include/Rivet/AnalysisHandler.hh	Wed Oct 26 23:32:08 2016 +0100
+++ b/include/Rivet/AnalysisHandler.hh	Wed Oct 26 23:59:06 2016 +0100
@@ -214,7 +214,7 @@
 
     /// Weight names
     std::vector<std::string> _weightNames;
-    std::vector<std::vector<double> > _subEventWeights;
+    std::vector<std::valarray<double> > _subEventWeights;
     size_t _numWeightTypes; // always == WeightVector.size()
 
     /// Run name
--- a/include/Rivet/Event.hh	Wed Oct 26 23:32:08 2016 +0100
+++ b/include/Rivet/Event.hh	Wed Oct 26 23:59:06 2016 +0100
@@ -87,7 +87,7 @@
     ///
     /// @todo This needs to be revisited when we finally add the mechanism to
     /// support NLO counter-events and weight vectors.
-    std::vector<double> weights() const;
+    std::valarray<double> weights() const;
 
     /// @brief Obsolete weight method. Always returns 1 now.
     [[deprecated("Event weight does not need to be included anymore. For compatibility, it's always == 1 now.")]]
--- a/include/Rivet/Tools/RivetYODA.hh	Wed Oct 26 23:32:08 2016 +0100
+++ b/include/Rivet/Tools/RivetYODA.hh	Wed Oct 26 23:59:06 2016 +0100
@@ -136,7 +136,7 @@
             /// rename to setActive(Idx)?
             virtual void setActiveWeightIdx(unsigned int iWeight) = 0;
 
-            virtual void pushToPersistent(const vector<vector<double> >& weight) = 0;
+            virtual void pushToPersistent(const vector<valarray<double> >& weight) = 0;
 
             virtual YODA::AnalysisObjectPtr activeYODAPtr() const = 0;
     };
@@ -353,7 +353,7 @@
         }
 
         /* to be implemented for each type */
-        void pushToPersistent(const vector<vector<double> >& weight);
+        void pushToPersistent(const vector<valarray<double> >& weight);
 
         /* M of these, one for each weight */
         vector<typename T::Ptr> _persistent;
--- a/src/Core/Event.cc	Wed Oct 26 23:32:08 2016 +0100
+++ b/src/Core/Event.cc	Wed Oct 26 23:59:06 2016 +0100
@@ -106,13 +106,12 @@
   }
 
 
-  vector<double> Event::weights() const {
-    vector<double> v;


More information about the Rivet-svn mailing list