6 #include "ui_calohitlegocontrollerform.h"
17 #include <Inventor/nodes/SoSwitch.h>
18 #include <Inventor/nodes/SoSeparator.h>
19 #include <Inventor/nodes/SoTranslation.h>
20 #include <Inventor/nodes/SoCube.h>
43 :
IVP13DSystemSimple(
"CaloHitLego",
"Display the calorimeter hits in an eta-phi view",
"boudreau@pitt.edu"),
59 QWidget* controller =
new QWidget(0);
60 Ui::frmCaloHitLegoController ui;
61 ui.setupUi(controller);
65 controller->setEnabled(
false);
97 for (
int i=0;
i<3;
i++) {
103 for (
int i=0;
i<4;
i++) {
122 for (
int i=0;
i<3;
i++) {
127 for (
int i=0;
i<4;
i++) {
162 for (
int i=0;
i<3;
i++)
164 for (
int i=0;
i<4;
i++) {
177 QString
key =
"AllCalo";
181 double energy = (*i_cell)->energy();
189 double phiMin = cellPtr->getPhiLocalLower();
190 double phiMax = cellPtr->getPhiLocalUpper();
191 double etaMin = cellPtr->getEtaMin();
192 double etaMax = cellPtr->getEtaMax();
194 if (cellPtr->getEndcapIndex()==0) {
195 phiMin =
M_PI-phiMin;
196 phiMax =
M_PI-phiMax;
201 SoCube *cube =
new SoCube();
202 SoTranslation *translation =
new SoTranslation();
203 translation->translation.setValue((
etaMax+
etaMin)/2.0, (phiMax+phiMin)/2.0, height/2.0);
205 cube->height=(fabs(phiMax-phiMin));
207 SoSeparator *
sep =
new SoSeparator();
208 sep->addChild(translation);
220 double phiMin = cellPtr->getPhiLocalLower();
221 double phiMax = cellPtr->getPhiLocalUpper();
222 double etaMin = cellPtr->getEtaMin();
223 double etaMax = cellPtr->getEtaMax();
225 if (cellPtr->getEndcapIndex()==0) {
226 phiMin =
M_PI-phiMin;
227 phiMax =
M_PI-phiMax;
232 SoCube *cube =
new SoCube();
233 SoTranslation *translation =
new SoTranslation();
234 translation->translation.setValue((
etaMax+
etaMin)/2.0, (phiMax+phiMin)/2.0, height/2);
236 cube->height=(fabs(phiMax-phiMin));
238 SoSeparator *
sep =
new SoSeparator();
239 sep->addChild(translation);
251 double phiMin = cellPtr->getPhiLocalLower();
252 double phiMax = cellPtr->getPhiLocalUpper();
253 double etaMin = cellPtr->getEtaMinNominal();
254 double etaMax = cellPtr->getEtaMaxNominal();
256 if (cellPtr->getEndcapIndex()==0) {
257 phiMin =
M_PI-phiMin;
258 phiMax =
M_PI-phiMax;
263 SoCube *cube =
new SoCube();
264 SoTranslation *translation =
new SoTranslation();
265 translation->translation.setValue((
etaMax+
etaMin)/2.0, (phiMax+phiMin)/2.0, height/2);
267 cube->height=(fabs(phiMax-phiMin));
269 SoSeparator *
sep =
new SoSeparator();
270 sep->addChild(translation);
280 for (
int i=0;
i<3;
i++)
282 for (
int i=0;
i<4;
i++) {
294 QCheckBox* cb =
dynamic_cast<QCheckBox*
>(sender());
306 sw->whichChild = SO_SWITCH_ALL;
309 sw->whichChild = SO_SWITCH_NONE;
327 QMap<QString,bool> checkboxstate;
328 while (
it.hasNext()) {
330 checkboxstate.insert(
it.key(),
it.value()->isChecked());
342 if (
state.version()!=0) {
343 message(
"Warning: State data in .vp1 file is in wrong format - ignoring!");
350 QMap<QString,bool> checkboxstate(
state.restore<QMap<QString,bool> >());
352 while (
it.hasNext()) {
354 state.widgetHandled(
it.value());
355 if (checkboxstate.contains(
it.key())) {
356 bool checked = checkboxstate.value(
it.key());
357 if (
it.value()->isChecked()!=checked)
358 it.value()->setChecked(checked);