Skip to content

Commit

Permalink
Declare SimpleGaussianConstraint as self-normalized to RooFit
Browse files Browse the repository at this point in the history
  • Loading branch information
guitargeek committed Nov 19, 2024
1 parent 1d69ee1 commit ef3c26b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion interface/SimpleGaussianConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ class SimpleGaussianConstraint : public RooGaussian {
SimpleGaussianConstraint(const RooGaussian &g) : RooGaussian(g, "") { init(); }

TObject* clone(const char* newname) const override { return new SimpleGaussianConstraint(*this,newname); }
inline ~SimpleGaussianConstraint() override { }

#if ROOT_VERSION_CODE < ROOT_VERSION(6,26,0)
// function was upstreamed to RooGaussian in ROOT 6.26
const RooAbsReal & getX() const { return x.arg(); }
#endif

double getLogValFast() const {
if (_valueDirty) {
Expand All @@ -29,7 +31,13 @@ class SimpleGaussianConstraint : public RooGaussian {
return _value;
}

// RooFit should make no attempt to normalize this constraint, as the
// "getLogValFast()" function that combined CachingNLL is calling also
// doesn't do any normalization.
bool selfNormalized() const override { return true; }

static RooGaussian * make(RooGaussian &c) ;

private:
double scale_;
void init() ;
Expand Down

0 comments on commit ef3c26b

Please sign in to comment.