File indexing completed on 2025-01-18 10:10:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_ROOFIT_TESTSTATISTICS_likelihood_builders
0014 #define ROOT_ROOFIT_TESTSTATISTICS_likelihood_builders
0015
0016 #include <RooGlobalFunc.h>
0017 #include <RooFit/TestStatistics/RooAbsL.h>
0018
0019 #include <memory>
0020
0021
0022 class RooAbsPdf;
0023 class RooAbsData;
0024
0025 namespace RooFit {
0026 namespace TestStatistics {
0027
0028 class NLLFactory {
0029 public:
0030 NLLFactory(RooAbsPdf &pdf, RooAbsData &data);
0031 std::unique_ptr<RooAbsL> build();
0032
0033 NLLFactory &Extended(RooAbsL::Extended extended);
0034 NLLFactory &ConstrainedParameters(const RooArgSet &constrainedParameters);
0035 NLLFactory &ExternalConstraints(const RooArgSet &externalconstraints);
0036 NLLFactory &GlobalObservables(const RooArgSet &globalObservables);
0037 NLLFactory &GlobalObservablesTag(const char *globalObservablesTag);
0038 NLLFactory &EvalBackend(RooFit::EvalBackend evalBackend);
0039
0040 private:
0041 std::vector<std::unique_ptr<RooAbsL>> getSimultaneousComponents();
0042
0043 RooAbsPdf &_pdf;
0044 RooAbsData &_data;
0045
0046 RooAbsL::Extended _extended = RooAbsL::Extended::Auto;
0047 RooArgSet _constrainedParameters;
0048 RooArgSet _externalConstraints;
0049 RooArgSet _globalObservables;
0050 std::string _globalObservablesTag;
0051 RooFit::EvalBackend _evalBackend = RooFit::EvalBackend::Legacy();
0052 };
0053
0054
0055 inline std::unique_ptr<RooAbsL> buildLikelihood(RooAbsPdf *pdf, RooAbsData *data)
0056 {
0057 return NLLFactory{*pdf, *data}.build();
0058 }
0059
0060 }
0061 }
0062
0063 #endif