81 _wgtVar(weightVar(vars,wgtVarName)),
102 _wgtVar(weightVar(vars,wgtVarName)),
104 _extWgtErrLoArray(0),
105 _extWgtErrHiArray(0),
127 _wgtVar(weightVar(vars,wgtVarName)),
129 _extWgtErrLoArray(0),
130 _extWgtErrHiArray(0),
152 _wgtVar(weightVar(vars,wgtVarName)),
154 _extWgtErrLoArray(0),
155 _extWgtErrHiArray(0),
164 if (selExpr && *selExpr) {
184 _wgtVar(weightVar(vars,wgtVarName)),
186 _extWgtErrLoArray(0),
187 _extWgtErrHiArray(0),
209 _wgtVar(weightVar(vars,wgtVarName)),
211 _extWgtErrLoArray(0),
212 _extWgtErrHiArray(0),
221 if (selExpr && *selExpr) {
240 _wgtVar(weightVar(vars,wgtVarName)),
242 _extWgtErrLoArray(0),
243 _extWgtErrHiArray(0),
273 loadValues(&tds,cloneVar,cutRange,nStart,nStop);
275 if (cloneVar)
delete cloneVar ;
345 _varsww(other._varsww),
346 _wgtVar(other._wgtVar),
347 _extWgtArray(other._extWgtArray),
348 _extWgtErrLoArray(other._extWgtErrLoArray),
349 _extWgtErrHiArray(other._extWgtErrHiArray),
350 _extSumW2Array(other._extSumW2Array),
351 _curWgt(other._curWgt),
352 _curWgtErrLo(other._curWgtErrLo),
353 _curWgtErrHi(other._curWgtErrHi),
354 _curWgtErr(other._curWgtErr)
364 RooAbsDataStore(other,varsNoWeight(vars,other._wgtVar?other._wgtVar->GetName():0),newname),
369 _wgtVar(other._wgtVar?weightVar(vars,other._wgtVar->GetName()):0),
370 _extWgtArray(other._extWgtArray),
371 _extWgtErrLoArray(other._extWgtErrLoArray),
372 _extWgtErrHiArray(other._extWgtErrHiArray),
373 _extSumW2Array(other._extSumW2Array),
374 _curWgt(other._curWgt),
375 _curWgtErrLo(other._curWgtErrLo),
376 _curWgtErrHi(other._curWgtErrHi),
377 _curWgtErr(other._curWgtErr)
483 if (dynamic_cast<const TChain*>(t)) {
517 Int_t numInvalid(0) ;
519 for(
Int_t i=0; i < nevent; ++i) {
521 if (entryNumber<0)
break;
526 sourceIter->
Reset() ;
540 if (!allOK || (selectClone && selectClone->
getVal()==0)) {
549 coutI(
Eval) <<
"RooTreeDataStore::loadValues(" <<
GetName() <<
") Ignored " << numInvalid <<
" out of range events" << endl ;
555 delete sourceArgSet ;
571 const char* rangeName,
Int_t nStart,
Int_t nStop)
594 for(
Int_t i=nStart; i < nevent ; ++i) {
598 if (selectClone && selectClone->
getVal()==0) {
783 throw string(
Form(
"RooDataHist::weightError(%s) error type Auto not allowed here",
GetName())) ;
787 throw string(
Form(
"RooDataHist::weightError(%s) error type Expected not allowed here",
GetName())) ;
847 coutE(
InputArguments) <<
"RooTreeDataStore::changeObservableName(" <<
GetName() <<
" no observable " << from <<
" in this dataset" << endl ;
919 << valHolder->
GetName() <<
"\"" << endl;
988 holderSet->
add(*valHolder) ;
993 << valHolder->
GetName() <<
"\"" << endl;
999 if (!newVarCloneList) {
1001 <<
") Couldn't deep-clone variable " << var->
GetName() <<
", abort." << endl ;
1008 cloneSetList.
Add(newVarCloneList) ;
1009 cloneSet.
add(*newVarClone) ;
1059 Int_t nevt = dstoreList.front()->numEntries() ;
1060 for (
int i=0 ; i<nevt ; i++) {
1063 mergedStore->
_vars = *
get(i) ;
1066 for (list<RooAbsDataStore*>::iterator
iter = dstoreList.begin() ;
iter!=dstoreList.end() ;
iter++) {
1067 const RooArgSet* partSet = (*iter)->get(i) ;
1068 mergedStore->
_vars = *partSet ;
1071 mergedStore->
fill() ;
1073 return mergedStore ;
1085 for (
int i=0 ; i<nevt ; i++) {
1104 for (
int i=0 ; i<nevt ; i++) {
1109 carry = (t - sum) - y;
1118 for (
int i=0 ; i<nevt ; i++) {
1122 carry = (t - sum) - y;
1208 delete constExprVarSet ;
1226 <<
") dataset doesn't contain variable " << arg->
GetName() << endl ;
1263 while((arg=iter.
next())) {
1286 while((arg=iter.
next())) {
1299 while((arg=iter.
next())) {
1353 if (!ret1)
return 0 ;
1369 void RooTreeDataStore::Streamer(
TBuffer &R__b)
virtual Bool_t changeObservableName(const char *from, const char *to)
Change name of internal observable named 'from' into 'to'.
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
virtual const char * GetTitle() const
Returns title of object.
virtual RooArgSet * addColumns(const RooArgList &varList)
Utility function to add multiple columns in one call See addColumn() for details. ...
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual Double_t weight() const =0
virtual void attachBuffers(const RooArgSet &extObs)
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' RooFo...
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
RooFIter fwdIterator() const
virtual Int_t Fill()
Fill all branches.
virtual void SetName(const char *name)
Change (i.e.
virtual Bool_t isFundamental() const
virtual const RooArgSet * get() const
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
Buffer base class used for serializing objects.
void Reset(Option_t *option=0)
Interface function to TTree::Reset.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual const RooArgSet * get(Int_t index) const =0
Bool_t _defCtor
Object owning cache contents.
Int_t GetEntry(Int_t entry=0, Int_t getall=0)
Interface function to TTree::GetEntry.
virtual void fillTreeBranch(TTree &t)=0
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
RooTreeDataStore is the abstract base class for data collection that use a TTree as internal storage ...
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
ClassImp(RooTreeDataStore)
Iterator abstract base class.
Bool_t _doDirtyProp
Iterator over cached variables.
virtual void attachToTree(TTree &t, Int_t bufSize=32000)=0
Overloadable function for derived classes to implement attachment as branch to a TTree.
virtual void syncCache(const RooArgSet *nset=0)=0
const char * Data() const
virtual Int_t numEntries() const =0
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
Add a new column to the data set which holds the pre-calculated values of 'newVar'.
Double_t * _extWgtErrLoArray
External weight array.
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="")
Copy nentries from given tree to this tree.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add element to an owning set.
virtual Double_t sumEntries() const
virtual Bool_t valid() const
Return true if currently loaded coordinate is considered valid within the current range definitions o...
Bool_t getPoissonInterval(Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma=1) const
Return a confidence interval for the expected number of events given n observed (unweighted) events...
std::map< std::string, std::string >::const_iterator iter
TIterator * _cacheIter
Iterator over dimension variables.
TIterator * createIterator(Bool_t dir=kIterForward) const
if on multiple lines(like in C++).**The" * configuration fragment. * * The "import myobject continue
Parses the configuration file.
TString & Append(const char *cs)
Double_t * _extWgtErrHiArray
External weight array - low error.
Double_t getVal(const RooArgSet *set=0) const
const RooAbsArg * _cacheOwner
TTree holding the cached function values.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual ~RooTreeDataStore()
Destructor.
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const
virtual 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...
virtual RooAbsArg * createFundamental(const char *newname=0) const =0
virtual void append(RooAbsDataStore &other)
RooRealVar represents a fundamental (non-derived) real valued object.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
void restoreAlternateBuffers()
virtual void setTreeBranchStatus(TTree &t, Bool_t active)=0
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooAbsArg * find(const char *name) const
Find object with given name in list.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
Bool_t hasAsymError(Bool_t allowZero=kTRUE) const
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
virtual Int_t fill()
Interface function to TTree::Fill.
static Int_t _defTreeBufSize
void SetName(const char *name)
Change (i.e.
char * Form(const char *fmt,...)
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called...
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables...
virtual const char * GetName() const
Returns name of object.
virtual Bool_t inRange(const char *) const
Int_t Fill()
Interface function to TTree::Fill.
Double_t getAsymErrorHi() const
virtual Int_t numEntries() const
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Double_t * _extSumW2Array
External weight array - high error.
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
The assignment operator sets the value of any argument in our set that also appears in the other set...
void select(Int_t replica=1, Int_t color=kGreen)
RooArgSet varsNoWeight(const RooArgSet &allVars, const char *wgtName=0)
Utility function for constructors Return RooArgSet that is copy of allVars minus variable matching wg...
RooArgSet _attachedBuffers
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
void initialize()
One-time initialization common to all constructor forms.
void setValueDirty() const
RooArgSet _varsww
Was object constructed with default ctor?
Double_t _curWgt
External sum of weights array.
virtual Bool_t isValid() const
WVE (08/21/01) Probably obsolete now.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches...
Double_t getAsymErrorLo() const
virtual void Add(TObject *obj)
Stat_t GetEntries() const
Interface function to TTree::GetEntries.
virtual TObject * Next()=0
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)
Merge columns of supplied data set(s) with this data set.
virtual void resetCache()
Remove tree with values of cached observables and clear list of cached observables.
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kFALSE)
Cache given RooAbsArgs with this tree: The tree is given direct write access of the args internal cac...
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
float type_of_call hi(const int &, const int &)
void clearValueDirty() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void checkInit() const
void createTree(const char *name, const char *title)
Create TTree object that lives in memory, independent of current location of gDirectory.
void Draw(Option_t *option="")
Default Draw method for all objects.
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
virtual Double_t weight() const
Return the weight of the n-th data point (n='index') in memory.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
RooRealVar * weightVar(const RooArgSet &allVars, const char *wgtName=0)
Utility function for constructors Return pointer to weight variable if it is defined.
virtual void resetBuffers()
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
Double_t getError() const