#ifndef __JROOT__JGRAPHERRORS__ #define __JROOT__JGRAPHERRORS__ #include #include "TGraphErrors.h" /** * \author mdejong */ namespace JROOT {} namespace JPP { using namespace JROOT; } namespace JROOT { /** * Data structure for graph data. */ struct JGraphErrors_t { /** * Put data. * * \param x abscissa value * \param y ordinate value * \param ex abscissa error * \param ey ordinate error */ void put(const Double_t x, const Double_t y, const Double_t ex, const Double_t ey) { X .push_back(x); Y .push_back(y); DX.push_back(ex); DY.push_back(ey); } std::vector X; //!< abscissa values std::vector Y; //!< ordinate values std::vector DX; //!< abscissa errors std::vector DY; //!< ordinate errors }; /** * Auxiliary data structure to build TGraphErrors. */ struct JGraphErrors : public TGraphErrors { /** * Constructor. * * \param graph graph data * \param name graph name */ JGraphErrors(const JGraphErrors_t& graph, const char* name) : TGraphErrors(graph.X .size(), graph.X .data(), graph.Y .data(), graph.DX.data(), graph.DY.data()) { SetName(name); } }; } #endif