71 TNamed(name,title), _constPars(0), _initPars(0), _finalPars(0), _globalCorr(0), _randomPars(0), _Lt(0),
72 _CM(0), _VM(0), _GC(0)
201 <<
" ERROR request for status history slot " 202 << icycle <<
" exceeds history count of " <<
_statusHistory.size() << endl ;
215 <<
" ERROR request for status history slot " 216 << icycle <<
" exceeds history count of " <<
_statusHistory.size() << endl ;
249 const char *options)
const 254 coutE(
InputArguments) <<
"RooFitResult::correlationPlot: parameter not floated in fit: " << parName1 << endl;
259 coutE(
InputArguments) <<
"RooFitResult::correlationPlot: parameter not floated in fit: " << parName2 << endl;
264 TString opt(options);
275 if(opt.Contains(
"E")) {
282 if(opt.Contains(
"1")) {
288 if(opt.Contains(
"2")) {
294 if(opt.Contains(
"B")) {
302 if(opt.Contains(
"H")) {
308 if(opt.Contains(
"A")) {
309 TGaxis *axis=
new TGaxis(x1-s1,x2-s2,x1+s1,x2-s2,-1.,+1.,502,
"-=");
315 if(opt.Contains(
"V")) {
321 if(opt.Contains(
"A")) {
322 TGaxis *axis=
new TGaxis(x1-s1,x2-s2,x1-s1,x2+s2,-1.,+1.,502,
"-=");
329 if(opt.Contains(
"M")) {
356 for(
Int_t iPar= 0; iPar < nPar; iPar++) {
359 for(
Int_t k= 0; k < iPar; k++) {
361 L(iPar,iPar)-= tmp*tmp;
363 L(iPar,iPar)=
sqrt(
L(iPar,iPar));
365 for(
Int_t jPar= iPar+1; jPar < nPar; jPar++) {
367 for(
Int_t k= 0; k < iPar; k++) {
368 L(iPar,jPar)-=
L(k,iPar)*
L(k,jPar);
370 L(iPar,jPar)/=
L(iPar,iPar);
407 coutE(
InputArguments) <<
"RooFitResult::correlation(" <<
GetName() <<
") parameter " << parname1 <<
" is not a floating fit parameter" << endl ;
411 coutE(
InputArguments) <<
"RooFitResult::correlation(" <<
GetName() <<
") parameter " << parname2 <<
" is not a floating fit parameter" << endl ;
431 coutE(
InputArguments) <<
"RooFitResult::correlation: variable " << parname <<
" not a floating parameter in fit" << endl ;
450 coutE(
InputArguments) <<
"RooFitResult::globalCorr: variable " << parname <<
" not a floating parameter in fit" << endl ;
482 return (*
_CM)(row,col) ;
491 return (*
_VM)(row,col) ;
505 << indent <<
" RooFitResult: minimized FCN value: " <<
_minNLL <<
", estimated distance to minimum: " <<
_edm << endl
506 << indent <<
" covariance matrix quality: " ;
508 case -1 : os <<
"Unknown, matrix was externally provided" ; break ;
509 case 0 : os <<
"Not calculated at all" ; break ;
510 case 1 : os <<
"Approximation only, not accurate" ; break ;
511 case 2 : os <<
"Full matrix, but forced positive-definite" ; break ;
512 case 3 : os <<
"Full, accurate covariance matrix" ; break ;
515 os << indent <<
" Status : " ;
517 os << iter->first <<
"=" << iter->second <<
" " ;
519 os << endl << endl ;;
524 os << indent <<
" Constant Parameter Value " << endl
525 << indent <<
" -------------------- ------------" << endl ;
546 os << indent <<
" Floating Parameter InitialValue FinalValue (+HiError,-LoError) GblCorr." << endl
547 << indent <<
" -------------------- ------------ ---------------------------------- --------" << endl ;
549 os << indent <<
" Floating Parameter InitialValue FinalValue +/- Error GblCorr." << endl
550 << indent <<
" -------------------- ------------ -------------------------- --------" << endl ;
563 os << (doAsymErr?
" ":
"") <<
" +/- " << setw(9) <<
Form(
"%9.2e",err) ;
576 os << indent <<
" Floating Parameter FinalValue +/- Error " << endl
577 << indent <<
" -------------------- --------------------------" << endl ;
583 <<
" +/- " << setw(9) <<
Form(
"%9.2e",err)
600 coutI(
Minimization) <<
"RooFitResult::fillCorrMatrix: number of floating parameters is zero, correlation matrix not filled" << endl ;
605 coutE(
Minimization) <<
"RooFitResult::fillCorrMatrix: ERROR: list of initial parameters must be filled first" << endl ;
619 (*_GC)[i] = globalCC[i] ;
647 TString gcName(
"GC[") ;
648 gcName.Append(arg->
GetName()) ;
651 gcTitle.Append(
" Global Correlation") ;
664 TString cName(
"C[") ;
667 cName.Append(arg2->
GetName()) ;
669 TString cTitle(
"Correlation between ") ;
670 cTitle.Append(arg->
GetName()) ;
671 cTitle.Append(
" and ") ;
672 cTitle.Append(arg2->
GetName()) ;
683 for (
unsigned int i = 0; i < (
unsigned int)
_CM->
GetNcols() ; ++i) {
691 for (
unsigned int it = 0; it < (
unsigned int)
_CM->
GetNcols() ; ++it) {
693 double value = (*_CM)(i,it) ;
695 (*_CM)(i,it) = value;
718 coutI(
Minimization) <<
"RooFitResult::fillCorrMatrix: number of floating parameters is zero, correlation matrix not filled" << endl ;
723 coutE(
Minimization) <<
"RooFitResult::fillCorrMatrix: ERROR: list of initial parameters must be filled first" << endl ;
748 ndex = m*(m-1) / 2 + n;
802 cout <<
"RooFitResult::isIdentical: minimized value of -log(L) is different " <<
_minNLL <<
" vs. " << other.
_minNLL << endl ;
809 cout <<
"RooFitResult::isIdentical: cannot find constant parameter " <<
_constPars->
at(i)->
GetName() <<
" in reference" << endl ;
822 cout <<
"RooFitResult::isIdentical: cannot find initial parameter " <<
_initPars->
at(i)->
GetName() <<
" in reference" << endl ;
826 cout <<
"RooFitResult::isIdentical: initial parameter " <<
_initPars->
at(i)->
GetName()
835 cout <<
"RooFitResult::isIdentical: cannot find final parameter " <<
_finalPars->
at(i)->
GetName() <<
" in reference" << endl ;
854 cout <<
"RooFitResult::isIdentical: cannot find global correlation coefficient " <<
_globalCorr->
at(i)->
GetName() <<
" in reference" << endl ;
858 cout <<
"RooFitResult::isIdentical: global correlation coefficient " <<
_globalCorr->
at(i)->
GetName()
870 cout <<
"RooFitResult::isIdentical: cannot find correlation coefficient " << row->
at(i)->
GetName() <<
" in reference" << endl ;
873 if (ov &&
fabs(static_cast<RooAbsReal*>(row->
at(i))->getVal()-ov->
getVal())>=tolCorr) {
874 cout <<
"RooFitResult::isIdentical: correlation coefficient " << row->
at(i)->
GetName()
875 <<
" differs in value: " <<
static_cast<RooAbsReal*
>(row->
at(i))->getVal() <<
" vs. " << ov->
getVal() << endl ;
896 <<
" or match the number of variables of the last fit (" <<
gMinuit->
fNu <<
")" << endl ;
904 if (!dynamic_cast<RooRealVar*>(arg)) {
933 if ((xlo<xhi) && !isConst) {
934 var =
new RooRealVar(varName,varName,xval,xlo,xhi) ;
947 if (varName.CompareTo(var->
GetName())) {
948 oocoutI((
TObject*)0,
Eval) <<
"RooFitResult::lastMinuitFit: fit parameter '" << varName
949 <<
"' stored in variable '" << var->
GetName() <<
"'" << endl ;
962 Int_t icode,npari,nparx ;
990 if (!dynamic_cast<RooRealVar *>(arg)) {
992 <<
"' is not of type RooRealVar" << endl;
1067 TH2D* hh =
new TH2D(name,name,n,0,n,n,0,n) ;
1069 for (
Int_t i = 0 ; i<
n ; i++) {
1070 for (
Int_t j = 0 ; j<
n; j++) {
1071 hh->
Fill(i+0.5,n-j-0.5,(*
_CM)(i,j)) ;
1115 << arg->
GetName() <<
" was not a floating parameters in fit result and is ignored" << endl ;
1122 vector<int> indexMap(params2.
getSize());
1123 for (
int i=0 ; i<params2.
getSize() ; i++) {
1125 assert(indexMap[i] < V.
GetNrows());
1129 for (
int i = 0; i < Vred.GetNrows(); ++i) {
1130 for (
int j = 0; j < Vred.GetNcols(); ++j) {
1131 Vred(i,j) = V( indexMap[i], indexMap[j]);
1162 coutE(
Eval) <<
"RooFitResult::conditionalCovarianceMatrix(" <<
GetName() <<
") ERROR: covariance matrix is not positive definite (|V|=" 1163 << det <<
") cannot reduce it" << endl ;
1164 throw string(
"RooFitResult::conditionalCovarianceMatrix() ERROR, input covariance matrix is not positive definite") ;
1176 << arg->
GetName() <<
" was not a floating parameters in fit result and is ignored" << endl ;
1192 vector<int> map1, map2 ;
1212 TMatrixD S22bar = S11 - S12 * (S22Inv * S21) ;
1216 for (
int i=0 ; i<Vred.GetNcols() ; i++) {
1217 for (
int j=i ; j<Vred.GetNcols() ; j++) {
1218 Vred(i,j) = (S22bar(i,j) + S22bar(j,i))/2 ;
1219 Vred(j,i) = Vred(i,j) ;
1248 coutE(
Eval) <<
"RooFitResult::createHessePdf(" <<
GetName() <<
") ERROR: covariance matrix is not positive definite (|V|=" 1249 << det <<
") cannot construct p.d.f" << endl ;
1262 << arg->
GetName() <<
" was not a floating parameters in fit result and is ignored" << endl ;
1301 vector<int> map1, map2 ;
1318 for (
UInt_t i=0 ; i<map1.size() ; i++) {
1321 mu1.
add(*parclone) ;
1329 TMatrixD S22bar = S11 - S12 * (S22Inv * S21) ;
1333 for (
int i=0 ; i<Vred.GetNcols() ; i++) {
1334 for (
int j=i ; j<Vred.GetNcols() ; j++) {
1335 Vred(i,j) = (S22bar(i,j) + S22bar(j,i))/2 ;
1336 Vred(j,i) = Vred(i,j) ;
1395 os << IsA()->GetName() ;
1432 if (!opt || strlen(opt)==0) {
1442 void RooFitResult::Streamer(
TBuffer &R__b)
1453 TNamed::Streamer(R__b);
1454 RooPrintable::Streamer(R__b);
1455 RooDirItem::Streamer(R__b);
1474 TIterator *gcIter = _globalCorr->createIterator() ;
1475 TIterator *parIter = _finalPars->createIterator() ;
1477 for (
unsigned int i = 0; i < (
unsigned int)
_CM->
GetNcols() ; ++i) {
1481 (*_GC)(i) = gcVal->
getVal() ;
1485 for (
unsigned int it = 0; it < (
unsigned int)
_CM->
GetNcols() ; ++it) {
1487 double value = cVal->
getVal() ;
1488 (*_CM)(it,i) = value ;
1489 (*_CM)(i,it) = value;
1490 (*_VM)(it,i) = value*((
RooRealVar*)_finalPars->at(i))->getError()*((
RooRealVar*)_finalPars->at(it))->getError() ;
1491 (*_VM)(i,it) = (*_VM)(it,i) ;
const TMatrixDSym & correlationMatrix() const
Return correlation matrix ;.
virtual const char * GetName() const
Returns name of object.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void mnstat(Double_t &fmin, Double_t &fedm, Double_t &errdef, Int_t &npari, Int_t &nparx, Int_t &istat)
Returns concerning the current status of the minimization.
RooPlot * plotOn(RooPlot *frame, const RooAbsArg &par1, const RooAbsArg &par2, const char *options="ME") const
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual void printArgs(std::ostream &os) const
Print arguments of fit result, i.e. the parameters of the fit.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TMatrixDSym conditionalCovarianceMatrix(const RooArgList ¶ms) const
Return a reduced covariance matrix, which is calculated as ___ -1 Vred = V22 = V11 - V12 * V22 * V21...
const RooArgList & floatParsFinal() const
virtual void printClassName(std::ostream &os) const
Print class name of fit result.
const RooArgList & randomizePars() const
Return a list of floating parameter values that are perturbed from the final fit values by random amo...
virtual void SetMaximum(Double_t maximum=-1111)
TMatrixDSym reducedCovarianceMatrix(const RooArgList ¶ms) const
Return a reduced covariance matrix (Note that Vred is a simple sub-matrix of V, row/columns are order...
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
static Double_t gaussian(TRandom *generator=randomGenerator())
Return a Gaussian random variable with mean 0 and variance 1.
static void blockDecompose(const TMatrixD &input, const std::vector< int > &map1, const std::vector< int > &map2, TMatrixDSym &S11, TMatrixD &S12, TMatrixD &S21, TMatrixDSym &S22)
Block decomposition of covI according to given maps of observables.
static void ioStreamerPass2Finalize()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Int_t index(const RooAbsArg *arg) const
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Double_t getVal(const RooArgSet *set=0) const
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
void fillLegacyCorrMatrix() const
Sanity check.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void SetNameTitle(const char *name, const char *title)
Change name and title of RooFitResult object.
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
Buffer base class used for serializing objects.
void setStatus(Int_t val)
virtual void SetMinimum(Double_t minimum=-1111)
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Short_t Min(Short_t a, Short_t b)
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Int_t defaultPrintContents(Option_t *opt) const
Configure default contents to be printed.
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
A RooEllipse is a two-dimensional ellipse that can be used to represent an error contour.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void setInitParList(const RooArgList &list)
Fill the list of initial values of the floating parameters.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Iterator abstract base class.
virtual void printValue(std::ostream &os) const
Print the value of the fit result, i.e.g the status, minimized FCN, edm and covariance quality code...
void setEDM(Double_t val)
Int_t GetNoElements() const
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Configure mapping of Print() arguments to RooPrintable print styles.
void fillPrefitCorrMatrix()
void appendToDir(TObject *obj, Bool_t forceMemoryResident=kFALSE)
Append object to directory.
static const double x2[5]
R__EXTERN TMinuit * gMinuit
RooAbsPdf * createHessePdf(const RooArgSet ¶ms) const
Return a p.d.f that represents the fit result as a multi-variate probability densisty function on the...
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods...
const char * statusLabelHistory(UInt_t icycle) const
The TNamed class is the base class for all named ROOT classes.
void deleteSharedProperties()
No longer used?
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
static constexpr double L
virtual TList * GetList() const
TVectorT< Double_t > TVectorD
RooRealVar represents a fundamental (non-derived) real valued object.
TH2 * correlationHist(const char *name="correlation_matrix") const
Return TH2D of correlation matrix.
void setMinNLL(Double_t val)
TList _corrMatrix
List of global correlation coefficients.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TMatrixDSym * _CM
triangular matrix used for generate random perturbations
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual Double_t Determinant() const
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
Service class for 2-Dim histogram classes.
TString * fCpnam
Character to be plotted at the X,Y contour positions.
Double_t covariance(Int_t row, Int_t col) const
Return the covariance matrix element addressed with numeric indices.
RooAbsArg * at(Int_t idx) const
void setConstant(Bool_t value=kTRUE)
static RooFitResult * lastMinuitFit(const RooArgList &varList=RooArgList())
Import the results of the last fit performed by gMinuit, interpreting the fit parameters as the given...
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Int_t statusCodeHistory(UInt_t icycle) const
char * Form(const char *fmt,...)
virtual ~RooFitResult()
Destructor.
void setFinalParList(const RooArgList &list)
Fill the list of final values of the floating parameters.
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print fit result to stream 'os'.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
RooFitResult(const char *name=0, const char *title=0)
Constructor with name and title coverity[UNINIT_CTOR].
void removeFromDir(TObject *obj)
Remove object from directory it was added to.
TMatrixF * _Lt
List of floating parameters with most recent random perturbation applied.
void SetName(const char *name)
Change name of RooFitResult object.
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Multivariate Gaussian p.d.f.
RooArgList * _randomPars
Correlation matrix (list of RooArgLists)
void setConstParList(const RooArgList &list)
Fill the list of constant parameters.
static const double x1[5]
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooDirItem is a utility base class for RooFit objects that are to be attached to ROOT directories...
TMatrixTSym< Double_t > TMatrixDSym
virtual void printName(std::ostream &os) const
Print name of fit result.
virtual StyleOption defaultPrintStyle(Option_t *opt) const
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
TMatrixT< Float_t > TMatrix
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
Mother of all ROOT objects.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
const RooArgList & constPars() const
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual void Add(TObject *obj)
virtual void RemoveAll(TCollection *col)
Remove all objects in collection col from this collection.
Short_t Max(Short_t a, Short_t b)
virtual TObject * Next()=0
const RooArgList * globalCorr()
Return the list of all global correlations.
static RooFitResult * prefitResult(const RooArgList ¶mList)
Import the results of the last fit performed by gMinuit, interpreting the fit parameters as the given...
void setCovQual(Int_t val)
Double_t Sqrt(Double_t x)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual Int_t GetSize() const
void fillCorrMatrix()
Internal utility method to extract the correlation matrix and the global correlation coefficients fro...
Int_t Fill(Double_t)
Invalid Fill method.
Double_t getError() const
void setCovarianceMatrix(TMatrixDSym &V)
Store externally provided correlation matrix in this RooFitResult ;.
Double_t correlation(const RooAbsArg &par1, const RooAbsArg &par2) const
Bool_t isConstant() const
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Bool_t isIdentical(const RooFitResult &other, Double_t tol=5e-5, Double_t tolCorr=1e-4, Bool_t verbose=kTRUE) const
Return true if this fit result is identical to other within tolerance 'tol' on fitted values and tole...
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
std::vector< std::pair< std::string, int > > _statusHistory
void setError(Double_t value)
2-D histogram with a double per channel (see TH1 documentation)}
static constexpr double g
virtual void printTitle(std::ostream &os) const
Print title of fit result.