|
[Rivet-svn] r4308 - in trunk: . bin include/Rivet include/Rivet/Tools src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon May 27 21:20:20 BST 2013
Author: buckley Date: Mon May 27 21:20:19 2013 New Revision: 4308 Log: Removing lots of unnecessary .fhh includes from core classes: everything still compiling ok. A good opportunity to tidy this up before the release. Modified: trunk/ChangeLog trunk/bin/rivet-mkanalysis trunk/include/Rivet/Analysis.fhh trunk/include/Rivet/Analysis.hh trunk/include/Rivet/AnalysisBuilder.hh trunk/include/Rivet/AnalysisHandler.fhh trunk/include/Rivet/AnalysisHandler.hh trunk/include/Rivet/AnalysisLoader.hh trunk/include/Rivet/HistoHandler.hh trunk/include/Rivet/Projection.fhh trunk/include/Rivet/Projection.hh trunk/include/Rivet/ProjectionApplier.hh trunk/include/Rivet/ProjectionHandler.hh trunk/include/Rivet/Rivet.hh trunk/include/Rivet/RivetBoost.hh trunk/include/Rivet/RivetHepMC.hh trunk/include/Rivet/RivetYODA.fhh trunk/include/Rivet/RivetYODA.hh trunk/include/Rivet/Run.hh trunk/include/Rivet/Tools/Logging.fhh trunk/src/Analyses/ATLAS_2011_S9131140.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Mon May 27 15:27:26 2013 (r4307) +++ trunk/ChangeLog Mon May 27 21:20:19 2013 (r4308) @@ -1,10 +1,15 @@ 2013-05-27 Andy Buckley <andy.buckley at cern.ch> + * Removing lots of unnecessary .fhh includes from core classes: + everything still compiling ok. A good opportunity to tidy this up + before the release. + * Moving the rivet-completion script from the data dir to bin (the completion is for scripts in bin, and this makes development easier). - * Updating bash completion scripts for YODA format and compare-histos -> rivet-cmphistos. + * Updating bash completion scripts for YODA format and + compare-histos -> rivet-cmphistos. 2013-05-23 Andy Buckley <andy.buckley at cern.ch> Modified: trunk/bin/rivet-mkanalysis ============================================================================== --- trunk/bin/rivet-mkanalysis Mon May 27 15:27:26 2013 (r4307) +++ trunk/bin/rivet-mkanalysis Mon May 27 21:20:19 2013 (r4308) @@ -165,7 +165,6 @@ src = '''\ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/RivetYODA.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/FinalState.hh" /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder... Modified: trunk/include/Rivet/Analysis.fhh ============================================================================== --- trunk/include/Rivet/Analysis.fhh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Analysis.fhh Mon May 27 21:20:19 2013 (r4308) @@ -3,17 +3,11 @@ #define Rivet_Analysis_FHH #include "Rivet/Cmp.fhh" -//#include <boost/shared_ptr.hpp> namespace Rivet { class Analysis; - - /// Smart (shared) pointer for handling projections. - //typedef boost::shared_ptr<Analysis> AnalysisPtr; - - typedef Analysis* AnalysisPtr; - + } #endif Modified: trunk/include/Rivet/Analysis.hh ============================================================================== --- trunk/include/Rivet/Analysis.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Analysis.hh Mon May 27 21:20:19 2013 (r4308) @@ -3,17 +3,15 @@ #define RIVET_Analysis_HH #include "Rivet/Rivet.hh" -#include "Rivet/Analysis.fhh" #include "Rivet/AnalysisInfo.hh" #include "Rivet/Event.hh" #include "Rivet/Projection.hh" #include "Rivet/ProjectionApplier.hh" #include "Rivet/ProjectionHandler.hh" #include "Rivet/Constraints.hh" -#include "Rivet/AnalysisHandler.fhh" #include "Rivet/AnalysisLoader.hh" -#include "Rivet/Tools/Logging.fhh" -#include "Rivet/RivetYODA.fhh" +#include "Rivet/Tools/Logging.hh" +#include "Rivet/RivetYODA.hh" /// @def vetoEvent @@ -25,6 +23,9 @@ namespace Rivet { + // Forward declaration + class AnalysisHandler; + /// @brief This is the base class of all analysis classes in Rivet. /// /// There are @@ -616,7 +617,7 @@ /// Collection of cached refdata to speed up many autobookings: the /// reference data file should only be read once. - mutable RefDataMap _refdata; + mutable std::map<std::string, Scatter2DPtr> _refdata; private: Modified: trunk/include/Rivet/AnalysisBuilder.hh ============================================================================== --- trunk/include/Rivet/AnalysisBuilder.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/AnalysisBuilder.hh Mon May 27 21:20:19 2013 (r4308) @@ -3,13 +3,16 @@ #define RIVET_AnalysisBuilder_HH #include "Rivet/Rivet.hh" -#include "Rivet/Analysis.fhh" #include "Rivet/AnalysisLoader.hh" -#include "Rivet/Tools/Logging.fhh" +#include "Rivet/Tools/Logging.hh" namespace Rivet { + // Forward declaration + class Analysis; + + /// @cond ANALYSIS_PLUGIN_DETAILS /// @brief Interface for analysis builders Modified: trunk/include/Rivet/AnalysisHandler.fhh ============================================================================== --- trunk/include/Rivet/AnalysisHandler.fhh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/AnalysisHandler.fhh Mon May 27 21:20:19 2013 (r4308) @@ -6,7 +6,7 @@ namespace Rivet { - // Forward declaration of AnalysisHandler class + // Forward declaration class AnalysisHandler; } Modified: trunk/include/Rivet/AnalysisHandler.hh ============================================================================== --- trunk/include/Rivet/AnalysisHandler.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/AnalysisHandler.hh Mon May 27 21:20:19 2013 (r4308) @@ -4,17 +4,17 @@ #include "Rivet/Rivet.hh" #include "Rivet/RivetBoost.hh" -#include "Rivet/Tools/Logging.fhh" -#include "Rivet/AnalysisHandler.fhh" -#include "Rivet/Analysis.fhh" -#include "Rivet/Event.fhh" +#include "Rivet/Tools/Logging.hh" #include "Rivet/AnalysisLoader.hh" namespace Rivet { - /// Typedef for Analysis (smart) pointer + + // Forward declaration and smart pointer for Analysis + class Analysis; typedef shared_ptr<Analysis> AnaHandle; + // Needed to make smart pointers compare equivalent in the STL set struct AnaHandleLess { bool operator()(const AnaHandle& a, const AnaHandle& b) { @@ -185,7 +185,7 @@ std::string _runname; /// Number of events seen. - size_t _numEvents; + unsigned int _numEvents; /// Sum of event weights seen. double _sumOfWeights; Modified: trunk/include/Rivet/AnalysisLoader.hh ============================================================================== --- trunk/include/Rivet/AnalysisLoader.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/AnalysisLoader.hh Mon May 27 21:20:19 2013 (r4308) @@ -3,7 +3,6 @@ #define RIVET_AnalysisLoader_HH #include "Rivet/Rivet.hh" -#include "Rivet/Tools/Logging.fhh" #include <map> #include <string> @@ -13,9 +12,10 @@ // Forward declarations class Analysis; class AnalysisBuilderBase; + class Log; - /// @brief Internal class which loads and registers analyses from plugin libs + /// Internal class which loads and registers analyses from plugin libs class AnalysisLoader { public: Modified: trunk/include/Rivet/HistoHandler.hh ============================================================================== --- trunk/include/Rivet/HistoHandler.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/HistoHandler.hh Mon May 27 21:20:19 2013 (r4308) @@ -3,12 +3,12 @@ #define RIVET_HistoHandler_HH #include "Rivet/Rivet.hh" -#include "Rivet/Tools/Logging.fhh" -#include "Rivet/Analysis.fhh" +#include "Rivet/Tools/Logging.hh" namespace Rivet { - /// Forward declaration of Histo base class. + // Forward declarations + class Analysis; class AnalysisObject; Modified: trunk/include/Rivet/Projection.fhh ============================================================================== --- trunk/include/Rivet/Projection.fhh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Projection.fhh Mon May 27 21:20:19 2013 (r4308) @@ -2,6 +2,8 @@ #ifndef Rivet_Projection_FHH #define Rivet_Projection_FHH +/// @todo Is there a reason that this stuff can't go into Projection.hh? + #include "Rivet/Cmp.fhh" @@ -13,7 +15,7 @@ namespace std { - + /// This is the function called when comparing two (const) pointers to Rivet::Projection. template <> struct less<const Rivet::Projection*> @@ -31,14 +33,14 @@ inline const PROJ& pcast(const Projection& p) { return dynamic_cast<const PROJ&>(p); } - - + + /// Convenience method for casting to a const Projection pointer. template <typename PROJ> inline const PROJ* pcast(const Projection* p) { return dynamic_cast<const PROJ*>(p); } - + } #endif Modified: trunk/include/Rivet/Projection.hh ============================================================================== --- trunk/include/Rivet/Projection.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Projection.hh Mon May 27 21:20:19 2013 (r4308) @@ -8,13 +8,15 @@ #include "Rivet/ProjectionHandler.hh" #include "Rivet/Constraints.hh" #include "Rivet/ParticleName.hh" -#include "Rivet/Event.fhh" #include "Rivet/Tools/Logging.hh" -#include "Rivet/Cmp.fhh" - namespace Rivet { + + // Forward declaration + class Event; + + /// @brief Base class for all Rivet projections. /// /// Projection is the base class of all Projections to be used by @@ -26,7 +28,6 @@ /// The main virtual functions to be overridden by concrete sub-classes /// are project(const Event &) and compare(const Projection &). class Projection : public ProjectionApplier { - public: /// Event is a friend. Modified: trunk/include/Rivet/ProjectionApplier.hh ============================================================================== --- trunk/include/Rivet/ProjectionApplier.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/ProjectionApplier.hh Mon May 27 21:20:19 2013 (r4308) @@ -3,7 +3,6 @@ #define RIVET_ProjectionApplier_HH #include "Rivet/Rivet.hh" -#include "Rivet/Event.fhh" #include "Rivet/Projection.fhh" #include "Rivet/ProjectionHandler.hh" #include "Rivet/Tools/Logging.hh" @@ -11,6 +10,10 @@ namespace Rivet { + // Forward declarations + class Event; + + /// @brief Common base class for Projection and Analysis, used for internal polymorphism /// /// Empty interface used for storing Projection and Analysis pointers in the Modified: trunk/include/Rivet/ProjectionHandler.hh ============================================================================== --- trunk/include/Rivet/ProjectionHandler.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/ProjectionHandler.hh Mon May 27 21:20:19 2013 (r4308) @@ -4,7 +4,7 @@ #include "Rivet/Rivet.hh" #include "Rivet/RivetBoost.hh" -#include "Rivet/Tools/Logging.fhh" +#include "Rivet/Tools/Logging.hh" #include "Rivet/Projection.fhh" namespace Rivet { Modified: trunk/include/Rivet/Rivet.hh ============================================================================== --- trunk/include/Rivet/Rivet.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Rivet.hh Mon May 27 21:20:19 2013 (r4308) @@ -29,8 +29,8 @@ } -// AIDA headers -#include "Rivet/RivetYODA.fhh" +// YODA headers +#include "Rivet/RivetYODA.hh" // HepMC headers and helper functions #include "Rivet/RivetHepMC.hh" Modified: trunk/include/Rivet/RivetBoost.hh ============================================================================== --- trunk/include/Rivet/RivetBoost.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/RivetBoost.hh Mon May 27 21:20:19 2013 (r4308) @@ -4,12 +4,12 @@ #include "boost/smart_ptr.hpp" #include "boost/lexical_cast.hpp" #include "boost/assign.hpp" +#include <boost/algorithm/string.hpp> #include "boost/foreach.hpp" +#ifndef foreach #define foreach BOOST_FOREACH - -//#include <boost/random.hpp> -#include <boost/algorithm/string.hpp> +#endif namespace Rivet { @@ -27,13 +27,6 @@ // Strings using namespace boost; - // Random numbers - // typedef boost::minstd_rand RngBase; - // typedef boost::uniform_real<> UniformRealDist; - // typedef boost::variate_generator<RngBase&, UniformRealDist> UniformRealRNG; - // typedef boost::uniform_int<> UniformIntDist; - // typedef boost::variate_generator<RngBase&, UniformIntDist> UniformIntRNG; - } Modified: trunk/include/Rivet/RivetHepMC.hh ============================================================================== --- trunk/include/Rivet/RivetHepMC.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/RivetHepMC.hh Mon May 27 21:20:19 2013 (r4308) @@ -5,8 +5,8 @@ #include "HepMC/GenEvent.h" #include "HepMC/GenParticle.h" #include "HepMC/GenVertex.h" - -#include <vector> +#include "HepMC/IO_GenEvent.h" +#include "Rivet/RivetSTL.hh" namespace Rivet { @@ -16,44 +16,44 @@ using HepMC::GenVertex; - inline vector<GenParticle*> particles(const GenEvent& ge) { - vector<GenParticle*> rtn; + inline std::vector<GenParticle*> particles(const GenEvent& ge) { + std::vector<GenParticle*> rtn; for (GenEvent::particle_const_iterator pi = ge.particles_begin(); pi != ge.particles_end(); ++pi) { rtn.push_back(*pi); } return rtn; } - inline vector<GenParticle*> particles(const GenEvent* ge) { + inline std::vector<GenParticle*> particles(const GenEvent* ge) { assert(ge); return particles(*ge); } -// inline std::pair<GenEvent::particle_const_iterator, GenEvent::particle_const_iterator> particles(const GenEvent& ge) { -// return make_pair(ge.particles_begin(), ge.particles_end()); -// } -// inline std::pair<GenEvent::particle_const_iterator, GenEvent::particle_const_iterator> particles(const GenEvent* ge) { -// assert(ge); -// return particles(*ge); -// } + // inline std::pair<GenEvent::particle_const_iterator, GenEvent::particle_const_iterator> particles(const GenEvent& ge) { + // return make_pair(ge.particles_begin(), ge.particles_end()); + // } + // inline std::pair<GenEvent::particle_const_iterator, GenEvent::particle_const_iterator> particles(const GenEvent* ge) { + // assert(ge); + // return particles(*ge); + // } - inline vector<GenVertex*> vertices(const GenEvent& ge) { - vector<GenVertex*> rtn; + inline std::vector<GenVertex*> vertices(const GenEvent& ge) { + std::vector<GenVertex*> rtn; for (GenEvent::vertex_const_iterator vi = ge.vertices_begin(); vi != ge.vertices_end(); ++vi) { rtn.push_back(*vi); } return rtn; } - inline vector<GenVertex*> vertices(const GenEvent* ge) { + inline std::vector<GenVertex*> vertices(const GenEvent* ge) { assert(ge); return vertices(*ge); } -// inline std::pair<GenEvent::vertex_const_iterator, GenEvent::vertex_const_iterator> vertices(const GenEvent& ge) { -// return make_pair(ge.vertices_begin(), ge.vertices_end()); -// } -// inline std::pair<GenEvent::vertex_const_iterator, GenEvent::vertex_const_iterator> vertices(const GenEvent* ge) { -// assert(ge); -// return vertices(*ge); -// } + // inline std::pair<GenEvent::vertex_const_iterator, GenEvent::vertex_const_iterator> vertices(const GenEvent& ge) { + // return make_pair(ge.vertices_begin(), ge.vertices_end()); + // } + // inline std::pair<GenEvent::vertex_const_iterator, GenEvent::vertex_const_iterator> vertices(const GenEvent* ge) { + // assert(ge); + // return vertices(*ge); + // } inline const std::pair<GenVertex::particles_in_const_iterator, GenVertex::particles_in_const_iterator> particles_in(const GenVertex* gv) { @@ -66,16 +66,16 @@ } - inline vector<GenParticle*> particles(GenVertex* gv, HepMC::IteratorRange range=HepMC::relatives) { - vector<GenParticle*> rtn; + inline std::vector<GenParticle*> particles(GenVertex* gv, HepMC::IteratorRange range=HepMC::relatives) { + std::vector<GenParticle*> rtn; for (GenVertex::particle_iterator pi = gv->particles_begin(range); pi != gv->particles_end(range); ++pi) { rtn.push_back(*pi); } return rtn; } -// inline std::pair<GenVertex::particle_iterator, GenVertex::particle_iterator> particles(GenVertex* gv, HepMC::IteratorRange range=HepMC::relatives) { -// return make_pair(gv->particles_begin(range), gv->particles_end(range)); -// } + // inline std::pair<GenVertex::particle_iterator, GenVertex::particle_iterator> particles(GenVertex* gv, HepMC::IteratorRange range=HepMC::relatives) { + // return make_pair(gv->particles_begin(range), gv->particles_end(range)); + // } } Modified: trunk/include/Rivet/RivetYODA.fhh ============================================================================== --- trunk/include/Rivet/RivetYODA.fhh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/RivetYODA.fhh Mon May 27 21:20:19 2013 (r4308) @@ -2,8 +2,7 @@ #ifndef ANALYSIS_RIVETYODA_FHH #define ANALYSIS_RIVETYODA_FHH -// \todo use something like RivetBoost.fhh here? -#include "boost/smart_ptr.hpp" +#include "Rivet/RivetBoost.hh" /// @author Andy Buckley /// @date 2009-01-30 @@ -20,19 +19,16 @@ } namespace Rivet { - typedef boost::shared_ptr<YODA::AnalysisObject> AnalysisObjectPtr; - typedef boost::shared_ptr<YODA::Histo1D> Histo1DPtr; - typedef boost::shared_ptr<YODA::Profile1D> Profile1DPtr; - typedef boost::shared_ptr<YODA::Scatter2D> Scatter2DPtr; + typedef shared_ptr<YODA::AnalysisObject> AnalysisObjectPtr; + typedef shared_ptr<YODA::Histo1D> Histo1DPtr; + typedef shared_ptr<YODA::Profile1D> Profile1DPtr; + typedef shared_ptr<YODA::Scatter2D> Scatter2DPtr; } -#include <vector> #include <map> namespace Rivet { - /// Typedef for a collection of bin edges. typedef map<string, Scatter2DPtr> RefDataMap; - typedef vector<double> BinEdges; } #endif Modified: trunk/include/Rivet/RivetYODA.hh ============================================================================== --- trunk/include/Rivet/RivetYODA.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/RivetYODA.hh Mon May 27 21:20:19 2013 (r4308) @@ -6,18 +6,26 @@ /// @author David Grellscheid /// @date 2011-07-18 -// Include files #include "Rivet/Rivet.hh" -#include "Rivet/RivetYODA.fhh" +#include "Rivet/RivetBoost.hh" + #include "YODA/AnalysisObject.h" #include "YODA/WriterYODA.h" #include "YODA/Histo1D.h" #include "YODA/Profile1D.h" #include "YODA/Scatter2D.h" #include "YODA/Point2D.h" +#include <map> + namespace Rivet { + + typedef shared_ptr<YODA::AnalysisObject> AnalysisObjectPtr; + typedef shared_ptr<YODA::Histo1D> Histo1DPtr; + typedef shared_ptr<YODA::Profile1D> Profile1DPtr; + typedef shared_ptr<YODA::Scatter2D> Scatter2DPtr; + using YODA::WriterYODA; typedef YODA::Histo1D Histo1D; typedef YODA::Profile1D Profile1D; @@ -26,16 +34,18 @@ /// Function to get a map of all the refdata in a paper with the /// given @a papername. - RefDataMap getRefData(const string& papername); + map<string, Scatter2DPtr> getRefData(const string& papername); - /// Get the file system path to the AIDA reference file for this paper. + /// Get the file system path to the reference file for this paper. string getDatafilePath(const string& papername); /// Return the integral over the histogram bins + /// @deprecated Prefer to directly use the histo's integral() method. inline double integral(Histo1DPtr histo) { return histo->integral(); } + } #endif Modified: trunk/include/Rivet/Run.hh ============================================================================== --- trunk/include/Rivet/Run.hh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Run.hh Mon May 27 21:20:19 2013 (r4308) @@ -2,15 +2,14 @@ #ifndef RIVET_Run_HH #define RIVET_Run_HH -#include "Rivet/AnalysisHandler.fhh" #include "Rivet/RivetBoost.hh" +#include "Rivet/RivetHepMC.hh" -namespace HepMC { - class IO_GenEvent; -} +namespace Rivet { -namespace Rivet { + // Forward declaration + class AnalysisHandler; /// @brief Interface to handle a run of events read from a HepMC stream or file. Modified: trunk/include/Rivet/Tools/Logging.fhh ============================================================================== --- trunk/include/Rivet/Tools/Logging.fhh Mon May 27 15:27:26 2013 (r4307) +++ trunk/include/Rivet/Tools/Logging.fhh Mon May 27 21:20:19 2013 (r4308) @@ -1,6 +1,5 @@ -// $Id: $ -#ifndef RIVET_LOGGING_FHH -#define RIVET_LOGGING_FHH 1 +#ifndef RIVET_LOGGING_FHH +#define RIVET_LOGGING_FHH namespace Rivet { class Log; Modified: trunk/src/Analyses/ATLAS_2011_S9131140.cc ============================================================================== --- trunk/src/Analyses/ATLAS_2011_S9131140.cc Mon May 27 15:27:26 2013 (r4307) +++ trunk/src/Analyses/ATLAS_2011_S9131140.cc Mon May 27 21:20:19 2013 (r4308) @@ -3,7 +3,6 @@ #include "Rivet/RivetYODA.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/ZFinder.hh" -#include "Rivet/Particle.fhh" namespace Rivet {
More information about the Rivet-svn mailing list |