Jpp  master_rocky-37-gf0c5bc59d
the software that should make you happy
JGraph2D.hh
Go to the documentation of this file.
1 #ifndef __JROOT__JGRAPH2D__
2 #define __JROOT__JGRAPH2D__
3 
4 #include <vector>
5 
6 #include "TGraph2D.h"
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JROOT {}
13 namespace JPP { using namespace JROOT; }
14 
15 namespace JROOT {
16 
17 
18  /**
19  * Data structure for graph data.
20  */
21  struct JGraph2D_t {
22  /**
23  * Put data.
24  *
25  * \param x abscissa value
26  * \param y abscissa value
27  * \param z ordinate value
28  */
29  void put(const Double_t x, const Double_t y, const Double_t z)
30  {
31  X.push_back(x);
32  Y.push_back(y);
33  Z.push_back(z);
34  }
35 
36  std::vector<Double_t> X; //!< abscissa values
37  std::vector<Double_t> Y; //!< abscissa values
38  std::vector<Double_t> Z; //!< ordinate values
39  };
40 
41 
42  /**
43  * Auxiliary data structure to build TGraph2D.
44  */
45  struct JGraph2D :
46  public TGraph2D
47  {
48  /**
49  * Constructor.
50  *
51  * \param graph graph data
52  * \param name graph name
53  */
54  JGraph2D(JGraph2D_t& graph, const char* name) :
55  TGraph2D(graph.X.size(),
56  graph.X.data(),
57  graph.Y.data(),
58  graph.Z.data())
59  {
60  SetName(name);
61  }
62  };
63 }
64 
65 #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: JGraph2D.hh:21
std::vector< Double_t > Y
abscissa values
Definition: JGraph2D.hh:37
std::vector< Double_t > X
abscissa values
Definition: JGraph2D.hh:36
std::vector< Double_t > Z
ordinate values
Definition: JGraph2D.hh:38
void put(const Double_t x, const Double_t y, const Double_t z)
Put data.
Definition: JGraph2D.hh:29
Auxiliary data structure to build TGraph2D.
Definition: JGraph2D.hh:47
JGraph2D(JGraph2D_t &graph, const char *name)
Constructor.
Definition: JGraph2D.hh:54