Warning, file /include/root/RooCurve.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_CURVE
0017 #define ROO_CURVE
0018
0019 #include <RooPlotable.h>
0020
0021 #include <ROOT/RSpan.hxx>
0022
0023 #include <TGraph.h>
0024 #include <TMatrixDfwd.h>
0025
0026 #include <list>
0027 #include <vector>
0028
0029 class RooAbsReal;
0030 class RooRealVar;
0031 class RooAbsFunc;
0032 class RooArgSet;
0033 class RooAbsRealLValue ;
0034 class RooHist ;
0035
0036 class RooCurve : public TGraph, public RooPlotable {
0037 public:
0038 RooCurve();
0039 enum WingMode { NoWings=0 ,Straight=1, Extended=2 } ;
0040 RooCurve(const RooAbsReal &func, RooAbsRealLValue &x, double xlo, double xhi, Int_t xbins,
0041 double scaleFactor= 1, const RooArgSet *normVars= nullptr, double prec= 1e-3, double resolution= 1e-3,
0042 bool shiftToZero=false, WingMode wmode=Extended, Int_t nEvalError=-1, Int_t doEEVal=false, double eeVal=0.0,
0043 bool showProgress=false);
0044 RooCurve(const char *name, const char *title, const RooAbsFunc &func, double xlo,
0045 double xhi, UInt_t minPoints, double prec= 1e-3, double resolution= 1e-3,
0046 bool shiftToZero=false, WingMode wmode=Extended, Int_t nEvalError=-1, Int_t doEEVal=false, double eeVal=0.0);
0047 ~RooCurve() override;
0048
0049 RooCurve(const char* name, const char* title, const RooCurve& c1, const RooCurve& c2, double scale1=1., double scale2=1.) ;
0050
0051 void addPoint(double x, double y);
0052
0053 double getFitRangeBinW() const override;
0054 double getFitRangeNEvt(double xlo, double xhi) const override ;
0055 double getFitRangeNEvt() const override;
0056
0057
0058 void printName(std::ostream& os) const override ;
0059 void printTitle(std::ostream& os) const override ;
0060 void printClassName(std::ostream& os) const override ;
0061 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override;
0062
0063 inline void Print(Option_t *options= nullptr) const override {
0064
0065 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
0066 }
0067
0068 double chiSquare(const RooHist& hist, int nFitParam) const ;
0069 Int_t findPoint(double value, double tolerance=1e-10) const ;
0070 double average(double lo, double hi) const ;
0071 double interpolate(double x, double tolerance=1e-10) const ;
0072
0073 bool isIdentical(const RooCurve& other, double tol=1e-6, bool verbose=true) const ;
0074
0075 RooCurve* makeErrorBand(const std::vector<RooCurve*>& variations, double Z=1) const ;
0076 RooCurve* makeErrorBand(const std::vector<RooCurve*>& plusVar, const std::vector<RooCurve*>& minusVar, const TMatrixD& V, double Z=1) const ;
0077
0078 static std::list<double>* plotSamplingHintForBinBoundaries(std::span<const double> boundaries, double xlo, double xhi);
0079
0080 protected:
0081
0082 void calcBandInterval(const std::vector<RooCurve*>& variations,Int_t i,double Z,double& lo, double& hi, bool approxGauss) const ;
0083 void calcBandInterval(const std::vector<RooCurve*>& plusVar, const std::vector<RooCurve*>& minusVar, Int_t i, const TMatrixD& V,
0084 double Z,double& lo, double& hi) const ;
0085
0086 void initialize();
0087 void addPoints(const RooAbsFunc &func, double xlo, double xhi,
0088 Int_t minPoints, double prec, double resolution, WingMode wmode,
0089 Int_t numee=0, bool doEEVal=false, double eeVal=0.0,std::list<double>* samplingHint=nullptr) ;
0090 void addRange(const RooAbsFunc& func, double x1, double x2, double y1,
0091 double y2, double minDy, double minDx,
0092 int numee, bool doEEVal, double eeVal, double epsilon);
0093
0094
0095 void shiftCurveToZero();
0096
0097 bool _showProgress = false;
0098
0099 private:
0100
0101
0102
0103
0104 static constexpr double relativeXEpsilon() { return 1e-9; }
0105
0106 ClassDefOverride(RooCurve,1)
0107 };
0108
0109 #endif