[yoda-svn] r414 - in trunk: . include/YODA

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Dec 7 10:56:02 GMT 2011


Author: buckley
Date: Wed Dec  7 10:56:02 2011
New Revision: 414

Log:
Adding totalDbn() accessors to data types.

Modified:
   trunk/ChangeLog
   trunk/include/YODA/Histo1D.h
   trunk/include/YODA/Histo2D.h
   trunk/include/YODA/Profile1D.h
   trunk/include/YODA/Profile2D.h

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Wed Dec  7 10:55:21 2011	(r413)
+++ trunk/ChangeLog	Wed Dec  7 10:56:02 2011	(r414)
@@ -1,3 +1,7 @@
+2011-12-07  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Adding totalDbn() accessors to data types.
+
 2011-12-06  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Making Histo1D/2D::scaleW() write a ScaledBy annotation.

Modified: trunk/include/YODA/Histo1D.h
==============================================================================
--- trunk/include/YODA/Histo1D.h	Wed Dec  7 10:55:21 2011	(r413)
+++ trunk/include/YODA/Histo1D.h	Wed Dec  7 10:56:02 2011	(r414)
@@ -160,6 +160,7 @@
       return _axis.highEdge();
     }
 
+
     /// Access the bin vector
     std::vector<YODA::HistoBin1D>& bins() {
       return _axis.bins();
@@ -170,6 +171,7 @@
       return _axis.bins();
     }
 
+
     /// Access a bin by index (non-const version)
     HistoBin1D& bin(size_t index) {
       return _axis.bins()[index];
@@ -180,6 +182,7 @@
       return _axis.bins()[index];
     }
 
+
     /// Access a bin by coordinate (non-const version)
     HistoBin1D& binByCoord(double x) {
       return _axis.binByCoord(x);
@@ -190,6 +193,18 @@
       return _axis.binByCoord(x);
     }
 
+
+    /// Access summary distribution, including gaps and overflows (non-const version)
+    Dbn1D& totalDbn() {
+      return _axis.totalDbn();
+    }
+
+    /// Access summary distribution, including gaps and overflows (const version)
+    const Dbn1D& totalDbn() const {
+      return _axis.totalDbn();
+    }
+
+
     /// Access underflow (non-const version)
     Dbn1D& underflow() {
       return _axis.underflow();
@@ -200,6 +215,7 @@
       return _axis.underflow();
     }
 
+
     /// Access overflow (non-const version)
     Dbn1D& overflow() {
       return _axis.overflow();
@@ -210,6 +226,7 @@
       return _axis.overflow();
     }
 
+
     /// Add a new bin specifying its lower and upper bound
     void addBin(double from, double to) {
       _axis.addBin(from, to);
@@ -225,6 +242,7 @@
       _axis.addBin(edges);
     }
 
+
     /// Remove a bin
     void eraseBin(size_t index) {
       _axis.eraseBin(index);

Modified: trunk/include/YODA/Histo2D.h
==============================================================================
--- trunk/include/YODA/Histo2D.h	Wed Dec  7 10:55:21 2011	(r413)
+++ trunk/include/YODA/Histo2D.h	Wed Dec  7 10:56:02 2011	(r414)
@@ -170,6 +170,7 @@
       return lowEdgeX();
     }
 
+
     /// Low y edge of this histo's axis
     double lowEdgeY() const {
         return _axis.lowEdgeY();
@@ -179,6 +180,7 @@
       return lowEdgeY();
     }
 
+
     /// High x edge of this histo's axis
     double highEdgeX() const {
       return _axis.highEdgeX();
@@ -188,6 +190,7 @@
       return highEdgeX();
     }
 
+
     /// High y edge of this histo's axis
     double highEdgeY() const {
         return _axis.highEdgeY();
@@ -197,6 +200,7 @@
       return highEdgeY();
     }
 
+
     /// Access the bin vector (non-const version)
     std::vector<YODA::HistoBin2D>& bins() {
       return _axis.bins();
@@ -207,6 +211,7 @@
       return _axis.bins();
     }
 
+
     /// Access a bin by index (non-const version)
     HistoBin2D& bin(size_t index) {
       return _axis.bin(index);
@@ -217,6 +222,7 @@
       return _axis.bin(index);
     }
 
+
     /// Access a bin by coordinate (non-const version)
     HistoBin2D& binByCoord(double x, double y) {
       return _axis.binByCoord(x, y);
@@ -227,6 +233,7 @@
       return _axis.binByCoord(x, y);
     }
 
+
     /// Return bin index (non-const version)
     int findBinIndex(double coordX, double coordY) {
       return _axis.getBinIndex(coordX, coordY);
@@ -237,6 +244,7 @@
       return _axis.getBinIndex(coordX, coordY);
     }
 
+
     /// Number of bins
     const size_t numBins() const {
       return _axis.numBins();
@@ -252,6 +260,17 @@
       return _axis.numBinsY();
     }
 
+
+    /// Access summary distribution, including gaps and overflows (non-const version)
+    Dbn2D& totalDbn() {
+      return _axis.totalDbn();
+    }
+
+    /// Access summary distribution, including gaps and overflows (const version)
+    const Dbn2D& totalDbn() const {
+      return _axis.totalDbn();
+    }
+
     //@}
 
 

Modified: trunk/include/YODA/Profile1D.h
==============================================================================
--- trunk/include/YODA/Profile1D.h	Wed Dec  7 10:55:21 2011	(r413)
+++ trunk/include/YODA/Profile1D.h	Wed Dec  7 10:56:02 2011	(r414)
@@ -197,6 +197,17 @@
     }
 
 
