[Rivet-svn] r3199 - in branches/2011-07-aida2yoda: include/Rivet pyext/rivet src/Core

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Jul 19 12:27:42 BST 2011


Author: dgrell
Date: Tue Jul 19 12:27:42 2011
New Revision: 3199

Log:
addPlot added, not used yet

Modified:
   branches/2011-07-aida2yoda/include/Rivet/Analysis.hh
   branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh
   branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh
   branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh
   branches/2011-07-aida2yoda/pyext/rivet/rivetwrap.i
   branches/2011-07-aida2yoda/src/Core/Analysis.cc
   branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc

Modified: branches/2011-07-aida2yoda/include/Rivet/Analysis.hh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/Analysis.hh	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/include/Rivet/Analysis.hh	Tue Jul 19 12:27:42 2011	(r3199)
@@ -500,6 +500,10 @@
 
     //@}
 
+    /// List of registered plot objects
+    const vector<AnalysisObjectPtr> & plots() const {
+      return _plotobjects;
+    }
 
   private:
 
@@ -520,6 +524,9 @@
 
   protected:
 
+    /// Add a plot object to the final output list
+    void addPlot(AnalysisObjectPtr);
+
     /// Name passed to constructor (used to find .info analysis data file, and as a fallback)
     string _defaultname;
 
@@ -529,6 +536,9 @@
 
   private:
 
+    /// Storage of all plot objects
+    vector<AnalysisObjectPtr> _plotobjects;
+
     /// @name Cross-section variables
     //@{
     double _crossSection;

Modified: branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh	Tue Jul 19 12:27:42 2011	(r3199)
@@ -170,24 +170,9 @@
 
     //@}
 
-
-    /// @name AIDA factories etc.
-    /// @deprecated All this will be removed when histogramming is overhauled
-    //@{
-
-    /// Commit the AIDA tree to file.
-    /// @deprecated When AIDA goes, this goes...
-    void commitData();
-
-
-    /// Write the AIDA tree to the named file.
-    /// @deprecated When AIDA goes, this goes...
+    /// Write all analyses' plots to the named file.
     void writeData(const std::string& filename);
 
-
-    //@}
-
-
   private:
 
     /// The collection of Analysis objects to be used.

Modified: branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh	Tue Jul 19 12:27:42 2011	(r3199)
@@ -12,6 +12,7 @@
 
 namespace YODA {
    class AnalysisObject;
+   class WriterYODA;
    class Histo1D;
    class Profile1D;
 //   class IHistogram2D;

Modified: branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh	Tue Jul 19 12:27:42 2011	(r3199)
@@ -10,6 +10,7 @@
 #include "Rivet/Rivet.hh"
 #include "Rivet/RivetYODA.fhh"
 #include "YODA/AnalysisObject.h"
+#include "YODA/WriterYODA.h"
 #include "YODA/Histo1D.h"
 #include "YODA/Profile1D.h"
 
@@ -38,6 +39,7 @@
   //   return intg;
   // }
 
+  using YODA::WriterYODA;
   using YODA::Histo1D;
   using YODA::Profile1D;
   // using AIDA::IHistogram2D;

Modified: branches/2011-07-aida2yoda/pyext/rivet/rivetwrap.i
==============================================================================
--- branches/2011-07-aida2yoda/pyext/rivet/rivetwrap.i	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/pyext/rivet/rivetwrap.i	Tue Jul 19 12:27:42 2011	(r3199)
@@ -138,7 +138,6 @@
     bool needCrossSection();
     AnalysisHandler& setCrossSection(double xs);
     double crossSection();
-    void commitData();
     void writeData(const std::string& filename);
   };
 

Modified: branches/2011-07-aida2yoda/src/Core/Analysis.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Core/Analysis.cc	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/src/Core/Analysis.cc	Tue Jul 19 12:27:42 2011	(r3199)
@@ -5,12 +5,8 @@
 #include "Rivet/AnalysisInfo.hh"
 #include "Rivet/Analysis.hh"
 #include "Rivet/Tools/Logging.hh"
-#include "LWH/AIManagedObject.h"
-using namespace AIDA;
 
 namespace Rivet {
-
-
   namespace {
     string makeAxisCode(const size_t datasetId, const size_t xAxisId, const size_t yAxisId) {
       stringstream axisCode;
@@ -587,5 +583,8 @@
   //   histo = 0;
   // }
 
+  void Analysis::addPlot(AnalysisObjectPtr ao) {
+    _plotobjects.push_back(ao);
+  }
 
 }

Modified: branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc	Tue Jul 19 12:26:33 2011	(r3198)
+++ branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc	Tue Jul 19 12:27:42 2011	(r3199)
@@ -3,13 +3,10 @@
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/ParticleName.hh"
 #include "Rivet/AnalysisHandler.hh"
-#include "Rivet/RivetAIDA.hh"
+#include "Rivet/RivetYODA.hh"
 #include "Rivet/Analysis.hh"
 #include "Rivet/Event.hh"
 #include "Rivet/Projections/Beam.hh"
-#include "LWH/AIManagedObject.h"
-
-using namespace AIDA;
 
 namespace Rivet {
 
@@ -194,13 +191,14 @@
     return *this;
   }
 
-  void AnalysisHandler::commitData() {
-    // \todo YODA
-  }
-
-
   void AnalysisHandler::writeData(const string& filename) {
-    // \todo YODA
+    vector<AnalysisObjectPtr> allPlots;
+    foreach (const AnaHandle a, _analyses) {
+      allPlots.insert(allPlots.end(),
+		      a->plots().begin(), 
+		      a->plots().end());
+    }
+    WriterYODA::write(filename, allPlots.begin(), allPlots.end());
   }
 
 


More information about the Rivet-svn mailing list