Warning, file /include/root/RooFitResult.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_FIT_RESULT
0017 #define ROO_FIT_RESULT
0018
0019 #include "RooAbsArg.h"
0020 #include "RooPrintable.h"
0021 #include "RooDirItem.h"
0022 #include "RooArgList.h"
0023
0024 #include "RVersion.h"
0025 #include "TMatrixFfwd.h"
0026 #include "TMatrixDSym.h"
0027 #include "TList.h"
0028
0029 #include <vector>
0030 #include <string>
0031 #include <utility>
0032
0033 class RooArgSet ;
0034 class RooAbsPdf ;
0035 class RooPlot;
0036 class TObject ;
0037 class TH2 ;
0038 typedef RooArgSet* pRooArgSet ;
0039
0040 class RooFitResult : public TNamed, public RooPrintable, public RooDirItem {
0041 public:
0042
0043
0044 RooFitResult(const char* name=nullptr, const char* title=nullptr) ;
0045 RooFitResult(const RooFitResult& other) ;
0046 TObject* Clone(const char* newname = nullptr) const override {
0047 RooFitResult* r = new RooFitResult(*this) ;
0048 if (newname && *newname) r->SetName(newname) ;
0049 return r ;
0050 }
0051 virtual TObject* clone() const { return new RooFitResult(*this); }
0052 ~RooFitResult() override ;
0053
0054 static RooFitResult* lastMinuitFit(const RooArgList& varList=RooArgList()) ;
0055
0056 static RooFitResult *prefitResult(const RooArgList ¶mList);
0057
0058
0059 void printValue(std::ostream& os) const override ;
0060 void printName(std::ostream& os) const override ;
0061 void printTitle(std::ostream& os) const override ;
0062 void printClassName(std::ostream& os) const override ;
0063 void printArgs(std::ostream& os) const override ;
0064 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
0065
0066 inline void Print(Option_t *options= nullptr) const override {
0067
0068 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
0069 }
0070
0071 Int_t defaultPrintContents(Option_t* opt) const override ;
0072 StyleOption defaultPrintStyle(Option_t* opt) const override ;
0073
0074 RooAbsPdf* createHessePdf(const RooArgSet& params) const ;
0075
0076
0077
0078 inline Int_t status() const {
0079 return _status ;
0080 }
0081
0082 inline UInt_t numStatusHistory() const { return _statusHistory.size() ; }
0083 Int_t statusCodeHistory(UInt_t icycle) const ;
0084 const char* statusLabelHistory(UInt_t icycle) const ;
0085
0086
0087 inline Int_t covQual() const {
0088 return _covQual ;
0089 }
0090
0091 inline Int_t numInvalidNLL() const {
0092 return _numBadNLL ;
0093 }
0094
0095 inline double edm() const {
0096 return _edm ;
0097 }
0098
0099 inline double minNll() const {
0100 return _minNLL ;
0101 }
0102
0103 inline const RooArgList& constPars() const {
0104 return *_constPars ;
0105 }
0106
0107 inline const RooArgList& floatParsInit() const {
0108 return *_initPars ;
0109 }
0110
0111 inline const RooArgList& floatParsFinal() const {
0112 return *_finalPars ;
0113 }
0114
0115 TH2* correlationHist(const char* name = "correlation_matrix") const ;
0116
0117
0118 double correlation(const RooAbsArg& par1, const RooAbsArg& par2) const {
0119 return correlation(par1.GetName(),par2.GetName()) ;
0120 }
0121
0122 const RooArgList* correlation(const RooAbsArg& par) const {
0123 return correlation(par.GetName()) ;
0124 }
0125
0126 double correlation(const char* parname1, const char* parname2) const ;
0127 const RooArgList* correlation(const char* parname) const ;
0128
0129
0130 const TMatrixDSym& covarianceMatrix() const ;
0131 const TMatrixDSym& correlationMatrix() const ;
0132 TMatrixDSym reducedCovarianceMatrix(const RooArgList& params) const ;
0133 TMatrixDSym conditionalCovarianceMatrix(const RooArgList& params) const ;
0134
0135
0136
0137 double globalCorr(const RooAbsArg& par) { return globalCorr(par.GetName()) ; }
0138 double globalCorr(const char* parname) ;
0139 const RooArgList* globalCorr() ;
0140
0141
0142
0143
0144 inline RooPlot *plotOn(RooPlot *frame, const RooAbsArg &par1, const RooAbsArg &par2,
0145 const char *options= "ME") const {
0146 return plotOn(frame,par1.GetName(),par2.GetName(),options);
0147 }
0148 RooPlot *plotOn(RooPlot *plot, const char *parName1, const char *parName2,
0149 const char *options= "ME") const;
0150
0151
0152 const RooArgList& randomizePars() const;
0153
0154 bool isIdenticalNoCov(const RooFitResult& other, double tol=1e-6, double tolErr=1e-3, bool verbose=true) const ;
0155 bool isIdentical(const RooFitResult& other, double tol=1e-6, double tolCorr=1e-4, bool verbose=true) const ;
0156
0157 void SetName(const char *name) override ;
0158 void SetNameTitle(const char *name, const char* title) override ;
0159
0160
0161
0162 void setCovarianceMatrix(TMatrixDSym& V) ;
0163 void setConstParList(const RooArgList& list) ;
0164 void setInitParList(const RooArgList& list) ;
0165 void setFinalParList(const RooArgList& list) ;
0166 inline void setMinNLL(double val) { _minNLL = val ; }
0167 inline void setEDM(double val) { _edm = val ; }
0168 inline void setStatus(Int_t val) { _status = val ; }
0169 inline void setCovQual(Int_t val) { _covQual = val ; }
0170 inline void setNumInvalidNLL(Int_t val) { _numBadNLL=val ; }
0171 void setStatusHistory(std::vector<std::pair<std::string,int> >& hist) { _statusHistory = hist ; }
0172 void fillCorrMatrix(const std::vector<double>& globalCC, const TMatrixDSym& corrs, const TMatrixDSym& covs) ;
0173
0174 protected:
0175
0176 void fillCorrMatrix() ;
0177 void fillLegacyCorrMatrix() const ;
0178 void fillPrefitCorrMatrix();
0179 double correlation(Int_t row, Int_t col) const;
0180 double covariance(Int_t row, Int_t col) const;
0181
0182 Int_t _status ;
0183 Int_t _covQual ;
0184 Int_t _numBadNLL ;
0185 double _minNLL ;
0186 double _edm ;
0187 RooArgList* _constPars = nullptr;
0188 RooArgList* _initPars = nullptr;
0189 RooArgList* _finalPars = nullptr;
0190
0191 mutable RooArgList* _globalCorr = nullptr;
0192 mutable TList _corrMatrix ;
0193
0194 mutable RooArgList *_randomPars = nullptr;
0195 mutable TMatrixF* _Lt = nullptr;
0196
0197 TMatrixDSym* _CM = nullptr;
0198 TMatrixDSym* _VM = nullptr;
0199 TVectorD* _GC = nullptr;
0200
0201 std::vector<std::pair<std::string,int> > _statusHistory ;
0202
0203 ClassDefOverride(RooFitResult,5)
0204 };
0205
0206 #endif