23 #include "ui_vp1etaphicutform.h"
32 Ui::VP1EtaPhiCutForm
ui;
44 m_d->
ui.setupUi(
this);
57 connect(
m_d->
ui.phisectionwidget,SIGNAL(enabledPhiRangesChanged(
const QList<VP1Interval>&)),
83 if (!
m_d->
ui.checkBox_cut_etarange->isChecked()) {
84 return VP1Interval(-std::numeric_limits<double>::infinity(),std::numeric_limits<double>::infinity());
87 const double min =
m_d->
ui.doubleSpinBox_cut_etalower->value();
88 const double max =
m_d->
ui.doubleSpinBox_cut_etaupper->value();
96 if (
m_d->
ui.checkBox_etacut_excludeRange) {
108 QList<VP1Interval>
l;
110 if (!
m_d->
ui.checkBox_cut_phi && !
m_d->
ui.checkBox_phiCuts)
114 if ( !
m_d->
ui.checkBox_cut_phi->isChecked() && !
m_d->
ui.checkBox_phiCuts->isChecked() ) {
115 l <<
VP1Interval(-std::numeric_limits<double>::infinity(),std::numeric_limits<double>::infinity());
119 if (
m_d->
ui.checkBox_cut_phi->isChecked() && ( !
m_d->
ui.phisectionwidget ||
m_d->
ui.phisectionwidget->allSectorsOff() ) )
122 if (
m_d->
ui.checkBox_cut_phi->isChecked() &&
m_d->
ui.phisectionwidget->allSectorsOn() ) {
123 l <<
VP1Interval(-std::numeric_limits<double>::infinity(),std::numeric_limits<double>::infinity());
125 }
else if (
m_d->
ui.checkBox_cut_phi->isChecked() ) {
126 return m_d->
ui.phisectionwidget->enabledPhiRanges();
128 if (
m_d->
ui.checkBox_phiCuts->isChecked() ) {
129 double phi_min =
m_d->
ui.dsb_phiCuts_min->value();
130 double phi_max =
m_d->
ui.dsb_phiCuts_max->value();
131 return m_d->
ui.phisectionwidget->enabledPhiRanges(phi_min, phi_max);
142 ui.doubleSpinBox_cut_etalower->setMaximum(0.0);
143 ui.doubleSpinBox_cut_etaupper->setMinimum(0.0);
145 const double rangemax =
ui.doubleSpinBox_cut_etaupper->maximum();
146 ui.doubleSpinBox_cut_etalower->setMaximum(rangemax);
147 ui.doubleSpinBox_cut_etaupper->setMinimum(-rangemax);
154 if (!
m_d->
ui.checkBox_cut_etarange_forcesymmetric)
156 if (sender()==
m_d->
ui.checkBox_cut_etarange_forcesymmetric) {
159 if (
m_d->
ui.checkBox_cut_etarange_forcesymmetric->isChecked()) {
161 const double eta =
std::max(fabs(
m_d->
ui.doubleSpinBox_cut_etalower->value()),fabs(
m_d->
ui.doubleSpinBox_cut_etaupper->value()));
162 m_d->
ui.doubleSpinBox_cut_etalower->setValue(-
eta);
163 m_d->
ui.doubleSpinBox_cut_etaupper->setValue(
eta);
165 }
else if (
m_d->
ui.checkBox_cut_etarange_forcesymmetric->isChecked()) {
167 if (sender()==
m_d->
ui.doubleSpinBox_cut_etalower) {
168 m_d->
ui.doubleSpinBox_cut_etaupper->setValue(-
m_d->
ui.doubleSpinBox_cut_etalower->value());
169 }
else if (sender()==
m_d->
ui.doubleSpinBox_cut_etaupper) {
170 m_d->
ui.doubleSpinBox_cut_etalower->setValue(-
m_d->
ui.doubleSpinBox_cut_etaupper->value());
194 if (sender()==
m_d->
ui.checkBox_phiCuts) {
195 if (
m_d->
ui.checkBox_phiCuts->isChecked() )
m_d->
ui.checkBox_cut_phi->setChecked(
false);
196 }
else if (sender()==
m_d->
ui.checkBox_cut_phi) {
197 if (
m_d->
ui.checkBox_cut_phi->isChecked() )
m_d->
ui.checkBox_phiCuts->setChecked(
false);
206 QList<VP1Interval> newAllowedPhi =
allowedPhi();
212 for(
int i=0;
i<newAllowedPhi.count();++
i)
213 s+= newAllowedPhi.at(
i).toString()+(
i==newAllowedPhi.count()-1?
"":
", ");
222 if (
b==
m_d->
ui.checkBox_cut_etarange->isChecked())
224 m_d->
ui.checkBox_cut_etarange->setChecked(
b);
238 m_d->
ui.checkBox_cut_etarange->setChecked(
b);
239 m_d->
ui.widget_etacut->setVisible(
b);
244 m_d->
ui.checkBox_cut_phi->setChecked(
b);
245 m_d->
ui.widget_phicut->setVisible(
b);
252 const double rangemax =
m_d->
ui.doubleSpinBox_cut_etaupper->maximum();
262 bool save = blockSignals(
true);
263 bool save1 =
m_d->
ui.doubleSpinBox_cut_etalower->blockSignals(
true);
264 bool save2 =
m_d->
ui.doubleSpinBox_cut_etaupper->blockSignals(
true);
265 bool save3 =
m_d->
ui.checkBox_cut_etarange->blockSignals(
true);
266 bool save4 =
m_d->
ui.checkBox_cut_etarange_forcesymmetric->blockSignals(
true);
268 m_d->
ui.checkBox_cut_etarange->setChecked(
true);
269 m_d->
ui.checkBox_cut_etarange_forcesymmetric->setChecked(
e1==-
e2);
271 m_d->
ui.doubleSpinBox_cut_etalower->setValue(
e1);
272 m_d->
ui.doubleSpinBox_cut_etaupper->setValue(
e2);
275 m_d->
ui.doubleSpinBox_cut_etalower->blockSignals(save1);
276 m_d->
ui.doubleSpinBox_cut_etaupper->blockSignals(save2);
277 m_d->
ui.checkBox_cut_etarange->blockSignals(save3);
278 m_d->
ui.checkBox_cut_etarange_forcesymmetric->blockSignals(save4);
311 state.
restore(
m_d->
ui.checkBox_cut_etarange_forcesymmetric);