#ifndef ROO_DATA_HIST
#define ROO_DATA_HIST
#include "RooTreeData.h"
#include "RooDirItem.h"
#include "RooArgSet.h"
#include "RooNameSet.h"
#include "RooCacheManager.h"
#include <vector>
#include <list>
#include <map>
#include <string>
class TObject ;
class RooAbsArg;
class RooAbsReal ;
class RooAbsCategory ;
class Roo1DTable ;
class RooPlot;
class RooArgSet ;
class RooLinkedList ;
class RooAbsLValue ;
class RooDataHist : public RooTreeData, public RooDirItem {
public:
RooDataHist() ;
RooDataHist(const char *name, const char *title, const RooArgSet& vars, const char* binningName=0) ;
RooDataHist(const char *name, const char *title, const RooArgSet& vars, const RooAbsData& data, Double_t initWgt=1.0) ;
RooDataHist(const char *name, const char *title, const RooArgList& vars, const TH1* hist, Double_t initWgt=1.0) ;
RooDataHist(const char *name, const char *title, const RooArgList& vars, RooCategory& indexCat, std::map<std::string,TH1*> histMap, Double_t initWgt=1.0) ;
RooDataHist(const char *name, const char *title, const RooArgList& vars, RooCmdArg arg1, RooCmdArg arg2=RooCmdArg(), RooCmdArg arg3=RooCmdArg(),
RooCmdArg arg4=RooCmdArg(),RooCmdArg arg5=RooCmdArg(),RooCmdArg arg6=RooCmdArg(),RooCmdArg arg7=RooCmdArg(),RooCmdArg arg8=RooCmdArg()) ;
RooDataHist(const RooDataHist& other, const char* newname = 0) ;
virtual TObject* Clone(const char* newname=0) const { return new RooDataHist(*this,newname?newname:GetName()) ; }
virtual ~RooDataHist() ;
virtual RooAbsData* emptyClone(const char* newName=0, const char* newTitle=0, const RooArgSet*vars=0) const {
return new RooDataHist(newName?newName:GetName(),newTitle?newTitle:GetTitle(),vars?*vars:*get()) ;
}
virtual void add(const RooArgSet& row, Double_t wgt=1.0) {
add(row,wgt,-1.) ;
}
virtual void add(const RooArgSet& row, Double_t weight, Double_t sumw2) ;
void set(Double_t weight, Double_t wgtErr=-1) ;
void set(const RooArgSet& row, Double_t weight, Double_t wgtErr=-1) ;
void set(const RooArgSet& row, Double_t weight, Double_t wgtErrLo, Double_t wgtErrHi) ;
void add(const RooAbsData& dset, const RooFormulaVar* cutVar=0, Double_t weight=1.0 ) ;
void add(const RooAbsData& dset, const char* cut, Double_t weight=1.0 ) ;
virtual const RooArgSet* get() const {
return &_vars ;
}
virtual const RooArgSet* get(Int_t masterIdx) const ;
virtual const RooArgSet* get(const RooArgSet& coord) const ;
virtual Int_t numEntries(Bool_t useWeights=kFALSE) const ;
virtual Double_t sumEntries(const char* cutSpec=0, const char* cutRange=0) const ;
virtual Bool_t isWeighted() const {
return kTRUE ;
}
Double_t sum(Bool_t correctForBinSize) const ;
Double_t sum(const RooArgSet& sumSet, const RooArgSet& sliceSet, Bool_t correctForBinSize) ;
virtual Double_t weight() const {
return _curWeight ;
}
Double_t weight(const RooArgSet& bin, Int_t intOrder=1, Bool_t correctForBinSize=kFALSE, Bool_t cdfBoundaries=kFALSE) ;
Double_t binVolume() const { return _curVolume ; }
Double_t binVolume(const RooArgSet& bin) ;
virtual Bool_t valid() const ;
TIterator* sliceIterator(RooAbsArg& sliceArg, const RooArgSet& otherArgs) ;
virtual void weightError(Double_t& lo, Double_t& hi, ErrorType etype=Poisson) const ;
virtual Double_t weightError(ErrorType etype=Poisson) const {
Double_t lo,hi ;
weightError(lo,hi,etype) ;
return (lo+hi)/2 ;
}
using RooTreeData::plotOn ;
virtual RooPlot *plotOn(RooPlot *frame, PlotOpt o) const;
virtual void reset() ;
void dump2() ;
virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
virtual void printArgs(ostream& os) const ;
virtual void printValue(ostream& os) const ;
void SetName(const char *name) ;
void SetNameTitle(const char *name, const char* title) ;
protected:
friend class RooAbsCachedPdf ;
friend class RooAbsCachedReal ;
friend class RooDataHistSliceIter ;
friend class RooAbsOptTestStatistic ;
void cacheValidEntries() ;
void setAllWeights(Double_t value) ;
void initialize(Bool_t fillTree=kTRUE) ;
RooDataHist(const char* name, const char* title, RooDataHist* h, const RooArgSet& varSubset,
const RooFormulaVar* cutVar, const char* cutRange, Int_t nStart, Int_t nStop, Bool_t copyCache) ;
RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cutVar, const char* cutRange=0,
Int_t nStart=0, Int_t nStop=2000000000, Bool_t copyCache=kTRUE) ;
Double_t interpolateDim(RooRealVar& dim, const RooAbsBinning* binning, Double_t xval, Int_t intOrder, Bool_t correctForBinSize, Bool_t cdfBoundaries) ;
void calculatePartialBinVolume(const RooArgSet& dimSet) const ;
void adjustBinning(const RooArgList& vars, TH1& href, Int_t* offset=0) ;
void importTH1(const RooArgList& vars, TH1& histo, Double_t initWgt) ;
void importTH1Set(const RooArgList& vars, RooCategory& indexCat, std::map<std::string,TH1*> hmap, Double_t initWgt) ;
virtual RooAbsData* cacheClone(const RooArgSet* newCacheVars, const char* newName=0) ;
Int_t calcTreeIndex() const ;
Int_t _arrSize ;
Int_t* _idxMult ;
Double_t* _wgt ;
Double_t* _errLo ;
Double_t* _errHi ;
Double_t* _sumw2 ;
Double_t* _binv ;
RooArgSet _realVars ;
TIterator* _realIter ;
Bool_t* _binValid ;
mutable Double_t _curWeight ;
mutable Double_t _curWgtErrLo ;
mutable Double_t _curWgtErrHi ;
mutable Double_t _curSumW2 ;
mutable Double_t _curVolume ;
mutable Int_t _curIndex ;
mutable std::vector<Double_t>* _pbinv ;
mutable RooCacheManager<std::vector<Double_t> > _pbinvCacheMgr ;
std::list<RooAbsLValue*> _lvvars ;
std::list<const RooAbsBinning*> _lvbins ;
char* _binningName ;
inline const char* bname() const {
return _binningName ;
}
private:
ClassDef(RooDataHist,2)
};
#endif
Last change: Fri Dec 12 09:05:59 2008
Last generated: 2008-12-12 09:05
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.