|
[yoda-svn] r280 - trunk/include/YODAblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Aug 18 14:55:42 BST 2011
Author: mkawalec Date: Thu Aug 18 14:55:42 2011 New Revision: 280 Log: Added the X/Y ticks constructor to Axis2D. Not tested!! Modified: trunk/include/YODA/Axis2D.h Modified: trunk/include/YODA/Axis2D.h ============================================================================== --- trunk/include/YODA/Axis2D.h Thu Aug 18 14:36:17 2011 (r279) +++ trunk/include/YODA/Axis2D.h Thu Aug 18 14:55:42 2011 (r280) @@ -114,6 +114,21 @@ _dbn = totalDbn; } + /// A constructor with specified X and Y axis ticks. + Axis2D(const std::vector<double>& xedges, const std::vector<double>& yedges) { + vector<Segment> binLimits; + + for(int i = 0; i < yedges.size() - 1; ++i) { + for(int j = 0; j < xedges.size() - 1; ++j) { + binLimits.push_back(make_pair(make_pair(xedges[j], yedges[i]), + make_pair(xedges[j+1], yedges[i+1]))); + } + } + _mkAxis(binLimits); + _setOutflows(); + } + + /// A copy constructor Axis2D(const Axis2D& a) { _bins = a._bins; @@ -124,9 +139,7 @@ _binHashSparse.second.regenCache(); _regenDelimiters(); } - - - + //@} /// @name Bin insertion operators
More information about the yoda-svn mailing list |