GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitPeakFinderWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitPeakFinderWidget.cpp 3114 2021-03-30 06:39:32Z 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 "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  QObject::connect(DataNameEdt, SIGNAL(textChanged(QString)), this, SLOT(DataNameEdt_textChanged(QString)));
23  QObject::connect(ClearModelsChk, SIGNAL(toggled(bool)), this, SLOT(ClearModelsChk_toggled(bool)));
24  QObject::connect(UsePolynChk, SIGNAL(toggled(bool)), this, SLOT(UsePolynChk_toggled(bool)));
25  QObject::connect(PolynSpin, SIGNAL(valueChanged(int)), this, SLOT(PolynSpin_valueChanged(int)));
26  QObject::connect(FindersTab, SIGNAL(currentChanged(int)), this, SLOT(FindersTab_currentChanged(int)));
27  QObject::connect(ThresholdEdt, SIGNAL(textChanged(QString)), this, SLOT(ThresholdEdt_textChanged(QString)));
28  QObject::connect(MinWidthEdt, SIGNAL(textChanged(QString)), this, SLOT(MinWidthEdt_textChanged(QString)));
29  QObject::connect(MaxWidthEdt, SIGNAL(textChanged(QString)), this, SLOT(MaxWidthEdt_textChanged(QString)));
30  QObject::connect(WidthEdit, SIGNAL(textChanged(QString)), this, SLOT(WidthEdit_textChanged(QString)));
31  QObject::connect(NoiseFactorEdit, SIGNAL(textChanged(QString)), this, SLOT(NoiseFactorEdit_textChanged(QString)));
32  QObject::connect(NoiseMinEdit, SIGNAL(textChanged(QString)), this, SLOT(NoiseMinEdit_textChanged(QString)));
33  QObject::connect(SumUpSpin, SIGNAL(valueChanged(int)), this, SLOT(SumUpSpin_valueChanged(int)));
34 }
35 
37 {
38  return dynamic_cast<TGo4FitPeakFinder*> (GetObject());
39 }
40 
42 {
44  TGo4FitPeakFinder* finder = GetPF();
45  if (finder) {
46  DataNameEdt->setText(finder->GetDataName());
47  ClearModelsChk->setChecked(finder->GetClearModels());
48 
49  UsePolynChk->setChecked(finder->GetUsePolynom());
50  PolynSpin->setValue(finder->GetPolynomOrder());
51  PolynSpin->setEnabled(finder->GetUsePolynom());
52 
53  FindersTab->setCurrentIndex(finder->GetPeakFinderType());
54 
55  ThresholdEdt->setText(QString::number(finder->Get0MaxAmplFactor()));
56  MinWidthEdt->setText(QString::number(finder->Get0MinWidth()));
57  MaxWidthEdt->setText(QString::number(finder->Get0MaxWidth()));
58 
59  WidthEdit->setText(QString::number(finder->Get1LineWidth()));
60 
61  NoiseFactorEdit->setText(QString::number(finder->Get2NoiseFactor()));
62  NoiseMinEdit->setText(QString::number(finder->Get2NoiseMinimum()));
63  SumUpSpin->setValue(finder->Get2ChannelSum());
64  }
65 }
66 
67 
69 {
70  if (!fbFillWidget && GetPF())
71  GetPF()->SetDataName(name.toLatin1().constData());
72 }
73 
74 
76 {
77  if (!fbFillWidget && GetPF())
78  GetPF()->SetClearModels(zn);
79 }
80 
81 
83 {
84  if (!fbFillWidget && GetPF()) {
85  GetPF()->SetUsePolynom(zn);
86  PolynSpin->setEnabled(zn);
87  }
88 }
89 
90 
92 {
93  if (!fbFillWidget && GetPF())
94  GetPF()->SetPolynomOrder(zn);
95 }
96 
97 
99 {
100  if (!fbFillWidget && GetPF())
101  GetPF()->SetPeakFinderType(indx);
102 }
103 
104 
106 {
107  if (!fbFillWidget && GetPF()) {
108  bool ok = false;
109  double zn = value.toDouble(&ok);
110  if (ok && (zn>0) && (zn<=1.)) GetPF()->Set0MaxAmplFactor(zn);
111  }
112 }
113 
114 
116 {
117  if (!fbFillWidget && GetPF()) {
118  bool ok = false;
119  double zn = value.toDouble(&ok);
120  if (ok && (zn>=0)) GetPF()->Set0MinWidth(zn);
121  }
122 }
123 
124 
126 {
127  if (!fbFillWidget && GetPF()) {
128  bool ok = false;
129  double zn = value.toDouble(&ok);
130  if (ok && (zn>0)) GetPF()->Set0MaxWidth(zn);
131  }
132 }
133 
134 
135 void QFitPeakFinderWidget::WidthEdit_textChanged( const QString & value )
136 {
137  if (!fbFillWidget && GetPF()) {
138  bool ok = false;
139  double zn = value.toDouble(&ok);
140  if (ok && (zn>0)) GetPF()->Set1LineWidth(zn);
141  }
142 }
143 
144 
146 {
147  if (!fbFillWidget && GetPF()) {
148  bool ok = false;
149  double zn = value.toDouble(&ok);
150  if (ok && (zn>0)) GetPF()->Set2NoiseFactor(zn);
151  }
152 }
153 
154 
156 {
157  if (!fbFillWidget && GetPF()) {
158  bool ok = false;
159  double zn = value.toDouble(&ok);
160  if (ok && (zn>=0)) GetPF()->Set2NoiseMinimum(zn);
161  }
162 }
163 
164 
166 {
167  if (!fbFillWidget && GetPF())
168  GetPF()->Set2ChannelSum(zn);
169 }
virtual void MaxWidthEdt_textChanged(const QString &)
virtual TGo4FitPeakFinder * GetPF()
Int_t GetPeakFinderType() const
void Set2NoiseFactor(Double_t factor)
QFitPeakFinderWidget(QWidget *parent=0, const char *name=0)
Double_t Get0MinWidth() const
void SetDataName(const char *name)
void Set2NoiseMinimum(Double_t min)
bool fbFillWidget
Definition: QFitWidget.h:63
void SetPeakFinderType(Int_t typ)
virtual void DataNameEdt_textChanged(const QString &)
Bool_t GetUsePolynom() const
Double_t Get2NoiseMinimum() const
Int_t Get2ChannelSum() const
const char * GetDataName()
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 Get2NoiseFactor() const
virtual void ThresholdEdt_textChanged(const QString &)
Double_t Get1LineWidth() const
virtual void SumUpSpin_valueChanged(int)
void SetUsePolynom(Bool_t use)
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
Double_t Get0MaxWidth() const
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 &)
Double_t Get0MaxAmplFactor() const
virtual void FillSpecificData()
virtual void ClearModelsChk_toggled(bool)
void SetPolynomOrder(Int_t order)
void Set0MinWidth(Double_t min)
Int_t GetPolynomOrder() const
virtual void FindersTab_currentChanged(int)