Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User

RooFit Toolkit for Data Modeling
#include "RooDataSet.hh"

RooDataSet


class description - source file - inheritance tree (.pdf)

class RooDataSet : public RooTreeData, public RooDirItem

Inheritance Chart:
TObject
<-
TNamed
RooPrintable
<-
RooAbsData
<-
RooTreeData
RooDirItem
<-
RooDataSet

    protected:
RooDataSet(const char* name, const char* title, RooDataSet* ntuple, const RooArgSet& vars, const RooFormulaVar* cutVar, const char* cutRange, int nStart, int nStop, Bool_t copyCache) RooArgSet addWgtVar(const RooArgSet& origVars, const RooAbsArg* wgtVar) virtual RooAbsData* cacheClone(const RooArgSet* newCacheVars, const char* newName = "0") void initialize(const char* wgtVarName) Bool_t merge(const TList& data) virtual RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange = "0", Int_t nStart = 0, Int_t nStop = 2000000000, Bool_t copyCache = kTRUE) public:
RooDataSet() RooDataSet(const char* name, const char* title, const RooArgSet& vars, const char* wgtVarName = "0") RooDataSet(const char* name, const char* title, RooDataSet* ntuple, const RooArgSet& vars, const char* cuts = "0", const char* wgtVarName = "0") RooDataSet(const char* name, const char* title, RooDataSet* t, const RooArgSet& vars, const RooFormulaVar& cutVar, const char* wgtVarName = "0") RooDataSet(const char* name, const char* title, TTree* t, const RooArgSet& vars, const RooFormulaVar& cutVar, const char* wgtVarName = "0") RooDataSet(const char* name, const char* title, TTree* ntuple, const RooArgSet& vars, const char* cuts = "0", const char* wgtVarName = "0") RooDataSet(const char* name, const char* filename, const char* treename, const RooArgSet& vars, const char* cuts = "0", const char* wgtVarName = "0") RooDataSet(RooDataSet const& other, const char* newname = "0") virtual ~RooDataSet() virtual void add(const RooArgSet& row, Double_t weight = 1.0) virtual RooAbsArg* addColumn(RooAbsArg& var) virtual RooArgSet* addColumns(const RooArgList& varList) void append(RooTreeData& data) RooDataHist* binnedClone(const char* newName = "0", const char* newTitle = "0") const static TClass* Class() virtual TObject* Clone(const char* newname = "0") const TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts = "", const char* name = "hist") const TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, Int_t nx, Int_t ny, const char* cuts = "", const char* name = "hist") const virtual RooAbsData* emptyClone(const char* newName = "0", const char* newTitle = "0", const RooArgSet* vars = 0) const virtual const RooArgSet* get(Int_t index) const virtual const RooArgSet* get() const virtual TClass* IsA() const virtual Bool_t isWeighted() const Bool_t merge(RooDataSet* data1, RooDataSet* data2 = 0, RooDataSet* data3 = 0, RooDataSet* data4 = 0, RooDataSet* data5 = 0, RooDataSet* data6 = 0) virtual Int_t numEntries(Bool_t useWeights = kFALSE) const RooDataSet& operator=(const RooDataSet&) virtual void printToStream(ostream& os, RooPrintable::PrintOption opt, TString indent) const static RooDataSet* read(const char* filename, const RooArgList& variables, const char* opts = "", const char* commonPath = "", const char* indexCatName = "0") void setWeightVar(const char* name = "0") void setWeightVar(const RooAbsArg& arg) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Double_t sumEntries(const char* cutSpec = "0", const char* cutRange = "0") const virtual Double_t weight() const Bool_t write(const char* filename)

Data Members


    protected:
RooArgSet _varsNoWgt Vars without weight variable RooRealVar* _wgtVar

Class Description

 RooDataSet is a container class to hold unbinned data. Each data point
 in N-dimensional space is represented by a RooArgSet of RooRealVar, RooCategory
 or RooStringVar objects


RooDataSet()

RooDataSet(const char *name, const char *title, const RooArgSet& vars, const char* wgtVarName) : RooTreeData(name,title,vars)
 Constructor of an empty data set from a RooArgSet defining the dimensions
 of the data space.

RooDataSet(const char *name, const char *title, RooDataSet *dset, const RooArgSet& vars, const char *cuts, const char* wgtVarName) : RooTreeData(name,title,dset,vars,cuts)
 Constructor of a data set from (part of) an existing data set. The dimensions
 of the data set are defined by the 'vars' RooArgSet, which can be identical
 to 'dset' dimensions, or a subset thereof. The 'cuts' string is an optional
 RooFormula expression and can be used to select the subset of the data points
 in 'dset' to be copied. The cut expression can refer to any variable in the
 source dataset. For cuts involving variables other than those contained in
 the source data set, such as intermediate formula objects, use the
 equivalent constructor accepting RooFormulaVar reference as cut specification

 For most uses the RooAbsData::reduce() wrapper function, which uses this constructor,
 is the most convenient way to create a subset of an existing data

