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#include "RooNameReg.h"
25#include "RooFit/UniqueId.h"
27
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
61class RooAbsData : public TNamed, public RooPrintable {
62public:
63
64 // Constructors, factory methods etc.
65 RooAbsData() ;
67 RooAbsData(const RooAbsData& other, const char* newname = nullptr) ;
68
69 RooAbsData& operator=(const RooAbsData& other);
70 ~RooAbsData() override ;
71 virtual RooAbsData* emptyClone(const char* newName=nullptr, const char* newTitle=nullptr, const RooArgSet* vars=nullptr, const char* wgtVarName=nullptr) const = 0 ;
72
73 // Reduction methods
74 RooAbsData* reduce(const RooCmdArg& arg1,const RooCmdArg& arg2=RooCmdArg(),const RooCmdArg& arg3=RooCmdArg(),const RooCmdArg& arg4=RooCmdArg(),
75 const RooCmdArg& arg5=RooCmdArg(),const RooCmdArg& arg6=RooCmdArg(),const RooCmdArg& arg7=RooCmdArg(),const RooCmdArg& arg8=RooCmdArg()) ;
76 RooAbsData* reduce(const char* cut) ;
77 RooAbsData* reduce(const RooFormulaVar& cutVar) ;
78 RooAbsData* reduce(const RooArgSet& varSubset, const char* cut=nullptr) ;
79 RooAbsData* reduce(const RooArgSet& varSubset, const RooFormulaVar& cutVar) ;
80
81 RooAbsDataStore* store() { return _dstore.get(); }
82 const RooAbsDataStore* store() const { return _dstore.get(); }
83 const TTree* tree() const ;
84 TTree *GetClonedTree() const;
85
87 virtual void convertToTreeStore();
88
89 void attachBuffers(const RooArgSet& extObs) ;
90 void resetBuffers() ;
91
92
93 void Draw(Option_t* option = "") override ;
94
95 void checkInit() const ;
96
97 // Change name of observable
98 virtual bool changeObservableName(const char* from, const char* to) ;
99
100 // Add one ore more rows of data
101 virtual void add(const RooArgSet& row, double weight=1, double weightError=0.0) = 0 ; // DERIVED
102 virtual void fill() ;
103
104 // Load a given row of data
105 virtual inline const RooArgSet* get() const {
106 // Return current row of dataset
107 return &_vars ;
108 }
109 virtual double weight() const = 0 ; // DERIVED
110 virtual double weightSquared() const = 0 ; // DERIVED
111
113 /// Return the symmetric error on the current weight.
114 /// See also weightError(double&,double&,ErrorType) const for asymmetric errors.
115 // \param[in] etype Type of error to compute. May throw if not supported.
116 virtual double weightError(ErrorType /*etype*/=Poisson) const {
117 // Dummy implementation returning zero, because not all deriving classes
118 // need to implement a non-zero weight error.
119 return 0.0;
120 }
121 /// Return the asymmetric errors on the current weight.
122 /// See also weightError(ErrorType) const for symmetric error.
123 /// \param[out] lo Low error.
124 /// \param[out] hi High error.
125 // \param[in] etype Type of error to compute. May throw if not supported.
126 virtual void weightError(double& lo, double& hi, ErrorType /*etype*/=Poisson) const {
127 // Dummy implementation returning zero, because not all deriving classes
128 // need to implement a non-zero weight error.
129 lo=0;
130 hi=0;
131 }
132
133 virtual const RooArgSet* get(Int_t index) const ;
134
135 using RealSpans = std::map<RooFit::Detail::DataKey, RooSpan<const double>>;
136 using CategorySpans = std::map<RooFit::Detail::DataKey, RooSpan<const RooAbsCategory::value_type>>;
137
138 RealSpans getBatches(std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
139 CategorySpans getCategoryBatches(std::size_t first = 0, std::size_t len = std::numeric_limits<std::size_t>::max()) const;
140
141 ////////////////////////////////////////////////////////////////////////////////
142 /// Return event weights of all events in range [first, first+len).
143 /// If no contiguous structure of weights is stored, an empty batch can be returned.
144 /// This indicates that the weight is constant. Use weight() to retrieve it.
145 virtual RooSpan<const double> getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const = 0;
146
147 /// Return number of entries in dataset, i.e., count unweighted entries.
148 virtual Int_t numEntries() const ;
149 /// Return effective number of entries in dataset, i.e., sum all weights.
150 virtual double sumEntries() const = 0 ;
151 /// Return effective number of entries in dataset inside range or after cuts, i.e., sum certain weights.
152 /// \param[in] cutSpec Apply given cut when counting (e.g. `0 < x && x < 5`). Passing `"1"` selects all events.
153 /// \param[in] cutRange If the observables have a range with this name, only count events inside this range.
154 virtual double sumEntries(const char* cutSpec, const char* cutRange=nullptr) const = 0 ; // DERIVED
155 double sumEntriesW2() const;
156 virtual bool isWeighted() const {
157 // Do events in dataset have weights?
158 return false ;
159 }
160 virtual bool isNonPoissonWeighted() const {
161 // Do events in dataset have non-integer weights?
162 return false ;
163 }
164 virtual void reset() ;
165
166
167 bool getRange(const RooAbsRealLValue& var, double& lowest, double& highest, double marginFrac=0.0, bool symMode=false) const ;
168
169 // Plot the distribution of a real valued arg
170 virtual Roo1DTable* table(const RooArgSet& catSet, const char* cuts="", const char* opts="") const ;
171 virtual Roo1DTable* table(const RooAbsCategory& cat, const char* cuts="", const char* opts="") const ;
172 /// \see RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const
173 virtual RooPlot* plotOn(RooPlot* frame,
174 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
175 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
176 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
177 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
178
179 virtual RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;
180
181 // WVE --- This needs to be public to avoid CINT problems
182 struct PlotOpt {
183 PlotOpt() : cuts(""), drawOptions("P"), bins(nullptr), etype(RooAbsData::Poisson), cutRange(nullptr), histName(nullptr), histInvisible(false),
185 scaleFactor(1.) {} ;
186 const char* cuts ;
190 const char* cutRange ;
191 const char* histName ;
193 const char* addToHistName ;
196 double xErrorSize ;
199 double scaleFactor ;
200 } ;
201
202 // Split a dataset by a category
203 virtual TList* split(const RooAbsCategory& splitCat, bool createEmptyDataSets=false) const ;
204
205 // Split a dataset by categories of a RooSimultaneous
206 virtual TList* split(const RooSimultaneous& simpdf, bool createEmptyDataSets=false) const ;
207
208 // Fast splitting for SimMaster setData
209 bool canSplitFast() const ;
210 RooAbsData* getSimData(const char* idxstate) ;
211
212 /// Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const
213 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar,
214 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
215 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
216 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
217 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ;
218 TH1 *createHistogram(const char* varNameList,
219 const RooCmdArg& binArgX=RooCmdArg::none(), const RooCmdArg& binArgY=RooCmdArg::none(),
220 const RooCmdArg& binArgZ=RooCmdArg::none()) const;
221 /// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset.
222 TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const ;
223 TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts="",
224 const char *name= "hist") const;
225 TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, int nx, int ny,
226 const char* cuts="", const char *name="hist") const;
227
228 // Fill an existing histogram
229 virtual TH1 *fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts= "", const char* cutRange=nullptr) const;
230
231 // Printing interface (human readable)
232 inline void Print(Option_t *options= nullptr) const override {
233 // Print contents on stdout
235 }
236
237 void printName(std::ostream& os) const override ;
238 void printTitle(std::ostream& os) const override ;
239 void printClassName(std::ostream& os) const override ;
240 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
241
242 Int_t defaultPrintContents(Option_t* opt) const override ;
243
244 void setDirtyProp(bool flag) ;
245
246 double moment(const RooRealVar& var, double order, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
247 double moment(const RooRealVar& var, double order, double offset, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
248 double standMoment(const RooRealVar& var, double order, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
249
250 double mean(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return moment(var,1,0,cutSpec,cutRange) ; }
251 double sigma(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return sqrt(moment(var,2,cutSpec,cutRange)) ; }
252 double skewness(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return standMoment(var,3,cutSpec,cutRange) ; }
253 double kurtosis(const RooRealVar& var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return standMoment(var,4,cutSpec,cutRange) ; }
254
255 double covariance(RooRealVar &x,RooRealVar &y, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcov(x,y,cutSpec,cutRange,false) ; }
256 double correlation(RooRealVar &x,RooRealVar &y, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcov(x,y,cutSpec,cutRange,true) ; }
257
258 TMatrixDSym* covarianceMatrix(const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return covarianceMatrix(*get(),cutSpec,cutRange) ; }
259 TMatrixDSym* correlationMatrix(const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return correlationMatrix(*get(),cutSpec,cutRange) ; }
260 TMatrixDSym* covarianceMatrix(const RooArgList& vars, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcovMatrix(vars,cutSpec,cutRange,false) ; }
261 TMatrixDSym* correlationMatrix(const RooArgList& vars, const char* cutSpec=nullptr, const char* cutRange=nullptr) const { return corrcovMatrix(vars,cutSpec,cutRange,true) ; }
262
263 RooRealVar* meanVar(const RooRealVar &var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
264 RooRealVar* rmsVar(const RooRealVar &var, const char* cutSpec=nullptr, const char* cutRange=nullptr) const ;
265
266 virtual RooPlot* statOn(RooPlot* frame,
267 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
268 const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
269 const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
270 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
271
272 virtual RooPlot* statOn(RooPlot* frame, const char *what,
273 const char *label= "", Int_t sigDigits= 2,
274 Option_t *options= "NELU", double xmin=0.15,
275 double xmax= 0.65,double ymax=0.85,
276 const char* cutSpec=nullptr, const char* cutRange=nullptr,
277 const RooCmdArg* formatCmd=nullptr);
278
279 void RecursiveRemove(TObject *obj) override;
280
281 bool hasFilledCache() const ;
282
283 void addOwnedComponent(const char* idxlabel, RooAbsData& data) ;
284 static void claimVars(RooAbsData*) ;
285 static bool releaseVars(RooAbsData*) ;
286
288
289 static void setDefaultStorageType(StorageType s) ;
290
292
293 /// Returns snapshot of global observables stored in this data.
294 /// \return Pointer to a RooArgSet with the snapshot of global observables
295 /// stored in the data. Can be `nullptr` if no global observables are
296 /// stored.
297 RooArgSet const* getGlobalObservables() const { return _globalObservables.get(); }
298 void setGlobalObservables(RooArgSet const& globalObservables);
299
300 /// De-duplicated pointer to this object's name.
301 /// This can be used for fast name comparisons.
302 /// like `if (namePtr() == other.namePtr())`.
303 /// \note TNamed::GetName() will return a pointer that's
304 /// different for each object, but namePtr() always points
305 /// to a unique instance.
306 inline const TNamed* namePtr() const {
307 return _namePtr ;
308 }
309
310 void SetName(const char* name) override ;
311 void SetNameTitle(const char *name, const char *title) override ;
312
313 /// Returns a unique ID that is different for every instantiated RooAbsData object.
314 /// This ID can be used whether two RooAbsData are the same object, which is safer
315 /// than memory address comparisons that might result in false positives when
316 /// memory is reused.
318
319protected:
320
322
324
325 double corrcov(const RooRealVar& x, const RooRealVar& y, const char* cutSpec, const char* cutRange, bool corr) const ;
326 TMatrixDSym* corrcovMatrix(const RooArgList& vars, const char* cutSpec, const char* cutRange, bool corr) const ;
327
328 virtual void optimizeReadingWithCaching(RooAbsArg& arg, const RooArgSet& cacheList, const RooArgSet& keepObsList) ;
329 bool allClientsCached(RooAbsArg*, const RooArgSet&) ;
330
331
332 // PlotOn implementation
333 virtual RooPlot *plotOn(RooPlot *frame, PlotOpt o) const ;
334 virtual RooPlot *plotAsymOn(RooPlot* frame, const RooAbsCategoryLValue& asymCat, PlotOpt o) const ;
335 virtual RooPlot *plotEffOn(RooPlot* frame, const RooAbsCategoryLValue& effCat, PlotOpt o) const ;
336
337
338 // Constant term optimizer interface
341 // for access into copied dataset:
343
344 virtual void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=nullptr, bool skipZeroWeights=false) ;
345 virtual void resetCache() ;
346 virtual void setArgStatus(const RooArgSet& set, bool active) ;
347 virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) ;
348
349 virtual RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange=nullptr,
350 std::size_t nStart = 0, std::size_t = std::numeric_limits<std::size_t>::max()) = 0 ;
351
352 RooRealVar* dataRealVar(const char* methodname, const RooRealVar& extVar) const ;
353
354 // Column structure definition
355 RooArgSet _vars; ///< Dimensions of this data set
356 RooArgSet _cachedVars ; ///<! External variables cached with this data set
357
358 std::unique_ptr<RooAbsDataStore> _dstore; ///< Data storage implementation
359
360 std::map<std::string,RooAbsData*> _ownedComponents ; ///< Owned external components
361
362 std::unique_ptr<RooArgSet> _globalObservables; ///< Snapshot of global observables
363
364 mutable const TNamed * _namePtr = nullptr; ///<! De-duplicated name pointer. This will be equal for all objects with the same name.
365
366private:
367 void copyGlobalObservables(const RooAbsData& other);
368
370
371 ClassDefOverride(RooAbsData, 7) // Abstract data collection
372};
373
374#endif
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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
Definition: THbookFile.cxx:95
#define hi
Definition: THbookFile.cxx:128
float xmax
Definition: THbookFile.cxx:95
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:72
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:25
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
A space to attach TBranches.
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:61
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:252
virtual const RooArgSet * get() const
Definition: RooAbsData.h:105
const RooAbsDataStore * store() const
Definition: RooAbsData.h:82
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.
Definition: RooAbsData.cxx:857
const TNamed * _namePtr
! De-duplicated name pointer. This will be equal for all objects with the same name.
Definition: RooAbsData.h:364
RooAbsData()
Default constructor.
Definition: RooAbsData.cxx:172
static void setDefaultStorageType(StorageType s)
Definition: RooAbsData.cxx:132
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.
Definition: RooAbsData.cxx:956
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.
Definition: RooAbsData.cxx:807
void setGlobalObservables(RooArgSet const &globalObservables)
Sets the global observables stored in this data.
RooAbsDataStore * store()
Definition: RooAbsData.h:81
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:135
void printClassName(std::ostream &os) const override
Print class name of dataset.
Definition: RooAbsData.cxx:850
virtual void reset()
Definition: RooAbsData.cxx:381
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.
Definition: RooAbsData.cxx:879
RooFit::UniqueId< RooAbsData > const & uniqueId() const
Returns a unique ID that is different for every instantiated RooAbsData object.
Definition: RooAbsData.h:317
void Draw(Option_t *option="") override
Forward draw command to data store.
virtual bool changeObservableName(const char *from, const char *to)
Definition: RooAbsData.cxx:354
void printTitle(std::ostream &os) const override
Print title of dataset.
Definition: RooAbsData.cxx:842
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:116
void setDirtyProp(bool flag)
Control propagation of dirty flags from observables in dataset.
Definition: RooAbsData.cxx:429
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:250
double correlation(RooRealVar &x, RooRealVar &y, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:256
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)
Definition: RooAbsData.cxx:421
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=nullptr, bool skipZeroWeights=false)
Internal method – Cache given set of functions with data.
Definition: RooAbsData.cxx:397
TMatrixDSym * correlationMatrix(const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:259
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 *)
Definition: RooAbsData.cxx:150
static StorageType defaultStorageType
Definition: RooAbsData.h:321
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.
Definition: RooAbsData.cxx:975
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:358
double sigma(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:251
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void fill()
Definition: RooAbsData.cxx:367
RooArgSet _vars
Dimensions of this data set.
Definition: RooAbsData.h:355
bool canSplitFast() const
static bool releaseVars(RooAbsData *)
If return value is true variables can be deleted.
Definition: RooAbsData.cxx:159
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
Print TNamed name and title.
Definition: RooAbsData.h:232
TMatrixDSym * covarianceMatrix(const RooArgList &vars, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:260
RooAbsData * getSimData(const char *idxstate)
void copyGlobalObservables(const RooAbsData &other)
Definition: RooAbsData.cxx:311
virtual bool isNonPoissonWeighted() const
Definition: RooAbsData.h:160
bool hasFilledCache() const
TMatrixDSym * correlationMatrix(const RooArgList &vars, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:261
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:414
std::map< RooFit::Detail::DataKey, RooSpan< const RooAbsCategory::value_type > > CategorySpans
Definition: RooAbsData.h:136
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
Definition: RooAbsData.cxx:344
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:306
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:356
const RooFit::UniqueId< RooAbsData > _uniqueId
!
Definition: RooAbsData.h:369
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Definition: RooAbsData.cxx:374
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:599
double moment(const RooRealVar &var, double order, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Calculate moment of requested order.
Definition: RooAbsData.cxx:898
StorageType storageType
Definition: RooAbsData.h:323
RooArgSet const * getGlobalObservables() const
Returns snapshot of global observables stored in this data.
Definition: RooAbsData.h:297
RooAbsData & operator=(const RooAbsData &other)
Definition: RooAbsData.cxx:268
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.
Definition: RooAbsData.cxx:405
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.
Definition: RooAbsData.cxx:865
std::unique_ptr< RooArgSet > _globalObservables
Snapshot of global observables.
Definition: RooAbsData.h:362
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.
Definition: RooAbsData.cxx:450
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:360
double covariance(RooRealVar &x, RooRealVar &y, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:255
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:612
static StorageType getDefaultStorageType()
Definition: RooAbsData.cxx:143
virtual bool isWeighted() const
Definition: RooAbsData.h:156
void resetBuffers()
double kurtosis(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Definition: RooAbsData.h:253
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.
Definition: RooAbsData.cxx:834
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:258
~RooAbsData() override
Destructor.
Definition: RooAbsData.cxx:325
virtual void weightError(double &lo, double &hi, ErrorType=Poisson) const
Return the asymmetric errors on the current weight.
Definition: RooAbsData.h:126
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:60
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:56
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...
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:43
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=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...
Definition: RooStringView.h:27
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: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
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
static const char * what
Definition: stlLoader.cc:6
const char * cuts
Definition: RooAbsData.h:186
const char * cutRange
Definition: RooAbsData.h:190
const char * histName
Definition: RooAbsData.h:191
const char * addToHistName
Definition: RooAbsData.h:193
RooAbsData::ErrorType etype
Definition: RooAbsData.h:189
RooAbsBinning * bins
Definition: RooAbsData.h:188
Option_t * drawOptions
Definition: RooAbsData.h:187
Analyzes a function given a dataset/observables for constant terms and caches those in the dataset.