Skip to content

Commit 1f10a6a

Browse files
committed
Fix - prevent corrupted list of histogram functions
Appears once in the jupyter notebook in SWAN, to be observed in the future
1 parent c5e407c commit 1f10a6a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

modules/hist2d/THistPainter.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { gStyle, BIT, settings, constants, create, isObject, isFunc, isStr, getPromise,
22
clTList, clTPaveStats, clTPaletteAxis, clTProfile, clTProfile2D, clTProfile3D, clTPad,
3-
clTAxis, clTF1, clTF2, kNoZoom, clTCutG, kNoStats, kTitle, setHistogramTitle } from '../core.mjs';
3+
clTAxis, clTF1, clTF2, kNoZoom, clTCutG, kNoStats, kTitle, setHistogramTitle, addMethods } from '../core.mjs';
44
import { getColorPalette } from '../base/colors.mjs';
55
import { DrawOptions } from '../base/BasePainter.mjs';
66
import { ObjectPainter, EAxisBits, kAxisTime, kAxisLabels } from '../base/ObjectPainter.mjs';
@@ -1852,6 +1852,12 @@ class THistPainter extends ObjectPainter {
18521852

18531853
if (!histo.fFunctions)
18541854
histo.fFunctions = create(clTList);
1855+
else if (histo.fFunctions._typename !== clTList) {
1856+
// Fix - seen once in jupyter notebook that typename was TList*
1857+
console.error(`Fixing wrong typename ${histo.fFunctions._typename} for histogram list of functions`);
1858+
histo.fFunctions._typename = clTList;
1859+
addMethods(histo.fFunctions, clTList);
1860+
}
18551861

18561862
if (asfirst)
18571863
histo.fFunctions.AddFirst(obj);

0 commit comments

Comments
 (0)