[Rivet-svn] rivet: Add binding to a pre-loaded analysis object if possible i...

Rivet Mercurial rivet at projects.hepforge.org
Tue May 2 16:30:01 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/47bdb638546d
branches:  
changeset: 5739:47bdb638546d
user:      Andy Buckley <andy at insectnation.org>
date:      Tue May 02 16:18:56 2017 +0100
description:
Add binding to a pre-loaded analysis object if possible in Analysis::bookHisto1D() methods.

diffs (truncated from 170 to 50 lines):

--- a/ChangeLog	Tue May 02 12:31:31 2017 +0100
+++ b/ChangeLog	Tue May 02 16:18:56 2017 +0100
@@ -1,5 +1,7 @@
 2017-05-02  Andy Buckley  <andy.buckley at cern.ch>
 
+	* Add binding to a pre-loaded analysis object if possible in Analysis::bookHisto1D() methods.
+
 	* Add AnalysisHandler::addData and readData methods for histo preloading.
 
 	* Extend and improve string functions for path handling.
--- a/include/Rivet/Analysis.hh	Tue May 02 12:31:31 2017 +0100
+++ b/include/Rivet/Analysis.hh	Tue May 02 16:18:56 2017 +0100
@@ -345,19 +345,8 @@
     //@{
 
     /// Get reference data for a named histo
-    /// @todo Move to the templated version when we have C++11 and can have a default fn template type
-    const YODA::Scatter2D& refData(const string& hname) const;
-
-    /// Get reference data for a numbered histo
-    /// @todo Move to the templated version when we have C++11 and can have a default fn template type
-    const YODA::Scatter2D& refData(unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId) const;
-
-    /// Get reference data for a named histo
-    /// @todo Would be nice to just use these and ditch the S2D no-template version,
-    ///   but we need C++11 for default args in function templates
-    // template <typename T=Scatter2D>
     /// @todo SFINAE to ensure that the type inherits from YODA::AnalysisObject?
-    template <typename T>
+    template <typename T=Scatter2D>
     const T& refData(const string& hname) const {
       _cacheRefData();
       MSG_TRACE("Using histo bin edges for " << name() << ":" << hname);
@@ -369,11 +358,8 @@
     }
 
     /// Get reference data for a numbered histo
-    /// @todo Would be nice to just use these and ditch the S2D no-template version,
-    ///   but we need C++11 for default args in function templates
-    // template <typename T=Scatter2D>
     /// @todo SFINAE to ensure that the type inherits from YODA::AnalysisObject?
-    template <typename T>
+    template <typename T=Scatter2D>
     const T& refData(unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId) const {
       const string hname = makeAxisCode(datasetId, xAxisId, yAxisId);
       return refData(hname);
@@ -833,9 +819,7 @@
     void addAnalysisObject(AnalysisObjectPtr ao);
 
     /// Get a data object from the histogram system


More information about the Rivet-svn mailing list