Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooNLLVarNew.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Jonas Rembser, CERN 2021
5 * Emmanouil Michalainas, CERN 2021
6 *
7 * Copyright (c) 2021, CERN
8 *
9 * Redistribution and use in source and binary forms,
10 * with or without modification, are permitted according to the terms
11 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
12 */
13
14#ifndef RooFit_RooNLLVarNew_h
15#define RooFit_RooNLLVarNew_h
16
17#include "RooAbsPdf.h"
18#include "RooAbsReal.h"
19#include "RooTemplateProxy.h"
20
21#include <Math/Util.h>
22
24
25namespace ROOT {
26namespace Experimental {
27
28class RooNLLVarNew : public RooAbsReal {
29
30public:
31 // The names for the weight variables that the RooNLLVarNew expects
32 static constexpr const char *weightVarName = "_weight";
33 static constexpr const char *weightVarNameSumW2 = "_weight_sumW2";
34
36 RooNLLVarNew(const char *name, const char *title, RooAbsPdf &pdf, RooArgSet const &observables, bool isExtended,
37 std::string const &rangeName, bool doOffset);
38 RooNLLVarNew(const RooNLLVarNew &other, const char *name = 0);
39 TObject *clone(const char *newname) const override { return new RooNLLVarNew(*this, newname); }
40
41 void getParametersHook(const RooArgSet *nset, RooArgSet *list, Bool_t stripDisconnected) const override;
42
43 /// Return default level for MINUIT error analysis.
44 double defaultErrorLevel() const override { return 0.5; }
45
46 inline RooAbsPdf *getPdf() const { return &*_pdf; }
47 void computeBatch(cudaStream_t *, double *output, size_t nOut, RooFit::Detail::DataMap const &) const override;
48 inline bool isReducerNode() const override { return true; }
49
50 RooArgSet prefixObservableAndWeightNames(std::string const &prefix);
51
52 void applyWeightSquared(bool flag) override;
53
54 std::unique_ptr<RooArgSet> fillNormSetForServer(RooArgSet const &normSet, RooAbsArg const &server) const override;
55
56private:
57 double evaluate() const override;
59
62 mutable double _sumWeight = 0.0; //!
63 mutable double _sumWeight2 = 0.0; //!
65 bool _weightSquared = false;
66 bool _binnedL = false;
67 bool _doOffset = false;
68 std::string _prefix;
71 std::unique_ptr<RooTemplateProxy<RooAbsReal>> _fractionInRange;
72 mutable std::vector<double> _binw; ///<!
73 mutable std::vector<double> _logProbasBuffer; ///<!
74 mutable ROOT::Math::KahanSum<double> _offset = 0.0; ///<! Offset as KahanSum to avoid loss of precision
75
76}; // end class RooNLLVar
77
78} // end namespace Experimental
79} // end namespace ROOT
80
81#endif
char name[80]
Definition TGX11.cxx:110
std::unique_ptr< RooTemplateProxy< RooAbsReal > > _fractionInRange
RooTemplateProxy< RooAbsReal > _weightVar
TObject * clone(const char *newname) const override
void computeBatch(cudaStream_t *, double *output, size_t nOut, RooFit::Detail::DataMap const &) const override
Compute multiple negative logs of propabilities.
void applyWeightSquared(bool flag) override
Toggles the weight square correction.
ROOT::Math::KahanSum< double > _offset
! Offset as KahanSum to avoid loss of precision
RooTemplateProxy< RooAbsPdf > _pdf
std::vector< double > _logProbasBuffer
!
double defaultErrorLevel() const override
Return default level for MINUIT error analysis.
RooTemplateProxy< RooAbsReal > _weightSquaredVar
void getParametersHook(const RooArgSet *nset, RooArgSet *list, Bool_t stripDisconnected) const override
std::vector< double > _binw
!
static constexpr const char * weightVarName
std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &normSet, RooAbsArg const &server) const override
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
bool isReducerNode() const override
RooArgSet prefixObservableAndWeightNames(std::string const &prefix)
Replaces all observables and the weight variable of this NLL with clones that only differ by a prefix...
static constexpr const char * weightVarNameSumW2
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Definition Util.h:122
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:69
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
Mother of all ROOT objects.
Definition TObject.h:41
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static void output(int code)
Definition gifencode.c:226