Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README/ReleaseNotes/v644/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following people have contributed to this new version:
* The `RooTrace` class was untested and is now removed. For memory debugging, please use general-purpose tools such as AddressSanitizer or Valgrind instead.
* Flattening nested **RooSimultaneous** in the constructor, deprecated in ROOT 6.42, is removed. RooSimultaneous components are now kept as they are, which also allows adding them with `RooSimultaneous::addPdf()`. They are only supported if their index category is a parameter ("switch mode"), which now also works for toy generation and for plotting slices of the outer RooSimultaneous. If the index category of a nested RooSimultaneous is in the dataset, creating the likelihood fails with a clear error for all evaluation backends. To combine channels, use one RooSimultaneous over a **RooCategory** with one state per channel, or over a **RooSuperCategory** if the channels span the full product of several categories. RooSimultaneous objects that were flattened by previous ROOT versions and are read from files are not affected. The internal `RooSimultaneous::InitializationOutput` struct and `RooSimultaneous::initialize()` function are removed as well.
* The PyMVA library and the associated `tmva-pymva` build option that were deprecated in ROOT 6.42 have been removed
* The `RooParamHistFunc` and `RooHistConstraint` classes are deprecated and will be removed in ROOT 6.46. Their functionality is too close to the HistFactory classes, which has repeatedly caused confusion about which classes to use and how they differ. Please use the HistFactory class `ParamHistFunc` instead, multiplied with a `RooHistFunc` and constrained by one `RooPoisson` per bin, like the models built by HistFactory. The [rf709_BarlowBeeston](https://root.cern/doc/v644/rf709__BarlowBeeston_8C.html) tutorial was rewritten to show how this works. We are aware that these classes might have been used in RooWorkspaces that were written to disk. If you face problems because of that, please reach out to the RooFit developers by opening a [GitHub issue](https://github.com/root-project/root/issues) or posting on the [ROOT forum](https://root-forum.cern.ch/).
* The **TMPIFile** class and the associated `mpi` build option (not to be confused with `minuit2_mpi`, which is unaffected) have been removed.


Expand Down
13 changes: 13 additions & 0 deletions roofit/codegen/inc/RooFit/CodegenImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,20 @@ void codegenImpl(RooLognormal &arg, CodegenContext &ctx);
void codegenImpl(RooMultiPdf &arg, CodegenContext &ctx);
void codegenImpl(RooMultiVarGaussian &arg, CodegenContext &ctx);
void codegenImpl(RooONNXFunc &arg, CodegenContext &ctx);
// Support for the deprecated RooParamHistFunc, to be removed in ROOT 6.46
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void codegenImpl(RooParamHistFunc &arg, CodegenContext &ctx);
#ifdef _MSC_VER
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif
void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
void codegenImpl(RooPolynomial &arg, CodegenContext &ctx);
Expand Down
13 changes: 13 additions & 0 deletions roofit/codegen/src/CodegenImpl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,14 @@ void codegenImpl(RooFit::Detail::RooNormalizedPdf &arg, CodegenContext &ctx)
ctx.addResult(&arg, ctx.getResult(arg.pdf()) + "/" + ctx.getResult(arg.normIntegral()));
}

// Support for the deprecated RooParamHistFunc, to be removed in ROOT 6.46
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void codegenImpl(RooParamHistFunc &arg, CodegenContext &ctx)
{
std::string const &idx = arg.dataHist().calculateTreeIndexForCodeSquash(ctx, arg.xList());
Expand All @@ -720,6 +728,11 @@ void codegenImpl(RooParamHistFunc &arg, CodegenContext &ctx)
}
ctx.addResult(&arg, result.str());
}
#ifdef _MSC_VER
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif

