ROOT logo
ROOT » ROOFIT » ROOFITCORE » RooTreeDataStore

class RooTreeDataStore: public RooAbsDataStore



RooTreeDataStore is the abstract base class for data collection that use a TTree as internal storage mechanism

Function Members (Methods)

public:
RooTreeDataStore()
RooTreeDataStore(const RooTreeDataStore& other, const char* newname = 0)
RooTreeDataStore(TTree* t, const RooArgSet& vars, const char* wgtVarName = 0)
RooTreeDataStore(const RooTreeDataStore& other, const RooArgSet& vars, const char* newname = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, TTree& t, const RooFormulaVar& select, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, TTree& t, const char* selExpr = 0, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const RooAbsDataStore& tds, const RooFormulaVar& select, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const RooAbsDataStore& tds, const char* selExpr = 0, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, RooAbsDataStore& tds, const RooArgSet& vars, const RooFormulaVar* cutVar, const char* cutRange, Int_t nStart, Int_t nStop, Bool_t, const char* wgtVarName = 0)
virtual~RooTreeDataStore()
voidTObject::AbstractMethod(const char* method) const
virtual RooAbsArg*addColumn(RooAbsArg& var, Bool_t adjustRange = kTRUE)
virtual RooArgSet*addColumns(const RooArgList& varList)
virtual voidappend(RooAbsDataStore& other)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
virtual voidcacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset = 0)
const RooArgSet&RooAbsDataStore::cachedVars() const
virtual const RooAbsArg*cacheOwner()
virtual Bool_tchangeObservableName(const char* from, const char* to)
virtual voidcheckInit() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual RooAbsDataStore*clone(const RooArgSet& vars, const char* newname = 0) const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual Int_tRooAbsDataStore::defaultPrintContents(Option_t* opt) const
static ostream&RooPrintable::defaultPrintStream(ostream* os = 0)
virtual RooPrintable::StyleOptionRooPrintable::defaultPrintStyle(Option_t* opt) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual Int_tfill()
Int_tFill()
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual const RooArgSet*get(Int_t index) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Stat_tGetEntries() const
Int_tGetEntry(Int_t entry = 0, Int_t getall = 0)
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
Bool_tRooAbsDataStore::hasFilledCache() const
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tisWeighted() const
Bool_tTObject::IsZombie() const
voidloadValues(const TTree* t, const RooFormulaVar* select = 0, const char* rangeName = 0, Int_t nStart = 0, Int_t nStop = 2000000000)
voidloadValues(const RooAbsDataStore* tds, const RooFormulaVar* select = 0, const char* rangeName = 0, Int_t nStart = 0, Int_t nStop = 2000000000)
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual RooAbsDataStore*merge(const RooArgSet& allvars, list<RooAbsDataStore*> dstoreList)
static voidRooPrintable::nameFieldLength(Int_t newLen)
virtual Bool_tTObject::Notify()
virtual Int_tnumEntries() const
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
RooAbsDataStore&RooAbsDataStore::operator=(const RooAbsDataStore&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidRooAbsDataStore::Print(Option_t* options = 0) const
virtual voidRooPrintable::printAddress(ostream& os) const
virtual voidRooAbsDataStore::printArgs(ostream& os) const
virtual voidRooAbsDataStore::printClassName(ostream& os) const
virtual voidRooPrintable::printExtras(ostream& os) const
virtual voidRooAbsDataStore::printMultiline(ostream& os, Int_t content, Bool_t verbose, TString indent) const
virtual voidRooAbsDataStore::printName(ostream& os) const
virtual voidRooPrintable::printStream(ostream& os, Int_t contents, RooPrintable::StyleOption style, TString indent = "") const
virtual voidRooAbsDataStore::printTitle(ostream& os) const
virtual voidRooPrintable::printTree(ostream& os, TString indent = "") const
virtual voidRooAbsDataStore::printValue(ostream& os) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidreset()
voidReset(Option_t* option = 0)
voidTObject::ResetBit(UInt_t f)
virtual voidresetCache()
const RooArgSet&row()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual voidsetArgStatus(const RooArgSet& set, Bool_t active)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidRooAbsDataStore::setDirtyProp(Bool_t flag)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidsetExternalWeightArray(Double_t* arrayWgt, Double_t* arrayWgtErrLo, Double_t* arrayWgtErrHi, Double_t* arraySumW2)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TTree&tree()
virtual const TTree*tree() const
virtual voidTObject::UseCurrentStyle()
virtual Bool_tvalid() const
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Double_tweight() const
virtual Double_tweight(Int_t index) const
virtual Double_tweightError(RooAbsData::ErrorType etype = RooAbsData::Poisson) const
virtual voidweightError(Double_t& lo, Double_t& hi, RooAbsData::ErrorType etype = RooAbsData::Poisson) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidattachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars)
voidcreateTree(const char* name, const char* title)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Int_tgetBranchBufferSize() const
voidinitialize()
voidTObject::MakeZombie()
voidsetBranchBufferSize(Int_t size)
RooArgSetvarsNoWeight(const RooArgSet& allVars, const char* wgtName = 0)
RooRealVar*weightVar(const RooArgSet& allVars, const char* wgtName = 0)

