Warning, file /include/root/TFoamSampler.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 #ifndef ROOT_TFoamSampler
0013 #define ROOT_TFoamSampler
0014
0015
0016 #include "Math/DistSampler.h"
0017
0018
0019 namespace ROOT {
0020
0021 namespace Fit {
0022
0023 class DataRange;
0024 class BinData;
0025 class UnBinData;
0026 }
0027
0028 namespace Math {
0029 }
0030 }
0031
0032 class TFoamIntegrand;
0033
0034
0035 class TRandom;
0036 class TF1;
0037 class TFoam;
0038
0039 class TFoamSampler : public ROOT::Math::DistSampler {
0040
0041 public:
0042
0043
0044 TFoamSampler();
0045
0046
0047
0048 ~TFoamSampler() override;
0049
0050
0051 using DistSampler::SetFunction;
0052
0053
0054 void SetFunction(const ROOT::Math::IGenFunction & func) override {
0055 fFunc1D = &func;
0056 SetFunction<const ROOT::Math::IGenFunction>(func, 1);
0057 }
0058
0059
0060 void SetFunction(TF1 * pdf);
0061
0062
0063
0064
0065
0066 bool Init(const char * = "") override;
0067
0068
0069
0070
0071 bool Init(const ROOT::Math::DistSamplerOptions & opt ) override;
0072
0073
0074
0075
0076
0077 void SetRandom(TRandom * r) override;
0078
0079
0080
0081
0082
0083
0084 void SetSeed(unsigned int seed) override;
0085
0086
0087
0088
0089
0090 TRandom * GetRandom() override;
0091
0092
0093
0094
0095
0096
0097 bool Sample(double * x) override;
0098
0099
0100
0101
0102
0103
0104
0105 bool SampleBin(double prob, double & value, double *error = nullptr) override;
0106
0107
0108
0109 protected:
0110
0111
0112 private:
0113
0114
0115
0116
0117
0118
0119 const ROOT::Math::IGenFunction * fFunc1D;
0120 TFoam * fFoam;
0121 TFoamIntegrand * fFoamDist;
0122
0123
0124
0125 };
0126
0127
0128
0129 #endif