Logo ROOT  
Reference Guide
RooAbsData.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsData.h,v 1.33 2007/07/16 21:04:28 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_DATA
17#define ROO_ABS_DATA
18
19#include "RooPrintable.h"
20#include "RooArgSet.h"
21#include "RooArgList.h"
22#include "RooSpan.h"
23
24#include "ROOT/RStringView.hxx"
25#include "TNamed.h"
26
27#include <map>
28#include <string>
29
30class RooAbsArg;
31class RooAbsReal ;
32class RooRealVar;
34class RooAbsCategory ;
36class Roo1DTable ;
37class RooPlot;
38class RooArgList;
39class TH1;
40class TH2F;
41class RooAbsBinning ;
42class Roo1DTable ;
43class RooAbsDataStore ;
44template<typename T> class TMatrixTSym;
46class RooFormulaVar;
47namespace RooBatchCompute{
48struct RunContext;
49}
50namespace RooFit {
51namespace TestStatistics {
52class RooAbsL;
54}
55}
56
57
58// Writes a templated constructor for compatibility with ROOT builds using the
59// C++14 standard or earlier, taking `ROOT::Internal::TStringView` instead of
60// `std::string_view`. This means one can still use a `TString` for the name or
61// title parameter. The condition in the following `#if` should be kept in
62// sync with the one in TString.h.
63#if (__cplusplus >= 201700L) && !defined(_MSC_VER) && (!defined(__clang_major__) || __clang_major__ > 5)
64#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t) // does nothing
65#else
66#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t) \
67 template<typename ...Args_t> \
68 Class_t(ROOT::Internal::TStringView name, ROOT::Internal::TStringView title, Args_t &&... args) \
69 : Class_t(std::string_view(name), std::string_view(title), std::forward<Args_t>(args)...) {} \
70 template<typename ...Args_t> \
71 Class_t(ROOT::Internal::TStringView name, std::string_view title, Args_t &&... args) \
72 : Class_t(std::string_view(name), title, std::forward<Args_t>(args)...) {} \
73 template<typename ...Args_t> \
74 Class_t(std::string_view name, ROOT::Internal::TStringView title, Args_t &&... args) \
75 : Class_t(name, std::string_view(title), std::forward<Args_t>(args)...) {}
76#endif
77
78
79class RooAbsData : public TNamed, public RooPrintable {
80public:
81
82 // Constructors, factory methods etc.
83 RooAbsData() ;
85 RooAbsData(const RooAbsData& other, const char* newname = 0) ;
86
88
89 RooAbsData& operator=(const RooAbsData& other);
90 virtual ~RooAbsData() ;
91 virtual RooAbsData* emptyClone(const char* newName=0, const char* newTitle=0, const RooArgSet* vars=0, const char* wgtVarName=0) const = 0 ;
92
93 // Reduction methods
94 RooAbsData* reduce(const RooCmdArg& arg1,const RooCmdArg& arg2=RooCmdArg(),const RooCmdArg& arg3=RooCmdArg(),const RooCmdArg& arg4=RooCmdArg(),
95 const RooCmdArg& arg5=RooCmdArg(),const RooCmdArg& arg6=RooCmdArg(),const RooCmdArg& arg7=RooCmdArg(),const RooCmdArg& arg8=RooCmdArg()) ;
96 RooAbsData* reduce(const char* cut) ;
97 RooAbsData* reduce(const RooFormulaVar& cutVar) ;
98 RooAbsData* reduce(const RooArgSet& varSubset, const char* cut=0) ;
99 RooAbsData* reduce(const RooArgSet& varSubset, const RooFormulaVar& cutVar) ;
100
102 const RooAbsDataStore* store() const { return _dstore ; }
103 const TTree* tree() const ;
104 TTree *GetClonedTree() const;
105
106 void convertToVectorStore() ;
107 virtual void convertToTreeStore();
108
109 void attachBuffers(const RooArgSet& extObs) ;
110 void resetBuffers() ;
111
112
113 virtual void Draw(Option_t* option = "") ;
114
115 void checkInit() const ;
116
117 // Change name of observable
118 virtual Bool_t changeObservableName(const char* from, const char* to) ;
119
120 // Add one ore more rows of data
121 virtual void add(const RooArgSet& row, Double_t weight=1, Double_t weightError=0) = 0 ; // DERIVED
122 virtual void fill() ;
123
124 // Load a given row of data
125 virtual inline const RooArgSet* get() const {
126 // Return current row of dataset
127 return &_vars ;
128 }
129 virtual Double_t weight() const = 0 ; // DERIVED
130 virtual Double_t weightSquared() const = 0 ; // DERIVED
131 virtual Bool_t valid() const { return kTRUE ; }
132
134 /// Return the symmetric error on the current weight.
135 /// See also weightError(double&,double&,ErrorType) const for asymmetric errors.
136 /// \param[in] etype Type of error to compute. May throw if not supported.
137 virtual double weightError(ErrorType /*etype*/=Poisson) const {
138 // Dummy implementation returning zero, because not all deriving classes
139 // need to implement a non-zero weight error.
140 return 0.0;
141 }
142 /// Return the asymmetric errors on the current weight.
143 /// See also weightError(ErrorType) const for symmetric error.
144 /// \param[out] lo Low error.
145 /// \param[out] hi High error.
146 /// \param[in] etype Type of error to compute. May throw if not supported.
147 virtual void weightError(double& lo, double& hi, ErrorType /*etype*/=Poisson) const {
148 // Dummy implementation returning zero, because not all deriving classes
149 // need to implement a non-zero weight error.
150 lo=0;
151 hi=0;
152 }
153
154 virtual const RooArgSet* get(Int_t index) const ;
155
156 /// Retrieve batches of data for each real-valued variable in this dataset.
157 /// \param[out] evalData Store references to all data batches in this struct.
158 /// \param first Index of first event that ends up in the batch.
159 /// \param len Number of events in each batch.
160 /// Needs to be overridden by derived classes. This implementation returns an empty RunContext.
162 std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const = 0;
163
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Return event weights of all events in range [first, first+len).
166 /// If no contiguous structure of weights is stored, an empty batch can be returned.
167 /// This indicates that the weight is constant. Use weight() to retrieve it.
168 virtual RooSpan<const double> getWeightBatch(std::size_t first, std::size_t len) const = 0;
169
170 /// Return number of entries in dataset, *i.e.*, count unweighted entries.
171 virtual Int_t numEntries() const ;
172 /// Return effective number of entries in dataset, *i.e.*, sum all weights.
173 virtual Double_t sumEntries() const = 0 ;
174 /// Return effective number of entries in dataset inside range or after cuts, *i.e.*, sum certain weights.
175 /// \param[in] cutSpec Apply given cut when counting (*e.g.* `0 < x && x < 5`). Passing `"1"` selects all events.
176 /// \param[in] cutRange If the observables have a range with this name, only count events inside this range.
177 virtual Double_t sumEntries(const char* cutSpec, const char* cutRange=0) const = 0 ; // DERIVED
178 virtual Bool_t isWeighted() const {
179 // Do events in dataset have weights?
180 return kFALSE ;
181 }
182 virtual Bool_t isNonPoissonWeighted() const {
183 // Do events in dataset have non-integer weights?
184 return kFALSE ;
185 }
186 virtual void reset() ;
187
188
189 Bool_t getRange(const RooAbsRealLValue& var, Double_t& lowest, Double_t& highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const ;
190
191 // Plot the distribution of a real valued arg
192 virtual Roo1DTable* table(const RooArgSet& catSet, const char* cuts="", const char* opts="") const ;
193 virtual Roo1DTable* table(const RooAbsCategory& cat, const char* cuts="", const char* opts="") const ;
194 /// \see RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const
195 virtual RooPlot* plotOn(RooPlot* frame,
196 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
197 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
198 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
199 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
200
201 virtual RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;
202
203 // WVE --- This needs to be public to avoid CINT problems
204 struct PlotOpt {
207 scaleFactor(1.) {} ;
208 const char* cuts ;
212 const char* cutRange ;
213 const char* histName ;
215 const char* addToHistName ;
222 } ;
223
224 // Split a dataset by a category
225 virtual TList* split(const RooAbsCategory& splitCat, Bool_t createEmptyDataSets=kFALSE) const ;
226
227 // Fast splitting for SimMaster setData
228 Bool_t canSplitFast() const ;
229 RooAbsData* getSimData(const char* idxstate) ;
230
231 /// Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const
232 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar,
233 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
234 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
235 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
236 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
237 /// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset.
238 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const ;
239 TH1 *createHistogram(const char* varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const ;
240
241 // Fill an existing histogram
242 virtual TH1 *fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts= "", const char* cutRange=0) const;
243
244 // Printing interface (human readable)
245 inline virtual void Print(Option_t *options= 0) const {
246 // Print contents on stdout
248 }
249
250 virtual void printName(std::ostream& os) const ;
251 virtual void printTitle(std::ostream& os) const ;
252 virtual void printClassName(std::ostream& os) const ;
253 void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
254
255 virtual Int_t defaultPrintContents(Option_t* opt) const ;
256
257 void setDirtyProp(Bool_t flag) ;
258
259 Double_t moment(const RooRealVar& var, Double_t order, const char* cutSpec=0, const char* cutRange=0) const ;
260 Double_t moment(const RooRealVar& var, Double_t order, Double_t offset, const char* cutSpec=0, const char* cutRange=0) const ;
261 Double_t standMoment(const RooRealVar& var, Double_t order, const char* cutSpec=0, const char* cutRange=0) const ;
262
263 Double_t mean(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return moment(var,1,0,cutSpec,cutRange) ; }
264 Double_t sigma(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return sqrt(moment(var,2,cutSpec,cutRange)) ; }
265 Double_t skewness(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return standMoment(var,3,cutSpec,cutRange) ; }
266 Double_t kurtosis(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return standMoment(var,4,cutSpec,cutRange) ; }
267
268 Double_t covariance(RooRealVar &x,RooRealVar &y, const char* cutSpec=0, const char* cutRange=0) const { return corrcov(x,y,cutSpec,cutRange,kFALSE) ; }
269 Double_t correlation(RooRealVar &x,RooRealVar &y, const char* cutSpec=0, const char* cutRange=0) const { return corrcov(x,y,cutSpec,cutRange,kTRUE) ; }
270
271 TMatrixDSym* covarianceMatrix(const char* cutSpec=0, const char* cutRange=0) const { return covarianceMatrix(*get(),cutSpec,cutRange) ; }
272 TMatrixDSym* correlationMatrix(const char* cutSpec=0, const char* cutRange=0) const { return correlationMatrix(*get(),cutSpec,cutRange) ; }
273 TMatrixDSym* covarianceMatrix(const RooArgList& vars, const char* cutSpec=0, const char* cutRange=0) const { return corrcovMatrix(vars,cutSpec,cutRange,kFALSE) ; }
274 TMatrixDSym* correlationMatrix(const RooArgList& vars, const char* cutSpec=0, const char* cutRange=0) const { return corrcovMatrix(vars,cutSpec,cutRange,kTRUE) ; }
275
276 RooRealVar* meanVar(const RooRealVar &var, const char* cutSpec=0, const char* cutRange=0) const ;
277 RooRealVar* rmsVar(const RooRealVar &var, const char* cutSpec=0, const char* cutRange=0) const ;
278
279 virtual RooPlot* statOn(RooPlot* frame,
280 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
281 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
282 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
283 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
284
285 virtual RooPlot* statOn(RooPlot* frame, const char *what,
286 const char *label= "", Int_t sigDigits= 2,
287 Option_t *options= "NELU", Double_t xmin=0.15,
288 Double_t xmax= 0.65,Double_t ymax=0.85,
289 const char* cutSpec=0, const char* cutRange=0,
290 const RooCmdArg* formatCmd=0);
291
292 virtual void RecursiveRemove(TObject *obj);
293
294 Bool_t hasFilledCache() const ;
295
296 void addOwnedComponent(const char* idxlabel, RooAbsData& data) ;
297 static void claimVars(RooAbsData*) ;
298 static Bool_t releaseVars(RooAbsData*) ;
299
301
302 static void setDefaultStorageType(StorageType s) ;
303
305
306 /// Returns snapshot of global observables stored in this data.
307 /// \return Pointer to a RooArgSet with the snapshot of global observables
308 /// stored in the data. Can be `nullptr` if no global observales are
309 /// stored.
310 RooArgSet const* getGlobalObservables() const { return _globalObservables.get(); }
311 void setGlobalObservables(RooArgSet const& globalObservables);
312
313protected:
314
316
318
319 Double_t corrcov(const RooRealVar& x, const RooRealVar& y, const char* cutSpec, const char* cutRange, Bool_t corr) const ;
320 TMatrixDSym* corrcovMatrix(const RooArgList& vars, const char* cutSpec, const char* cutRange, Bool_t corr) const ;
321
322 virtual void optimizeReadingWithCaching(RooAbsArg& arg, const RooArgSet& cacheList, const RooArgSet& keepObsList) ;
324
325
326 // PlotOn implementation
327 virtual RooPlot *plotOn(RooPlot *frame, PlotOpt o) const ;
328 virtual RooPlot *plotAsymOn(RooPlot* frame, const RooAbsCategoryLValue& asymCat, PlotOpt o) const ;
329 virtual RooPlot *plotEffOn(RooPlot* frame, const RooAbsCategoryLValue& effCat, PlotOpt o) const ;
330
331
332 // Constant term optimizer interface
333 friend class RooAbsArg ;
334 friend class RooAbsReal ;
336 friend class RooAbsCachedPdf ;
338 // for access into copied dataset:
340
341 virtual void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=0, Bool_t skipZeroWeights=kFALSE) ;
342 virtual void resetCache() ;
343 virtual void setArgStatus(const RooArgSet& set, Bool_t active) ;
344 virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) ;
345
346 virtual RooAbsData* cacheClone(const RooAbsArg* newCacheOwner, const RooArgSet* newCacheVars, const char* newName=0) = 0 ; // DERIVED
347 virtual RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange=0,
348 std::size_t nStart = 0, std::size_t = std::numeric_limits<std::size_t>::max(), Bool_t copyCache=kTRUE) = 0 ; // DERIVED
349
350 RooRealVar* dataRealVar(const char* methodname, const RooRealVar& extVar) const ;
351
352 // Column structure definition
353 RooArgSet _vars; // Dimensions of this data set
354 RooArgSet _cachedVars ; //! External variables cached with this data set
355
356 RooAbsDataStore* _dstore ; // Data storage implementation
357
358 std::map<std::string,RooAbsData*> _ownedComponents ; // Owned external components
359
360 std::unique_ptr<RooArgSet> _globalObservables; // Snapshot of global observables
361
362private:
363 void copyGlobalObservables(const RooAbsData& other);
364
365 ClassDef(RooAbsData, 6) // Abstract data collection
366};
367
368#endif
#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t)
Definition: RooAbsData.h:66
int Int_t
Definition: RtypesCore.h:45
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
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
float type_of_call hi(const int &, const int &)
float ymax
Definition: THbookFile.cxx:95
double sqrt(double)
Roo1DTable implements a one-dimensional table.
Definition: Roo1DTable.h:23
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:26
RooAbsCachedPdf is the abstract base class for p.d.f.s that need or want to cache their evaluate() ou...
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:79
RooRealVar * meanVar(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Create a RooRealVar containing the mean of observable 'var' in this dataset.
virtual const RooArgSet * get() const
Definition: RooAbsData.h:125
const RooAbsDataStore * store() const
Definition: RooAbsData.h:102
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
RooAbsData()
Default constructor.
Definition: RooAbsData.cxx:172
static void setDefaultStorageType(StorageType s)
Definition: RooAbsData.cxx:132
virtual Bool_t changeObservableName(const char *from, const char *to)
Definition: RooAbsData.cxx:356
Double_t skewness(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:265
RooRealVar * dataRealVar(const char *methodname, const RooRealVar &extVar) const
Internal method to check if given RooRealVar maps to a RooRealVar in this dataset.
Definition: RooAbsData.cxx:957
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.
Definition: RooAbsData.cxx:805
void setGlobalObservables(RooArgSet const &globalObservables)
Sets the global observables stored in this data.
RooAbsDataStore * store()
Definition: RooAbsData.h:101
virtual void reset()
Definition: RooAbsData.cxx:383
Double_t sigma(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:264
virtual RooAbsData * cacheClone(const RooAbsArg *newCacheOwner, const RooArgSet *newCacheVars, const char *newName=0)=0
TMatrixDSym * covarianceMatrix(const RooArgList &vars, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:273
static Bool_t releaseVars(RooAbsData *)
If return value is true variables can be deleted.
Definition: RooAbsData.cxx:159
TMatrixDSym * correlationMatrix(const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:272
TMatrixDSym * corrcovMatrix(const RooArgList &vars, const char *cutSpec, const char *cutRange, Bool_t corr) const
Return covariance matrix from data for given list of observables.
virtual Bool_t isNonPoissonWeighted() const
Definition: RooAbsData.h:182
virtual void getBatches(RooBatchCompute::RunContext &evalData, std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const =0
Retrieve batches of data for each real-valued variable in this dataset.
TMatrixDSym * correlationMatrix(const RooArgList &vars, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:274
Double_t kurtosis(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:266
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const =0
Return event weights of all events in range [first, first+len).
virtual Double_t sumEntries(const char *cutSpec, const char *cutRange=0) const =0
Return effective number of entries in dataset inside range or after cuts, i.e.
virtual TList * split(const RooAbsCategory &splitCat, Bool_t createEmptyDataSets=kFALSE) const
Split dataset into subsets based on states of given splitCat in this dataset.
virtual Double_t sumEntries() const =0
Return effective number of entries in dataset, i.e., sum all weights.
virtual double weightError(ErrorType=Poisson) const
Return the symmetric error on the current weight.
Definition: RooAbsData.h:137
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
Definition: RooAbsData.cxx:858
virtual TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts="", const char *cutRange=0) const
Loop over columns of our tree data and fill the input histogram.
virtual RooPlot * statOn(RooPlot *frame, 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())
Add a box with statistics information to the specified frame.
void checkInit() const
virtual Bool_t valid() const
Definition: RooAbsData.h:131
virtual RooPlot * plotEffOn(RooPlot *frame, const RooAbsCategoryLValue &effCat, PlotOpt o) const
Create and fill a histogram with the efficiency N[1] / ( N[1] + N[0] ), where N(1/0) is the number of...
virtual void optimizeReadingWithCaching(RooAbsArg &arg, const RooArgSet &cacheList, const RooArgSet &keepObsList)
Prepare dataset for use with cached constant terms listed in 'cacheList' of expression 'arg'.
static void claimVars(RooAbsData *)
Definition: RooAbsData.cxx:150
virtual Double_t weight() const =0
static StorageType defaultStorageType
Definition: RooAbsData.h:315
virtual Double_t weightSquared() const =0
Double_t standMoment(const RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate standardized moment.
Definition: RooAbsData.cxx:880
TMatrixDSym * covarianceMatrix(const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:271
virtual Bool_t isWeighted() const
Definition: RooAbsData.h:178
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void fill()
Definition: RooAbsData.cxx:369
RooArgSet _vars
Definition: RooAbsData.h:353
virtual void printName(std::ostream &os) const
Print name of dataset.
Definition: RooAbsData.cxx:835
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsData.h:245
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
Create and fill a histogram with the asymmetry N[+] - N[-] / ( N[+] + N[-] ), where N(+/-) is the num...
RooAbsData * getSimData(const char *idxstate)
virtual void Draw(Option_t *option="")
Forward draw command to data store.
virtual RooAbsData * reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=0, std::size_t nStart=0, std::size_t=std::numeric_limits< std::size_t >::max(), Bool_t copyCache=kTRUE)=0
void copyGlobalObservables(const RooAbsData &other)
Definition: RooAbsData.cxx:308
RooRealVar * rmsVar(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Create a RooRealVar containing the RMS of observable 'var' in this dataset.
Double_t correlation(RooRealVar &x, RooRealVar &y, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:269
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Internal method – Attach dataset copied with cache contents to copied instances of functions.
Definition: RooAbsData.cxx:416
Double_t corrcov(const RooRealVar &x, const RooRealVar &y, const char *cutSpec, const char *cutRange, Bool_t corr) const
Internal method to calculate single correlation and covariance elements.
Definition: RooAbsData.cxx:976
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
Definition: RooAbsData.cxx:344
RooArgSet _cachedVars
Definition: RooAbsData.h:354
virtual void add(const RooArgSet &row, Double_t weight=1, Double_t weightError=0)=0
Bool_t getRange(const RooAbsRealLValue &var, Double_t &lowest, Double_t &highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const
Fill Doubles 'lowest' and 'highest' with the lowest and highest value of observable 'var' in this dat...
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Definition: RooAbsData.cxx:376
virtual void convertToTreeStore()
Convert vector-based storage to tree-based storage.
virtual RooPlot * plotOn(RooPlot *frame, 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()) const
Definition: RooAbsData.cxx:604
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default print options, for a given print style.
Definition: RooAbsData.cxx:866
StorageType storageType
Definition: RooAbsData.h:317
RooArgSet const * getGlobalObservables() const
Returns snapshot of global observables stored in this data.
Definition: RooAbsData.h:310
RooAbsData & operator=(const RooAbsData &other)
Definition: RooAbsData.cxx:266
Double_t moment(const RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate moment of requested order.
Definition: RooAbsData.cxx:899
Double_t covariance(RooRealVar &x, RooRealVar &y, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:268
virtual void resetCache()
Internal method – Remove cached function values.
Definition: RooAbsData.cxx:407
std::unique_ptr< RooArgSet > _globalObservables
Definition: RooAbsData.h:360
Bool_t hasFilledCache() const
TTree * GetClonedTree() const
Return a clone of the TTree which stores the data or create such a tree if vector storage is used.
RooAbsData * reduce(const RooCmdArg &arg1, 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())
Create a reduced copy of this dataset.
Definition: RooAbsData.cxx:451
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kFALSE)
Internal method – Cache given set of functions with data.
Definition: RooAbsData.cxx:399
void attachBuffers(const RooArgSet &extObs)
Double_t mean(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:263
virtual RooAbsData * emptyClone(const char *newName=0, const char *newTitle=0, const RooArgSet *vars=0, const char *wgtVarName=0) const =0
virtual void setArgStatus(const RooArgSet &set, Bool_t active)
Definition: RooAbsData.cxx:423
virtual void printClassName(std::ostream &os) const
Print class name of dataset.
Definition: RooAbsData.cxx:851
std::map< std::string, RooAbsData * > _ownedComponents
Definition: RooAbsData.h:358
TH1 * createHistogram(const char *name, const RooAbsRealLValue &xvar, 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()) const
Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) c...
Definition: RooAbsData.cxx:682
static StorageType getDefaultStorageType()
Definition: RooAbsData.cxx:143
void resetBuffers()
Bool_t canSplitFast() const
virtual void printTitle(std::ostream &os) const
Print title of dataset.
Definition: RooAbsData.cxx:843
RooAbsDataStore * _dstore
External variables cached with this data set.
Definition: RooAbsData.h:356
const TTree * tree() const
Return a pointer to the TTree which stores the data.
Bool_t allClientsCached(RooAbsArg *, const RooArgSet &)
Utility function that determines if all clients of object 'var' appear in given list of cached nodes.
void setDirtyProp(Bool_t flag)
Control propagation of dirty flags from observables in dataset.
Definition: RooAbsData.cxx:431
virtual ~RooAbsData()
Destructor.
Definition: RooAbsData.cxx:322
virtual void weightError(double &lo, double &hi, ErrorType=Poisson) const
Return the asymmetric errors on the current weight.
Definition: RooAbsData.h:147
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:35
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:27
static const RooCmdArg & none()
Return reference to null argument.
Definition: RooCmdArg.cxx:52
A RooFormulaVar is a generic implementation of a real-valued object, which takes a RooArgList of serv...
Definition: RooFormulaVar.h:30
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:44
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
virtual StyleOption defaultPrintStyle(Option_t *opt) const
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
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
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
A doubly linked list.
Definition: TList.h:44
TMatrixTSym.
Definition: TMatrixTSym.h:34
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
A TTree represents a columnar dataset.
Definition: TTree.h:79
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
basic_string_view< char > string_view
Namespace for dispatching RooFit computations to various backends.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
static constexpr double s
Definition: first.py:1
const double xbins[xbins_n]
static const char * what
Definition: stlLoader.cc:6
Double_t scaleFactor
Definition: RooAbsData.h:221
const char * cuts
Definition: RooAbsData.h:207
const char * cutRange
Definition: RooAbsData.h:212
Double_t addToWgtOther
Definition: RooAbsData.h:217
const char * histName
Definition: RooAbsData.h:213
const char * addToHistName
Definition: RooAbsData.h:215
Double_t addToWgtSelf
Definition: RooAbsData.h:216
RooAbsData::ErrorType etype
Definition: RooAbsData.h:211
RooAbsBinning * bins
Definition: RooAbsData.h:210
Bool_t correctForBinWidth
Definition: RooAbsData.h:220
Option_t * drawOptions
Definition: RooAbsData.h:209
This struct enables passing computation data around between elements of a computation graph.
Definition: RunContext.h:31
Analyzes a function given a dataset/observables for constant terms and caches those in the dataset.