Data Members

protected:
TIterator*RooAbsDataStore::_cacheIter! Iterator over cached variables
const RooAbsArg*_cacheOwner! Object owning cache contents
TTree*_cacheTree! TTree holding the cached function values
RooArgSetRooAbsDataStore::_cachedVars
Double_t_curWgtWeight of current event
Double_t_curWgtErrWeight of current event
Double_t_curWgtErrHiWeight of current event
Double_t_curWgtErrLoWeight of current event
Bool_t_defCtor! Was object constructed with default ctor?
static Int_t_defTreeBufSize
Bool_tRooAbsDataStore::_doDirtyPropSwitch do (de)activate dirty state propagation when loading a data point
Double_t*_extSumW2Array! External sum of weights array
Double_t*_extWgtArray! External weight array
Double_t*_extWgtErrHiArray! External weight array - high error
Double_t*_extWgtErrLoArray! External weight array - low error
TIterator*RooAbsDataStore::_iterator! Iterator over dimension variables
static Int_tRooPrintable::_nameLength
TTree*_treeTTree holding the data points
RooArgSetRooAbsDataStore::_vars
RooArgSet_varsww
RooRealVar*_wgtVarPointer to weight variable (if set)
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

RooTreeDataStore()
RooTreeDataStore(TTree* t, const RooArgSet& vars, const char* wgtVarName = 0)
 Constructor to facilitate reading of legacy RooDataSets
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, TTree& t, const RooFormulaVar& select, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, TTree& t, const char* selExpr = 0, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const RooAbsDataStore& tds, const RooFormulaVar& select, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, const RooArgSet& vars, const RooAbsDataStore& tds, const char* selExpr = 0, const char* wgtVarName = 0)
RooTreeDataStore(const char* name, const char* title, RooAbsDataStore& tds, const RooArgSet& vars, const RooFormulaVar* cutVar, const char* cutRange, Int_t nStart, Int_t nStop, Bool_t , const char* wgtVarName = 0)
RooArgSet varsNoWeight(const RooArgSet& allVars, const char* wgtName = 0)
 Utility function for constructors
 Return RooArgSet that is copy of allVars minus variable matching wgtName if specified
RooRealVar* weightVar(const RooArgSet& allVars, const char* wgtName = 0)
 Utility function for constructors
 Return pointer to weight variable if it is defined
void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars)
 Initialize cache of dataset: attach variables of cache ArgSet
 to the corresponding TTree branches
RooTreeDataStore(const RooTreeDataStore& other, const char* newname = 0)
RooTreeDataStore(const RooTreeDataStore& other, const RooArgSet& vars, const char* newname = 0)
~RooTreeDataStore()
 Destructor
void initialize()
 One-time initialization common to all constructor forms.  Attach
 variables of internal ArgSet to the corresponding TTree branches
void createTree(const char* name, const char* title)
 Create TTree object that lives in memory, independent of current
 location of gDirectory
void loadValues(const TTree* t, const RooFormulaVar* select = 0, const char* rangeName = 0, Int_t nStart = 0, Int_t nStop = 2000000000)
 Load values from tree 't' into this data collection, optionally
 selecting events using 'select' RooFormulaVar

 The source tree 't' is first clone as not disturb its branch
 structure when retrieving information from it.