RooDataSet(const char *name, const char *title, RooDataSet *t, const RooArgSet& vars, const RooFormulaVar& cutVar, const char* wgtVarName) : RooTreeData(name,title,t,vars,cutVar)
 Constructor of a data set from (part of) an existing data set. The dimensions
 of the data set are defined by the 'vars' RooArgSet, which can be identical
 to 'dset' dimensions, or a subset thereof. The 'cutVar' formula variable
 is used to select the subset of data points to be copied.
 For subsets without selection on the data points, or involving cuts
 operating exclusively and directly on the data set dimensions, the equivalent
 constructor with a string based cut expression is recommended.

 For most uses the RooAbsData::reduce() wrapper function, which uses this constructor,
 is the most convenient way to create a subset of an existing data

RooDataSet(const char *name, const char *title, TTree *t, const RooArgSet& vars, const RooFormulaVar& cutVar, const char* wgtVarName) : RooTreeData(name,title,t,vars,cutVar)
 Constructor of a data set from (part of) an ROOT TTRee. The dimensions
 of the data set are defined by the 'vars' RooArgSet. For each dimension
 specified, the TTree must have a branch with the same name. For category
 branches, this branch should contain the numeric index value. Real dimensions
 can be constructed from either 'Double_t' or 'Float_t' tree branches. In the
 latter case, an automatic conversion is applied.

 The 'cutVar' formula variable
 is used to select the subset of data points to be copied.
 For subsets without selection on the data points, or involving cuts
 operating exclusively and directly on the data set dimensions, the equivalent
 constructor with a string based cut expression is recommended.

RooDataSet(const char *name, const char *title, TTree *ntuple, const RooArgSet& vars, const char *cuts, const char* wgtVarName) : RooTreeData(name,title,ntuple,vars,cuts)
 Constructor of a data set from (part of) an ROOT TTRee. The dimensions
 of the data set are defined by the 'vars' RooArgSet. For each dimension
 specified, the TTree must have a branch with the same name. For category
 branches, this branch should contain the numeric index value. Real dimensions
 can be constructed from either 'Double_t' or 'Float_t' tree branches. In the
 latter case, an automatic conversion is applied.

 The 'cuts' string is an optional
 RooFormula expression and can be used to select the subset of the data points
 in 'dset' to be copied. The cut expression can refer to any variable in the
 vars argset. For cuts involving variables other than those contained in
 the vars argset, such as intermediate formula objects, use the
 equivalent constructor accepting RooFormulaVar reference as cut specification


RooDataSet(const char *name, const char *filename, const char *treename, const RooArgSet& vars, const char *cuts, const char* wgtVarName) : RooTreeData(name,filename,treename,vars,cuts)
 Constructor of a data set from (part of) a named ROOT TTRee in given ROOT file.
 The dimensions of the data set are defined by the 'vars' RooArgSet. For each dimension
 specified, the TTree must have a branch with the same name. For category
 branches, this branch should contain the numeric index value. Real dimensions
 can be constructed from either 'Double_t' or 'Float_t' tree branches. In the
 latter case, an automatic conversion is applied.

 The 'cuts' string is an optional
 RooFormula expression and can be used to select the subset of the data points
 in 'dset' to be copied. The cut expression can refer to any variable in the
 vars argset. For cuts involving variables other than those contained in
 the vars argset, such as intermediate formula objects, use the
 equivalent constructor accepting RooFormulaVar reference as cut specification


RooDataSet(RooDataSet const & other, const char* newname) : RooTreeData(other,newname), RooDirItem()
 Copy constructor

RooArgSet addWgtVar(const RooArgSet& origVars, const RooAbsArg* wgtVar)
 Helper function for constructor below

RooDataSet(const char *name, const char *title, RooDataSet *ntuple, const RooArgSet& vars, const RooFormulaVar* cutVar, const char* cutRange, Int_t nStart, Int_t nStop, Bool_t copyCache) : RooTreeData(name,title,ntuple,addWgtVar(vars,ntuple->_wgtVar),cutVar,cutRange,nStart,nStop,copyCache)
 Protected constructor for internal use only

RooAbsData* cacheClone(const RooArgSet* newCacheVars, const char* newName)

RooAbsData* emptyClone(const char* newName, const char* newTitle, const RooArgSet* vars) const

void initialize(const char* wgtVarName)

RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange, Int_t nStart, Int_t nStop, Bool_t copyCache)
 Implementation of RooAbsData virtual method that drives the RooAbsData::reduce() methods

