@@ -69007,6 +69007,9 @@ ensureTCanvas: ensureTCanvas
69007
69007
* @private
69008
69008
*/
69009
69009
69010
+ const kTakeStyle = BIT(17);
69011
+
69012
+
69010
69013
class TPavePainter extends ObjectPainter {
69011
69014
69012
69015
/** @summary constructor
@@ -69179,15 +69182,15 @@ class TPavePainter extends ObjectPainter {
69179
69182
69180
69183
if (isFunc(main?.fillStatistic)) {
69181
69184
let dostat = parseInt(pt.fOptStat), dofit = parseInt(pt.fOptFit);
69182
- if (!Number.isInteger(dostat)) dostat = gStyle.fOptStat;
69183
- if (!Number.isInteger(dofit)) dofit = gStyle.fOptFit;
69185
+ if (!Number.isInteger(dostat) || pt.TestBit(kTakeStyle) ) dostat = gStyle.fOptStat;
69186
+ if (!Number.isInteger(dofit)|| pt.TestBit(kTakeStyle) ) dofit = gStyle.fOptFit;
69184
69187
69185
69188
// we take statistic from main painter
69186
69189
if (main.fillStatistic(this, dostat, dofit)) {
69187
69190
// adjust the size of the stats box with the number of lines
69188
69191
const nlines = pt.fLines?.arr.length || 0;
69189
69192
if ((nlines > 0) && !this.moved_interactive && ((gStyle.fStatFontSize <= 0) || (gStyle.fStatFont % 10 === 3)))
69190
- pt.fY1NDC = pt.fY2NDC - nlines * 0.25 * gStyle.fStatH;
69193
+ pt.fY1NDC = Math.max(0.02, pt.fY2NDC - (( nlines < 8) ? nlines * 0.25 * gStyle.fStatH : nlines * 0.025)) ;
69191
69194
}
69192
69195
}
69193
69196
}
@@ -70167,19 +70170,19 @@ class TPavePainter extends ObjectPainter {
70167
70170
}
70168
70171
70169
70172
/** @summary Fill function parameters */
70170
- fillFunctionStat(f1, dofit) {
70173
+ fillFunctionStat(f1, dofit, ndim = 1 ) {
70171
70174
if (!dofit || !f1) return false;
70172
70175
70173
- const print_fval = dofit % 10,
70174
- print_ferrors = Math.floor(dofit/10) % 10,
70175
- print_fchi2 = Math.floor(dofit/100) % 10,
70176
- print_fprob = Math.floor(dofit/1000) % 10;
70176
+ const print_fval = (ndim === 1) ? dofit % 10 : 1 ,
70177
+ print_ferrors = (ndim === 1) ? Math.floor(dofit/10) % 10 : 1 ,
70178
+ print_fchi2 = (ndim === 1) ? Math.floor(dofit/100) % 10 : 1 ,
70179
+ print_fprob = (ndim === 1) ? Math.floor(dofit/1000) % 10 : 0 ;
70177
70180
70178
- if (print_fchi2 > 0 )
70179
- this.addText('#chi^2 / ndf = ' + this.format(f1.fChisquare, 'fit') + ' / ' + f1.fNDF);
70180
- if (print_fprob > 0 )
70181
+ if (print_fchi2)
70182
+ this.addText('#chi^{2} / ndf = ' + this.format(f1.fChisquare, 'fit') + ' / ' + f1.fNDF);
70183
+ if (print_fprob)
70181
70184
this.addText('Prob = ' + this.format(Prob(f1.fChisquare, f1.fNDF)));
70182
- if (print_fval > 0 ) {
70185
+ if (print_fval) {
70183
70186
for (let n = 0; n < f1.GetNumPars(); ++n) {
70184
70187
const parname = f1.GetParName(n);
70185
70188
let parvalue = f1.GetParValue(n), parerr = f1.GetParError(n);
@@ -70191,7 +70194,7 @@ class TPavePainter extends ObjectPainter {
70191
70194
parerr = this.format(f1.GetParError(n), '4.2g');
70192
70195
}
70193
70196
70194
- if (( print_ferrors > 0) && parerr)
70197
+ if (print_ferrors && parerr)
70195
70198
this.addText(`${parname} = ${parvalue} #pm ${parerr}`);
70196
70199
else
70197
70200
this.addText(`${parname} = ${parvalue}`);
@@ -73908,7 +73911,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter {
73908
73911
stat.addText(`${get(0)} | ${get(1)} | ${get(2)}`);
73909
73912
}
73910
73913
73911
- if (dofit) stat.fillFunctionStat(this.findFunction(clTF2), dofit);
73914
+ if (dofit) stat.fillFunctionStat(this.findFunction(clTF2), dofit, 2 );
73912
73915
73913
73916
return true;
73914
73917
}
@@ -78373,7 +78376,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
78373
78376
stat.addText(`Kurtosis = ${stat.format(data.kurtx)}`);
78374
78377
}
78375
78378
78376
- if (dofit) stat.fillFunctionStat(this.findFunction(clTF1), dofit);
78379
+ if (dofit) stat.fillFunctionStat(this.findFunction(clTF1), dofit, 1 );
78377
78380
78378
78381
return true;
78379
78382
}
@@ -79877,7 +79880,7 @@ class TH3Painter extends THistPainter {
79877
79880
}
79878
79881
79879
79882
79880
- if (dofit) stat.fillFunctionStat(this.findFunction('TF3'), dofit);
79883
+ if (dofit) stat.fillFunctionStat(this.findFunction('TF3'), dofit, 3 );
79881
79884
79882
79885
return true;
79883
79886
}
0 commit comments