+    /// Access summary distribution, including gaps and overflows (non-const version)
+    Dbn2D& totalDbn() {
+      return _axis.totalDbn();
+    }
+
+    /// Access summary distribution, including gaps and overflows (const version)
+    const Dbn2D& totalDbn() const {
+      return _axis.totalDbn();
+    }
+
+
     /// Access underflow (non-const version)
     Dbn2D& underflow() {
       return _axis.underflow();

Modified: trunk/include/YODA/Profile2D.h
==============================================================================
--- trunk/include/YODA/Profile2D.h	Wed Dec  7 10:55:21 2011	(r413)
+++ trunk/include/YODA/Profile2D.h	Wed Dec  7 10:56:02 2011	(r414)
@@ -13,7 +13,7 @@
 #include <map>
 
 namespace YODA {
-  
+
   // Forward declarations
   class Histo2D;
   class Scatter3D;
@@ -24,7 +24,7 @@
   /// A one-dimensional profile histogram.
   class Profile2D : public AnalysisObject {
   public:
-    
+
     /// Convenience typedefs
     typedef Profile2DAxis Axis;
     typedef Axis::Bins Bins;
@@ -37,15 +37,15 @@
     //@{
 
     /// Constructor giving range and number of bins
-    Profile2D(size_t nbinsX, double lowerX, double upperX, 
-              size_t nbinsY, double lowerY, double upperY, 
+    Profile2D(size_t nbinsX, double lowerX, double upperX,
+              size_t nbinsY, double lowerY, double upperY,
               const std::string& path="", const std::string& title="")
       : AnalysisObject("Profile2D", path, title),
         _axis(nbinsX, lowerX, upperX, nbinsY, lowerY, upperY)
     { }
 
     /// Constructor giving explicit bin edges in the direction of X and Y
-    Profile2D(const std::vector<double>& xedges, const std::vector<double>& yedges, 
+    Profile2D(const std::vector<double>& xedges, const std::vector<double>& yedges,
               const std::string& path="", const std::string& title="")
       : AnalysisObject("Profile2D", path, title),
         _axis(xedges, yedges)
@@ -59,7 +59,7 @@
 
     /// Constructor from a Histo2D's binning, with optional new path
     Profile2D(const Histo2D& h, const std::string& path="");
-    
+
     /// A state setting constructor
     Profile2D();
 
@@ -73,15 +73,16 @@
 
     //@}
 
+
     /// @name Persistency hooks
     //@{
 
     /// Get name of the analysis object type for persisting
     std::string type() const { return "Profile2D"; }
 
-    /// Set the state of the profile object for unpersisting
     //@}
 
+
     /// @name Modifiers
     //@{
 
@@ -89,6 +90,7 @@
     void fill(double x, double y, double z, double weight=1.0);
 
     /// @brief Reset the histogram
+    ///
     /// Keep the binning but reset the statistics
     void reset() {
       _axis.reset();
@@ -110,6 +112,7 @@
       //_axis.rebin(n);
     }
 
+
     /// @brief Bin addition operator
     /// Add a bin to an axis described by its lower-left and higher-right point
     void addBin(double lowX, double lowY, double highX, double highY) {
@@ -117,7 +120,7 @@
     }
 
     /// @brief Bin addition operator
-    /// Add a set of bins delimiting coordinates of which are contained 
+    /// Add a set of bins delimiting coordinates of which are contained
     /// in binLimits vector.
     void addBin(const std::vector<Segment>& binLimits) {
       _axis.addBin(binLimits);
@@ -125,6 +128,7 @@
 
     //@}
 
+
     /// @name Bin accessors
     //@{
 
@@ -133,6 +137,7 @@
       return _axis.bins().size();
     }
 
+
     /// Access the bin vector (non-const)
     std::vector<YODA::ProfileBin2D>& bins() {
       return _axis.bins();
@@ -143,11 +148,13 @@
       return _axis.bins();
     }
 
+
     /// Access a bin by index (non-const)
     const ProfileBin2D& bin(size_t index) const {
       return _axis.bins()[index];
     }
 
+
     /// Access a bin by x-coordinate (non-const)
     ProfileBin2D& binByCoord(double x, double y) {
       return _axis.binByCoord(x, y);
@@ -158,6 +165,18 @@
       return _axis.binByCoord(x, y);
     }
 
+
+    /// Access summary distribution, including gaps and overflows (non-const version)
+    Dbn3D& totalDbn() {
+      return _axis.totalDbn();
+    }
+
+    /// Access summary distribution, including gaps and overflows (const version)
+    const Dbn3D& totalDbn() const {
+      return _axis.totalDbn();
+    }
+
+
     /// Access outflows (non-const)
     std::vector<std::vector<Dbn3D> > outflows() {
       return _axis.outflows();
@@ -170,8 +189,9 @@
 
     //@}
 
+
   public:
-    
+
     /// @name Whole histo data
     //@{
 
@@ -182,7 +202,7 @@
     //@}
 
   public:
-    
+
     /// @name Adding and subtracting histograms
     //@{
 
@@ -197,11 +217,11 @@
       _axis -= toSubtract._axis;
       return *this;
     }
-    
+
     inline bool operator == (const Profile2D& other){
       return _axis == other._axis;
     }
-    
+
     inline bool operator != (const Profile2D& other){
       return ! operator == (other);
     }
@@ -258,4 +278,4 @@
 }
 
 #endif
-    
+


More information about the yoda-svn mailing list