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)
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)
430 TString memDir(
gROOT->GetName()) ;
431 memDir.Append(
":/") ;
432 Bool_t notInMemNow= (pwd!=memDir) ;
441 _tree =
new TTree(name,title) ;
442 _tree->SetDirectory(0) ;
474 TString memDir(
gROOT->GetName()) ;
475 memDir.Append(
":/") ;
476 Bool_t notInMemNow= (pwd!=memDir) ;
483 if (dynamic_cast<const TChain*>(t)) {
484 tClone = (TTree*) t->Clone() ;
486 tClone = ((TTree*)t)->CloneTree() ;
490 tClone->SetDirectory(0) ;
517 Int_t numInvalid(0) ;
519 for(
Int_t i=0; i < nevent; ++i) {
520 Int_t entryNumber=tClone->GetEntryNumber(i);
521 if (entryNumber<0)
break;
522 tClone->GetEntry(entryNumber,1);
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) {
656 return _tree->Fill() ;
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 ;
856 if (
_tree->GetBranch(oldBranchName.Data())) {
862 if (
_tree->GetBranch(
Form(
"%s_err",oldBranchName.Data()))) {
865 if (
_tree->GetBranch(
Form(
"%s_aerr_lo",oldBranchName.Data()))) {
868 if (
_tree->GetBranch(
Form(
"%s_aerr_hi",oldBranchName.Data()))) {
875 if (
_tree->GetBranch(
Form(
"%s_idx",oldBranchName.Data()))) {
878 if (
_tree->GetBranch(
Form(
"%s_lbl",oldBranchName.Data()))) {
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;
1141 return _tree->GetEntries() ;
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())) {
1325 return _tree->GetEntries() ;
1334 _tree->Reset(option) ;
1343 return _tree->Fill() ;
1353 if (!ret1)
return 0 ;
1363 _tree->Draw(option) ;
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.
std::string GetName(const std::string &scope_name)
virtual RooArgSet * addColumns(const RooArgList &varList)
Utility function to add multiple columns in one call See addColumn() for details. ...
static long int sum(long int i)
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 Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
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 void SetName(const char *name)
Set the name of the TNamed.
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 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
RooTreeDataStore is the abstract base class for data collection that use a TTree as internal storage ...
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
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
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 void removeAll()
Remove all arguments from our set, deleting them if we own them.
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...
TIterator * _cacheIter
Iterator over dimension variables.
TIterator * createIterator(Bool_t dir=kIterForward) const
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 ~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.
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.
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)
Set the name of the TNamed.
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 Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
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.
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...
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
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.
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="")
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()
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