Logo ROOT  
Reference Guide
RooAbsReal.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsReal.h,v 1.75 2007/07/13 21:50:24 wouter Exp $
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#ifndef ROO_ABS_REAL
17#define ROO_ABS_REAL
18
19#include "RooAbsArg.h"
20#include "RooCmdArg.h"
21#include "RooCurve.h"
22#include "RooArgSet.h"
23#include "RooArgList.h"
24#include "RooGlobalFunc.h"
25#include "RooSpan.h"
28
29class RooDataSet ;
30class RooPlot;
31class RooRealVar;
32class RooAbsFunc;
34class RooLinkedList ;
35class RooNumIntConfig ;
36class RooDataHist ;
37class RooFunctor ;
38class RooGenFunction ;
40class RooFitResult ;
41class RooAbsMoment ;
42class RooDerivative ;
44struct TreeReadBuffer; /// A space to attach TBranches
45namespace ROOT {
46namespace Experimental {
47class RooFitDriver ;
48}
49}
50
51class TH1;
52class TH1F;
53class TH2F;
54class TH3F;
55
56#include <iostream>
57#include <list>
58#include <map>
59#include <string>
60#include <sstream>
61
62class RooAbsReal : public RooAbsArg {
63public:
65
66 // Constructors, assignment etc
67 RooAbsReal() ;
68 RooAbsReal(const char *name, const char *title, const char *unit= "") ;
69 RooAbsReal(const char *name, const char *title, double minVal, double maxVal,
70 const char *unit= "") ;
71 RooAbsReal(const RooAbsReal& other, const char* name=nullptr);
72 ~RooAbsReal() override;
73
74
75
76
77 //////////////////////////////////////////////////////////////////////////////////
78 /// Evaluate object. Returns either cached value or triggers a recalculation.
79 /// The recalculation happens by calling getValV(), which in the end calls the
80 /// virtual evaluate() functions of the respective PDFs.
81 /// \param[in] normalisationSet getValV() reacts differently depending on the value of the normalisation set.
82 /// If the set is `nullptr`, an unnormalised value is returned.
83 /// \note The normalisation is arbitrary, because it is up to the implementation
84 /// of the PDF to e.g. leave out normalisation constants for speed reasons. The range
85 /// of the variables is also ignored.
86 ///
87 /// To normalise the result properly, a RooArgSet has to be passed, which contains
88 /// the variables to normalise over.
89 /// These are integrated over their current ranges to compute the normalisation constant,
90 /// and the unnormalised result is divided by this value.
91 inline double getVal(const RooArgSet* normalisationSet = nullptr) const {
92 // Sometimes, the calling code uses an empty RooArgSet to request evaluation
93 // without normalization set instead of following the `nullptr` convention.
94 // To remove this ambiguity which might not always be correctly handled in
95 // downstream code, we set `normalisationSet` to nullptr if it is pointing
96 // to an empty set.
97 if(normalisationSet && normalisationSet->empty()) {
98 normalisationSet = nullptr;
99 }
100#ifdef ROOFIT_CHECK_CACHED_VALUES
101 return _DEBUG_getVal(normalisationSet);
102#else
103
104#ifndef _WIN32
105 return (_fast && !_inhibitDirty) ? _value : getValV(normalisationSet) ;
106#else
107 return (_fast && !inhibitDirty()) ? _value : getValV(normalisationSet) ;
108#endif
109
110#endif
111 }
112
113 /// Like getVal(const RooArgSet*), but always requires an argument for normalisation.
114 inline double getVal(const RooArgSet& normalisationSet) const {
115 // Sometimes, the calling code uses an empty RooArgSet to request evaluation
116 // without normalization set instead of following the `nullptr` convention.
117 // To remove this ambiguity which might not always be correctly handled in
118 // downstream code, we set `normalisationSet` to nullptr if it is an empty set.
119 return _fast ? _value : getValV(normalisationSet.empty() ? nullptr : &normalisationSet) ;
120 }
121
122 virtual double getValV(const RooArgSet* normalisationSet = nullptr) const ;
123
124 /// \deprecated getValBatch() has been removed in favour of the faster getValues(). If your code is affected
125 /// by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this transition.
126 /// https://root.cern/doc/v624/release-notes.html
127#ifndef R__MACOSX
128 virtual RooSpan<const double> getValBatch(std::size_t /*begin*/, std::size_t /*maxSize*/, const RooArgSet* /*normSet*/ = nullptr) = delete;
129#else
130 //AppleClang in MacOS10.14 has a linker bug and fails to link programs that create objects of classes containing virtual deleted methods.
131 //This can be safely deleted when MacOS10.14 is no longer supported by ROOT. See https://reviews.llvm.org/D37830
132 virtual RooSpan<const double> getValBatch(std::size_t /*begin*/, std::size_t /*maxSize*/, const RooArgSet* /*normSet*/ = nullptr) final {
133 throw std::logic_error("Deprecated getValBatch() has been removed in favour of the faster getValues(). If your code is affected by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this transition. https://root.cern/doc/v624/release-notes.html");
134 }
135#endif
136 /// \copydoc getValBatch(std::size_t, std::size_t, const RooArgSet*)
137 virtual RooSpan<const double> getValues(RooBatchCompute::RunContext& evalData, const RooArgSet* normSet = nullptr) const;
138 std::vector<double> getValues(RooAbsData const& data, RooFit::BatchModeOption batchMode=RooFit::BatchModeOption::Cpu) const;
139
140 double getPropagatedError(const RooFitResult &fr, const RooArgSet &nset = RooArgSet()) const;
141
142 bool operator==(double value) const ;
143 bool operator==(const RooAbsArg& other) const override;
144 bool isIdentical(const RooAbsArg& other, bool assumeSameType=false) const override;
145
146
147 inline const Text_t *getUnit() const {
148 // Return string with unit description
149 return _unit.Data();
150 }
151 inline void setUnit(const char *unit) {
152 // Set unit description to given string
153 _unit= unit;
154 }
155 TString getTitle(bool appendUnit= false) const;
156
157 // Lightweight interface adaptors (caller takes ownership)
158 RooAbsFunc *bindVars(const RooArgSet &vars, const RooArgSet* nset=nullptr, bool clipInvalid=false) const;
159
160 // Create a fundamental-type object that can hold our value.
161 RooAbsArg *createFundamental(const char* newname=nullptr) const override;
162
163 // Analytical integration support
164 virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const ;
165 virtual double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const ;
166 virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const ;
167 virtual double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const ;
168 virtual bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
169 // Interface to force RooRealIntegral to offer given observable for internal integration
170 // even if this is deemed unsafe. This default implementation returns always false
171 return false ;
172 }
173 virtual void forceNumInt(bool flag=true) {
174 // If flag is true, all advertised analytical integrals will be ignored
175 // and all integrals are calculated numerically
176 _forceNumInt = flag ;
177 }
178 bool getForceNumInt() const { return _forceNumInt ; }
179
180 // Chi^2 fits to histograms
182 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),
183 const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
184 virtual RooFitResult* chi2FitTo(RooDataHist& data, const RooLinkedList& cmdList) ;
185
186 virtual RooAbsReal* createChi2(RooDataHist& data, const RooLinkedList& cmdList) ;
188 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),
189 const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
190
191 // Chi^2 fits to X-Y datasets
192 virtual RooFitResult* chi2FitTo(RooDataSet& xydata, const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
193 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),
194 const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
195 virtual RooFitResult* chi2FitTo(RooDataSet& xydata, const RooLinkedList& cmdList) ;
196
197 virtual RooAbsReal* createChi2(RooDataSet& data, const RooLinkedList& cmdList) ;
199 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),
200 const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
201
202
203 virtual RooAbsReal* createProfile(const RooArgSet& paramsOfInterest) ;
204
205
206 RooAbsReal* createIntegral(const RooArgSet& iset, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg::none(),
207 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
208 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
209 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
210
211 /// Create integral over observables in iset in range named rangeName.
212 RooAbsReal* createIntegral(const RooArgSet& iset, const char* rangeName) const {
213 return createIntegral(iset,nullptr,nullptr,rangeName) ;
214 }
215 /// Create integral over observables in iset in range named rangeName with integrand normalized over observables in nset
216 RooAbsReal* createIntegral(const RooArgSet& iset, const RooArgSet& nset, const char* rangeName=nullptr) const {
217 return createIntegral(iset,&nset,nullptr,rangeName) ;
218 }
219 /// Create integral over observables in iset in range named rangeName with integrand normalized over observables in nset while
220 /// using specified configuration for any numeric integration.
221 RooAbsReal* createIntegral(const RooArgSet& iset, const RooArgSet& nset, const RooNumIntConfig& cfg, const char* rangeName=nullptr) const {
222 return createIntegral(iset,&nset,&cfg,rangeName) ;
223 }
224 /// Create integral over observables in iset in range named rangeName using specified configuration for any numeric integration.
225 RooAbsReal* createIntegral(const RooArgSet& iset, const RooNumIntConfig& cfg, const char* rangeName=nullptr) const {
226 return createIntegral(iset,nullptr,&cfg,rangeName) ;
227 }
228 virtual RooAbsReal* createIntegral(const RooArgSet& iset, const RooArgSet* nset=nullptr, const RooNumIntConfig* cfg=nullptr, const char* rangeName=nullptr) const ;
229
230
231 void setParameterizeIntegral(const RooArgSet& paramVars) ;
232
233 // Create running integrals
234 RooAbsReal* createRunningIntegral(const RooArgSet& iset, const RooArgSet& nset=RooArgSet()) ;
235 RooAbsReal* createRunningIntegral(const RooArgSet& iset, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg::none(),
236 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
237 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
238 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
239 RooAbsReal* createIntRI(const RooArgSet& iset, const RooArgSet& nset=RooArgSet()) ;
240 RooAbsReal* createScanRI(const RooArgSet& iset, const RooArgSet& nset, Int_t numScanBins, Int_t intOrder) ;
241
242
243 // Optimized accept/reject generator support
244 virtual Int_t getMaxVal(const RooArgSet& vars) const ;
245 virtual double maxVal(Int_t code) const ;
246 virtual Int_t minTrialSamples(const RooArgSet& /*arGenObs*/) const { return 0 ; }
247
248
249 // Plotting options
250 void setPlotLabel(const char *label);
251 const char *getPlotLabel() const;
252
253 virtual double defaultErrorLevel() const {
254 // Return default level for MINUIT error analysis
255 return 1.0 ;
256 }
257
258 const RooNumIntConfig* getIntegratorConfig() const ;
262 RooNumIntConfig* specialIntegratorConfig(bool createOnTheFly) ;
263 void setIntegratorConfig() ;
264 void setIntegratorConfig(const RooNumIntConfig& config) ;
265
266 virtual void fixAddCoefNormalization(const RooArgSet& addNormSet=RooArgSet(),bool force=true) ;
267 virtual void fixAddCoefRange(const char* rangeName=nullptr,bool force=true) ;
268
269 virtual void preferredObservableScanOrder(const RooArgSet& obs, RooArgSet& orderedObs) const ;
270
271 // User entry point for plotting
272 virtual RooPlot* plotOn(RooPlot* frame,
273 const RooCmdArg& arg1=RooCmdArg(), const RooCmdArg& arg2=RooCmdArg(),
274 const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(),
275 const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(),
276 const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(),
277 const RooCmdArg& arg9=RooCmdArg(), const RooCmdArg& arg10=RooCmdArg()
278 ) const ;
279
280
282
283 // Forwarder function for backward compatibility
284 virtual RooPlot *plotSliceOn(RooPlot *frame, const RooArgSet& sliceSet, Option_t* drawOptions="L",
285 double scaleFactor=1.0, ScaleType stype=Relative, const RooAbsData* projData=nullptr) const;
286
287 // Fill an existing histogram
288 TH1 *fillHistogram(TH1 *hist, const RooArgList &plotVars,
289 double scaleFactor= 1, const RooArgSet *projectedVars= nullptr, bool scaling=true,
290 const RooArgSet* condObs=nullptr, bool setError=true) const;
291
292 // Create 1,2, and 3D histograms from and fill it
293 TH1 *createHistogram(const char* varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const ;
294 TH1* createHistogram(const char *name, const RooAbsRealLValue& xvar, RooLinkedList& argList) const ;
295 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar,
296 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
297 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
298 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
299 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
300
301 // Fill a RooDataHist
302 RooDataHist* fillDataHist(RooDataHist *hist, const RooArgSet* nset, double scaleFactor,
303 bool correctForBinVolume=false, bool showProgress=false) const ;
304
305 // I/O streaming interface (machine readable)
306 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
307 void writeToStream(std::ostream& os, bool compact) const override ;
308
309 // Printing interface (human readable)
310 void printValue(std::ostream& os) const override ;
311 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
312
313 inline void setCachedValue(double value, bool notifyClients = true) final;
314
315 // Evaluation error logging
316 class EvalError {
317 public:
319 EvalError(const EvalError& other) : _msg(other._msg), _srvval(other._srvval) { }
320 void setMessage(const char* tmp) { std::string s(tmp); s.swap(_msg); }
321 void setServerValues(const char* tmp) { std::string s(tmp); s.swap(_srvval); }
322 std::string _msg;
323 std::string _srvval;
324 } ;
325
329 void logEvalError(const char* message, const char* serverValueString=nullptr) const ;
330 static void logEvalError(const RooAbsReal* originator, const char* origName, const char* message, const char* serverValueString=nullptr) ;
331 static void printEvalErrors(std::ostream&os=std::cout, Int_t maxPerNode=10000000) ;
332 static Int_t numEvalErrors() ;
333 static Int_t numEvalErrorItems() ;
334
335
336 typedef std::map<const RooAbsArg*,std::pair<std::string,std::list<EvalError> > >::const_iterator EvalErrorIter ;
338
339 static void clearEvalErrorLog() ;
340
341 /// Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
342 virtual bool isBinnedDistribution(const RooArgSet& /*obs*/) const { return false ; }
343 virtual std::list<double>* binBoundaries(RooAbsRealLValue& obs, double xlo, double xhi) const;
344 virtual std::list<double>* plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const;
345
347 RooMultiGenFunction* iGenFunction(const RooArgSet& observables, const RooArgSet& nset=RooArgSet()) ;
348
349 RooFunctor* functor(const RooArgList& obs, const RooArgList& pars=RooArgList(), const RooArgSet& nset=RooArgSet()) const ;
350 TF1* asTF(const RooArgList& obs, const RooArgList& pars=RooArgList(), const RooArgSet& nset=RooArgSet()) const ;
351
352 RooDerivative* derivative(RooRealVar& obs, Int_t order=1, double eps=0.001) ;
353 RooDerivative* derivative(RooRealVar& obs, const RooArgSet& normSet, Int_t order, double eps=0.001) ;
354
355 RooAbsMoment* moment(RooRealVar& obs, Int_t order, bool central, bool takeRoot) ;
356 RooAbsMoment* moment(RooRealVar& obs, const RooArgSet& normObs, Int_t order, bool central, bool takeRoot, bool intNormObs) ;
357
358 RooAbsMoment* mean(RooRealVar& obs) { return moment(obs,1,false,false) ; }
359 RooAbsMoment* mean(RooRealVar& obs, const RooArgSet& nset) { return moment(obs,nset,1,false,false,true) ; }
360 RooAbsMoment* sigma(RooRealVar& obs) { return moment(obs,2,true,true) ; }
361 RooAbsMoment* sigma(RooRealVar& obs, const RooArgSet& nset) { return moment(obs,nset,2,true,true,true) ; }
362
363 double findRoot(RooRealVar& x, double xmin, double xmax, double yval) ;
364
365
366 virtual bool setData(RooAbsData& /*data*/, bool /*cloneData*/=true) { return true ; }
367
368 virtual void enableOffsetting(bool);
369 virtual bool isOffsetting() const { return false ; }
370 virtual double offset() const { return 0 ; }
371
372 static void setHideOffset(bool flag);
373 static bool hideOffset() ;
374
375protected:
376 // Hook for objects with normalization-dependent parameters interpretation
377 virtual void selectNormalization(const RooArgSet* depSet=nullptr, bool force=false) ;
378 virtual void selectNormalizationRange(const char* rangeName=nullptr, bool force=false) ;
379
380 // Helper functions for plotting
381 bool plotSanityChecks(RooPlot* frame) const ;
382 void makeProjectionSet(const RooAbsArg* plotVar, const RooArgSet* allVars,
383 RooArgSet& projectedVars, bool silent) const ;
384
385 TString integralNameSuffix(const RooArgSet& iset, const RooArgSet* nset=nullptr, const char* rangeName=nullptr, bool omitEmpty=false) const ;
386
387
388 bool isSelectedComp() const ;
389
390
391 public:
392 const RooAbsReal* createPlotProjection(const RooArgSet& depVars, const RooArgSet& projVars, RooArgSet*& cloneSet) const ;
393 const RooAbsReal *createPlotProjection(const RooArgSet &dependentVars, const RooArgSet *projectedVars,
394 RooArgSet *&cloneSet, const char* rangeName=nullptr, const RooArgSet* condObs=nullptr) const;
395 virtual void computeBatch(cudaStream_t*, double* output, size_t size, RooFit::Detail::DataMap const&) const;
396
397 protected:
398
400
401 void plotOnCompSelect(RooArgSet* selNodes) const ;
402 RooPlot* plotOnWithErrorBand(RooPlot* frame,const RooFitResult& fr, double Z, const RooArgSet* params, const RooLinkedList& argList, bool method1) const ;
403
404 // Support interface for subclasses to advertise their analytic integration
405 // and generator capabilities in their analyticalIntegral() and generateEvent()
406 // implementations.
407 bool matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps,
408 const RooArgProxy& a) const ;
409 bool matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps,
410 const RooArgProxy& a, const RooArgProxy& b) const ;
411 bool matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps,
412 const RooArgProxy& a, const RooArgProxy& b, const RooArgProxy& c) const ;
413 bool matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps,
414 const RooArgProxy& a, const RooArgProxy& b,
415 const RooArgProxy& c, const RooArgProxy& d) const ;
416
417 bool matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps,
418 const RooArgSet& set) const ;
419
420
421 RooAbsReal* createIntObj(const RooArgSet& iset, const RooArgSet* nset, const RooNumIntConfig* cfg, const char* rangeName) const ;
422 void findInnerMostIntegration(const RooArgSet& allObs, RooArgSet& innerObs, const char* rangeName) const ;
423
424
425 // Internal consistency checking (needed by RooDataSet)
426 /// Check if current value is valid.
427 bool isValid() const override { return isValidReal(_value); }
428 /// Interface function to check if given value is a valid value for this object. Returns true unless overridden.
429 virtual bool isValidReal(double /*value*/, bool printError = false) const { (void)printError; return true; }
430
431
432 // Function evaluation and error tracing
433 double traceEval(const RooArgSet* set) const ;
434
435 /// Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
436 virtual double evaluate() const = 0;
437
438 /// \deprecated evaluateBatch() has been removed in favour of the faster evaluateSpan(). If your code is affected
439 /// by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this transition.
440 /// https://root.cern/doc/v624/release-notes.html
441#ifndef R__MACOSX
442 virtual RooSpan<double> evaluateBatch(std::size_t /*begin*/, std::size_t /*maxSize*/) = delete;
443#else
444 //AppleClang in MacOS10.14 has a linker bug and fails to link programs that create objects of classes containing virtual deleted methods.
445 //This can be safely deleted when MacOS10.14 is no longer supported by ROOT. See https://reviews.llvm.org/D37830
446 virtual RooSpan<double> evaluateBatch(std::size_t /*begin*/, std::size_t /*maxSize*/) final {
447 throw std::logic_error("Deprecated evaluatedBatch() has been removed in favour of the faster evaluateSpan(). If your code is affected by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this transition. https://root.cern/doc/v624/release-notes.html");
448 }
449#endif
450
451 virtual RooSpan<double> evaluateSpan(RooBatchCompute::RunContext& evalData, const RooArgSet* normSet) const;
452
453
454 //---------- Interface to access batch data ---------------------------
455 //
457
458 private:
459 void checkBatchComputation(const RooBatchCompute::RunContext& evalData, std::size_t evtNo, const RooArgSet* normSet = nullptr, double relAccuracy = 1.E-13) const;
460
461 /// Debug version of getVal(), which is slow and does error checking.
462 double _DEBUG_getVal(const RooArgSet* normalisationSet) const;
463
464 //--------------------------------------------------------------------
465
466 protected:
467 // Hooks for RooDataSet interface
468 friend class RooVectorDataStore ;
469 void syncCache(const RooArgSet* set=nullptr) override { getVal(set) ; }
470 void copyCache(const RooAbsArg* source, bool valueOnly=false, bool setValDirty=true) override ;
471 void attachToTree(TTree& t, Int_t bufSize=32000) override ;
472 void attachToVStore(RooVectorDataStore& vstore) override ;
473 void setTreeBranchStatus(TTree& t, bool active) override ;
474 void fillTreeBranch(TTree& t) override ;
475
476 friend class RooRealBinding ;
477 double _plotMin ; ///< Minimum of plot range
478 double _plotMax ; ///< Maximum of plot range
479 Int_t _plotBins ; ///< Number of plot bins
480 mutable double _value ; ///< Cache for current value of object
481 TString _unit ; ///< Unit for objects value
482 TString _label ; ///< Plot label for objects value
483 bool _forceNumInt ; ///< Force numerical integration if flag set
484
485 RooNumIntConfig* _specIntegratorConfig ; // Numeric integrator configuration specific for this object
486
487 struct PlotOpt {
488 PlotOpt() : drawOptions("L"), scaleFactor(1.0), stype(Relative), projData(nullptr), binProjData(false), projSet(nullptr), precision(1e-3),
490 projectionRangeName(nullptr),curveInvisible(false), curveName(nullptr),addToCurveName(nullptr),addToWgtSelf(1.),addToWgtOther(1.),
491 numCPU(1),interleave(RooFit::Interleave),curveNameSuffix(""), numee(10), eeval(0), doeeval(false), progress(false), errorFR(nullptr) {}
493 double scaleFactor ;
498 double precision ;
501 const char* normRangeName ;
502 double rangeLo ;
503 double rangeHi ;
508 const char* curveName ;
509 const char* addToCurveName ;
514 const char* curveNameSuffix ;
516 double eeval ;
517 bool doeeval ;
518 bool progress ;
520 } ;
521
522 // Plot implementation functions
523 virtual RooPlot *plotOn(RooPlot* frame, PlotOpt o) const;
524
525public:
526 // PlotOn with command list
527 virtual RooPlot* plotOn(RooPlot* frame, RooLinkedList& cmdList) const ;
528
529 protected:
530 virtual RooPlot *plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue& asymCat, PlotOpt o) const;
531
532
533private:
534
536 static std::map<const RooAbsArg*,std::pair<std::string,std::list<EvalError> > > _evalErrorList ;
538
539 bool matchArgsByName(const RooArgSet &allArgs, RooArgSet &matchedArgs, const TList &nameList) const;
540
541 std::unique_ptr<TreeReadBuffer> _treeReadBuffer; //! A buffer for reading values from trees
542
543protected:
544
545 bool redirectServersHook(const RooAbsCollection & newServerList, bool mustReplaceAll,
546 bool nameChange, bool isRecursiveStep) override;
547
548 friend class RooRealSumPdf ;
549 friend class RooRealSumFunc;
550 friend class RooAddHelpers ;
551 friend class RooAddPdf ;
552 friend class RooAddModel ;
553 void selectComp(bool flag) {
554 // If flag is true, only selected component will be included in evaluates of RooAddPdf components
555 _selectComp = flag ;
556 }
557 static void globalSelectComp(bool flag) ;
558 bool _selectComp ; //! Component selection flag for RooAbsPdf::plotCompOn
559 static bool _globalSelectComp ; // Global activation switch for component selection
560 // This struct can be used to flip the global switch to select components.
561 // Doing this with RAII prevents forgetting to reset the state.
567 }
568
572 }
573
575 };
576
577
578 mutable RooArgSet* _lastNSet ; ///<!
579 static bool _hideOffset ; ///< Offset hiding flag
580
581 ClassDefOverride(RooAbsReal,2) // Abstract real-valued variable
582};
583
584
585/// Helper class to access a batch-related part of RooAbsReal's interface, which should not leak to the outside world.
587 public:
588 static void checkBatchComputation(const RooAbsReal& theReal, const RooBatchCompute::RunContext& evalData, std::size_t evtNo,
589 const RooArgSet* normSet = nullptr, double relAccuracy = 1.E-13) {
590 theReal.checkBatchComputation(evalData, evtNo, normSet, relAccuracy);
591 }
592};
593
594
595////////////////////////////////////////////////////////////////////////////////
596/// Overwrite the value stored in this object's cache.
597/// This can be used to fake a computation that resulted in `value`.
598/// \param[in] value Value to write.
599/// \param[in] notifyClients If true, notify users of this object that its value changed.
600/// This is the default.
601void RooAbsReal::setCachedValue(double value, bool notifyClients) {
602 _value = value;
603
604 if (notifyClients) {
606 _valueDirty = false;
607 }
608}
609
610
611#endif
#define d(i)
Definition: RSha256.hxx:102
#define c(i)
Definition: RSha256.hxx:101
#define e(i)
Definition: RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
char Text_t
Definition: RtypesCore.h:62
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
static void indent(ostringstream &buf, int indent_level)
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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition: TGX11.cxx:110
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
Helper class to access a batch-related part of RooAbsReal's interface, which should not leak to the o...
Definition: RooAbsReal.h:586
static void checkBatchComputation(const RooAbsReal &theReal, const RooBatchCompute::RunContext &evalData, std::size_t evtNo, const RooArgSet *normSet=nullptr, double relAccuracy=1.E-13)
Definition: RooAbsReal.h:588
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:71
bool _fast
Definition: RooAbsArg.h:714
bool _valueDirty
Definition: RooAbsArg.h:710
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:490
bool inhibitDirty() const
Delete watch flag.
Definition: RooAbsArg.cxx:109
static bool _inhibitDirty
Definition: RooAbsArg.h:693
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
bool empty() const
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:62
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:27
RooAbsMoment represents the first, second, or third order derivative of any RooAbsReal as calculated ...
Definition: RooAbsMoment.h:27
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
void setServerValues(const char *tmp)
Definition: RooAbsReal.h:321
std::string _srvval
Definition: RooAbsReal.h:323
void setMessage(const char *tmp)
Definition: RooAbsReal.h:320
EvalError(const EvalError &other)
Definition: RooAbsReal.h:319
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:62
virtual RooSpan< const double > getValBatch(std::size_t, std::size_t, const RooArgSet *=nullptr)=delete
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, double scaleFactor, bool correctForBinVolume=false, bool showProgress=false) const
Fill a RooDataHist with values sampled from this function at the bin centers.
virtual void selectNormalizationRange(const char *rangeName=nullptr, bool force=false)
Interface function to force use of a given normalization range to interpret function value.
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
bool isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
std::unique_ptr< TreeReadBuffer > _treeReadBuffer
Definition: RooAbsReal.h:541
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
void selectComp(bool flag)
Definition: RooAbsReal.h:553
RooGenFunction * iGenFunction(RooRealVar &x, const RooArgSet &nset=RooArgSet())
TString _label
Plot label for objects value.
Definition: RooAbsReal.h:482
@ RelativeExpected
Definition: RooAbsReal.h:281
bool _selectComp
Definition: RooAbsReal.h:558
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:91
double findRoot(RooRealVar &x, double xmin, double xmax, double yval)
Return value of x (in range xmin,xmax) at which function equals yval.
RooAbsMoment * mean(RooRealVar &obs)
Definition: RooAbsReal.h:358
virtual bool isOffsetting() const
Definition: RooAbsReal.h:369
virtual double getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
Definition: RooAbsReal.cxx:244
virtual RooPlot * plotSliceOn(RooPlot *frame, const RooArgSet &sliceSet, Option_t *drawOptions="L", double scaleFactor=1.0, ScaleType stype=Relative, const RooAbsData *projData=nullptr) const
static Int_t numEvalErrorItems()
Definition: RooAbsReal.cxx:311
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
Definition: RooAbsReal.cxx:128
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
virtual RooSpan< double > evaluateSpan(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet) const
Evaluate this object for a batch/span of data points.
RooAbsReal * createScanRI(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
Utility function for createRunningIntegral that construct an object implementing the numeric scanning...
static std::map< const RooAbsArg *, std::pair< std::string, std::list< EvalError > > > _evalErrorList
Definition: RooAbsReal.h:536
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
Definition: RooAbsReal.cxx:360
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables std::liste...
Definition: RooAbsReal.cxx:522
virtual RooAbsReal * createChi2(RooDataHist &data, const RooLinkedList &cmdList)
RooArgSet * _lastNSet
!
Definition: RooAbsReal.h:578
RooAbsArg * createFundamental(const char *newname=nullptr) const override
Create a RooRealVar fundamental object with our properties.
bool isValid() const override
Check if current value is valid.
Definition: RooAbsReal.h:427
bool _forceNumInt
Force numerical integration if flag set.
Definition: RooAbsReal.h:483
~RooAbsReal() override
Destructor.
Definition: RooAbsReal.cxx:181
void setParameterizeIntegral(const RooArgSet &paramVars)
bool matchArgsByName(const RooArgSet &allArgs, RooArgSet &matchedArgs, const TList &nameList) const
Check if allArgs contains matching elements for each name in nameList.
static bool hideOffset()
Definition: RooAbsReal.cxx:117
virtual RooAbsReal * createProfile(const RooArgSet &paramsOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
Definition: RooAbsReal.cxx:480
void setTreeBranchStatus(TTree &t, bool active) override
(De)Activate associated tree branch
TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, double scaleFactor=1, const RooArgSet *projectedVars=nullptr, bool scaling=true, const RooArgSet *condObs=nullptr, bool setError=true) const
Fill the ROOT histogram 'hist' with values sampled from this function at the bin centers.
Definition: RooAbsReal.cxx:988
virtual double defaultErrorLevel() const
Definition: RooAbsReal.h:253
double _DEBUG_getVal(const RooArgSet *normalisationSet) const
Debug version of getVal(), which is slow and does error checking.
RooAbsReal * createIntegral(const RooArgSet &iset, const RooArgSet &nset, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName with integrand normalized over obse...
Definition: RooAbsReal.h:216
bool plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
double getPropagatedError(const RooFitResult &fr, const RooArgSet &nset=RooArgSet()) const
Calculate error on self by linearly propagating errors on parameters using the covariance matrix from...
virtual void selectNormalization(const RooArgSet *depSet=nullptr, bool force=false)
Interface function to force use of a given set of observables to interpret function value.
RooDerivative * derivative(RooRealVar &obs, Int_t order=1, double eps=0.001)
Return function representing first, second or third order derivative of this function.
TH1 * createHistogram(const char *varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1, TH2 or TH3 with the values of this function for the variables w...
static EvalErrorIter evalErrorIter()
Definition: RooAbsReal.cxx:319
RooAbsReal * createIntRI(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Utility function for createRunningIntegral.
TF1 * asTF(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a ROOT TF1,2,3 object bound to this RooAbsReal with given definition of observables and parame...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
virtual bool setData(RooAbsData &, bool=true)
Definition: RooAbsReal.h:366
TString _unit
Unit for objects value.
Definition: RooAbsReal.h:481
static RooNumIntConfig * defaultIntegratorConfig()
Returns the default numeric integration configuration for all RooAbsReals.
RooFitResult * chi2FitDriver(RooAbsReal &fcn, RooLinkedList &cmdList)
Internal driver function for chi2 fits.
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
Definition: RooAbsReal.cxx:280
double getVal(const RooArgSet &normalisationSet) const
Like getVal(const RooArgSet*), but always requires an argument for normalisation.
Definition: RooAbsReal.h:114
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from stream (dummy for now)
Definition: RooAbsReal.cxx:435
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
void fillTreeBranch(TTree &t) override
Fill the tree branch that associated with this object with its current value.
RooAbsFunc * bindVars(const RooArgSet &vars, const RooArgSet *nset=nullptr, bool clipInvalid=false) const
Create an interface adaptor f(vars) that binds us to the specified variables (in arbitrary order).
RooNumIntConfig * _specIntegratorConfig
Definition: RooAbsReal.h:485
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
Definition: RooAbsReal.cxx:464
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
virtual RooSpan< double > evaluateBatch(std::size_t, std::size_t)=delete
bool operator==(double value) const
Equality operator comparing to a double.
Definition: RooAbsReal.cxx:191
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
A buffer for reading values from trees.
virtual Int_t minTrialSamples(const RooArgSet &) const
Definition: RooAbsReal.h:246
virtual bool isValidReal(double, bool printError=false) const
Interface function to check if given value is a valid value for this object. Returns true unless over...
Definition: RooAbsReal.h:429
void setIntegratorConfig()
Remove the specialized numeric integration configuration associated with this object.
void syncCache(const RooArgSet *set=nullptr) override
Definition: RooAbsReal.h:469
void printValue(std::ostream &os) const override
Print object value.
Definition: RooAbsReal.cxx:454
virtual bool forceAnalyticalInt(const RooAbsArg &) const
Definition: RooAbsReal.h:168
bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const override
Definition: RooAbsReal.cxx:211
void setUnit(const char *unit)
Definition: RooAbsReal.h:151
bool getForceNumInt() const
Definition: RooAbsReal.h:178
static bool _hideOffset
Offset hiding flag.
Definition: RooAbsReal.h:579
static ErrorLoggingMode _evalErrorMode
Definition: RooAbsReal.h:535
void attachToVStore(RooVectorDataStore &vstore) override
static Int_t _evalErrorCount
Definition: RooAbsReal.h:537
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy the cached value of another RooAbsArg to our cache.
virtual void fixAddCoefRange(const char *rangeName=nullptr, bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
double _value
Cache for current value of object.
Definition: RooAbsReal.h:480
virtual double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: RooAbsReal.cxx:403
void attachToTree(TTree &t, Int_t bufSize=32000) override
Attach object to a branch of given TTree.
std::map< constRooAbsArg *, std::pair< std::string, std::list< EvalError > > >::const_iterator EvalErrorIter
Definition: RooAbsReal.h:336
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
RooAbsReal * createIntObj(const RooArgSet &iset, const RooArgSet *nset, const RooNumIntConfig *cfg, const char *rangeName) const
Internal utility function for createIntegral() that creates the actual integral object.
Definition: RooAbsReal.cxx:593
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to stream (dummy for now)
Definition: RooAbsReal.cxx:445
double traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
Definition: RooAbsReal.cxx:328
RooAbsReal * createIntegral(const RooArgSet &iset, const RooArgSet &nset, const RooNumIntConfig &cfg, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName with integrand normalized over obse...
Definition: RooAbsReal.h:221
static void setHideOffset(bool flag)
Definition: RooAbsReal.cxx:116
void checkBatchComputation(const RooBatchCompute::RunContext &evalData, std::size_t evtNo, const RooArgSet *normSet=nullptr, double relAccuracy=1.E-13) const
Walk through expression tree headed by the this object, and check a batch computation.
static void globalSelectComp(bool flag)
Global switch controlling the activation of the selectComp() functionality.
RooAbsMoment * moment(RooRealVar &obs, Int_t order, bool central, bool takeRoot)
Return function representing moment of function of given order.
RooPlot * plotOnWithErrorBand(RooPlot *frame, const RooFitResult &fr, double Z, const RooArgSet *params, const RooLinkedList &argList, bool method1) const
Plot function or PDF on frame with support for visualization of the uncertainty encoded in the given ...
const char * getPlotLabel() const
Get the label associated with the variable.
Definition: RooAbsReal.cxx:415
virtual RooFitResult * chi2FitTo(RooDataHist &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Perform a fit to given histogram.
virtual void forceNumInt(bool flag=true)
Definition: RooAbsReal.h:173
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Definition: RooAbsReal.cxx:377
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
double _plotMax
Maximum of plot range.
Definition: RooAbsReal.h:478
virtual void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const
Interface method for function objects to indicate their preferred order of observables for scanning t...
virtual double maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
void findInnerMostIntegration(const RooArgSet &allObs, RooArgSet &innerObs, const char *rangeName) const
Utility function for createIntObj() that aids in the construct of recursive integrals over functions ...
Definition: RooAbsReal.cxx:709
TString integralNameSuffix(const RooArgSet &iset, const RooArgSet *nset=nullptr, const char *rangeName=nullptr, bool omitEmpty=false) const
Construct std::string with unique suffix name to give to integral object that encodes integrated obse...
Definition: RooAbsReal.cxx:764
RooAbsReal * createIntegral(const RooArgSet &iset, const RooNumIntConfig &cfg, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName using specified configuration for a...
Definition: RooAbsReal.h:225
virtual double evaluate() const =0
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
virtual void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const
Base function for computing multiple values of a RooAbsReal.
TString getTitle(bool appendUnit=false) const
Return this variable's title std::string.
Definition: RooAbsReal.cxx:226
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
virtual double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: RooAbsReal.cxx:389
RooAbsReal * createIntegral(const RooArgSet &iset, const char *rangeName) const
Create integral over observables in iset in range named rangeName.
Definition: RooAbsReal.h:212
const Text_t * getUnit() const
Definition: RooAbsReal.h:147
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
virtual bool isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooAbsReal.h:342
static void printEvalErrors(std::ostream &os=std::cout, Int_t maxPerNode=10000000)
Print all outstanding logged evaluation error on the given ostream.
virtual void enableOffsetting(bool)
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooAbsMoment * sigma(RooRealVar &obs, const RooArgSet &nset)
Definition: RooAbsReal.h:361
RooFunctor * functor(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a RooFunctor object bound to this RooAbsReal with given definition of observables and paramete...
void setCachedValue(double value, bool notifyClients=true) final
Overwrite the value stored in this object's cache.
Definition: RooAbsReal.h:601
Int_t _plotBins
Number of plot bins.
Definition: RooAbsReal.h:479
const RooAbsReal * createPlotProjection(const RooArgSet &depVars, const RooArgSet &projVars, RooArgSet *&cloneSet) const
Utility function for plotOn() that creates a projection of a function or p.d.f to be plotted on a Roo...
Definition: RooAbsReal.cxx:824
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
void setPlotLabel(const char *label)
Set the label associated with this variable.
Definition: RooAbsReal.cxx:425
void makeProjectionSet(const RooAbsArg *plotVar, const RooArgSet *allVars, RooArgSet &projectedVars, bool silent) const
Utility function for plotOn() that constructs the set of observables to project when plotting ourselv...
virtual Int_t getMaxVal(const RooArgSet &vars) const
Advertise capability to determine maximum value of function for given set of observables.
double _plotMin
Minimum of plot range.
Definition: RooAbsReal.h:477
RooAbsMoment * mean(RooRealVar &obs, const RooArgSet &nset)
Definition: RooAbsReal.h:359
virtual double offset() const
Definition: RooAbsReal.h:370
RooAbsMoment * sigma(RooRealVar &obs)
Definition: RooAbsReal.h:360
RooAbsReal * createRunningIntegral(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Calls createRunningIntegral(const RooArgSet&, const RooCmdArg&, const RooCmdArg&, const RooCmdArg&,...
static bool _globalSelectComp
Component selection flag for RooAbsPdf::plotCompOn.
Definition: RooAbsReal.h:559
RooAddModel is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddModel.h:28
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddPdf.h:34
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgProxy is the abstract interface for RooAbsArg proxy classes.
Definition: RooArgProxy.h:24
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:26
static const RooCmdArg & none()
Return reference to null argument.
Definition: RooCmdArg.cxx:51
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Definition: RooCurve.h:32
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:55
RooDerivative represents the first, second, or third order derivative of any RooAbsReal as calculated...
Definition: RooDerivative.h:30
This class can evaluate a RooAbsReal object in other ways than recursive graph traversal.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Definition: RooFunctor.h:25
Lightweight interface adaptor that exports a RooAbsReal as a ROOT::Math::IGenFunction.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
Lightweight interface adaptor that exports a RooAbsReal as a ROOT::Math::IMultiGenFunction.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:43
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
Definition: RooRealSumPdf.h:24
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:40
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
RooVectorDataStore uses std::vectors to store data columns.
1-Dim function class
Definition: TF1.h:213
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:577
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:257
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:268
A doubly linked list.
Definition: TList.h:38
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
A TTree represents a columnar dataset.
Definition: TTree.h:79
RooCmdArg Extended(bool flag=true)
Double_t x[n]
Definition: legend1.C:17
void(off) SmallVectorTemplateBase< T
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: Common.h:18
@ Interleave
Definition: RooGlobalFunc.h:64
BatchModeOption
For setting the batch mode flag with the BatchMode() command argument to RooAbsPdf::fitTo();.
Definition: RooGlobalFunc.h:68
static constexpr double s
const double xbins[xbins_n]
RooCurve::WingMode wmode
Definition: RooAbsReal.h:505
const char * normRangeName
Definition: RooAbsReal.h:501
RooFit::MPSplit interleave
Definition: RooAbsReal.h:513
const char * projectionRangeName
Definition: RooAbsReal.h:506
const RooArgSet * projDataSet
Definition: RooAbsReal.h:500
const char * curveNameSuffix
Definition: RooAbsReal.h:514
const char * addToCurveName
Definition: RooAbsReal.h:509
const RooFitResult * errorFR
Definition: RooAbsReal.h:519
const RooArgSet * projSet
Definition: RooAbsReal.h:497
const char * curveName
Definition: RooAbsReal.h:508
const RooAbsData * projData
Definition: RooAbsReal.h:495
Option_t * drawOptions
Definition: RooAbsReal.h:492
This struct enables passing computation data around between elements of a computation graph.
Definition: RunContext.h:32
TMarker m
Definition: textangle.C:8
TArc a
Definition: textangle.C:12
static void output()