Skip to content

Commit 586e846

Browse files
committed
[RF] Increment value reset counter also in RooRealVar::setValFast()
There is a `RooRealVar::setValFast()` method that behaves like `RooRealVar::setVal()` but without the boundary check, for internal RooFit use in the `RooRealVar::setBin()` method. It's important to also increment the value reset counter in this method, so that recomputations in the RooFit::Evaluator will be triggered correctly. Thanks to @PetroZarytskyi for finding this!
1 parent 7294e1b commit 586e846

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roofit/roofitcore/inc/RooRealVar.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@ class RooRealVar : public RooAbsRealLValue {
138138
static bool _printScientific ;
139139
static Int_t _printSigDigits ;
140140

141-
void setValFast(double value) override { _value = value ; setValueDirty() ; }
142-
141+
void setValFast(double value) override
142+
{
143+
if (_value != value) {
144+
++_valueResetCounter;
145+
}
146+
_value = value;
147+
setValueDirty();
148+
}
143149

144150
double evaluate() const override { return _value ; } // dummy because we overloaded getVal()
145151
void copyCache(const RooAbsArg* source, bool valueOnly=false, bool setValDirty=true) override ;

0 commit comments

Comments
 (0)