32namespace TestStatistics {
48 throw std::logic_error(
"RooAbsL::isExtendedHelper got an unknown extended value!");
55 std::size_t N_events, std::size_t N_components,
Extended extended)
56 : pdf_(std::move(pdf)), data_(std::move(data)), N_events_(N_events), N_components_(N_components)
62 <<
"in RooAbsL ctor: p.d.f. provides expected number of events, including extended term in likelihood."
78 std::shared_ptr<
RooAbsData>(static_cast<
RooAbsData *>(in.data->Clone())), N_events, N_components, extended)
94 :
RooAbsL({std::shared_ptr<RooAbsPdf>(
nullptr), inpdf}, {std::shared_ptr<RooAbsData>(
nullptr), indata}, N_events, N_components, extended)
99 : pdf_(other.pdf_), data_(other.data_), N_events_(other.N_events_), N_components_(other.N_components_), extended_(other.extended_), sim_count_(other.sim_count_)
102 assert((
pdf_.use_count() != 1) && (
data_.use_count() != 1) && (
pdf_.use_count() ==
data_.use_count()));
103 if ((
pdf_.use_count() > 1) && (
data_.use_count() > 1)) {
117 auto _funcObsSet =
pdf_->getObservables(indata);
119 if (
pdf_->getAttribute(
"BinnedLikelihood")) {
120 pdf_->setAttribute(
"BinnedLikelihoodActive");
124 std::unique_ptr<RooArgSet> origParams{inpdf.
getParameters(indata)};
125 pdf_->recursiveRedirectServers(*origParams);
131 for (
const auto realDep : *_funcObsSet) {
133 if (realDepRLV && realDepRLV->isDerived()) {
135 realDepRLV->leafNodeServerList(&tmp2, 0,
kTRUE);
146 for (
const auto arg : *_funcObsSet) {
149 auto realReal =
dynamic_cast<RooRealVar *
>(arg);
153 auto datReal =
dynamic_cast<RooRealVar *
>(dataDepSet->
find(realReal->GetName()));
160 if (!realReal->getBinning().lowBoundFunc() && realReal->getMin() < (datReal->getMin() - 1
e-6)) {
162 << realReal->getMin() <<
") is smaller than that of " << arg->GetName()
163 <<
" in the dataset (" << datReal->getMin() <<
")" << std::endl;
168 if (!realReal->getBinning().highBoundFunc() && realReal->getMax() > (datReal->getMax() + 1
e-6)) {
170 <<
"RooAbsL: ERROR maximum of FUNC observable " << arg->GetName() <<
" is larger than that of "
171 << arg->GetName() <<
" in the dataset" << std::endl;
192 data_->attachBuffers(*_funcObsSet);
208 pdf_->optimizeCacheMode(*_funcObsSet);
232 std::string
output(
"likelihood of pdf ");
239 std::string
output(
"likelihood of pdf ");
246 return static_cast<std::size_t
>(
data_->numEntries());
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...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
The RooDataHist is a container class to hold N-dimensional binned data.
void cacheValidEntries()
Compute which bins of the dataset are part of the currently set fit range.
std::shared_ptr< RooAbsData > data_
static bool isExtendedHelper(RooAbsPdf *pdf, Extended extended)
virtual std::string GetName() const
virtual std::string GetTitle() const
std::unique_ptr< RooArgSet > normSet_
void initClones(RooAbsPdf &inpdf, RooAbsData &indata)
virtual void constOptimizeTestStatistic(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt)
Interface function signaling a request to perform constant term optimization.
RooAbsL(std::shared_ptr< RooAbsPdf > pdf, std::shared_ptr< RooAbsData > data, std::size_t N_events, std::size_t N_components, Extended extended)
After handling cloning (or not) of the pdf and dataset, the public constructors call this private con...
virtual RooArgSet * getParameters()
virtual std::size_t numDataEntries() const
Number of dataset entries.
std::shared_ptr< RooAbsPdf > pdf_
RooRealVar represents a variable that can be changed from the outside.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
static void enableConstantTermsOptimization(RooAbsReal *function, RooArgSet *norm_set, RooAbsData *dataset, bool applyTrackingOpt)
Convenience wrapper class used to distinguish between pdf/data owning and non-owning constructors.
static void output(int code)