void codegenImpl(RooPoisson &arg, CodegenContext &ctx)
{
Expand Down
5 changes: 4 additions & 1 deletion roofit/roofit/inc/RooHistConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#include <RooAbsPdf.h>
#include <RooListProxy.h>

class RooHistConstraint : public RooAbsPdf {
class R__DEPRECATED(6, 46,
"Its functionality is too close to the HistFactory classes. Please constrain the parameters of "
"the HistFactory class ParamHistFunc with one RooPoisson per bin instead, as shown in the "
"rf709_BarlowBeeston tutorial.") RooHistConstraint : public RooAbsPdf {
public:
RooHistConstraint() {} ;
RooHistConstraint(const char *name, const char *title, const RooArgSet& phfSet, int threshold=1000000);
Expand Down
5 changes: 4 additions & 1 deletion roofit/roofit/inc/RooParamHistFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
#include "RooDataHist.h"
#include <list>

class RooParamHistFunc : public RooAbsReal {
class R__DEPRECATED(6, 46,
"Its functionality is too close to the HistFactory classes. Please use the HistFactory class "
"ParamHistFunc instead, multiplying it with a RooHistFunc, as shown in the rf709_BarlowBeeston "
"tutorial.") RooParamHistFunc : public RooAbsReal {
public:
RooParamHistFunc() {} ;
RooParamHistFunc(const char *name, const char *title, RooDataHist &dh, const RooAbsArg &x,
Expand Down
22 changes: 20 additions & 2 deletions roofit/roofit/src/RooHistConstraint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@

/** \class RooHistConstraint
* \ingroup Roofit
*
* \deprecated RooHistConstraint will be removed in ROOT 6.46, because its functionality is too close to the
* HistFactory classes. Please constrain the parameters of the HistFactory class ParamHistFunc with one RooPoisson
* per bin instead, as shown in the rf709_BarlowBeeston tutorial.
*
* The RooHistConstraint implements constraint terms for a binned PDF with statistical uncertainties.
* Following the Barlow-Beeston method, it adds Poisson constraints for each bin that
* constrain the statistical uncertainty of the template histogram.
*
* It can therefore be used to estimate the Monte Carlo uncertainty of a fit.
*
* Check also the tutorial rf709_BarlowBeeston.C
*
*/

#include <RooHistConstraint.h>
Expand All @@ -27,6 +30,15 @@

#include <Math/PdfFuncMathCore.h>

// RooHistConstraint is deprecated together with RooParamHistFunc, which it is
// built on, so its implementation necessarily refers to the deprecated class.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

////////////////////////////////////////////////////////////////////////////////
/// Create a new RooHistConstraint.
Expand Down Expand Up @@ -219,3 +231,9 @@ double RooHistConstraint::getLogVal(const RooArgSet* /*set*/) const

return sum ;
}

#ifdef _MSC_VER
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif
13 changes: 13 additions & 0 deletions roofit/roofit/src/RooLagrangianMorphFunc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,14 @@ RooRealVar *RooLagrangianMorphFunc::setupObservable(const char *obsname, TClass
obsExists = true;
}

// Support for the deprecated RooParamHistFunc, to be removed in ROOT 6.46
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
if (mode && mode->InheritsFrom(RooHistFunc::Class())) {
obs = static_cast<RooRealVar *>(dynamic_cast<RooHistFunc *>(inputExample)->getHistObsList().first());
obsExists = true;
Expand All @@ -1619,6 +1627,11 @@ RooRealVar *RooLagrangianMorphFunc::setupObservable(const char *obsname, TClass
obsExists = true;
_observables.add(*obs);
}
#ifdef _MSC_VER
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif

// Note: "found!" will be printed if s2 is a substring of s1, both s1 and s2
// are of type std::string. s1.find(s2)
Expand Down
7 changes: 5 additions & 2 deletions roofit/roofit/src/RooParamHistFunc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

/** \class RooParamHistFunc
* \ingroup Roofit
*
* \deprecated RooParamHistFunc will be removed in ROOT 6.46, because its functionality is too close to the
* HistFactory classes. Please use the HistFactory class ParamHistFunc instead, multiplying it with a RooHistFunc,
* as shown in the rf709_BarlowBeeston tutorial.
*
* A histogram function that assigns scale parameters to every bin. Instead of the bare bin contents,
* it therefore yields:
* \f[
Expand All @@ -19,8 +24,6 @@
* The \f$ \gamma_i \f$ can therefore be used to parametrise statistical uncertainties of the histogram
* template. In conjunction with a constraint term, this can be used to implement the Barlow-Beeston method.
* The constraint can be implemented using RooHistConstraint.
*
* See also the tutorial rf709_BarlowBeeston.C
*/

#include <RooParamHistFunc.h>
Expand Down
7 changes: 7 additions & 0 deletions roofit/roofit/test/testRooParamHistFunc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

#include <numeric>

// RooParamHistFunc is deprecated, but still tested until its removal in ROOT 6.46
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

TEST(RooParamHistFunc, Integration)
{
// This tests the analytical integration of RooParamHistFunc,
Expand Down
Loading
Loading