ATLAS Offline Software
Loading...
Searching...
No Matches
VP1CaloCellController.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#define VP1IMPVARNAME m_d
6
9#include "ui_calocellcontrollerform.h"
10//#include "ui_calodigitssingle.h" // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
11//#include "ui_calodigitsdouble.h" // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
12#include "ui_calocell_badchannels_form.h"
13#include "ui_calocell_mbtsthresholds_form.h"
14#include "ui_calocell_tilethresholds_form.h"
15#include "ui_calocell_larsimpthresholds_form.h"
16#include "ui_calocell_larexpthresholds_form.h"
17#include "ui_calocell_interactions_form.h"
18#include "ui_calocell_cuts_form.h"
19#include "ui_calocell_visoptions_form.h"
20
23
30
31/*
32 * FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
33#include <qwt_legend.h>
34#include <qwt_plot.h>
35#include <qwt_plot_curve.h>
36#include <qwt_plot_marker.h>
37#include <qwt_symbol.h>
38#include <qwt_text.h>
39*/
40
41#include <QVector>
42#include "GaudiKernel/SystemOfUnits.h"
43#include <map>
44
45// -------------------- Imp -------------------------------
47{
48public:
49 // ---------- Data members ------------
51 Ui::frmCaloCellController ui{};
52 Ui::frmCaloCellVisOptions ui_visopts{};
53 Ui::frmCaloCellBadChannels ui_badchans{};
54 Ui::frmCaloCellInteractions ui_interact{};
55 Ui::frmCaloCellCuts ui_cuts{};
56 Ui::frmCaloCellThresholdsMbts ui_threshmbts{};
57 Ui::frmCaloCellThresholdsTile ui_threshtile{};
58 Ui::frmCaloCellThresholdsLArSimple ui_threshlarsimp{};
59 Ui::frmCaloCellThresholdsLArExpert ui_threshlarexp{};
60
61 // This is needed by VP1Controller base class
63 QPair<bool,double> last_scale;
65 bool last_showDigits = false;
67 bool last_energyModeEt = false;
69
70 // Map of gui object structures by selection type (simple/expert modes)
73
74 // Material button map
75 typedef std::map<VP1CC_SeparatorTypes, VP1MaterialButton* > MatButtonMap;
77
78 // Digits display
79 QWidget* digit_form_single = nullptr;
80 QWidget* digit_form_double = nullptr;
81
82// Ui::frmCaloDigitsSingle* UiDigitsSingle; // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
83// Ui::frmCaloDigitsDouble* UiDigitsDouble; // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
84
85 // at the beginning of every event reset these flags to FALSE
86 bool singlePlotHasData = false;
87 bool doublePlotHasData = false;
88};
89
90// -------------------- Controller -------------------------------
92 VP1Controller(sys,"CaloCellController"),
93 m_d(new Imp),
94 m_tile_hw_id(0),
95 m_tile_info(0),
97{
98
99 messageDebug("VP1CaloCellController() constructor...");
100
101 m_d->theclass = this;
102 m_d->ui.setupUi(this);
103
104 // Setup dialogs
105 initDialog(m_d->ui_interact, m_d->ui.pushButton_settings_interactions);
106 initDialog(m_d->ui_cuts, m_d->ui.pushButton_settings_cuts);
107 initDialog(m_d->ui_badchans, m_d->ui.pushButton_settings_badchannels);
108 initDialog(m_d->ui_visopts, m_d->ui.pushButton_settings_visoptions);
109 initDialog(m_d->ui_threshmbts,m_d->ui.pushButton_settings_thresholds_mbts);
110 initDialog(m_d->ui_threshtile,m_d->ui.pushButton_settings_thresholds_tile);
111 initDialog(m_d->ui_threshlarsimp,m_d->ui.pushButton_settings_thresholds_larsimple,m_d->ui.rbtnSimple);
112 initDialog(m_d->ui_threshlarexp,m_d->ui.pushButton_settings_thresholds_larexpert,m_d->ui.rbtnExpert);
113
114 m_d->ui_cuts.wdgEtaPhiCut->setEtaCutEnabled(false);
115
116 m_d->ui_visopts.wdgDrawOptions->setLineWidths(2.0);
117 m_d->ui_visopts.wdgDrawOptions->setPointSizesDisabled();
118 m_d->ui_visopts.wdgDrawOptions->setBaseLightingDisabled();
119 m_d->ui_visopts.wdgDrawOptions->setComplexityDisabled();
120
121 // Initialize flags
122 m_d->singlePlotHasData = false;
123 m_d->doublePlotHasData = false;
124
125 // ------------------------ SLOTS ----------------------
126
127 // ----------------- Selection Intervals ------------------
129
130 // Enable/disable checkboxes
131 connectToLastUpdateSlot(m_d->ui.chbxEMB);
132 connectToLastUpdateSlot(m_d->ui.chbxEMEC);
133 connectToLastUpdateSlot(m_d->ui.chbxHEC);
134 connectToLastUpdateSlot(m_d->ui.chbxFCAL);
135 connectToLastUpdateSlot(m_d->ui.chbxEMB_S0);
136 connectToLastUpdateSlot(m_d->ui.chbxEMB_S1);
137 connectToLastUpdateSlot(m_d->ui.chbxEMB_S2);
138 connectToLastUpdateSlot(m_d->ui.chbxEMB_S3);
139 connectToLastUpdateSlot(m_d->ui.chbxEMEC_S0);
140 connectToLastUpdateSlot(m_d->ui.chbxEMEC_S1);
141 connectToLastUpdateSlot(m_d->ui.chbxEMEC_S2);
142 connectToLastUpdateSlot(m_d->ui.chbxEMEC_S3);
143 connectToLastUpdateSlot(m_d->ui.chbxHEC_S0);
144 connectToLastUpdateSlot(m_d->ui.chbxHEC_S1);
145 connectToLastUpdateSlot(m_d->ui.chbxHEC_S2);
146 connectToLastUpdateSlot(m_d->ui.chbxHEC_S3);
147 connectToLastUpdateSlot(m_d->ui.chbxFCAL_M1);
148 connectToLastUpdateSlot(m_d->ui.chbxFCAL_M2);
149 connectToLastUpdateSlot(m_d->ui.chbxFCAL_M3);
150 connectToLastUpdateSlot(m_d->ui.chbxTILB);
151 connectToLastUpdateSlot(m_d->ui.chbxTILEC);
152 connectToLastUpdateSlot(m_d->ui.chbxTILCR);
153 // Negative checkboxes
154 connectToLastUpdateSlot(m_d->ui.chbxLArNegative);
155 connectToLastUpdateSlot(m_d->ui.chbxEMB_Neg_Expert);
156 connectToLastUpdateSlot(m_d->ui.chbxEMEC_Neg_Expert);
157 connectToLastUpdateSlot(m_d->ui.chbxHEC_Neg_Expert);
158 connectToLastUpdateSlot(m_d->ui.chbxFCAL_Neg_Expert);
159 connectToLastUpdateSlot(m_d->ui.chbxTileNegative);
160
161 // Disable upper thresholds checkboxes
162 connectToLastUpdateSlot(m_d->ui_threshlarsimp.chbxNoLArUpper);
163 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S0Upper);
164 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S1Upper);
165 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S2Upper);
166 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S3Upper);
167 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S0Upper);
168 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S1Upper);
169 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S2Upper);
170 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S3Upper);
171 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S0Upper);
172 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S1Upper);
173 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S2Upper);
174 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S3Upper);
175 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M1Upper);
176 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M2Upper);
177 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M3Upper);
178 connectToLastUpdateSlot(m_d->ui_threshtile.chbxNoTileUpper);
179
180 // Lower threhold spinboxes
181 connectToLastUpdateSlot(m_d->ui_threshlarsimp.dspbxLArLowerThresh);
182 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S0LowerThresh);
183 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S1LowerThresh);
184 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S2LowerThresh);
185 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S3LowerThresh);
186 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S0LowerThresh);
187 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S1LowerThresh);
188 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S2LowerThresh);
189 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S3LowerThresh);
190 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S0LowerThresh);
191 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S1LowerThresh);
192 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S2LowerThresh);
193 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S3LowerThresh);
194 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M1LowerThresh);
195 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M2LowerThresh);
196 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M3LowerThresh);
197 connectToLastUpdateSlot(m_d->ui_threshtile.dspbxTileLowerThresh);
198
199 // Upper threhold spinboxes
200 connectToLastUpdateSlot(m_d->ui_threshlarsimp.dspbxLArUpperThresh);
201 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S0UpperThresh);
202 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S1UpperThresh);
203 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S2UpperThresh);
204 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMB_S3UpperThresh);
205 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S0UpperThresh);
206 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S1UpperThresh);
207 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S2UpperThresh);
208 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxEMEC_S3UpperThresh);
209 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S0UpperThresh);
210 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S1UpperThresh);
211 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S2UpperThresh);
212 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxHEC_S3UpperThresh);
213 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M1UpperThresh);
214 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M2UpperThresh);
215 connectToLastUpdateSlot(m_d->ui_threshlarexp.dspbxFCAL_M3UpperThresh);
216 connectToLastUpdateSlot(m_d->ui_threshtile.dspbxTileUpperThresh);
217
218 // LAr mode change radio button
219 connectToLastUpdateSlot(m_d->ui.rbtnSimple);
220
221 // ----------------- Selection Intervals ------------------
222
223 // ----------------- Global cuts ------------------
225 connectToLastUpdateSlot(m_d->ui_cuts.chbxSideA);
226 connectToLastUpdateSlot(m_d->ui_cuts.chbxSideC);
227 connectToLastUpdateSlot(m_d->ui_cuts.wdgEtaPhiCut,SIGNAL(allowedEtaChanged(const VP1Interval&)));
228 connectToLastUpdateSlot(m_d->ui_cuts.wdgEtaPhiCut,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&)));
229 // ----------------- Global cuts ------------------
230
231 // -------------- Scale ------------
233 connectToLastUpdateSlot(m_d->ui_visopts.dspbxScale);
234 connectToLastUpdateSlot(m_d->ui_visopts.chbxLogscale);
235 // -------------- Scale ------------
236
237 // ---------------- Enable Upper Threshold ----------------
239 connectToLastUpdateSlot(m_d->ui_threshlarsimp.chbxNoLArUpper);
240 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S0Upper);
241 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S1Upper);
242 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S2Upper);
243 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMB_S3Upper);
244 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S0Upper);
245 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S1Upper);
246 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S2Upper);
247 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoEMEC_S3Upper);
248 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S0Upper);
249 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S1Upper);
250 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S2Upper);
251 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoHEC_S3Upper);
252 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M1Upper);
253 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M2Upper);
254 connectToLastUpdateSlot(m_d->ui_threshlarexp.chbxNoFCAL_M3Upper);
255 connectToLastUpdateSlot(m_d->ui_threshtile.chbxNoTileUpper);
256
257 // ----------------- LAr mode ------------------
258 addUpdateSlot(SLOT(changeMode()));
259 connectToLastUpdateSlot(m_d->ui.rbtnSimple);
260
261 // ----------------- MBTS ---------------------
263 connectToLastUpdateSlot(m_d->ui.chbxMbts);
264 connectToLastUpdateSlot(m_d->ui_threshmbts.dspbxMbtsThresh);
265
266 // ------------- Digits checkbox ----------------
268 connectToLastUpdateSlot(m_d->ui_interact.chbxDigits);
269 // ------------- Digits checkbox ----------------
270
271 // ------------- Volume OutLines -------------
273 connectToLastUpdateSlot(m_d->ui_visopts.chbxShowOutlines);
274 // ------------- Volume OutLines -------------
275
276 // ------------- Energy Mode -------------
278 connectToLastUpdateSlot(m_d->ui.rbtnModeEt);
279 // ------------- Energy Mode -------------
280
281 initLastVars();
282 // ------------------------ SLOTS ----------------------
283
284 // ---------------------- Material Buttons --------------------
285 m_d->ui_visopts.matbutLArEMBColorPos->setMaterial(VP1MaterialButton::createMaterial(0.21,0.8,0.51));
286 m_d->ui_visopts.matbutLArEMECColorPos->setMaterial(VP1MaterialButton::createMaterial(0.26,0.8,0.2));
287 m_d->ui_visopts.matbutLArHECColorPos->setMaterial(VP1MaterialButton::createMaterial(0.25,0.8,0.76));
288 m_d->ui_visopts.matbutLArFCALColorPos->setMaterial(VP1MaterialButton::createMaterial(0.09,0.98,0.02));
289 m_d->ui_visopts.matbutLArEMBColorNeg->setMaterial(VP1MaterialButton::createMaterial(0.21,0.51,0.8));
290 m_d->ui_visopts.matbutLArEMECColorNeg->setMaterial(VP1MaterialButton::createMaterial(0.21,0.51,0.8));
291 m_d->ui_visopts.matbutLArHECColorNeg->setMaterial(VP1MaterialButton::createMaterial(0.21,0.51,0.8));
292 m_d->ui_visopts.matbutLArFCALColorNeg->setMaterial(VP1MaterialButton::createMaterial(0.21,0.51,0.8));
293 m_d->ui_visopts.matbutTileColorPosPMT1->setMaterial(VP1MaterialButton::createMaterial(1.,1.,0.));
294 m_d->ui_visopts.matbutTileColorPosPMT0->setMaterial(VP1MaterialButton::createMaterial(1.,0.78,0.));
295 m_d->ui_visopts.matbutTileColorPosNeg->setMaterial(VP1MaterialButton::createMaterial(1.,0.,0.));
296 m_d->ui_visopts.matbutTileColorNegPMT1->setMaterial(VP1MaterialButton::createMaterial(1.,0.,1.));
297 m_d->ui_visopts.matbutTileColorNegPMT0->setMaterial(VP1MaterialButton::createMaterial(0.78,0.,1.));
298 m_d->ui_visopts.matbutTileColorNegPos->setMaterial(VP1MaterialButton::createMaterial(1.,0.,0.));
299 m_d->ui_visopts.matbutMbts->setMaterial(VP1MaterialButton::createMaterial(1.,1.,0.));
300
301 m_d->matButtonMap[VP1CC_SepLArEMBPos] = m_d->ui_visopts.matbutLArEMBColorPos;
302 m_d->matButtonMap[VP1CC_SepLArEMECPos] = m_d->ui_visopts.matbutLArEMECColorPos;
303 m_d->matButtonMap[VP1CC_SepLArHECPos] = m_d->ui_visopts.matbutLArHECColorPos;
304 m_d->matButtonMap[VP1CC_SepLArFCALPos] = m_d->ui_visopts.matbutLArFCALColorPos;
305 m_d->matButtonMap[VP1CC_SepLArEMBNeg] = m_d->ui_visopts.matbutLArEMBColorNeg;
306 m_d->matButtonMap[VP1CC_SepLArEMECNeg] = m_d->ui_visopts.matbutLArEMECColorNeg;
307 m_d->matButtonMap[VP1CC_SepLArHECNeg] = m_d->ui_visopts.matbutLArHECColorNeg;
308 m_d->matButtonMap[VP1CC_SepLArFCALNeg] = m_d->ui_visopts.matbutLArFCALColorNeg;
309 m_d->matButtonMap[VP1CC_SepTilePositiveUp] = m_d->ui_visopts.matbutTileColorPosPMT1;
310 m_d->matButtonMap[VP1CC_SepTilePositiveDown] = m_d->ui_visopts.matbutTileColorPosPMT0;
311 m_d->matButtonMap[VP1CC_SepTilePositiveNeg] = m_d->ui_visopts.matbutTileColorPosNeg;
312 m_d->matButtonMap[VP1CC_SepTileNegativeUp] = m_d->ui_visopts.matbutTileColorNegPMT1;
313 m_d->matButtonMap[VP1CC_SepTileNegativeDown] = m_d->ui_visopts.matbutTileColorNegPMT0;
314 m_d->matButtonMap[VP1CC_SepTileNegativePos] = m_d->ui_visopts.matbutTileColorNegPos;
315 m_d->matButtonMap[VP1CC_SepMBTS] = m_d->ui_visopts.matbutMbts;
316 // ---------------------- Material Buttons --------------------
317
318 // --------------------- Digits Display -------------------------
319 messageDebug("Digits Display...");
320 m_d->digit_form_single = new QWidget(0,Qt::WindowStaysOnTopHint);
321 m_d->digit_form_single->setVisible(false);
322
323 m_d->digit_form_double = new QWidget(0,Qt::WindowStaysOnTopHint);
324 m_d->digit_form_double->setVisible(false);
325
326// // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
327// messageDebug("setting up digits box (s)");
328// m_d->UiDigitsSingle = new Ui::frmCaloDigitsSingle();
329// m_d->UiDigitsSingle->setupUi(m_d->digit_form_single);
330// m_d->UiDigitsSingle->plotDigits->setAxisTitle(QwtPlot::xBottom,"Bunch crossing");
331// m_d->UiDigitsSingle->plotDigits->setAxisTitle(QwtPlot::yLeft,"ADC counts");
332//
333 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
334// messageDebug("setting up digits box (m_d)");
335// m_d->UiDigitsDouble = new Ui::frmCaloDigitsDouble();
336// m_d->UiDigitsDouble->setupUi(m_d->digit_form_double);
337// m_d->UiDigitsDouble->plotDigits_1->setAxisTitle(QwtPlot::xBottom,"Bunch crossing");
338// m_d->UiDigitsDouble->plotDigits_1->setAxisTitle(QwtPlot::yLeft,"ADC counts");
339// m_d->UiDigitsDouble->plotDigits_2->setAxisTitle(QwtPlot::xBottom,"Bunch crossing");
340// m_d->UiDigitsDouble->plotDigits_2->setAxisTitle(QwtPlot::yLeft,"ADC counts");
341 // --------------------- Digits Display -------------------------
342
343 // Fill Sel2Gui maps
344 VP1CCUi2Manager* ui2manager;
345 // EMB
346 ui2manager = new VP1CCUi2Manager;
347 ui2manager->globalEnableCB = m_d->ui.chbxEMB;
348 ui2manager->showNegativeCB = m_d->ui.chbxLArNegative;
349 ui2manager->upperThreshOffCB = m_d->ui_threshlarsimp.chbxNoLArUpper;
350 ui2manager->lowerThresholdSB = m_d->ui_threshlarsimp.dspbxLArLowerThresh;
351 ui2manager->upperThresholdSB = m_d->ui_threshlarsimp.dspbxLArUpperThresh;
352
353 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMB0] = ui2manager;
354 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMB1] = ui2manager;
355 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMB2] = ui2manager;
356 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMB3] = ui2manager;
357
358 // EMEC
359 ui2manager = new VP1CCUi2Manager;
360 ui2manager->globalEnableCB = m_d->ui.chbxEMEC;
361 ui2manager->showNegativeCB = m_d->ui.chbxLArNegative;
362 ui2manager->upperThreshOffCB = m_d->ui_threshlarsimp.chbxNoLArUpper;
363 ui2manager->lowerThresholdSB = m_d->ui_threshlarsimp.dspbxLArLowerThresh;
364 ui2manager->upperThresholdSB = m_d->ui_threshlarsimp.dspbxLArUpperThresh;
365
366 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMEC0] = ui2manager;
367 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMEC1] = ui2manager;
368 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMEC2] = ui2manager;
369 (m_d->sel2GuiSimple)[VP1CC_SelTypeEMEC3] = ui2manager;
370
371 // HEC
372 ui2manager = new VP1CCUi2Manager;
373 ui2manager->globalEnableCB = m_d->ui.chbxHEC;
374 ui2manager->showNegativeCB = m_d->ui.chbxLArNegative;
375 ui2manager->upperThreshOffCB = m_d->ui_threshlarsimp.chbxNoLArUpper;
376 ui2manager->lowerThresholdSB = m_d->ui_threshlarsimp.dspbxLArLowerThresh;
377 ui2manager->upperThresholdSB = m_d->ui_threshlarsimp.dspbxLArUpperThresh;
378
379 (m_d->sel2GuiSimple)[VP1CC_SelTypeHEC0] = ui2manager;
380 (m_d->sel2GuiSimple)[VP1CC_SelTypeHEC1] = ui2manager;
381 (m_d->sel2GuiSimple)[VP1CC_SelTypeHEC2] = ui2manager;
382 (m_d->sel2GuiSimple)[VP1CC_SelTypeHEC3] = ui2manager;
383
384 // FCAL
385 ui2manager = new VP1CCUi2Manager;
386 ui2manager->globalEnableCB = m_d->ui.chbxFCAL;
387 ui2manager->showNegativeCB = m_d->ui.chbxLArNegative;
388 ui2manager->upperThreshOffCB = m_d->ui_threshlarsimp.chbxNoLArUpper;
389 ui2manager->lowerThresholdSB = m_d->ui_threshlarsimp.dspbxLArLowerThresh;
390 ui2manager->upperThresholdSB = m_d->ui_threshlarsimp.dspbxLArUpperThresh;
391
392 (m_d->sel2GuiSimple)[VP1CC_SelTypeFCAL1] = ui2manager;
393 (m_d->sel2GuiSimple)[VP1CC_SelTypeFCAL2] = ui2manager;
394 (m_d->sel2GuiSimple)[VP1CC_SelTypeFCAL3] = ui2manager;
395
396 // ---VP1CC_SelTypeEMB0 ---
397 ui2manager = new VP1CCUi2Manager;
398 ui2manager->globalEnableCB = m_d->ui.chbxEMB_S0;
399 ui2manager->showNegativeCB = m_d->ui.chbxEMB_Neg_Expert;
400 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMB_S0Upper;
401 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S0LowerThresh;
402 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S0UpperThresh;
403 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMB0] = ui2manager;
404
405 // ---VP1CC_SelTypeEMB1 ---
406 ui2manager = new VP1CCUi2Manager;
407 ui2manager->globalEnableCB = m_d->ui.chbxEMB_S1;
408 ui2manager->showNegativeCB = m_d->ui.chbxEMB_Neg_Expert;
409 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMB_S1Upper;
410 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S1LowerThresh;
411 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S1UpperThresh;
412 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMB1] = ui2manager;
413
414 // --- VP1CC_SelTypeEMB2 ---
415 ui2manager = new VP1CCUi2Manager;
416 ui2manager->globalEnableCB = m_d->ui.chbxEMB_S2;
417 ui2manager->showNegativeCB = m_d->ui.chbxEMB_Neg_Expert;
418 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMB_S2Upper;
419 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S2LowerThresh;
420 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S2UpperThresh;
421 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMB2] = ui2manager;
422
423 // --- VP1CC_SelTypeEMB3 ---
424 ui2manager = new VP1CCUi2Manager;
425 ui2manager->globalEnableCB = m_d->ui.chbxEMB_S3;
426 ui2manager->showNegativeCB = m_d->ui.chbxEMB_Neg_Expert;
427 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMB_S3Upper;
428 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S3LowerThresh;
429 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMB_S3UpperThresh;
430 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMB3] = ui2manager;
431
432 // --- VP1CC_SelTypeEMEC0 ---
433 ui2manager = new VP1CCUi2Manager;
434 ui2manager->globalEnableCB = m_d->ui.chbxEMEC_S0;
435 ui2manager->showNegativeCB = m_d->ui.chbxEMEC_Neg_Expert;
436 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMEC_S0Upper;
437 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S0LowerThresh;
438 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S0UpperThresh;
439 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMEC0] = ui2manager;
440
441 // --- VP1CC_SelTypeEMEC1 ---
442 ui2manager = new VP1CCUi2Manager;
443 ui2manager->globalEnableCB = m_d->ui.chbxEMEC_S1;
444 ui2manager->showNegativeCB = m_d->ui.chbxEMEC_Neg_Expert;
445 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMEC_S1Upper;
446 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S1LowerThresh;
447 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S1UpperThresh;
448 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMEC1] = ui2manager;
449
450 // --- VP1CC_SelTypeEMEC2 ---
451 ui2manager = new VP1CCUi2Manager;
452 ui2manager->globalEnableCB = m_d->ui.chbxEMEC_S2;
453 ui2manager->showNegativeCB = m_d->ui.chbxEMEC_Neg_Expert;
454 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMEC_S2Upper;
455 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S2LowerThresh;
456 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S2UpperThresh;
457 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMEC2] = ui2manager;
458
459 // --- VP1CC_SelTypeEMEC3 ---
460 ui2manager = new VP1CCUi2Manager;
461 ui2manager->globalEnableCB = m_d->ui.chbxEMEC_S3;
462 ui2manager->showNegativeCB = m_d->ui.chbxEMEC_Neg_Expert;
463 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoEMEC_S3Upper;
464 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S3LowerThresh;
465 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxEMEC_S3UpperThresh;
466 (m_d->sel2GuiExpert)[VP1CC_SelTypeEMEC3] = ui2manager;
467
468 // --- VP1CC_SelTypeHEC0 ---
469 ui2manager = new VP1CCUi2Manager;
470 ui2manager->globalEnableCB = m_d->ui.chbxHEC_S0;
471 ui2manager->showNegativeCB = m_d->ui.chbxHEC_Neg_Expert;
472 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoHEC_S0Upper;
473 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S0LowerThresh;
474 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S0UpperThresh;
475 (m_d->sel2GuiExpert)[VP1CC_SelTypeHEC0] = ui2manager;
476
477 // --- VP1CC_SelTypeHEC1 ---
478 ui2manager = new VP1CCUi2Manager;
479 ui2manager->globalEnableCB = m_d->ui.chbxHEC_S1;
480 ui2manager->showNegativeCB = m_d->ui.chbxHEC_Neg_Expert;
481 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoHEC_S1Upper;
482 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S1LowerThresh;
483 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S1UpperThresh;
484 (m_d->sel2GuiExpert)[VP1CC_SelTypeHEC1] = ui2manager;
485
486 // --- VP1CC_SelTypeHEC2 ---
487 ui2manager = new VP1CCUi2Manager;
488 ui2manager->globalEnableCB = m_d->ui.chbxHEC_S2;
489 ui2manager->showNegativeCB = m_d->ui.chbxHEC_Neg_Expert;
490 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoHEC_S2Upper;
491 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S2LowerThresh;
492 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S2UpperThresh;
493 (m_d->sel2GuiExpert)[VP1CC_SelTypeHEC2] = ui2manager;
494
495 // --- VP1CC_SelTypeHEC3 ---
496 ui2manager = new VP1CCUi2Manager;
497 ui2manager->globalEnableCB = m_d->ui.chbxHEC_S3;
498 ui2manager->showNegativeCB = m_d->ui.chbxHEC_Neg_Expert;
499 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoHEC_S3Upper;
500 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S3LowerThresh;
501 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxHEC_S3UpperThresh;
502 (m_d->sel2GuiExpert)[VP1CC_SelTypeHEC3] = ui2manager;
503
504 // --- VP1CC_SelTypeFCAL1 ---
505 ui2manager = new VP1CCUi2Manager;
506 ui2manager->globalEnableCB = m_d->ui.chbxFCAL_M1;
507 ui2manager->showNegativeCB = m_d->ui.chbxFCAL_Neg_Expert;
508 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoFCAL_M1Upper;
509 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M1LowerThresh;
510 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M1UpperThresh;
511 (m_d->sel2GuiExpert)[VP1CC_SelTypeFCAL1] = ui2manager;
512
513 // --- VP1CC_SelTypeFCAL2 ---
514 ui2manager = new VP1CCUi2Manager;
515 ui2manager->globalEnableCB = m_d->ui.chbxFCAL_M2;
516 ui2manager->showNegativeCB = m_d->ui.chbxFCAL_Neg_Expert;
517 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoFCAL_M2Upper;
518 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M2LowerThresh;
519 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M2UpperThresh;
520 (m_d->sel2GuiExpert)[VP1CC_SelTypeFCAL2] = ui2manager;
521
522 // --- VP1CC_SelTypeFCAL3 ---
523 ui2manager = new VP1CCUi2Manager;
524 ui2manager->globalEnableCB = m_d->ui.chbxFCAL_M3;
525 ui2manager->showNegativeCB = m_d->ui.chbxFCAL_Neg_Expert;
526 ui2manager->upperThreshOffCB = m_d->ui_threshlarexp.chbxNoFCAL_M3Upper;
527 ui2manager->lowerThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M3LowerThresh;
528 ui2manager->upperThresholdSB = m_d->ui_threshlarexp.dspbxFCAL_M3UpperThresh;
529 (m_d->sel2GuiExpert)[VP1CC_SelTypeFCAL3] = ui2manager;
530
531 // --- VP1CC_SelTypeTileB ---
532 ui2manager = new VP1CCUi2Manager;
533 ui2manager->globalEnableCB = m_d->ui.chbxTILB;
534 ui2manager->showNegativeCB = m_d->ui.chbxTileNegative;
535 ui2manager->upperThreshOffCB = m_d->ui_threshtile.chbxNoTileUpper;
536 ui2manager->lowerThresholdSB = m_d->ui_threshtile.dspbxTileLowerThresh;
537 ui2manager->upperThresholdSB = m_d->ui_threshtile.dspbxTileUpperThresh;
538 (m_d->sel2GuiSimple)[VP1CC_SelTypeTileB] = ui2manager;
539 (m_d->sel2GuiExpert)[VP1CC_SelTypeTileB] = ui2manager;
540
541 // --- VP1CC_SelTypeTileEC ---
542 ui2manager = new VP1CCUi2Manager;
543 ui2manager->globalEnableCB = m_d->ui.chbxTILEC;
544 ui2manager->showNegativeCB = m_d->ui.chbxTileNegative;
545 ui2manager->upperThreshOffCB = m_d->ui_threshtile.chbxNoTileUpper;
546 ui2manager->lowerThresholdSB = m_d->ui_threshtile.dspbxTileLowerThresh;
547 ui2manager->upperThresholdSB = m_d->ui_threshtile.dspbxTileUpperThresh;
548 (m_d->sel2GuiSimple)[VP1CC_SelTypeTileEC] = ui2manager;
549 (m_d->sel2GuiExpert)[VP1CC_SelTypeTileEC] = ui2manager;
550
551 // --- VP1CC_SelTypeTileCrack ---
552 ui2manager = new VP1CCUi2Manager;
553 ui2manager->globalEnableCB = m_d->ui.chbxTILCR;
554 ui2manager->showNegativeCB = m_d->ui.chbxTileNegative;
555 ui2manager->upperThreshOffCB = m_d->ui_threshtile.chbxNoTileUpper;
556 ui2manager->lowerThresholdSB = m_d->ui_threshtile.dspbxTileLowerThresh;
557 ui2manager->upperThresholdSB = m_d->ui_threshtile.dspbxTileUpperThresh;
558 (m_d->sel2GuiSimple)[VP1CC_SelTypeTileCrack] = ui2manager;
559 (m_d->sel2GuiExpert)[VP1CC_SelTypeTileCrack] = ui2manager;
560}
561
563{
564 // Clean up in Imp maps
565 delete m_d->sel2GuiSimple[VP1CC_SelTypeEMB0];
566 delete m_d->sel2GuiSimple[VP1CC_SelTypeEMEC0];
567 delete m_d->sel2GuiSimple[VP1CC_SelTypeHEC0];
568 delete m_d->sel2GuiSimple[VP1CC_SelTypeFCAL1];
569 //TK: Fixme: why not just iterate and delete all here?
570 m_d->sel2GuiSimple.clear();
571
572 for (auto& p : m_d->sel2GuiExpert)
573 delete p.second;
574 m_d->sel2GuiExpert.clear();
575 delete m_d;
576}
577
579{
580 if (s.version()<0 || s.version()>4) {
581 message("Warning: State data in .vp1 file has unsupported version ("+str(s.version())+")");
582 return;
583 }
584
585 s.restore(m_d->ui_interact.chbxDigits);
586 s.restore(m_d->ui_visopts.dspbxScale);
587 s.restore(m_d->ui.chbxMbts);
588 s.restore(m_d->ui_threshmbts.dspbxMbtsThresh);
589 s.restore(m_d->ui_badchans.chbxEnableBadChannels);
590 s.restore(m_d->ui_badchans.chbxMaskDead);
591 s.restore(m_d->ui_badchans.chbxMaskNoisy);
592 s.restore(m_d->ui_badchans.chbxMaskAffected);
593 s.restore(m_d->ui.rbtnSimple,m_d->ui.rbtnExpert);
594 s.restore(m_d->ui.chbxEMB);
595 s.restore(m_d->ui.chbxEMEC);
596 s.restore(m_d->ui.chbxHEC);
597 s.restore(m_d->ui.chbxFCAL);
598 s.restore(m_d->ui.chbxLArNegative);
599 s.restore(m_d->ui_threshlarsimp.dspbxLArLowerThresh);
600 s.restore(m_d->ui_threshlarsimp.dspbxLArUpperThresh);
601 s.restore(m_d->ui_threshlarsimp.chbxNoLArUpper);
602 s.restore(m_d->ui.chbxEMB_Neg_Expert);
603 s.restore(m_d->ui.chbxEMB_S0);
604 s.restore(m_d->ui_threshlarexp.dspbxEMB_S0LowerThresh);
605 s.restore(m_d->ui_threshlarexp.dspbxEMB_S0UpperThresh);
606 s.restore(m_d->ui_threshlarexp.chbxNoEMB_S0Upper);
607 s.restore(m_d->ui.chbxEMB_S1);
608 s.restore(m_d->ui_threshlarexp.dspbxEMB_S1LowerThresh);
609 s.restore(m_d->ui_threshlarexp.dspbxEMB_S1UpperThresh);
610 s.restore(m_d->ui_threshlarexp.chbxNoEMB_S1Upper);
611 s.restore(m_d->ui.chbxEMB_S2);
612 s.restore(m_d->ui_threshlarexp.dspbxEMB_S2LowerThresh);
613 s.restore(m_d->ui_threshlarexp.dspbxEMB_S2UpperThresh);
614 s.restore(m_d->ui_threshlarexp.chbxNoEMB_S2Upper);
615 s.restore(m_d->ui.chbxEMB_S3);
616 s.restore(m_d->ui_threshlarexp.dspbxEMB_S3LowerThresh);
617 s.restore(m_d->ui_threshlarexp.dspbxEMB_S3UpperThresh);
618 s.restore(m_d->ui_threshlarexp.chbxNoEMB_S3Upper);
619 s.restore(m_d->ui.chbxEMEC_Neg_Expert);
620 s.restore(m_d->ui.chbxEMEC_S0);
621 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S0LowerThresh);
622 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S0UpperThresh);
623 s.restore(m_d->ui_threshlarexp.chbxNoEMEC_S0Upper);
624 s.restore(m_d->ui.chbxEMEC_S1);
625 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S1LowerThresh);
626 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S1UpperThresh);
627 s.restore(m_d->ui_threshlarexp.chbxNoEMEC_S1Upper);
628 s.restore(m_d->ui.chbxEMEC_S2);
629 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S2LowerThresh);
630 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S2UpperThresh);
631 s.restore(m_d->ui_threshlarexp.chbxNoEMEC_S2Upper);
632 s.restore(m_d->ui.chbxEMEC_S3);
633 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S3LowerThresh);
634 s.restore(m_d->ui_threshlarexp.dspbxEMEC_S3UpperThresh);
635 s.restore(m_d->ui_threshlarexp.chbxNoEMEC_S3Upper);
636 s.restore(m_d->ui.chbxHEC_Neg_Expert);
637 s.restore(m_d->ui.chbxHEC_S0);
638 s.restore(m_d->ui_threshlarexp.dspbxHEC_S0LowerThresh);
639 s.restore(m_d->ui_threshlarexp.dspbxHEC_S0UpperThresh);
640 s.restore(m_d->ui_threshlarexp.chbxNoHEC_S0Upper);
641 s.restore(m_d->ui.chbxHEC_S1);
642 s.restore(m_d->ui_threshlarexp.dspbxHEC_S1LowerThresh);
643 s.restore(m_d->ui_threshlarexp.dspbxHEC_S1UpperThresh);
644 s.restore(m_d->ui_threshlarexp.chbxNoHEC_S1Upper);
645 s.restore(m_d->ui.chbxHEC_S2);
646 s.restore(m_d->ui_threshlarexp.dspbxHEC_S2LowerThresh);
647 s.restore(m_d->ui_threshlarexp.dspbxHEC_S2UpperThresh);
648 s.restore(m_d->ui_threshlarexp.chbxNoHEC_S2Upper);
649 s.restore(m_d->ui.chbxHEC_S3);
650 s.restore(m_d->ui_threshlarexp.dspbxHEC_S3LowerThresh);
651 s.restore(m_d->ui_threshlarexp.dspbxHEC_S3UpperThresh);
652 s.restore(m_d->ui_threshlarexp.chbxNoHEC_S3Upper);
653 s.restore(m_d->ui.chbxFCAL_Neg_Expert);
654 s.restore(m_d->ui.chbxFCAL_M1);
655 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M1LowerThresh);
656 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M1UpperThresh);
657 s.restore(m_d->ui_threshlarexp.chbxNoFCAL_M1Upper);
658 s.restore(m_d->ui.chbxFCAL_M2);
659 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M2LowerThresh);
660 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M2UpperThresh);
661 s.restore(m_d->ui_threshlarexp.chbxNoFCAL_M2Upper);
662 s.restore(m_d->ui.chbxFCAL_M3);
663 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M3LowerThresh);
664 s.restore(m_d->ui_threshlarexp.dspbxFCAL_M3UpperThresh);
665 s.restore(m_d->ui_threshlarexp.chbxNoFCAL_M3Upper);
666 s.restore(m_d->ui.chbxTILB);
667 s.restore(m_d->ui.chbxTILEC);
668 s.restore(m_d->ui.chbxTILCR);
669 s.restore(m_d->ui.chbxTileNegative);
670 s.restore(m_d->ui_threshtile.dspbxTileLowerThresh);
671 s.restore(m_d->ui_threshtile.dspbxTileUpperThresh);
672 s.restore(m_d->ui_threshtile.chbxNoTileUpper);
673 s.restore(m_d->ui_visopts.matbutLArEMBColorPos);
674 s.restore(m_d->ui_visopts.matbutLArEMBColorNeg);
675 s.restore(m_d->ui_visopts.matbutLArEMECColorPos);
676 s.restore(m_d->ui_visopts.matbutLArEMECColorNeg);
677 s.restore(m_d->ui_visopts.matbutLArHECColorPos);
678 s.restore(m_d->ui_visopts.matbutLArHECColorNeg);
679 s.restore(m_d->ui_visopts.matbutLArFCALColorPos);
680 s.restore(m_d->ui_visopts.matbutLArFCALColorNeg);
681 s.restore(m_d->ui_visopts.matbutTileColorPosPMT0);
682 s.restore(m_d->ui_visopts.matbutTileColorPosPMT1);
683 s.restore(m_d->ui_visopts.matbutTileColorPosNeg);
684 s.restore(m_d->ui_visopts.matbutTileColorNegPMT0);
685 s.restore(m_d->ui_visopts.matbutTileColorNegPMT1);
686 s.restore(m_d->ui_visopts.matbutTileColorNegPos);
687 s.restore(m_d->ui_visopts.matbutMbts);
688
689 if(s.version()>0) {
690 s.restore(m_d->ui_visopts.wdgDrawOptions);
691 s.restore(m_d->ui_visopts.chbxShowOutlines);
692 }
693
694 if(s.version()>1) {
695 s.restore(m_d->ui.rbtnModeEt,m_d->ui.rbtnModeEne);
696 }
697
698 if(s.version()>2) {
699 s.restore(m_d->ui_visopts.chbxLogscale);
700 }
701
702 if(s.version()>3) {
703 s.restore(m_d->ui_cuts.chbxSideA);
704 s.restore(m_d->ui_cuts.chbxSideC);
705 s.restore(m_d->ui_cuts.wdgEtaPhiCut);
706 }
707}
708
710{
711 return 4;
712}
713
715{
716 s.save(m_d->ui_interact.chbxDigits);
717 s.save(m_d->ui_visopts.dspbxScale);
718 s.save(m_d->ui.chbxMbts);
719 s.save(m_d->ui_threshmbts.dspbxMbtsThresh);
720 s.save(m_d->ui_badchans.chbxEnableBadChannels);
721 s.save(m_d->ui_badchans.chbxMaskDead);
722 s.save(m_d->ui_badchans.chbxMaskNoisy);
723 s.save(m_d->ui_badchans.chbxMaskAffected);
724 s.save(m_d->ui.rbtnSimple,m_d->ui.rbtnExpert);
725 s.save(m_d->ui.chbxEMB);
726 s.save(m_d->ui.chbxEMEC);
727 s.save(m_d->ui.chbxHEC);
728 s.save(m_d->ui.chbxFCAL);
729 s.save(m_d->ui.chbxLArNegative);
730 s.save(m_d->ui_threshlarsimp.dspbxLArLowerThresh);
731 s.save(m_d->ui_threshlarsimp.dspbxLArUpperThresh);
732 s.save(m_d->ui_threshlarsimp.chbxNoLArUpper);
733 s.save(m_d->ui.chbxEMB_Neg_Expert);
734 s.save(m_d->ui.chbxEMB_S0);
735 s.save(m_d->ui_threshlarexp.dspbxEMB_S0LowerThresh);
736 s.save(m_d->ui_threshlarexp.dspbxEMB_S0UpperThresh);
737 s.save(m_d->ui_threshlarexp.chbxNoEMB_S0Upper);
738 s.save(m_d->ui.chbxEMB_S1);
739 s.save(m_d->ui_threshlarexp.dspbxEMB_S1LowerThresh);
740 s.save(m_d->ui_threshlarexp.dspbxEMB_S1UpperThresh);
741 s.save(m_d->ui_threshlarexp.chbxNoEMB_S1Upper);
742 s.save(m_d->ui.chbxEMB_S2);
743 s.save(m_d->ui_threshlarexp.dspbxEMB_S2LowerThresh);
744 s.save(m_d->ui_threshlarexp.dspbxEMB_S2UpperThresh);
745 s.save(m_d->ui_threshlarexp.chbxNoEMB_S2Upper);
746 s.save(m_d->ui.chbxEMB_S3);
747 s.save(m_d->ui_threshlarexp.dspbxEMB_S3LowerThresh);
748 s.save(m_d->ui_threshlarexp.dspbxEMB_S3UpperThresh);
749 s.save(m_d->ui_threshlarexp.chbxNoEMB_S3Upper);
750 s.save(m_d->ui.chbxEMEC_Neg_Expert);
751 s.save(m_d->ui.chbxEMEC_S0);
752 s.save(m_d->ui_threshlarexp.dspbxEMEC_S0LowerThresh);
753 s.save(m_d->ui_threshlarexp.dspbxEMEC_S0UpperThresh);
754 s.save(m_d->ui_threshlarexp.chbxNoEMEC_S0Upper);
755 s.save(m_d->ui.chbxEMEC_S1);
756 s.save(m_d->ui_threshlarexp.dspbxEMEC_S1LowerThresh);
757 s.save(m_d->ui_threshlarexp.dspbxEMEC_S1UpperThresh);
758 s.save(m_d->ui_threshlarexp.chbxNoEMEC_S1Upper);
759 s.save(m_d->ui.chbxEMEC_S2);
760 s.save(m_d->ui_threshlarexp.dspbxEMEC_S2LowerThresh);
761 s.save(m_d->ui_threshlarexp.dspbxEMEC_S2UpperThresh);
762 s.save(m_d->ui_threshlarexp.chbxNoEMEC_S2Upper);
763 s.save(m_d->ui.chbxEMEC_S3);
764 s.save(m_d->ui_threshlarexp.dspbxEMEC_S3LowerThresh);
765 s.save(m_d->ui_threshlarexp.dspbxEMEC_S3UpperThresh);
766 s.save(m_d->ui_threshlarexp.chbxNoEMEC_S3Upper);
767 s.save(m_d->ui.chbxHEC_Neg_Expert);
768 s.save(m_d->ui.chbxHEC_S0);
769 s.save(m_d->ui_threshlarexp.dspbxHEC_S0LowerThresh);
770 s.save(m_d->ui_threshlarexp.dspbxHEC_S0UpperThresh);
771 s.save(m_d->ui_threshlarexp.chbxNoHEC_S0Upper);
772 s.save(m_d->ui.chbxHEC_S1);
773 s.save(m_d->ui_threshlarexp.dspbxHEC_S1LowerThresh);
774 s.save(m_d->ui_threshlarexp.dspbxHEC_S1UpperThresh);
775 s.save(m_d->ui_threshlarexp.chbxNoHEC_S1Upper);
776 s.save(m_d->ui.chbxHEC_S2);
777 s.save(m_d->ui_threshlarexp.dspbxHEC_S2LowerThresh);
778 s.save(m_d->ui_threshlarexp.dspbxHEC_S2UpperThresh);
779 s.save(m_d->ui_threshlarexp.chbxNoHEC_S2Upper);
780 s.save(m_d->ui.chbxHEC_S3);
781 s.save(m_d->ui_threshlarexp.dspbxHEC_S3LowerThresh);
782 s.save(m_d->ui_threshlarexp.dspbxHEC_S3UpperThresh);
783 s.save(m_d->ui_threshlarexp.chbxNoHEC_S3Upper);
784 s.save(m_d->ui.chbxFCAL_Neg_Expert);
785 s.save(m_d->ui.chbxFCAL_M1);
786 s.save(m_d->ui_threshlarexp.dspbxFCAL_M1LowerThresh);
787 s.save(m_d->ui_threshlarexp.dspbxFCAL_M1UpperThresh);
788 s.save(m_d->ui_threshlarexp.chbxNoFCAL_M1Upper);
789 s.save(m_d->ui.chbxFCAL_M2);
790 s.save(m_d->ui_threshlarexp.dspbxFCAL_M2LowerThresh);
791 s.save(m_d->ui_threshlarexp.dspbxFCAL_M2UpperThresh);
792 s.save(m_d->ui_threshlarexp.chbxNoFCAL_M2Upper);
793 s.save(m_d->ui.chbxFCAL_M3);
794 s.save(m_d->ui_threshlarexp.dspbxFCAL_M3LowerThresh);
795 s.save(m_d->ui_threshlarexp.dspbxFCAL_M3UpperThresh);
796 s.save(m_d->ui_threshlarexp.chbxNoFCAL_M3Upper);
797 s.save(m_d->ui.chbxTILB);
798 s.save(m_d->ui.chbxTILEC);
799 s.save(m_d->ui.chbxTILCR);
800 s.save(m_d->ui.chbxTileNegative);
801 s.save(m_d->ui_threshtile.dspbxTileLowerThresh);
802 s.save(m_d->ui_threshtile.dspbxTileUpperThresh);
803 s.save(m_d->ui_threshtile.chbxNoTileUpper);
804 s.save(m_d->ui_visopts.matbutLArEMBColorPos);
805 s.save(m_d->ui_visopts.matbutLArEMBColorNeg);
806 s.save(m_d->ui_visopts.matbutLArEMECColorPos);
807 s.save(m_d->ui_visopts.matbutLArEMECColorNeg);
808 s.save(m_d->ui_visopts.matbutLArHECColorPos);
809 s.save(m_d->ui_visopts.matbutLArHECColorNeg);
810 s.save(m_d->ui_visopts.matbutLArFCALColorPos);
811 s.save(m_d->ui_visopts.matbutLArFCALColorNeg);
812 s.save(m_d->ui_visopts.matbutTileColorPosPMT0);
813 s.save(m_d->ui_visopts.matbutTileColorPosPMT1);
814 s.save(m_d->ui_visopts.matbutTileColorPosNeg);
815 s.save(m_d->ui_visopts.matbutTileColorNegPMT0);
816 s.save(m_d->ui_visopts.matbutTileColorNegPMT1);
817 s.save(m_d->ui_visopts.matbutTileColorNegPos);
818 s.save(m_d->ui_visopts.matbutMbts);
819 s.save(m_d->ui_visopts.wdgDrawOptions); // 1+
820 s.save(m_d->ui_visopts.chbxShowOutlines); // 1+
821 s.save(m_d->ui.rbtnModeEt,m_d->ui.rbtnModeEne); // 2+
822 s.save(m_d->ui_visopts.chbxLogscale); // 3+
823 s.save(m_d->ui_cuts.chbxSideA); // 4+
824 s.save(m_d->ui_cuts.chbxSideC); // 4+
825 s.save(m_d->ui_cuts.wdgEtaPhiCut); // 4+
826}
827
829{
830 return m_d->ui_visopts.wdgDrawOptions->drawOptionsGroup();
831}
832
834 const TileInfo* tile_info,
835 const TileCablingService* tile_cabling)
836{
837 m_tile_hw_id = tile_hw_id;
838 m_tile_info = tile_info;
839 m_tile_cabling = tile_cabling;
840}
841
843{
844 messageDebug("ClearHideDigitForms()");
845 m_d->singlePlotHasData = false;
846 m_d->digit_form_single->setVisible(false);
847 m_d->doublePlotHasData = false;
848 m_d->digit_form_double->setVisible(false);
849}
850
852{
853 messageDebug("DeleteDigitForms()");
854
855 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
856 /*
857 if (m_d) {
858 messageDebug("delete digit_form_single...");
859 if (m_d->digit_form_single) {
860 delete m_d->digit_form_single;
861 m_d->digit_form_single = 0;
862 }
863 messageDebug("delete digit_form_double...");
864 if (m_d->digit_form_double) {
865 delete m_d->digit_form_double;
866 m_d->digit_form_double = 0;
867 }
868 messageDebug("delete UiDigitsSingle...");
869 if (m_d->UiDigitsSingle) {
870 delete m_d->UiDigitsSingle;
871 m_d->UiDigitsSingle = 0;
872 }
873 messageDebug("delete UiDigitsDouble...");
874 if (m_d->UiDigitsDouble) {
875 delete m_d->UiDigitsDouble;
876 m_d->UiDigitsDouble = 0;
877 }
878 messageDebug("DeleteDigitForms(). End.");
879 }
880 */
881}
882
884{
885 m_d->ui_interact.chbxDigits->setEnabled(enable);
886}
887
889 int /* n_samples */,
890 std::vector<short> /* samples */,
891 std::vector<std::string>& /* msg */)
892{
893 message("VP1CaloCellController::displayLArDigits()... not be ported to 'master' yet, because of failing dependencies (LCG's Qwt has to be ported to Qt5, still)");
894
895 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
896/*
897
898 QwtPlot* plot = m_d->UiDigitsSingle->plotDigits;
899
900 // Pop up the widget
901 m_d->digit_form_single->setVisible(true);
902 m_d->digit_form_double->setVisible(false);
903
904 // Get data
905 QVector<QPointF> _data;
906 for(int ii=0; ii<n_samples;ii++) {
907 _data.push_back(QPointF(ii,samples[ii]));
908 }
909
910 // Create symbol
911 QwtSymbol* sym = new QwtSymbol();
912 sym->setStyle(QwtSymbol::Star1);
913// sym->setPen(QColor(Qt::darkMagenta));
914 sym->setPen(QColor(Qt::red));
915 sym->setSize(5);
916
917 // Create curve
918 QwtPlotCurve* _curve = new QwtPlotCurve("ADC Counts");
919 _curve->setRenderHint(QwtPlotItem::RenderAntialiased);
920 _curve->setSamples(_data); // builds QwtSeriesData objects from arrays internally
921 _curve->setStyle(QwtPlotCurve::NoCurve);
922 _curve->setPen(QPen(Qt::red));
923 _curve->setSymbol(sym);
924
925 // Attach the curve to the hosting plot
926 // std::cout << "plot: " << m_d->UiDigitsSingle->plotDigits << std::endl;
927 _curve->attach(plot);
928
929 // Set the canvas background color
930 plot->setCanvasBackground( QBrush(Qt::white) );
931
932 // Refresh the plot
933// plot->replot();
934 m_d->UiDigitsSingle->plotDigits->replot();
935
936
937 // Set values for the labels
938 m_d->UiDigitsSingle->lblCellName->setText((msg[1]).c_str());
939 m_d->UiDigitsSingle->lblTotalEnergy->setText((msg[3]).c_str());
940 m_d->UiDigitsSingle->lblTotalTime->setText((msg[4]).c_str());
941
942 // hide pmt/gain label
943 m_d->UiDigitsSingle->lblPMTGain->setVisible(false);
944
945 // set the flag for the plot data
946 m_d->singlePlotHasData = true;
947 m_d->doublePlotHasData = false;
948 */
949
950 messageDebug("display LAr digits end.");
951}
952
954 std::vector<float> /*samples1*/,
955 std::vector<float> /*samples2*/,
956 std::vector<std::string>& /*msg*/)
957{
958
959 messageDebug("VP1CaloCellController::displayTileDigits(A)...");
960
961 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
962 /*
963 // Pop up the widget
964 m_d->digit_form_double->setVisible(true);
965 m_d->digit_form_single->setVisible(false);
966
967 messageDebug("Setting text...");
968 m_d->UiDigitsDouble->lblCellName->setText(msg[1].c_str());
969 m_d->UiDigitsDouble->lblTotalEnergy->setText(msg[2].c_str());
970 m_d->UiDigitsDouble->lblTotalTime->setText(msg[3].c_str());
971
972
973 messageDebug("Calling DrawTileDigits()...");
974 DrawTileDigits(m_d->UiDigitsDouble->plotDigits_1,n_samples,samples1);
975 messageDebug("Called on plotDigits_1.");
976 DrawTileDigits(m_d->UiDigitsDouble->plotDigits_2,n_samples,samples2);
977 messageDebug("Called on plotDigits_2.");
978
979 // set the flag for the plot data
980 m_d->doublePlotHasData = true;
981 m_d->singlePlotHasData = false;
982 */
983}
984
986 std::vector<float> /*samples*/,
987 std::vector<std::string>& /*msg*/)
988{
989 messageDebug("VP1CaloCellController::displayTileDigits(B)...");
990
991 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
992 /*
993 // Pop up the widget
994 m_d->digit_form_single->setVisible(true);
995 m_d->digit_form_double->setVisible(false);
996
997 messageDebug("Setting text...");
998 m_d->UiDigitsSingle->lblCellName->setText(msg[1].c_str());
999 m_d->UiDigitsSingle->lblTotalEnergy->setText(msg[2].c_str());
1000 m_d->UiDigitsSingle->lblTotalTime->setText(msg[3].c_str());
1001
1002 // show pmt/gain label
1003 messageDebug("Show pmt/gain...");
1004 m_d->UiDigitsSingle->lblPMTGain->setVisible(true);
1005
1006 messageDebug("calling DrawTileDigits()...");
1007 DrawTileDigits(m_d->UiDigitsSingle->plotDigits,n_samples,samples);
1008 messageDebug("called DrawTileDigits().");
1009
1010 // set the flag for the plot data
1011 m_d->doublePlotHasData = true;
1012 m_d->singlePlotHasData = false;
1013 */
1014}
1015
1017 const TileRawChannel* /*rawchannel2*/,
1018 const TileRawChannelContainer* /*rawchannel_cont*/,
1019 size_t /*digitsize*/)
1020{
1021 messageDebug("VP1CaloCellController::displayTilePulse(A)...");
1022
1023 // std::cout << ""
1024 // << "a:" << m_d->UiDigitsDouble->plotDigits_1 << " - "
1025 // << "b:" << m_d->UiDigitsDouble->lblPMTGain_1 << " - "
1026 // << "c:" << rawchannel1 << " - "
1027 // << "m_d:" << rawchannel_cont << " - "
1028 // << "e:" << m_d->UiDigitsDouble->plotDigits_2 << " - "
1029 // << "f:" << m_d->UiDigitsDouble->lblPMTGain_2 << " - "
1030 // << "g:" << rawchannel2 << " - "
1031 // << "h:" << digitsize
1032 // << std::endl;
1033
1034
1035 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
1036// DrawTilePulse(m_d->UiDigitsDouble->plotDigits_1,
1037// m_d->UiDigitsDouble->lblPMTGain_1,
1038// rawchannel1,
1039// rawchannel_cont,
1040// digitsize);
1041// std::cout << "Drawn digits_1" << std::endl;
1042//
1043// DrawTilePulse(m_d->UiDigitsDouble->plotDigits_2,
1044// m_d->UiDigitsDouble->lblPMTGain_2,
1045// rawchannel2,
1046// rawchannel_cont,
1047// digitsize);
1048// std::cout << "Drawn digits_2" << std::endl;
1049}
1050
1052 const TileRawChannelContainer* /*rawchannel_cont*/,
1053 size_t /*digitsize*/)
1054{
1055 messageDebug("VP1CaloCellController::displayTilePulse(B)...");
1056
1057 // FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
1058// DrawTilePulse(m_d->UiDigitsSingle->plotDigits,
1059// m_d->UiDigitsSingle->lblPMTGain,
1060// rawchannel,
1061// rawchannel_cont,
1062// digitsize);
1063
1064 messageDebug("displayTilePulse(). End.");
1065}
1066
1068{
1069 Imp::MatButtonMap::const_iterator it = m_d->matButtonMap.find(type);
1070 if(it!=m_d->matButtonMap.end())
1071 return getMaterial(it->second);
1072 else
1073 return 0;
1074}
1075
1077{
1078 // Which sel2Gui map are we working with? This depends on the active mode (simple/expert)
1079 VP1CCSelectionType2GuiMap* useMap = 0;
1080
1081 if(m_d->ui.rbtnSimple->isChecked())
1082 useMap = &(m_d->sel2GuiSimple);
1083 else
1084 useMap = &(m_d->sel2GuiExpert);
1085
1086 VP1CCIntervalMap returnMap;
1087
1088 // Construct a new map of intervals based on values of GUI widgets
1089 for (const auto& p : *useMap) {
1090 // Pointer to the current structure
1091 VP1CCUi2Manager* ui = p.second;
1092
1093 VP1Interval posInterval, negInterval;
1094 bool positiveON = true;
1095 bool negativeON = true;
1096
1097 // If subsystem is unchecked set pos/neg OFF
1098 if(!ui->globalEnableCB->isChecked()) {
1099 positiveON = false;
1100 negativeON = false;
1101 }
1102
1103 // If negative is unchecked set neg OFF
1104 if(!ui->showNegativeCB->isChecked())
1105 negativeON = false;
1106
1107 // If upper threshold is available and lower>upper set pos/neg OFF
1108 if(!ui->upperThreshOffCB->isChecked() &&
1109 ui->lowerThresholdSB->value() > ui->upperThresholdSB->value()){
1110 positiveON = false;
1111 negativeON = false;
1112 }
1113
1114 // Construct new interval for positive cells
1115 if(positiveON){
1116 if(ui->upperThreshOffCB->isChecked())
1117 posInterval.setUpper(VP1Interval::inf());
1118 else {
1119 posInterval.setUpper(ui->upperThresholdSB->value());
1120 posInterval.setOpenUpper(false);
1121 }
1122 posInterval.setLower(ui->lowerThresholdSB->value());
1123 posInterval.setOpenLower(false);
1124 }
1125
1126 // We use the same interval for negative cells as well if they are ON
1127 if(negativeON)
1128 negInterval = posInterval;
1129
1130 returnMap[p.first] = VP1CCIntervalPair(posInterval,negInterval);
1131 }
1132
1133 return returnMap;
1134}
1135
1136QPair<bool,double> VP1CaloCellController::scale() const
1137{
1138 double scl = m_d->ui_visopts.chbxLogscale->isChecked() ? m_d->ui_visopts.dspbxScale->value()*Gaudi::Units::m/log(1+10*Gaudi::Units::GeV) : m_d->ui_visopts.dspbxScale->value()*Gaudi::Units::m/(10*Gaudi::Units::GeV);
1139 return QPair<bool,double>(m_d->ui_visopts.chbxLogscale->isChecked(),scl);
1140}
1141
1143{
1144 VP1Interval returnInterval;
1145 if(m_d->ui.chbxMbts->isChecked()) {
1146 returnInterval.setUpper(VP1Interval::inf());
1147 returnInterval.setLower(m_d->ui_threshmbts.dspbxMbtsThresh->value());
1148 returnInterval.setOpenLower(false);
1149 }
1150
1151 return returnInterval;
1152}
1153
1155{
1156 return m_d->ui_interact.chbxDigits->isChecked();
1157}
1158
1160{
1161 return m_d->ui_visopts.chbxShowOutlines->isChecked();
1162}
1163
1165{
1166 return m_d->ui.rbtnModeEt->isChecked();
1167}
1168
1170{
1172 globalCuts.sideA = m_d->ui_cuts.chbxSideA->isChecked();
1173 globalCuts.sideC = m_d->ui_cuts.chbxSideC->isChecked();
1174 globalCuts.allowedEta = m_d->ui_cuts.wdgEtaPhiCut->allowedEta();
1175 globalCuts.allowedPhi = m_d->ui_cuts.wdgEtaPhiCut->allowedPhi();
1176 globalCuts.clipRadius = 10e9;
1177 // no easy way to get the 'current' value since we don't know where in the AnimationSequence we are. Need to rely on this being updated by connections.
1178
1179 return globalCuts;
1180}
1181
1182// FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
1183//void VP1CaloCellController::DrawTileDigits(QwtPlot* plot,
1184// int n_samples,
1185// std::vector<float> samples)
1186//{
1187// messageDebug("VP1CaloCellController::DrawTileDigits()...");
1188//
1189// // Get data
1190// QVector<QPointF> _data;
1191// for(int ii=0; ii<n_samples;ii++) {
1192// _data.push_back(QPointF(ii,samples[ii]));
1193// }
1194//
1195// // Create symbol
1196// QwtSymbol* sym = new QwtSymbol();
1197// sym->setStyle(QwtSymbol::Star1);
1198// sym->setPen(QColor(Qt::red));
1199// sym->setSize(5);
1200//
1201// // Create curve
1202// QwtPlotCurve* _curve = new QwtPlotCurve("ADC Counts");
1203// _curve->setRenderHint(QwtPlotItem::RenderAntialiased);
1204// _curve->setSamples(_data);
1205// _curve->setStyle(QwtPlotCurve::NoCurve);
1206// _curve->setPen(QPen(Qt::red));
1207// _curve->setSymbol(sym);
1208//
1209// // Attach curve to the hosting plot
1210// _curve->attach(plot);
1211//
1212// // Set the canvas background color
1213// plot->setCanvasBackground( QBrush(Qt::white) );
1214//
1215// // Refresh the plot
1216// plot->replot();
1217//}
1218//
1219
1220
1221// FIXME:You have to compile Qwt with Qt5. LCG's Qwt is compiled with Qt4 only...
1222//void VP1CaloCellController::DrawTilePulse(QwtPlot* plot,
1223// QLabel* gainlabel,
1224// const TileRawChannel* rawchannel,
1225// const TileRawChannelContainer* rawchannel_cont,
1226// size_t digitsize)
1227//{
1228// messageDebug("VP1CaloCellController::DrawTilePulse()...");
1229//
1230// // convert amplitude
1231// double _amplitude1 = rawchannel->amplitude();
1232// HWIdentifier adc_hwid1 = rawchannel->adc_HWID();
1233//
1234// std::ostringstream pmtgain1;
1235//
1242//
1243// pmtgain1 << " PMT " << m_tile_cabling->channel2hole(m_tile_hw_id->ros(adc_hwid1),m_tile_hw_id->channel(adc_hwid1))
1244// << " Gain " << m_tile_hw_id->adc(adc_hwid1);
1245//
1246// gainlabel->setText(pmtgain1.str().c_str());
1247//
1248// std::cout << "DEBUG - Getting TileInfo..." << std::endl;
1249// try {
1250// _amplitude1 /= m_tile_info->ChannelCalib(adc_hwid1,
1251// TileRawChannelUnit::ADCcounts,
1252// rawchannel_cont->get_unit(),
1253// rawchannel_cont->get_type());
1254// } catch (TileCalib::InvalidRawChanUnit& e) {
1255// std::cout << "ERROR!!! Exception caught from Tile! --> " << e.what() << std::endl;
1256// std::cout << "re-throwing it..." << std::endl;
1257// throw e;
1258// }
1259//
1260//
1261//
1262// // Get correct vector of values depending on the gain
1263// std::vector<double> *xval, *yval;
1264// if(m_tile_hw_id->adc(adc_hwid1) == 0)
1265// {
1266// xval = &(m_tile_info->getPulseShapes()->m_tlphys);
1267// yval = &(m_tile_info->getPulseShapes()->m_ylphys);
1268// }
1269// else if(m_tile_hw_id->adc(adc_hwid1) == 1)
1270// {
1271// xval = &(m_tile_info->getPulseShapes()->m_thphys);
1272// yval = &(m_tile_info->getPulseShapes()->m_yhphys);
1273// }
1274// else
1275// return;
1276//
1277// // Prepare data for plotting
1278// QVector<QPointF> _data;
1279// for(size_t i=0; i<xval->size(); i++) {
1280// double xpoint = ((*xval)[i] + rawchannel->time())/25. + (digitsize - 1)/2.;
1281// double ypoint = rawchannel->pedestal() + _amplitude1*(*yval)[i];
1282//
1283// if(xpoint >= 0 && xpoint <= digitsize -1)
1284// _data.push_back(QPointF(xpoint,ypoint));
1285// }
1286//
1287// // Create curve
1288// QwtPlotCurve* _curve = new QwtPlotCurve("Pulse");
1289// _curve->setRenderHint(QwtPlotItem::RenderAntialiased);
1290// _curve->setSamples(_data);
1291// _curve->setStyle(QwtPlotCurve::Dots);
1292// _curve->setPen(QPen(Qt::blue));
1293//
1294// // Attach the curve to the hosting plot
1295// _curve->attach(plot);
1296//
1297// // Refresh the plot
1298// plot->replot();
1299//}
1300
1301// --------------------- SLOTS ------------------------
1303{
1304 // Which sel2Gui map are we working with? This depends on the active mode (simple/expert)
1305 VP1CCSelectionType2GuiMap* useMap = 0;
1306
1307 if(m_d->ui.rbtnSimple->isChecked())
1308 useMap = &(m_d->sel2GuiSimple);
1309 else
1310 useMap = &(m_d->sel2GuiExpert);
1311
1312 for (const auto& p : *useMap) {
1313 VP1CCUi2Manager* ui = p.second;
1314 ui->upperThresholdSB->setEnabled(!ui->upperThreshOffCB->isChecked());
1315 }
1316}
1317
1319{
1320 if(m_d->ui.rbtnSimple->isChecked()) {
1321 m_d->ui.stackLAr->setCurrentIndex(0);
1322 m_d->ui.pushButton_settings_thresholds_larsimple->setEnabled(true);
1323 m_d->ui.pushButton_settings_thresholds_larexpert->setEnabled(false);
1324 }
1325 else {
1326 m_d->ui.stackLAr->setCurrentIndex(1);
1327 m_d->ui.pushButton_settings_thresholds_larsimple->setEnabled(false);
1328 m_d->ui.pushButton_settings_thresholds_larexpert->setEnabled(true);
1329 }
1330}
1331
1332#define VP1CONTROLLERCLASSNAME VP1CaloCellController
1334
1335POSSIBLECHANGE_IMP(selectionIntervals)
1336POSSIBLECHANGE_IMP(scale)
1337POSSIBLECHANGE_IMP(selectionMbts)
1338POSSIBLECHANGE_IMP(showDigits)
1339POSSIBLECHANGE_IMP(showVolumeOutLines)
1340POSSIBLECHANGE_IMP(energyModeEt)
1341POSSIBLECHANGE_IMP(globalCuts)
std::map< VP1CC_SelectionTypes, VP1CCUi2Manager * > VP1CCSelectionType2GuiMap
VP1CC_SeparatorTypes
@ VP1CC_SepTileNegativeDown
@ VP1CC_SepTilePositiveDown
@ VP1CC_SepLArEMBPos
@ VP1CC_SepLArHECNeg
@ VP1CC_SepLArFCALPos
@ VP1CC_SepLArEMECPos
@ VP1CC_SepMBTS
@ VP1CC_SepTilePositiveNeg
@ VP1CC_SepLArEMECNeg
@ VP1CC_SepTilePositiveUp
@ VP1CC_SepLArEMBNeg
@ VP1CC_SepLArHECPos
@ VP1CC_SepTileNegativePos
@ VP1CC_SepTileNegativeUp
@ VP1CC_SepLArFCALNeg
QPair< VP1Interval, VP1Interval > VP1CCIntervalPair
QMap< VP1CC_SelectionTypes, VP1CCIntervalPair > VP1CCIntervalMap
@ VP1CC_SelTypeEMB2
@ VP1CC_SelTypeEMEC1
@ VP1CC_SelTypeFCAL3
@ VP1CC_SelTypeTileB
@ VP1CC_SelTypeEMEC3
@ VP1CC_SelTypeFCAL1
@ VP1CC_SelTypeHEC0
@ VP1CC_SelTypeHEC2
@ VP1CC_SelTypeTileEC
@ VP1CC_SelTypeEMB3
@ VP1CC_SelTypeEMEC0
@ VP1CC_SelTypeEMB0
@ VP1CC_SelTypeFCAL2
@ VP1CC_SelTypeEMB1
@ VP1CC_SelTypeEMEC2
@ VP1CC_SelTypeHEC3
@ VP1CC_SelTypeHEC1
@ VP1CC_SelTypeTileCrack
#define POSSIBLECHANGE_IMP(x)
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
VP1CaloCellController * theclass
Ui::frmCaloCellController ui
VP1CCSelectionType2GuiMap sel2GuiSimple
Ui::frmCaloCellThresholdsLArExpert ui_threshlarexp
VP1CCSelectionType2GuiMap sel2GuiExpert
Ui::frmCaloCellThresholdsMbts ui_threshmbts
Ui::frmCaloCellInteractions ui_interact
Ui::frmCaloCellVisOptions ui_visopts
Ui::frmCaloCellBadChannels ui_badchans
Ui::frmCaloCellThresholdsLArSimple ui_threshlarsimp
Ui::frmCaloCellThresholdsTile ui_threshtile
std::map< VP1CC_SeparatorTypes, VP1MaterialButton * > MatButtonMap
VP1CC_GlobalCuts globalCuts() const
void possibleChange_globalCuts()
void possibleChange_energyModeEt()
const TileCablingService * m_tile_cabling
void possibleChange_selectionMbts()
SoMaterial * GetMaterial(VP1CC_SeparatorTypes type)
void EnableDigitsCheckbox(bool enable)
void displayTileDigits(int n_samples, std::vector< float > samples1, std::vector< float > samples2, std::vector< std::string > &msg)
void displayLArDigits(int n_samples, std::vector< short > samples, std::vector< std::string > &msg)
void possibleChange_showDigits()
void initTilePulse(const TileHWID *tile_hw_id, const TileInfo *tile_info, const TileCablingService *tile_cabling)
VP1CCIntervalMap selectionIntervals() const
void possibleChange_showVolumeOutLines()
VP1Interval selectionMbts() const
QPair< bool, double > scale() const
void actualRestoreSettings(VP1Deserialise &)
void actualSaveSettings(VP1Serialise &) const
void possibleChange_selectionIntervals()
void displayTilePulse(const TileRawChannel *rawchannel1, const TileRawChannel *rawchannel2, const TileRawChannelContainer *rawchannel_cont, size_t digitsize)
VP1CaloCellController(IVP1System *sys)
void initDialog(T &theUI, QPushButton *launchbutton, QAbstractButton *enabledButton=0)
SoMaterial * getMaterial(VP1MaterialButton *) const
void connectToLastUpdateSlot(QObject *sender, const char *signal)
const char * addUpdateSlot(const char *slot)
VP1Controller(IVP1System *sys, const QString &classname)
void message(const QString &) const
void messageDebug(const QString &) const
void setOpenUpper(bool openUpper)
void setLower(const double &lower)
void setOpenLower(bool openLower)
static double inf()
Definition VP1Interval.h:25
void setUpper(const double &upper)
static SoMaterial * createMaterial(const QColor &, const double &brightness=0.0, const double &transp=0.0)
const QCheckBox * upperThreshOffCB
const QCheckBox * globalEnableCB
const QCheckBox * showNegativeCB
const QDoubleSpinBox * lowerThresholdSB
QDoubleSpinBox * upperThresholdSB