[Rivet-svn] r1768 - in trunk: include/Rivet src

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Aug 19 17:46:01 BST 2009


Author: fsiegert
Date: Wed Aug 19 17:46:01 2009
New Revision: 1768

Log:
Allow for setting the sum of weights from outside, so that one can use
Rivet for analysing sub-contributions in one run.

Modified:
   trunk/include/Rivet/AnalysisHandler.hh
   trunk/src/AnalysisHandler.cc

Modified: trunk/include/Rivet/AnalysisHandler.hh
==============================================================================
--- trunk/include/Rivet/AnalysisHandler.hh	Wed Aug 19 14:53:27 2009	(r1767)
+++ trunk/include/Rivet/AnalysisHandler.hh	Wed Aug 19 17:46:01 2009	(r1768)
@@ -70,6 +70,12 @@
     /// or analyses in the finalize phase.
     double sumOfWeights() const;
 
+    /// Set sum of weights. This is useful if Rivet is steered externally and
+    /// the analyses are run for a sub-contribution of the events
+    /// (but of course have to be normalised to the total sum of weights)
+    void setSumOfWeights(const double& sum);
+      
+
     /// Get a list of the currently registered analyses' names.
     std::vector<std::string> analysisNames();
 

Modified: trunk/src/AnalysisHandler.cc
==============================================================================
--- trunk/src/AnalysisHandler.cc	Wed Aug 19 14:53:27 2009	(r1767)
+++ trunk/src/AnalysisHandler.cc	Wed Aug 19 17:46:01 2009	(r1768)
@@ -218,6 +218,10 @@
   size_t AnalysisHandler::numEvents() const { return _numEvents; }
   double AnalysisHandler::sumOfWeights() const { return _sumOfWeights; }
   
+  void AnalysisHandler::setSumOfWeights(const double& sum) {
+    _sumOfWeights=sum;
+  }
+  
   
   std::vector<std::string> AnalysisHandler::analysisNames() {
     std::vector<std::string> rtn;


More information about the Rivet-svn mailing list