ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataSysController.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Implementation of class VP1RawDataSysController //
9// //
10// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11// Initial version: January 2009 //
12// //
14
15#define VP1IMPVARNAME m_d
16
18#include "ui_vp1rawdatacontrollerform.h"
19#include "ui_rawdata_settings_display_form.h"
20#include "ui_rawdata_settings_interactions_form.h"
21#include "ui_rawdata_settings_cuts_form.h"
25
26#include "GaudiKernel/SystemOfUnits.h"
27
28#include <QCursor>
29#include <QDialog>
30#include <QGuiApplication>
31#include <QScreen>
32
33#include <cmath>
34
35
36//____________________________________________________________________
38public:
39 Ui::VP1RawDataControllerForm ui{};
40 Ui::RawDataSysSettingsCutsForm ui_cuts{};
41 Ui::RawDataSysSettingsInteractionsForm ui_int{};
42 Ui::RawDataSysSettingsDisplayForm ui_display{};
44
46 QList<VP1Interval> last_cutAllowedPhi;//All off: empty list. All on: list with one entry: ]-inf,inf[
50 VP1RawDataFlags::InDetPartsFlags last_enabledInDetParts;
51 bool last_trtRequireHT = false;
53 unsigned last_lucidMinQDC = 0U;
54 bool last_rpcShowEta = true;
55 bool last_rpcShowPhi = true;
61 bool last_tgcShowStrips = true;
62 bool last_tgcShowWires = true;
65 bool last_tgcShowNext = true;
70 bool last_stgcShowPads = true;
72 bool last_stgcShowWires = true;
75
82
83};
84
85//____________________________________________________________________
87 : VP1Controller(sys,"VP1RawDataSysController"), m_d(new Imp)
88{
89 m_d->ui.setupUi(this);
90
91 m_d->collWidget = new VP1CollectionWidget;
92 setupCollWidgetInScrollArea(m_d->ui.collWidgetScrollArea,m_d->collWidget);
93
94 initDialog(m_d->ui_display, m_d->ui.pushButton_settings_display);
95 initDialog(m_d->ui_int, m_d->ui.pushButton_settings_interactions);
96 // Keep long cut forms usable on small screens and with large desktop fonts.
97 auto cutsDialog = std::make_unique<QDialog>(nullptr, Qt::WindowStaysOnTopHint);
98 m_d->ui_cuts.setupUi(cutsDialog.get());
99 cutsDialog->setSizeGripEnabled(true);
100 cutsDialog->setMinimumSize(320, 240);
101 m_d->ui_cuts.cutsContentLayout->setAlignment(Qt::AlignTop);
102 QScreen* screen = QGuiApplication::screenAt(QCursor::pos());
103 if (!screen)
104 screen = QGuiApplication::primaryScreen();
105 const QSize preferredSize(520, 640);
106 cutsDialog->resize(screen ? preferredSize.boundedTo(screen->availableGeometry().size() * 0.85)
107 : preferredSize);
108 initDialog(std::move(cutsDialog), m_d->ui.pushButton_settings_cuts,
109 m_d->ui_cuts.pushButton_close);
110
111 m_d->ui_display.widget_drawOptions->setLineWidths(1.5);
112 m_d->ui_display.widget_drawOptions->setPointSizes(2.5);
113 m_d->ui_display.widget_drawOptions->setComplexityDisabled();
114
115 m_d->ui_cuts.etaPhiCutWidget->setEtaCutEnabled(false);
116
117 m_d->ui_display.matButton_trtht->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0));
118 m_d->ui_display.matButton_bcmhighatt->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0));
119
120
122 // Setup connections which monitor changes in the controller so that we may emit signals as appropriate: //
124
125 // -> cutAllowedEta:
127 connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedEtaChanged(const VP1Interval&)));
128
129 // -> cutAllowedPhi:
131 connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&)));
132
133 // -> showVolumeOutLines
135 connectToLastUpdateSlot(m_d->ui_display.checkBox_showVolumeOutLines);
136
137 // -> useSpecialTRTHTMaterial
139 connectToLastUpdateSlot(m_d->ui_display.checkBox_trtHTUseSpecialMat);
140
141 // -> useSpecialBCMHighAttMaterial
143 connectToLastUpdateSlot(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
144
145 // -> enabledInDetParts
147 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_barrelA);
148 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_barrelC);
149 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_endcapA);
150 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_endcapC);
151
152 // -> trtRequireHT
154 connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_needHT);
155
156 // -> trtAllowedToT
158 connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMin);
159 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
160 connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMax);
161 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
162
163 // -> lucidMinQDC
165 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_lucid_qdc_min);
166
168 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mdtAllowedADCMin);
169 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mdtAllowedADCMin);
170 connect(m_d->ui_cuts.checkBox_mdtAllowedADCMin, &QCheckBox::toggled,
171 m_d->ui_cuts.spinBox_mdtAllowedADCMin, &QDoubleSpinBox::setEnabled);
172 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mdtAllowedADCMax);
173 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mdtAllowedADCMax);
174 connect(m_d->ui_cuts.checkBox_mdtAllowedADCMax, &QCheckBox::toggled,
175 m_d->ui_cuts.spinBox_mdtAllowedADCMax, &QDoubleSpinBox::setEnabled);
177 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mdtAllowedTDCMin);
178 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mdtAllowedTDCMin);
179 connect(m_d->ui_cuts.checkBox_mdtAllowedTDCMin, &QCheckBox::toggled,
180 m_d->ui_cuts.spinBox_mdtAllowedTDCMin, &QDoubleSpinBox::setEnabled);
181 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mdtAllowedTDCMax);
182 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mdtAllowedTDCMax);
183 connect(m_d->ui_cuts.checkBox_mdtAllowedTDCMax, &QCheckBox::toggled,
184 m_d->ui_cuts.spinBox_mdtAllowedTDCMax, &QDoubleSpinBox::setEnabled);
186 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mmAllowedChargeMin);
187 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mmAllowedChargeMin);
188 connect(m_d->ui_cuts.checkBox_mmAllowedChargeMin, &QCheckBox::toggled,
189 m_d->ui_cuts.spinBox_mmAllowedChargeMin, &QDoubleSpinBox::setEnabled);
190 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mmAllowedChargeMax);
191 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mmAllowedChargeMax);
192 connect(m_d->ui_cuts.checkBox_mmAllowedChargeMax, &QCheckBox::toggled,
193 m_d->ui_cuts.spinBox_mmAllowedChargeMax, &QDoubleSpinBox::setEnabled);
195 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mmAllowedTimeMin);
196 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mmAllowedTimeMin);
197 connect(m_d->ui_cuts.checkBox_mmAllowedTimeMin, &QCheckBox::toggled,
198 m_d->ui_cuts.spinBox_mmAllowedTimeMin, &QDoubleSpinBox::setEnabled);
199 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mmAllowedTimeMax);
200 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_mmAllowedTimeMax);
201 connect(m_d->ui_cuts.checkBox_mmAllowedTimeMax, &QCheckBox::toggled,
202 m_d->ui_cuts.spinBox_mmAllowedTimeMax, &QDoubleSpinBox::setEnabled);
204 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcAllowedChargeMin);
205 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_stgcAllowedChargeMin);
206 connect(m_d->ui_cuts.checkBox_stgcAllowedChargeMin, &QCheckBox::toggled,
207 m_d->ui_cuts.spinBox_stgcAllowedChargeMin, &QDoubleSpinBox::setEnabled);
208 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcAllowedChargeMax);
209 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_stgcAllowedChargeMax);
210 connect(m_d->ui_cuts.checkBox_stgcAllowedChargeMax, &QCheckBox::toggled,
211 m_d->ui_cuts.spinBox_stgcAllowedChargeMax, &QDoubleSpinBox::setEnabled);
213 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcAllowedTimeMin);
214 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_stgcAllowedTimeMin);
215 connect(m_d->ui_cuts.checkBox_stgcAllowedTimeMin, &QCheckBox::toggled,
216 m_d->ui_cuts.spinBox_stgcAllowedTimeMin, &QDoubleSpinBox::setEnabled);
217 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcAllowedTimeMax);
218 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_stgcAllowedTimeMax);
219 connect(m_d->ui_cuts.checkBox_stgcAllowedTimeMax, &QCheckBox::toggled,
220 m_d->ui_cuts.spinBox_stgcAllowedTimeMax, &QDoubleSpinBox::setEnabled);
221
223 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_mdtExcludeMasked);
224
226 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcShowEta);
228 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcShowPhi);
230 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcShowPrimarySide);
232 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcShowOppositeSide);
234 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcKeepMissingToT);
236 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcAllowedTimeMin);
237 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_rpcAllowedTimeMin);
238 connect(m_d->ui_cuts.checkBox_rpcAllowedTimeMin, &QCheckBox::toggled,
239 m_d->ui_cuts.spinBox_rpcAllowedTimeMin, &QDoubleSpinBox::setEnabled);
240 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcAllowedTimeMax);
241 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_rpcAllowedTimeMax);
242 connect(m_d->ui_cuts.checkBox_rpcAllowedTimeMax, &QCheckBox::toggled,
243 m_d->ui_cuts.spinBox_rpcAllowedTimeMax, &QDoubleSpinBox::setEnabled);
245 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcAllowedToTMin);
246 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_rpcAllowedToTMin);
247 connect(m_d->ui_cuts.checkBox_rpcAllowedToTMin, &QCheckBox::toggled,
248 m_d->ui_cuts.spinBox_rpcAllowedToTMin, &QDoubleSpinBox::setEnabled);
249 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_rpcAllowedToTMax);
250 connectToLastUpdateSlot(m_d->ui_cuts.spinBox_rpcAllowedToTMax);
251 connect(m_d->ui_cuts.checkBox_rpcAllowedToTMax, &QCheckBox::toggled,
252 m_d->ui_cuts.spinBox_rpcAllowedToTMax, &QDoubleSpinBox::setEnabled);
253
255 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowStrips);
257 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowWires);
259 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowPrevious);
261 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowCurrent);
263 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowNext);
265 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowNextNext);
267 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowUndefined);
269 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_tgcShowUnknown);
271 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcShowPads);
273 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcShowStrips);
275 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcShowWires);
277 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcExcludeDead);
279 connectToLastUpdateSlot(m_d->ui_cuts.checkBox_stgcExcludePileup);
280
281 initLastVars();
282}
283
284//____________________________________________________________________
289
290
291//____________________________________________________________________
293{
294 return 6;
295}
296
297//____________________________________________________________________
299{
300 s.save(m_d->ui_cuts.etaPhiCutWidget);
301 s.save(m_d->ui_cuts.checkBox_cut_indet_barrelA);
302 s.save(m_d->ui_cuts.checkBox_cut_indet_barrelC);
303 s.save(m_d->ui_cuts.checkBox_cut_indet_endcapA);
304 s.save(m_d->ui_cuts.checkBox_cut_indet_endcapC);
305 s.save(m_d->ui_cuts.checkbox_cut_trt_needHT);
306 s.save(m_d->ui_cuts.checkbox_cut_trt_TotMin);
307 s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
308 s.save(m_d->ui_cuts.checkbox_cut_trt_TotMax);
309 s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
310 s.save(m_d->ui_display.checkBox_showVolumeOutLines);
311 s.save(m_d->ui_display.widget_drawOptions);
312 s.save(m_d->ui_display.checkBox_trtHTUseSpecialMat);
313 s.save(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
314 s.save(m_d->ui_display.matButton_trtht);
315 s.save(m_d->ui_display.matButton_bcmhighatt);
316 s.save(m_d->ui_int.checkBox_printinfo);
317 s.save(m_d->ui_int.checkBox_printinfo_verbose);
318 s.save(m_d->ui_int.checkBox_zoom);
319 s.save(m_d->ui_cuts.spinBox_lucid_qdc_min);//Version 1+
320 // Version 2: muon digit ranges.
321 s.save(m_d->ui_cuts.checkBox_mdtAllowedADCMin);
322 s.save(m_d->ui_cuts.spinBox_mdtAllowedADCMin);
323 s.save(m_d->ui_cuts.checkBox_mdtAllowedADCMax);
324 s.save(m_d->ui_cuts.spinBox_mdtAllowedADCMax);
325 s.save(m_d->ui_cuts.checkBox_mdtAllowedTDCMin);
326 s.save(m_d->ui_cuts.spinBox_mdtAllowedTDCMin);
327 s.save(m_d->ui_cuts.checkBox_mdtAllowedTDCMax);
328 s.save(m_d->ui_cuts.spinBox_mdtAllowedTDCMax);
329 s.save(m_d->ui_cuts.checkBox_mmAllowedChargeMin);
330 s.save(m_d->ui_cuts.spinBox_mmAllowedChargeMin);
331 s.save(m_d->ui_cuts.checkBox_mmAllowedChargeMax);
332 s.save(m_d->ui_cuts.spinBox_mmAllowedChargeMax);
333 s.save(m_d->ui_cuts.checkBox_mmAllowedTimeMin);
334 s.save(m_d->ui_cuts.spinBox_mmAllowedTimeMin);
335 s.save(m_d->ui_cuts.checkBox_mmAllowedTimeMax);
336 s.save(m_d->ui_cuts.spinBox_mmAllowedTimeMax);
337 s.save(m_d->ui_cuts.checkBox_stgcAllowedChargeMin);
338 s.save(m_d->ui_cuts.spinBox_stgcAllowedChargeMin);
339 s.save(m_d->ui_cuts.checkBox_stgcAllowedChargeMax);
340 s.save(m_d->ui_cuts.spinBox_stgcAllowedChargeMax);
341 s.save(m_d->ui_cuts.checkBox_stgcAllowedTimeMin);
342 s.save(m_d->ui_cuts.spinBox_stgcAllowedTimeMin);
343 s.save(m_d->ui_cuts.checkBox_stgcAllowedTimeMax);
344 s.save(m_d->ui_cuts.spinBox_stgcAllowedTimeMax);
345 s.save(m_d->ui_cuts.checkBox_mdtExcludeMasked);//Version 3+
346 // Version 4: sTGC channel types and status.
347 s.save(m_d->ui_cuts.checkBox_stgcShowPads);
348 s.save(m_d->ui_cuts.checkBox_stgcShowStrips);
349 s.save(m_d->ui_cuts.checkBox_stgcShowWires);
350 s.save(m_d->ui_cuts.checkBox_stgcExcludeDead);
351 s.save(m_d->ui_cuts.checkBox_stgcExcludePileup);
352 // Version 5: TGC channel types and bunch crossings.
353 s.save(m_d->ui_cuts.checkBox_tgcShowStrips);
354 s.save(m_d->ui_cuts.checkBox_tgcShowWires);
355 s.save(m_d->ui_cuts.checkBox_tgcShowPrevious);
356 s.save(m_d->ui_cuts.checkBox_tgcShowCurrent);
357 s.save(m_d->ui_cuts.checkBox_tgcShowNext);
358 s.save(m_d->ui_cuts.checkBox_tgcShowNextNext);
359 s.save(m_d->ui_cuts.checkBox_tgcShowUndefined);
360 s.save(m_d->ui_cuts.checkBox_tgcShowUnknown);
361 // Version 6: RPC view, side, time and optional ToT selections.
362 s.save(m_d->ui_cuts.checkBox_rpcShowEta);
363 s.save(m_d->ui_cuts.checkBox_rpcShowPhi);
364 s.save(m_d->ui_cuts.checkBox_rpcShowPrimarySide);
365 s.save(m_d->ui_cuts.checkBox_rpcShowOppositeSide);
366 s.save(m_d->ui_cuts.checkBox_rpcKeepMissingToT);
367 s.save(m_d->ui_cuts.checkBox_rpcAllowedTimeMin);
368 s.save(m_d->ui_cuts.spinBox_rpcAllowedTimeMin);
369 s.save(m_d->ui_cuts.checkBox_rpcAllowedTimeMax);
370 s.save(m_d->ui_cuts.spinBox_rpcAllowedTimeMax);
371 s.save(m_d->ui_cuts.checkBox_rpcAllowedToTMin);
372 s.save(m_d->ui_cuts.spinBox_rpcAllowedToTMin);
373 s.save(m_d->ui_cuts.checkBox_rpcAllowedToTMax);
374 s.save(m_d->ui_cuts.spinBox_rpcAllowedToTMax);
375
376
377
378
379}
380
381//____________________________________________________________________
383{
384 if (s.version()<0||s.version()>6) {
385 message("Warning: State data in .vp1 file has unsupported version ("+str(s.version())+")");
386 return;
387 }
388 s.restore(m_d->ui_cuts.etaPhiCutWidget);
389 s.restore(m_d->ui_cuts.checkBox_cut_indet_barrelA);
390 s.restore(m_d->ui_cuts.checkBox_cut_indet_barrelC);
391 s.restore(m_d->ui_cuts.checkBox_cut_indet_endcapA);
392 s.restore(m_d->ui_cuts.checkBox_cut_indet_endcapC);
393 s.restore(m_d->ui_cuts.checkbox_cut_trt_needHT);
394 s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMin);
395 s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
396 s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMax);
397 s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
398 s.restore(m_d->ui_display.checkBox_showVolumeOutLines);
399 s.restore(m_d->ui_display.widget_drawOptions);
400 s.restore(m_d->ui_display.checkBox_trtHTUseSpecialMat);
401 s.restore(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
402 s.restore(m_d->ui_display.matButton_trtht);
403 s.restore(m_d->ui_display.matButton_bcmhighatt);
404 s.restore(m_d->ui_int.checkBox_printinfo);
405 s.restore(m_d->ui_int.checkBox_printinfo_verbose);
406 s.restore(m_d->ui_int.checkBox_zoom);
407 if (s.version()>=1)
408 s.restore(m_d->ui_cuts.spinBox_lucid_qdc_min);
409 if (s.version() >= 2) {
410 s.restore(m_d->ui_cuts.checkBox_mdtAllowedADCMin);
411 s.restore(m_d->ui_cuts.spinBox_mdtAllowedADCMin);
412 s.restore(m_d->ui_cuts.checkBox_mdtAllowedADCMax);
413 s.restore(m_d->ui_cuts.spinBox_mdtAllowedADCMax);
414 s.restore(m_d->ui_cuts.checkBox_mdtAllowedTDCMin);
415 s.restore(m_d->ui_cuts.spinBox_mdtAllowedTDCMin);
416 s.restore(m_d->ui_cuts.checkBox_mdtAllowedTDCMax);
417 s.restore(m_d->ui_cuts.spinBox_mdtAllowedTDCMax);
418 s.restore(m_d->ui_cuts.checkBox_mmAllowedChargeMin);
419 s.restore(m_d->ui_cuts.spinBox_mmAllowedChargeMin);
420 s.restore(m_d->ui_cuts.checkBox_mmAllowedChargeMax);
421 s.restore(m_d->ui_cuts.spinBox_mmAllowedChargeMax);
422 s.restore(m_d->ui_cuts.checkBox_mmAllowedTimeMin);
423 s.restore(m_d->ui_cuts.spinBox_mmAllowedTimeMin);
424 s.restore(m_d->ui_cuts.checkBox_mmAllowedTimeMax);
425 s.restore(m_d->ui_cuts.spinBox_mmAllowedTimeMax);
426 s.restore(m_d->ui_cuts.checkBox_stgcAllowedChargeMin);
427 s.restore(m_d->ui_cuts.spinBox_stgcAllowedChargeMin);
428 s.restore(m_d->ui_cuts.checkBox_stgcAllowedChargeMax);
429 s.restore(m_d->ui_cuts.spinBox_stgcAllowedChargeMax);
430 s.restore(m_d->ui_cuts.checkBox_stgcAllowedTimeMin);
431 s.restore(m_d->ui_cuts.spinBox_stgcAllowedTimeMin);
432 s.restore(m_d->ui_cuts.checkBox_stgcAllowedTimeMax);
433 s.restore(m_d->ui_cuts.spinBox_stgcAllowedTimeMax);
434 } else {
435 // Old settings must also clear any cuts active in this session.
436 m_d->ui_cuts.checkBox_mdtAllowedADCMin->setChecked(false);
437 m_d->ui_cuts.checkBox_mdtAllowedADCMax->setChecked(false);
438 m_d->ui_cuts.checkBox_mdtAllowedTDCMin->setChecked(false);
439 m_d->ui_cuts.checkBox_mdtAllowedTDCMax->setChecked(false);
440 m_d->ui_cuts.checkBox_mmAllowedChargeMin->setChecked(false);
441 m_d->ui_cuts.checkBox_mmAllowedChargeMax->setChecked(false);
442 m_d->ui_cuts.checkBox_mmAllowedTimeMin->setChecked(false);
443 m_d->ui_cuts.checkBox_mmAllowedTimeMax->setChecked(false);
444 m_d->ui_cuts.checkBox_stgcAllowedChargeMin->setChecked(false);
445 m_d->ui_cuts.checkBox_stgcAllowedChargeMax->setChecked(false);
446 m_d->ui_cuts.checkBox_stgcAllowedTimeMin->setChecked(false);
447 m_d->ui_cuts.checkBox_stgcAllowedTimeMax->setChecked(false);
448 }
449 if (s.version() >= 3)
450 s.restore(m_d->ui_cuts.checkBox_mdtExcludeMasked);
451 else
452 m_d->ui_cuts.checkBox_mdtExcludeMasked->setChecked(false);
453
454 if (s.version() >= 4) {
455 s.restore(m_d->ui_cuts.checkBox_stgcShowPads);
456 s.restore(m_d->ui_cuts.checkBox_stgcShowStrips);
457 s.restore(m_d->ui_cuts.checkBox_stgcShowWires);
458 s.restore(m_d->ui_cuts.checkBox_stgcExcludeDead);
459 s.restore(m_d->ui_cuts.checkBox_stgcExcludePileup);
460 } else {
461 m_d->ui_cuts.checkBox_stgcShowPads->setChecked(true);
462 m_d->ui_cuts.checkBox_stgcShowStrips->setChecked(true);
463 m_d->ui_cuts.checkBox_stgcShowWires->setChecked(true);
464 m_d->ui_cuts.checkBox_stgcExcludeDead->setChecked(false);
465 m_d->ui_cuts.checkBox_stgcExcludePileup->setChecked(false);
466 }
467
468 if (s.version() >= 5) {
469 s.restore(m_d->ui_cuts.checkBox_tgcShowStrips);
470 s.restore(m_d->ui_cuts.checkBox_tgcShowWires);
471 s.restore(m_d->ui_cuts.checkBox_tgcShowPrevious);
472 s.restore(m_d->ui_cuts.checkBox_tgcShowCurrent);
473 s.restore(m_d->ui_cuts.checkBox_tgcShowNext);
474 s.restore(m_d->ui_cuts.checkBox_tgcShowNextNext);
475 s.restore(m_d->ui_cuts.checkBox_tgcShowUndefined);
476 s.restore(m_d->ui_cuts.checkBox_tgcShowUnknown);
477 } else {
478 m_d->ui_cuts.checkBox_tgcShowStrips->setChecked(true);
479 m_d->ui_cuts.checkBox_tgcShowWires->setChecked(true);
480 m_d->ui_cuts.checkBox_tgcShowPrevious->setChecked(true);
481 m_d->ui_cuts.checkBox_tgcShowCurrent->setChecked(true);
482 m_d->ui_cuts.checkBox_tgcShowNext->setChecked(true);
483 m_d->ui_cuts.checkBox_tgcShowNextNext->setChecked(true);
484 m_d->ui_cuts.checkBox_tgcShowUndefined->setChecked(true);
485 m_d->ui_cuts.checkBox_tgcShowUnknown->setChecked(true);
486 }
487
488 if (s.version() >= 6) {
489 s.restore(m_d->ui_cuts.checkBox_rpcShowEta);
490 s.restore(m_d->ui_cuts.checkBox_rpcShowPhi);
491 s.restore(m_d->ui_cuts.checkBox_rpcShowPrimarySide);
492 s.restore(m_d->ui_cuts.checkBox_rpcShowOppositeSide);
493 s.restore(m_d->ui_cuts.checkBox_rpcKeepMissingToT);
494 s.restore(m_d->ui_cuts.checkBox_rpcAllowedTimeMin);
495 s.restore(m_d->ui_cuts.spinBox_rpcAllowedTimeMin);
496 s.restore(m_d->ui_cuts.checkBox_rpcAllowedTimeMax);
497 s.restore(m_d->ui_cuts.spinBox_rpcAllowedTimeMax);
498 s.restore(m_d->ui_cuts.checkBox_rpcAllowedToTMin);
499 s.restore(m_d->ui_cuts.spinBox_rpcAllowedToTMin);
500 s.restore(m_d->ui_cuts.checkBox_rpcAllowedToTMax);
501 s.restore(m_d->ui_cuts.spinBox_rpcAllowedToTMax);
502 } else {
503 m_d->ui_cuts.checkBox_rpcShowEta->setChecked(true);
504 m_d->ui_cuts.checkBox_rpcShowPhi->setChecked(true);
505 m_d->ui_cuts.checkBox_rpcShowPrimarySide->setChecked(true);
506 m_d->ui_cuts.checkBox_rpcShowOppositeSide->setChecked(true);
507 m_d->ui_cuts.checkBox_rpcKeepMissingToT->setChecked(true);
508 m_d->ui_cuts.checkBox_rpcAllowedTimeMin->setChecked(false);
509 m_d->ui_cuts.checkBox_rpcAllowedTimeMax->setChecked(false);
510 m_d->ui_cuts.checkBox_rpcAllowedToTMin->setChecked(false);
511 m_d->ui_cuts.checkBox_rpcAllowedToTMax->setChecked(false);
512 }
513
514 // Deserialisation blocks checkbox signals, so synchronize the fields explicitly.
515 m_d->ui_cuts.spinBox_rpcAllowedTimeMin->setEnabled(m_d->ui_cuts.checkBox_rpcAllowedTimeMin->isChecked());
516 m_d->ui_cuts.spinBox_rpcAllowedTimeMax->setEnabled(m_d->ui_cuts.checkBox_rpcAllowedTimeMax->isChecked());
517 m_d->ui_cuts.spinBox_rpcAllowedToTMin->setEnabled(m_d->ui_cuts.checkBox_rpcAllowedToTMin->isChecked());
518 m_d->ui_cuts.spinBox_rpcAllowedToTMax->setEnabled(m_d->ui_cuts.checkBox_rpcAllowedToTMax->isChecked());
519 m_d->ui_cuts.spinBox_mdtAllowedADCMin->setEnabled(m_d->ui_cuts.checkBox_mdtAllowedADCMin->isChecked());
520 m_d->ui_cuts.spinBox_mdtAllowedADCMax->setEnabled(m_d->ui_cuts.checkBox_mdtAllowedADCMax->isChecked());
521 m_d->ui_cuts.spinBox_mdtAllowedTDCMin->setEnabled(m_d->ui_cuts.checkBox_mdtAllowedTDCMin->isChecked());
522 m_d->ui_cuts.spinBox_mdtAllowedTDCMax->setEnabled(m_d->ui_cuts.checkBox_mdtAllowedTDCMax->isChecked());
523 m_d->ui_cuts.spinBox_mmAllowedChargeMin->setEnabled(m_d->ui_cuts.checkBox_mmAllowedChargeMin->isChecked());
524 m_d->ui_cuts.spinBox_mmAllowedChargeMax->setEnabled(m_d->ui_cuts.checkBox_mmAllowedChargeMax->isChecked());
525 m_d->ui_cuts.spinBox_mmAllowedTimeMin->setEnabled(m_d->ui_cuts.checkBox_mmAllowedTimeMin->isChecked());
526 m_d->ui_cuts.spinBox_mmAllowedTimeMax->setEnabled(m_d->ui_cuts.checkBox_mmAllowedTimeMax->isChecked());
527 m_d->ui_cuts.spinBox_stgcAllowedChargeMin->setEnabled(m_d->ui_cuts.checkBox_stgcAllowedChargeMin->isChecked());
528 m_d->ui_cuts.spinBox_stgcAllowedChargeMax->setEnabled(m_d->ui_cuts.checkBox_stgcAllowedChargeMax->isChecked());
529 m_d->ui_cuts.spinBox_stgcAllowedTimeMin->setEnabled(m_d->ui_cuts.checkBox_stgcAllowedTimeMin->isChecked());
530 m_d->ui_cuts.spinBox_stgcAllowedTimeMax->setEnabled(m_d->ui_cuts.checkBox_stgcAllowedTimeMax->isChecked());
531
532}
533
534//____________________________________________________________________
536{
537 return m_d->collWidget;
538}
539
540//____________________________________________________________________
542{
543 return m_d->ui_display.widget_drawOptions->drawOptionsGroup();
544}
545
546//____________________________________________________________________
547bool VP1RawDataSysController::printInfoOnClick() const { return m_d->ui_int.checkBox_printinfo->isChecked(); }
548bool VP1RawDataSysController::printVerboseInfoOnClick() const { return m_d->ui_int.checkBox_printinfo_verbose->isChecked(); }
549bool VP1RawDataSysController::zoomOnClick() const { return m_d->ui_int.checkBox_zoom->isChecked(); }
550
551//____________________________________________________________________
553{
554 return m_d->ui_cuts.etaPhiCutWidget->allowedEta();
555}
556
557//____________________________________________________________________
559{
560 return m_d->ui_cuts.etaPhiCutWidget->allowedPhi();
561}
562
563//____________________________________________________________________
565{
566 return m_d->ui_display.checkBox_showVolumeOutLines->isChecked();
567}
568
569//____________________________________________________________________
571{
572 return m_d->ui_display.checkBox_trtHTUseSpecialMat->isChecked();
573}
574
575//____________________________________________________________________
577{
578 return m_d->ui_display.checkBox_bcmHighAttUseSpecialMat->isChecked();
579}
580
581//____________________________________________________________________
582VP1RawDataFlags::InDetPartsFlags VP1RawDataSysController::enabledInDetParts() const
583{
584 VP1RawDataFlags::InDetPartsFlags f;
585 if (m_d->ui_cuts.checkBox_cut_indet_barrelA->isChecked())
587 if (m_d->ui_cuts.checkBox_cut_indet_barrelC->isChecked())
589 if (m_d->ui_cuts.checkBox_cut_indet_endcapA->isChecked())
591 if (m_d->ui_cuts.checkBox_cut_indet_endcapC->isChecked())
593 return f;
594}
595
596//____________________________________________________________________
598{
599 return m_d->ui_cuts.checkbox_cut_trt_needHT->isChecked();
600}
601
602//____________________________________________________________________
604{
605 VP1Interval i( (m_d->ui_cuts.checkbox_cut_trt_TotMin->isChecked() ? (m_d->ui_cuts.spinBox_cut_trt_ToTMin->value()-0.5)*3.125*Gaudi::Units::nanosecond : -VP1Interval::inf() ),
606 (m_d->ui_cuts.checkbox_cut_trt_TotMax->isChecked() ? (m_d->ui_cuts.spinBox_cut_trt_ToTMax->value()+0.5)*3.125*Gaudi::Units::nanosecond : VP1Interval::inf() ) );
607 return i.lower()>i.upper() ? VP1Interval() : i;
608}
609
610//____________________________________________________________________
612{
613 return m_d->ui_cuts.spinBox_lucid_qdc_min->value();
614}
615
616//____________________________________________________________________
618{
619 return getMaterial(m_d->ui_display.matButton_trtht);
620}
621
622//____________________________________________________________________
624{
625 return getMaterial(m_d->ui_display.matButton_bcmhighatt);
626}
627
628
629namespace {
630VP1Interval muonDigitRange(const QCheckBox* minimumEnabled, const QDoubleSpinBox* minimum,
631 const QCheckBox* maximumEnabled, const QDoubleSpinBox* maximum)
632{
633 const double lower = minimumEnabled->isChecked() ? minimum->value() : -VP1Interval::inf();
634 const double upper = maximumEnabled->isChecked() ? maximum->value() : VP1Interval::inf();
635 return lower > upper ? VP1Interval() : VP1Interval(lower, upper, false, false);
636}
637}
638
640{
641 return muonDigitRange(m_d->ui_cuts.checkBox_mdtAllowedADCMin, m_d->ui_cuts.spinBox_mdtAllowedADCMin,
642 m_d->ui_cuts.checkBox_mdtAllowedADCMax, m_d->ui_cuts.spinBox_mdtAllowedADCMax);
643}
644
646{
647 return muonDigitRange(m_d->ui_cuts.checkBox_mdtAllowedTDCMin, m_d->ui_cuts.spinBox_mdtAllowedTDCMin,
648 m_d->ui_cuts.checkBox_mdtAllowedTDCMax, m_d->ui_cuts.spinBox_mdtAllowedTDCMax);
649}
650
652{
653 return muonDigitRange(m_d->ui_cuts.checkBox_mmAllowedChargeMin, m_d->ui_cuts.spinBox_mmAllowedChargeMin,
654 m_d->ui_cuts.checkBox_mmAllowedChargeMax, m_d->ui_cuts.spinBox_mmAllowedChargeMax);
655}
656
658{
659 return muonDigitRange(m_d->ui_cuts.checkBox_mmAllowedTimeMin, m_d->ui_cuts.spinBox_mmAllowedTimeMin,
660 m_d->ui_cuts.checkBox_mmAllowedTimeMax, m_d->ui_cuts.spinBox_mmAllowedTimeMax);
661}
662
664{
665 return muonDigitRange(m_d->ui_cuts.checkBox_stgcAllowedChargeMin, m_d->ui_cuts.spinBox_stgcAllowedChargeMin,
666 m_d->ui_cuts.checkBox_stgcAllowedChargeMax, m_d->ui_cuts.spinBox_stgcAllowedChargeMax);
667}
668
670{
671 return muonDigitRange(m_d->ui_cuts.checkBox_stgcAllowedTimeMin, m_d->ui_cuts.spinBox_stgcAllowedTimeMin,
672 m_d->ui_cuts.checkBox_stgcAllowedTimeMax, m_d->ui_cuts.spinBox_stgcAllowedTimeMax);
673}
674
676// Test for possible changes in values and emit signals as appropriate:
677// (possibleChange_XXX() slots code provided by macros)
678#define VP1CONTROLLERCLASSNAME VP1RawDataSysController
680POSSIBLECHANGE_IMP(cutAllowedEta)
681POSSIBLECHANGE_IMP(cutAllowedPhi)
682POSSIBLECHANGE_IMP(showVolumeOutLines)
683POSSIBLECHANGE_IMP(useSpecialTRTHTMaterial)
684POSSIBLECHANGE_IMP(useSpecialBCMHighAttMaterial)
685POSSIBLECHANGE_IMP(enabledInDetParts)
686POSSIBLECHANGE_IMP(trtRequireHT)
687POSSIBLECHANGE_IMP(trtAllowedToT)
688POSSIBLECHANGE_IMP(lucidMinQDC)
689
690POSSIBLECHANGE_IMP(mdtAllowedADC)
691POSSIBLECHANGE_IMP(mdtAllowedTDC)
692POSSIBLECHANGE_IMP(mmAllowedCharge)
693POSSIBLECHANGE_IMP(mmAllowedTime)
694POSSIBLECHANGE_IMP(stgcAllowedCharge)
695POSSIBLECHANGE_IMP(stgcAllowedTime)
696
698{
699 return m_d->ui_cuts.checkBox_mdtExcludeMasked->isChecked();
700}
701
702POSSIBLECHANGE_IMP(mdtExcludeMasked)
703
705{
706 return m_d->ui_cuts.checkBox_stgcShowPads->isChecked();
707}
708
709POSSIBLECHANGE_IMP(stgcShowPads)
710
712{
713 return m_d->ui_cuts.checkBox_stgcShowStrips->isChecked();
714}
715
716POSSIBLECHANGE_IMP(stgcShowStrips)
717
719{
720 return m_d->ui_cuts.checkBox_stgcShowWires->isChecked();
721}
722
723POSSIBLECHANGE_IMP(stgcShowWires)
724
726{
727 return m_d->ui_cuts.checkBox_stgcExcludeDead->isChecked();
728}
729
730POSSIBLECHANGE_IMP(stgcExcludeDead)
731
733{
734 return m_d->ui_cuts.checkBox_stgcExcludePileup->isChecked();
735}
736
737POSSIBLECHANGE_IMP(stgcExcludePileup)
738
740{
741 return m_d->ui_cuts.checkBox_tgcShowStrips->isChecked();
742}
743
744POSSIBLECHANGE_IMP(tgcShowStrips)
745
747{
748 return m_d->ui_cuts.checkBox_tgcShowWires->isChecked();
749}
750
751POSSIBLECHANGE_IMP(tgcShowWires)
752
754{
755 return m_d->ui_cuts.checkBox_tgcShowPrevious->isChecked();
756}
757
758POSSIBLECHANGE_IMP(tgcShowPrevious)
759
761{
762 return m_d->ui_cuts.checkBox_tgcShowCurrent->isChecked();
763}
764
765POSSIBLECHANGE_IMP(tgcShowCurrent)
766
768{
769 return m_d->ui_cuts.checkBox_tgcShowNext->isChecked();
770}
771
772POSSIBLECHANGE_IMP(tgcShowNext)
773
775{
776 return m_d->ui_cuts.checkBox_tgcShowNextNext->isChecked();
777}
778
779POSSIBLECHANGE_IMP(tgcShowNextNext)
780
782{
783 return m_d->ui_cuts.checkBox_tgcShowUndefined->isChecked();
784}
785
786POSSIBLECHANGE_IMP(tgcShowUndefined)
787
789{
790 return m_d->ui_cuts.checkBox_tgcShowUnknown->isChecked();
791}
792
793POSSIBLECHANGE_IMP(tgcShowUnknown)
794
796{
797 return m_d->ui_cuts.checkBox_rpcShowEta->isChecked();
798}
799
800POSSIBLECHANGE_IMP(rpcShowEta)
801
803{
804 return m_d->ui_cuts.checkBox_rpcShowPhi->isChecked();
805}
806
807POSSIBLECHANGE_IMP(rpcShowPhi)
808
810{
811 return m_d->ui_cuts.checkBox_rpcShowPrimarySide->isChecked();
812}
813
814POSSIBLECHANGE_IMP(rpcShowPrimarySide)
815
817{
818 return m_d->ui_cuts.checkBox_rpcShowOppositeSide->isChecked();
819}
820
821POSSIBLECHANGE_IMP(rpcShowOppositeSide)
822
824{
825 return m_d->ui_cuts.checkBox_rpcKeepMissingToT->isChecked();
826}
827
828POSSIBLECHANGE_IMP(rpcKeepMissingToT)
829
831{
832 return muonDigitRange(m_d->ui_cuts.checkBox_rpcAllowedTimeMin, m_d->ui_cuts.spinBox_rpcAllowedTimeMin,
833 m_d->ui_cuts.checkBox_rpcAllowedTimeMax, m_d->ui_cuts.spinBox_rpcAllowedTimeMax);
834}
835
836POSSIBLECHANGE_IMP(rpcAllowedTime)
837
839{
840 return muonDigitRange(m_d->ui_cuts.checkBox_rpcAllowedToTMin, m_d->ui_cuts.spinBox_rpcAllowedToTMin,
841 m_d->ui_cuts.checkBox_rpcAllowedToTMax, m_d->ui_cuts.spinBox_rpcAllowedToTMax);
842}
843
844POSSIBLECHANGE_IMP(rpcAllowedToT)
int upper(int c)
#define POSSIBLECHANGE_IMP(x)
void initDialog(T &theUI, QPushButton *launchbutton, QAbstractButton *enabledButton=0)
SoMaterial * getMaterial(VP1MaterialButton *) const
void connectToLastUpdateSlot(QObject *sender, const char *signal)
void setupCollWidgetInScrollArea(QScrollArea *scrollarea, VP1CollectionWidget *collWidget)
const char * addUpdateSlot(const char *slot)
VP1Controller(IVP1System *sys, const QString &classname)
void message(const QString &) const
static double inf()
Definition VP1Interval.h:25
static SoMaterial * createMaterial(const QColor &, const double &brightness=0.0, const double &transp=0.0)
VP1RawDataFlags::InDetPartsFlags last_enabledInDetParts
Ui::VP1RawDataControllerForm ui
Ui::RawDataSysSettingsCutsForm ui_cuts
Ui::RawDataSysSettingsDisplayForm ui_display
Ui::RawDataSysSettingsInteractionsForm ui_int
void possibleChange_stgcExcludeDead()
void possibleChange_tgcShowPrevious()
void possibleChange_mdtExcludeMasked()
void possibleChange_rpcShowPrimarySide()
void possibleChange_tgcShowNextNext()
QList< VP1Interval > cutAllowedPhi() const
void possibleChange_rpcAllowedTime()
void possibleChange_stgcShowStrips()
void possibleChange_rpcShowOppositeSide()
void possibleChange_stgcExcludePileup()
void possibleChange_mmAllowedCharge()
void actualRestoreSettings(VP1Deserialise &)
SoMaterial * bcmHighAttMaterial() const
void possibleChange_useSpecialTRTHTMaterial()
void possibleChange_rpcKeepMissingToT()
void possibleChange_tgcShowUndefined()
void possibleChange_useSpecialBCMHighAttMaterial()
void actualSaveSettings(VP1Serialise &) const
void possibleChange_stgcAllowedCharge()
void possibleChange_enabledInDetParts()
void possibleChange_tgcShowUnknown()
VP1CollectionWidget * collWidget() const
VP1RawDataFlags::InDetPartsFlags enabledInDetParts() const
void possibleChange_tgcShowCurrent()
void possibleChange_showVolumeOutLines()
void possibleChange_stgcAllowedTime()