9 _hyperPoints(hyperPoints)
12 ERROR_LOG <<
"You have given a 2D painter a different dimensionality of binning and/or data. I'll probably crash soon";
14 if (hyperPoints != 0){
16 ERROR_LOG <<
"You have given a 2D painter a different dimensionality of binning and/or data. I'll probably crash soon";
19 WELCOME_LOG <<
"Good day from the HyperBinningPainter2D() Constructor";
29 ERROR_LOG <<
"You have given a 2D painter a different dimensionality of binning and/or data. I'll probably crash soon";
31 WELCOME_LOG <<
"Good day from the HyperBinningPainter2D() Constructor";
64 leftLine ->SetLineWidth(1);
65 rightLine ->SetLineWidth(1);
66 topLine ->SetLineWidth(1);
67 bottomLine->SetLineWidth(1);
69 leftLine ->SetLineColor(kBlack);
70 rightLine ->SetLineColor(kBlack);
71 topLine ->SetLineColor(kBlack);
72 bottomLine->SetLineColor(kBlack);
75 leftLine ->SetLineStyle(3);
78 bottomLine->SetLineStyle(3);
91 double minBinWidthX = 10e50;
92 double minBinWidthY = 10e50;
98 if (binWidthX < minBinWidthX) minBinWidthX = binWidthX;
99 if (binWidthY < minBinWidthY) minBinWidthY = binWidthY;
137 if (binNumLow == -1 )
return;
138 if (binNumHigh == -1 )
return;
146 if (binNumLow == binNumHigh && binContent == binConLow)
return;
147 else if (binNumLow == binNumHigh && binContent != binConLow) {
150 else if (binConLow != binContent){
153 else if (binConHigh != binContent){
166 if (binNumLow == -1 )
return;
167 if (binNumHigh == -1 )
return;
175 if (binNumLow == binNumHigh && binContent == binConLow)
return;
176 else if (binNumLow == binNumHigh && binContent != binConLow) {
179 else if (binConLow != binContent){
182 else if (binConHigh != binContent){
195 if (binNumLow == -1 )
return;
196 if (binNumHigh == -1 )
return;
204 if (binNumLow == binNumHigh && binContent == binConLow)
return;
205 else if (binNumLow == binNumHigh && binContent != binConLow) {
208 else if (binConLow != binContent){
211 else if (binConHigh != binContent){
224 if (binNumLow == -1 )
return;
225 if (binNumHigh == -1 )
return;
232 if (binNumLow == binNumHigh && binContent == binConLow)
return;
233 else if (binNumLow == binNumHigh && binContent != binConLow) {
236 else if (binConLow != binContent){
239 else if (binConHigh != binContent){
245 if (line == 0)
return;
247 line ->SetLineWidth(1);
248 line ->SetLineColor(kBlack);
249 line ->SetLineStyle(1);
267 if (binContents < min || binContents > max)
return kWhite;
269 int ndivz = gStyle->GetNumberContours();
270 double dz = max - min;
271 double scale = ndivz/dz;
272 int ncolors = gStyle->GetNumberOfColors();
274 int color = int(0.01+(binContents-min)*scale);
275 int theColor = int((color+0.99)*
double(ncolors)/
double(ndivz));
276 if (theColor > ncolors-1) theColor = ncolors-1;
278 return gStyle->GetColorPalette(theColor);
290 TString label =
""; label += bin;
291 plotter->
addText( label ,center.
at(0), center.
at(1), 2, 2, 0.02, 0);
305 TString label =
""; label += binCont;
306 plotter->
addText( label ,center.
at(0), center.
at(1), 2, 2, 0.02, 0);
323 if (hashNeg ==
true && binContent < 0.0) {
324 binContent = -binContent;
343 int fillStyle = 1001;
353 box->SetFillColor( fillColor );
354 box->SetLineWidth(0.0);
355 box->SetFillStyle( fillStyle );
356 box->SetLineColor( fillColor );
372 bool drawBinEd1 = option.Contains(
"Edges1" );
373 bool drawBinEd2 = option.Contains(
"Edges2" );
374 bool drawBinNums = option.Contains(
"BinNums");
375 bool drawHashedNeg = option.Contains(
"HashNeg");
376 bool drawBinContOp = option.Contains(
"Text");
386 TH2D* histogram =
new TH2D(
"2DHyperBinningPlot",
"2DHyperBinningPlot", 100, x_min, x_max, 100, y_min, y_max);
387 histogram->GetXaxis()->SetTitle( xtitle );
388 histogram->GetYaxis()->SetTitle( ytitle );
398 min = min<0.0?0.0:min;
399 max = fabs(max)>fabs(min)?fabs(max):fabs(min);
405 for(
int i = 1; i <= 100; i++)
for (
int j = 0; j <= 100; ++j) histogram->SetBinContent(i, j, max);
406 histogram->SetBinContent(2, 2, min);
407 histogram->SetMaximum(max);
408 histogram->SetMinimum(min);
411 histogram->SetContour(gStyle->GetNumberContours());
419 box->SetFillColor( 0 );
420 box->SetLineWidth(0.0);
430 plotter.
plot(path,
"COLZ");
double getMax(int dimension) const
double getMaxDensity() const
void addObject(TObject *obj)
TString getAxisString(int dim)
double getMin(int dimension) const
const HyperCuboid & at(int i) const
HyperPointSet * _hyperPoints
double getBinContent(int bin) const
void drawBinEdges2(RootPlotter2D *plotter)
HyperBinningPainter2D(BinningBase *binning, HyperPointSet *hyperPoints=0)
virtual int getNumBins() const =0
void drawFilledBin(RootPlotter2D *plotter, int bin, bool hashNeg=false)
HyperCuboid getLimits() const
void drawBinNumbers(RootPlotter2D *plotter)
double getFrequencyDensity(int bin) const
void addHyperPoints(TH2D *histogram)
const HyperPoint & at(int i) const
virtual int getBinNum(const HyperPoint &coords) const =0
HyperPoint getCenter() const
const HyperPoint & getHighCorner() const
void drawBinEdge(RootPlotter2D *plotter, int bin)
virtual void draw(TString path="", TString option="")
virtual void plot(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
HyperPoint getWidth() const
HyperHistogram * _histogram
const double & at(int i) const
void drawBinEdges(RootPlotter2D *plotter)
const int & getDimension() const
virtual double getVal(const HyperPoint &point) const
void drawFilledBins(RootPlotter2D *plotter, bool hashNeg=false)
const HyperPoint & getLowCorner() const
unsigned int size() const
void addText(TString text, double x, double y, int alignh=1, int alignv=2, double size=0.06, int ndc=true, int color=kBlack)
const BinningBase & getBinning() const
void drawBinCont(RootPlotter2D *plotter)
HyperName getNames() const
HyperPoint getAverageCenter() const
const BinningBase & getBinning()
void drawBinEdge2(RootPlotter2D *plotter, int bin, double minWidX, double minWidY)
int getFillColour(double binContents)
double getMinDensity() const
virtual HyperVolume getBinHyperVolume(int binNumber) const =0