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>::iterator biter = boundaries->begin();
66 _binw.resize(boundaries->size() - 1);
67 double lastBound = (*biter);
70 while (biter != boundaries->end()) {
71 _binw[ibin] = (*biter) - lastBound;
109 double eventWeight =
data_->weight();
112 double N = eventWeight;
115 if (mu <= 0 && N > 0) {
121 <<
"Observed " <<
N <<
" events in bin " << i <<
" with zero event yield" << std::endl;
132 sumWeight += eventWeight;
146 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
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.
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 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.
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.
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< PromoteType< T > > log(const RVec< T > &v)
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