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