Warning, file /include/root/RooRealIntegral.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_REAL_INTEGRAL
0017 #define ROO_REAL_INTEGRAL
0018
0019 #include <RooAbsPdf.h>
0020 #include <RooAbsReal.h>
0021 #include <RooArgSet.h>
0022 #include <RooListProxy.h>
0023 #include <RooRealProxy.h>
0024 #include <RooSetProxy.h>
0025
0026 class RooAbsIntegrator;
0027 class RooNumIntConfig;
0028
0029 class RooRealIntegral : public RooAbsReal {
0030 public:
0031
0032
0033 RooRealIntegral() ;
0034 RooRealIntegral(const char *name, const char *title, const RooAbsReal& function, const RooArgSet& depList,
0035 const RooArgSet* funcNormSet=nullptr, const RooNumIntConfig* config=nullptr, const char* rangeName=nullptr) ;
0036 RooRealIntegral(const RooRealIntegral& other, const char* name=nullptr);
0037 TObject* clone(const char* newname) const override { return new RooRealIntegral(*this,newname); }
0038 ~RooRealIntegral() override;
0039
0040 double getValV(const RooArgSet* set=nullptr) const override ;
0041
0042 bool isValid() const override { return _valid; }
0043
0044 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
0045 void printMetaArgs(std::ostream& os) const override ;
0046
0047 const RooArgSet& numIntCatVars() const { return _sumList ; }
0048 const RooArgSet& numIntRealVars() const { return _intList ; }
0049 const RooArgSet& anaIntVars() const { return _anaList ; }
0050
0051 RooArgSet intVars() const { RooArgSet tmp(_sumList) ; tmp.add(_intList) ; tmp.add(_anaList) ; tmp.add(_facList) ; return tmp ; }
0052 const char* intRange() const { return _rangeName ? _rangeName->GetName() : nullptr ; }
0053 const RooAbsReal& integrand() const { return *_function; }
0054
0055 void setCacheNumeric(bool flag) {
0056
0057 _cacheNum = flag ;
0058 }
0059
0060 bool getCacheNumeric() {
0061
0062 return _cacheNum ;
0063 }
0064
0065 static void setCacheAllNumeric(Int_t ndim) ;
0066
0067 static Int_t getCacheAllNumeric() ;
0068
0069 std::list<double>* plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const override {
0070
0071 return _function->plotSamplingHint(obs,xlo,xhi) ;
0072 }
0073
0074 RooFit::OwningPtr<RooAbsReal> createIntegral(const RooArgSet& iset, const RooArgSet* nset=nullptr, const RooNumIntConfig* cfg=nullptr, const char* rangeName=nullptr) const override ;
0075
0076 void setAllowComponentSelection(bool allow);
0077 bool getAllowComponentSelection() const;
0078
0079 std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
0080
0081 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0082
0083 inline RooArgSet const* funcNormSet() const { return _funcNormSet.get(); }
0084
0085 protected:
0086
0087 mutable bool _valid = false;
0088 bool _respectCompSelect = true;
0089
0090 const RooArgSet& parameters() const ;
0091
0092 enum IntOperMode { Hybrid, Analytic, PassThrough } ;
0093
0094
0095 bool initNumIntegrator() const;
0096 void autoSelectDirtyMode() ;
0097
0098 virtual double sum() const ;
0099 virtual double integrate() const ;
0100 virtual double jacobianProduct() const ;
0101
0102
0103 double evaluate() const override ;
0104 bool isValidReal(double value, bool printError=false) const override ;
0105
0106 bool redirectServersHook(const RooAbsCollection& newServerList,
0107 bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0108
0109
0110
0111
0112 inline RooArgSet const* actualFuncNormSet() const {
0113 return _funcNormSet ? _funcNormSet.get() : _function.nset();
0114 }
0115
0116
0117 RooSetProxy _sumList;
0118 RooSetProxy _intList;
0119 RooSetProxy _anaList;
0120 RooSetProxy _jacList;
0121 RooSetProxy _facList;
0122
0123 RooRealProxy _function ;
0124 std::unique_ptr<RooArgSet> _funcNormSet;
0125
0126 RooArgSet _saveInt;
0127 RooArgSet _saveSum;
0128
0129 RooNumIntConfig* _iconfig = nullptr;
0130
0131 RooListProxy _sumCat ;
0132
0133 Int_t _mode = 0;
0134 IntOperMode _intOperMode = Hybrid;
0135
0136 mutable bool _restartNumIntEngine = false;
0137 mutable std::unique_ptr<RooAbsIntegrator> _numIntEngine;
0138 mutable std::unique_ptr<RooAbsFunc> _numIntegrand;
0139
0140 TNamed* _rangeName = nullptr;
0141
0142 mutable std::unique_ptr<RooArgSet> _params;
0143
0144 bool _cacheNum = false;
0145 static Int_t _cacheAllNDim ;
0146
0147 private:
0148 void addNumIntDep(RooAbsArg const &arg);
0149
0150 ClassDefOverride(RooRealIntegral,5)
0151 };
0152
0153 #endif