32namespace TestStatistics {
48 throw std::logic_error(
"RooAbsL::isExtendedHelper got an unknown extended value!");
57 : pdf_(std::
move(pdf)),
61 extended_(isExtendedHelper(pdf_.get(),
extended))
66 <<
"in RooAbsL ctor: p.d.f. provides expected number of events, including extended term in likelihood."
110 N_events_(
other.N_events_),
111 N_components_(
other.N_components_),
112 extended_(
other.extended_),
113 sim_count_(
other.sim_count_)
118 if ((
pdf_.use_count() > 1) && (
data_.use_count() > 1)) {
134 if (
pdf_->getAttribute(
"BinnedLikelihood")) {
135 pdf_->setAttribute(
"BinnedLikelihoodActive");
143 normSet_ = std::make_unique<RooArgSet>();
178 <<
realReal->getMin() <<
") is smaller than that of " << arg->GetName()
179 <<
" in the dataset (" <<
datReal->getMin() <<
")" << std::endl;
186 <<
"RooAbsL: ERROR maximum of FUNC observable " << arg->GetName() <<
" is larger than that of "
187 << arg->GetName() <<
" in the dataset" << std::endl;
232 data_->setDirtyProp(
false);
240 return std::unique_ptr<RooArgSet>{
pdf_->getParameters(*
data_)};
252 <<
"RooAbsL::constOptimizeTestStatistic(" <<
GetName()
253 <<
") optimizing evaluation of test statistic by finding all nodes in p.d.f that depend exclusively"
254 <<
" on observables and constant parameters and precalculating their values" << std::endl;
261 <<
"RooAbsL::constOptimizeTestStatistic(" <<
GetName()
262 <<
") deactivating optimization of constant terms in test statistic" << std::endl;
268 <<
"RooAbsL::constOptimizeTestStatistic(" <<
GetName()
269 <<
") one ore more parameter were changed from constant to floating or vice versa, "
270 <<
"re-evaluating constant term optimization" << std::endl;
278 <<
"RooAbsL::constOptimizeTestStatistic(" <<
GetName()
279 <<
") the value of one ore more constant parameter were changed re-evaluating constant term optimization"
282 data_.get()->store()->forceCacheUpdate();
289 std::string
output(
"likelihood of pdf ");
296 std::string
output(
"likelihood of pdf ");
303 return static_cast<std::size_t
>(
data_->numEntries());
RooArgSet * _funcObsSet
List of observables in the pdf expression.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static void softAbort()
Soft abort function that interrupts macro execution but doesn't kill ROOT.
Convenience wrapper class used to distinguish between pdf/data owning and non-owning constructors.
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_
Pointer to set with observables used for normalization.
void initClones(RooAbsPdf &inpdf, RooAbsData &indata)
virtual std::unique_ptr< RooArgSet > getParameters()
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 std::size_t numDataEntries() const
Number of dataset entries.
std::shared_ptr< RooAbsPdf > pdf_
Variable that can be changed from the outside.
const char * GetName() const override
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 disableConstantTermsOptimization(RooAbsReal *function, RooArgSet *norm_set, RooAbsData *dataset, RooArgSet *observables=nullptr)
static void enableConstantTermsOptimization(RooAbsReal *function, RooArgSet *norm_set, RooAbsData *dataset, bool applyTrackingOpt)