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