Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JGraph.hh
Go to the documentation of this file.
1#ifndef __JROOT__JGRAPH__
2#define __JROOT__JGRAPH__
3
4#include <vector>
5
6#include "TGraph.h"
7
8/**
9 * \author mdejong
10 */
11
12namespace JROOT {}
13namespace JPP { using namespace JROOT; }
14
15namespace JROOT {
16
17
18 /**
19 * Data structure for graph data.
20 */
21 struct JGraph_t {
22 /**
23 * Put data.
24 *
25 * \param x abscissa value
26 * \param y ordinate value
27 */
28 void put(const Double_t x, const Double_t y)
29 {
30 X.push_back(x);
31 Y.push_back(y);
32 }
33
34 std::vector<Double_t> X; //!< abscissa values
35 std::vector<Double_t> Y; //!< ordinate values
36 };
37
38
39 /**
40 * Auxiliary data structure to build TGraph.
41 */
42 struct JGraph :
43 public TGraph
44 {
45 /**
46 * Constructor.
47 *
48 * \param graph graph data
49 * \param name graph name
50 */
51 JGraph(const JGraph_t& graph, const char* name) :
52 TGraph(graph.X.size(),
53 graph.X.data(),
54 graph.Y.data())
55 {
56 SetName(name);
57 }
58 };
59}
60
61#endif
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for ROOT I/O.
Data structure for graph data.
Definition JGraph.hh:21
std::vector< Double_t > Y
ordinate values
Definition JGraph.hh:35
void put(const Double_t x, const Double_t y)
Put data.
Definition JGraph.hh:28
std::vector< Double_t > X
abscissa values
Definition JGraph.hh:34
Auxiliary data structure to build TGraph.
Definition JGraph.hh:44
JGraph(const JGraph_t &graph, const char *name)
Constructor.
Definition JGraph.hh:51