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