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