Skip to content

Commit 29db7c1

Browse files
bellenotlinev
authored andcommitted
Add handling of TFormula fParams & fClingParameters
This makes the folowing example working TF1 f1("f1","gaus",0,10); TF1 f2("f2","10.-x",0,10); f2.SetParameter(0,1); f1.SetParameter(0,2); f1.SetParameter(1,4); f1.SetParameter(2,2.5); TF1 f3("f3","f1+f2",0,10); f3.SetParameter(0,3); f3.SetParameter(2,0.5); f3.Draw();
1 parent 8e8665f commit 29db7c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/JSRootCore.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,12 @@
15741574
_func = this.fFormula.fFormula;
15751575
pprefix = "[p";
15761576
}
1577+
if (this.fFormula.fClingParameters && this.fFormula.fParams) {
1578+
for (var i=0;i<this.fFormula.fParams.length;++i) {
1579+
var regex = new RegExp('(\\[' + this.fFormula.fParams[i].first + '\\])', 'g');
1580+
_func = _func.replace(regex, this.fFormula.fClingParameters[this.fFormula.fParams[i].second]);
1581+
}
1582+
}
15771583
}
15781584

15791585
if ('formulas' in this)

0 commit comments

Comments
 (0)