|
[Rivet-svn] r3189 - in branches/2011-07-aida2yoda: . include include/LWH include/Rivet src src/Analyses src/Core src/Toolsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Jul 18 17:24:03 BST 2011
Author: dgrell Date: Mon Jul 18 17:24:03 2011 New Revision: 3189 Log: Converted Histo1D and Profile1D to use YODA. Rest commented out. Compiles, but no tree replacement yet. Search for "todo YODA"! Added: branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh (contents, props changed) - copied, changed from r3187, branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.fhh branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh (contents, props changed) - copied, changed from r3187, branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.hh branches/2011-07-aida2yoda/src/Analyses/Makefile.am.AIDAversion (props changed) - copied unchanged from r3187, branches/2011-07-aida2yoda/src/Analyses/Makefile.am branches/2011-07-aida2yoda/src/Tools/RivetYODA.cc (contents, props changed) - copied, changed from r3187, branches/2011-07-aida2yoda/src/Tools/RivetAIDA.cc Deleted: branches/2011-07-aida2yoda/include/LWH/ branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.fhh branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.hh branches/2011-07-aida2yoda/src/Tools/RivetAIDA.cc Modified: branches/2011-07-aida2yoda/configure.ac branches/2011-07-aida2yoda/include/Makefile.am branches/2011-07-aida2yoda/include/Rivet/Analysis.hh branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh branches/2011-07-aida2yoda/include/Rivet/HistoFormat.hh branches/2011-07-aida2yoda/include/Rivet/Makefile.am branches/2011-07-aida2yoda/include/Rivet/Rivet.hh branches/2011-07-aida2yoda/src/Analyses/ExampleAnalysis.cc branches/2011-07-aida2yoda/src/Analyses/Makefile.am branches/2011-07-aida2yoda/src/Core/Analysis.cc branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc branches/2011-07-aida2yoda/src/Makefile.am branches/2011-07-aida2yoda/src/Tools/Makefile.am Modified: branches/2011-07-aida2yoda/configure.ac ============================================================================== --- branches/2011-07-aida2yoda/configure.ac Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/configure.ac Mon Jul 18 17:24:03 2011 (r3189) @@ -66,6 +66,9 @@ AC_CHECK_HEADER([boost/random.hpp], [], [AC_MSG_ERROR([Boost random numbers not found. $BOOSTERRMSG])]) CPPFLAGS=$oldCPPFLAGS +## YODA library +AC_CEDAR_LIBRARYANDHEADERS([YODA], , , [AC_MSG_ERROR([YODA is required])]) +## TODO NEEDS TESTS HERE ## HepMC library AC_CEDAR_LIBRARYANDHEADERS([HepMC], , , [AC_MSG_ERROR([HepMC is required])]) @@ -297,6 +300,7 @@ #AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/include/eigen2" AM_CPPFLAGS="$AM_CPPFLAGS \$(GSL_CPPFLAGS)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(BOOSTINCPATH) \$(BOOST_CPPFLAGS)" +AM_CPPFLAGS="$AM_CPPFLAGS -I\$(YODAINCPATH)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(HEPMCINCPATH)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(FASTJETINCPATH)" AC_CEDAR_CHECKCXXFLAG([-pedantic], [AM_CXXFLAGS="$AM_CXXFLAGS -pedantic "]) Modified: branches/2011-07-aida2yoda/include/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/include/Makefile.am Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Makefile.am Mon Jul 18 17:24:03 2011 (r3189) @@ -2,34 +2,5 @@ ## Remove these when YODA is available... EXTRA_DIST = TinyXML -nobase_include_HEADERS = \ - LWH/AIAnalysisFactory.h \ - LWH/AITreeFactory.h \ - LWH/AIHistogramFactory.h \ - LWH/AIDataPointSetFactory.h \ - LWH/AIManagedObject.h \ - LWH/AIBaseHistogram.h \ - LWH/AIHistogram1D.h \ - LWH/AIHistogram2D.h \ - LWH/AIProfile1D.h \ - LWH/AIDataPointSet.h \ - LWH/AIMeasurement.h \ - LWH/AIDataPoint.h \ - LWH/AITree.h \ - LWH/AIAxis.h \ - LWH/AnalysisFactory.h \ - LWH/TreeFactory.h \ - LWH/HistogramFactory.h \ - LWH/DataPointSetFactory.h \ - LWH/ManagedObject.h \ - LWH/Histogram1D.h \ - LWH/Histogram2D.h \ - LWH/Profile1D.h \ - LWH/DataPointSet.h \ - LWH/DataPoint.h \ - LWH/Measurement.h \ - LWH/Tree.h \ - LWH/Axis.h \ - LWH/VariAxis.h #EXTRA_DIST += eigen2 Modified: branches/2011-07-aida2yoda/include/Rivet/Analysis.hh ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/Analysis.hh Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Rivet/Analysis.hh Mon Jul 18 17:24:03 2011 (r3189) @@ -13,7 +13,7 @@ #include "Rivet/AnalysisHandler.fhh" #include "Rivet/AnalysisLoader.hh" #include "Rivet/Tools/Logging.fhh" -#include "Rivet/RivetAIDA.fhh" +#include "Rivet/RivetYODA.fhh" /// @def vetoEvent @@ -291,14 +291,14 @@ /// @param histo The histogram to be normalised. /// @param norm The new area of the histogram. /// @warning The old histogram will be deleted, and its pointer set to zero. - void normalize(AIDA::IHistogram1D*& histo, double norm=1.0); + void normalize(Histo1DPtr histo, double norm=1.0); /// Multiplicatively scale the given histogram, @a histo. After this call the /// histogram will have been transformed to a DataPointSet with the same name and path. /// @param histo The histogram to be scaled. /// @param scale The factor used to multiply the histogram bin heights. /// @warning The old histogram will be deleted, and its pointer set to zero. - void scale(AIDA::IHistogram1D*& histo, double scale); + void scale(Histo1DPtr histo, double scale); /// Normalize the given histogram, @a histo. After this call the /// histogram will have been transformed to a DataPointSet with the @@ -307,14 +307,14 @@ /// @param histo The histogram to be normalised. /// @param norm The new area of the histogram. /// @warning The old histogram will be deleted, and its pointer set to zero. - void normalize(AIDA::IHistogram2D*& histo, double norm=1.0); + // void normalize(AIDA::IHistogram2D*& histo, double norm=1.0); /// Multiplicatively scale the given histogram, @a histo. After this call the /// histogram will have been transformed to a DataPointSet with the same name and path. /// @param histo The histogram to be scaled. /// @param scale The factor used to multiply the histogram bin heights. /// @warning The old histogram will be deleted, and its pointer set to zero. - void scale(AIDA::IHistogram2D*& histo, double scale); + // void scale(AIDA::IHistogram2D*& histo, double scale); /// Set the cross section from the generator Analysis& setCrossSection(double xs); @@ -345,18 +345,6 @@ /// @name AIDA analysis infrastructure. //@{ - /// Access the AIDA analysis factory of the controlling AnalysisHandler object. - AIDA::IAnalysisFactory& analysisFactory(); - - /// Access the AIDA tree of the controlling AnalysisHandler object. - AIDA::ITree& tree(); - - /// Access the AIDA histogram factory of the controlling AnalysisHandler object. - AIDA::IHistogramFactory& histogramFactory(); - - /// Access the AIDA histogram factory of the controlling AnalysisHandler object. - AIDA::IDataPointSetFactory& datapointsetFactory(); - /// Get the canonical histogram "directory" path for this analysis. const std::string histoDir() const; @@ -382,58 +370,61 @@ /// (NB. this returns a pointer rather than a reference since it will /// have to be stored in the analysis class - there's no point in forcing users to explicitly /// get the pointer from a reference before they can use it!) - AIDA::IHistogram1D* bookHistogram1D(const std::string& name, - size_t nbins, double lower, double upper, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Histo1DPtr bookHisto1D(const std::string& name, + size_t nbins, double lower, double upper, + const std::string& title="", + const std::string& xtitle="", const std::string& ytitle=""); /// Book a 1D histogram with non-uniform bins defined by the vector of bin edges @a binedges . /// (NB. this returns a pointer rather than a reference since it will /// have to be stored in the analysis class - there's no point in forcing users to explicitly /// get the pointer from a reference before they can use it!) - AIDA::IHistogram1D* bookHistogram1D(const std::string& name, + Histo1DPtr bookHisto1D(const std::string& name, const std::vector<double>& binedges, const std::string& title="", const std::string& xtitle="", const std::string& ytitle=""); - /// Book a 2D histogram with @a nxbins and @a nybins uniformly - /// distributed across the ranges @a xlower - @a xupper and @a - /// ylower - @a yupper respectively along the x- and y-axis. - /// (NB. this returns a pointer rather than a reference since it - /// will have to be stored in the analysis class - there's no - /// point in forcing users to explicitly get the pointer from a - /// reference before they can use it!) - AIDA::IHistogram2D* - bookHistogram2D(const std::string& name, - size_t nxbins, double xlower, double xupper, - size_t nybins, double ylower, double yupper, - const std::string& title="", const std::string& xtitle="", - const std::string& ytitle="", const std::string& ztitle=""); - - /// Book a 2D histogram with non-uniform bins defined by the - /// vectorx of bin edges @a xbinedges and @a ybinedges. - /// (NB. this returns a pointer rather than a reference since it - /// will have to be stored in the analysis class - there's no - /// point in forcing users to explicitly get the pointer from a - /// reference before they can use it!) - AIDA::IHistogram2D* - bookHistogram2D(const std::string& name, - const std::vector<double>& xbinedges, - const std::vector<double>& ybinedges, - const std::string& title="", const std::string& xtitle="", - const std::string& ytitle="", const std::string& ztitle=""); + // /// Book a 2D histogram with @a nxbins and @a nybins uniformly + // /// distributed across the ranges @a xlower - @a xupper and @a + // /// ylower - @a yupper respectively along the x- and y-axis. + // /// (NB. this returns a pointer rather than a reference since it + // /// will have to be stored in the analysis class - there's no + // /// point in forcing users to explicitly get the pointer from a + // /// reference before they can use it!) + // AIDA::IHistogram2D* + // bookHistogram2D(const std::string& name, + // size_t nxbins, double xlower, double xupper, + // size_t nybins, double ylower, double yupper, + // const std::string& title="", const std::string& xtitle="", + // const std::string& ytitle="", const std::string& ztitle=""); + + // /// Book a 2D histogram with non-uniform bins defined by the + // /// vectorx of bin edges @a xbinedges and @a ybinedges. + // /// (NB. this returns a pointer rather than a reference since it + // /// will have to be stored in the analysis class - there's no + // /// point in forcing users to explicitly get the pointer from a + // /// reference before they can use it!) + // AIDA::IHistogram2D* + // bookHistogram2D(const std::string& name, + // const std::vector<double>& xbinedges, + // const std::vector<double>& ybinedges, + // const std::string& title="", const std::string& xtitle="", + // const std::string& ytitle="", const std::string& ztitle=""); /// Book a 1D histogram based on the name in the corresponding AIDA /// file. The binnings will be obtained by reading the bundled AIDA data /// record file with the same filename as the analysis' name() property. - AIDA::IHistogram1D* bookHistogram1D(const std::string& name, const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Histo1DPtr bookHisto1D(const std::string& name, + const std::string& title="", + const std::string& xtitle="", + const std::string& ytitle=""); /// Book a 1D histogram based on the paper, dataset and x/y-axis IDs in the corresponding /// HepData record. The binnings will be obtained by reading the bundled AIDA data record file /// of the same filename as the analysis' name() property. - AIDA::IHistogram1D* bookHistogram1D(size_t datasetId, size_t xAxisId, size_t yAxisId, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Histo1DPtr bookHisto1D(size_t datasetId, size_t xAxisId, size_t yAxisId, + const std::string& title="", + const std::string& xtitle="", + const std::string& ytitle=""); //@} @@ -445,67 +436,67 @@ /// (NB. this returns a pointer rather than a reference since it will /// have to be stored in the analysis class - there's no point in forcing users to explicitly /// get the pointer from a reference before they can use it!) - AIDA::IProfile1D* bookProfile1D(const std::string& name, - size_t nbins, double lower, double upper, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Profile1DPtr bookProfile1D(const std::string& name, + size_t nbins, double lower, double upper, + const std::string& title="", + const std::string& xtitle="", const std::string& ytitle=""); /// Book a 1D profile histogram with non-uniform bins defined by the vector of bin edges @a binedges . /// (NB. this returns a pointer rather than a reference since it will /// have to be stored in the analysis class - there's no point in forcing users to explicitly /// get the pointer from a reference before they can use it!) - AIDA::IProfile1D* bookProfile1D(const std::string& name, - const std::vector<double>& binedges, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Profile1DPtr bookProfile1D(const std::string& name, + const std::vector<double>& binedges, + const std::string& title="", + const std::string& xtitle="", const std::string& ytitle=""); /// Book a 1D profile histogram based on the name in the corresponding AIDA /// file. The binnings will be obtained by reading the bundled AIDA data /// record file with the same filename as the analysis' name() property. - AIDA::IProfile1D* bookProfile1D(const std::string& name, const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); - + Profile1DPtr bookProfile1D(const std::string& name, const std::string& title="", + const std::string& xtitle="", const std::string& ytitle=""); + /// Book a 1D profile histogram based on the paper, dataset and x/y-axis IDs in the corresponding /// HepData record. The binnings will be obtained by reading the bundled AIDA data record file /// of the same filename as the analysis' name() property. - AIDA::IProfile1D* bookProfile1D(size_t datasetId, size_t xAxisId, size_t yAxisId, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + Profile1DPtr bookProfile1D(size_t datasetId, size_t xAxisId, size_t yAxisId, + const std::string& title="", + const std::string& xtitle="", const std::string& ytitle=""); //@} /// @name Internal data point set booking (for use by Analysis sub-classes). //@{ - /// Book a 2-dimensional data point set. - /// (NB. this returns a pointer rather than a reference since it will - /// have to be stored in the analysis class - there's no point in forcing users to explicitly - /// get the pointer from a reference before they can use it!) - AIDA::IDataPointSet* bookDataPointSet(const std::string& name, const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); - - - /// Book a 2-dimensional data point set with equally spaced points in a range. - /// (NB. this returns a pointer rather than a reference since it will - /// have to be stored in the analysis class - there's no point in forcing users to explicitly - /// get the pointer from a reference before they can use it!) - AIDA::IDataPointSet* bookDataPointSet(const std::string& name, - size_t npts, double lower, double upper, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); - - /// Book a 2-dimensional data point set based on the corresponding AIDA data - /// file. The binnings (x-errors) will be obtained by reading the bundled - /// AIDA data record file of the same filename as the analysis' name() - /// property. - //AIDA::IDataPointSet* bookDataPointSet(const std::string& name, const std::string& title); - - /// Book a 2-dimensional data point set based on the paper, dataset and x/y-axis IDs in the corresponding - /// HepData record. The binnings (x-errors) will be obtained by reading the bundled AIDA data record file - /// of the same filename as the analysis' name() property. - AIDA::IDataPointSet* bookDataPointSet(size_t datasetId, size_t xAxisId, size_t yAxisId, - const std::string& title="", - const std::string& xtitle="", const std::string& ytitle=""); + // /// Book a 2-dimensional data point set. + // /// (NB. this returns a pointer rather than a reference since it will + // /// have to be stored in the analysis class - there's no point in forcing users to explicitly + // /// get the pointer from a reference before they can use it!) + // AIDA::IDataPointSet* bookDataPointSet(const std::string& name, const std::string& title="", + // const std::string& xtitle="", const std::string& ytitle=""); + + + // /// Book a 2-dimensional data point set with equally spaced points in a range. + // /// (NB. this returns a pointer rather than a reference since it will + // /// have to be stored in the analysis class - there's no point in forcing users to explicitly + // /// get the pointer from a reference before they can use it!) + // AIDA::IDataPointSet* bookDataPointSet(const std::string& name, + // size_t npts, double lower, double upper, + // const std::string& title="", + // const std::string& xtitle="", const std::string& ytitle=""); + + // /// Book a 2-dimensional data point set based on the corresponding AIDA data + // /// file. The binnings (x-errors) will be obtained by reading the bundled + // /// AIDA data record file of the same filename as the analysis' name() + // /// property. + // //AIDA::IDataPointSet* bookDataPointSet(const std::string& name, const std::string& title); + + // /// Book a 2-dimensional data point set based on the paper, dataset and x/y-axis IDs in the corresponding + // /// HepData record. The binnings (x-errors) will be obtained by reading the bundled AIDA data record file + // /// of the same filename as the analysis' name() property. + // AIDA::IDataPointSet* bookDataPointSet(size_t datasetId, size_t xAxisId, size_t yAxisId, + // const std::string& title="", + // const std::string& xtitle="", const std::string& ytitle=""); //@} @@ -518,11 +509,11 @@ /// Make the histogram directory. void _makeHistoDir(); - /// Get the bin edges for this paper from the reference AIDA file, and cache them. - void _cacheBinEdges() const; + // /// Get the bin edges for this paper from the reference AIDA file, and cache them. + // void _cacheBinEdges() const; - /// Get the x-axis points for this paper from the reference AIDA file, and cache them. - void _cacheXAxisData() const; + // /// Get the x-axis points for this paper from the reference AIDA file, and cache them. + // void _cacheXAxisData() const; //@} @@ -550,10 +541,10 @@ /// Flag to indicate whether the histogram directory is present mutable bool _madeHistoDir; - /// Collection of x-axis point data to speed up many autobookings: the - /// reference data file should only be read once. - /// @todo Reduce memory occupancy, or clear after initialisation? - mutable map<string, vector<DPSXPoint> > _dpsData; + // /// Collection of x-axis point data to speed up many autobookings: the + // /// reference data file should only be read once. + // /// @todo Reduce memory occupancy, or clear after initialisation? + // mutable map<string, vector<DPSXPoint> > _dpsData; /// Collection of cached bin edges to speed up many autobookings: the /// reference data file should only be read once. Modified: branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Rivet/AnalysisHandler.hh Mon Jul 18 17:24:03 2011 (r3189) @@ -35,22 +35,6 @@ /// Preferred constructor, with optional run name. AnalysisHandler(const string& runname=""); - - /// @brief Make a Rivet handler with a set base filename and store type. - /// - /// An AnalysisHandler built with this constructor sets the output histo format - /// and filename when the handler is created rather than when it is written. - /// This is not the preferred behaviour, to allow for more flexible histogramming - /// in future, use the writeData() method to supply the filename and format at - /// the point of file-writing. - /// - /// Note that the run name is now a compulsory argument: this is to avoid - /// conflict with the preferred one-argument constructor. - /// - /// @deprecated Prefer to specify output files and formats explicitly. - AnalysisHandler(const string& basefilename, const string& runname, HistoFormat storetype=AIDAML); - - /// @brief Destructor /// The destructor is not virtual, as this class should not be inherited from. ~AnalysisHandler(); @@ -60,18 +44,6 @@ private: - /// Do the initialisation of the AIDA analysis factories. - /// @deprecated When AIDA goes, this goes... - void _setupFactories(const string& basefilename, HistoFormat storetype); - - /// Do the initialisation of the AIDA analysis factories with no store. - /// @deprecated When AIDA goes, this goes... - void _setupFactories(); - - /// Convert any IHistogram1D objects in the AIDA tree to IDataPointSet objects. - /// @deprecated When AIDA goes, this goes... - void _normalizeTree(AIDA::ITree& tree); - /// Get a logger object. Log& getLog() const; @@ -203,11 +175,6 @@ /// @deprecated All this will be removed when histogramming is overhauled //@{ - /// The AIDA analysis factory. - /// @deprecated When AIDA goes, this goes... - AIDA::IAnalysisFactory& analysisFactory(); - - /// Commit the AIDA tree to file. /// @deprecated When AIDA goes, this goes... void commitData(); @@ -218,20 +185,6 @@ void writeData(const std::string& filename); - /// The AIDA tree object. - /// @deprecated When AIDA goes, this goes... - AIDA::ITree& tree(); - - - /// The AIDA histogram factory. - /// @deprecated When AIDA goes, this goes... - AIDA::IHistogramFactory& histogramFactory(); - - - /// The AIDA histogram factory. - /// @deprecated When AIDA goes, this goes... - AIDA::IDataPointSetFactory& datapointsetFactory(); - //@} @@ -264,29 +217,6 @@ //@} - - /// @name AIDA factory handles - /// Note that only the analysis factory can be a shared_ptr, since it deletes all the others. - //@{ - - /// The AIDA analysis factory. - shared_ptr<AIDA::IAnalysisFactory> _theAnalysisFactory; - - /// The AIDA tree factory. - AIDA::ITreeFactory* _theTreeFactory; - - /// The AIDA tree object. - AIDA::ITree* _theTree; - - /// The AIDA histogram factory. - AIDA::IHistogramFactory* _theHistogramFactory; - - /// The AIDA data point set factory. - AIDA::IDataPointSetFactory* _theDataPointSetFactory; - - //@} - - private: /// The assignment operator is private and must never be called. Modified: branches/2011-07-aida2yoda/include/Rivet/HistoFormat.hh ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/HistoFormat.hh Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Rivet/HistoFormat.hh Mon Jul 18 17:24:03 2011 (r3189) @@ -8,7 +8,7 @@ /// Enumeration of available histogram output formats. - enum HistoFormat { AIDAML, FLAT, ROOT }; + enum HistoFormat { YODA, FLAT, ROOT }; /// Typedef for a map of histogram format enums to strings. typedef std::map<HistoFormat, std::string> HistoFormatMap; @@ -21,7 +21,7 @@ /// Function which returns a map from histogram format enums to the corresponding name strings. inline HistoFormatMap getKnownHistoFormats() { HistoFormatMap hfmap; - hfmap[AIDAML] = "AIDA"; + hfmap[YODA] = "YODA"; hfmap[FLAT] = "FLAT"; #ifdef HAVE_ROOT hfmap[ROOT] = "ROOT"; Modified: branches/2011-07-aida2yoda/include/Rivet/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/Makefile.am Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Rivet/Makefile.am Mon Jul 18 17:24:03 2011 (r3189) @@ -12,7 +12,7 @@ Event.hh Event.fhh \ ParticleBase.hh Jet.hh \ Particle.hh Particle.fhh \ - RivetAIDA.hh RivetAIDA.fhh \ + RivetYODA.hh RivetYODA.fhh \ Analysis.hh Analysis.fhh AnalysisBuilder.hh \ AnalysisHandler.hh AnalysisHandler.fhh \ AnalysisInfo.hh ProjectionHandler.hh \ Modified: branches/2011-07-aida2yoda/include/Rivet/Rivet.hh ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/Rivet.hh Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/include/Rivet/Rivet.hh Mon Jul 18 17:24:03 2011 (r3189) @@ -32,7 +32,7 @@ // AIDA headers -#include "Rivet/RivetAIDA.fhh" +#include "Rivet/RivetYODA.fhh" // HepMC headers and helper functions #include "Rivet/RivetHepMC.hh" Copied and modified: branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh (from r3187, branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.fhh) ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.fhh Mon Jul 18 12:51:16 2011 (r3187, copy source) +++ branches/2011-07-aida2yoda/include/Rivet/RivetYODA.fhh Mon Jul 18 17:24:03 2011 (r3189) @@ -1,52 +1,59 @@ -#ifndef ANALYSIS_RIVETAIDA_FHH -#define ANALYSIS_RIVETAIDA_FHH +#ifndef ANALYSIS_RIVETYODA_FHH +#define ANALYSIS_RIVETYODA_FHH + +// \todo use something like RivetBoost.fhh here? +#include "boost/smart_ptr.hpp" /// @author Andy Buckley /// @date 2009-01-30 -/// @brief Forward declarations of AIDA interfaces +/// @author David Grellscheid +/// @date 2011-07-18 +/// @brief Forward declarations of YODA interfaces + +namespace YODA { + class AnalysisObject; + class Histo1D; + class Profile1D; +// class IHistogram2D; +// class IMeasurement; +// class ITreeFactory; +// class ITree; +// class IAxis; +} -namespace AIDA { - class IAnalysisFactory; - class IHistogramFactory; - class IHistogram1D; - class IHistogram2D; - class IProfile1D; - class IDataPointSetFactory; - class IDataPointSet; - class IDataPoint; - class IMeasurement; - class ITreeFactory; - class ITree; - class IAxis; +namespace Rivet { + typedef boost::shared_ptr<YODA::AnalysisObject> AnalysisObjectPtr; + typedef boost::shared_ptr<YODA::Histo1D> Histo1DPtr; + typedef boost::shared_ptr<YODA::Profile1D> Profile1DPtr; } #include <vector> namespace Rivet { - /// Typedef for a collection of bin edges. - typedef std::vector<double> BinEdges; +// /// Typedef for a collection of bin edges. + typedef std::vector<double> BinEdges; - /// Container for x-axis point details - struct DPSXPoint { - DPSXPoint(double xval, double xerrminus, double xerrplus) : - val(xval), errminus(xerrminus), errplus(xerrplus) { } - double val; - double errminus; - double errplus; - }; - - /// Container for x-axis point details - struct DPSXYPoint { - DPSXYPoint(double xval, double xerrminus, double xerrplus, double yval, double yerrminus, double yerrplus) : - xval(xval), xerrminus(xerrminus), xerrplus(xerrplus), yval(yval), yerrminus(yerrminus), yerrplus(yerrplus) { } - double xval; - double xerrminus; - double xerrplus; - double yval; - double yerrminus; - double yerrplus; - }; +// /// Container for x-axis point details +// struct DPSXPoint { +// DPSXPoint(double xval, double xerrminus, double xerrplus) : +// val(xval), errminus(xerrminus), errplus(xerrplus) { } +// double val; +// double errminus; +// double errplus; +// }; + +// /// Container for x-axis point details +// struct DPSXYPoint { +// DPSXYPoint(double xval, double xerrminus, double xerrplus, double yval, double yerrminus, double yerrplus) : +// xval(xval), xerrminus(xerrminus), xerrplus(xerrplus), yval(yval), yerrminus(yerrminus), yerrplus(yerrplus) { } +// double xval; +// double xerrminus; +// double xerrplus; +// double yval; +// double yerrminus; +// double yerrplus; +// }; } Copied and modified: branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh (from r3187, branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.hh) ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/RivetAIDA.hh Mon Jul 18 12:51:16 2011 (r3187, copy source) +++ branches/2011-07-aida2yoda/include/Rivet/RivetYODA.hh Mon Jul 18 17:24:03 2011 (r3189) @@ -1,63 +1,51 @@ -#ifndef RIVET_RIVETAIDA_HH -#define RIVET_RIVETAIDA_HH +#ifndef RIVET_RIVETYODA_HH +#define RIVET_RIVETYODA_HH /// @author Andy Buckley /// @date 2009-01-30 +/// @author David Grellscheid +/// @date 2011-07-18 // Include files #include "Rivet/Rivet.hh" -#include "Rivet/RivetAIDA.fhh" -#include "LWH/AIAnalysisFactory.h" -#include "LWH/AIHistogramFactory.h" -#include "LWH/AIHistogram1D.h" -#include "LWH/AIHistogram2D.h" -#include "LWH/AIProfile1D.h" -#include "LWH/AITreeFactory.h" -#include "LWH/AIDataPointSetFactory.h" -#include "LWH/AIDataPointSet.h" -#include "LWH/AIDataPoint.h" -#include "LWH/AIMeasurement.h" -#include "LWH/AITree.h" -#include "LWH/AIAxis.h" +#include "Rivet/RivetYODA.fhh" +#include "YODA/AnalysisObject.h" +#include "YODA/Histo1D.h" +#include "YODA/Profile1D.h" namespace Rivet { - - AIDA::IAnalysisFactory* createAnalysisFactory(); - /// Function to get a map of all the bin edge vectors in a paper with the /// given @a papername. map<string, BinEdges> getBinEdges(string papername); - map<string, BinEdges> getBinEdges(const map<string, vector<DPSXPoint> >& xpoints); + // map<string, BinEdges> getBinEdges(const map<string, vector<DPSXPoint> >& xpoints); - map<string, vector<DPSXPoint> > getDPSXValsErrs(string papername); + // map<string, vector<DPSXPoint> > getDPSXValsErrs(string papername); - map<string, vector<DPSXYPoint> > getDPSXYValsErrs(string papername); + // map<string, vector<DPSXYPoint> > getDPSXYValsErrs(string papername); /// Get the file system path to the AIDA reference file for this paper. string getDatafilePath(string papername); - /// Return the integral over the histogram bins - inline double integral(AIDA::IHistogram1D* histo) { - double intg = 0.; - for ( int i = 0; i < histo->axis().bins(); ++i ) { - // Don't multiply with binWidth -- it's already included in binHeight - intg += histo->binHeight(i); // * histo->axis().binWidth(i); - } - return intg; - } - - using AIDA::IHistogram1D; - using AIDA::IHistogram2D; - using AIDA::IDataPointSet; - using AIDA::IDataPoint; - using AIDA::IMeasurement; - using AIDA::ITree; - using AIDA::IAxis; - using AIDA::IProfile1D; - - + // /// Return the integral over the histogram bins + // inline double integral(AIDA::IHistogram1D* histo) { + // double intg = 0.; + // for ( int i = 0; i < histo->axis().bins(); ++i ) { + // // Don't multiply with binWidth -- it's already included in binHeight + // intg += histo->binHeight(i); // * histo->axis().binWidth(i); + // } + // return intg; + // } + + using YODA::Histo1D; + using YODA::Profile1D; + // using AIDA::IHistogram2D; + // using AIDA::IDataPointSet; + // using AIDA::IDataPoint; + // using AIDA::IMeasurement; + // using AIDA::ITree; + // using AIDA::IAxis; } #endif Modified: branches/2011-07-aida2yoda/src/Analyses/ExampleAnalysis.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/ExampleAnalysis.cc Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Analyses/ExampleAnalysis.cc Mon Jul 18 17:24:03 2011 (r3189) @@ -1,7 +1,7 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/Logging.hh" -#include "Rivet/RivetAIDA.hh" +#include "Rivet/RivetYODA.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/FastJets.hh" @@ -41,18 +41,18 @@ addProjection(Sphericity(cfs), "Sphericity"); // Histograms - _histTot = bookHistogram1D("TotalMult", 100, -0.5, 99.5); - _histChTot = bookHistogram1D("TotalChMult", 50, -1.0, 99.0); - _histHadrTot = bookHistogram1D("HadrTotalMult", 100, -0.5, 99.5); - _histHadrChTot = bookHistogram1D("HadrTotalChMult", 50, -1.0, 99.0); - _histMajor = bookHistogram1D("Major", 10, 0.0, 0.6); - _histSphericity = bookHistogram1D("Sphericity", 10, 0.0, 0.8); - _histAplanarity = bookHistogram1D("Aplanarity", 10, 0.0, 0.3); + _histTot = bookHisto1D("TotalMult", 100, -0.5, 99.5); + _histChTot = bookHisto1D("TotalChMult", 50, -1.0, 99.0); + _histHadrTot = bookHisto1D("HadrTotalMult", 100, -0.5, 99.5); + _histHadrChTot = bookHisto1D("HadrTotalChMult", 50, -1.0, 99.0); + _histMajor = bookHisto1D("Major", 10, 0.0, 0.6); + _histSphericity = bookHisto1D("Sphericity", 10, 0.0, 0.8); + _histAplanarity = bookHisto1D("Aplanarity", 10, 0.0, 0.3); // Non-uniform binning example: double edges[11] = { 0.5, 0.6, 0.7, 0.80, 0.85, 0.9, 0.92, 0.94, 0.96, 0.98, 1.0 }; vector<double> vedges(edges, edges+11); - _histThrust = bookHistogram1D("Thrust", vedges); + _histThrust = bookHisto1D("Thrust", vedges); } @@ -112,14 +112,14 @@ //@{ /// Histograms - AIDA::IHistogram1D* _histTot; - AIDA::IHistogram1D* _histChTot; - AIDA::IHistogram1D* _histHadrTot; - AIDA::IHistogram1D* _histHadrChTot; - AIDA::IHistogram1D* _histThrust; - AIDA::IHistogram1D* _histMajor; - AIDA::IHistogram1D* _histSphericity; - AIDA::IHistogram1D* _histAplanarity; + Histo1DPtr _histTot; + Histo1DPtr _histChTot; + Histo1DPtr _histHadrTot; + Histo1DPtr _histHadrChTot; + Histo1DPtr _histThrust; + Histo1DPtr _histMajor; + Histo1DPtr _histSphericity; + Histo1DPtr _histAplanarity; //@} }; Modified: branches/2011-07-aida2yoda/src/Analyses/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/Makefile.am Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Analyses/Makefile.am Mon Jul 18 17:24:03 2011 (r3189) @@ -3,9 +3,9 @@ LIBS = $(FASTJETCONFIGLIBADD) lib_LTLIBRARIES = -noinst_LTLIBRARIES = libRivetAnalysisTools.la -libRivetAnalysisTools_la_SOURCES = \ - MC_JetAnalysis.cc +#noinst_LTLIBRARIES = libRivetAnalysisTools.la +#libRivetAnalysisTools_la_SOURCES = \ +# MC_JetAnalysis.cc ## ANALYSIS CATEGORIES ## @@ -34,217 +34,217 @@ ## --disable-obsolete configure flag. -lib_LTLIBRARIES += RivetALICEAnalyses.la -RivetALICEAnalyses_la_SOURCES = \ - ALICE_2010_S8706239.cc \ - ALICE_2010_S8625980.cc \ - ALICE_2010_S8624100.cc - - -lib_LTLIBRARIES += RivetATLASAnalyses.la -RivetATLASAnalyses_la_SOURCES = \ - ATLAS_2010_S8591806.cc \ - ATLAS_2010_S8817804.cc \ - ATLAS_2010_S8894728.cc \ - ATLAS_2010_S8914702.cc \ - ATLAS_2010_S8918562.cc \ - ATLAS_2010_S8919674.cc \ - ATLAS_2011_S8924791.cc \ - ATLAS_2011_S8971293.cc \ - ATLAS_2010_S8994773.cc \ - ATLAS_2011_S8983313.cc \ - ATLAS_2011_S9002537.cc -if ENABLE_UNVALIDATED -RivetATLASAnalyses_la_SOURCES += \ - ATLAS_2010_CONF_2010_049.cc \ - ATLAS_2011_S9019561.cc \ - ATLAS_2011_CONF_2011_090.cc -endif - - -lib_LTLIBRARIES += RivetCMSAnalyses.la -RivetCMSAnalyses_la_SOURCES = \ - CMS_2011_S8957746.cc - - -lib_LTLIBRARIES += RivetLHCbAnalyses.la -RivetLHCbAnalyses_la_SOURCES = -if ENABLE_UNVALIDATED -RivetLHCbAnalyses_la_SOURCES += \ - LHCB_2010_S8758301.cc -endif - - -lib_LTLIBRARIES += RivetCDFAnalyses.la -RivetCDFAnalyses_la_SOURCES = \ - CDF_1988_S1865951.cc \ - CDF_1990_S2089246.cc \ - CDF_1994_S2952106.cc \ - CDF_1996_S3418421.cc \ - CDF_1998_S3618439.cc \ - CDF_2000_S4155203.cc \ - CDF_2000_S4266730.cc \ - CDF_2001_S4517016.cc \ - CDF_2001_S4563131.cc \ - CDF_2001_S4751469.cc \ - CDF_2002_S4796047.cc \ - CDF_2004_S5839831.cc \ - CDF_2005_S6080774.cc \ - CDF_2005_S6217184.cc \ - CDF_2006_S6450792.cc \ - CDF_2006_S6653332.cc \ - CDF_2007_S7057202.cc \ - CDF_2008_S7540469.cc \ - CDF_2008_S7828950.cc \ - CDF_2008_S8093652.cc \ - CDF_2008_S8095620.cc \ - CDF_2009_S8233977.cc \ - CDF_2009_S8383952.cc \ - CDF_2009_S8436959.cc \ - CDF_2010_S8591881_DY.cc \ - CDF_2010_S8591881_QCD.cc -if ENABLE_PRELIMINARY -RivetCDFAnalyses_la_SOURCES += \ - CDF_2009_NOTE_9936.cc -endif -if ENABLE_OBSOLETE -RivetCDFAnalyses_la_SOURCES += \ - CDF_2008_LEADINGJETS.cc \ - CDF_2008_NOTE_9351.cc -endif -if ENABLE_UNVALIDATED -RivetCDFAnalyses_la_SOURCES += \ - CDF_1993_S2742446.cc \ - CDF_1996_S3108457.cc \ - CDF_1996_S3349578.cc \ - CDF_1997_S3541940.cc \ - CDF_2008_S7541902.cc \ - CDF_2008_S7782535.cc -endif - - -lib_LTLIBRARIES += RivetD0Analyses.la -RivetD0Analyses_la_SOURCES = \ - D0_2000_S4480767.cc \ - D0_2001_S4674421.cc \ - D0_2004_S5992206.cc \ - D0_2006_S6438750.cc \ - D0_2007_S7075677.cc \ - D0_2008_S6879055.cc \ - D0_2008_S7554427.cc \ - D0_2008_S7662670.cc \ - D0_2008_S7719523.cc \ - D0_2008_S7837160.cc \ - D0_2008_S7863608.cc \ - D0_2009_S8202443.cc \ - D0_2009_S8320160.cc \ - D0_2009_S8349509.cc \ - D0_2010_S8566488.cc \ - D0_2010_S8570965.cc \ - D0_2010_S8671338.cc \ - D0_2010_S8821313.cc -if ENABLE_UNVALIDATED -RivetD0Analyses_la_SOURCES += \ - D0_1996_S3214044.cc \ - D0_1996_S3324664.cc -endif - - -lib_LTLIBRARIES += RivetHERAAnalyses.la -RivetHERAAnalyses_la_SOURCES = \ - H1_1994_S2919893.cc \ - H1_2000_S4129130.cc -if ENABLE_UNVALIDATED -RivetHERAAnalyses_la_SOURCES += \ - H1_1995_S3167097.cc \ - ZEUS_2001_S4815815.cc -endif - -lib_LTLIBRARIES += RivetPetraAnalyses.la -RivetPetraAnalyses_la_SOURCES = \ - JADE_1998_S3612880.cc \ - TASSO_1990_S2148048.cc - -lib_LTLIBRARIES += RivetLEPAnalyses.la -RivetLEPAnalyses_la_SOURCES = \ - ALEPH_1991_S2435284.cc \ - ALEPH_1996_S3486095.cc \ - ALEPH_1996_S3196992.cc \ - ALEPH_2004_S5765862.cc \ - DELPHI_1995_S3137023.cc \ - DELPHI_1996_S3430090.cc \ - OPAL_1998_S3780481.cc \ - OPAL_2001_S4553896.cc \ - OPAL_2004_S6132243.cc -if ENABLE_PRELIMINARY -RivetLEPAnalyses_la_SOURCES += \ - DELPHI_2002_069_CONF_603.cc -endif -if ENABLE_UNVALIDATED -RivetLEPAnalyses_la_SOURCES += \ - DELPHI_2003_WUD_03_11.cc \ - OPAL_1993_S2692198.cc -endif - - -lib_LTLIBRARIES += RivetRHICAnalyses.la -RivetRHICAnalyses_la_SOURCES = \ - STAR_2006_S6500200.cc \ - STAR_2006_S6860818.cc \ - STAR_2006_S6870392.cc -if ENABLE_PRELIMINARY -RivetRHICAnalyses_la_SOURCES += \ - STAR_2009_UE_HELEN.cc -endif -if ENABLE_UNVALIDATED -RivetRHICAnalyses_la_SOURCES += \ - STAR_2008_S7869363.cc \ - STAR_2008_S7993412.cc -endif - - -lib_LTLIBRARIES += RivetSPSAnalyses.la -RivetSPSAnalyses_la_SOURCES = \ - UA1_1990_S2044935.cc \ - UA5_1982_S875503.cc \ - UA5_1986_S1583476.cc \ - UA5_1987_S1640666.cc \ - UA5_1988_S1867512.cc \ - UA5_1989_S1926373.cc - - -lib_LTLIBRARIES += RivetMiscAnalyses.la -RivetMiscAnalyses_la_SOURCES = \ - PDG_Hadron_Multiplicities.cc \ - PDG_Hadron_Multiplicities_Ratios.cc \ - JADE_OPAL_2000_S4300807.cc \ - BELLE_2006_S6265367.cc -if ENABLE_UNVALIDATED -RivetMiscAnalyses_la_SOURCES += \ - E735_1998_S3905616.cc \ - SFM_1984_S1178091.cc -endif +# lib_LTLIBRARIES += RivetALICEAnalyses.la +# RivetALICEAnalyses_la_SOURCES = \ +# ALICE_2010_S8706239.cc \ +# ALICE_2010_S8625980.cc \ +# ALICE_2010_S8624100.cc + + +# lib_LTLIBRARIES += RivetATLASAnalyses.la +# RivetATLASAnalyses_la_SOURCES = \ +# ATLAS_2010_S8591806.cc \ +# ATLAS_2010_S8817804.cc \ +# ATLAS_2010_S8894728.cc \ +# ATLAS_2010_S8914702.cc \ +# ATLAS_2010_S8918562.cc \ +# ATLAS_2010_S8919674.cc \ +# ATLAS_2011_S8924791.cc \ +# ATLAS_2011_S8971293.cc \ +# ATLAS_2010_S8994773.cc \ +# ATLAS_2011_S8983313.cc \ +# ATLAS_2011_S9002537.cc +# if ENABLE_UNVALIDATED +# RivetATLASAnalyses_la_SOURCES += \ +# ATLAS_2010_CONF_2010_049.cc \ +# ATLAS_2011_S9019561.cc \ +# ATLAS_2011_CONF_2011_090.cc +# endif + + +# lib_LTLIBRARIES += RivetCMSAnalyses.la +# RivetCMSAnalyses_la_SOURCES = \ +# CMS_2011_S8957746.cc + + +# lib_LTLIBRARIES += RivetLHCbAnalyses.la +# RivetLHCbAnalyses_la_SOURCES = +# if ENABLE_UNVALIDATED +# RivetLHCbAnalyses_la_SOURCES += \ +# LHCB_2010_S8758301.cc +# endif + + +# lib_LTLIBRARIES += RivetCDFAnalyses.la +# RivetCDFAnalyses_la_SOURCES = \ +# CDF_1988_S1865951.cc \ +# CDF_1990_S2089246.cc \ +# CDF_1994_S2952106.cc \ +# CDF_1996_S3418421.cc \ +# CDF_1998_S3618439.cc \ +# CDF_2000_S4155203.cc \ +# CDF_2000_S4266730.cc \ +# CDF_2001_S4517016.cc \ +# CDF_2001_S4563131.cc \ +# CDF_2001_S4751469.cc \ +# CDF_2002_S4796047.cc \ +# CDF_2004_S5839831.cc \ +# CDF_2005_S6080774.cc \ +# CDF_2005_S6217184.cc \ +# CDF_2006_S6450792.cc \ +# CDF_2006_S6653332.cc \ +# CDF_2007_S7057202.cc \ +# CDF_2008_S7540469.cc \ +# CDF_2008_S7828950.cc \ +# CDF_2008_S8093652.cc \ +# CDF_2008_S8095620.cc \ +# CDF_2009_S8233977.cc \ +# CDF_2009_S8383952.cc \ +# CDF_2009_S8436959.cc \ +# CDF_2010_S8591881_DY.cc \ +# CDF_2010_S8591881_QCD.cc +# if ENABLE_PRELIMINARY +# RivetCDFAnalyses_la_SOURCES += \ +# CDF_2009_NOTE_9936.cc +# endif +# if ENABLE_OBSOLETE +# RivetCDFAnalyses_la_SOURCES += \ +# CDF_2008_LEADINGJETS.cc \ +# CDF_2008_NOTE_9351.cc +# endif +# if ENABLE_UNVALIDATED +# RivetCDFAnalyses_la_SOURCES += \ +# CDF_1993_S2742446.cc \ +# CDF_1996_S3108457.cc \ +# CDF_1996_S3349578.cc \ +# CDF_1997_S3541940.cc \ +# CDF_2008_S7541902.cc \ +# CDF_2008_S7782535.cc +# endif + + +# lib_LTLIBRARIES += RivetD0Analyses.la +# RivetD0Analyses_la_SOURCES = \ +# D0_2000_S4480767.cc \ +# D0_2001_S4674421.cc \ +# D0_2004_S5992206.cc \ +# D0_2006_S6438750.cc \ +# D0_2007_S7075677.cc \ +# D0_2008_S6879055.cc \ +# D0_2008_S7554427.cc \ +# D0_2008_S7662670.cc \ +# D0_2008_S7719523.cc \ +# D0_2008_S7837160.cc \ +# D0_2008_S7863608.cc \ +# D0_2009_S8202443.cc \ +# D0_2009_S8320160.cc \ +# D0_2009_S8349509.cc \ +# D0_2010_S8566488.cc \ +# D0_2010_S8570965.cc \ +# D0_2010_S8671338.cc \ +# D0_2010_S8821313.cc +# if ENABLE_UNVALIDATED +# RivetD0Analyses_la_SOURCES += \ +# D0_1996_S3214044.cc \ +# D0_1996_S3324664.cc +# endif + + +# lib_LTLIBRARIES += RivetHERAAnalyses.la +# RivetHERAAnalyses_la_SOURCES = \ +# H1_1994_S2919893.cc \ +# H1_2000_S4129130.cc +# if ENABLE_UNVALIDATED +# RivetHERAAnalyses_la_SOURCES += \ +# H1_1995_S3167097.cc \ +# ZEUS_2001_S4815815.cc +# endif + +# lib_LTLIBRARIES += RivetPetraAnalyses.la +# RivetPetraAnalyses_la_SOURCES = \ +# JADE_1998_S3612880.cc \ +# TASSO_1990_S2148048.cc + +# lib_LTLIBRARIES += RivetLEPAnalyses.la +# RivetLEPAnalyses_la_SOURCES = \ +# ALEPH_1991_S2435284.cc \ +# ALEPH_1996_S3486095.cc \ +# ALEPH_1996_S3196992.cc \ +# ALEPH_2004_S5765862.cc \ +# DELPHI_1995_S3137023.cc \ +# DELPHI_1996_S3430090.cc \ +# OPAL_1998_S3780481.cc \ +# OPAL_2001_S4553896.cc \ +# OPAL_2004_S6132243.cc +# if ENABLE_PRELIMINARY +# RivetLEPAnalyses_la_SOURCES += \ +# DELPHI_2002_069_CONF_603.cc +# endif +# if ENABLE_UNVALIDATED +# RivetLEPAnalyses_la_SOURCES += \ +# DELPHI_2003_WUD_03_11.cc \ +# OPAL_1993_S2692198.cc +# endif + + +# lib_LTLIBRARIES += RivetRHICAnalyses.la +# RivetRHICAnalyses_la_SOURCES = \ +# STAR_2006_S6500200.cc \ +# STAR_2006_S6860818.cc \ +# STAR_2006_S6870392.cc +# if ENABLE_PRELIMINARY +# RivetRHICAnalyses_la_SOURCES += \ +# STAR_2009_UE_HELEN.cc +# endif +# if ENABLE_UNVALIDATED +# RivetRHICAnalyses_la_SOURCES += \ +# STAR_2008_S7869363.cc \ +# STAR_2008_S7993412.cc +# endif + + +# lib_LTLIBRARIES += RivetSPSAnalyses.la +# RivetSPSAnalyses_la_SOURCES = \ +# UA1_1990_S2044935.cc \ +# UA5_1982_S875503.cc \ +# UA5_1986_S1583476.cc \ +# UA5_1987_S1640666.cc \ +# UA5_1988_S1867512.cc \ +# UA5_1989_S1926373.cc + + +# lib_LTLIBRARIES += RivetMiscAnalyses.la +# RivetMiscAnalyses_la_SOURCES = \ +# PDG_Hadron_Multiplicities.cc \ +# PDG_Hadron_Multiplicities_Ratios.cc \ +# JADE_OPAL_2000_S4300807.cc \ +# BELLE_2006_S6265367.cc +# if ENABLE_UNVALIDATED +# RivetMiscAnalyses_la_SOURCES += \ +# E735_1998_S3905616.cc \ +# SFM_1984_S1178091.cc +# endif lib_LTLIBRARIES += RivetMCAnalyses.la RivetMCAnalyses_la_SOURCES = \ - ExampleAnalysis.cc \ - MC_GENERIC.cc \ - MC_JETS.cc \ - MC_PHOTONJETS.cc \ - MC_HJETS.cc \ - MC_WJETS.cc \ - MC_WPOL.cc \ - MC_WWJETS.cc \ - MC_ZJETS.cc \ - MC_ZZJETS.cc \ - MC_LEADINGJETS.cc \ - MC_DIPHOTON.cc \ - MC_SUSY.cc -if ENABLE_UNVALIDATED -RivetMCAnalyses_la_SOURCES += \ - MC_DIJET.cc \ - MC_PHOTONJETUE.cc \ - MC_TTBAR.cc \ - MC_XS.cc -endif + ExampleAnalysis.cc +# MC_GENERIC.cc \ +# MC_JETS.cc \ +# MC_PHOTONJETS.cc \ +# MC_HJETS.cc \ +# MC_WJETS.cc \ +# MC_WPOL.cc \ +# MC_WWJETS.cc \ +# MC_ZJETS.cc \ +# MC_ZZJETS.cc \ +# MC_LEADINGJETS.cc \ +# MC_DIPHOTON.cc \ +# MC_SUSY.cc +# if ENABLE_UNVALIDATED +# RivetMCAnalyses_la_SOURCES += \ +# MC_DIJET.cc \ +# MC_PHOTONJETUE.cc \ +# MC_TTBAR.cc \ +# MC_XS.cc +# endif Copied: branches/2011-07-aida2yoda/src/Analyses/Makefile.am.AIDAversion (from r3187, branches/2011-07-aida2yoda/src/Analyses/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2011-07-aida2yoda/src/Analyses/Makefile.am.AIDAversion Mon Jul 18 17:24:03 2011 (r3189, copy of r3187, branches/2011-07-aida2yoda/src/Analyses/Makefile.am) @@ -0,0 +1,250 @@ +## Flags for building all plugins +AM_LDFLAGS = $(LDFLAGS) -module -avoid-version -L$(FASTJETLIBPATH) +LIBS = $(FASTJETCONFIGLIBADD) +lib_LTLIBRARIES = + +noinst_LTLIBRARIES = libRivetAnalysisTools.la +libRivetAnalysisTools_la_SOURCES = \ + MC_JetAnalysis.cc + +## ANALYSIS CATEGORIES +## +## Unvalidated analyses: add new standard analyses here, and only +## move them into the collider-specific standard plugin libraries +## once they have been finished and checked. The --enable-unvalidated +## flag is needed to install the unvalidated analyses. +## +## Preliminary analyses: validated analyses whose experimental paper has not +## been fully accepted for publication should go here. Analyses in this group +## are considered safe to use but the reference data may yet change. In +## progressing from preliminary status to a permanent published analyses +## collection, the analysis name is very likely to change, so you should ensure +## that any Rivet-using scripts are not broken by such name changes when +## upgrading between Rivet versions. These analyses will not be available if +## Rivet is built with the --disable-preliminary configure flag. +## +## Obsolete analyses: as mentioned above, when a preliminary analysis becomes +## permanent its name will change to reflect its newly published status via the +## publication's SPIRES ID. The previous form of the analysis, possibly with +## different reference histograms, will be retained for one major version of +## Rivet with a status of "obsolete" before being removed, to give users time to +## migrate their run scripts, i.e. if an analysis is marked as obsolete in +## version 1.4.2, it will remain in Rivet's distribution until version +## 1.5.0. Obsolete analyses will not be available if Rivet is built with the +## --disable-obsolete configure flag. + + +lib_LTLIBRARIES += RivetALICEAnalyses.la +RivetALICEAnalyses_la_SOURCES = \ + ALICE_2010_S8706239.cc \ + ALICE_2010_S8625980.cc \ + ALICE_2010_S8624100.cc + + +lib_LTLIBRARIES += RivetATLASAnalyses.la +RivetATLASAnalyses_la_SOURCES = \ + ATLAS_2010_S8591806.cc \ + ATLAS_2010_S8817804.cc \ + ATLAS_2010_S8894728.cc \ + ATLAS_2010_S8914702.cc \ + ATLAS_2010_S8918562.cc \ + ATLAS_2010_S8919674.cc \ + ATLAS_2011_S8924791.cc \ + ATLAS_2011_S8971293.cc \ + ATLAS_2010_S8994773.cc \ + ATLAS_2011_S8983313.cc \ + ATLAS_2011_S9002537.cc +if ENABLE_UNVALIDATED +RivetATLASAnalyses_la_SOURCES += \ + ATLAS_2010_CONF_2010_049.cc \ + ATLAS_2011_S9019561.cc \ + ATLAS_2011_CONF_2011_090.cc +endif + + +lib_LTLIBRARIES += RivetCMSAnalyses.la +RivetCMSAnalyses_la_SOURCES = \ + CMS_2011_S8957746.cc + + +lib_LTLIBRARIES += RivetLHCbAnalyses.la +RivetLHCbAnalyses_la_SOURCES = +if ENABLE_UNVALIDATED +RivetLHCbAnalyses_la_SOURCES += \ + LHCB_2010_S8758301.cc +endif + + +lib_LTLIBRARIES += RivetCDFAnalyses.la +RivetCDFAnalyses_la_SOURCES = \ + CDF_1988_S1865951.cc \ + CDF_1990_S2089246.cc \ + CDF_1994_S2952106.cc \ + CDF_1996_S3418421.cc \ + CDF_1998_S3618439.cc \ + CDF_2000_S4155203.cc \ + CDF_2000_S4266730.cc \ + CDF_2001_S4517016.cc \ + CDF_2001_S4563131.cc \ + CDF_2001_S4751469.cc \ + CDF_2002_S4796047.cc \ + CDF_2004_S5839831.cc \ + CDF_2005_S6080774.cc \ + CDF_2005_S6217184.cc \ + CDF_2006_S6450792.cc \ + CDF_2006_S6653332.cc \ + CDF_2007_S7057202.cc \ + CDF_2008_S7540469.cc \ + CDF_2008_S7828950.cc \ + CDF_2008_S8093652.cc \ + CDF_2008_S8095620.cc \ + CDF_2009_S8233977.cc \ + CDF_2009_S8383952.cc \ + CDF_2009_S8436959.cc \ + CDF_2010_S8591881_DY.cc \ + CDF_2010_S8591881_QCD.cc +if ENABLE_PRELIMINARY +RivetCDFAnalyses_la_SOURCES += \ + CDF_2009_NOTE_9936.cc +endif +if ENABLE_OBSOLETE +RivetCDFAnalyses_la_SOURCES += \ + CDF_2008_LEADINGJETS.cc \ + CDF_2008_NOTE_9351.cc +endif +if ENABLE_UNVALIDATED +RivetCDFAnalyses_la_SOURCES += \ + CDF_1993_S2742446.cc \ + CDF_1996_S3108457.cc \ + CDF_1996_S3349578.cc \ + CDF_1997_S3541940.cc \ + CDF_2008_S7541902.cc \ + CDF_2008_S7782535.cc +endif + + +lib_LTLIBRARIES += RivetD0Analyses.la +RivetD0Analyses_la_SOURCES = \ + D0_2000_S4480767.cc \ + D0_2001_S4674421.cc \ + D0_2004_S5992206.cc \ + D0_2006_S6438750.cc \ + D0_2007_S7075677.cc \ + D0_2008_S6879055.cc \ + D0_2008_S7554427.cc \ + D0_2008_S7662670.cc \ + D0_2008_S7719523.cc \ + D0_2008_S7837160.cc \ + D0_2008_S7863608.cc \ + D0_2009_S8202443.cc \ + D0_2009_S8320160.cc \ + D0_2009_S8349509.cc \ + D0_2010_S8566488.cc \ + D0_2010_S8570965.cc \ + D0_2010_S8671338.cc \ + D0_2010_S8821313.cc +if ENABLE_UNVALIDATED +RivetD0Analyses_la_SOURCES += \ + D0_1996_S3214044.cc \ + D0_1996_S3324664.cc +endif + + +lib_LTLIBRARIES += RivetHERAAnalyses.la +RivetHERAAnalyses_la_SOURCES = \ + H1_1994_S2919893.cc \ + H1_2000_S4129130.cc +if ENABLE_UNVALIDATED +RivetHERAAnalyses_la_SOURCES += \ + H1_1995_S3167097.cc \ + ZEUS_2001_S4815815.cc +endif + +lib_LTLIBRARIES += RivetPetraAnalyses.la +RivetPetraAnalyses_la_SOURCES = \ + JADE_1998_S3612880.cc \ + TASSO_1990_S2148048.cc + +lib_LTLIBRARIES += RivetLEPAnalyses.la +RivetLEPAnalyses_la_SOURCES = \ + ALEPH_1991_S2435284.cc \ + ALEPH_1996_S3486095.cc \ + ALEPH_1996_S3196992.cc \ + ALEPH_2004_S5765862.cc \ + DELPHI_1995_S3137023.cc \ + DELPHI_1996_S3430090.cc \ + OPAL_1998_S3780481.cc \ + OPAL_2001_S4553896.cc \ + OPAL_2004_S6132243.cc +if ENABLE_PRELIMINARY +RivetLEPAnalyses_la_SOURCES += \ + DELPHI_2002_069_CONF_603.cc +endif +if ENABLE_UNVALIDATED +RivetLEPAnalyses_la_SOURCES += \ + DELPHI_2003_WUD_03_11.cc \ + OPAL_1993_S2692198.cc +endif + + +lib_LTLIBRARIES += RivetRHICAnalyses.la +RivetRHICAnalyses_la_SOURCES = \ + STAR_2006_S6500200.cc \ + STAR_2006_S6860818.cc \ + STAR_2006_S6870392.cc +if ENABLE_PRELIMINARY +RivetRHICAnalyses_la_SOURCES += \ + STAR_2009_UE_HELEN.cc +endif +if ENABLE_UNVALIDATED +RivetRHICAnalyses_la_SOURCES += \ + STAR_2008_S7869363.cc \ + STAR_2008_S7993412.cc +endif + + +lib_LTLIBRARIES += RivetSPSAnalyses.la +RivetSPSAnalyses_la_SOURCES = \ + UA1_1990_S2044935.cc \ + UA5_1982_S875503.cc \ + UA5_1986_S1583476.cc \ + UA5_1987_S1640666.cc \ + UA5_1988_S1867512.cc \ + UA5_1989_S1926373.cc + + +lib_LTLIBRARIES += RivetMiscAnalyses.la +RivetMiscAnalyses_la_SOURCES = \ + PDG_Hadron_Multiplicities.cc \ + PDG_Hadron_Multiplicities_Ratios.cc \ + JADE_OPAL_2000_S4300807.cc \ + BELLE_2006_S6265367.cc +if ENABLE_UNVALIDATED +RivetMiscAnalyses_la_SOURCES += \ + E735_1998_S3905616.cc \ + SFM_1984_S1178091.cc +endif + + +lib_LTLIBRARIES += RivetMCAnalyses.la +RivetMCAnalyses_la_SOURCES = \ + ExampleAnalysis.cc \ + MC_GENERIC.cc \ + MC_JETS.cc \ + MC_PHOTONJETS.cc \ + MC_HJETS.cc \ + MC_WJETS.cc \ + MC_WPOL.cc \ + MC_WWJETS.cc \ + MC_ZJETS.cc \ + MC_ZZJETS.cc \ + MC_LEADINGJETS.cc \ + MC_DIPHOTON.cc \ + MC_SUSY.cc +if ENABLE_UNVALIDATED +RivetMCAnalyses_la_SOURCES += \ + MC_DIJET.cc \ + MC_PHOTONJETUE.cc \ + MC_TTBAR.cc \ + MC_XS.cc +endif Modified: branches/2011-07-aida2yoda/src/Core/Analysis.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Core/Analysis.cc Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Core/Analysis.cc Mon Jul 18 17:24:03 2011 (r3189) @@ -1,6 +1,6 @@ // -*- C++ -*- #include "Rivet/Rivet.hh" -#include "Rivet/RivetAIDA.hh" +#include "Rivet/RivetYODA.hh" #include "Rivet/AnalysisHandler.hh" #include "Rivet/AnalysisInfo.hh" #include "Rivet/Analysis.hh" @@ -46,27 +46,6 @@ assert(_info.get() != 0); } - - IAnalysisFactory& Analysis::analysisFactory() { - return handler().analysisFactory(); - } - - - ITree& Analysis::tree() { - return handler().tree(); - } - - - IHistogramFactory& Analysis::histogramFactory() { - return handler().histogramFactory(); - } - - - IDataPointSetFactory& Analysis::datapointsetFactory() { - return handler().datapointsetFactory(); - } - - double Analysis::sqrtS() const { return handler().sqrtS(); } @@ -188,25 +167,25 @@ // Histogramming - void Analysis::_cacheBinEdges() const { - _cacheXAxisData(); - if (_histBinEdges.empty()) { - MSG_TRACE("Getting histo bin edges from AIDA for paper " << name()); - _histBinEdges = getBinEdges(_dpsData); - } - } + // void Analysis::_cacheBinEdges() const { + // _cacheXAxisData(); + // if (_histBinEdges.empty()) { + // MSG_TRACE("Getting histo bin edges from AIDA for paper " << name()); + // _histBinEdges = getBinEdges(_dpsData); + // } + // } - void Analysis::_cacheXAxisData() const { - if (_dpsData.empty()) { - MSG_TRACE("Getting DPS x-axis data from AIDA for paper " << name()); - _dpsData = getDPSXValsErrs(name()); - } - } + // void Analysis::_cacheXAxisData() const { + // if (_dpsData.empty()) { + // MSG_TRACE("Getting DPS x-axis data from AIDA for paper " << name()); + // _dpsData = getDPSXValsErrs(name()); + // } + // } const BinEdges& Analysis::binEdges(const string& hname) const { - _cacheBinEdges(); + // _cacheBinEdges(); MSG_TRACE("Using histo bin edges for " << name() << ":" << hname); const BinEdges& edges = _histBinEdges.find(hname)->second; if (getLog().isActive(Log::TRACE)) { @@ -239,144 +218,145 @@ return binedges; } - IHistogram1D* Analysis::bookHistogram1D(size_t datasetId, size_t xAxisId, + Histo1DPtr Analysis::bookHisto1D(size_t datasetId, size_t xAxisId, size_t yAxisId, const string& title, const string& xtitle, const string& ytitle) { const string axisCode = makeAxisCode(datasetId, xAxisId, yAxisId); - return bookHistogram1D(axisCode, title, xtitle, ytitle); + return bookHisto1D(axisCode, title, xtitle, ytitle); } - IHistogram1D* Analysis::bookHistogram1D(const string& hname, const string& title, - const string& xtitle, const string& ytitle) + Histo1DPtr Analysis::bookHisto1D(const string& hname, const string& title, + const string& xtitle, const string& ytitle) { // Get the bin edges (only read the AIDA file once) const BinEdges edges = binEdges(hname); _makeHistoDir(); const string path = histoPath(hname); - IHistogram1D* hist = histogramFactory().createHistogram1D(path, title, edges); + Histo1DPtr hist( new Histo1D(edges,path,title) ); MSG_TRACE("Made histogram " << hname << " for " << name()); - hist->setXTitle(xtitle); - hist->setYTitle(ytitle); + // hist->setXTitle(xtitle); + // hist->setYTitle(ytitle); return hist; } - IHistogram1D* Analysis::bookHistogram1D(const string& hname, - size_t nbins, double lower, double upper, - const string& title, - const string& xtitle, const string& ytitle) { + Histo1DPtr Analysis::bookHisto1D(const string& hname, + size_t nbins, double lower, double upper, + const string& title, + const string& xtitle, const string& ytitle) { _makeHistoDir(); const string path = histoPath(hname); - IHistogram1D* hist = histogramFactory().createHistogram1D(path, title, nbins, lower, upper); + Histo1DPtr hist( new Histo1D(nbins, lower, upper, path, title) ); MSG_TRACE("Made histogram " << hname << " for " << name()); - hist->setXTitle(xtitle); - hist->setYTitle(ytitle); + // hist->setXTitle(xtitle); + // hist->setYTitle(ytitle); return hist; } - IHistogram1D* Analysis::bookHistogram1D(const string& hname, - const vector<double>& binedges, - const string& title, - const string& xtitle, const string& ytitle) { + Histo1DPtr Analysis::bookHisto1D(const string& hname, + const vector<double>& binedges, + const string& title, + const string& xtitle, + const string& ytitle) { _makeHistoDir(); const string path = histoPath(hname); - IHistogram1D* hist = histogramFactory().createHistogram1D(path, title, binedges); + Histo1DPtr hist( new Histo1D(binedges, path, title) ); MSG_TRACE("Made histogram " << hname << " for " << name()); - hist->setXTitle(xtitle); - hist->setYTitle(ytitle); - return hist; - } - - IHistogram2D* - Analysis::bookHistogram2D(const string& hname, - size_t nxbins, double xlower, double xupper, - size_t nybins, double ylower, double yupper, - const string& title, const string& xtitle, - const string& ytitle, const string& ztitle) { - _makeHistoDir(); - const string path = histoPath(hname); - IHistogram2D* hist = - histogramFactory().createHistogram2D(path, title, nxbins, xlower, xupper, - nybins, ylower, yupper); - MSG_TRACE("Made 2D histogram " << hname << " for " << name()); - hist->setXTitle(xtitle); - hist->setYTitle(ytitle); - hist->setZTitle(ztitle); + // hist->setXTitle(xtitle); + // hist->setYTitle(ytitle); return hist; } - - IHistogram2D* - Analysis::bookHistogram2D(const string& hname, - const vector<double>& xbinedges, - const vector<double>& ybinedges, - const string& title, const string& xtitle, - const string& ytitle, const string& ztitle) { - _makeHistoDir(); - const string path = histoPath(hname); - IHistogram2D* hist = - histogramFactory().createHistogram2D(path, title, xbinedges, ybinedges); - MSG_TRACE("Made 2D histogram " << hname << " for " << name()); - hist->setXTitle(xtitle); - hist->setYTitle(ytitle); - hist->setZTitle(ztitle); - return hist; - } + // IHistogram2D* + // Analysis::bookHistogram2D(const string& hname, + // size_t nxbins, double xlower, double xupper, + // size_t nybins, double ylower, double yupper, + // const string& title, const string& xtitle, + // const string& ytitle, const string& ztitle) { + // _makeHistoDir(); + // const string path = histoPath(hname); + // IHistogram2D* hist = + // histogramFactory().createHistogram2D(path, title, nxbins, xlower, xupper, + // nybins, ylower, yupper); + // MSG_TRACE("Made 2D histogram " << hname << " for " << name()); + // hist->setXTitle(xtitle); + // hist->setYTitle(ytitle); + // hist->setZTitle(ztitle); + // return hist; + // } + + + // IHistogram2D* + // Analysis::bookHistogram2D(const string& hname, + // const vector<double>& xbinedges, + // const vector<double>& ybinedges, + // const string& title, const string& xtitle, + // const string& ytitle, const string& ztitle) { + // _makeHistoDir(); + // const string path = histoPath(hname); + // IHistogram2D* hist = + // histogramFactory().createHistogram2D(path, title, xbinedges, ybinedges); + // MSG_TRACE("Made 2D histogram " << hname << " for " << name()); + // hist->setXTitle(xtitle); + // hist->setYTitle(ytitle); + // hist->setZTitle(ztitle); + // return hist; + // } ///////////////// - IProfile1D* Analysis::bookProfile1D(size_t datasetId, size_t xAxisId, - size_t yAxisId, const string& title, - const string& xtitle, const string& ytitle) { + Profile1DPtr Analysis::bookProfile1D(size_t datasetId, size_t xAxisId, + size_t yAxisId, const string& title, + const string& xtitle, const string& ytitle) { const string axisCode = makeAxisCode(datasetId, xAxisId, yAxisId); return bookProfile1D(axisCode, title, xtitle, ytitle); } - IProfile1D* Analysis::bookProfile1D(const string& hname, const string& title, - const string& xtitle, const string& ytitle) + Profile1DPtr Analysis::bookProfile1D(const string& hname, const string& title, + const string& xtitle, const string& ytitle) { // Get the bin edges (only read the AIDA file once) const BinEdges edges = binEdges(hname); _makeHistoDir(); const string path = histoPath(hname); - IProfile1D* prof = histogramFactory().createProfile1D(path, title, edges); + Profile1DPtr prof( new Profile1D(edges, path, title) ); MSG_TRACE("Made profile histogram " << hname << " for " << name()); - prof->setXTitle(xtitle); - prof->setYTitle(ytitle); + // prof->setXTitle(xtitle); + // prof->setYTitle(ytitle); return prof; } - IProfile1D* Analysis::bookProfile1D(const string& hname, - size_t nbins, double lower, double upper, - const string& title, - const string& xtitle, const string& ytitle) { + Profile1DPtr Analysis::bookProfile1D(const string& hname, + size_t nbins, double lower, double upper, + const string& title, + const string& xtitle, const string& ytitle) { _makeHistoDir(); const string path = histoPath(hname); - IProfile1D* prof = histogramFactory().createProfile1D(path, title, nbins, lower, upper); + Profile1DPtr prof( new Profile1D(nbins, lower, upper, path, title) ); MSG_TRACE("Made profile histogram " << hname << " for " << name()); - prof->setXTitle(xtitle); - prof->setYTitle(ytitle); + // prof->setXTitle(xtitle); + // prof->setYTitle(ytitle); return prof; } - IProfile1D* Analysis::bookProfile1D(const string& hname, - const vector<double>& binedges, - const string& title, - const string& xtitle, const string& ytitle) { + Profile1DPtr Analysis::bookProfile1D(const string& hname, + const vector<double>& binedges, + const string& title, + const string& xtitle, const string& ytitle) { _makeHistoDir(); const string path = histoPath(hname); - IProfile1D* prof = histogramFactory().createProfile1D(path, title, binedges); + Profile1DPtr prof( new Profile1D(binedges, path, title) ); MSG_TRACE("Made profile histogram " << hname << " for " << name()); - prof->setXTitle(xtitle); - prof->setYTitle(ytitle); + // prof->setXTitle(xtitle); + // prof->setYTitle(ytitle); return prof; } @@ -385,57 +365,57 @@ - IDataPointSet* Analysis::bookDataPointSet(const string& hname, const string& title, - const string& xtitle, const string& ytitle) { - _makeHistoDir(); - const string path = histoPath(hname); - IDataPointSet* dps = datapointsetFactory().create(path, title, 2); - MSG_TRACE("Made data point set " << hname << " for " << name()); - dps->setXTitle(xtitle); - dps->setYTitle(ytitle); - return dps; - } - - - IDataPointSet* Analysis::bookDataPointSet(const string& hname, - size_t npts, double lower, double upper, - const string& title, - const string& xtitle, const string& ytitle) { - IDataPointSet* dps = bookDataPointSet(hname, title, xtitle, ytitle); - for (size_t pt = 0; pt < npts; ++pt) { - const double binwidth = (upper-lower)/npts; - const double bincentre = lower + (pt + 0.5) * binwidth; - dps->addPoint(); - IMeasurement* meas = dps->point(pt)->coordinate(0); - meas->setValue(bincentre); - meas->setErrorPlus(binwidth/2.0); - meas->setErrorMinus(binwidth/2.0); - } - return dps; - } - - - IDataPointSet* Analysis::bookDataPointSet(size_t datasetId, size_t xAxisId, - size_t yAxisId, const string& title, - const string& xtitle, const string& ytitle) { - // Get the bin edges (only read the AIDA file once) - _cacheXAxisData(); - // Build the axis code - const string axisCode = makeAxisCode(datasetId, xAxisId, yAxisId); - //const map<string, vector<DPSXPoint> > xpoints = getDPSXValsErrs(papername); - MSG_TRACE("Using DPS x-positions for " << name() << ":" << axisCode); - IDataPointSet* dps = bookDataPointSet(axisCode, title, xtitle, ytitle); - const vector<DPSXPoint> xpts = _dpsData.find(axisCode)->second; - for (size_t pt = 0; pt < xpts.size(); ++pt) { - dps->addPoint(); - IMeasurement* meas = dps->point(pt)->coordinate(0); - meas->setValue(xpts[pt].val); - meas->setErrorPlus(xpts[pt].errplus); - meas->setErrorMinus(xpts[pt].errminus); - } - MSG_TRACE("Made DPS " << axisCode << " for " << name()); - return dps; - } + // IDataPointSet* Analysis::bookDataPointSet(const string& hname, const string& title, + // const string& xtitle, const string& ytitle) { + // _makeHistoDir(); + // const string path = histoPath(hname); + // IDataPointSet* dps = datapointsetFactory().create(path, title, 2); + // MSG_TRACE("Made data point set " << hname << " for " << name()); + // dps->setXTitle(xtitle); + // dps->setYTitle(ytitle); + // return dps; + // } + + + // IDataPointSet* Analysis::bookDataPointSet(const string& hname, + // size_t npts, double lower, double upper, + // const string& title, + // const string& xtitle, const string& ytitle) { + // IDataPointSet* dps = bookDataPointSet(hname, title, xtitle, ytitle); + // for (size_t pt = 0; pt < npts; ++pt) { + // const double binwidth = (upper-lower)/npts; + // const double bincentre = lower + (pt + 0.5) * binwidth; + // dps->addPoint(); + // IMeasurement* meas = dps->point(pt)->coordinate(0); + // meas->setValue(bincentre); + // meas->setErrorPlus(binwidth/2.0); + // meas->setErrorMinus(binwidth/2.0); + // } + // return dps; + // } + + + // IDataPointSet* Analysis::bookDataPointSet(size_t datasetId, size_t xAxisId, + // size_t yAxisId, const string& title, + // const string& xtitle, const string& ytitle) { + // // Get the bin edges (only read the AIDA file once) + // _cacheXAxisData(); + // // Build the axis code + // const string axisCode = makeAxisCode(datasetId, xAxisId, yAxisId); + // //const map<string, vector<DPSXPoint> > xpoints = getDPSXValsErrs(papername); + // MSG_TRACE("Using DPS x-positions for " << name() << ":" << axisCode); + // IDataPointSet* dps = bookDataPointSet(axisCode, title, xtitle, ytitle); + // const vector<DPSXPoint> xpts = _dpsData.find(axisCode)->second; + // for (size_t pt = 0; pt < xpts.size(); ++pt) { + // dps->addPoint(); + // IMeasurement* meas = dps->point(pt)->coordinate(0); + // meas->setValue(xpts[pt].val); + // meas->setErrorPlus(xpts[pt].errplus); + // meas->setErrorMinus(xpts[pt].errminus); + // } + // MSG_TRACE("Made DPS " << axisCode << " for " << name()); + // return dps; + // } //////////////////// @@ -450,27 +430,30 @@ // foreach (const string& d, dirs) { //tree().mkdir(); //} - tree().mkdirs(histoDir()); + + // \todo YODA version + + //tree().mkdirs(histoDir()); } _madeHistoDir = true; } } - void Analysis::normalize(AIDA::IHistogram1D*& histo, double norm) { + void Analysis::normalize(Histo1DPtr histo, double norm) { if (!histo) { MSG_ERROR("Failed to normalize histo=NULL in analysis " << name() << " (norm=" << norm << ")"); return; } - const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + const string hpath = histo->path(); MSG_TRACE("Normalizing histo " << hpath << " to " << norm); double oldintg = 0.0; - int nBins = histo->axis().bins(); + int nBins = histo->numBins(); for (int iBin = 0; iBin != nBins; ++iBin) { // Leaving out factor of binWidth because AIDA's "height" already includes a width factor. - oldintg += histo->binHeight(iBin); // * histo->axis().binWidth(iBin); + oldintg += histo->bin(iBin).area(); // * histo->axis().binWidth(iBin); } if (oldintg == 0.0) { MSG_WARNING("Histo " << hpath << " has null integral during normalization"); @@ -482,126 +465,127 @@ } - void Analysis::scale(AIDA::IHistogram1D*& histo, double scale) { + void Analysis::scale(Histo1DPtr histo, double scale) { if (!histo) { MSG_ERROR("Failed to scale histo=NULL in analysis " << name() << " (scale=" << scale << ")"); return; } - const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + const string hpath = histo->path(); MSG_TRACE("Scaling histo " << hpath); vector<double> x, y, ex, ey; - for (size_t i = 0, N = histo->axis().bins(); i < N; ++i) { - x.push_back(0.5 * (histo->axis().binLowerEdge(i) + histo->axis().binUpperEdge(i))); - ex.push_back(histo->axis().binWidth(i)*0.5); + for (size_t i = 0, N = histo->numBins(); i < N; ++i) { + x.push_back( histo->bin(i).midpoint() ); + ex.push_back(histo->bin(i).width()*0.5); - // "Bin height" is a misnomer in the AIDA spec: width is neglected. // We'd like to do this: y.push_back(histo->binHeight(i) * scale); - y.push_back(histo->binHeight(i)*scale/histo->axis().binWidth(i)); + y.push_back(histo->bin(i).height()*scale); - // "Bin error" is a misnomer in the AIDA spec: width is neglected. // We'd like to do this: ey.push_back(histo->binError(i) * scale); - ey.push_back(histo->binError(i)*scale/histo->axis().binWidth(i)); + ey.push_back(histo->bin(i).heightError()*scale); } string title = histo->title(); - string xtitle = histo->xtitle(); - string ytitle = histo->ytitle(); - - tree().mkdir("/tmpnormalize"); - tree().mv(hpath, "/tmpnormalize"); - - AIDA::IDataPointSet* dps = datapointsetFactory().createXY(hpath, title, x, y, ex, ey); - dps->setXTitle(xtitle); - dps->setYTitle(ytitle); - - tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo))); - tree().rmdir("/tmpnormalize"); - - // Set histo pointer to null - it can no longer be used. - histo = 0; - } - - - void Analysis::normalize(AIDA::IHistogram2D*& histo, double norm) { - if (!histo) { - MSG_ERROR("Failed to normalize histo=NULL in analysis " - << name() << " (norm=" << norm << ")"); - return; - } - const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); - MSG_TRACE("Normalizing histo " << hpath << " to " << norm); - - double oldintg = 0.0; - int nxBins = histo->xAxis().bins(); - int nyBins = histo->yAxis().bins(); - for (int ixBin = 0; ixBin != nxBins; ++ixBin) - for (int iyBin = 0; iyBin != nyBins; ++iyBin) { - // Leaving out factor of binWidth because AIDA's "height" - // already includes a width factor. - oldintg += histo->binHeight(ixBin, iyBin); // * histo->axis().binWidth(iBin); - } - if (oldintg == 0.0) { - MSG_WARNING("Histo " << hpath << " has null integral during normalization"); - return; - } + // string xtitle = histo->xtitle(); + // string ytitle = histo->ytitle(); - // Scale by the normalisation factor. - scale(histo, norm/oldintg); - } + // \todo YODA - void Analysis::scale(AIDA::IHistogram2D*& histo, double scale) { - if (!histo) { - MSG_ERROR("Failed to scale histo=NULL in analysis " - << name() << " (scale=" << scale << ")"); - return; - } - const string hpath = - tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); - MSG_TRACE("Scaling histo " << hpath); - - vector<double> x, y, z, ex, ey, ez; - for (size_t ix = 0, Nx = histo->xAxis().bins(); ix < Nx; ++ix) - for (size_t iy = 0, Ny = histo->yAxis().bins(); iy < Ny; ++iy) { - x.push_back(0.5 * (histo->xAxis().binLowerEdge(ix) + - histo->xAxis().binUpperEdge(ix))); - ex.push_back(histo->xAxis().binWidth(ix)*0.5); - y.push_back(0.5 * (histo->yAxis().binLowerEdge(iy) + - histo->yAxis().binUpperEdge(iy))); - ey.push_back(histo->yAxis().binWidth(iy)*0.5); - - // "Bin height" is a misnomer in the AIDA spec: width is neglected. - // We'd like to do this: y.push_back(histo->binHeight(i) * scale); - z.push_back(histo->binHeight(ix, iy)*scale/ - (histo->xAxis().binWidth(ix)*histo->yAxis().binWidth(iy))); - // "Bin error" is a misnomer in the AIDA spec: width is neglected. - // We'd like to do this: ey.push_back(histo->binError(i) * scale); - ez.push_back(histo->binError(ix, iy)*scale/ - (histo->xAxis().binWidth(ix)*histo->yAxis().binWidth(iy))); - } + // tree().mkdir("/tmpnormalize"); + // tree().mv(hpath, "/tmpnormalize"); - string title = histo->title(); - string xtitle = histo->xtitle(); - string ytitle = histo->ytitle(); - string ztitle = histo->ztitle(); - - tree().mkdir("/tmpnormalize"); - tree().mv(hpath, "/tmpnormalize"); - - AIDA::IDataPointSet* dps = - datapointsetFactory().createXYZ(hpath, title, x, y, z, ex, ey, ez); - dps->setXTitle(xtitle); - dps->setYTitle(ytitle); - dps->setZTitle(ztitle); - - tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo))); - tree().rmdir("/tmpnormalize"); - - // Set histo pointer to null - it can no longer be used. - histo = 0; - } + // AIDA::IDataPointSet* dps = datapointsetFactory().createXY(hpath, title, x, y, ex, ey); + // dps->setXTitle(xtitle); + // dps->setYTitle(ytitle); + + // tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo))); + // tree().rmdir("/tmpnormalize"); + + // // Set histo pointer to null - it can no longer be used. + // histo = 0; + } + + + // void Analysis::normalize(AIDA::IHistogram2D*& histo, double norm) { + // if (!histo) { + // MSG_ERROR("Failed to normalize histo=NULL in analysis " + // << name() << " (norm=" << norm << ")"); + // return; + // } + // const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + // MSG_TRACE("Normalizing histo " << hpath << " to " << norm); + + // double oldintg = 0.0; + // int nxBins = histo->xAxis().bins(); + // int nyBins = histo->yAxis().bins(); + // for (int ixBin = 0; ixBin != nxBins; ++ixBin) + // for (int iyBin = 0; iyBin != nyBins; ++iyBin) { + // // Leaving out factor of binWidth because AIDA's "height" + // // already includes a width factor. + // oldintg += histo->binHeight(ixBin, iyBin); // * histo->axis().binWidth(iBin); + // } + // if (oldintg == 0.0) { + // MSG_WARNING("Histo " << hpath << " has null integral during normalization"); + // return; + // } + + // // Scale by the normalisation factor. + // scale(histo, norm/oldintg); + // } + + + // void Analysis::scale(AIDA::IHistogram2D*& histo, double scale) { + // if (!histo) { + // MSG_ERROR("Failed to scale histo=NULL in analysis " + // << name() << " (scale=" << scale << ")"); + // return; + // } + // const string hpath = + // tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + // MSG_TRACE("Scaling histo " << hpath); + + // vector<double> x, y, z, ex, ey, ez; + // for (size_t ix = 0, Nx = histo->xAxis().bins(); ix < Nx; ++ix) + // for (size_t iy = 0, Ny = histo->yAxis().bins(); iy < Ny; ++iy) { + // x.push_back(0.5 * (histo->xAxis().binLowerEdge(ix) + + // histo->xAxis().binUpperEdge(ix))); + // ex.push_back(histo->xAxis().binWidth(ix)*0.5); + // y.push_back(0.5 * (histo->yAxis().binLowerEdge(iy) + + // histo->yAxis().binUpperEdge(iy))); + // ey.push_back(histo->yAxis().binWidth(iy)*0.5); + + // // "Bin height" is a misnomer in the AIDA spec: width is neglected. + // // We'd like to do this: y.push_back(histo->binHeight(i) * scale); + // z.push_back(histo->binHeight(ix, iy)*scale/ + // (histo->xAxis().binWidth(ix)*histo->yAxis().binWidth(iy))); + // // "Bin error" is a misnomer in the AIDA spec: width is neglected. + // // We'd like to do this: ey.push_back(histo->binError(i) * scale); + // ez.push_back(histo->binError(ix, iy)*scale/ + // (histo->xAxis().binWidth(ix)*histo->yAxis().binWidth(iy))); + // } + + // string title = histo->title(); + // string xtitle = histo->xtitle(); + // string ytitle = histo->ytitle(); + // string ztitle = histo->ztitle(); + + // tree().mkdir("/tmpnormalize"); + // tree().mv(hpath, "/tmpnormalize"); + + // AIDA::IDataPointSet* dps = + // datapointsetFactory().createXYZ(hpath, title, x, y, z, ex, ey, ez); + // dps->setXTitle(xtitle); + // dps->setYTitle(ytitle); + // dps->setZTitle(ztitle); + + // tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo))); + // tree().rmdir("/tmpnormalize"); + + // // Set histo pointer to null - it can no longer be used. + // histo = 0; + // } } Modified: branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Core/AnalysisHandler.cc Mon Jul 18 17:24:03 2011 (r3189) @@ -18,27 +18,10 @@ : _runname(runname), _numEvents(0), _sumOfWeights(0.0), _xs(-1.0), _initialised(false) - { - _theAnalysisFactory.reset( createAnalysisFactory() ); - _setupFactories(); - } - - - AnalysisHandler::AnalysisHandler(const string& basefilename, - const string& runname, HistoFormat storetype) - : _runname(runname), _numEvents(0), - _sumOfWeights(0.0), _xs(-1.0), - _initialised(false) - { - cerr << "AnalysisHandler(basefilename, runname, format) constructor is deprecated: " - << "please migrate your code to use the one-arg constructor" << endl; - _theAnalysisFactory.reset( createAnalysisFactory() ); - _setupFactories(basefilename, storetype); - } - + {} AnalysisHandler::~AnalysisHandler() - { } + {} Log& AnalysisHandler::getLog() const { @@ -163,11 +146,6 @@ // Print out number of events processed MSG_INFO("Processed " << _numEvents << " event" << (_numEvents == 1 ? "" : "s")); - // Change AIDA histos into data point sets - MSG_DEBUG("Converting histograms to scatter plots"); - assert(_theTree != 0); - _normalizeTree(tree()); - // Delete analyses MSG_DEBUG("Deleting analyses"); _analyses.clear(); @@ -216,93 +194,13 @@ return *this; } - - void AnalysisHandler::_setupFactories(const string& basefilename, HistoFormat storetype) { - string filename(basefilename), storetypestr(""); - if (storetype == AIDAML) { - if (!endsWith(filename, ".aida")) filename += ".aida"; - storetypestr = "xml"; - } else if (storetype == FLAT) { - if (!endsWith(filename, ".data")) filename += ".data"; - storetypestr = "flat"; - } else if (storetype == ROOT) { - if (!endsWith(filename, ".root")) filename += ".root"; - storetypestr = "root"; - } - _theTreeFactory = _theAnalysisFactory->createTreeFactory(); - _theTree = _theTreeFactory->create(filename, storetypestr, false, true); - _theHistogramFactory = _theAnalysisFactory->createHistogramFactory(tree()); - _theDataPointSetFactory = _theAnalysisFactory->createDataPointSetFactory(tree()); - } - - - void AnalysisHandler::_setupFactories() { - _theTreeFactory = _theAnalysisFactory->createTreeFactory(); - _theTree = _theTreeFactory->create(); - _theHistogramFactory = _theAnalysisFactory->createHistogramFactory(tree()); - _theDataPointSetFactory = _theAnalysisFactory->createDataPointSetFactory(tree()); - } - - void AnalysisHandler::commitData() { - tree().commit(); + // \todo YODA } void AnalysisHandler::writeData(const string& filename) { - tree().commit(filename); - } - - - void AnalysisHandler::_normalizeTree(ITree& tree) { - const vector<string> paths = tree.listObjectNames("/", true); // args set recursive listing - MSG_TRACE("Number of objects in AIDA tree = " << paths.size()); - const string tmpdir = "/RivetNormalizeTmp"; - tree.mkdir(tmpdir); - foreach (const string& path, paths) { - - IManagedObject* hobj = tree.find(path); - if (hobj) { - - // Try to cast to specific histogram types - const IProfile1D* prof = dynamic_cast<IProfile1D*>(hobj); - const IHistogram1D* histo = dynamic_cast<IHistogram1D*>(hobj); - const IHistogram2D* histo2 = dynamic_cast<IHistogram2D*>(hobj); - if (!(histo || histo2 || prof)) { - MSG_TRACE("Could not find the type of histo for " << path << ": it's probably already a DPS"); - continue; - } - - // AIDA path mangling - const size_t lastslash = path.find_last_of("/"); - const string basename = path.substr(lastslash+1, path.length() - (lastslash+1)); - const string tmppath = tmpdir + "/" + basename; - - // If it's a normal histo: - tree.mv(path, tmpdir); - if (histo) { - MSG_TRACE("Converting histo " << path << " to DPS"); - IHistogram1D* tmphisto = dynamic_cast<IHistogram1D*>(tree.find(tmppath)); - if (tmphisto) datapointsetFactory().create(path, *tmphisto); - } - // If it's a 2D histo: - else if (histo2) { - MSG_TRACE("Converting 2D histo " << path << " to DPS"); - IHistogram2D* tmphisto2 = dynamic_cast<IHistogram2D*>(tree.find(tmppath)); - if (tmphisto2) datapointsetFactory().create(path, *tmphisto2); - } - // If it's a profile histo: - else if (prof) { - MSG_TRACE("Converting profile histo " << path << " to DPS"); - IProfile1D* tmpprof = dynamic_cast<IProfile1D*>(tree.find(tmppath)); - if (tmpprof) datapointsetFactory().create(path, *tmpprof); - } - tree.rm(tmppath); - - } - - } - tree.rmdir(tmpdir); + // \todo YODA } @@ -342,27 +240,6 @@ } - - AIDA::IAnalysisFactory& AnalysisHandler::analysisFactory() { - return *_theAnalysisFactory; - } - - - AIDA::ITree& AnalysisHandler::tree() { - return *_theTree; - } - - - AIDA::IHistogramFactory& AnalysisHandler::histogramFactory() { - return *_theHistogramFactory; - } - - - AIDA::IDataPointSetFactory& AnalysisHandler::datapointsetFactory() { - return *_theDataPointSetFactory; - } - - bool AnalysisHandler::needCrossSection() const { bool rtn = false; foreach (const AnaHandle a, _analyses) { Modified: branches/2011-07-aida2yoda/src/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/src/Makefile.am Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Makefile.am Mon Jul 18 17:24:03 2011 (r3189) @@ -10,13 +10,15 @@ libRivet_la_LDFLAGS = \ -L$(prefix)/lib \ + -L$(YODALIBPATH) -R$(YODALIBPATH) \ -L$(HEPMCLIBPATH) -R$(HEPMCLIBPATH) \ -export-dynamic $(VERSIONINFOFLAGS) libRivet_la_LIBADD = \ Core/libRivetCore.la \ Projections/libRivetProjections.la \ - Analyses/libRivetAnalysisTools.la \ Tools/libRivetTools.la \ - -ldl -lm -lHepMC \ + -ldl -lm -lYODA -lHepMC \ $(GSL_LDFLAGS) $(FASTJETCONFIGLIBADD) + +## Analyses/libRivetAnalysisTools.la \ Modified: branches/2011-07-aida2yoda/src/Tools/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/src/Tools/Makefile.am Mon Jul 18 16:44:48 2011 (r3188) +++ branches/2011-07-aida2yoda/src/Tools/Makefile.am Mon Jul 18 17:24:03 2011 (r3189) @@ -6,7 +6,7 @@ libRivetTools_la_SOURCES = \ Logging.cc \ - RivetAIDA.cc \ + RivetYODA.cc \ RivetPaths.cc \ binreloc.c \ Utils.cc \ @@ -14,9 +14,9 @@ TinyXML/tinyxml.cpp \ TinyXML/tinyxmlerror.cpp \ TinyXML/tinyxmlparser.cpp \ - BinnedHistogram.cc \ mt2_bisect.cc \ RivetMT2.cc +## BinnedHistogram.cc \ dist_noinst_HEADERS = binreloc.h mt2_bisect.hh Copied and modified: branches/2011-07-aida2yoda/src/Tools/RivetYODA.cc (from r3187, branches/2011-07-aida2yoda/src/Tools/RivetAIDA.cc) ============================================================================== --- branches/2011-07-aida2yoda/src/Tools/RivetAIDA.cc Mon Jul 18 12:51:16 2011 (r3187, copy source) +++ branches/2011-07-aida2yoda/src/Tools/RivetYODA.cc Mon Jul 18 17:24:03 2011 (r3189) @@ -1,234 +1,234 @@ -#include "Rivet/RivetAIDA.hh" +#include "Rivet/RivetYODA.hh" #include "Rivet/Rivet.hh" -#include "Rivet/RivetBoost.hh" -#include "Rivet/Tools/Utils.hh" +// #include "Rivet/RivetBoost.hh" +// #include "Rivet/Tools/Utils.hh" #include "Rivet/Tools/RivetPaths.hh" -#include "LWH/AnalysisFactory.h" -#include "TinyXML/tinyxml.h" -#include <sstream> -#include <stdexcept> +// #include "LWH/AnalysisFactory.h" +// #include "TinyXML/tinyxml.h" +// #include <sstream> +// #include <stdexcept> using namespace std; namespace Rivet { - /// Get an AIDA system (LWH impl.) - AIDA::IAnalysisFactory* createAnalysisFactory() { - return new LWH::AnalysisFactory(); - } + // /// Get an AIDA system (LWH impl.) + // AIDA::IAnalysisFactory* createAnalysisFactory() { + // return new LWH::AnalysisFactory(); + // } string getDatafilePath(string papername) { - const string path = findAnalysisRefFile(papername + ".aida"); + const string path = findAnalysisRefFile(papername + ".dat"); if (!path.empty()) return path; - throw Rivet::Error("Couldn't find ref data file '" + papername + ".aida" + + throw Rivet::Error("Couldn't find ref data file '" + papername + ".dat" + " in $RIVET_REF_PATH, " + getRivetDataPath() + ", or ."); return ""; } - map<string, vector<DPSXYPoint> > getDPSXYValsErrs(string papername) { - // Get filename - const string xmlfile = getDatafilePath(papername); - - // Open AIDA XML file - TiXmlDocument doc(xmlfile); - doc.LoadFile(); - if (doc.Error()) { - string err = "Error in " + string(doc.Value()); - err += ": " + string(doc.ErrorDesc()); - cerr << err << endl; - throw Error(err); - } - - // Return value, to be populated - map<string, vector<DPSXYPoint> > rtn; - - try { - // Walk down tree to get to the <paper> element - const TiXmlNode* aidaN = doc.FirstChild("aida"); - if (!aidaN) throw Error("Couldn't get <aida> root element"); - for (const TiXmlNode* dpsN = aidaN->FirstChild("dataPointSet"); dpsN; dpsN = dpsN->NextSibling()) { - const TiXmlElement* dpsE = dpsN->ToElement(); - const string plotname = dpsE->Attribute("name"); - const string plotpath = dpsE->Attribute("path"); - /// Check path to make sure that this is a reference histogram. - if (plotpath.find("/REF") != 0) { - cerr << "Skipping non-reference histogram " << plotname << endl; - continue; - } - - /// @todo Check that "path" matches filename - vector<DPSXYPoint> points; - for (const TiXmlNode* dpN = dpsN->FirstChild("dataPoint"); dpN; dpN = dpN->NextSibling()) { - const TiXmlNode* xMeasN = dpN->FirstChild("measurement"); - const TiXmlNode* yMeasN = xMeasN->NextSibling(); - if (xMeasN && yMeasN) { - const TiXmlElement* xMeasE = xMeasN->ToElement(); - const TiXmlElement* yMeasE = yMeasN->ToElement(); - const string xcentreStr = xMeasE->Attribute("value"); - const string xerrplusStr = xMeasE->Attribute("errorPlus"); - const string xerrminusStr = xMeasE->Attribute("errorMinus"); - const string ycentreStr = yMeasE->Attribute("value"); - const string yerrplusStr = yMeasE->Attribute("errorPlus"); - const string yerrminusStr = yMeasE->Attribute("errorMinus"); - //if (!centreStr) throw Error("Couldn't get a valid bin centre"); - //if (!errplusStr) throw Error("Couldn't get a valid bin err+"); - //if (!errminusStr) throw Error("Couldn't get a valid bin err-"); - istringstream xssC(xcentreStr); - istringstream xssP(xerrplusStr); - istringstream xssM(xerrminusStr); - istringstream yssC(ycentreStr); - istringstream yssP(yerrplusStr); - istringstream yssM(yerrminusStr); - double xcentre, xerrplus, xerrminus, ycentre, yerrplus, yerrminus; - xssC >> xcentre; xssP >> xerrplus; xssM >> xerrminus; - yssC >> ycentre; yssP >> yerrplus; yssM >> yerrminus; - //cout << " " << centre << " + " << errplus << " - " << errminus << endl; - DPSXYPoint pt(xcentre, xerrminus, xerrplus, ycentre, yerrminus, yerrplus); - points.push_back(pt); - } else { - cerr << "Couldn't get <measurement> tag" << endl; - /// @todo Throw an exception here? - } - } - - // Add to the map - rtn[plotname] = points; - } - - } - // Write out the error - /// @todo Rethrow as a general XML failure. - catch (std::exception& e) { - cerr << e.what() << endl; - throw; - } - - // Return - return rtn; - } - - map<string, vector<DPSXPoint> > getDPSXValsErrs(string papername) { - // Get filename - const string xmlfile = getDatafilePath(papername); - - // Open AIDA XML file - TiXmlDocument doc(xmlfile); - doc.LoadFile(); - if (doc.Error()) { - string err = "Error in " + string(doc.Value()); - err += ": " + string(doc.ErrorDesc()); - cerr << err << endl; - throw Error(err); - } - - // Return value, to be populated - map<string, vector<DPSXPoint> > rtn; - - try { - // Walk down tree to get to the <paper> element - const TiXmlNode* aidaN = doc.FirstChild("aida"); - if (!aidaN) throw Error("Couldn't get <aida> root element"); - for (const TiXmlNode* dpsN = aidaN->FirstChild("dataPointSet"); dpsN; dpsN = dpsN->NextSibling()) { - const TiXmlElement* dpsE = dpsN->ToElement(); - const string plotname = dpsE->Attribute("name"); - const string plotpath = dpsE->Attribute("path"); - /// Check path to make sure that this is a reference histogram. - if (plotpath.find("/REF") != 0) { - cerr << "Skipping non-reference histogram " << plotname << endl; - continue; - } - - /// @todo Check that "path" matches filename - vector<DPSXPoint> points; - for (const TiXmlNode* dpN = dpsN->FirstChild("dataPoint"); dpN; dpN = dpN->NextSibling()) { - const TiXmlNode* xMeasN = dpN->FirstChild("measurement"); - if (xMeasN) { - const TiXmlElement* xMeasE = xMeasN->ToElement(); - const string centreStr = xMeasE->Attribute("value"); - const string errplusStr = xMeasE->Attribute("errorPlus"); - const string errminusStr = xMeasE->Attribute("errorMinus"); - //if (!centreStr) throw Error("Couldn't get a valid bin centre"); - //if (!errplusStr) throw Error("Couldn't get a valid bin err+"); - //if (!errminusStr) throw Error("Couldn't get a valid bin err-"); - istringstream ssC(centreStr); - istringstream ssP(errplusStr); - istringstream ssM(errminusStr); - double centre, errplus, errminus; - ssC >> centre; ssP >> errplus; ssM >> errminus; - //cout << " " << centre << " + " << errplus << " - " << errminus << endl; - DPSXPoint pt(centre, errminus, errplus); - points.push_back(pt); - } else { - cerr << "Couldn't get <measurement> tag" << endl; - /// @todo Throw an exception here? - } - } - - // Add to the map - rtn[plotname] = points; - } - - } - // Write out the error - /// @todo Rethrow as a general XML failure. - catch (std::exception& e) { - cerr << e.what() << endl; - throw; - } - - // Return - return rtn; - } - - - - map<string, BinEdges> getBinEdges(string papername) { - const map<string, vector<DPSXPoint> > xpoints = getDPSXValsErrs(papername); - return getBinEdges(xpoints); - } - - - - map<string, BinEdges> getBinEdges(const map<string, vector<DPSXPoint> >& xpoints) { - - map<string, BinEdges> rtn; - for (map<string, vector<DPSXPoint> >::const_iterator dsit = xpoints.begin(); dsit != xpoints.end(); ++dsit) { - const string plotname = dsit->first; - list<double> edges; - foreach (const DPSXPoint& xpt, dsit->second) { - const double lowedge = xpt.val - xpt.errminus; - const double highedge = xpt.val + xpt.errplus; - edges.push_back(lowedge); - edges.push_back(highedge); - } - - //cout << "*** " << edges << endl; - - // Remove duplicates (the careful testing is why we haven't used a set) - //cout << edges.size() << " edges -> " << edges.size()/2 << " bins" << endl; - for (list<double>::iterator e = edges.begin(); e != edges.end(); ++e) { - list<double>::iterator e2 = e; - while (e2 != edges.end()) { - if (e != e2) { - if (fuzzyEquals(*e, *e2)) { - edges.erase(e2++); - } - } - ++e2; - } - } - //cout << edges.size() << " edges after dups removal (should be #bins+1)" << endl; - //cout << "@@@ " << edges << endl; - - // Add to the map - rtn[plotname] = BinEdges(edges.begin(), edges.end()); - } - - // Return - return rtn; - } + // map<string, vector<DPSXYPoint> > getDPSXYValsErrs(string papername) { + // // Get filename + // const string xmlfile = getDatafilePath(papername); + + // // Open AIDA XML file + // TiXmlDocument doc(xmlfile); + // doc.LoadFile(); + // if (doc.Error()) { + // string err = "Error in " + string(doc.Value()); + // err += ": " + string(doc.ErrorDesc()); + // cerr << err << endl; + // throw Error(err); + // } + + // // Return value, to be populated + // map<string, vector<DPSXYPoint> > rtn; + + // try { + // // Walk down tree to get to the <paper> element + // const TiXmlNode* aidaN = doc.FirstChild("aida"); + // if (!aidaN) throw Error("Couldn't get <aida> root element"); + // for (const TiXmlNode* dpsN = aidaN->FirstChild("dataPointSet"); dpsN; dpsN = dpsN->NextSibling()) { + // const TiXmlElement* dpsE = dpsN->ToElement(); + // const string plotname = dpsE->Attribute("name"); + // const string plotpath = dpsE->Attribute("path"); + // /// Check path to make sure that this is a reference histogram. + // if (plotpath.find("/REF") != 0) { + // cerr << "Skipping non-reference histogram " << plotname << endl; + // continue; + // } + + // /// @todo Check that "path" matches filename + // vector<DPSXYPoint> points; + // for (const TiXmlNode* dpN = dpsN->FirstChild("dataPoint"); dpN; dpN = dpN->NextSibling()) { + // const TiXmlNode* xMeasN = dpN->FirstChild("measurement"); + // const TiXmlNode* yMeasN = xMeasN->NextSibling(); + // if (xMeasN && yMeasN) { + // const TiXmlElement* xMeasE = xMeasN->ToElement(); + // const TiXmlElement* yMeasE = yMeasN->ToElement(); + // const string xcentreStr = xMeasE->Attribute("value"); + // const string xerrplusStr = xMeasE->Attribute("errorPlus"); + // const string xerrminusStr = xMeasE->Attribute("errorMinus"); + // const string ycentreStr = yMeasE->Attribute("value"); + // const string yerrplusStr = yMeasE->Attribute("errorPlus"); + // const string yerrminusStr = yMeasE->Attribute("errorMinus"); + // //if (!centreStr) throw Error("Couldn't get a valid bin centre"); + // //if (!errplusStr) throw Error("Couldn't get a valid bin err+"); + // //if (!errminusStr) throw Error("Couldn't get a valid bin err-"); + // istringstream xssC(xcentreStr); + // istringstream xssP(xerrplusStr); + // istringstream xssM(xerrminusStr); + // istringstream yssC(ycentreStr); + // istringstream yssP(yerrplusStr); + // istringstream yssM(yerrminusStr); + // double xcentre, xerrplus, xerrminus, ycentre, yerrplus, yerrminus; + // xssC >> xcentre; xssP >> xerrplus; xssM >> xerrminus; + // yssC >> ycentre; yssP >> yerrplus; yssM >> yerrminus; + // //cout << " " << centre << " + " << errplus << " - " << errminus << endl; + // DPSXYPoint pt(xcentre, xerrminus, xerrplus, ycentre, yerrminus, yerrplus); + // points.push_back(pt); + // } else { + // cerr << "Couldn't get <measurement> tag" << endl; + // /// @todo Throw an exception here? + // } + // } + + // // Add to the map + // rtn[plotname] = points; + // } + + // } + // // Write out the error + // /// @todo Rethrow as a general XML failure. + // catch (std::exception& e) { + // cerr << e.what() << endl; + // throw; + // } + + // // Return + // return rtn; + // } + + // map<string, vector<DPSXPoint> > getDPSXValsErrs(string papername) { + // // Get filename + // const string xmlfile = getDatafilePath(papername); + + // // Open AIDA XML file + // TiXmlDocument doc(xmlfile); + // doc.LoadFile(); + // if (doc.Error()) { + // string err = "Error in " + string(doc.Value()); + // err += ": " + string(doc.ErrorDesc()); + // cerr << err << endl; + // throw Error(err); + // } + + // // Return value, to be populated + // map<string, vector<DPSXPoint> > rtn; + + // try { + // // Walk down tree to get to the <paper> element + // const TiXmlNode* aidaN = doc.FirstChild("aida"); + // if (!aidaN) throw Error("Couldn't get <aida> root element"); + // for (const TiXmlNode* dpsN = aidaN->FirstChild("dataPointSet"); dpsN; dpsN = dpsN->NextSibling()) { + // const TiXmlElement* dpsE = dpsN->ToElement(); + // const string plotname = dpsE->Attribute("name"); + // const string plotpath = dpsE->Attribute("path"); + // /// Check path to make sure that this is a reference histogram. + // if (plotpath.find("/REF") != 0) { + // cerr << "Skipping non-reference histogram " << plotname << endl; + // continue; + // } + + // /// @todo Check that "path" matches filename + // vector<DPSXPoint> points; + // for (const TiXmlNode* dpN = dpsN->FirstChild("dataPoint"); dpN; dpN = dpN->NextSibling()) { + // const TiXmlNode* xMeasN = dpN->FirstChild("measurement"); + // if (xMeasN) { + // const TiXmlElement* xMeasE = xMeasN->ToElement(); + // const string centreStr = xMeasE->Attribute("value"); + // const string errplusStr = xMeasE->Attribute("errorPlus"); + // const string errminusStr = xMeasE->Attribute("errorMinus"); + // //if (!centreStr) throw Error("Couldn't get a valid bin centre"); + // //if (!errplusStr) throw Error("Couldn't get a valid bin err+"); + // //if (!errminusStr) throw Error("Couldn't get a valid bin err-"); + // istringstream ssC(centreStr); + // istringstream ssP(errplusStr); + // istringstream ssM(errminusStr); + // double centre, errplus, errminus; + // ssC >> centre; ssP >> errplus; ssM >> errminus; + // //cout << " " << centre << " + " << errplus << " - " << errminus << endl; + // DPSXPoint pt(centre, errminus, errplus); + // points.push_back(pt); + // } else { + // cerr << "Couldn't get <measurement> tag" << endl; + // /// @todo Throw an exception here? + // } + // } + + // // Add to the map + // rtn[plotname] = points; + // } + + // } + // // Write out the error + // /// @todo Rethrow as a general XML failure. + // catch (std::exception& e) { + // cerr << e.what() << endl; + // throw; + // } + + // // Return + // return rtn; + // } + + + + // map<string, BinEdges> getBinEdges(string papername) { + // const map<string, vector<DPSXPoint> > xpoints = getDPSXValsErrs(papername); + // return getBinEdges(xpoints); + // } + + + + // map<string, BinEdges> getBinEdges(const map<string, vector<DPSXPoint> >& xpoints) { + + // map<string, BinEdges> rtn; + // for (map<string, vector<DPSXPoint> >::const_iterator dsit = xpoints.begin(); dsit != xpoints.end(); ++dsit) { + // const string plotname = dsit->first; + // list<double> edges; + // foreach (const DPSXPoint& xpt, dsit->second) { + // const double lowedge = xpt.val - xpt.errminus; + // const double highedge = xpt.val + xpt.errplus; + // edges.push_back(lowedge); + // edges.push_back(highedge); + // } + + // //cout << "*** " << edges << endl; + + // // Remove duplicates (the careful testing is why we haven't used a set) + // //cout << edges.size() << " edges -> " << edges.size()/2 << " bins" << endl; + // for (list<double>::iterator e = edges.begin(); e != edges.end(); ++e) { + // list<double>::iterator e2 = e; + // while (e2 != edges.end()) { + // if (e != e2) { + // if (fuzzyEquals(*e, *e2)) { + // edges.erase(e2++); + // } + // } + // ++e2; + // } + // } + // //cout << edges.size() << " edges after dups removal (should be #bins+1)" << endl; + // //cout << "@@@ " << edges << endl; + + // // Add to the map + // rtn[plotname] = BinEdges(edges.begin(), edges.end()); + // } + + // // Return + // return rtn; + // } }
More information about the Rivet-svn mailing list |