Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:26

0001 /*
0002  * Project: RooFit
0003  * Authors:
0004  *   PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl
0005  *
0006  * Copyright (c) 2021, CERN
0007  *
0008  * Redistribution and use in source and binary forms,
0009  * with or without modification, are permitted according to the terms
0010  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
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 // forward declarations
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 /// Delegating function to build a likelihood without additional arguments.
0055 inline std::unique_ptr<RooAbsL> buildLikelihood(RooAbsPdf *pdf, RooAbsData *data)
0056 {
0057    return NLLFactory{*pdf, *data}.build();
0058 }
0059 
0060 } // namespace TestStatistics
0061 } // namespace RooFit
0062 
0063 #endif // ROOT_ROOFIT_TESTSTATISTICS_likelihood_builders