GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitPeakFinderWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitPeakFinderWidget.cpp 1134 2014-01-22 14:53:40Z 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 "QFitPeakFinderWidget.h"
15 
16 #include "TGo4FitPeakFinder.h"
17 
18 QFitPeakFinderWidget::QFitPeakFinderWidget(QWidget *parent, const char* name)
19  : QFitNamedWidget(parent, name)
20 {
21  setupUi(this);
22 }
23 
25  return dynamic_cast<TGo4FitPeakFinder*> (GetObject());
26 }
27 
30  TGo4FitPeakFinder* finder = GetPF();
31  if (finder) {
32  DataNameEdt->setText(finder->GetDataName());
33  ClearModelsChk->setChecked(finder->GetClearModels());
34 
35  UsePolynChk->setChecked(finder->GetUsePolynom());
36  PolynSpin->setValue(finder->GetPolynomOrder());
37  PolynSpin->setEnabled(finder->GetUsePolynom());
38 
39  FindersTab->setCurrentIndex(finder->GetPeakFinderType());
40 
41  ThresholdEdt->setText(QString::number(finder->Get0MaxAmplFactor()));
42  MinWidthEdt->setText(QString::number(finder->Get0MinWidth()));
43  MaxWidthEdt->setText(QString::number(finder->Get0MaxWidth()));
44 
45  WidthEdit->setText(QString::number(finder->Get1LineWidth()));
46 
47  NoiseFactorEdit->setText(QString::number(finder->Get2NoiseFactor()));
48  NoiseMinEdit->setText(QString::number(finder->Get2NoiseMinimum()));
49  SumUpSpin->setValue(finder->Get2ChannelSum());
50  }
51 }
52 
53 
55 {
56  if (!fbFillWidget && GetPF())
57  GetPF()->SetDataName(name.toLatin1().constData());
58 }
59 
60 
62 {
63  if (!fbFillWidget && GetPF())
64  GetPF()->SetClearModels(zn);
65 }
66 
67 
69 {
70  if (!fbFillWidget && GetPF()) {
71  GetPF()->SetUsePolynom(zn);
72  PolynSpin->setEnabled(zn);
73  }
74 }
75 
76 
78 {
79  if (!fbFillWidget && GetPF())
80  GetPF()->SetPolynomOrder(zn);
81 }
82 
83 
85 {
86  if (!fbFillWidget && GetPF())
87  GetPF()->SetPeakFinderType(indx);
88 }
89 
90 
92 {
93  if (!fbFillWidget && GetPF()) {
94  bool ok = false;
95  double zn = value.toDouble(&ok);
96  if (ok && (zn>0) && (zn<=1.)) GetPF()->Set0MaxAmplFactor(zn);
97  }
98 }
99 
100 
102 {
103  if (!fbFillWidget && GetPF()) {
104  bool ok = false;
105  double zn = value.toDouble(&ok);
106  if (ok && (zn>=0)) GetPF()->Set0MinWidth(zn);
107  }
108 }
109 
110 
112 {
113  if (!fbFillWidget && GetPF()) {
114  bool ok = false;
115  double zn = value.toDouble(&ok);
116  if (ok && (zn>0)) GetPF()->Set0MaxWidth(zn);
117  }
118 }
119 
120 
121 void QFitPeakFinderWidget::WidthEdit_textChanged( const QString & value )
122 {
123  if (!fbFillWidget && GetPF()) {
124  bool ok = false;
125  double zn = value.toDouble(&ok);
126  if (ok && (zn>0)) GetPF()->Set1LineWidth(zn);
127  }
128 }
129 
130 
132 {
133  if (!fbFillWidget && GetPF()) {
134  bool ok = false;
135  double zn = value.toDouble(&ok);
136  if (ok && (zn>0)) GetPF()->Set2NoiseFactor(zn);
137  }
138 }
139 
140 
142 {
143  if (!fbFillWidget && GetPF()) {
144  bool ok = false;
145  double zn = value.toDouble(&ok);
146  if (ok && (zn>=0)) GetPF()->Set2NoiseMinimum(zn);
147  }
148 }
149 
150 
152 {
153  if (!fbFillWidget && GetPF())
154  GetPF()->Set2ChannelSum(zn);
155 }
Double_t Get1LineWidth()
virtual void MaxWidthEdt_textChanged(const QString &)
virtual TGo4FitPeakFinder * GetPF()
void Set2NoiseFactor(Double_t factor)
QFitPeakFinderWidget(QWidget *parent=0, const char *name=0)
void SetDataName(const char *name)
void Set2NoiseMinimum(Double_t min)
Double_t Get2NoiseFactor()
bool fbFillWidget
Definition: QFitWidget.h:64
void SetPeakFinderType(Int_t typ)
virtual void DataNameEdt_textChanged(const QString &)
const char * GetDataName()
Double_t Get0MaxAmplFactor()
virtual void WidthEdit_textChanged(const QString &)
void Set0MaxWidth(Double_t max)
void Set0MaxAmplFactor(Double_t factor)
virtual void MinWidthEdt_textChanged(const QString &)
void Set2ChannelSum(Int_t sum)
Double_t Get2NoiseMinimum()
virtual void ThresholdEdt_textChanged(const QString &)
virtual void SumUpSpin_valueChanged(int)
void SetUsePolynom(Bool_t use)
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
void Set1LineWidth(Double_t width)
void SetClearModels(Bool_t clear)
virtual void UsePolynChk_toggled(bool)
virtual void NoiseFactorEdit_textChanged(const QString &)
virtual void PolynSpin_valueChanged(int)
virtual void NoiseMinEdit_textChanged(const QString &)
virtual void FillSpecificData()
virtual void ClearModelsChk_toggled(bool)
void SetPolynomOrder(Int_t order)
void Set0MinWidth(Double_t min)
virtual void FindersTab_currentChanged(int)