From e6ea1e73da2d53efb10379297c87514f7531b592 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 19 Nov 2024 15:01:01 +0100 Subject: [PATCH] Declare SimpleGaussianConstraint as self-normalized to RooFit --- interface/SimpleGaussianConstraint.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/interface/SimpleGaussianConstraint.h b/interface/SimpleGaussianConstraint.h index 37a4fe9dd63..2103d621ba1 100644 --- a/interface/SimpleGaussianConstraint.h +++ b/interface/SimpleGaussianConstraint.h @@ -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) { @@ -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() ;