Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooNLLVar.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooNLLVar.cxx
19\class RooNLLVar
20\ingroup Roofitcore
21
22Class RooNLLVar implements a -log(likelihood) calculation from a dataset
23and a PDF. The NLL is calculated as
24\f[
25 \sum_\mathrm{data} -\log( \mathrm{pdf}(x_\mathrm{data}))
26\f]
27In extended mode, a
28\f$ N_\mathrm{expect} - N_\mathrm{observed}*log(N_\mathrm{expect}) \f$ term is added.
29**/
30
31#include <RooNLLVar.h>
32
33#include <RooAbsData.h>
34#include <RooAbsDataStore.h>
35#include <RooAbsPdf.h>
36#include <RooCmdConfig.h>
37#include <RooDataHist.h>
38#include <RooHistPdf.h>
39#include <RooMsgService.h>
40#include <RooNaNPacker.h>
41#include <RooProdPdf.h>
42#include <RooRealMPFE.h>
43#include <RooRealSumPdf.h>
44#include <RooRealVar.h>
45
46#include "TMath.h"
47#include "Math/Util.h"
48
49#include <algorithm>
50
51namespace {
52 template<class ...Args>
53 RooAbsTestStatistic::Configuration makeRooAbsTestStatisticCfg(Args const& ... args) {
55 cfg.rangeName = RooCmdConfig::decodeStringOnTheFly("RooNLLVar::RooNLLVar","RangeWithName",0,"",args...);
56 cfg.addCoefRangeName = RooCmdConfig::decodeStringOnTheFly("RooNLLVar::RooNLLVar","AddCoefRange",0,"",args...);
57 cfg.nCPU = RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","NumCPU",0,1,args...);
59 cfg.verbose = static_cast<bool>(RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","Verbose",0,1,args...));
60 cfg.splitCutRange = static_cast<bool>(RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","SplitRange",0,0,args...));
61 cfg.cloneInputData = static_cast<bool>(RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","CloneData",0,1,args...));
62 cfg.integrateOverBinsPrecision = RooCmdConfig::decodeDoubleOnTheFly("RooNLLVar::RooNLLVar", "IntegrateBins", 0, -1., {args...});
63 return cfg;
64 }
65}
66
68
70
72
73////////////////////////////////////////////////////////////////////////////////
74/// Construct likelihood from given p.d.f and (binned or unbinned dataset)
75///
76/// Argument | Description
77/// -------------------------|------------
78/// Extended() | Include extended term in calculation
79/// NumCPU() | Activate parallel processing feature
80/// Range() | Fit only selected region
81/// SumCoefRange() | Set the range in which to interpret the coefficients of RooAddPdf components
82/// SplitRange() | Fit range is split by index category of simultaneous PDF
83/// ConditionalObservables() | Define conditional observables
84/// Verbose() | Verbose output of GOF framework classes
85/// CloneData() | Clone input dataset for internal use (default is true)
86/// BatchMode() | Evaluate batches of data events (faster if PDFs support it)
87/// IntegrateBins() | Integrate PDF within each bin. This sets the desired precision. Only useful for binned fits.
88RooNLLVar::RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData& indata,
89 const RooCmdArg& arg1, const RooCmdArg& arg2,const RooCmdArg& arg3,
90 const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6,
91 const RooCmdArg& arg7, const RooCmdArg& arg8,const RooCmdArg& arg9) :
92 RooAbsOptTestStatistic(name,title,pdf,indata,
93 *RooCmdConfig::decodeSetOnTheFly(
94 "RooNLLVar::RooNLLVar","ProjectedObservables",0,&_emptySet,
95 arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
96 makeRooAbsTestStatisticCfg(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
97{
98 RooCmdConfig pc("RooNLLVar::RooNLLVar") ;
99 pc.allowUndefined() ;
100 pc.defineInt("extended","Extended",0,false) ;
101 pc.defineInt("BatchMode", "BatchMode", 0, false);
102
103 pc.process(arg1) ; pc.process(arg2) ; pc.process(arg3) ;
104 pc.process(arg4) ; pc.process(arg5) ; pc.process(arg6) ;
105 pc.process(arg7) ; pc.process(arg8) ; pc.process(arg9) ;
106
107 _extended = pc.getInt("extended") ;
108 _skipZeroWeights = true;
109}
110
111
112////////////////////////////////////////////////////////////////////////////////
113/// Construct likelihood from given p.d.f and (binned or unbinned dataset)
114/// For internal use.
115
116RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& indata,
117 bool extended, RooAbsTestStatistic::Configuration const& cfg) :
118 RooNLLVar{name, title, pdf, indata, RooArgSet(), extended, cfg} {}
119
120
121////////////////////////////////////////////////////////////////////////////////
122/// Construct likelihood from given p.d.f and (binned or unbinned dataset)
123/// For internal use.
124
125RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& indata,
126 const RooArgSet& projDeps,
127 bool extended, RooAbsTestStatistic::Configuration const& cfg) :
128 RooAbsOptTestStatistic(name,title,pdf,indata,projDeps, cfg),
129 _extended(extended)
130{
131 // If binned likelihood flag is set, pdf is a RooRealSumPdf representing a yield vector
132 // for a binned likelihood calculation
133 _binnedPdf = cfg.binnedL ? static_cast<RooRealSumPdf*>(_funcClone) : nullptr ;
134
135 // Retrieve and cache bin widths needed to convert un-normalized binnedPdf values back to yields
136 if (_binnedPdf) {
137
138 // The Active label will disable pdf integral calculations
139 _binnedPdf->setAttribute("BinnedLikelihoodActive") ;
140
141 RooArgSet obs;
143 if (obs.size()!=1) {
144 _binnedPdf = nullptr;
145 } else {
146 auto* var = static_cast<RooRealVar*>(obs.first());
147 std::unique_ptr<std::list<double>> boundaries{_binnedPdf->binBoundaries(*var,var->getMin(),var->getMax())};
148 auto biter = boundaries->begin() ;
149 _binw.reserve(boundaries->size()-1) ;
150 double lastBound = (*biter) ;
151 ++biter ;
152 while (biter!=boundaries->end()) {
153 _binw.push_back((*biter) - lastBound);
154 lastBound = (*biter) ;
155 ++biter ;
156 }
157 }
158
159 _skipZeroWeights = false;
160 } else {
161 _skipZeroWeights = true;
162 }
163}
164
165
166
167////////////////////////////////////////////////////////////////////////////////
168/// Copy constructor
169
170RooNLLVar::RooNLLVar(const RooNLLVar& other, const char* name) :
172 _extended(other._extended),
173 _weightSq(other._weightSq),
174 _offsetSaveW2(other._offsetSaveW2),
175 _binw(other._binw),
176 _binnedPdf{other._binnedPdf}
177{
178}
179
180
181////////////////////////////////////////////////////////////////////////////////
182/// Create a test statistic using several properties of the current instance. This is used to duplicate
183/// the test statistic in multi-processing scenarios.
184RooAbsTestStatistic* RooNLLVar::create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
185 const RooArgSet& projDeps, RooAbsTestStatistic::Configuration const& cfg) {
186 RooAbsPdf & thePdf = dynamic_cast<RooAbsPdf&>(pdf);
187 // check if pdf can be extended
188 bool extendedPdf = _extended && thePdf.canBeExtended();
189
190 auto testStat = new RooNLLVar(name, title, thePdf, adata, projDeps, extendedPdf, cfg);
191 return testStat;
192}
193
194
195////////////////////////////////////////////////////////////////////////////////
196
198{
199 if (_gofOpMode==Slave) {
200 if (flag != _weightSq) {
201 _weightSq = flag;
202 std::swap(_offset, _offsetSaveW2);
203 }
205 } else if ( _gofOpMode==MPMaster) {
206 for (int i=0 ; i<_nCPU ; i++)
207 _mpfeArray[i]->applyNLLWeightSquared(flag);
208 } else if ( _gofOpMode==SimMaster) {
209 for(auto& gof : _gofArray)
210 static_cast<RooNLLVar&>(*gof).applyWeightSquared(flag);
211 }
212}
213
214
215////////////////////////////////////////////////////////////////////////////////
216/// Calculate and return likelihood on subset of data.
217/// \param[in] firstEvent First event to be processed.
218/// \param[in] lastEvent First event not to be processed, any more.
219/// \param[in] stepSize Steps between events.
220/// \note For batch computations, the step size **must** be one.
221///
222/// If this an extended likelihood, the extended term is added to the return likelihood
223/// in the batch that encounters the event with index 0.
224
225double RooNLLVar::evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const
226{
227 // Throughout the calculation, we use Kahan's algorithm for summing to
228 // prevent loss of precision - this is a factor four more expensive than
229 // straight addition, but since evaluating the PDF is usually much more
230 // expensive than that, we tolerate the additional cost...
232 double sumWeight{0.0};
233
234 auto * pdfClone = static_cast<RooAbsPdf*>(_funcClone);
235
236
237 // If pdf is marked as binned - do a binned likelihood calculation here (sum of log-Poisson for each bin)
238 if (_binnedPdf) {
239 ROOT::Math::KahanSum<double> sumWeightKahanSum{0.0};
240 for (auto i=firstEvent ; i<lastEvent ; i+=stepSize) {
241
242 _dataClone->get(i) ;
243
244 double eventWeight = _dataClone->weight();
245
246
247 // Calculate log(Poisson(N|mu) for this bin
248 double N = eventWeight ;
249 double mu = _binnedPdf->getVal()*_binw[i] ;
250 //cout << "RooNLLVar::binnedL(" << GetName() << ") N=" << N << " mu = " << mu << endl ;
251
252 if (mu<=0 && N>0) {
253
254 // Catch error condition: data present where zero events are predicted
255 logEvalError(Form("Observed %f events in bin %lu with zero event yield",N,(unsigned long)i)) ;
256
257 } else if (std::abs(mu)<1e-10 && std::abs(N)<1e-10) {
258
259 // Special handling of this case since log(Poisson(0,0)=0 but can't be calculated with usual log-formula
260 // since log(mu)=0. No update of result is required since term=0.
261
262 } else {
263
264 double term = 0.0;
265 if(_doBinOffset) {
266 term -= -mu + N + N * (std::log(mu) - std::log(N));
267 } else {
268 term -= -mu + N * std::log(mu) - TMath::LnGamma(N+1);
269 }
270 result += term;
271 sumWeightKahanSum += eventWeight;
272
273 }
274 }
275
276 sumWeight = sumWeightKahanSum.Sum();
277
278 } else { //unbinned PDF
279
280 std::tie(result, sumWeight) = computeScalar(stepSize, firstEvent, lastEvent);
281
282 // include the extended maximum likelihood term, if requested
283 if(_extended && _setNum==_extSet) {
284 result += pdfClone->extendedTerm(*_dataClone, _weightSq, _doBinOffset);
285 }
286 } //unbinned PDF
287
288
289 // If part of simultaneous PDF normalize probability over
290 // number of simultaneous PDFs: -sum(log(p/n)) = -sum(log(p)) + N*log(n)
291 // If we do bin-by bin offsetting, we don't do this because it cancels out
292 if (!_doBinOffset && _simCount>1) {
293 result += sumWeight * std::log(static_cast<double>(_simCount));
294 }
295
296
297 // At the end of the first full calculation, wire the caches
298 if (_first) {
299 _first = false ;
301 }
302
303
304 // Check if value offset flag is set.
305 if (_doOffset) {
306
307 // If no offset is stored enable this feature now
308 if (_offset.Sum() == 0 && _offset.Carry() == 0 && (result.Sum() != 0 || result.Carry() != 0)) {
309 coutI(Minimization) << "RooNLLVar::evaluatePartition(" << GetName() << ") first = "<< firstEvent << " last = " << lastEvent << " Likelihood offset now set to " << result.Sum() << std::endl ;
310 _offset = result ;
311 }
312
313 // Subtract offset
314 result -= _offset;
315 }
316
317 _evalCarry = result.Carry();
318 return result.Sum() ;
319}
320
321RooNLLVar::ComputeResult RooNLLVar::computeScalar(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const {
322 auto pdfClone = static_cast<const RooAbsPdf*>(_funcClone);
323 return computeScalarFunc(pdfClone, _dataClone, _normSet, _weightSq, stepSize, firstEvent, lastEvent, _offsetPdf.get());
324}
325
327 RooArgSet *normSet, bool weightSq, std::size_t stepSize,
328 std::size_t firstEvent, std::size_t lastEvent, RooAbsPdf const* offsetPdf)
329{
332 RooNaNPacker packedNaN(0.f);
333
334 for (auto i=firstEvent; i<lastEvent; i+=stepSize) {
335 dataClone->get(i) ;
336
337 double weight = dataClone->weight(); //FIXME
338
339 if (0. == weight * weight) continue ;
340 if (weightSq) weight = dataClone->weightSquared() ;
341
342 double logProba = pdfClone->getLogVal(normSet);
343
344 if(offsetPdf) {
345 logProba -= offsetPdf->getLogVal(normSet);
346 }
347
348 const double term = -weight * logProba;
349
350 kahanWeight.Add(weight);
351 kahanProb.Add(term);
352 packedNaN.accumulate(term);
353 }
354
355 if (packedNaN.getPayload() != 0.) {
356 // Some events with evaluation errors. Return "badness" of errors.
357 return {ROOT::Math::KahanSum<double>{packedNaN.getNaNWithPayload()}, kahanWeight.Sum()};
358 }
359
360 return {kahanProb, kahanWeight.Sum()};
361}
362
363bool RooNLLVar::setDataSlave(RooAbsData &indata, bool cloneData, bool ownNewData)
364{
365 bool ret = RooAbsOptTestStatistic::setDataSlave(indata, cloneData, ownNewData);
366 // To re-create the data template pdf if necessary
367 _offsetPdf.reset();
369 return ret;
370}
371
373{
374 if (!_init) {
375 initialize();
376 }
377
378 _doBinOffset = flag;
379
380 // If this is a "master" that delegates the actual work to "slaves", the
381 // _offsetPdf will not be reset.
382 bool needsResetting = true;
383
384 switch (operMode()) {
385 case Slave: break;
386 case SimMaster: {
387 for (auto &gof : _gofArray) {
388 static_cast<RooNLLVar &>(*gof).enableBinOffsetting(flag);
389 }
390 needsResetting = false;
391 break;
392 }
393 case MPMaster: {
394 for (int i = 0; i < _nCPU; ++i) {
395 static_cast<RooNLLVar &>(_mpfeArray[i]->arg()).enableBinOffsetting(flag);
396 }
397 needsResetting = false;
398 break;
399 }
400 }
401
402 if (!needsResetting)
403 return;
404
405 if (flag && !_offsetPdf) {
406 std::string name = std::string{GetName()} + "_offsetPdf";
407 std::unique_ptr<RooDataHist> dataTemplate;
408 if (auto dh = dynamic_cast<RooDataHist *>(_dataClone)) {
409 dataTemplate = std::make_unique<RooDataHist>(*dh);
410 } else {
411 dataTemplate = std::unique_ptr<RooDataHist>(static_cast<RooDataSet const &>(*_dataClone).binnedClone());
412 }
413 _offsetPdf = std::make_unique<RooHistPdf>(name.c_str(), name.c_str(), *_funcObsSet, std::move(dataTemplate));
414 _offsetPdf->setOperMode(ADirty);
415 }
417}
#define e(i)
Definition RSha256.hxx:103
#define coutI(a)
#define ClassImp(name)
Definition Rtypes.h:377
#define N
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
char name[80]
Definition TGX11.cxx:110
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Definition Util.h:122
T Sum() const
Definition Util.h:240
T Carry() const
Definition Util.h:250
void Add(T x)
Single-element accumulation. Will not vectorise.
Definition Util.h:165
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
void wireAllCaches()
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition RooAbsArg.h:490
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Storage_t::size_type size() const
RooAbsArg * first() const
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
virtual double weight() const =0
virtual const RooArgSet * get() const
Definition RooAbsData.h:101
virtual double weightSquared() const =0
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
bool setDataSlave(RooAbsData &data, bool cloneData=true, bool ownNewDataAnyway=false) override
Change dataset that is used to given one.
RooAbsReal * _funcClone
Pointer to internal clone of input function.
bool _skipZeroWeights
! Whether to skip entries with weight zero in the evaluation
RooArgSet * _funcObsSet
List of observables in the pdf expression.
RooArgSet * _normSet
Pointer to set with observables used for normalization.
RooAbsData * _dataClone
Pointer to internal clone if input data.
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
bool canBeExtended() const
If true, PDF can provide extended likelihood term.
Definition RooAbsPdf.h:218
virtual double getLogVal(const RooArgSet *set=nullptr) const
Return the log of the current value with given normalization An error message is printed if the argum...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:103
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
Abstract base class for all test statistics.
Int_t _setNum
Partition number of this instance in parallel calculation mode.
double _evalCarry
! carry of Kahan sum in evaluatePartition
GOFOpMode operMode() const
Int_t _nCPU
Number of processors to use in parallel calculation mode.
GOFOpMode _gofOpMode
Operation mode of test statistic instance.
bool _init
! Is object initialized
Int_t _simCount
Total number of component p.d.f.s in RooSimultaneous (if any)
ROOT::Math::KahanSum< double > _offset
! Offset as KahanSum to avoid loss of precision
Int_t _extSet
! Number of designated set to calculated extended term
std::vector< std::unique_ptr< RooAbsTestStatistic > > _gofArray
! Array of sub-contexts representing part of the combined test statistic
bool initialize()
One-time initialization of the test statistic.
pRooRealMPFE * _mpfeArray
! Array of parallel execution frond ends
bool _doOffset
Apply interval value offset to control numeric precision?
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Named container for two doubles, two integers two object points and three string pointers that can be...
Definition RooCmdArg.h:26
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
static std::string decodeStringOnTheFly(const char *callerID, const char *cmdArgName, int intIdx, const char *defVal, Args_t &&...args)
Static decoder function allows to retrieve string property from set of RooCmdArgs For use in base mem...
static double decodeDoubleOnTheFly(const char *callerID, const char *cmdArgName, int idx, double defVal, std::initializer_list< std::reference_wrapper< const RooCmdArg > > args)
Find a given double in a list of RooCmdArg.
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void allowUndefined(bool flag=true)
If flag is true the processing of unrecognized RooCmdArgs is not considered an error.
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
static int decodeIntOnTheFly(const char *callerID, const char *cmdArgName, int intIdx, int defVal, Args_t &&...args)
Static decoder function allows to retrieve integer property from set of RooCmdArgs For use in base me...
The RooDataHist is a container class to hold N-dimensional binned data.
Definition RooDataHist.h:39
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooFit::OwningPtr< RooDataHist > binnedClone(const char *newName=nullptr, const char *newTitle=nullptr) const
Return binned clone of this dataset.
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
Definition RooNLLVar.h:25
ComputeResult computeScalar(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const
std::unique_ptr< RooAbsPdf > _offsetPdf
! An optional per-bin likelihood offset
Definition RooNLLVar.h:82
static RooNLLVar::ComputeResult computeScalarFunc(const RooAbsPdf *pdfClone, RooAbsData *dataClone, RooArgSet *normSet, bool weightSq, std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent, RooAbsPdf const *offsetPdf=nullptr)
bool _doBinOffset
Definition RooNLLVar.h:75
ROOT::Math::KahanSum< double > _offsetSaveW2
!
Definition RooNLLVar.h:78
static RooArgSet _emptySet
Definition RooNLLVar.h:69
RooAbsPdf * _binnedPdf
!
Definition RooNLLVar.h:81
void applyWeightSquared(bool flag) override
Disables or enables the usage of squared weights.
std::vector< double > _binw
!
Definition RooNLLVar.h:80
std::pair< ROOT::Math::KahanSum< double >, double > ComputeResult
Definition RooNLLVar.h:56
bool _extended
Definition RooNLLVar.h:74
RooNLLVar(const char *name, const char *title, RooAbsPdf &pdf, RooAbsData &data, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Construct likelihood from given p.d.f and (binned or unbinned dataset)
Definition RooNLLVar.cxx:88
bool setDataSlave(RooAbsData &data, bool cloneData=true, bool ownNewDataAnyway=false) override
Change dataset that is used to given one.
RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &pdf, RooAbsData &adata, const RooArgSet &projDeps, RooAbsTestStatistic::Configuration const &cfg) override
Create a test statistic using several properties of the current instance.
void enableBinOffsetting(bool on=true)
bool _first
!
Definition RooNLLVar.h:77
bool _weightSq
Apply weights squared?
Definition RooNLLVar.h:76
double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override
Calculate and return likelihood on subset of data.
RooAbsReal & arg() const
Definition RooRealMPFE.h:49
Implements a PDF constructed from a sum of functions:
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:37
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
@ BulkPartition
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Definition TMath.cxx:509
std::string rangeName
Stores the configuration parameters for RooAbsTestStatistic.
Little struct that can pack a float into the unused bits of the mantissa of a NaN double.
float getPayload() const
Retrieve packed float.
double getNaNWithPayload() const
Retrieve a NaN with the current float payload packed into the mantissa.
void accumulate(double val)
Accumulate a packed float from another NaN into this.