39namespace TestStatistics {
46 throw std::logic_error(
"RooBinnedL can only be created from pdf of type RooRealSumPdf!");
56 paramTracker_ = std::make_unique<RooChangeTracker>(
"chtracker",
"change tracker",params,
true);
59 if (obs->getSize() != 1) {
60 throw std::logic_error(
61 "RooBinnedL can only be created from combination of pdf and data which has exactly one observable!");
65 std::list<Double_t>::iterator biter = boundaries->begin();
66 _binw.resize(boundaries->size() - 1);
70 while (biter != boundaries->end()) {
71 _binw[ibin] = (*biter) - lastBound;
118 if (mu <= 0 && N > 0) {
124 <<
"Observed " <<
N <<
" events in bin " << i <<
" with zero event yield" << std::endl;
126 }
else if (fabs(mu) < 1
e-10 && fabs(
N) < 1
e-10) {
135 sumWeight += eventWeight;
149 pdf_->wireAllCaches();
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
std::shared_ptr< RooAbsData > data_
std::shared_ptr< RooAbsPdf > pdf_
ROOT::Math::KahanSum< double > evaluatePartition(Section bins, std::size_t components_begin, std::size_t components_end) override
Calculate and return likelihood on subset of data from firstEvent to lastEvent processed with a step ...
ROOT::Math::KahanSum< double > cachedResult_
std::unique_ptr< RooChangeTracker > paramTracker_
RooBinnedL(RooAbsPdf *pdf, RooAbsData *data)
std::vector< double > _binw
!
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
RooRealVar represents a variable that can be changed from the outside.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Convenience wrapper class used to distinguish between pdf/data owning and non-owning constructors.
A part of some range delimited by two fractional points between 0 and 1 (inclusive).
std::size_t begin(std::size_t N_total) const
std::size_t end(std::size_t N_total) const