16#ifndef RooFit_RooNLLVarNew_h
17#define RooFit_RooNLLVarNew_h
30 static constexpr const char *weightVarName =
"_weight";
31 static constexpr const char *weightVarNameSumW2 =
"_weight_sumW2";
33 RooNLLVarNew(
const char *
name,
const char *title, RooAbsPdf &pdf, RooArgSet
const &observables,
bool isExtended,
35 RooNLLVarNew(
const RooNLLVarNew &other,
const char *
name =
nullptr);
36 TObject *
clone(
const char *newname)
const override {
return new RooNLLVarNew(*
this, newname); }
41 void doEval(RooFit::EvalContext &)
const override;
42 bool canComputeBatchWithCuda()
const override {
return !_binnedL; }
43 bool isReducerNode()
const override {
return true; }
45 void setPrefix(std::string
const &prefix);
55 void translate(RooFit::Detail::CodeSquashContext &ctx)
const override;
58 double evaluate()
const override {
return _value; }
59 void resetWeightVarNames();
60 void finalizeResult(RooFit::EvalContext &, ROOT::Math::KahanSum<double>
result,
double weightSum)
const;
61 void fillBinWidthsFromPdfBoundaries(
RooAbsReal const &pdf, RooArgSet
const &observables);
62 void doEvalBinnedL(RooFit::EvalContext &, std::span<const double> preds, std::span<const double> weights)
const;
64 RooTemplateProxy<RooAbsPdf> _pdf;
65 RooTemplateProxy<RooAbsReal> _weightVar;
66 RooTemplateProxy<RooAbsReal> _weightSquaredVar;
67 std::unique_ptr<RooTemplateProxy<RooAbsReal>> _expectedEvents;
68 std::unique_ptr<RooTemplateProxy<RooAbsPdf>>
_offsetPdf;
69 mutable double _sumWeight = 0.0;
70 mutable double _sumWeight2 = 0.0;
71 bool _weightSquared =
false;
72 bool _binnedL =
false;
77 std::vector<double>
_binw;
78 mutable ROOT::Math::KahanSum<double>
_offset{0.};
bool _doOffset
Apply interval value offset to control numeric precision?
void enableOffsetting(bool flag) override
ROOT::Math::KahanSum< double > _offset
! Offset as KahanSum to avoid loss of precision
void setSimCount(Int_t simCount)
Int_t _simCount
Total number of component p.d.f.s in RooSimultaneous (if any)
TObject * clone(const char *newname) const override
double defaultErrorLevel() const override
double evaluate() const override
void applyWeightSquared(bool flag) override
std::vector< double > _binw
!
std::unique_ptr< RooAbsPdf > _offsetPdf
! An optional per-bin likelihood offset
void enableBinOffsetting(bool on=true)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Abstract base class for objects that represent a real value and implements functionality common to al...
OffsetMode
For setting the offset mode with the Offset() command argument to RooAbsPdf::fitTo()