GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitTableWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitTableWidget.cpp 3116 2021-03-30 06:51:49Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "QFitTableWidget.h"
15 
16 #include "QFitItem.h"
17 #include "TGo4Fitter.h"
18 #include "TGo4FitGuiTypes.h"
19 
20 QFitTableWidget::QFitTableWidget(QWidget *parent, const char* name)
21  : QFitWidget(parent, name)
22 {
23  setupUi(this);
24 }
25 
27 {
28  Table->setColumnCount(0);
29  Table->setRowCount(0);
30  Table->setEnabled(false);
31  if (GetItem())
32  if (GetItem()->ObjectType()==FitGui::ot_results) {
33  TGo4Fitter* fitter = dynamic_cast<TGo4Fitter*> (GetObject());
34  if (fitter==0) return;
35  Table->setColumnCount(1);
36  Table->setHorizontalHeaderItem(0, new QTableWidgetItem("Value"));
37  Table->setColumnWidth(0,150);
38  Table->setRowCount(fitter->GetNumResults()+2);
39  Table->setVerticalHeaderItem(0, new QTableWidgetItem("Fit function"));
40  Table->setItem(0,0, new QTableWidgetItem(QString::number(fitter->GetResultFF())));
41  Table->setVerticalHeaderItem(1, new QTableWidgetItem("NDF"));
42  Table->setItem(1,0, new QTableWidgetItem(QString::number(fitter->GetResultNDF())));
43 
44  for (Int_t n=0;n<fitter->GetNumResults();n++) {
45  Table->setVerticalHeaderItem(n+2, new QTableWidgetItem(QString("Result") + QString::number(n)));
46  Table->setItem(n+2, 0, new QTableWidgetItem(QString::number(fitter->GetResultValue(n))));
47  }
48  }
49 }
Int_t GetResultNDF() const
Int_t GetNumResults() const
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
Double_t GetResultFF() const
Double_t GetResultValue(Int_t n) const
virtual void FillSpecificData()
virtual QFitItem * GetItem()
Definition: QFitWidget.cpp:46
QFitTableWidget(QWidget *parent=0, const char *name=0)