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->size() != 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>::iterator biter = boundaries->begin();
66 _binw.resize(boundaries->size() - 1);
67 double lastBound = (*biter);
70 while (biter != boundaries->end()) {
71 _binw[ibin] = (*biter) - lastBound;
112 double eventWeight =
data_->weight();
115 double N = eventWeight;
118 if (mu <= 0 && N > 0) {
122 TString::Format(
"Observed %f events in bin %zu with zero event yield",
N, i));
124 }
else if (std::abs(mu) < 1
e-10 && std::abs(
N) < 1
e-10) {
133 sumWeight += eventWeight;
147 pdf_->wireAllCaches();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
RooFit::OwningPtr< 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...
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Convenience wrapper class used to distinguish between pdf/data owning and non-owning constructors.
std::shared_ptr< RooAbsData > data_
virtual std::string GetName() const
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
!
Implements a PDF constructed from a sum of functions:
Variable that can be changed from the outside.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
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.
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