104 RooAbsData(name,title,vars),
_wgt(0),
_binValid(0),
_curWeight(0),
_curVolume(1),
_pbinv(0),
_pbinvCacheMgr(0,10),
_cache_sum_valid(0)
142 RooAbsData(name,title,vars),
_wgt(0),
_binValid(0),
_curWeight(0),
_curVolume(1),
_pbinv(0),
_pbinvCacheMgr(0,10),
_cache_sum_valid(0)
168 map<string,TH1*> histMap,
Double_t wgt) :
194 map<string,RooDataHist*> dhistMap,
Double_t wgt) :
217 RooAbsData(name,title,vars),
_wgt(0),
_binValid(0),
_curWeight(0),
_curVolume(1),
_pbinv(0),
_pbinvCacheMgr(0,10),
_cache_sum_valid(0)
226 <<
"number of dimension variables" << endl ;
274 RooAbsData(name,title,
RooArgSet(vars,(
RooAbsArg*)
RooCmdConfig::decodeObjOnTheFly(
"RooDataHist::RooDataHist",
"IndexCat",0,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))),
284 pc.
defineInt(
"impDens",
"ImportHisto",0) ;
293 pc.
defineMutex(
"ImportHisto",
"ImportHistoSlice",
"ImportDataHistSlice") ;
313 const char* impSliceNames = pc.
getString(
"impSliceState",
"",
kTRUE) ;
316 const char* impSliceDNames = pc.
getString(
"impSliceDState",
"",
kTRUE) ;
323 importTH1(vars,*impHist,initWgt, impDens) ;
325 }
else if (indexCat) {
328 if (impSliceHistos.
GetSize()>0) {
331 map<string,TH1*> hmap ;
333 strlcpy(tmp,impSliceNames,1024) ;
334 char* token = strtok(tmp,
",") ;
337 hmap[token] = (
TH1*) hiter->
Next() ;
338 token = strtok(0,
",") ;
344 map<string,RooDataHist*> dmap ;
346 strlcpy(tmp,impSliceDNames,1024) ;
347 char* token = strtok(tmp,
",") ;
351 token = strtok(0,
",") ;
410 Int_t ix(0),iy(0),iz(0) ;
411 for (ix=0 ; ix < xvar->
getBins() ; ix++) {
414 for (iy=0 ; iy < yvar->
getBins() ; iy++) {
417 for (iz=0 ; iz < zvar->
getBins() ; iz++) {
450 for (map<string,TH1*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
453 histo = hiter->second ;
456 if (!indexCat.
lookupType(hiter->first.c_str())) {
458 coutI(
InputArguments) <<
"RooDataHist::importTH1Set(" <<
GetName() <<
") defining state \"" << hiter->first <<
"\" in index category " << indexCat.
GetName() << endl ;
460 if (!icat->
lookupType(hiter->first.c_str())) {
468 <<
"number of continuous variables" << endl ;
505 Int_t ic(0),ix(0),iy(0),iz(0) ;
506 for (ic=0 ; ic < icat->
numBins(0) ; ic++) {
509 for (ix=0 ; ix < xvar->
getBins() ; ix++) {
512 for (iy=0 ; iy < yvar->
getBins() ; iy++) {
515 for (iz=0 ; iz < zvar->
getBins() ; iz++) {
545 for (map<string,RooDataHist*>::iterator diter = dmap.begin() ; diter!=dmap.end() ; ++diter) {
548 if (!indexCat.
lookupType(diter->first.c_str())) {
550 coutI(
InputArguments) <<
"RooDataHist::importDHistSet(" <<
GetName() <<
") defining state \"" << diter->first <<
"\" in index category " << indexCat.
GetName() << endl ;
552 if (!icat->
lookupType(diter->first.c_str())) {
561 for (map<string,RooDataHist*>::iterator diter = dmap.begin() ; diter!=dmap.end() ; ++diter) {
565 icat->
setLabel(diter->first.c_str()) ;
585 if (!dynamic_cast<RooRealVar*>(xvar)) {
597 Double_t tolerance = 1
e-6*xbins.averageBinWidth() ;
600 Double_t xloAdj = xbins.binLow(xbins.binNumber(xlo+tolerance)) ;
601 Double_t xhiAdj = xbins.binHigh(xbins.binNumber(xhi-tolerance)) ;
602 xbins.setRange(xloAdj,xhiAdj) ;
605 if (
fabs(xloAdj-xlo)>tolerance||
fabs(xhiAdj-xhi)<tolerance) {
606 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << xvar->
GetName() <<
" expanded to nearest bin boundaries: [" 607 << xlo <<
"," << xhi <<
"] --> [" << xloAdj <<
"," << xhiAdj <<
"]" << endl ;
611 xmin = xbins.rawBinNumber(xloAdj+tolerance) ;
621 Double_t tolerance = 1
e-6*xbins.averageBinWidth() ;
624 Double_t xloAdj = xbins.binLow(xbins.binNumber(xlo+tolerance)) ;
625 Double_t xhiAdj = xbins.binHigh(xbins.binNumber(xhi-tolerance)) ;
626 xbins.setRange(xloAdj,xhiAdj) ;
628 if (
fabs(xloAdj-xlo)>tolerance||
fabs(xhiAdj-xhi)<tolerance) {
629 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << xvar->
GetName() <<
" expanded to nearest bin boundaries: [" 630 << xlo <<
"," << xhi <<
"] --> [" << xloAdj <<
"," << xhiAdj <<
"]" << endl ;
636 xmin = xbins.rawBinNumber(xloAdj+tolerance) ;
651 if (!dynamic_cast<RooRealVar*>(yvar)) {
660 Double_t tolerance = 1
e-6*ybins.averageBinWidth() ;
663 Double_t yloAdj = ybins.binLow(ybins.binNumber(ylo+tolerance)) ;
664 Double_t yhiAdj = ybins.binHigh(ybins.binNumber(yhi-tolerance)) ;
665 ybins.setRange(yloAdj,yhiAdj) ;
667 if (
fabs(yloAdj-ylo)>tolerance||
fabs(yhiAdj-yhi)<tolerance) {
668 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << yvar->
GetName() <<
" expanded to nearest bin boundaries: [" 669 << ylo <<
"," << yhi <<
"] --> [" << yloAdj <<
"," << yhiAdj <<
"]" << endl ;
673 ymin = ybins.rawBinNumber(yloAdj+tolerance) ;
683 Double_t tolerance = 1
e-6*ybins.averageBinWidth() ;
686 Double_t yloAdj = ybins.binLow(ybins.binNumber(ylo+tolerance)) ;
687 Double_t yhiAdj = ybins.binHigh(ybins.binNumber(yhi-tolerance)) ;
688 ybins.setRange(yloAdj,yhiAdj) ;
690 if (
fabs(yloAdj-ylo)>tolerance||
fabs(yhiAdj-yhi)<tolerance) {
691 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << yvar->
GetName() <<
" expanded to nearest bin boundaries: [" 692 << ylo <<
"," << yhi <<
"] --> [" << yloAdj <<
"," << yhiAdj <<
"]" << endl ;
697 ymin = ybins.rawBinNumber(yloAdj+tolerance) ;
712 if (!dynamic_cast<RooRealVar*>(zvar)) {
721 Double_t tolerance = 1
e-6*zbins.averageBinWidth() ;
724 Double_t zloAdj = zbins.binLow(zbins.binNumber(zlo+tolerance)) ;
725 Double_t zhiAdj = zbins.binHigh(zbins.binNumber(zhi-tolerance)) ;
726 zbins.setRange(zloAdj,zhiAdj) ;
728 if (
fabs(zloAdj-zlo)>tolerance||
fabs(zhiAdj-zhi)<tolerance) {
729 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << zvar->
GetName() <<
" expanded to nearest bin boundaries: [" 730 << zlo <<
"," << zhi <<
"] --> [" << zloAdj <<
"," << zhiAdj <<
"]" << endl ;
734 zmin = zbins.rawBinNumber(zloAdj+tolerance) ;
744 Double_t tolerance = 1
e-6*zbins.averageBinWidth() ;
747 Double_t zloAdj = zbins.binLow(zbins.binNumber(zlo+tolerance)) ;
748 Double_t zhiAdj = zbins.binHigh(zbins.binNumber(zhi-tolerance)) ;
749 zbins.setRange(zloAdj,zhiAdj) ;
751 if (
fabs(zloAdj-zlo)>tolerance||
fabs(zhiAdj-zhi)<tolerance) {
752 coutI(
DataHandling) <<
"RooDataHist::adjustBinning(" <<
GetName() <<
"): fit range of variable " << zvar->
GetName() <<
" expanded to nearest bin boundaries: [" 753 << zlo <<
"," << zhi <<
"] --> [" << zloAdj <<
"," << zhiAdj <<
"]" << endl ;
758 zmin = zbins.rawBinNumber(zloAdj+tolerance) ;
783 if (dynamic_cast<RooAbsReal*>(real))
_realVars.
add(*real);
798 _lvvars.push_back(dynamic_cast<RooAbsLValue*>(rvarg));
812 while((arg=dynamic_cast<RooAbsLValue*>(
_iterator->
Next()))) {
815 for (i=0 ; i<
n ; i++) {
852 for (ibin=0 ; ibin<
_arrSize ; ibin++) {
855 Int_t j(0), idx(0), tmp(ibin) ;
857 while((arg2=dynamic_cast<RooAbsLValue*>(
_iterator->
Next()))) {
865 _binv[ibin] = theBinVolume ;
879 for (std::vector<const RooAbsBinning*>::const_iterator it =
_lvbins.begin();
881 _binbounds.push_back(std::vector<Double_t>());
883 std::vector<Double_t>& bounds =
_binbounds.back();
884 bounds.reserve(2 * (*it)->numBins());
885 for (
Int_t i = 0; i < (*it)->numBins(); ++i) {
886 bounds.push_back((*it)->binLow(i));
887 bounds.push_back((*it)->binHigh(i));
897 RooAbsData(other,newname),
RooDirItem(),
_idxMult(other.
_idxMult),
_binValid(0),
_curWeight(0),
_curVolume(1),
_pbinv(0),
_pbinvCacheMgr(other.
_pbinvCacheMgr,0),
_cache_sum_valid(0)
920 if (dynamic_cast<RooAbsReal*>(arg))
_realVars.
add(*arg) ;
929 _lvvars.push_back(dynamic_cast<RooAbsLValue*>(rvarg)) ;
991 delete selCacheVars ;
1007 delete myVarSubset ;
1015 coutE(
DataHandling) <<
"RooDataHist::reduceEng(" <<
GetName() <<
") Couldn't deep-clone cut variable, abort," << endl ;
1025 TIterator* vIter =
get()->createIterator() ;
1026 for (i=nStart ; i<nevt ; i++) {
1034 if (!arg->
inRange(cutRange)) {
1042 if (!cloneVar || cloneVar->
getVal()) {
1070 vector<const RooAbsBinning*>::iterator iter =
_lvbins.begin() ;
1105 Int_t masterIdx(0), i(0) ;
1106 vector<RooAbsLValue*>::const_iterator iter =
_lvvars.begin() ;
1107 vector<const RooAbsBinning*>::const_iterator biter =
_lvbins.begin() ;
1108 for (;iter!=
_lvvars.end() ; ++iter) {
1110 masterIdx +=
_idxMult[i++]*(*iter)->getBin(binning) ;
1123 cout <<
"_arrSize = " <<
_arrSize << endl ;
1125 cout <<
"wgt[" << i <<
"] = " <<
_wgt[i] <<
"sumw2[" << i <<
"] = " <<
_sumw2[i] <<
" vol[" << i <<
"] = " <<
_binv[i] << endl ;
1149 <<
":plotOn: frame does not specify a plot variable" << endl;
1156 <<
":plotOn: dataset doesn't contain plot frame variable" << endl;
1201 if (correctForBinSize) {
1240 for (i=ybinLo ; i<=intOrder+ybinLo ; i++) {
1242 if (i>=0 && i<ybinM) {
1246 xarr[i-ybinLo] = realY->
getVal() ;
1247 }
else if (i>=ybinM) {
1249 ibin = 2*ybinM-i-1 ;
1262 cout <<
"RooDataHist interpolating data is" << endl ;
1264 for (
int q=0;
q<=intOrder ;
q++) cout << xarr[
q] <<
" " ;
1265 cout <<
" yarr = " ;
1266 for (
int q=0;
q<=intOrder ;
q++) cout << yarr[
q] <<
" " ;
1302 throw string(
Form(
"RooDataHist::weightError(%s) error type Auto not allowed here",
GetName())) ;
1306 throw string(
Form(
"RooDataHist::weightError(%s) error type Expected not allowed here",
GetName())) ;
1351 Int_t fbinLo = fbinC-intOrder/2 - ((xval<binning->
binCenter(fbinC))?1:0) ;
1358 for (i=fbinLo ; i<=intOrder+fbinLo ; i++) {
1360 if (i>=0 && i<fbinM) {
1365 xarr[i-fbinLo] = dim.
getVal() ;
1367 yarr[i-fbinLo] =
_wgt[idx] ;
1368 if (correctForBinSize) yarr[i-fbinLo] /=
_binv[idx] ;
1369 }
else if (i>=fbinM) {
1371 ibin = 2*fbinM-i-1 ;
1374 if (cdfBoundaries) {
1375 xarr[i-fbinLo] = dim.
getMax()+1
e-10*(i-fbinM+1) ;
1376 yarr[i-fbinLo] = 1.0 ;
1380 yarr[i-fbinLo] =
_wgt[idx] ;
1381 if (correctForBinSize) yarr[i-fbinLo] /=
_binv[idx] ;
1388 if (cdfBoundaries) {
1389 xarr[i-fbinLo] = dim.
getMin()-ibin*(1
e-10) ; ;
1390 yarr[i-fbinLo] = 0.0 ;
1394 yarr[i-fbinLo] =
_wgt[idx] ;
1395 if (correctForBinSize) yarr[i-fbinLo] /=
_binv[idx] ;
1426 _sumw2[idx] += (sumw2>0?sumw2:wgt*wgt) ;
1492 _sumw2[idx] = wgtErr*wgtErr ;
1507 add(dset,&cutVar,wgt) ;
1538 if (!cloneVar || cloneVar->
getVal()) {
1565 Int_t cache_code = 1 + (correctForBinSize?1:0) + ((correctForBinSize&&inverseBinCor)?1:0) ;
1574 Double_t theBinVolume = correctForBinSize ? (inverseBinCor ? 1/
_binv[i] :
_binv[i]) : 1.0 ;
1578 carry = (t -
total) - y;
1612 _vars = *sliceOnlySet ;
1614 delete sliceOnlySet ;
1626 if (sumSet.
find(*arg)) {
1631 refBin[i] = (
dynamic_cast<RooAbsLValue*
>(arg))->getBin() ;
1639 for (ibin=0 ; ibin<
_arrSize ; ibin++) {
1641 Int_t idx(0), tmp(ibin), ivar(0) ;
1650 if (mask[ivar] && idx!=refBin[ivar]) skip=
kTRUE ;
1655 Double_t theBinVolume = correctForBinSize ? (inverseBinCor ? 1/(*_pbinv)[i] : (*_pbinv)[i] ) : 1.0 ;
1659 carry = (t -
total) - y;
1691 const std::map<
const RooAbsArg*, std::pair<Double_t, Double_t> >& ranges)
1700 _vars = sliceOnlySet;
1707 std::vector<Double_t> rangeLo(
_vars.
getSize(), -std::numeric_limits<Double_t>::infinity());
1708 std::vector<Double_t> rangeHi(
_vars.
getSize(), +std::numeric_limits<Double_t>::infinity());
1718 refBin[i] = (
dynamic_cast<RooAbsLValue*
>(arg))->getBin();
1720 std::map<const RooAbsArg*, std::pair<Double_t, Double_t> >::const_iterator
1721 it = ranges.find(sumsetv ? sumsetv : slicesetv);
1722 if (ranges.end() != it) {
1723 rangeLo[i] = it->second.first;
1724 rangeHi[i] = it->second.second;
1735 for (
Int_t ivar = 0, tmp = ibin;
1739 if (mask[ivar] && idx!=refBin[ivar]) skip=
kTRUE;
1745 for (
Int_t ivar = 0, tmp = ibin;
1752 if (binHi < rangeLo[ivar] || binLo > rangeHi[ivar]) {
1758 (std::min(rangeHi[ivar], binHi) - std::max(rangeLo[ivar], binLo));
1761 if (0. == corrPartial)
continue;
1762 const Double_t corr = correctForBinSize ? (inverseBinCor ? 1. /
_binv[ibin] :
_binv[ibin] ) : 1.0;
1767 carry = (t -
total) - y;
1791 pbinv =
new vector<Double_t>(
_arrSize) ;
1804 for (ibin=0 ; ibin<
_arrSize ; ibin++) {
1807 Int_t j(0), idx(0), tmp(ibin) ;
1809 while((arg=dynamic_cast<RooAbsLValue*>(
_iterator->
Next()))) {
1817 (*pbinv)[ibin] = theBinVolume ;
1851 carry = (t -
n) - y;
1869 if (cutSpec==0 && cutRange==0) {
1876 select =
new RooFormula(
"select",cutSpec,*
get()) ;
1890 carry = (t - sumw) - y;
1895 if (select)
delete select ;
1995 coutE(
InputArguments) <<
"RooDataHist::sliceIterator() variable " << sliceArg.
GetName() <<
" is not part of this RooDataHist" << endl ;
2121 os << indent <<
"Binned Dataset " <<
GetName() <<
" (" <<
GetTitle() <<
")" << endl ;
2122 os << indent <<
" Contains " <<
numEntries() <<
" bins with a total weight of " <<
sumEntries() << endl;
2125 os << indent <<
" Observables " <<
_vars << endl ;
2127 os << indent <<
" Observables: " ;
2133 os << indent <<
" Caches " <<
_cachedVars << endl ;
2143 void RooDataHist::Streamer(
TBuffer &R__b)
2166 RooAbsData::Streamer(R__b);
2167 TTree* X_tree(0) ; R__b >> X_tree;
2168 RooArgSet X_truth ; X_truth.Streamer(R__b);
2169 TString X_blindString ; X_blindString.Streamer(R__b);
2179 RooDirItem::Streamer(R__b);
virtual Double_t getMin(const char *name=0) const
static Double_t interpolate(Double_t yArr[], Int_t nOrder, Double_t x)
virtual const char * GetName() const
Returns name of object.
virtual void setBin(Int_t ibin, const char *rangeName=0)
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
TIterator * createIterator(Bool_t dir=kIterForward) const
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
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 Double_t getBinWidth(Int_t i, const char *rangeName=0) const =0
virtual Double_t getMax(const char *name=0) const
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...
Double_t weightSquared() const
virtual const RooArgSet * get() const
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
Plot dataset on specified frame.
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
virtual Bool_t valid() const
Return true if currently loaded coordinate is considered valid within the current range definitions o...
virtual const RooArgSet * get() const
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual Int_t numBins(const char *rangeName=0) const
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
Double_t getVal(const RooArgSet *set=0) const
virtual RooAbsData * cacheClone(const RooAbsArg *newCacheOwner, const RooArgSet *newCacheVars, const char *newName=0)
Construct a clone of this dataset that contains only the cached variables.
virtual ~RooDataHist()
Destructor.
const Double_t * GetArray() const
virtual void SetName(const char *name)
Set the name of the TNamed.
const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const
Return binning definition with name.
Int_t getIndex(const RooArgSet &coord, Bool_t fast=kFALSE)
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
void set(Double_t weight, Double_t wgtErr=-1)
Increment the weight of the bin enclosing the coordinates given by 'row' by the specified amount...
Buffer base class used for serializing objects.
virtual Int_t GetNbinsZ() const
RooAbsData * reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=0, Int_t nStart=0, Int_t nStop=2000000000, Bool_t copyCache=kTRUE)
Implementation of RooAbsData virtual method that drives the RooAbsData::reduce() methods.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
void addUniform(Int_t nBins, Double_t xlo, Double_t xhi)
Add array of nbins uniformly sized bins in range [xlo,xhi].
Double_t _cache_sum
Is cache sum valid.
void importTH1Set(const RooArgList &vars, RooCategory &indexCat, std::map< std::string, TH1 *> hmap, Double_t initWgt, Bool_t doDensityCorrection)
Import data from given set of TH1/2/3 into this RooDataHist.
RooTreeDataStore is the abstract base class for data collection that use a TTree as internal storage ...
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
TIterator * _iterator
External variables cached with this data set.
virtual RooAbsBinning * clone(const char *name=0) const =0
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables...
Iterator abstract base class.
void importTH1(const RooArgList &vars, const TH1 &histo, Double_t initWgt, Bool_t doDensityCorrection)
Import data from given TH1/2/3 into this RooDataHist.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
virtual Bool_t inRange(const char *) const
virtual Double_t weightSquared() const =0
void dump2()
Debug stuff, should go...
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
virtual Int_t GetDimension() const
void importDHistSet(const RooArgList &vars, RooCategory &indexCat, std::map< std::string, RooDataHist *> dmap, Double_t initWgt)
Import data from given set of TH1/2/3 into this RooDataHist.
void setBinning(const RooAbsBinning &binning, const char *name=0)
Add given binning under name 'name' with this variable.
std::vector< RooAbsLValue * > _lvvars
Cache manager for arrays of partial bin volumes.
void appendToDir(TObject *obj, Bool_t forceMemoryResident=kFALSE)
Append object to directory.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Int_t numBins(const char *rangeName) const
Returm the number of fit bins ( = number of types )
RooDataSet is a container class to hold N-dimensional binned data.
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Internal method – Attach dataset copied with cache contents to copied instances of functions...
void initialize(const char *binningName=0, Bool_t fillTree=kTRUE)
Initialization procedure: allocate weights array, calculate multipliers needed for N-space to 1-dim a...
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range...
void checkBinBounds() const
std::vector< Int_t > _idxMult
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
double pow(double, double)
Double_t binVolume() const
virtual void setBinFast(Int_t ibin, const RooAbsBinning &binning)
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
Double_t interpolateDim(RooRealVar &dim, const RooAbsBinning *binning, Double_t xval, Int_t intOrder, Bool_t correctForBinSize, Bool_t cdfBoundaries)
Perform boundary safe 'intOrder'-th interpolation of weights in dimension 'dim' at current value 'xva...
if on multiple lines(like in C++). **The " * configuration fragment. * * The "import myobject continue
Parses the configuration file.
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
Int_t calcTreeIndex() const
Calculate the index for the weights array corresponding to to the bin enclosing the current coordinat...
Class RooBinning is an implements RooAbsBinning in terms of an array of boundary values, posing no constraints on the choice of binning, thus allowing variable bin sizes.
virtual Double_t weight() const
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout...
virtual TList * GetList() const
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void adjustBinning(const RooArgList &vars, const TH1 &href, Int_t *offset=0)
Adjust binning specification on first and optionally second and third observable to binning in given ...
virtual void weightError(Double_t &lo, Double_t &hi, ErrorType etype=Poisson) const
Return the error on current weight.
Bool_t * _binValid
Iterator over realVars.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void addClone(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 void setBin(Int_t ibin, const char *rangeName=0)=0
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
void SetName(const char *name)
Change the name of the RooDataHist.
virtual void Add(TObject *arg)
virtual const RooAbsBinning * getBinningPtr(const char *rangeName) const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual void checkInit() const
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual void add(const RooArgSet &row, Double_t wgt=1.0)
RooDataHist()
Default constructor.
RooAbsArg * at(Int_t idx) const
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
const RooCatType * lookupType(Int_t index, Bool_t printError=kFALSE) const
Find our type corresponding to the specified index, or return 0 for no match.
virtual void printValue(std::ostream &os) const
Print value of the dataset, i.e. the sum of weights contained in the dataset.
char * Form(const char *fmt,...)
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the details on the dataset contents.
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called...
void SetNameTitle(const char *name, const char *title)
Change the title of this RooDataHist.
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooAbsData is the common abstract base class for binned and unbinned datasets.
static void indent(ostringstream &buf, int indent_level)
void removeFromDir(TObject *obj)
Remove object from directory it was added to.
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
RooCategory represents a fundamental (non-derived) discrete value object.
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
Double_t sum(Bool_t correctForBinSize, Bool_t inverseCorr=kFALSE) const
Return the sum of the weights of all hist bins.
static unsigned int total
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
virtual Double_t sumEntries() const
std::vector< Double_t > * _pbinv
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual Int_t numEntries() const
Return the number of bins.
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...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
RooDirItem is a utility base class for RooFit objects that are to be attached to ROOT directories...
virtual Double_t binCenter(Int_t bin) const =0
RooAbsDataStore * _dstore
Iterator over cached variables.
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
virtual void setExternalWeightArray(Double_t *, Double_t *, Double_t *, Double_t *)
virtual Int_t getBin(const char *rangeName=0) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
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 * sliceIterator(RooAbsArg &sliceArg, const RooArgSet &otherArgs)
Create an iterator over all bins in a slice defined by the subset of observables listed in sliceArg...
virtual const char * getLabel() const
Return label string of current state.
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
void cacheValidEntries()
Cache the datahist entries with bin centers that are inside/outside the current observable definitio...
static StorageType defaultStorageType
Mother of all ROOT objects.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
friend class RooDataHistSliceIter
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual void Add(TObject *obj)
RooAbsRealLValue * getPlotVar() const
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
virtual void setBin(Int_t ibin, const char *rangeName=0)
Set category to i-th fit bin, which is the i-th registered state.
virtual void reset()
Reset all bin weights to zero.
virtual TObject * Next()=0
virtual void printArgs(std::ostream &os) const
Print argument of dataset, i.e. the observable names.
virtual Double_t weight() const =0
std::vector< const RooAbsBinning * > _lvbins
List of observables casted as RooAbsLValue.
void calculatePartialBinVolume(const RooArgSet &dimSet) const
Fill the transient cache with partial bin volumes with up-to-date values for the partial volume speci...
RooCacheManager< std::vector< Double_t > > _pbinvCacheMgr
Partial bin volume array.
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index...
virtual Bool_t isNonPoissonWeighted() const
Returns true if datasets contains entries with a non-integer weight.
float type_of_call hi(const int &, const int &)
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
virtual Int_t getBins(const char *name=0) const
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Abstract base class for objects that are lvalues, i.e.
virtual Int_t GetNbinsX() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void setAllWeights(Double_t value)
Set all the event weight of all bins to the specified value.
static char * skip(char **buf, const char *delimiters)
virtual RooPlot * plotOn(RooPlot *frame, PlotOpt o) const
Back end function to plotting functionality.
std::vector< std::vector< Double_t > > _binbounds
List of used binnings associated with lvalues.
const TArrayD * GetXbins() const
virtual Int_t numEntries() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t numBins(const char *rangeName=0) const =0
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t GetNbinsY() const
Int_t _cache_sum_valid
list of bin bounds per dimension
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Double_t _curWeight
Valid bins with current range definition.
Bool_t correctForBinWidth