5 #include "G4UnitsTable.hh" 29 #include "CLHEP/Units/PhysicalConstants.h" 30 using namespace CLHEP;
40 string d_name =
"Name: '" + det->
name +
"', daughter of '" + det->mother +
"'";
41 nameLabel->setText(d_name.c_str());
43 string d_desc =
"Description: " + det->description ;
44 descLabel->setText(d_desc.c_str());
47 string xyzpos =
"( " +
52 placeEdit->setText(xyzpos.c_str());
55 string xyzrot =
"( " +
57 stringify(det->rot.getTheta()/deg) +
", " +
58 stringify(det->rot.getPsi()/deg) +
") deg ";
60 rotEdit->setText(xyzrot.c_str());
63 string typeDims = det->type.c_str();
65 for(
unsigned int i=0; i<dimTypes.size(); i++)
69 Dim << G4BestUnit(det->dimensions[i], dimTypes[i][1]);
71 dtot = d1 +
"*" + d2 ;
72 typeDims = typeDims +
"\n" + dimTypes[i][0] +
": " + dtot;
74 solidType->setText(typeDims.c_str());
75 solidType->setStyleSheet(
"font: 12pt;");
78 if(det->type ==
"Box") solidpic = QPixmap(aBox_xpm);
79 if(det->type ==
"Tube") solidpic = QPixmap(aTubs_xpm);
80 if(det->type ==
"Cons") solidpic = QPixmap(aCons_xpm);
81 if(det->type ==
"G4Trap") solidpic = QPixmap(aTrap_xpm);
82 if(det->type ==
"ITrd") solidpic = QPixmap(aTrap_xpm);
83 if(det->type ==
"Trd") solidpic = QPixmap(aTrd_xpm);
84 if(det->type ==
"Sphere") solidpic = QPixmap(aSphere_xpm);
85 if(det->type ==
"Torus") solidpic = QPixmap(aTorus_xpm);
86 if(det->type ==
"Polycone") solidpic = QPixmap(aBREPSolidPCone_xpm);
87 if(det->type ==
"Ellipsoid") solidpic = QPixmap(aEllipticalTube_xpm);
88 if(det->type.find(
"CopyOf") != string::npos) solidpic = QPixmap(copy_xpm);
89 if(det->type.find(
"Operation:") != string::npos) solidpic = QPixmap(operation_xpm);
92 solidPicL->setPixmap(solidpic);
98 what =
"Material: " + det->material;
99 matLabel->setText(what.c_str());
102 if(det->magfield ==
"no")
103 what =
"Magnetic Field: inherited" ;
105 what =
"Magnetic Field: " + det->magfield;
106 mgnLabel->setText(what.c_str());
108 what =
"Sensitivity: " + det->sensitivity +
" Hit Process: " + det->hitType;
109 sensHitLabel->setText(what.c_str());
111 if(det->identity.size())
114 for(
unsigned int i=0; i<det->identity.size(); i++)
115 what = what + det->identity[i].name +
" " +
stringify(det->identity[i].id) +
" ";
117 idLabel->setText(what.c_str());
128 nameLabel =
new QLabel(tr(
"Placeholder for Volume Name"));
129 descLabel =
new QLabel(tr(
"Placeholder for Volume description"));
134 solidType =
new QLabel(
"placeholder for type");
135 solidType->setFrameStyle(QFrame::Panel | QFrame::Sunken);
143 QSplitter *splitter =
new QSplitter(Qt::Horizontal);
146 QVBoxLayout *leftLayout =
new QVBoxLayout(leftWidget);
151 QVBoxLayout *rightLayout =
new QVBoxLayout(rightWidget);
156 QLabel *
placeLabel =
new QLabel(
"(X,Y,Z) Position");
157 placeEdit =
new QLineEdit(tr(
"placeholder for (X,Y,Z) pos"));
160 QLabel *
rotLabel =
new QLabel(
"(phi, theta, psi) Euler rotation");
161 rotEdit =
new QLineEdit(
"placeholder for (X,Y,Z) rot");
164 matLabel =
new QLabel(tr(
"Placeholder for material "));
165 mgnLabel =
new QLabel(tr(
"Placeholder for magnetic field"));
166 sensHitLabel =
new QLabel(tr(
"Placeholder for sensitivity, Hit process"));
167 idLabel =
new QLabel(tr(
"Placeholder for identifier"));
169 idLabel->setMaximumWidth (300);
174 QVBoxLayout *mainLayout =
new QVBoxLayout;
178 mainLayout->addWidget(splitter);
180 mainLayout->addWidget(placeLabel);
183 mainLayout->addWidget(rotLabel);
184 mainLayout->addWidget(
rotEdit);
189 mainLayout->addWidget(
idLabel);
191 mainLayout->addStretch(10);
193 setLayout(mainLayout);
203 void descriptionTab::change_dimension()
214 void descriptionTab::change_placement()
QLineEdit * rotEdit
line editor for rotation
void update_detector(detector *Det)
change tab according to detector
QLabel * descLabel
label for description
QLabel * sensHitLabel
label for sensitivity, Hit process
QLabel * mgnLabel
label for magnetic field
QLabel * nameLabel
label for name
QLabel * placeLabel
label for position
vector< vector< string > > dimensionstype(string solidtype)
Returns dimensions nomenclature for different solid type.
QLabel * matLabel
label for material
string stringify(double x)
string name
Name of the volume. Since this is the key of the STL map, it has to be unique.
QLabel * rotLabel
label for rotation
QLabel * idLabel
label for identifier
QPixmap solidpic
solid pic from G4
descriptionTab(QWidget *parent=0)
Constructor.
QLabel * solidType
label for solid type
QLabel * solidPicL
container for solid pic
QLineEdit * placeEdit
line editor for position