Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RooNLLVar.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*
4 * Project: RooFit
5 *
6 * Copyright (c) 2024, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef ROO_NLL_VAR
14#define ROO_NLL_VAR
15
17#include "RooCmdArg.h"
18#include "RooAbsPdf.h"
19#include <vector>
20#include <utility>
21
22class RooNLLVar : public RooAbsOptTestStatistic {
23public:
24
25 // Constructors, assignment etc
26 RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
27 bool extended,
28 RooAbsTestStatistic::Configuration const& cfg=RooAbsTestStatistic::Configuration{});
29
30 RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
31 const RooArgSet& projDeps, bool extended = false,
32 RooAbsTestStatistic::Configuration const& cfg=RooAbsTestStatistic::Configuration{});
33
34 RooNLLVar(const RooNLLVar& other, const char* name=nullptr);
35 TObject* clone(const char* newname=nullptr) const override { return new RooNLLVar(*this,newname); }
36
37 RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
38 const RooArgSet& projDeps, RooAbsTestStatistic::Configuration const& cfg) override;
39
40 ~RooNLLVar() override;
41
42 void applyWeightSquared(bool flag) override;
43
44 double defaultErrorLevel() const override { return 0.5 ; }
45
46 void enableBinOffsetting(bool on = true);
47
48 using ComputeResult = std::pair<ROOT::Math::KahanSum<double>, double>;
49
50 static RooNLLVar::ComputeResult computeScalarFunc(const RooAbsPdf *pdfClone, RooAbsData *dataClone, RooArgSet *normSet,
51 bool weightSq, std::size_t stepSize, std::size_t firstEvent,
52 std::size_t lastEvent, RooAbsPdf const* offsetPdf = nullptr);
53
54 bool setDataSlave(RooAbsData& data, bool cloneData=true, bool ownNewDataAnyway=false) override;
55
56protected:
57
58 bool processEmptyDataSets() const override { return _extended ; }
59 double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override;
60
61 static RooArgSet _emptySet ; // Supports named argument constructor
62
63private:
64 ComputeResult computeScalar(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const;
65
66 bool _extended{false};
67 bool _doBinOffset{false};
68 bool _weightSq{false}; ///< Apply weights squared?
69 mutable bool _first{true}; ///<!
71
72 mutable std::vector<double> _binw ; ///<!
73 mutable RooAbsPdf* _binnedPdf{nullptr}; ///<!
74 std::unique_ptr<RooAbsPdf> _offsetPdf; ///<! An optional per-bin likelihood offset
75};
76
77#endif
78
79/// \endcond
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
char name[80]
Definition TGX11.cxx:110
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Definition Util.h:136
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Mother of all ROOT objects.
Definition TObject.h:41