~RooDataSet()

RooDataHist* binnedClone(const char* newName, const char* newTitle) const

void setWeightVar(const char* name)

Double_t weight() const

const RooArgSet* get(Int_t index) const

Int_t numEntries(Bool_t useWeights) const
 Return number of entries if no weights are requested or available

Double_t sumEntries(const char* cutSpec, const char* cutRange) const
 Setup RooFormulaVar for cutSpec if it is present

const RooArgSet* get() const

void add(const RooArgSet& data, Double_t weight)
 Add a data point, with its coordinates specified in the 'data' argset, to the data set.
 Any variables present in 'data' but not in the dataset will be silently ignored


Bool_t merge(RooDataSet* data1, RooDataSet* data2, RooDataSet* data3, RooDataSet* data4, RooDataSet* data5, RooDataSet* data6)
 Merge columns of supplied data set(s) with this data set.
 All data sets must have equal number of entries.
 In case of duplicate columns the column of the last dataset in the list prevails

Bool_t merge(const TList& dsetList)
 Merge columns of supplied data set(s) with this data set.
 All data sets must have equal number of entries.
 In case of duplicate columns the column of the last dataset in the list prevails

void append(RooTreeData& data)
 Add all data points of given data set to this data set.
 Eventual extra dimensions of 'data' will be stripped in transfer

RooAbsArg* addColumn(RooAbsArg& var)

RooArgSet* addColumns(const RooArgList& varList)

TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts, const char *name) const
 Create a TH2F histogram of the distribution of the specified variable
 using this dataset. Apply any cuts to select which events are used.
 The variable being plotted can either be contained directly in this
 dataset, or else be a function of the variables in this dataset.
 The histogram will be created using RooAbsReal::createHistogram() with
 the name provided (with our dataset name prepended).

TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, Int_t nx, Int_t ny, const char* cuts, const char *name) const
 Create a TH2F histogram of the distribution of the specified variable
 using this dataset. Apply any cuts to select which events are used.
 The variable being plotted can either be contained directly in this
 dataset, or else be a function of the variables in this dataset.
 The histogram will be created using RooAbsReal::createHistogram() with
 the name provided (with our dataset name prepended).

RooDataSet* read(const char *fileList, const RooArgList &varList, const char *verbOpt, const char* commonPath, const char* indexCatName)
 Read given list of ascii files, and construct a data set, using the given
 ArgList as structure definition.

 Multiple file names in fileList should be comma separated. Each
 file is optionally prefixed with 'commonPath' if such a path is
 provided

 The arglist specifies the dimensions of the dataset to be built
 and describes the order in which these dimensions appear in the
 ascii files to be read.

 Each line in the ascii file should contain N white space separated
 tokens, with N the number of args in 'variables'. Any text beyond
 N tokens will be ignored with a warning message.
 [ NB: This format is written by RooArgList::writeToStream() ]

 If the value of any of the variables on a given line exceeds the
 fit range associated with that dimension, the entire line will be
 ignored. A warning message is printed in each case, unless the
 'Q' verbose option is given. (Option 'D' will provide additional
 debugging information) The number of events read and skipped
 is always summarized at the end.

 When multiple files are read, a RooCategory arg in 'variables' can
 optionally be designated to hold information about the source file
 of each data point. This feature is enabled by giving the name
 of the (already existing) category variable in 'indexCatName'

 If no further information is given a label name 'fileNNN' will
 be assigned to each event, where NNN is the sequential number of
 the source file in 'fileList'.

 Alternatively it is possible to override the default label names
 of the index category by specifying them in the fileList string:
 When instead of "file1.txt,file2.txt" the string
 "file1.txt:FOO,file2.txt:BAR" is specified, a state named "FOO"
 is assigned to the index category for each event originating from
 file1.txt. The labels FOO,BAR may be predefined in the index
 category via defineType(), but don't have to be

 Finally, one can also assign the same label to multiple files,
 either by specifying "file1.txt:FOO,file2,txt:FOO,file3.txt:BAR"
 or "file1.txt,file2.txt:FOO,file3.txt:BAR"


Bool_t write(const char* filename)

void printToStream(ostream& os, PrintOption opt, TString indent) const
 Print info about this dataset to the specified output stream.

   Standard: number of entries
      Shape: list of variables we define & were generated with



Inline Functions


           TObject* Clone(const char* newname = "0") const
               void setWeightVar(const RooAbsArg& arg)
             Bool_t isWeighted() const
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
        RooDataSet& operator=(const RooDataSet&)
Last CVS Update: v 1.93 2005/12/08 15:26:16 wverkerke Top
Copyright © 2000-2005 University of California, Stanford University

Page maintained by Wouter Verkerke and David Kirkby

SourceForge.net Logo