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"
25#include "RooFit/UniqueId.h"
27
28#include <ROOT/RConfig.hxx> // R__DEPRECATED
29#include "TNamed.h"
30
31#include <map>
32#include <string>
33
34class RooAbsArg;
35class RooAbsReal ;
36class RooRealVar;
39class Roo1DTable ;
40class RooPlot;
41class RooArgList;
42class RooSimultaneous;
43class TH1;
44class TH2F;
45class RooAbsBinning ;
46class Roo1DTable ;
47class RooAbsDataStore ;
48template<typename T> class TMatrixTSym;
50class RooFormulaVar;
51namespace RooFit {
52namespace TestStatistics {
53class RooAbsL;
55}
56}
57
58
59class RooAbsData : public TNamed, public RooPrintable {
60public:
61
62 // Constructors, factory methods etc.
63 RooAbsData() ;
65 RooAbsData(const RooAbsData& other, const char* newname = nullptr) ;
66
67 RooAbsData& operator=(const RooAbsData& other);
68 ~RooAbsData() override ;
69 virtual RooAbsData* emptyClone(const char* newName=nullptr, const char* newTitle=nullptr, const RooArgSet* vars=nullptr, const char* wgtVarName=nullptr) const = 0 ;
70
71 // Reduction methods
72 RooAbsData* reduce(const RooCmdArg& arg1,const RooCmdArg& arg2=RooCmdArg(),const RooCmdArg& arg3=RooCmdArg(),const RooCmdArg& arg4=RooCmdArg(),
73 const RooCmdArg& arg5=RooCmdArg(),const RooCmdArg& arg6=RooCmdArg(),const RooCmdArg& arg7=RooCmdArg(),const RooCmdArg& arg8=RooCmdArg()) ;
74 RooAbsData* reduce(const char* cut) ;
75 RooAbsData* reduce(const RooFormulaVar& cutVar) ;
76 RooAbsData* reduce(const RooArgSet& varSubset, const char* cut=nullptr) ;
77 RooAbsData* reduce(const RooArgSet& varSubset, const RooFormulaVar& cutVar) ;
78
80 const RooAbsDataStore* store() const { return _dstore.get(); }
81 const TTree* tree() const ;
82 TTree *GetClonedTree() const;
83
85 virtual void convertToTreeStore();
86
87 void attachBuffers(const RooArgSet& extObs) ;
88 void resetBuffers() ;
89
90
91 void Draw(Option_t* option = "") override ;
92
93 void checkInit() const ;
94
95 // Change name of observable
96 virtual bool changeObservableName(const char* from, const char* to) ;
97
98 // Add one ore more rows of data
99 virtual void add(const RooArgSet& row, double weight=1, double weightError=0.0) = 0 ; // DERIVED
100 virtual void fill() ;
101
102 // Load a given row of data
103 virtual inline const RooArgSet* get() const {
104 // Return current row of dataset
105 return &_vars ;
106 }
107 virtual double weight() const = 0 ; // DERIVED
108 virtual double weightSquared() const = 0 ; // DERIVED
109
111 /// Return the symmetric error on the current weight.
112 /// See also weightError(double&,double&,ErrorType) const for asymmetric errors.
113 // \param[in] etype Type of error to compute. May throw if not supported.
114 virtual double weightError(ErrorType /*etype*/=Poisson) const {
115 // Dummy implementation returning zero, because not all deriving classes
116 // need to implement a non-zero weight error.
117 return 0.0;
118 }
119 /// Return the asymmetric errors on the current weight.
120 /// See also weightError(ErrorType) const for symmetric error.
121 /// \param[out] lo Low error.
122 /// \param[out] hi High error.
123 // \param[in] etype Type of error to compute. May throw if not supported.
124 virtual void weightError(double& lo, double& hi, ErrorType /*etype*/=Poisson) const {
125 // Dummy implementation returning zero, because not all deriving classes
126 // need to implement a non-zero weight error.
127 lo=0;
128 hi=0;
129 }
130
131 virtual const RooArgSet* get(Int_t index) const ;
132
133 using RealSpans = std::map<RooFit::Detail::DataKey, RooSpan<const double>>;
134 using CategorySpans = std::map<RooFit::Detail::DataKey, RooSpan<const RooAbsCategory::value_type>>;
135
136 RealSpans getBatches(std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
137 CategorySpans getCategoryBatches(std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
138
139 ////////////////////////////////////////////////////////////////////////////////
140 /// Return event weights of all events in range [first, first+len).
141 /// If no contiguous structure of weights is stored, an empty batch can be returned.
142 /// This indicates that the weight is constant. Use weight() to retrieve it.
143 virtual RooSpan<const double> getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const = 0;
144
145 /// Return number of entries in dataset, i.e., count unweighted entries.
146 virtual Int_t numEntries() const ;
147 /// Return effective number of entries in dataset, i.e., sum all weights.
148 virtual double sumEntries() const = 0 ;
149 /// Return effective number of entries in dataset inside range or after cuts, i.e., sum certain weights.
150 /// \param[in] cutSpec Apply given cut when counting (e.g. `0 < x && x < 5`). Passing `"1"` selects all events.
151 /// \param[in] cutRange If the observables have a range with this name, only count events inside this range.
152 virtual double sumEntries(const char* cutSpec, const char* cutRange=nullptr) const = 0 ; // DERIVED
153 double sumEntriesW2() const;
154 virtual bool isWeighted() const {
155 // Do events in dataset have weights?
156 return false ;
157 }
158 virtual bool isNonPoissonWeighted() const {
159 // Do events in dataset have non-integer weights?
160 return false ;
161 }
162 virtual void reset() ;
163
164
165 bool getRange(const RooAbsRealLValue& var, double& lowest, double& highest, double marginFrac=0.0, bool symMode=false) const ;
166
167 // Plot the distribution of a real valued arg
168 virtual Roo1DTable* table(const RooArgSet& catSet, const char* cuts="", const char* opts="") const ;
169 virtual Roo1DTable* table(const RooAbsCategory& cat, const char* cuts="", const char* opts="") const ;
170 /// \see RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const
171 virtual RooPlot* plotOn(RooPlot* frame,
172 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
173 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
174 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
175 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
176
177 virtual RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;
178
179 // WVE --- This needs to be public to avoid CINT problems
180 struct PlotOpt {
181 PlotOpt() : cuts(""), drawOptions("P"), bins(nullptr), etype(RooAbsData::Poisson), cutRange(nullptr), histName(nullptr), histInvisible(false),
183 scaleFactor(1.) {} ;
184 const char* cuts ;
188 const char* cutRange ;
189 const char* histName ;
191 const char* addToHistName ;
194 double xErrorSize ;
197 double scaleFactor ;
198 } ;
199
200 // Split a dataset by a category
201 virtual TList* split(const RooAbsCategory& splitCat, bool createEmptyDataSets=false) const ;
202
203 // Split a dataset by categories of a RooSimultaneous
204 virtual TList* split(const RooSimultaneous& simpdf, bool createEmptyDataSets=false) const ;
205
206 // Fast splitting for SimMaster setData
207 bool canSplitFast() const ;
208 RooAbsData* getSimData(const char* idxstate) ;
209
210 /// Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const
211 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar,
212 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
213 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
214 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
215 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
216 // Developer note: the `binArgX` parameter has no default `none` value,
217 // because then the signature would be ambiguous with the deprecated bin
218 // integer overload below. When the deprecated overload is removed, a default
219 // value must be set (tutorial failures will remind us to do that).
220 TH1 *createHistogram(const char* varNameList,
221 const RooCmdArg& binArgX, const RooCmdArg& binArgY=RooCmdArg::none(),
222 const RooCmdArg& binArgZ=RooCmdArg::none()) const;
223 /// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset.
224 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const ;
225 TH1 *createHistogram(const char* varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
226 R__DEPRECATED(6, 30, "Use the overload of RooAbsData::createHistogram that takes RooFit command arguments.");
227 TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts="",
228 const char *name= "hist") const;
229 TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, int nx, int ny,
230 const char* cuts="", const char *name="hist") const;
231
232 // Fill an existing histogram
233 virtual TH1 *fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts= "", const char* cutRange=nullptr) const;
234
235 // Printing interface (human readable)
236 inline void Print(Option_t *options= nullptr) const override {
237 // Print contents on stdout
239 }
240
241 void printName(std::ostream& os) const override ;
242 void printTitle(std::ostream& os) const override ;
243 void printClassName(std::ostream& os) const override ;
244 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
245
246 Int_t defaultPrintContents(Option_t* opt) const override ;
247
248 void setDirtyProp(bool flag) ;
249
250 double moment(const RooRealVar& var, double order, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
251 double moment(const RooRealVar& var, double order, double offset, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
252 double standMoment(const RooRealVar& var, double order, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
253
254 double mean(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return moment(var,1,0,cutSpec,cutRange) ; }
255 double sigma(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return sqrt(moment(var,2,cutSpec,cutRange)) ; }
256 double skewness(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return standMoment(var,3,cutSpec,cutRange) ; }
257 double kurtosis(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return standMoment(var,4,cutSpec,cutRange) ; }
258
259 double covariance(RooRealVar &x,RooRealVar &y, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcov(x,y,cutSpec,cutRange,false) ; }
260 double correlation(RooRealVar &x,RooRealVar &y, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcov(x,y,cutSpec,cutRange,true) ; }
261
262 TMatrixDSym* covarianceMatrix(const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return covarianceMatrix(*get(),cutSpec,cutRange) ; }
263 TMatrixDSym* correlationMatrix(const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return correlationMatrix(*get(),cutSpec,cutRange) ; }
264 TMatrixDSym* covarianceMatrix(const RooArgList& vars, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcovMatrix(vars,cutSpec,cutRange,false) ; }
265 TMatrixDSym* correlationMatrix(const RooArgList& vars, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcovMatrix(vars,cutSpec,cutRange,true) ; }
266
267 RooRealVar* meanVar(const RooRealVar &var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
268 RooRealVar* rmsVar(const RooRealVar &var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
269
270 virtual RooPlot* statOn(RooPlot* frame,
271 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
272 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
273 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
274 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
275
276 virtual RooPlot* statOn(RooPlot* frame, const char *what,
277 const char *label= "", Int_t sigDigits= 2,
278 Option_t *options= "NELU", double xmin=0.15,
279 double xmax= 0.65,double ymax=0.85,
280 const char* cutSpec=nullptr, const char* cutRange=nullptr,
281 const RooCmdArg* formatCmd=nullptr);
282
283 void RecursiveRemove(TObject *obj) override;
284
285 bool hasFilledCache() const ;
286
287 void addOwnedComponent(const char* idxlabel, RooAbsData& data) ;
288 static void claimVars(RooAbsData*) ;
289 static bool releaseVars(RooAbsData*) ;
290
292
293 static void setDefaultStorageType(StorageType s) ;
294
296
297 /// Returns snapshot of global observables stored in this data.
298 /// \return Pointer to a RooArgSet with the snapshot of global observables
299 /// stored in the data. Can be `nullptr` if no global observables are
300 /// stored.
302 void setGlobalObservables(RooArgSet const& globalObservables);
303
304 /// De-duplicated pointer to this object's name.
305 /// This can be used for fast name comparisons.
306 /// like `if (namePtr() == other.namePtr())`.
307 /// \note TNamed::GetName() will return a pointer that's
308 /// different for each object, but namePtr() always points
309 /// to a unique instance.
310 inline const TNamed* namePtr() const {
311 return _namePtr ;
312 }
313
314 void SetName(const char* name) override ;
315 void SetNameTitle(const char *name, const char *title) override ;
316
317 /// Returns a unique ID that is different for every instantiated RooAbsData object.
318 /// This ID can be used whether two RooAbsData are the same object, which is safer
319 /// than memory address comparisons that might result in false positives when
320 /// memory is reused.
322
323protected:
324
326
328
329 void initializeVars(RooArgSet const& vars);
330
331 double corrcov(const RooRealVar& x, const RooRealVar& y, const char* cutSpec, const char* cutRange, bool corr) const ;
332 TMatrixDSym* corrcovMatrix(const RooArgList& vars, const char* cutSpec, const char* cutRange, bool corr) const ;
333
334 virtual void optimizeReadingWithCaching(RooAbsArg& arg, const RooArgSet& cacheList, const RooArgSet& keepObsList) ;
335 bool allClientsCached(RooAbsArg*, const RooArgSet&) ;
336
337
338 // PlotOn implementation
339 virtual RooPlot *plotOn(RooPlot *frame, PlotOpt o) const ;
340 virtual RooPlot *plotAsymOn(RooPlot* frame, const RooAbsCategoryLValue& asymCat, PlotOpt o) const ;
341 virtual RooPlot *plotEffOn(RooPlot* frame, const RooAbsCategoryLValue& effCat, PlotOpt o) const ;
342
343
344 // Constant term optimizer interface
347 // for access into copied dataset:
349
350 virtual void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=nullptr, bool skipZeroWeights=false) ;
351 virtual void resetCache() ;
352 virtual void setArgStatus(const RooArgSet& set, bool active) ;
353 virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) ;
354
355 virtual RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange=nullptr,
356 std::size_t nStart = 0, std::size_t = std::numeric_limits<std::size_t>::max()) = 0 ;
357
358 RooRealVar* dataRealVar(const char* methodname, const RooRealVar& extVar) const ;
359
360 // Column structure definition
361 RooArgSet _vars; ///< Dimensions of this data set
362 RooArgSet _cachedVars ; ///<! External variables cached with this data set
363
364 std::unique_ptr<RooAbsDataStore> _dstore; ///< Data storage implementation
365
366 std::map<std::string,RooAbsData*> _ownedComponents ; ///< Owned external components
367
368 std::unique_ptr<RooArgSet> _globalObservables; ///< Snapshot of global observables
369
370 mutable const TNamed * _namePtr = nullptr; ///<! De-duplicated name pointer. This will be equal for all objects with the same name.
371
372private:
373 void copyGlobalObservables(const RooAbsData& other);
374
376
377 ClassDefOverride(RooAbsData, 7) // Abstract data collection
378};
379
380#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:519
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
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:74
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
A space to attach TBranches.
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...
virtual const RooArgSet * get(Int_t index) const =0
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:59
virtual double weight() const =0
virtual double sumEntries() const =0
Return effective number of entries in dataset, i.e., sum all weights.
double skewness(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:256
virtual const RooArgSet * get() const
Definition RooAbsData.h:103
const RooAbsDataStore * store() const
Definition RooAbsData.h:80
RooRealVar * meanVar(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Create a RooRealVar containing the mean of observable 'var' in this dataset.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for detailed printing of object.
const TNamed * _namePtr
! De-duplicated name pointer. This will be equal for all objects with the same name.
Definition RooAbsData.h:370
RooAbsData()
Default constructor.
static void setDefaultStorageType(StorageType s)
void SetName(const char *name) override
Set the name of the TNamed.
CategorySpans getCategoryBatches(std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
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:79
virtual RooAbsData * emptyClone(const char *newName=nullptr, const char *newTitle=nullptr, const RooArgSet *vars=nullptr, const char *wgtVarName=nullptr) const =0
std::map< RooFit::Detail::DataKey, RooSpan< const double > > RealSpans
Definition RooAbsData.h:133
void printClassName(std::ostream &os) const override
Print class name of dataset.
virtual void reset()
RooRealVar * rmsVar(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Create a RooRealVar containing the RMS of observable 'var' in this dataset.
double standMoment(const RooRealVar &var, double order, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Calculate standardized moment.
RooFit::UniqueId< RooAbsData > const & uniqueId() const
Returns a unique ID that is different for every instantiated RooAbsData object.
Definition RooAbsData.h:321
virtual bool changeObservableName(const char *from, const char *to)
void printTitle(std::ostream &os) const override
Print title of dataset.
void RecursiveRemove(TObject *obj) override
If one of the TObject we have a referenced to is deleted, remove the reference.
virtual double weightError(ErrorType=Poisson) const
Return the symmetric error on the current weight.
Definition RooAbsData.h:114
void setDirtyProp(bool flag)
Control propagation of dirty flags from observables in dataset.
virtual void add(const RooArgSet &row, double weight=1, double weightError=0.0)=0
double mean(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:254
double correlation(RooRealVar &x, RooRealVar &y, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:260
virtual TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts="", const char *cutRange=nullptr) 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 void setArgStatus(const RooArgSet &set, bool active)
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=nullptr, bool skipZeroWeights=false)
Internal method – Cache given set of functions with data.
TMatrixDSym * correlationMatrix(const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:263
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 *)
static StorageType defaultStorageType
Definition RooAbsData.h:325
double corrcov(const RooRealVar &x, const RooRealVar &y, const char *cutSpec, const char *cutRange, bool corr) const
Internal method to calculate single correlation and covariance elements.
bool allClientsCached(RooAbsArg *, const RooArgSet &)
Utility function that determines if all clients of object 'var' appear in given list of cached nodes.
std::unique_ptr< RooAbsDataStore > _dstore
Data storage implementation.
Definition RooAbsData.h:364
double sigma(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:255
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void fill()
RooArgSet _vars
Dimensions of this data set.
Definition RooAbsData.h:361
bool canSplitFast() const
static bool releaseVars(RooAbsData *)
If return value is true variables can be deleted.
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...
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Definition RooAbsData.h:236
TMatrixDSym * covarianceMatrix(const RooArgList &vars, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:264
TH1 Use the overload of RooAbsData::createHistogram that takes RooFit command arguments
Definition RooAbsData.h:226
RooAbsData * getSimData(const char *idxstate)
void copyGlobalObservables(const RooAbsData &other)
virtual bool isNonPoissonWeighted() const
Definition RooAbsData.h:158
bool hasFilledCache() const
TMatrixDSym * correlationMatrix(const RooArgList &vars, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:265
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:134
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:310
bool getRange(const RooAbsRealLValue &var, double &lowest, double &highest, double marginFrac=0.0, bool symMode=false) const
Fill Doubles 'lowest' and 'highest' with the lowest and highest value of observable 'var' in this dat...
RooArgSet _cachedVars
! External variables cached with this data set
Definition RooAbsData.h:362
const RooFit::UniqueId< RooAbsData > _uniqueId
!
Definition RooAbsData.h:375
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
double moment(const RooRealVar &var, double order, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Calculate moment of requested order.
StorageType storageType
Definition RooAbsData.h:327
RooArgSet const * getGlobalObservables() const
Returns snapshot of global observables stored in this data.
Definition RooAbsData.h:301
RooAbsData & operator=(const RooAbsData &other)
void SetNameTitle(const char *name, const char *title) override
Set all the TNamed parameters (name and title).
virtual void resetCache()
Internal method – Remove cached function values.
virtual TList * split(const RooAbsCategory &splitCat, bool createEmptyDataSets=false) const
Split dataset into subsets based on states of given splitCat in this dataset.
Int_t defaultPrintContents(Option_t *opt) const override
Define default print options, for a given print style.
std::unique_ptr< RooArgSet > _globalObservables
Snapshot of global observables.
Definition RooAbsData.h:368
virtual double weightSquared() const =0
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.
void attachBuffers(const RooArgSet &extObs)
virtual RooAbsData * reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=nullptr, std::size_t nStart=0, std::size_t=std::numeric_limits< std::size_t >::max())=0
std::map< std::string, RooAbsData * > _ownedComponents
Owned external components.
Definition RooAbsData.h:366
double covariance(RooRealVar &x, RooRealVar &y, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:259
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()
virtual bool isWeighted() const
Definition RooAbsData.h:154
void resetBuffers()
double kurtosis(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:257
TMatrixDSym * corrcovMatrix(const RooArgList &vars, const char *cutSpec, const char *cutRange, bool corr) const
Return covariance matrix from data for given list of observables.
virtual double sumEntries(const char *cutSpec, const char *cutRange=nullptr) const =0
Return effective number of entries in dataset inside range or after cuts, i.e., sum certain weights.
void printName(std::ostream &os) const override
Print name of dataset.
const TTree * tree() const
Return a pointer to the TTree which stores the data.
TMatrixDSym * covarianceMatrix(const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition RooAbsData.h:262
void initializeVars(RooArgSet const &vars)
~RooAbsData() override
Destructor.
virtual void weightError(double &lo, double &hi, ErrorType=Poisson) const
Return the asymmetric errors on the current weight.
Definition RooAbsData.h:124
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:62
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:55
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition RooCmdArg.h:26
static const RooCmdArg & none()
Return reference to null argument.
Definition RooCmdArg.cxx:51
A 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:43
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=nullptr)
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:40
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
The RooStringView is a wrapper around a C-syle string that can also be constructed from a std::string...
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
2-D histogram with a float per channel (see TH1 documentation)}
Definition TH2.h:257
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:139
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
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:184
const char * cutRange
Definition RooAbsData.h:188
const char * histName
Definition RooAbsData.h:189
const char * addToHistName
Definition RooAbsData.h:191
RooAbsData::ErrorType etype
Definition RooAbsData.h:187
RooAbsBinning * bins
Definition RooAbsData.h:186
Option_t * drawOptions
Definition RooAbsData.h:185
Analyzes a function given a dataset/observables for constant terms and caches those in the dataset.
A UniqueId can be added as a class member to enhance any class with a unique identifier for each inst...
Definition UniqueId.h:39
th1 Draw()