ATLAS Offline Software
TrackCollectionSettingsButton.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "VP1Base/VP1Serialise.h"
10 
11 #include "ui_pertrackcollectionsettings_form.h"
12 #include "ui_settings_cuts_form.h"
13 
14 #include "CLHEP/Units/SystemOfUnits.h"
15 
16 #include "Inventor/nodes/SoDrawStyle.h"
17 #include "Inventor/nodes/SoLightModel.h"
18 #include <iostream>
19 
20 #include <QTimer>
21 #include <QByteArray>
22 #include <QBuffer>
23 #include <QDataStream>
24 #include <QMouseEvent>
25 #include <QDragEnterEvent>
26 #include <QDropEvent>
27 #include <QShortcut>
28 #include <QMimeData>
29 #include <QDrag>
30 
31 
32 //____________________________________________________________________
34 public:
35  Imp():theclass(nullptr),editwindow(nullptr),matButton(nullptr), trackDrawStyle(nullptr), trackLightModel(nullptr),
39  //nop
40  }
42  QWidget * editwindow;
43  Ui::TrackCollectionSettingsForm editwindow_ui{};
44 
46 
47  SoDrawStyle * trackDrawStyle;
48  SoLightModel * trackLightModel;
49 
50  //GUI - last values
55  QList<VP1Interval> last_cutAllowedPhi;
56  QList<unsigned> last_cutRequiredNHits;
63 
64  int dim;
66 
67  void initEditWindow();
68 
70 };
71 
72 //____________________________________________________________________
74 {
75  if (editwindow)
76  return;
77  theclass->messageVerbose("Initialising material editor dialog");
78  editwindow = new QWidget(nullptr,Qt::WindowStaysOnTopHint);
79  editwindow_ui.setupUi(editwindow);
80  matButton = editwindow_ui.pushButton_matButton;
81 }
82 
83 //____________________________________________________________________
85 {
86  if (m_d->editwindow)
87  m_d->editwindow->setWindowTitle(t);
88  setToolTip(t);
89 }
90 
91 //____________________________________________________________________
93  : VP1MaterialButtonBase(parent,nullptr,"VP1MaterialButton"), m_d(new Imp)
94 {
95  m_d->dim = dim;
96 
97  m_d->theclass = this;
99 
100  // declare the current serialization version number
102 
103 
104  //Draw Styles / Complexity:
105  VP1QtInventorUtils::setLimitsLineWidthSlider(m_d->editwindow_ui.horizontalSlider_trackWidth);
106  VP1QtInventorUtils::setValueLineWidthSlider(m_d->editwindow_ui.horizontalSlider_trackWidth,1.0);
107 
108  m_d->trackDrawStyle = new SoDrawStyle;
109  m_d->trackDrawStyle->setName("TrackDrawStyle");
110  m_d->trackDrawStyle->ref();
112  connect(m_d->editwindow_ui.horizontalSlider_trackWidth,SIGNAL(valueChanged(int)),this,SLOT(updateTrackDrawStyle()));
113 
114  m_d->trackLightModel = new SoLightModel;
115  m_d->trackLightModel->setName("TrackLightModel");
116  m_d->trackLightModel->ref();
117  updateTrackLightModel(false);
118  connect(m_d->editwindow_ui.checkBox_tracksUseBaseLightModel,SIGNAL(toggled(bool)),this,SLOT(updateTrackLightModel(bool)));
119 
121  connect(m_d->editwindow_ui.checkBox_trackTubes,SIGNAL(toggled(bool)),this,SLOT(updateTrackTubeRadius()));
122  connect(m_d->editwindow_ui.doubleSpinBox_trackTubesRadiusMM,SIGNAL(valueChanged(double)),this,SLOT(updateTrackTubeRadius()));
123 
124  connect(m_d->editwindow_ui.checkBox_hideactualpaths,SIGNAL(toggled(bool)),this,SLOT(updateHideActualTrackPath(bool)));
125 
126  // Cuts
127  connect(m_d->editwindow_ui.checkBox_defaultCuts,SIGNAL(toggled(bool)),this,SLOT(possibleChange_useDefaultCuts()));
128  m_d->last_useDefaultCuts=m_d->editwindow_ui.checkBox_defaultCuts->isChecked();
129  messageVerbose("editwindow_ui.checkBox_defaultCuts->isChecked() L " + str(m_d->editwindow_ui.checkBox_defaultCuts->isChecked()));
130 
131 
132  // -> cutAllowedP/Pt
133  connect(m_d->editwindow_ui.checkBox_cut_minpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
134  connect(m_d->editwindow_ui.checkBox_cut_maxpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
135  connect(m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedPt()));
136  connect(m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedPt()));
137  connect(m_d->editwindow_ui.checkBox_cut_minpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
138  //connect(m_d->editwindow_ui.comboBox_momtype,SIGNAL(valueChanged(bool)),this,SLOT(possibleChange_cutAllowedPt()));
139  connect(m_d->editwindow_ui.comboBox_momtype,SIGNAL(currentIndexChanged(int)),this,SLOT(possibleChange_cutAllowedPt()));
140 
141 
142  // -> cutAllowedEta
143  connect(m_d->editwindow_ui.etaPhiCutWidget,SIGNAL(allowedEtaChanged(const VP1Interval&)),this,SLOT(possibleChange_cutAllowedEta()));
144 
145  // -> cutAllowedPhi
146  connect(m_d->editwindow_ui.etaPhiCutWidget,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&)),this,SLOT(possibleChange_cutAllowedPhi()));
147 
148  // -> cutRequiredNHits();
149  connect(m_d->editwindow_ui.checkBox_cut_nhits_pixel,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredNHits()));
150  connect(m_d->editwindow_ui.checkBox_cut_nhits_sct,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredNHits()));
151  connect(m_d->editwindow_ui.checkBox_cut_nhits_trt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredNHits()));
152  connect(m_d->editwindow_ui.checkBox_cut_nhits_muon,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredNHits()));
153  connect(m_d->editwindow_ui.checkBox_cut_nprecisionhits_muon,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredNHits()));
154  connect(m_d->editwindow_ui.spinBox_cut_nhits_pixel,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
155  connect(m_d->editwindow_ui.spinBox_cut_nhits_sct,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
156  connect(m_d->editwindow_ui.spinBox_cut_nhits_trt,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
157  connect(m_d->editwindow_ui.spinBox_cut_nhits_muon,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
158  connect(m_d->editwindow_ui.spinBox_cut_nprecisionhits_muon,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
159 
160  // Required detector element
161  connect(m_d->editwindow_ui.checkBox_requireDetectorElement,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
162  connect(m_d->editwindow_ui.lineEdit_detectorElementId,SIGNAL(textChanged(QString)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
163 
164  // -> cutTruthFromIROnly
165  connect(m_d->editwindow_ui.checkBox_cut_truthtracks_creationvertexinIR,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutTruthFromIROnly()));
166 
167  // -> cutExcludeBarcodeZero
168  connect(m_d->editwindow_ui.checkBox_cut_truthtracks_excludebarcode0,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutExcludeBarcodeZero()));
169 
170  // -> cutTruthExcludeNeutrals
171  connect(m_d->editwindow_ui.checkBox_cut_truthtracks_excludeneutrals,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutTruthExcludeNeutrals()));
172 
173  // -> cutOnlyVertexAssocTracks
174  connect(m_d->editwindow_ui.checkBox_vertexAssociated,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutOnlyVertexAssocTracks()));
175 
176  connect(this,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
177  connect(m_d->editwindow_ui.pushButton_close,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
178  connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SLOT(updateButton()));
179  connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SIGNAL(lastAppliedChanged()));
180  setAcceptDrops(true);
181 
182  QTimer::singleShot(0, this, SLOT(updateButton()));
183 
184 }
185 
186 // QWidget& TrackCollectionSettingsButton::editWindow() {
187 // if (!m_d->editwindow)
188 // initEditWindow();
189 // return *(m_d->editwindow);
190 // }
192 {
193  delete m_d->editwindow;
194  m_d->trackDrawStyle->unref();
195  m_d->trackLightModel->unref();
196  delete m_d;
197 }
198 
200 {
201  if (objectName().isEmpty())
202  setObjectName("TrackCollectionSettingsButton");
203  messageVerbose("setColButtonProperties: color=" + str(m_d->matButton->lastAppliedDiffuseColour()));
205 }
206 
208 {
209  if (m_d->dim == dim)
210  return;
211  m_d->dim = dim;
212  updateButton();
213 }
214 
216 {
217  if (!m_d->editwindow)
218  m_d->initEditWindow();
219 
220  if (m_d->editwindow->isHidden())
221  m_d->editwindow->show();
222  else
223  m_d->editwindow->hide();
224 }
225 
227 {
228  if (!m_d->matButton) m_d->initEditWindow();
230  return true;
231 }
232 
234 {
235  if (!m_d->matButton) m_d->initEditWindow();
237 }
239 {
240  if (!m_d->matButton) m_d->initEditWindow();
242 }
244 {
245  if (!m_d->matButton) m_d->initEditWindow();
247 }
249 {
250  if (!m_d->matButton) m_d->initEditWindow();
252 }
253 
255 {
256  return m_d->editwindow_ui.checkBox_trackTubes->isChecked() ?
257  m_d->editwindow_ui.doubleSpinBox_trackTubesRadiusMM->value()*CLHEP::mm : 0.0;
258 }
259 
261 {
262  if (m_d->last_trackTubeRadius==trackTubeRadius()) return;
264  messageVerbose("TrackTubeRadius changed to "+str(m_d->last_trackTubeRadius));
266 }
267 
269 {
270  double val = VP1QtInventorUtils::getValueLineWidthSlider(m_d->editwindow_ui.horizontalSlider_trackWidth);
271  if (m_d->trackDrawStyle->lineWidth.getValue()!=val)
272  m_d->trackDrawStyle->lineWidth = val;
273 }
274 
276 {
277  if (m_d->trackLightModel->model.getValue()!=(base?SoLightModel::BASE_COLOR:SoLightModel::PHONG)) {
278  messageVerbose("TrackLightModel changed (base = "+str(base));
279  if (base)
280  m_d->trackLightModel->model.setValue(SoLightModel::BASE_COLOR);
281  else
282  m_d->trackLightModel->model.setValue(SoLightModel::PHONG);
283  }
284 }
285 
287 {
288  emit hideActualTrackPathChanged(hide);
289 }
290 
291 
293 {
294  return m_d->trackDrawStyle;
295 }
296 
298 {
299  return m_d->trackLightModel;
300 }
301 
303 {
304  return m_d->editwindow_ui.checkBox_hideactualpaths->isChecked();
305 }
306 
307 
309 {
310  return m_d->editwindow_ui.checkBox_defaultCuts->isChecked();
311 }
312 
314 {
315  return m_d->editwindow_ui.checkBox_vertexAssociated->isChecked();
316 }
317 
318 //____________________________________________________________________
320 {
321  if (event->button() == Qt::LeftButton)
322  m_d->dragStartPosition = event->pos();
323  QPushButton::mousePressEvent(event);
324 }
325 
326 //____________________________________________________________________
328 {
329  if (event->source()!=this && event->mimeData()->hasFormat("vp1/material"))
330  event->acceptProposedAction();
331 }
332 
333 //____________________________________________________________________
335 {
336  if (!(event->buttons() & Qt::LeftButton))
337  return;
338  if ((event->pos() - m_d->dragStartPosition).manhattanLength()
339  < QApplication::startDragDistance())
340  return;
341 
342  QDrag *drag = new QDrag(this);
343  QMimeData *mimeData = new QMimeData;
344 
346  // For dragging state onto other material buttons: //
348 
349  QByteArray byteArray = saveState();
350 
351  // buffer.close();
352  mimeData->setData("vp1/material", byteArray);
353 
354  // ////////////////////////////////////////////////////////
355  // // For dragging c++ code for defining this material //
356  // // into e.g. an editor: //
357  // ////////////////////////////////////////////////////////
358  //
359  // QString s = "SoMaterial * mat = new SoMaterial;\n";
360  // QString str_ambient = m_d->toSbColTxt(m_d->lastapplied_ambient);
361  // if (str_ambient!="SbColor(0.2,0.2,0.2)")
362  // s += "mat->ambientColor.setValue("+str_ambient+");\n";
363  // QString str_diffuse = m_d->toSbColTxt(m_d->lastapplied_diffuse);
364  // if (str_diffuse!="SbColor(0.8,0.8,0.8)")
365  // s += "mat->diffuseColor.setValue("+str_diffuse+");\n";
366  // QString str_specular = m_d->toSbColTxt(m_d->lastapplied_specular);
367  // if (str_specular!="SbColor(0,0,0)")
368  // s += "mat->specularColor.setValue("+str_specular+");\n";
369  // QString str_emissive = m_d->toSbColTxt(m_d->lastapplied_emissive);
370  // if (str_emissive!="SbColor(0,0,0)")
371  // s += "mat->emissiveColor.setValue("+str_emissive+");\n";
372  // QString str_shininess = m_d->printFloat(m_d->lastapplied_shininess/100.0);
373  // if (str_shininess!="0.2")
374  // s += "mat->shininess.setValue("+str_shininess+");\n";
375  // QString str_transparency = m_d->printFloat(m_d->lastapplied_transparency/100.0);
376  // if (str_transparency!="0")
377  // s += "mat->transparency.setValue("+str_transparency+");\n";
378  // mimeData->setText(s);
379 
380  //Execute drag:
381  drag->setMimeData(mimeData);//drag assumes ownership of mimeData
382  drag->exec(Qt::CopyAction | Qt::MoveAction);
383 }
384 
385 //____________________________________________________________________
387 {
388  QByteArray data = event->mimeData()->data("vp1/material");
389  event->acceptProposedAction();
391 }
392 
393 
395  // messageVerbose("getState");
396  // if (m_d->editwindow_ui.checkBox_tracksUseBaseLightModel->isChecked()) messageVerbose("checked!");
397 
398  // start serializing data with the current version number,
399  // which is declared in the contructor
401 
402  serialise.save(m_d->matButton);
403  // serialise.disableUnsavedChecks();
404  serialise.save(m_d->editwindow_ui.horizontalSlider_trackWidth);
405  serialise.save(m_d->editwindow_ui.checkBox_trackTubes);
406  serialise.save(m_d->editwindow_ui.doubleSpinBox_trackTubesRadiusMM);
407  serialise.save(m_d->editwindow_ui.checkBox_tracksUseBaseLightModel);
408  serialise.save(m_d->editwindow_ui.checkBox_hideactualpaths);
409  serialise.save(m_d->editwindow_ui.checkBox_defaultCuts);
410  serialise.save(m_d->editwindow_ui.checkBox_defaultCuts);
411 
412  serialise.save(m_d->editwindow_ui.checkBox_cut_minpt);
413  serialise.save(m_d->editwindow_ui.checkBox_cut_maxpt);
414  serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev);
415  serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev);
416  serialise.save(m_d->editwindow_ui.checkBox_cut_minpt);
417  serialise.save(m_d->editwindow_ui.comboBox_momtype);
418  serialise.save(m_d->editwindow_ui.etaPhiCutWidget);
419  serialise.save(m_d->editwindow_ui.etaPhiCutWidget);
420  serialise.save(m_d->editwindow_ui.checkBox_cut_nhits_pixel);
421  serialise.save(m_d->editwindow_ui.checkBox_cut_nhits_sct);
422  serialise.save(m_d->editwindow_ui.checkBox_cut_nhits_trt);
423  serialise.save(m_d->editwindow_ui.checkBox_cut_nhits_muon);
424  serialise.save(m_d->editwindow_ui.checkBox_cut_nprecisionhits_muon);
425  serialise.save(m_d->editwindow_ui.spinBox_cut_nhits_pixel);
426  serialise.save(m_d->editwindow_ui.spinBox_cut_nhits_sct);
427  serialise.save(m_d->editwindow_ui.spinBox_cut_nhits_trt);
428  serialise.save(m_d->editwindow_ui.spinBox_cut_nhits_muon);
429  serialise.save(m_d->editwindow_ui.spinBox_cut_nprecisionhits_muon);
430  serialise.save(m_d->editwindow_ui.checkBox_cut_truthtracks_creationvertexinIR);
431  serialise.save(m_d->editwindow_ui.checkBox_cut_truthtracks_excludebarcode0);
432  serialise.save(m_d->editwindow_ui.checkBox_cut_truthtracks_excludeneutrals);
433  serialise.save(m_d->editwindow_ui.checkBox_vertexAssociated);
434 
435  serialise.widgetHandled(this);
436  serialise.warnUnsaved(this);
437  return serialise.result();
438 }
439 
441 
442  VP1Deserialise state(ba,systemBase());
443 
444  if (state.version()<0||state.version()>2) {
445  message("Version of 'TrackCollectionSettingsButton' settings file not recognized: "+QString::number(state.version())+" [current: "+QString::number(m_d->serialization_version)+"]. Ignoring...");
446  return;//Ignore silently
447  }
448  state.restore(m_d->matButton);
449  state.restore(m_d->editwindow_ui.horizontalSlider_trackWidth);
450  state.restore(m_d->editwindow_ui.checkBox_trackTubes);
451  state.restore(m_d->editwindow_ui.doubleSpinBox_trackTubesRadiusMM);
452  state.restore(m_d->editwindow_ui.checkBox_tracksUseBaseLightModel);
453  state.restore(m_d->editwindow_ui.checkBox_hideactualpaths);
454  state.restore(m_d->editwindow_ui.checkBox_defaultCuts);
455 
456  state.restore(m_d->editwindow_ui.checkBox_cut_minpt);
457  state.restore(m_d->editwindow_ui.checkBox_cut_maxpt);
458  state.restore(m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev);
459  state.restore(m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev);
460  state.restore(m_d->editwindow_ui.checkBox_cut_minpt);
461  state.restore(m_d->editwindow_ui.comboBox_momtype);
462  state.restore(m_d->editwindow_ui.etaPhiCutWidget);
463  state.restore(m_d->editwindow_ui.etaPhiCutWidget);
464  state.restore(m_d->editwindow_ui.checkBox_cut_nhits_pixel);
465  state.restore(m_d->editwindow_ui.checkBox_cut_nhits_sct);
466  state.restore(m_d->editwindow_ui.checkBox_cut_nhits_trt);
467  state.restore(m_d->editwindow_ui.checkBox_cut_nhits_muon);
468  state.restore(m_d->editwindow_ui.checkBox_cut_nprecisionhits_muon);
469  state.restore(m_d->editwindow_ui.spinBox_cut_nhits_pixel);
470  state.restore(m_d->editwindow_ui.spinBox_cut_nhits_sct);
471  state.restore(m_d->editwindow_ui.spinBox_cut_nhits_trt);
472  state.restore(m_d->editwindow_ui.spinBox_cut_nhits_muon);
473  state.restore(m_d->editwindow_ui.spinBox_cut_nprecisionhits_muon);
474  state.restore(m_d->editwindow_ui.checkBox_cut_truthtracks_creationvertexinIR);
475  state.restore(m_d->editwindow_ui.checkBox_cut_truthtracks_excludebarcode0);
476  state.restore(m_d->editwindow_ui.checkBox_cut_truthtracks_excludeneutrals);
477  state.restore(m_d->editwindow_ui.checkBox_vertexAssociated);
478 
479  state.widgetHandled(this);
480  state.warnUnrestored(this);
481 
483  updateTrackLightModel(m_d->editwindow_ui.checkBox_tracksUseBaseLightModel);
484  updateButton();
485  //FIXME - anything else need updating?
486 }
487 
488 //____________________________________________________________________
490 {
491  if (!m_d->editwindow_ui.checkBox_cut_minpt)
492  return {};
493 
494  // will set range to negative if we have momcut=P
495  // if minCut unset then min=-inf
496  // if minCut set, and Pt selected, then min=-minCut
497  // if minCut set, and P selected, then min=-maxCut
498  // etc
499  bool isPCut = m_d->editwindow_ui.comboBox_momtype->currentText()=="P";
500 
501  const double minFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev->value()*CLHEP::GeV;
502  const double maxFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev->value()*CLHEP::GeV;
503 
504  double min=0.0,max=0.0;
505  if (!isPCut) {
506  //Pt cut
507  min = (m_d->editwindow_ui.checkBox_cut_minpt->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
508  max = (m_d->editwindow_ui.checkBox_cut_maxpt->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
509  } else {
510  min = (m_d->editwindow_ui.checkBox_cut_maxpt->isChecked() ? -maxFromInterface : -std::numeric_limits<double>::infinity());
511  max = (m_d->editwindow_ui.checkBox_cut_minpt->isChecked() ? -minFromInterface : std::numeric_limits<double>::infinity());
512  }
513 
514  //message("cutAllowedPt: min,max="+QString::number(min)+","+QString::number(max));
515 
516  if (max<min)
517  return {};
518 
519  return VP1Interval( min, max );//fixme: closed interval??
520 }
521 
522 //____________________________________________________________________
524 {
525  return m_d->editwindow_ui.etaPhiCutWidget->allowedEta();
526 }
527 
528 //____________________________________________________________________
530 {
531  return m_d->editwindow_ui.etaPhiCutWidget->allowedPhi();
532 }
533 
534 //____________________________________________________________________
536 {
537  unsigned npixel = m_d->editwindow_ui.checkBox_cut_nhits_pixel->isChecked() ? m_d->editwindow_ui.spinBox_cut_nhits_pixel->value() : 0;
538  unsigned nsct = m_d->editwindow_ui.checkBox_cut_nhits_sct->isChecked() ? m_d->editwindow_ui.spinBox_cut_nhits_sct->value() : 0;
539  unsigned ntrt = m_d->editwindow_ui.checkBox_cut_nhits_trt->isChecked() ? m_d->editwindow_ui.spinBox_cut_nhits_trt->value() : 0;
540  unsigned nmuon = m_d->editwindow_ui.checkBox_cut_nhits_muon->isChecked() ? m_d->editwindow_ui.spinBox_cut_nhits_muon->value() : 0;
541  unsigned nprecmuon = m_d->editwindow_ui.checkBox_cut_nprecisionhits_muon->isChecked() ? m_d->editwindow_ui.spinBox_cut_nprecisionhits_muon->value() : 0;
542  QList<unsigned> l;
543  if (!npixel&&!nsct&&!ntrt&&!nmuon&&!nprecmuon)
544  return l;
545  l << npixel << nsct << ntrt << nmuon << nprecmuon;
546  return l;
547 }
548 
550  return m_d->editwindow_ui.checkBox_requireDetectorElement->isChecked() ? m_d->editwindow_ui.lineEdit_detectorElementId->text(): QString();
551 }
552 
553 //____________________________________________________________________
555 {
556  return m_d->editwindow_ui.checkBox_cut_truthtracks_creationvertexinIR->isChecked();
557 }
558 
559 //____________________________________________________________________
561 {
562  return m_d->editwindow_ui.checkBox_cut_truthtracks_excludebarcode0->isChecked();
563 }
564 
565 //____________________________________________________________________
567 {
568  return m_d->editwindow_ui.checkBox_cut_truthtracks_excludeneutrals->isChecked();
569 }
570 
571 
572 
573 // "POSSIBLECHANGE" SLOTS
574 //____________________________________________________________________
576 {
577  if (m_d->last_useDefaultCuts==useDefaultCuts()) return;
578  messageVerbose("useDefaultCuts() changed");
581 }
582 //____________________________________________________________________
584 {
585  messageVerbose("possibleChange_cutAllowedPt() ");
586 
587  if (m_d->last_cutAllowedPt==cutAllowedPt()) return;
588  messageVerbose("cutAllowedPt() changed");
591 }
592 //____________________________________________________________________
594 {
595  if (m_d->last_cutAllowedEta==cutAllowedEta()) return;
596  messageVerbose("cutAllowedEta() changed");
599 }
600 //____________________________________________________________________
602 {
603  if (m_d->last_cutAllowedPhi==cutAllowedPhi()) return;
604  messageVerbose("cutAllowedPhi() changed");
607 }
608 //____________________________________________________________________
610 {
611  messageVerbose("TrackCollectionSettingsButton::possibleChange_cutRequiredNHits");
613  messageVerbose("cutRequiredNHits() changed");
616 }
617 //____________________________________________________________________
619 {
620  messageVerbose("TrackCollectionSettingsButton::possibleChange_cutRequiredDetectorElement");
622  messageVerbose("cutRequiredDetectorElement() changed");
625 }
626 //____________________________________________________________________
628 {
630  messageVerbose("cutTruthFromIROnly() changed");
633 }
634 //____________________________________________________________________
636 {
638  messageVerbose("cutExcludeBarcodeZero() changed");
641 }
642 
643 //____________________________________________________________________
645 {
647  messageVerbose("cutTruthExcludeNeutrals() changed");
650 }
651 
652 //____________________________________________________________________
654 {
656  messageVerbose("cutOnlyVertexAssocTracks() changed");
659 }
TrackCollectionSettingsButton::updateTrackDrawStyle
void updateTrackDrawStyle()
Definition: TrackCollectionSettingsButton.cxx:268
VP1Serialise.h
TrackCollectionSettingsButton::lastAppliedTransparency
virtual double lastAppliedTransparency() const
Definition: TrackCollectionSettingsButton.cxx:238
base
std::string base
Definition: hcg.cxx:78
TrackCollectionSettingsButton::Imp::last_cutAllowedPt
VP1Interval last_cutAllowedPt
Definition: TrackCollectionSettingsButton.cxx:52
TrackCollectionSettingsButton::cutAllowedPt
VP1Interval cutAllowedPt() const
Definition: TrackCollectionSettingsButton.cxx:489
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TrackCollectionSettingsButton::useDefaultCutsChanged
void useDefaultCutsChanged(bool)
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
VP1QtInventorUtils::getValueLineWidthSlider
static double getValueLineWidthSlider(const QSlider *)
Definition: VP1QtInventorUtils.cxx:1619
TrackCollectionSettingsButton::restoreFromState
void restoreFromState(const QByteArray &)
Definition: TrackCollectionSettingsButton.cxx:440
TrackCollectionSettingsButton::possibleChange_cutTruthFromIROnly
void possibleChange_cutTruthFromIROnly()
Definition: TrackCollectionSettingsButton.cxx:627
TrackCollectionSettingsButton::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition: TrackCollectionSettingsButton.cxx:319
VP1Deserialise.h
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
VP1Serialise
Definition: VP1Serialise.h:45
TrackCollectionSettingsButton::setDimension
void setDimension(int dim)
Definition: TrackCollectionSettingsButton.cxx:207
max
#define max(a, b)
Definition: cfImp.cxx:41
RoiUtil::serialise
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
Definition: RoiSerialise.cxx:45
TrackCollectionSettingsButton::possibleChange_cutRequiredDetectorElement
void possibleChange_cutRequiredDetectorElement()
Definition: TrackCollectionSettingsButton.cxx:618
TrackCollectionSettingsButton::updateTrackTubeRadius
void updateTrackTubeRadius()
Definition: TrackCollectionSettingsButton.cxx:260
TrackCollectionSettingsButton::Imp::last_cutExcludeBarcodeZero
bool last_cutExcludeBarcodeZero
Definition: TrackCollectionSettingsButton.cxx:59
TrackCollectionSettingsButton::setMaterial
virtual bool setMaterial(SoMaterial *)
Definition: TrackCollectionSettingsButton.cxx:226
TrackCollectionSettingsButton::showEditMaterialDialog
void showEditMaterialDialog()
Definition: TrackCollectionSettingsButton.cxx:215
TrackCollectionSettingsButton::Imp::matButton
VP1MaterialButton * matButton
Definition: TrackCollectionSettingsButton.cxx:45
TrackCollectionSettingsButton::cutOnlyVertexAssocTracksChanged
void cutOnlyVertexAssocTracksChanged(bool)
TrackCollectionSettingsButton::possibleChange_cutAllowedEta
void possibleChange_cutAllowedEta()
Definition: TrackCollectionSettingsButton.cxx:593
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
TrackCollectionSettingsButton::trackLightModel
SoLightModel * trackLightModel() const
Definition: TrackCollectionSettingsButton.cxx:297
TrackCollectionSettingsButton::cutTruthExcludeNeutrals
bool cutTruthExcludeNeutrals() const
Definition: TrackCollectionSettingsButton.cxx:566
TrackCollectionSettingsButton::Imp::last_cutAllowedP
VP1Interval last_cutAllowedP
Definition: TrackCollectionSettingsButton.cxx:53
VP1MaterialButton
Definition: VP1MaterialButton.h:46
TrackCollectionSettingsButton::Imp::editwindow
QWidget * editwindow
Definition: TrackCollectionSettingsButton.cxx:42
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
TrackCollectionSettingsButton::possibleChange_useDefaultCuts
void possibleChange_useDefaultCuts()
Definition: TrackCollectionSettingsButton.cxx:575
TrackCollectionSettingsButton::dropEvent
void dropEvent(QDropEvent *event)
Definition: TrackCollectionSettingsButton.cxx:386
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
TrackCollectionSettingsButton::updateHideActualTrackPath
void updateHideActualTrackPath(bool)
Definition: TrackCollectionSettingsButton.cxx:286
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
TrackCollectionSettingsButton::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
Definition: TrackCollectionSettingsButton.cxx:334
TrackCollectionSettingsButton::m_d
Imp * m_d
Definition: TrackCollectionSettingsButton.h:88
TrackCollectionSettingsButton::useDefaultCuts
bool useDefaultCuts() const
Definition: TrackCollectionSettingsButton.cxx:308
TrackCollectionSettingsButton::cutTruthFromIROnly
bool cutTruthFromIROnly() const
Definition: TrackCollectionSettingsButton.cxx:554
TrackCollectionSettingsButton::trackDrawStyle
SoDrawStyle * trackDrawStyle() const
Definition: TrackCollectionSettingsButton.cxx:292
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
TrackCollectionSettingsButton::trackTubeRadius
double trackTubeRadius() const
Definition: TrackCollectionSettingsButton.cxx:254
TrackCollectionSettingsButton::possibleChange_cutAllowedPt
void possibleChange_cutAllowedPt()
Definition: TrackCollectionSettingsButton.cxx:583
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VP1MaterialButton::lastAppliedDiffuseColour
QColor lastAppliedDiffuseColour() const
Definition: VP1MaterialButton.cxx:167
TrackCollectionSettingsButton::Imp::last_cutTruthFromIROnly
bool last_cutTruthFromIROnly
Definition: TrackCollectionSettingsButton.cxx:58
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
TrackCollectionSettingsButton::TrackCollectionSettingsButton
TrackCollectionSettingsButton(QWidget *parent=0, int dim=25)
Definition: TrackCollectionSettingsButton.cxx:92
TrackCollectionSettingsButton::updateButton
void updateButton()
Definition: TrackCollectionSettingsButton.cxx:199
VP1ColorSelectButton::setColButtonProperties
static void setColButtonProperties(QPushButton *, const QColor &col, int dim)
Definition: VP1ColorSelectButton.cxx:49
TrackCollectionSettingsButton::Imp::trackDrawStyle
SoDrawStyle * trackDrawStyle
Definition: TrackCollectionSettingsButton.cxx:47
TrackCollectionSettingsButton::copyValuesFromMaterial
virtual void copyValuesFromMaterial(SoMaterial *)
Definition: TrackCollectionSettingsButton.cxx:233
TrackCollectionSettingsButton::setText
void setText(const QString &)
Definition: TrackCollectionSettingsButton.cxx:84
TrackCollectionSettingsButton::possibleChange_cutAllowedPhi
void possibleChange_cutAllowedPhi()
Definition: TrackCollectionSettingsButton.cxx:601
VP1QtInventorUtils.h
TrackCollectionSettingsButton::Imp::last_cutTruthExcludeNeutrals
bool last_cutTruthExcludeNeutrals
Definition: TrackCollectionSettingsButton.cxx:60
TrackCollectionSettingsButton
Definition: TrackCollectionSettingsButton.h:13
VP1Deserialise::version
qint32 version() const
Definition: VP1Deserialise.cxx:143
TrackCollectionSettingsButton::Imp
Definition: TrackCollectionSettingsButton.cxx:33
TrackCollectionSettingsButton::cutRequiredNHits
QList< unsigned > cutRequiredNHits() const
Definition: TrackCollectionSettingsButton.cxx:535
TrackCollectionSettingsButton::hideActualTrackPath
bool hideActualTrackPath() const
Definition: TrackCollectionSettingsButton.cxx:302
TrackCollectionSettingsButton::trackTubeRadiusChanged
void trackTubeRadiusChanged(const double &)
TrackCollectionSettingsButton::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event)
Definition: TrackCollectionSettingsButton.cxx:327
TrackCollectionSettingsButton::Imp::last_cutRequiredDetectorElement
QString last_cutRequiredDetectorElement
Definition: TrackCollectionSettingsButton.cxx:57
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
TrackCollectionSettingsButton::lastAppliedBrightness
virtual double lastAppliedBrightness() const
Definition: TrackCollectionSettingsButton.cxx:248
VP1MaterialButton::lastAppliedBrightness
double lastAppliedBrightness() const
Definition: VP1MaterialButton.cxx:173
TrackCollectionSettingsButton::cutRequiredDetectorElement
QString cutRequiredDetectorElement() const
Definition: TrackCollectionSettingsButton.cxx:549
TrackCollectionSettingsButton::updateTrackLightModel
void updateTrackLightModel(bool)
Definition: TrackCollectionSettingsButton.cxx:275
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrackCollectionSettingsButton::cutRequiredNHitsChanged
void cutRequiredNHitsChanged(const QList< unsigned > &)
TrackCollectionSettingsButton::cutAllowedEtaChanged
void cutAllowedEtaChanged(const VP1Interval &)
VP1Deserialise::restore
void restore(QCheckBox *sb)
Definition: VP1Deserialise.cxx:245
TrackCollectionSettingsButton::Imp::dim
int dim
Definition: TrackCollectionSettingsButton.cxx:64
TrackCollectionSettingsButton::cutRequiredDetectorElementChanged
void cutRequiredDetectorElementChanged(const QString &)
TrackCollectionSettingsButton::cutAllowedPhiChanged
void cutAllowedPhiChanged(const QList< VP1Interval > &)
TrackCollectionSettingsButton::~TrackCollectionSettingsButton
virtual ~TrackCollectionSettingsButton()
Definition: TrackCollectionSettingsButton.cxx:191
VP1ColorSelectButton.h
VP1Deserialise
Definition: VP1Deserialise.h:44
TrackCollectionSettingsButton::possibleChange_cutRequiredNHits
void possibleChange_cutRequiredNHits()
Definition: TrackCollectionSettingsButton.cxx:609
VP1QtInventorUtils::setValueLineWidthSlider
static void setValueLineWidthSlider(QSlider *, const double &value)
Definition: VP1QtInventorUtils.cxx:1593
min
#define min(a, b)
Definition: cfImp.cxx:40
TrackCollectionSettingsButton::Imp::initEditWindow
void initEditWindow()
Definition: TrackCollectionSettingsButton.cxx:73
TrackCollectionSettingsButton.h
VP1MaterialButton::setMaterial
bool setMaterial(SoMaterial *)
Definition: VP1MaterialButton.cxx:447
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition: VP1HelperClassBase.h:50
python.selection.number
number
Definition: selection.py:20
TrackCollectionSettingsButton::Imp::last_useDefaultCuts
bool last_useDefaultCuts
Definition: TrackCollectionSettingsButton.cxx:62
TrackCollectionSettingsButton::hideActualTrackPathChanged
void hideActualTrackPathChanged(bool)
TrackCollectionSettingsButton::possibleChange_cutExcludeBarcodeZero
void possibleChange_cutExcludeBarcodeZero()
Definition: TrackCollectionSettingsButton.cxx:635
TrackCollectionSettingsButton::possibleChange_cutTruthExcludeNeutrals
void possibleChange_cutTruthExcludeNeutrals()
Definition: TrackCollectionSettingsButton.cxx:644
TrackCollectionSettingsButton::Imp::last_cutRequiredNHits
QList< unsigned > last_cutRequiredNHits
Definition: TrackCollectionSettingsButton.cxx:56
TrackCollectionSettingsButton::lastAppliedShininess
virtual double lastAppliedShininess() const
Definition: TrackCollectionSettingsButton.cxx:243
TrackCollectionSettingsButton::Imp::last_cutAllowedEta
VP1Interval last_cutAllowedEta
Definition: TrackCollectionSettingsButton.cxx:54
VP1Deserialise::widgetHandled
void widgetHandled(QWidget *)
Definition: VP1Deserialise.cxx:658
TrackCollectionSettingsButton::Imp::Imp
Imp()
Definition: TrackCollectionSettingsButton.cxx:35
TrackCollectionSettingsButton::lastAppliedChanged
void lastAppliedChanged()
VP1MaterialButtonBase
Definition: VP1MaterialButton.h:25
TrackCollectionSettingsButton::saveState
QByteArray saveState() const
fill out with the state of the object (used for drag and drop etc)
Definition: TrackCollectionSettingsButton.cxx:394
VP1MaterialButton::lastAppliedShininess
double lastAppliedShininess() const
Definition: VP1MaterialButton.cxx:172
VP1Deserialise::warnUnrestored
void warnUnrestored(QObject *)
Definition: VP1Deserialise.cxx:696
TrackCollectionSettingsButton::cutOnlyVertexAssocTracks
bool cutOnlyVertexAssocTracks() const
Return true if this collection should only should tracks associated to a vertex.
Definition: TrackCollectionSettingsButton.cxx:313
TrackCollectionSettingsButton::cutTruthFromIROnlyChanged
void cutTruthFromIROnlyChanged(bool)
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
TrackCollectionSettingsButton::cutTruthExcludeNeutralsChanged
void cutTruthExcludeNeutralsChanged(bool)
TrackCollectionSettingsButton::Imp::serialization_version
int serialization_version
Definition: TrackCollectionSettingsButton.cxx:69
TrackCollectionSettingsButton::Imp::dragStartPosition
QPoint dragStartPosition
Definition: TrackCollectionSettingsButton.cxx:65
VP1Interval
Definition: VP1Interval.h:23
TrackCollectionSettingsButton::Imp::theclass
TrackCollectionSettingsButton * theclass
Definition: TrackCollectionSettingsButton.cxx:41
VP1QtInventorUtils::setLimitsLineWidthSlider
static void setLimitsLineWidthSlider(QSlider *)
Definition: VP1QtInventorUtils.cxx:1563
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
TrackCollectionSettingsButton::cutAllowedEta
VP1Interval cutAllowedEta() const
Definition: TrackCollectionSettingsButton.cxx:523
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
TrackCollectionSettingsButton::cutExcludeBarcodeZero
bool cutExcludeBarcodeZero() const
Definition: TrackCollectionSettingsButton.cxx:560
TrackCollectionSettingsButton::Imp::trackLightModel
SoLightModel * trackLightModel
Definition: TrackCollectionSettingsButton.cxx:48
TrackCollectionSettingsButton::Imp::last_cutOnlyVertexAssocTracks
bool last_cutOnlyVertexAssocTracks
Definition: TrackCollectionSettingsButton.cxx:61
TrackCollectionSettingsButton::possibleChange_cutOnlyVertexAssocTracks
void possibleChange_cutOnlyVertexAssocTracks()
Definition: TrackCollectionSettingsButton.cxx:653
VP1MaterialButton::lastAppliedTransparency
double lastAppliedTransparency() const
Definition: VP1MaterialButton.cxx:171
TrackCollectionSettingsButton::Imp::last_cutAllowedPhi
QList< VP1Interval > last_cutAllowedPhi
Definition: TrackCollectionSettingsButton.cxx:55
TrackCollectionSettingsButton::cutAllowedPhi
QList< VP1Interval > cutAllowedPhi() const
Definition: TrackCollectionSettingsButton.cxx:529
TrackCollectionSettingsButton::cutExcludeBarcodeZeroChanged
void cutExcludeBarcodeZeroChanged(bool)
TrackCollectionSettingsButton::Imp::last_trackTubeRadius
double last_trackTubeRadius
Definition: TrackCollectionSettingsButton.cxx:51
TrackCollectionSettingsButton::cutAllowedPtChanged
void cutAllowedPtChanged(const VP1Interval &)
TrackCollectionSettingsButton::Imp::editwindow_ui
Ui::TrackCollectionSettingsForm editwindow_ui
Definition: TrackCollectionSettingsButton.cxx:43