void loadValues(const RooAbsDataStore* tds, const RooFormulaVar* select = 0, const char* rangeName = 0, Int_t nStart = 0, Int_t nStop = 2000000000)
 Load values from dataset 't' into this data collection, optionally
 selecting events using 'select' RooFormulaVar

Bool_t valid() const
 Return true if currently loaded coordinate is considered valid within
 the current range definitions of all observables
Int_t fill()
 Interface function to TTree::Fill
const RooArgSet* get(Int_t index) const
 Load the n-th data point (n='index') in memory
 and return a pointer to the internal RooArgSet
 holding its coordinates.
Double_t weight(Int_t index) const
 Return the weight of the n-th data point (n='index') in memory
Double_t weight() const
 Return the weight of the n-th data point (n='index') in memory
Double_t weightError(RooAbsData::ErrorType etype = RooAbsData::Poisson) const
void weightError(Double_t& lo, Double_t& hi, RooAbsData::ErrorType etype = RooAbsData::Poisson) const
Bool_t changeObservableName(const char* from, const char* to)
 Change name of internal observable named 'from' into 'to'
RooAbsArg* addColumn(RooAbsArg& var, Bool_t adjustRange = kTRUE)
 Add a new column to the data set which holds the pre-calculated values
 of 'newVar'. This operation is only meaningful if 'newVar' is a derived
 value.

 The return value points to the added element holding 'newVar's value
 in the data collection. The element is always the corresponding fundamental
 type of 'newVar' (e.g. a RooRealVar if 'newVar' is a RooFormulaVar)

 Note: This function is explicitly NOT intended as a speed optimization
       opportunity for the user. Components of complex PDFs that can be
       precalculated with the dataset are automatically identified as such
       and will be precalculated when fitting to a dataset

       By forcibly precalculating functions with non-trivial Jacobians,
       or functions of multiple variables occurring in the data set,
       using addColumn(), you may alter the outcome of the fit.

       Only in cases where such a modification of fit behaviour is intentional,
       this function should be used.
RooArgSet* addColumns(const RooArgList& varList)
 Utility function to add multiple columns in one call
 See addColumn() for details
RooAbsDataStore* merge(const RooArgSet& allvars, list<RooAbsDataStore*> dstoreList)
 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(RooAbsDataStore& other)
Int_t numEntries() const
void reset()
void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset = 0)
 Cache given RooAbsArgs with this tree: The tree is
 given direct write access of the args internal cache
 the args values is pre-calculated for all data points
 in this data collection. Upon a get() call, the
 internal cache of 'newVar' will be loaded with the
 precalculated value and it's dirty flag will be cleared.
void setArgStatus(const RooArgSet& set, Bool_t active)
 Activate or deactivate the branch status of the TTree branch associated
 with the given set of dataset observables
void resetCache()
 Remove tree with values of cached observables
 and clear list of cached observables
void checkInit() const
Stat_t GetEntries() const
 Interface function to TTree::GetEntries
void Reset(Option_t* option = 0)
 Interface function to TTree::Reset
Int_t Fill()
 Interface function to TTree::Fill
Int_t GetEntry(Int_t entry = 0, Int_t getall = 0)
 Interface function to TTree::GetEntry
void Draw(Option_t* option = "")
void Streamer(TBuffer& b)
 Stream an object of class RooTreeDataStore.
RooAbsDataStore* clone(const RooArgSet& vars, const char* newname = 0) const
{ return new RooTreeDataStore(*this,vars,newname) ; }
Bool_t isWeighted() const
{ return (_wgtVar!=0||_extWgtArray!=0) ; }
TTree& tree()
 Tree access
{ return *_tree ; }
const TTree* tree() const
{ return _tree ; }
const RooAbsArg* cacheOwner()
{ return _cacheOwner ; }
void setExternalWeightArray(Double_t* arrayWgt, Double_t* arrayWgtErrLo, Double_t* arrayWgtErrHi, Double_t* arraySumW2)
const RooArgSet& row()
{ return _varsww ; }
void setBranchBufferSize(Int_t size)
 TTree Branch buffer size control
{ _defTreeBufSize = size ; }
Int_t getBranchBufferSize() const
{ return _defTreeBufSize ; }