[yoda-svn] r278 - trunk/include/YODA

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Aug 18 14:28:02 BST 2011


Author: mkawalec
Date: Thu Aug 18 14:28:02 2011
New Revision: 278

Log:
Added in-place flipping and corrected mkProfileY accordingly.

Modified:
   trunk/include/YODA/Dbn2D.h
   trunk/include/YODA/Histo2D.h

Modified: trunk/include/YODA/Dbn2D.h
==============================================================================
--- trunk/include/YODA/Dbn2D.h	Thu Aug 18 14:09:47 2011	(r277)
+++ trunk/include/YODA/Dbn2D.h	Thu Aug 18 14:28:02 2011	(r278)
@@ -194,6 +194,13 @@
       return subtract(d);
     }
 
+    /// @brief Interchange X and Y subdistributions
+    /// Mostly used for operations on total distribution of an Axis
+    void flipXY() {
+      Dbn1D temp(_dbnX);
+      _dbnX = _dbnY;
+      _dbnY = temp;
+    }
     //@}
 
 

Modified: trunk/include/YODA/Histo2D.h
==============================================================================
--- trunk/include/YODA/Histo2D.h	Thu Aug 18 14:09:47 2011	(r277)
+++ trunk/include/YODA/Histo2D.h	Thu Aug 18 14:28:02 2011	(r278)
@@ -414,12 +414,11 @@
       }
 
       /// Setting a flipped total distribution
-      Dbn2D& td = _axis.totalDbn();
-      Dbn2D flipped(td.numEntries(), td.sumW(), td.sumW2(), td.sumWY(), 
-                    td.sumWY2(), td.sumWX(), td.sumWX2(), td.sumWXY());
+      Dbn2D td = _axis.totalDbn();
+      td.flipXY();
 
       /// And constructing a profile 1D from all this data
-      Profile1D ret(prof, flipped, underflow, overflow);
+      Profile1D ret(prof, td, underflow, overflow);
       return ret;
 
     }


More information about the yoda-svn mailing list