ATLAS Offline Software
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 
17 #ifndef ROOTUTILS_SCATTERH2_H
18 #define ROOTUTILS_SCATTERH2_H
19 
20 
21 #include "TH2.h"
22 #include <vector>
23 class TArrayD;
24 class TMemberInspector;
25 
26 
27 namespace RootUtils {
28 
29 
66 class ScatterH2
67  : public TH2F
68 {
69 public:
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 
216 private:
219  bool m_scatter;
220 
225 
229 
231 public:
232  struct Pair
233  {
234  float first;
235  float second;
236  Pair (float x=0, float y=0) : first (x), second (y) {}
237  };
238 private:
240  std::vector<Pair> m_vals;
241 
242 
243 private:
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
RootUtils::ScatterH2::m_shadestep
int m_shadestep
shadestep option.
Definition: ScatterH2.h:228
RootUtils
Definition: ILogger.h:20
RootUtils::ScatterH2::Fill
virtual Int_t Fill(Axis_t, const char *, Stat_t)
Definition: ScatterH2.h:246
RootUtils::ScatterH2::rescale
ScatterH2 * rescale(const char *name, double xscale, double yscale) const
Return a new plot with all data points multiplied by a constant.
Definition: ScatterH2.cxx:355
TH2F
Definition: rootspy.cxx:420
RootUtils::ScatterH2::m_vals
std::vector< Pair > m_vals
The collection of points that have been plotted.
Definition: ScatterH2.h:240
RootUtils::ScatterH2::shadestep
int shadestep() const
Get the current value of shadestep.
Definition: ScatterH2.cxx:329
RootUtils::ScatterH2::Fill
Int_t Fill(Axis_t)
Definition: ScatterH2.h:249
x
#define x
RootUtils::ScatterH2::m_scatter
bool m_scatter
The scatter flag.
Definition: ScatterH2.h:219
RootUtils::ScatterH2::Pair::Pair
Pair(float x=0, float y=0)
Definition: ScatterH2.h:236
RootUtils::ScatterH2::Pair::second
float second
Definition: ScatterH2.h:235
RootUtils::ScatterH2::Fill
virtual Int_t Fill(const char *, const char *, Stat_t)
Definition: ScatterH2.h:248
covarianceTool.title
title
Definition: covarianceTool.py:542
master.flag
bool flag
Definition: master.py:29
RootUtils::ScatterH2::Paint
virtual void Paint(Option_t *option="")
Standard ROOT paint method.
Definition: ScatterH2.cxx:110
RootUtils::ScatterH2::Pair
One point. Avoid std::pair so that we don't have duplicate dicts.
Definition: ScatterH2.h:233
RootUtils::ScatterH2::Reset
virtual void Reset(Option_t *option="")
Standard ROOT reset method.
Definition: ScatterH2.cxx:252
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
RootUtils::ScatterH2::Fill
Int_t Fill(const char *, Stat_t)
Definition: ScatterH2.h:250
y
#define y
RootUtils::ScatterH2::scatter
bool scatter() const
Get the current value of the scatter flag.
Definition: ScatterH2.cxx:298
RootUtils::ScatterH2::ClassDef
ClassDef(RootUtils::ScatterH2, 1)
RootUtils::ScatterH2::Fill
virtual Int_t Fill(Axis_t x, Axis_t y, Stat_t w)
Standard ROOT fill method.
Definition: ScatterH2.cxx:273
RootUtils::ScatterH2::Pair::first
float first
Definition: ScatterH2.h:234
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
RootUtils::ScatterH2
A 2-D histogram that can draw a proper scatter plot.
Definition: ScatterH2.h:68
RootUtils::ScatterH2::ScatterH2
ScatterH2()
Default constructor.
Definition: ScatterH2.cxx:34
RootUtils::ScatterH2::Fill
virtual Int_t Fill(const char *, Axis_t, Stat_t)
Definition: ScatterH2.h:247