15 #include "TVirtualPad.h"
16 #include "TPolyMarker.h"
22 #include "TMemberInspector.h"
53 Int_t nbinsx, Axis_t xlow, Axis_t xup,
54 Int_t nbinsy, Axis_t ylow, Axis_t yup)
73 Int_t nbinsx,
const Double_t*
xbins,
74 Int_t nbinsy, Axis_t ylow, Axis_t yup)
94 Int_t nbinsy, Axis_t ylow, Axis_t yup)
113 TH2F::Paint (option);
118 double oldmax = GetMaximumStored ();
119 double oldmin = GetMinimumStored ();
124 TH2F::Paint (option);
139 GetListOfFunctions()->Clear();
143 Double_t umin = gPad->GetUxmin();
144 Double_t umax = gPad->GetUxmax();
145 Double_t
vmin = gPad->GetUymin();
146 Double_t
vmax = gPad->GetUymax();
148 int pxmin = gPad->XtoAbsPixel (umin);
149 int pxmax = gPad->XtoAbsPixel (umax);
150 int pymin = gPad->YtoAbsPixel (
vmin);
151 int pymax = gPad->YtoAbsPixel (
vmax);
152 if (pxmin > pxmax)
std::swap (pxmin, pxmax);
153 if (pymin > pymax)
std::swap (pymin, pymax);
154 int pxsize = pxmax - pxmin + 1;
155 int pysize = pymax - pymin + 1;
156 std::vector<unsigned int> counts (pxsize * pysize);
158 TVirtualPad* pad = gPad;
161 unsigned int maxcount = 0;
162 unsigned int n =
m_vals.size();
163 for (
unsigned int i=0;
i<
n;
i++) {
166 if (
u < umin)
u = umin;
167 if (
u > umax)
u = umax;
171 int px = pad->XtoAbsPixel (
u);
172 int py = pad->YtoAbsPixel (
v);
173 if (px < pxmin || px > pxmax || py < pymin || py > pymax)
continue;
174 unsigned ndx = (
px-pxmin) + (
py-pymin) * pxsize;
175 assert (ndx < counts.size());
177 if (counts[ndx] > maxcount)
178 maxcount = counts[ndx];
181 const unsigned int NCOLOR = 255;
189 step =
static_cast<float>(NCOLOR-1)/(maxcount-1);
193 unsigned int ccounts[NCOLOR];
194 std::uninitialized_fill (ccounts, ccounts+NCOLOR, 0);
195 size_t ndxmax = counts.size();
196 for (
unsigned int i=0;
i < ndxmax;
i++) {
197 unsigned int count = counts[
i];
205 TPolyMarker* pms[NCOLOR];
206 std::uninitialized_fill (pms, pms+NCOLOR, (TPolyMarker*)0);
209 for (
int py = pymin;
py <= pymax; ++
py) {
210 for (
int px = pxmin;
px <= pxmax; ++
px) {
211 unsigned int ndx = (
px-pxmin) + (
py-pymin) * pxsize;
212 assert (ndx < ndxmax);
213 unsigned int count = counts[ndx];
215 Double_t
u = pad->AbsPixeltoX (
px);
216 Double_t
v = pad->AbsPixeltoY (
py);
220 TPolyMarker* pm = pms[
color];
222 pm =
new TPolyMarker (ccounts[
color]);
224 pm->SetMarkerStyle (GetMarkerStyle());
225 pm->SetMarkerSize (GetMarkerSize());
227 pm->SetMarkerColor (TColor::GetColor (
color, 0, 0));
230 pm->SetPoint (ccounts[
color]++,
u,
v);
236 for (
unsigned int i = 0;
i < NCOLOR;
i++) {
254 TString
opt = option;
255 if (!
opt.Contains(
"ICE")) {
257 std::vector<Pair>
tmp;
260 TH2F::Reset (option);
277 return TH2F::Fill (
x,
y,
w);
357 int nx = GetXaxis()->GetNbins();
358 double xlo = GetXaxis()->GetXmin();
359 double xhi = GetXaxis()->GetXmax();
361 int ny = GetYaxis()->GetNbins();
362 double ylo = GetYaxis()->GetXmin();
363 double yhi = GetYaxis()->GetXmax();
367 nx, xscale*
xlo, xscale*
xhi,
368 ny, yscale*
ylo, yscale*
yhi);
373 hnew->GetXaxis()->Set (nx, xscale*
xlo, xscale*
xhi);
374 hnew->GetYaxis()->Set (ny, yscale*
ylo, yscale*
yhi);
375 size_t n = hnew->
m_vals.size();
376 for (
size_t i = 0;
i <
n;
i++) {
377 hnew->
m_vals[
i].first *= xscale;
378 hnew->
m_vals[
i].second *= yscale;