25#ifdef R__HAS_ROOFIT_MULTIPROCESS
30namespace TestStatistics {
51 std::shared_ptr<WrapperCalculationCleanFlags> calculation_is_clean)
52 : likelihood_(std::move(likelihood)), calculation_is_clean_(std::move(calculation_is_clean))
62 const std::vector<ROOT::Fit::ParameterSettings> & )
68 likelihood_->constOptimizeTestStatistic(opcode, doAlsoTrackingOpt);
98 <<
"LikelihoodWrapper::setOffsettingMode(" <<
GetName()
99 <<
"): changed offsetting mode while offsetting was enabled; resetting offset values" << std::endl;
109 if (
offset_ == 0 && current_value != 0) {
113 if (sum_likelihood !=
nullptr) {
122 <<
"LikelihoodWrapper::applyOffsetting(" <<
GetName() <<
"): Likelihood offset now set to " <<
offset_
126 return current_value -
offset_;
128 return current_value;
143 if (unbinned_likelihood ==
nullptr) {
144 throw std::logic_error(
"LikelihoodWrapper::setApplyWeightSquared can only be used on unbinned likelihoods, but "
145 "the wrapped likelihood_ member is not a RooUnbinnedL!");
149 if (flag_was_changed) {
158std::unique_ptr<LikelihoodWrapper>
160 std::shared_ptr<WrapperCalculationCleanFlags> calculationIsClean)
162 switch (likelihoodMode) {
164 return std::make_unique<LikelihoodSerial>(std::move(likelihood), std::move(calculationIsClean));
167#ifdef R__HAS_ROOFIT_MULTIPROCESS
168 return std::make_unique<LikelihoodJob>(std::move(likelihood), std::move(calculationIsClean));
170 throw std::runtime_error(
"MinuitFcnGrad ctor with LikelihoodMode::multiprocess is not available in this build "
171 "without RooFit::Multiprocess!");
175 throw std::logic_error(
"In MinuitFcnGrad constructor: likelihoodMode has an unsupported value!");
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...
virtual bool isOffsetting() const
virtual void synchronizeParameterSettings(const std::vector< ROOT::Fit::ParameterSettings > ¶meter_settings)
std::shared_ptr< RooAbsL > likelihood_
void constOptimizeTestStatistic(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt)
LikelihoodWrapper(std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean)
virtual std::string GetTitle() const
ROOT::Math::KahanSum< double > applyOffsetting(ROOT::Math::KahanSum< double > current_value)
ROOT::Math::KahanSum< double > offset_save_
!
void setOffsettingMode(OffsettingMode mode)
virtual std::string GetName() const
virtual void enableOffsetting(bool flag)
ROOT::Math::KahanSum< double > offset_
void swapOffsets()
When calculating an unbinned likelihood with square weights applied, a different offset is necessary.
OffsettingMode offsetting_mode_
double defaultErrorLevel() const
virtual void updateMinuitExternalParameterValues(const std::vector< double > &minuit_external_x)
virtual void updateMinuitInternalParameterValues(const std::vector< double > &minuit_internal_x)
Minuit passes in parameter values that may not conform to RooFit internal standards (like applying ra...
virtual void synchronizeWithMinimizer(const ROOT::Math::MinimizerOptions &options)
Synchronize minimizer settings with calculators in child classes.
void setApplyWeightSquared(bool flag)
static std::unique_ptr< LikelihoodWrapper > create(LikelihoodMode likelihoodMode, std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculationIsClean)
Factory method.
Likelihood class that sums over multiple -log components.
ROOT::Math::KahanSum< double > getSubsidiaryValue()
bool setApplyWeightSquared(bool flag)
Returns true if value was changed, false otherwise.
OffsettingMode
Previously, offsetting was only implemented for RooNLLVar components of a likelihood,...
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...