ATLAS Offline Software
VP1RawDataSysController.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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"
22 #include "VP1Base/VP1Serialise.h"
23 #include "VP1Base/VP1Deserialise.h"
25 
26 #include "GaudiKernel/SystemOfUnits.h"
27 
28 #include <cmath>
29 
30 
31 //____________________________________________________________________
33 public:
34  Ui::VP1RawDataControllerForm ui{};
35  Ui::RawDataSysSettingsCutsForm ui_cuts{};
36  Ui::RawDataSysSettingsInteractionsForm ui_int{};
37  Ui::RawDataSysSettingsDisplayForm ui_display{};
39 
41  QList<VP1Interval> last_cutAllowedPhi;//All off: empty list. All on: list with one entry: ]-inf,inf[
45  VP1RawDataFlags::InDetPartsFlags last_enabledInDetParts;
46  bool last_trtRequireHT = false;
48  unsigned last_lucidMinQDC = 0U;
49 };
50 
51 //____________________________________________________________________
53  : VP1Controller(sys,"VP1RawDataSysController"), m_d(new Imp)
54 {
55  m_d->ui.setupUi(this);
56 
58  setupCollWidgetInScrollArea(m_d->ui.collWidgetScrollArea,m_d->collWidget);
59 
60  initDialog(m_d->ui_display, m_d->ui.pushButton_settings_display);
61  initDialog(m_d->ui_int, m_d->ui.pushButton_settings_interactions);
62  initDialog(m_d->ui_cuts, m_d->ui.pushButton_settings_cuts);
63 
64  m_d->ui_display.widget_drawOptions->setLineWidths(1.5);
65  m_d->ui_display.widget_drawOptions->setPointSizes(2.5);
66  m_d->ui_display.widget_drawOptions->setComplexityDisabled();
67 
68  m_d->ui_cuts.etaPhiCutWidget->setEtaCutEnabled(false);
69 
70  m_d->ui_display.matButton_trtht->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0));
71  m_d->ui_display.matButton_bcmhighatt->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0));
72 
73 
75  // Setup connections which monitor changes in the controller so that we may emit signals as appropriate: //
77 
78  // -> cutAllowedEta:
80  connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedEtaChanged(const VP1Interval&)));
81 
82  // -> cutAllowedPhi:
84  connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&)));
85 
86  // -> showVolumeOutLines
88  connectToLastUpdateSlot(m_d->ui_display.checkBox_showVolumeOutLines);
89 
90  // -> useSpecialTRTHTMaterial
92  connectToLastUpdateSlot(m_d->ui_display.checkBox_trtHTUseSpecialMat);
93 
94  // -> useSpecialBCMHighAttMaterial
96  connectToLastUpdateSlot(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
97 
98  // -> enabledInDetParts
100  connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_barrelA);
101  connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_barrelC);
102  connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_endcapA);
103  connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_endcapC);
104 
105  // -> trtRequireHT
107  connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_needHT);
108 
109  // -> trtAllowedToT
111  connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMin);
112  connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
113  connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMax);
114  connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
115 
116  // -> lucidMinQDC
118  connectToLastUpdateSlot(m_d->ui_cuts.spinBox_lucid_qdc_min);
119 
120  initLastVars();
121 }
122 
123 //____________________________________________________________________
125 {
126  delete m_d;
127 }
128 
129 
130 //____________________________________________________________________
132 {
133  return 1;
134 }
135 
136 //____________________________________________________________________
138 {
139  s.save(m_d->ui_cuts.etaPhiCutWidget);
140  s.save(m_d->ui_cuts.checkBox_cut_indet_barrelA);
141  s.save(m_d->ui_cuts.checkBox_cut_indet_barrelC);
142  s.save(m_d->ui_cuts.checkBox_cut_indet_endcapA);
143  s.save(m_d->ui_cuts.checkBox_cut_indet_endcapC);
144  s.save(m_d->ui_cuts.checkbox_cut_trt_needHT);
145  s.save(m_d->ui_cuts.checkbox_cut_trt_TotMin);
146  s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
147  s.save(m_d->ui_cuts.checkbox_cut_trt_TotMax);
148  s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
149  s.save(m_d->ui_display.checkBox_showVolumeOutLines);
150  s.save(m_d->ui_display.widget_drawOptions);
151  s.save(m_d->ui_display.checkBox_trtHTUseSpecialMat);
152  s.save(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
153  s.save(m_d->ui_display.matButton_trtht);
154  s.save(m_d->ui_display.matButton_bcmhighatt);
155  s.save(m_d->ui_int.checkBox_printinfo);
156  s.save(m_d->ui_int.checkBox_printinfo_verbose);
157  s.save(m_d->ui_int.checkBox_zoom);
158  s.save(m_d->ui_cuts.spinBox_lucid_qdc_min);//Version 1+
159 }
160 
161 //____________________________________________________________________
163 {
164  if (s.version()<0||s.version()>1) {
165  message("Warning: State data in .vp1 file has unsupported version ("+str(s.version())+")");
166  return;
167  }
168  s.restore(m_d->ui_cuts.etaPhiCutWidget);
169  s.restore(m_d->ui_cuts.checkBox_cut_indet_barrelA);
170  s.restore(m_d->ui_cuts.checkBox_cut_indet_barrelC);
171  s.restore(m_d->ui_cuts.checkBox_cut_indet_endcapA);
172  s.restore(m_d->ui_cuts.checkBox_cut_indet_endcapC);
173  s.restore(m_d->ui_cuts.checkbox_cut_trt_needHT);
174  s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMin);
175  s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMin);
176  s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMax);
177  s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMax);
178  s.restore(m_d->ui_display.checkBox_showVolumeOutLines);
179  s.restore(m_d->ui_display.widget_drawOptions);
180  s.restore(m_d->ui_display.checkBox_trtHTUseSpecialMat);
181  s.restore(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat);
182  s.restore(m_d->ui_display.matButton_trtht);
183  s.restore(m_d->ui_display.matButton_bcmhighatt);
184  s.restore(m_d->ui_int.checkBox_printinfo);
185  s.restore(m_d->ui_int.checkBox_printinfo_verbose);
186  s.restore(m_d->ui_int.checkBox_zoom);
187  if (s.version()>=1)
188  s.restore(m_d->ui_cuts.spinBox_lucid_qdc_min);
189 }
190 
191 //____________________________________________________________________
193 {
194  return m_d->collWidget;
195 }
196 
197 //____________________________________________________________________
199 {
200  return m_d->ui_display.widget_drawOptions->drawOptionsGroup();
201 }
202 
203 //____________________________________________________________________
204 bool VP1RawDataSysController::printInfoOnClick() const { return m_d->ui_int.checkBox_printinfo->isChecked(); }
205 bool VP1RawDataSysController::printVerboseInfoOnClick() const { return m_d->ui_int.checkBox_printinfo_verbose->isChecked(); }
206 bool VP1RawDataSysController::zoomOnClick() const { return m_d->ui_int.checkBox_zoom->isChecked(); }
207 
208 //____________________________________________________________________
210 {
211  return m_d->ui_cuts.etaPhiCutWidget->allowedEta();
212 }
213 
214 //____________________________________________________________________
215 QList<VP1Interval> VP1RawDataSysController::cutAllowedPhi() const
216 {
217  return m_d->ui_cuts.etaPhiCutWidget->allowedPhi();
218 }
219 
220 //____________________________________________________________________
222 {
223  return m_d->ui_display.checkBox_showVolumeOutLines->isChecked();
224 }
225 
226 //____________________________________________________________________
228 {
229  return m_d->ui_display.checkBox_trtHTUseSpecialMat->isChecked();
230 }
231 
232 //____________________________________________________________________
234 {
235  return m_d->ui_display.checkBox_bcmHighAttUseSpecialMat->isChecked();
236 }
237 
238 //____________________________________________________________________
239 VP1RawDataFlags::InDetPartsFlags VP1RawDataSysController::enabledInDetParts() const
240 {
241  VP1RawDataFlags::InDetPartsFlags f;
242  if (m_d->ui_cuts.checkBox_cut_indet_barrelA->isChecked())
244  if (m_d->ui_cuts.checkBox_cut_indet_barrelC->isChecked())
246  if (m_d->ui_cuts.checkBox_cut_indet_endcapA->isChecked())
248  if (m_d->ui_cuts.checkBox_cut_indet_endcapC->isChecked())
250  return f;
251 }
252 
253 //____________________________________________________________________
255 {
256  return m_d->ui_cuts.checkbox_cut_trt_needHT->isChecked();
257 }
258 
259 //____________________________________________________________________
261 {
262  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() ),
263  (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() ) );
264  return i.lower()>i.upper() ? VP1Interval() : i;
265 }
266 
267 //____________________________________________________________________
269 {
270  return m_d->ui_cuts.spinBox_lucid_qdc_min->value();
271 }
272 
273 //____________________________________________________________________
275 {
276  return getMaterial(m_d->ui_display.matButton_trtht);
277 }
278 
279 //____________________________________________________________________
281 {
282  return getMaterial(m_d->ui_display.matButton_bcmhighatt);
283 }
284 
286 // Test for possible changes in values and emit signals as appropriate:
287 // (possibleChange_XXX() slots code provided by macros)
288 #define VP1CONTROLLERCLASSNAME VP1RawDataSysController
290 POSSIBLECHANGE_IMP(cutAllowedEta)
291 POSSIBLECHANGE_IMP(cutAllowedPhi)
292 POSSIBLECHANGE_IMP(showVolumeOutLines)
293 POSSIBLECHANGE_IMP(useSpecialTRTHTMaterial)
294 POSSIBLECHANGE_IMP(useSpecialBCMHighAttMaterial)
295 POSSIBLECHANGE_IMP(enabledInDetParts)
296 POSSIBLECHANGE_IMP(trtRequireHT)
297 POSSIBLECHANGE_IMP(trtAllowedToT)
298 POSSIBLECHANGE_IMP(lucidMinQDC)
VP1Serialise.h
VP1RawDataSysController::Imp::last_trtAllowedToT
VP1Interval last_trtAllowedToT
Definition: VP1RawDataSysController.cxx:47
VP1RawDataSysController::possibleChange_cutAllowedEta
void possibleChange_cutAllowedEta()
VP1Controller::addUpdateSlot
const char * addUpdateSlot(const char *slot)
Definition: VP1Controller.cxx:318
VP1Controller::setupCollWidgetInScrollArea
void setupCollWidgetInScrollArea(QScrollArea *scrollarea, VP1CollectionWidget *collWidget)
Definition: VP1Controller.cxx:255
VP1RawDataSysController::cutAllowedPhi
QList< VP1Interval > cutAllowedPhi() const
Definition: VP1RawDataSysController.cxx:215
POSSIBLECHANGE_IMP
#define POSSIBLECHANGE_IMP(x)
Definition: VP1ControllerMacros.h:18
VP1RawDataSysController::Imp::last_lucidMinQDC
unsigned last_lucidMinQDC
Definition: VP1RawDataSysController.cxx:48
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1RawDataFlags::EndCapPositive
@ EndCapPositive
Definition: VP1RawDataFlags.h:27
VP1RawDataSysController::Imp::last_useSpecialBCMHighAttMaterial
bool last_useSpecialBCMHighAttMaterial
Definition: VP1RawDataSysController.cxx:44
VP1Deserialise.h
VP1Serialise
Definition: VP1Serialise.h:45
VP1RawDataSysController::actualRestoreSettings
void actualRestoreSettings(VP1Deserialise &)
Definition: VP1RawDataSysController.cxx:162
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
VP1RawDataSysController::zoomOnClick
bool zoomOnClick() const
Definition: VP1RawDataSysController.cxx:206
VP1RawDataSysController::~VP1RawDataSysController
virtual ~VP1RawDataSysController()
Definition: VP1RawDataSysController.cxx:124
VP1RawDataSysController::possibleChange_lucidMinQDC
void possibleChange_lucidMinQDC()
VP1Controller::initDialog
void initDialog(T &theUI, QPushButton *launchbutton, QAbstractButton *enabledButton=0)
Definition: VP1Controller.h:144
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
VP1RawDataSysController::actualSaveSettings
void actualSaveSettings(VP1Serialise &) const
Definition: VP1RawDataSysController.cxx:137
VP1RawDataSysController::trtHTMaterial
SoMaterial * trtHTMaterial() const
Definition: VP1RawDataSysController.cxx:274
VP1RawDataSysController::cutAllowedEta
VP1Interval cutAllowedEta() const
Definition: VP1RawDataSysController.cxx:209
VP1RawDataSysController::possibleChange_trtRequireHT
void possibleChange_trtRequireHT()
VP1RawDataSysController::showVolumeOutLines
bool showVolumeOutLines() const
Definition: VP1RawDataSysController.cxx:221
VP1RawDataSysController::bcmHighAttMaterial
SoMaterial * bcmHighAttMaterial() const
Definition: VP1RawDataSysController.cxx:280
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1RawDataSysController::currentSettingsVersion
int currentSettingsVersion() const
Definition: VP1RawDataSysController.cxx:131
VP1Controller::connectToLastUpdateSlot
void connectToLastUpdateSlot(QObject *sender, const char *signal)
Definition: VP1Controller.cxx:327
VP1RawDataSysController::Imp::ui
Ui::VP1RawDataControllerForm ui
Definition: VP1RawDataSysController.cxx:34
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
VP1CollectionWidget.h
VP1RawDataSysController::trtRequireHT
bool trtRequireHT() const
Definition: VP1RawDataSysController.cxx:254
VP1RawDataSysController::possibleChange_enabledInDetParts
void possibleChange_enabledInDetParts()
IVP1System
Definition: IVP1System.h:36
VP1RawDataSysController::VP1RawDataSysController
VP1RawDataSysController(IVP1System *sys)
Definition: VP1RawDataSysController.cxx:52
VP1RawDataSysController::trtAllowedToT
VP1Interval trtAllowedToT() const
Definition: VP1RawDataSysController.cxx:260
VP1RawDataSysController::Imp::ui_int
Ui::RawDataSysSettingsInteractionsForm ui_int
Definition: VP1RawDataSysController.cxx:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1RawDataSysController::Imp::ui_display
Ui::RawDataSysSettingsDisplayForm ui_display
Definition: VP1RawDataSysController.cxx:37
VP1Interval::inf
static double inf()
Definition: VP1Interval.h:25
VP1RawDataSysController.h
VP1RawDataSysController::Imp::last_trtRequireHT
bool last_trtRequireHT
Definition: VP1RawDataSysController.cxx:46
VP1RawDataSysController::possibleChange_cutAllowedPhi
void possibleChange_cutAllowedPhi()
VP1RawDataSysController::possibleChange_useSpecialBCMHighAttMaterial
void possibleChange_useSpecialBCMHighAttMaterial()
VP1RawDataSysController::Imp::last_cutAllowedPhi
QList< VP1Interval > last_cutAllowedPhi
Definition: VP1RawDataSysController.cxx:41
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VP1RawDataSysController::Imp::last_useSpecialTRTHTMaterial
bool last_useSpecialTRTHTMaterial
Definition: VP1RawDataSysController.cxx:43
VP1Deserialise
Definition: VP1Deserialise.h:44
VP1RawDataSysController::printInfoOnClick
bool printInfoOnClick() const
Definition: VP1RawDataSysController.cxx:204
VP1Controller
Definition: VP1Controller.h:45
VP1RawDataSysController::Imp::ui_cuts
Ui::RawDataSysSettingsCutsForm ui_cuts
Definition: VP1RawDataSysController.cxx:35
VP1RawDataSysController::useSpecialTRTHTMaterial
bool useSpecialTRTHTMaterial() const
Definition: VP1RawDataSysController.cxx:227
VP1MaterialButton::createMaterial
static SoMaterial * createMaterial(const QColor &, const double &brightness=0.0, const double &transp=0.0)
Definition: VP1MaterialButton.cxx:786
VP1RawDataSysController::m_d
Imp * m_d
Definition: VP1RawDataSysController.h:86
VP1Controller::getMaterial
SoMaterial * getMaterial(VP1MaterialButton *) const
Definition: VP1Controller.cxx:437
VP1RawDataSysController::enabledInDetParts
VP1RawDataFlags::InDetPartsFlags enabledInDetParts() const
Definition: VP1RawDataSysController.cxx:239
VP1RawDataSysController::Imp::last_showVolumeOutLines
bool last_showVolumeOutLines
Definition: VP1RawDataSysController.cxx:42
VP1Interval
Definition: VP1Interval.h:23
VP1RawDataSysController::Imp::collWidget
VP1CollectionWidget * collWidget
Definition: VP1RawDataSysController.cxx:38
VP1RawDataSysController::printVerboseInfoOnClick
bool printVerboseInfoOnClick() const
Definition: VP1RawDataSysController.cxx:205
VP1RawDataFlags::BarrelNegative
@ BarrelNegative
Definition: VP1RawDataFlags.h:26
VP1CollectionWidget
Definition: VP1CollectionWidget.h:32
VP1RawDataSysController::collWidget
VP1CollectionWidget * collWidget() const
Definition: VP1RawDataSysController.cxx:192
VP1RawDataSysController::Imp::last_enabledInDetParts
VP1RawDataFlags::InDetPartsFlags last_enabledInDetParts
Definition: VP1RawDataSysController.cxx:45
VP1RawDataSysController::possibleChange_showVolumeOutLines
void possibleChange_showVolumeOutLines()
VP1RawDataSysController::Imp::last_cutAllowedEta
VP1Interval last_cutAllowedEta
Definition: VP1RawDataSysController.cxx:40
VP1RawDataFlags::BarrelPositive
@ BarrelPositive
Definition: VP1RawDataFlags.h:25
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
VP1RawDataSysController::possibleChange_useSpecialTRTHTMaterial
void possibleChange_useSpecialTRTHTMaterial()
VP1RawDataSysController::useSpecialBCMHighAttMaterial
bool useSpecialBCMHighAttMaterial() const
Definition: VP1RawDataSysController.cxx:233
VP1RawDataFlags::EndCapNegative
@ EndCapNegative
Definition: VP1RawDataFlags.h:28
VP1RawDataSysController::drawOptions
SoGroup * drawOptions() const
Definition: VP1RawDataSysController.cxx:198
VP1Controller::initLastVars
void initLastVars()
Definition: VP1Controller.cxx:68
VP1RawDataSysController::Imp
Definition: VP1RawDataSysController.cxx:32
VP1RawDataSysController::lucidMinQDC
unsigned lucidMinQDC() const
Definition: VP1RawDataSysController.cxx:268
VP1RawDataSysController::possibleChange_trtAllowedToT
void possibleChange_trtAllowedToT()
VP1ControllerMacros.h