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 "RooAbsCategory.h"
21#include "RooArgSet.h"
22#include "RooArgList.h"
23#include "RooSpan.h"
24
25#include "ROOT/RStringView.hxx"
26#include "TNamed.h"
27
28#include <map>
29#include <string>
30
31class RooAbsArg;
32class RooAbsReal ;
33class RooRealVar;
36class Roo1DTable ;
37class RooPlot;
38class RooArgList;
39class RooSimultaneous;
40class TH1;
41class TH2F;
42class RooAbsBinning ;
43class Roo1DTable ;
44class RooAbsDataStore ;
45template<typename T> class TMatrixTSym;
47class RooFormulaVar;
48namespace RooBatchCompute{
49struct RunContext;
50}
51namespace RooFit {
52namespace TestStatistics {
53class RooAbsL;
55}
56}
57
58
59// Writes a templated constructor for compatibility with ROOT builds using the
60// C++14 standard or earlier, taking `ROOT::Internal::TStringView` instead of
61// `std::string_view`. This means one can still use a `TString` for the name or
62// title parameter. The condition in the following `#if` should be kept in
63// sync with the one in TString.h.
64#if (__cplusplus >= 201700L) && !defined(_MSC_VER) && (!defined(__clang_major__) || __clang_major__ > 5)
65#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t) // does nothing
66#else
67#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t) \
68 template<typename ...Args_t> \
69 Class_t(ROOT::Internal::TStringView name, ROOT::Internal::TStringView title, Args_t &&... args) \
70 : Class_t(std::string_view(name), std::string_view(title), std::forward<Args_t>(args)...) {} \
71 template<typename ...Args_t> \
72 Class_t(ROOT::Internal::TStringView name, std::string_view title, Args_t &&... args) \
73 : Class_t(std::string_view(name), title, std::forward<Args_t>(args)...) {} \
74 template<typename ...Args_t> \
75 Class_t(std::string_view name, ROOT::Internal::TStringView title, Args_t &&... args) \
76 : Class_t(name, std::string_view(title), std::forward<Args_t>(args)...) {}
77#endif
78
79
80class RooAbsData : public TNamed, public RooPrintable {
81public:
82
83 // Constructors, factory methods etc.
84 RooAbsData() ;
86 RooAbsData(const RooAbsData& other, const char* newname = 0) ;
87
89
90 RooAbsData& operator=(const RooAbsData& other);
91 virtual ~RooAbsData() ;
92 virtual RooAbsData* emptyClone(const char* newName=0, const char* newTitle=0, const RooArgSet* vars=0, const char* wgtVarName=0) const = 0 ;
93
94 // Reduction methods
95 RooAbsData* reduce(const RooCmdArg& arg1,const RooCmdArg& arg2=RooCmdArg(),const RooCmdArg& arg3=RooCmdArg(),const RooCmdArg& arg4=RooCmdArg(),
96 const RooCmdArg& arg5=RooCmdArg(),const RooCmdArg& arg6=RooCmdArg(),const RooCmdArg& arg7=RooCmdArg(),const RooCmdArg& arg8=RooCmdArg()) ;
97 RooAbsData* reduce(const char* cut) ;
98 RooAbsData* reduce(const RooFormulaVar& cutVar) ;
99 RooAbsData* reduce(const RooArgSet& varSubset, const char* cut=0) ;
100 RooAbsData* reduce(const RooArgSet& varSubset, const RooFormulaVar& cutVar) ;
101
103 const RooAbsDataStore* store() const { return _dstore ; }
104 const TTree* tree() const ;
105 TTree *GetClonedTree() const;
106
107 void convertToVectorStore() ;
108 virtual void convertToTreeStore();
109
110 void attachBuffers(const RooArgSet& extObs) ;
111 void resetBuffers() ;
112
113
114 virtual void Draw(Option_t* option = "") ;
115
116 void checkInit() const ;
117
118 // Change name of observable
119 virtual Bool_t changeObservableName(const char* from, const char* to) ;
120
121 // Add one ore more rows of data
122 virtual void add(const RooArgSet& row, Double_t weight=1, Double_t weightError=0) = 0 ; // DERIVED
123 virtual void fill() ;
124
125 // Load a given row of data
126 virtual inline const RooArgSet* get() const {
127 // Return current row of dataset
128 return &_vars ;
129 }
130 virtual Double_t weight() const = 0 ; // DERIVED
131 virtual Double_t weightSquared() const = 0 ; // DERIVED
132 virtual Bool_t valid() const { return kTRUE ; }
133
135 /// Return the symmetric error on the current weight.
136 /// See also weightError(double&,double&,ErrorType) const for asymmetric errors.
137 /// \param[in] etype Type of error to compute. May throw if not supported.
138 virtual double weightError(ErrorType /*etype*/=Poisson) const {
139 // Dummy implementation returning zero, because not all deriving classes
140 // need to implement a non-zero weight error.
141 return 0.0;
142 }
143 /// Return the asymmetric errors on the current weight.
144 /// See also weightError(ErrorType) const for symmetric error.
145 /// \param[out] lo Low error.
146 /// \param[out] hi High error.
147 /// \param[in] etype Type of error to compute. May throw if not supported.
148 virtual void weightError(double& lo, double& hi, ErrorType /*etype*/=Poisson) const {
149 // Dummy implementation returning zero, because not all deriving classes
150 // need to implement a non-zero weight error.
151 lo=0;
152 hi=0;
153 }
154
155 virtual const RooArgSet* get(Int_t index) const ;
156
157 virtual void getBatches(RooBatchCompute::RunContext& evalData,
158 std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
159 virtual std::map<const std::string, RooSpan<const RooAbsCategory::value_type>> getCategoryBatches(std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
160
161 ////////////////////////////////////////////////////////////////////////////////
162 /// Return event weights of all events in range [first, first+len).
163 /// If no contiguous structure of weights is stored, an empty batch can be returned.
164 /// This indicates that the weight is constant. Use weight() to retrieve it.
165 virtual RooSpan<const double> getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const = 0;
166
167 /// Return number of entries in dataset, *i.e.*, count unweighted entries.
168 virtual Int_t numEntries() const ;
169 /// Return effective number of entries in dataset, *i.e.*, sum all weights.
170 virtual Double_t sumEntries() const = 0 ;
171 /// Return effective number of entries in dataset inside range or after cuts, *i.e.*, sum certain weights.
172 /// \param[in] cutSpec Apply given cut when counting (*e.g.* `0 < x && x < 5`). Passing `"1"` selects all events.
173 /// \param[in] cutRange If the observables have a range with this name, only count events inside this range.
174 virtual Double_t sumEntries(const char* cutSpec, const char* cutRange=0) const = 0 ; // DERIVED
175 double sumEntriesW2() const;
176 virtual Bool_t isWeighted() const {
177 // Do events in dataset have weights?
178 return kFALSE ;
179 }
180 virtual Bool_t isNonPoissonWeighted() const {
181 // Do events in dataset have non-integer weights?
182 return kFALSE ;
183 }
184 virtual void reset() ;
185
186
187 Bool_t getRange(const RooAbsRealLValue& var, Double_t& lowest, Double_t& highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const ;
188
189 // Plot the distribution of a real valued arg
190 virtual Roo1DTable* table(const RooArgSet& catSet, const char* cuts="", const char* opts="") const ;
191 virtual Roo1DTable* table(const RooAbsCategory& cat, const char* cuts="", const char* opts="") const ;
192 /// \see RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const
193 virtual RooPlot* plotOn(RooPlot* frame,
194 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
195 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
196 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
197 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
198
199 virtual RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;
200
201 // WVE --- This needs to be public to avoid CINT problems
202 struct PlotOpt {
205 scaleFactor(1.) {} ;
206 const char* cuts ;
210 const char* cutRange ;
211 const char* histName ;
213 const char* addToHistName ;
220 } ;
221
222 // Split a dataset by a category
223 virtual TList* split(const RooAbsCategory& splitCat, Bool_t createEmptyDataSets=kFALSE) const ;
224
225 // Split a dataset by categories of a RooSimultaneous
226 virtual TList* split(const RooSimultaneous& simpdf, Bool_t createEmptyDataSets=kFALSE) const ;
227
228 // Fast splitting for SimMaster setData
229 Bool_t canSplitFast() const ;
230 RooAbsData* getSimData(const char* idxstate) ;
231
232 /// Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const
233 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar,
234 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
235 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
236 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
237 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
238 /// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset.
239 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const ;
240 TH1 *createHistogram(const char* varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const ;
241
242 // Fill an existing histogram
243 virtual TH1 *fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts= "", const char* cutRange=0) const;
244
245 // Printing interface (human readable)
246 inline virtual void Print(Option_t *options= 0) const {
247 // Print contents on stdout
249 }
250
251 virtual void printName(std::ostream& os) const ;
252 virtual void printTitle(std::ostream& os) const ;
253 virtual void printClassName(std::ostream& os) const ;
254 void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
255
256 virtual Int_t defaultPrintContents(Option_t* opt) const ;
257
258 void setDirtyProp(Bool_t flag) ;
259
260 Double_t moment(const RooRealVar& var, Double_t order, const char* cutSpec=0, const char* cutRange=0) const ;
261 Double_t moment(const RooRealVar& var, Double_t order, Double_t offset, const char* cutSpec=0, const char* cutRange=0) const ;
262 Double_t standMoment(const RooRealVar& var, Double_t order, const char* cutSpec=0, const char* cutRange=0) const ;
263
264 Double_t mean(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return moment(var,1,0,cutSpec,cutRange) ; }
265 Double_t sigma(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return sqrt(moment(var,2,cutSpec,cutRange)) ; }
266 Double_t skewness(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return standMoment(var,3,cutSpec,cutRange) ; }
267 Double_t kurtosis(const RooRealVar& var, const char* cutSpec=0, const char* cutRange=0) const { return standMoment(var,4,cutSpec,cutRange) ; }
268
269 Double_t covariance(RooRealVar &x,RooRealVar &y, const char* cutSpec=0, const char* cutRange=0) const { return corrcov(x,y,cutSpec,cutRange,kFALSE) ; }
270 Double_t correlation(RooRealVar &x,RooRealVar &y, const char* cutSpec=0, const char* cutRange=0) const { return corrcov(x,y,cutSpec,cutRange,kTRUE) ; }
271
272 TMatrixDSym* covarianceMatrix(const char* cutSpec=0, const char* cutRange=0) const { return covarianceMatrix(*get(),cutSpec,cutRange) ; }
273 TMatrixDSym* correlationMatrix(const char* cutSpec=0, const char* cutRange=0) const { return correlationMatrix(*get(),cutSpec,cutRange) ; }
274 TMatrixDSym* covarianceMatrix(const RooArgList& vars, const char* cutSpec=0, const char* cutRange=0) const { return corrcovMatrix(vars,cutSpec,cutRange,kFALSE) ; }
275 TMatrixDSym* correlationMatrix(const RooArgList& vars, const char* cutSpec=0, const char* cutRange=0) const { return corrcovMatrix(vars,cutSpec,cutRange,kTRUE) ; }
276
277 RooRealVar* meanVar(const RooRealVar &var, const char* cutSpec=0, const char* cutRange=0) const ;
278 RooRealVar* rmsVar(const RooRealVar &var, const char* cutSpec=0, const char* cutRange=0) const ;
279
280 virtual RooPlot* statOn(RooPlot* frame,
281 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
282 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
283 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
284 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
285
286 virtual RooPlot* statOn(RooPlot* frame, const char *what,
287 const char *label= "", Int_t sigDigits= 2,
288 Option_t *options= "NELU", Double_t xmin=0.15,
289 Double_t xmax= 0.65,Double_t ymax=0.85,
290 const char* cutSpec=0, const char* cutRange=0,
291 const RooCmdArg* formatCmd=0);
292
293 virtual void RecursiveRemove(TObject *obj);
294
295 Bool_t hasFilledCache() const ;
296
297 void addOwnedComponent(const char* idxlabel, RooAbsData& data) ;
298 static void claimVars(RooAbsData*) ;
299 static Bool_t releaseVars(RooAbsData*) ;
300
302
303 static void setDefaultStorageType(StorageType s) ;
304
306
307 /// Returns snapshot of global observables stored in this data.
308 /// \return Pointer to a RooArgSet with the snapshot of global observables
309 /// stored in the data. Can be `nullptr` if no global observales are
310 /// stored.
311 RooArgSet const* getGlobalObservables() const { return _globalObservables.get(); }
312 void setGlobalObservables(RooArgSet const& globalObservables);
313
314protected:
315
317
319
320 Double_t corrcov(const RooRealVar& x, const RooRealVar& y, const char* cutSpec, const char* cutRange, Bool_t corr) const ;
321 TMatrixDSym* corrcovMatrix(const RooArgList& vars, const char* cutSpec, const char* cutRange, Bool_t corr) const ;
322
323 virtual void optimizeReadingWithCaching(RooAbsArg& arg, const RooArgSet& cacheList, const RooArgSet& keepObsList) ;
325
326
327 // PlotOn implementation
328 virtual RooPlot *plotOn(RooPlot *frame, PlotOpt o) const ;
329 virtual RooPlot *plotAsymOn(RooPlot* frame, const RooAbsCategoryLValue& asymCat, PlotOpt o) const ;
330 virtual RooPlot *plotEffOn(RooPlot* frame, const RooAbsCategoryLValue& effCat, PlotOpt o) const ;
331
332
333 // Constant term optimizer interface
334 friend class RooAbsArg ;
335 friend class RooAbsReal ;
337 friend class RooAbsCachedPdf ;
339 // for access into copied dataset:
341
342 virtual void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=0, Bool_t skipZeroWeights=kFALSE) ;
343 virtual void resetCache() ;
344 virtual void setArgStatus(const RooArgSet& set, Bool_t active) ;
345 virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) ;
346
347 virtual RooAbsData* cacheClone(const RooAbsArg* newCacheOwner, const RooArgSet* newCacheVars, const char* newName=0) = 0 ; // DERIVED
348 virtual RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange=0,
349 std::size_t nStart = 0, std::size_t = std::numeric_limits<std::size_t>::max(), Bool_t copyCache=kTRUE) = 0 ; // DERIVED
350
351 RooRealVar* dataRealVar(const char* methodname, const RooRealVar& extVar) const ;
352
353 // Column structure definition
354 RooArgSet _vars; // Dimensions of this data set
355 RooArgSet _cachedVars ; //! External variables cached with this data set
356
357 RooAbsDataStore* _dstore ; // Data storage implementation
358
359 std::map<std::string,RooAbsData*> _ownedComponents ; // Owned external components
360
361 std::unique_ptr<RooArgSet> _globalObservables; // Snapshot of global observables
362
363private:
364 void copyGlobalObservables(const RooAbsData& other);
365
366 ClassDef(RooAbsData, 6) // Abstract data collection
367};
368
369#endif
#define WRITE_TSTRING_COMPATIBLE_CONSTRUCTOR(Class_t)
Definition: RooAbsData.h:67
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
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:74
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:80
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:126
const RooAbsDataStore * store() const
Definition: RooAbsData.h:103
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:173
static void setDefaultStorageType(StorageType s)
Definition: RooAbsData.cxx:133
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:266
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:102
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:265
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:274
static Bool_t releaseVars(RooAbsData *)
If return value is true variables can be deleted.
Definition: RooAbsData.cxx:160
TMatrixDSym * correlationMatrix(const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:273
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:180
TMatrixDSym * correlationMatrix(const RooArgList &vars, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:275
Double_t kurtosis(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Definition: RooAbsData.h:267
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 std::map< const std::string, RooSpan< const RooAbsCategory::value_type > > getCategoryBatches(std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
virtual double weightError(ErrorType=Poisson) const
Return the symmetric error on the current weight.
Definition: RooAbsData.h:138
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:132
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:151
virtual Double_t weight() const =0
static StorageType defaultStorageType
Definition: RooAbsData.h:316
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:272
virtual Bool_t isWeighted() const
Definition: RooAbsData.h:176
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void fill()
Definition: RooAbsData.cxx:369
RooArgSet _vars
Definition: RooAbsData.h:354
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:246
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:309
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:270
double sumEntriesW2() const
Return sum of squared weights of this data.
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:345
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const =0
Return event weights of all events in range [first, first+len).
RooArgSet _cachedVars
Definition: RooAbsData.h:355
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 getBatches(RooBatchCompute::RunContext &evalData, std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
Write information to retrieve data columns into evalData.spans.
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:318
RooArgSet const * getGlobalObservables() const
Returns snapshot of global observables stored in this data.
Definition: RooAbsData.h:311
RooAbsData & operator=(const RooAbsData &other)
Definition: RooAbsData.cxx:267
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:269
virtual void resetCache()
Internal method – Remove cached function values.
Definition: RooAbsData.cxx:407
std::unique_ptr< RooArgSet > _globalObservables
Definition: RooAbsData.h:361
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:264
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:359
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:144
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:357
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:323
virtual void weightError(double &lo, double &hi, ErrorType=Poisson) const
Return the asymmetric errors on the current weight.
Definition: RooAbsData.h:148
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:63
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
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
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
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Namespace for dispatching RooFit computations to various backends.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: Common.h:18
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:219
const char * cuts
Definition: RooAbsData.h:205
const char * cutRange
Definition: RooAbsData.h:210
Double_t addToWgtOther
Definition: RooAbsData.h:215
const char * histName
Definition: RooAbsData.h:211
const char * addToHistName
Definition: RooAbsData.h:213
Double_t addToWgtSelf
Definition: RooAbsData.h:214
RooAbsData::ErrorType etype
Definition: RooAbsData.h:209
RooAbsBinning * bins
Definition: RooAbsData.h:208
Bool_t correctForBinWidth
Definition: RooAbsData.h:218
Option_t * drawOptions
Definition: RooAbsData.h:207
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.