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