[Rivet-svn] r2315 - in trunk: include/Rivet include/Rivet/Math src/Core src/Tools

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Mar 8 14:58:03 GMT 2010


Author: fsiegert
Date: Mon Mar  8 14:58:03 2010
New Revision: 2315

Log:
Restructure header includes such that our external interface AnalysisHandler.hh doesn't depend on boost anymore.

Modified:
   trunk/include/Rivet/AnalysisHandler.hh
   trunk/include/Rivet/Math/MathUtils.hh
   trunk/include/Rivet/ProjectionHandler.hh
   trunk/include/Rivet/Rivet.hh
   trunk/include/Rivet/Run.hh
   trunk/src/Core/AnalysisHandler.cc
   trunk/src/Core/AnalysisInfo.cc
   trunk/src/Core/Jet.cc
   trunk/src/Core/Particle.cc
   trunk/src/Tools/RivetAIDA.cc

Modified: trunk/include/Rivet/AnalysisHandler.hh
==============================================================================
--- trunk/include/Rivet/AnalysisHandler.hh	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/include/Rivet/AnalysisHandler.hh	Mon Mar  8 14:58:03 2010	(r2315)
@@ -5,10 +5,9 @@
 #include "Rivet/Rivet.hh"
 #include "Rivet/Tools/Logging.fhh"
 #include "Rivet/AnalysisHandler.fhh"
-#include "Rivet/Event.hh"
-#include "Rivet/Analysis.hh"
+#include "Rivet/Analysis.fhh"
+#include "Rivet/Event.fhh"
 #include "Rivet/AnalysisLoader.hh"
-#include "Rivet/Projections/Beam.hh"
 
 namespace Rivet {
 
@@ -111,14 +110,10 @@
     }
 
     /// Get beam IDs for this run, determined from first event
-    BeamPair beamIds() const { 
-      return Rivet::beamIds(beams());
-    }
+    BeamPair beamIds() const;
 
     /// Get energy for this run, determined from first event
-    double sqrtS() const {
-      return Rivet::sqrtS(beams());
-    }
+    double sqrtS() const;
     
     //@}
 
@@ -156,11 +151,7 @@
 
 
     /// Add an analysis to the run list by object
-    AnalysisHandler& addAnalysis(Analysis* analysis) {
-      analysis->_analysishandler = this;
-      _analyses.insert(analysis);
-      return *this;
-    }
+    AnalysisHandler& addAnalysis(Analysis* analysis);
 
     /// Remove beam-incompatible analyses from the run list.
     /// @todo Do this automatically in the init phase (including energies) and deprecate explicit use

Modified: trunk/include/Rivet/Math/MathUtils.hh
==============================================================================
--- trunk/include/Rivet/Math/MathUtils.hh	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/include/Rivet/Math/MathUtils.hh	Mon Mar  8 14:58:03 2010	(r2315)
@@ -3,7 +3,6 @@
 #define RIVET_MathUtils_HH
 
 #include "Rivet/Math/MathHeader.hh"
