Warning, file /include/root/RooNumIntFactory.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_NUM_INT_FACTORY
0017 #define ROO_NUM_INT_FACTORY
0018
0019 #include <map>
0020 #include <string>
0021 #include "TObject.h"
0022 #include "RooLinkedList.h"
0023 #include "RooAbsIntegrator.h"
0024
0025 #include <functional>
0026
0027 class RooNumIntConfig ;
0028 class RooAbsFunc ;
0029
0030 class RooNumIntFactory ;
0031 typedef void (*RooNumIntInitializerFunc)(RooNumIntFactory&) ;
0032
0033 class RooNumIntFactory : public TObject {
0034 public:
0035
0036 RooNumIntFactory(const RooNumIntFactory& other) = delete;
0037
0038 using Creator = std::function<std::unique_ptr<RooAbsIntegrator>(RooAbsFunc const& function, const RooNumIntConfig& config)>;
0039
0040 static RooNumIntFactory& instance() ;
0041
0042 bool registerPlugin(std::string const &name, Creator const &creator, const RooArgSet &defConfig, bool canIntegrate1D,
0043 bool canIntegrate2D, bool canIntegrateND, bool canIntegrateOpenEnded, const char *depName = "");
0044
0045 std::string getIntegratorName(RooAbsFunc& func, const RooNumIntConfig& config, int ndim=0, bool isBinned=false) const;
0046 std::unique_ptr<RooAbsIntegrator> createIntegrator(RooAbsFunc& func, const RooNumIntConfig& config, int ndim=0, bool isBinned=false) const;
0047
0048
0049 private:
0050
0051 friend class RooNumIntConfig ;
0052
0053 struct PluginInfo {
0054 Creator creator;
0055 bool canIntegrate1D = false;
0056 bool canIntegrate2D = false;
0057 bool canIntegrateND = false;
0058 bool canIntegrateOpenEnded = false;
0059 std::string depName;
0060 };
0061
0062 PluginInfo const* getPluginInfo(std::string const& name) const
0063 {
0064 auto item = _map.find(name);
0065 return item == _map.end() ? nullptr : &item->second;
0066 }
0067
0068 std::map<std::string,PluginInfo> _map;
0069
0070 RooNumIntFactory() {}
0071
0072 void init();
0073
0074
0075 ClassDefOverride(RooNumIntFactory, 0)
0076 };
0077
0078 #endif