ATLAS Offline Software
Loading...
Searching...
No Matches
ScatterH2.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: ScatterH2.h,v 1.5 2008-01-17 20:56:37 ssnyder Exp $
8
15
16
17#ifndef ROOTUTILS_SCATTERH2_H
18#define ROOTUTILS_SCATTERH2_H
19
20
21#include "TH2.h"
22#include <vector>
23class TArrayD;
24class TMemberInspector;
25
26
27namespace RootUtils {
28
29
67 : public TH2F
68{
69public:
73 ScatterH2 ();
74
75
87 ScatterH2 (const char *name, const char *title,
88 Int_t nbinsx, Axis_t xlow, Axis_t xup,
89 Int_t nbinsy, Axis_t ylow, Axis_t yup);
90
91
102 ScatterH2 (const char *name, const char *title,
103 Int_t nbinsx, const Double_t* xbins,
104 Int_t nbinsy, Axis_t ylow, Axis_t yup);
105
106
116 ScatterH2 (const char *name, const char *title,
117 const TArrayD& xbins,
118 Int_t nbinsy, Axis_t ylow, Axis_t yup);
119
120
128 virtual void Paint (Option_t* option = "");
129
130
138 virtual void Reset (Option_t *option = "");
139
140
150 virtual Int_t Fill (Axis_t x, Axis_t y, Stat_t w);
151
152
158 virtual Int_t Fill(Axis_t x, Axis_t y);
159
160
167 bool scatter () const;
168
169
178 bool scatter (bool flag);
179
180
190 int shadestep () const;
191
192
204 int shadestep (int shadestep);
205
206
213 ScatterH2* rescale (const char* name, double xscale, double yscale) const;
214
215
216private:
220
225
229
231public:
232 struct Pair
233 {
234 float first;
235 float second;
236 Pair (float x=0, float y=0) : first (x), second (y) {}
237 };
238private:
240 std::vector<Pair> m_vals;
241
242
243private:
244 // These Fill overloads don't make sense for this class.
245 // Make them private here.
246 virtual Int_t Fill(Axis_t, const char*, Stat_t) { return -1; }
247 virtual Int_t Fill(const char*, Axis_t, Stat_t) { return -1; }
248 virtual Int_t Fill(const char*, const char*, Stat_t) { return -1; }
249 Int_t Fill(Axis_t) {return -1;}
250 Int_t Fill(const char*, Stat_t) {return -1;}
251
252
254};
255
256
257} // namespace RootUtils
258
259
260#endif // not ROOTUTILS_SCATTERH2_H
#define y
#define x
A 2-D histogram that can draw a proper scatter plot.
Definition ScatterH2.h:68
Int_t Fill(Axis_t)
Definition ScatterH2.h:249
ClassDef(RootUtils::ScatterH2, 1)
int m_shadestep
shadestep option.
Definition ScatterH2.h:228
virtual Int_t Fill(const char *, Axis_t, Stat_t)
Definition ScatterH2.h:247
virtual void Reset(Option_t *option="")
Standard ROOT reset method.
std::vector< Pair > m_vals
The collection of points that have been plotted.
Definition ScatterH2.h:240
int shadestep() const
Get the current value of shadestep.
virtual Int_t Fill(Axis_t, const char *, Stat_t)
Definition ScatterH2.h:246
ScatterH2()
Default constructor.
Definition ScatterH2.cxx:34
virtual Int_t Fill(Axis_t x, Axis_t y, Stat_t w)
Standard ROOT fill method.
virtual void Paint(Option_t *option="")
Standard ROOT paint method.
virtual Int_t Fill(const char *, const char *, Stat_t)
Definition ScatterH2.h:248
ScatterH2 * rescale(const char *name, double xscale, double yscale) const
Return a new plot with all data points multiplied by a constant.
Int_t Fill(const char *, Stat_t)
Definition ScatterH2.h:250
bool m_scatter
The scatter flag.
Definition ScatterH2.h:219
bool scatter() const
Get the current value of the scatter flag.
Pair(float x=0, float y=0)
Definition ScatterH2.h:236