-#include "Rivet/RivetBoost.hh"
 
 namespace Rivet {
 
@@ -119,8 +118,8 @@
   /// Calculate the mean of a sample
   inline double mean(const vector<int>& sample) {
     double mean = 0.0;
-    foreach (const int& i, sample) {
-      mean += i;
+    for (size_t i=0; i<sample.size(); ++i) {
+      mean += sample[i];
     }
     return mean/sample.size();
   }

Modified: trunk/include/Rivet/ProjectionHandler.hh
==============================================================================
--- trunk/include/Rivet/ProjectionHandler.hh	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/include/Rivet/ProjectionHandler.hh	Mon Mar  8 14:58:03 2010	(r2315)
@@ -3,6 +3,7 @@
 #define RIVET_ProjectionHandler_HH
 
 #include "Rivet/Rivet.hh"
+#include "Rivet/RivetBoost.hh"
 #include "Rivet/Tools/Logging.fhh"
 #include "Rivet/ProjectionApplier.fhh"
 #include "Rivet/Projection.fhh"

Modified: trunk/include/Rivet/Rivet.hh
==============================================================================
--- trunk/include/Rivet/Rivet.hh	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/include/Rivet/Rivet.hh	Mon Mar  8 14:58:03 2010	(r2315)
@@ -60,9 +60,6 @@
 // AIDA headers
 #include "Rivet/RivetAIDA.fhh"
 
-// Pull some Boost defns into the Rivet namespace
-#include "Rivet/RivetBoost.hh"
-
 // HepMC headers and helper functions
 #include "Rivet/RivetHepMC.hh"
 
@@ -84,8 +81,8 @@
   template<typename T>
   inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
     os << "[ ";
-    foreach (const T& i, vec) {
-      os << i << " ";
+    for (size_t i=0; i<vec.size(); ++i) {
+      os << vec[i] << " ";
     }
     os << "]";
     return os;
@@ -96,8 +93,8 @@
   template<typename T>
   inline std::ostream& operator<<(std::ostream& os, const std::list<T>& vec) {
     os << "[ ";
-    foreach (const T& i, vec) {
-      os << i << " ";
+    for (size_t i=0; i<vec.size(); ++i) {
+      os << vec[i] << " ";
     }
     os << "]";
     return os;

Modified: trunk/include/Rivet/Run.hh
==============================================================================
--- trunk/include/Rivet/Run.hh	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/include/Rivet/Run.hh	Mon Mar  8 14:58:03 2010	(r2315)
@@ -3,6 +3,7 @@
 #define RIVET_Run_HH
 
 #include "Rivet/AnalysisHandler.fhh"
+#include "Rivet/RivetBoost.hh"
 
 namespace HepMC {
   class IO_GenEvent;

Modified: trunk/src/Core/AnalysisHandler.cc
==============================================================================
--- trunk/src/Core/AnalysisHandler.cc	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/src/Core/AnalysisHandler.cc	Mon Mar  8 14:58:03 2010	(r2315)
@@ -3,6 +3,9 @@
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/AnalysisHandler.hh"
 #include "Rivet/RivetAIDA.hh"
+#include "Rivet/Analysis.hh"
+#include "Rivet/Event.hh"
+#include "Rivet/Projections/Beam.hh"
 #include "LWH/AIManagedObject.h"
 
 using namespace AIDA;
@@ -343,5 +346,19 @@
     return (crossSection() >= 0);
   }
 
+  AnalysisHandler& AnalysisHandler::addAnalysis(Analysis* analysis) {
+    analysis->_analysishandler = this;
+    _analyses.insert(analysis);
+    return *this;
+  }
+
+  BeamPair AnalysisHandler::beamIds() const { 
+    return Rivet::beamIds(beams());
+  }
+
+  double AnalysisHandler::sqrtS() const {
+    return Rivet::sqrtS(beams());
+  }
+
 
 }

Modified: trunk/src/Core/AnalysisInfo.cc
==============================================================================
--- trunk/src/Core/AnalysisInfo.cc	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/src/Core/AnalysisInfo.cc	Mon Mar  8 14:58:03 2010	(r2315)
@@ -1,4 +1,5 @@
 #include "Rivet/Rivet.hh"
+#include "Rivet/RivetBoost.hh"
 #include "Rivet/AnalysisInfo.hh"
 #include "Rivet/Tools/Utils.hh"
 #include "Rivet/Tools/Logging.hh"

Modified: trunk/src/Core/Jet.cc
==============================================================================
--- trunk/src/Core/Jet.cc	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/src/Core/Jet.cc	Mon Mar  8 14:58:03 2010	(r2315)
@@ -2,6 +2,7 @@
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/Tools/ParticleIdUtils.hh"
 #include "Rivet/ParticleName.hh"
+#include "Rivet/RivetBoost.hh"
 
 namespace Rivet {
 

Modified: trunk/src/Core/Particle.cc
==============================================================================
--- trunk/src/Core/Particle.cc	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/src/Core/Particle.cc	Mon Mar  8 14:58:03 2010	(r2315)
@@ -1,4 +1,5 @@
 #include "Rivet/Particle.hh"
+#include "Rivet/RivetBoost.hh"
 
 namespace Rivet {
 

Modified: trunk/src/Tools/RivetAIDA.cc
==============================================================================
--- trunk/src/Tools/RivetAIDA.cc	Sun Mar  7 13:41:05 2010	(r2314)
+++ trunk/src/Tools/RivetAIDA.cc	Mon Mar  8 14:58:03 2010	(r2315)
@@ -1,5 +1,6 @@
 #include "Rivet/RivetAIDA.hh"
 #include "Rivet/Rivet.hh"
+#include "Rivet/RivetBoost.hh"
 #include "Rivet/Tools/Utils.hh"
 #include "LWH/AnalysisFactory.h"
 #include "TinyXML/tinyxml.h"


More information about the Rivet-svn mailing list