GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitTableWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitTableWidget.cpp 999 2013-07-25 11:58:59Z 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 für 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 "Riostream.h"
17 
18 #include "QFitItem.h"
19 #include "TGo4Fitter.h"
20 #include "TGo4FitGuiTypes.h"
21 
22 
23 QFitTableWidget::QFitTableWidget(QWidget *parent, const char* name)
24  : QFitWidget(parent, name)
25 {
26  setupUi(this);
27 }
28 
30 {
31  Table->setColumnCount(0);
32  Table->setRowCount(0);
33  Table->setEnabled(false);
34  if (GetItem())
35  if (GetItem()->ObjectType()==FitGui::ot_results) {
36  TGo4Fitter* fitter = dynamic_cast<TGo4Fitter*> (GetObject());
37  if (fitter==0) return;
38  Table->setColumnCount(1);
39  Table->setHorizontalHeaderItem(0, new QTableWidgetItem("Value"));
40  Table->setColumnWidth(0,150);
41  Table->setRowCount(fitter->GetNumResults()+2);
42  Table->setVerticalHeaderItem(0, new QTableWidgetItem("Fit function"));
43  Table->setItem(0,0, new QTableWidgetItem(QString::number(fitter->GetResultFF())));
44  Table->setVerticalHeaderItem(1, new QTableWidgetItem("NDF"));
45  Table->setItem(1,0, new QTableWidgetItem(QString::number(fitter->GetResultNDF())));
46 
47  for (Int_t n=0;n<fitter->GetNumResults();n++) {
48  Table->setVerticalHeaderItem(n+2, new QTableWidgetItem(QString("Result") + QString::number(n)));
49  Table->setItem(n+2, 0, new QTableWidgetItem(QString::number(fitter->GetResultValue(n))));
50  }
51  }
52 }
Int_t GetResultNDF() const
Int_t GetNumResults() const
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
Double_t GetResultFF() const
Double_t GetResultValue(Int_t n) const
virtual void FillSpecificData()
virtual QFitItem * GetItem()
Definition: QFitWidget.cpp:48
QFitTableWidget(QWidget *parent=0, const char *name=0)