GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
QFitPeakFinderWidget.cpp
Go to the documentation of this file.
1// $Id$
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
15
16#include "TGo4FitPeakFinder.h"
17
18QFitPeakFinderWidget::QFitPeakFinderWidget(QWidget *parent, const char *name)
19 : QFitNamedWidget(parent, name)
20{
21 setupUi(this);
22 QObject::connect(DataNameEdt, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::DataNameEdt_textChanged);
23 QObject::connect(ClearModelsChk, &QCheckBox::toggled, this, &QFitPeakFinderWidget::ClearModelsChk_toggled);
24 QObject::connect(UsePolynChk, &QCheckBox::toggled, this, &QFitPeakFinderWidget::UsePolynChk_toggled);
25 QObject::connect(PolynSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &QFitPeakFinderWidget::PolynSpin_valueChanged);
26 QObject::connect(FindersTab, &QTabWidget::currentChanged, this, &QFitPeakFinderWidget::FindersTab_currentChanged);
27 QObject::connect(ThresholdEdt, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::ThresholdEdt_textChanged);
28 QObject::connect(MinWidthEdt, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::MinWidthEdt_textChanged);
29 QObject::connect(MaxWidthEdt, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::MaxWidthEdt_textChanged);
30 QObject::connect(WidthEdit, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::WidthEdit_textChanged);
31 QObject::connect(NoiseFactorEdit, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::NoiseFactorEdit_textChanged);
32 QObject::connect(NoiseMinEdit, &QGo4LineEdit::textChanged, this, &QFitPeakFinderWidget::NoiseMinEdit_textChanged);
33 QObject::connect(SumUpSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &QFitPeakFinderWidget::SumUpSpin_valueChanged);
34}
35
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
80
81
83{
84 if (!fbFillWidget && GetPF()) {
85 GetPF()->SetUsePolynom(zn);
86 PolynSpin->setEnabled(zn);
87 }
88}
89
90
96
97
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))
121 GetPF()->Set0MinWidth(zn);
122 }
123}
124
126{
127 if (!fbFillWidget && GetPF()) {
128 bool ok = false;
129 double zn = value.toDouble(&ok);
130 if (ok && (zn > 0))
131 GetPF()->Set0MaxWidth(zn);
132 }
133}
134
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))
161 GetPF()->Set2NoiseMinimum(zn);
162 }
163}
164
165
167{
168 if (!fbFillWidget && GetPF())
169 GetPF()->Set2ChannelSum(zn);
170}
QFitNamedWidget(QWidget *parent=nullptr, const char *name=nullptr)
void FillSpecificData() override
virtual void ThresholdEdt_textChanged(const QString &)
virtual void FindersTab_currentChanged(int)
virtual void MaxWidthEdt_textChanged(const QString &)
virtual void NoiseMinEdit_textChanged(const QString &)
virtual void MinWidthEdt_textChanged(const QString &)
virtual void UsePolynChk_toggled(bool)
virtual void ClearModelsChk_toggled(bool)
virtual void DataNameEdt_textChanged(const QString &)
virtual TGo4FitPeakFinder * GetPF()
virtual void SumUpSpin_valueChanged(int)
virtual void NoiseFactorEdit_textChanged(const QString &)
virtual void PolynSpin_valueChanged(int)
QFitPeakFinderWidget(QWidget *parent=nullptr, const char *name=nullptr)
virtual void WidthEdit_textChanged(const QString &)
virtual TObject * GetObject()
bool fbFillWidget
Definition QFitWidget.h:63
Peak finder action.
void Set0MinWidth(Double_t min)
Double_t Get0MaxAmplFactor() const
Double_t Get1LineWidth() const
const char * GetDataName() const
Bool_t GetUsePolynom() const
Int_t GetPeakFinderType() const
void SetPolynomOrder(Int_t order)
Bool_t GetClearModels() const
Double_t Get2NoiseFactor() const
void Set0MaxWidth(Double_t max)
Double_t Get0MaxWidth() const
void Set0MaxAmplFactor(Double_t factor)
void SetPeakFinderType(Int_t typ)
Int_t Get2ChannelSum() const
void Set2NoiseFactor(Double_t factor)
Double_t Get2NoiseMinimum() const
void SetDataName(const char *name)
void SetClearModels(Bool_t clear)
void Set1LineWidth(Double_t width)
void Set2ChannelSum(Int_t sum)
void SetUsePolynom(Bool_t use)
Double_t Get0MinWidth() const
void Set2NoiseMinimum(Double_t min)
Int_t GetPolynomOrder() const