23 #ifndef ROOSTATS_MarkovChain
35 #ifndef RooStats_RooStatsUtils
41 #ifndef ROOT_THnSparse
49 using namespace RooFit;
50 using namespace RooStats;
53 static const char*
NLL_NAME =
"nll_MarkovChain_local_";
58 MarkovChain::MarkovChain() :
133 for(
int i=0; i < otherChain.
Size(); i++ ) {
136 if( counter > burnIn ) {
148 double counter = 0.0;
149 for(
int i=0; i < otherChain.
Size(); i++ ) {
151 counter += otherChain.
Weight();
152 if( counter > discardEntries ) {
171 if (whichVars ==
NULL) {
176 args.
add(*whichVars);
198 if (whichVars ==
NULL) {
203 args.
add(*whichVars);
229 if (whichVars ==
NULL)
232 axes.
add(*whichVars);
235 std::vector<Double_t>
min(dim);
236 std::vector<Double_t>
max(dim);
237 std::vector<Int_t>
bins(dim);
238 std::vector<const char *> names(dim);
240 for (
Int_t i = 0; i < dim; i++) {
250 dim, &bins[0], &min[0], &max[0]);
261 for (
Int_t i = 0; i < size; i++) {
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
static const char * DEFAULT_TITLE
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
virtual Int_t numBins(const char *rangeName=0) const
Long64_t Fill(const Double_t *x, Double_t w=1.)
static const char * DATASET_NAME
virtual Double_t NLL(Int_t i) const
get the NLL value of entry at position i
void SetParameters(const RooArgSet *desiredVals, RooArgSet *paramsToChange)
virtual Double_t getMin(const char *name=0) const
RooAbsData * reduce(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg())
Create a reduced copy of this dataset.
static const char * DEFAULT_NAME
const TKDTreeBinning * bins
Iterator abstract base class.
RooDataSet is a container class to hold N-dimensional binned data.
Efficient multidimensional histogram.
The TNamed class is the base class for all named ROOT classes.
virtual RooDataHist * GetAsDataHist(RooArgSet *whichVars=NULL) const
get this MarkovChain as a RooDataHist whose entries contain the values of whichVars.
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual void Add(RooArgSet &entry, Double_t nllValue, Double_t weight=1.0)
safely add an entry to the chain
ClassImp(RooStats::MarkovChain)
virtual RooDataSet * GetAsDataSet(RooArgSet *whichVars=NULL) const
get this MarkovChain as a RooDataSet whose entries contain the values of whichVars.
static const char * WEIGHT_NAME
THnSparseT< TArrayF > THnSparseF
virtual void AddWithBurnIn(MarkovChain &otherChain, Int_t burnIn=0)
add another markov chain
RooRealVar represents a fundamental (non-derived) real valued object.
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.
virtual Double_t weight() const
Return event weight of current event.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void AddFast(RooArgSet &entry, Double_t nllValue, Double_t weight=1.0)
add an entry to the chain ONLY IF you have constructed with parameters or called SetParameters ...
virtual Int_t numEntries() const
void Sumw2()
Enable calculation of errors.
virtual THnSparse * GetAsSparseHist(RooAbsCollection *whichVars=NULL) const
Get a clone of the markov chain on which this interval is based as a sparse histogram.
virtual const char * GetName() const
Returns name of object.
RooDataSet is a container class to hold unbinned data.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set...
virtual void addFast(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set...
Stores the steps in a Markov Chain of points.
RooDataHist * binnedClone(const char *newName=0, const char *newTitle=0) const
Return binned clone of this dataset.
virtual void SetParameters(RooArgSet ¶meters)
set which of your parameters this chain should store
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
virtual Double_t getMax(const char *name=0) const
static const char * NLL_NAME
virtual TObject * Next()=0
virtual Int_t Size() const
get the number of steps in the chain
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add clone of specified element to an owning set.
Templated implementation of the abstract base THnSparse.
virtual const RooArgSet * Get(Int_t i) const
get the entry at position i
virtual Double_t NLL() const
get the NLL value of the current (last indexed) entry
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
virtual Double_t Weight() const
get the weight of the current (last indexed) entry
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.