|
[yoda-svn] r415 - in trunk: . pyext/yoda/includeblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Dec 7 10:58:12 GMT 2011
Author: buckley Date: Wed Dec 7 10:58:11 2011 New Revision: 415 Log: Updating the Cython mappings to provide the totalDbn() methods and add a placeholder mapping for Dbn2D. Completed mappings are needed for Dbn{1,2,3}D and the Profile types. Added: trunk/pyext/yoda/include/20-Dbn2D.pyx Modified: trunk/ChangeLog trunk/pyext/yoda/include/40-Histo1D.pyx trunk/pyext/yoda/include/40-Histo2D.pyx Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Wed Dec 7 10:56:02 2011 (r414) +++ trunk/ChangeLog Wed Dec 7 10:58:11 2011 (r415) @@ -1,5 +1,9 @@ 2011-12-07 Andy Buckley <andy.buckley at cern.ch> + * Updating the Cython mappings to provide the totalDbn() methods + and add a placeholder mapping for Dbn2D. Completed mappings are + needed for Dbn{1,2,3}D and the Profile types. + * Adding totalDbn() accessors to data types. 2011-12-06 Andy Buckley <andy.buckley at cern.ch> Added: trunk/pyext/yoda/include/20-Dbn2D.pyx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/pyext/yoda/include/20-Dbn2D.pyx Wed Dec 7 10:58:11 2011 (r415) @@ -0,0 +1,3 @@ +cdef extern from "YODA/Dbn2D.h" namespace "YODA": + cdef cppclass cDbn2D "Dbn1D": + pass Modified: trunk/pyext/yoda/include/40-Histo1D.pyx ============================================================================== --- trunk/pyext/yoda/include/40-Histo1D.pyx Wed Dec 7 10:56:02 2011 (r414) +++ trunk/pyext/yoda/include/40-Histo1D.pyx Wed Dec 7 10:58:11 2011 (r415) @@ -23,6 +23,7 @@ double highEdge() vector[cHistoBin1D] &bins() cHistoBin1D & bin "bin"(size_t i) + cDbn1D &totalDbn() cDbn1D &underflow() cDbn1D &overflow() void eraseBin(size_t index) @@ -64,13 +65,13 @@ cdef cHisto1D* ptr(self): return <cHisto1D *> self.thisptr - + def asScatter(self): """ h.asScatter() -> Scatter2D Return a 2D scatter data object from the histogram's bins and heights - + """ cdef cScatter2D *s = new cScatter2D() s[0] = Scatter2D_mkScatter(self.ptr()[0]) @@ -91,7 +92,7 @@ h.reset() -> self Reset the histogram but leave the bin structure - + """ self.ptr().reset() return self @@ -149,14 +150,14 @@ self.ptr().bins() return out - + @property def lowEdge(self): """ h.lowEdge -> float The x-value of the lowest edge of the lowest bin of the histogram. - + """ return self.ptr().lowEdge() @@ -166,7 +167,7 @@ h.highEdge -> float The x-value of the highest edge of the highest bin of the histogram. - + """ return self.ptr().highEdge() @@ -192,7 +193,7 @@ Return the total area of the histogram. If overflows is False, ignore over-and underflow bins. - + """ return self.ptr().integral(overflows) @@ -213,7 +214,7 @@ Return the sum of weights squared. If overflows is False, ignore over-and underflow bins. - + """ return self.ptr().sumW2(overflows) @@ -242,7 +243,7 @@ Return the standard deviation. If overflows is False, ignore over-and underflow bins. - + """ return self.ptr().stdDev(overflows) @@ -257,7 +258,7 @@ def __mul__(x, y): """ Scalar multiplication. Equivalent to scaleW acting on a copy. - + """ cdef cHisto1D *res tx, ty = type(x), type(y) @@ -288,8 +289,8 @@ def __div__(x, y): """ Division by scalar (i.e. multiplication by reciprocal) or another - 1D histogram. - + 1D histogram. + """ tx = type(x); ty = type(y) if tx is Histo1D: @@ -297,9 +298,9 @@ return x._div_scalar(y) elif ty is Histo1D: return x._div_histo(y) - + raise RuntimeError('Cannot multiply %r by %r' % (tx, ty)) - + def __repr__(self): return 'Histo1D%r' % self.bins Modified: trunk/pyext/yoda/include/40-Histo2D.pyx ============================================================================== --- trunk/pyext/yoda/include/40-Histo2D.pyx Wed Dec 7 10:56:02 2011 (r414) +++ trunk/pyext/yoda/include/40-Histo2D.pyx Wed Dec 7 10:58:11 2011 (r415) @@ -6,7 +6,7 @@ cHisto2D(size_t nbinsX, double lowerX, double upperX, size_t nbinsY, double lowerY, double upperY, string &path, string &title) - + cHisto2D(cHisto2D &h) void fill(double x, double y, double weight) @@ -22,6 +22,7 @@ double lowEdgeY() double highEdgeX() double highEdgeY() + cDbn2D &totalDbn() vector[cHistoBin2D] &bins() cHistoBin2D& binByCoord(double x, double y) @@ -37,7 +38,7 @@ double xVariance(bool includeoverflows) double yVariance(bool includeoverflows) - + double xStdDev(bool includeoverflows) double yStdDev(bool includeoverflows) @@ -93,7 +94,7 @@ for i in xrange(numbins)]) return self._bins - + @property def lowEdgeX(self): return self.ptr().lowEdgeX()
More information about the yoda-svn mailing list |