9 #include "G4UnitsTable.hh" 39 tabWidget =
new QTabWidget;
44 buttonBox =
new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
45 connect(buttonBox, SIGNAL(accepted()),
this, SLOT(accept()));
46 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
48 QVBoxLayout *mainLayout =
new QVBoxLayout;
49 mainLayout->addWidget(tabWidget);
50 mainLayout->addWidget(buttonBox);
51 setLayout(mainLayout);
53 setWindowTitle(tr(
"Detector Editor"));
59 QLabel *dNameLabel =
new QLabel(tr(
"Volume Name:"));
60 QLineEdit *dNameEdit =
new QLineEdit(
Detector->
name.c_str());
61 QLabel *solidType =
new QLabel(detect->
type.c_str());
62 solidType->setFrameStyle(QFrame::Panel | QFrame::Sunken);
70 dtot = d1 +
"*" + d2 ;
77 dtot = d1 +
"*" + d2 ;
84 dtot = d1 +
"*" + d2 ;
88 QLabel *
rotXLabel =
new QLabel(
"Euler Phi Rotation");
91 dtot = d1 +
"*" + d2 ;
92 rotXEdit =
new QLineEdit(dtot.c_str());
95 QLabel *
rotYLabel =
new QLabel(
"Euler theta Rotation");
96 Dim << G4BestUnit(
Detector->
rot.getTheta(),
"Angle");
98 dtot = d1 +
"*" + d2 ;
99 rotYEdit =
new QLineEdit(dtot.c_str());
102 QLabel *
rotZLabel =
new QLabel(
"Euler psi Rotation");
103 Dim << G4BestUnit(
Detector->
rot.getPsi(),
"Angle");
105 dtot = d1 +
"*" + d2 ;
106 rotZEdit =
new QLineEdit(dtot.c_str());
109 QVBoxLayout *mainLayout =
new QVBoxLayout;
110 mainLayout->addWidget(dNameLabel);
111 mainLayout->addWidget(dNameEdit);
112 mainLayout->addWidget(placeXLabel);
114 mainLayout->addWidget(placeYLabel);
116 mainLayout->addWidget(placeZLabel);
118 mainLayout->addSpacing(50);
119 mainLayout->addWidget(rotXLabel);
121 mainLayout->addWidget(rotYLabel);
123 mainLayout->addWidget(rotZLabel);
126 setLayout(mainLayout);
127 connect ( dNameEdit , SIGNAL( textChanged (QString) ),
this, SLOT( change_dname(QString) ) );
128 connect (
placeXEdit , SIGNAL( textChanged (QString) ),
this, SLOT( change_placement() ) );
129 connect (
placeYEdit , SIGNAL( textChanged (QString) ),
this, SLOT( change_placement() ) );
130 connect (
placeZEdit , SIGNAL( textChanged (QString) ),
this, SLOT( change_placement() ) );
141 QLabel *dNameLabel =
new QLabel(what.c_str());
144 QLabel *dDescLabel =
new QLabel(what.c_str());
147 QLabel *dMateLabel =
new QLabel(what.c_str());
150 QLabel *dMagfLabel =
new QLabel(what.c_str());
153 QLabel *dSensLabel =
new QLabel(what.c_str());
157 QLabel *dHitLabel, *dIdenLabel;
164 dHitLabel =
new QLabel(what.c_str());
166 what =
"Identifier: " ;
169 dIdenLabel =
new QLabel(what.c_str());
172 QVBoxLayout *mainLayout =
new QVBoxLayout;
173 mainLayout->addWidget(dNameLabel);
174 mainLayout->addWidget(dDescLabel);
175 mainLayout->addWidget(dMateLabel);
176 mainLayout->addWidget(dMagfLabel);
177 mainLayout->addWidget(dSensLabel);
180 mainLayout->addWidget(dHitLabel);
181 mainLayout->addWidget(dIdenLabel);
184 setLayout(mainLayout);
191 void PlacementTab::change_dname(QString dname)
200 QLabel *solidType =
new QLabel(detect->
type.c_str());
201 solidType->setFrameStyle(QFrame::Panel | QFrame::Sunken);
203 for(
unsigned int i=0; i<dimTypes.size(); i++)
209 dtot = d1 +
"*" + d2 ;
214 if(
Detector->
type ==
"Box") solidpic = QPixmap(g4Box_xpm);
215 if(
Detector->
type ==
"Cons") solidpic = QPixmap(g4Cons_xpm);
216 if(
Detector->
type ==
"G4Trap") solidpic = QPixmap(g4Trap_xpm);
217 if(
Detector->
type ==
"ITrd") solidpic = QPixmap(g4Trap_xpm);
218 if(
Detector->
type ==
"Polycone") solidpic = QPixmap(g4Polycone_xpm);
219 if(
Detector->
type ==
"Tube") solidpic = QPixmap(g4Tubs_xpm);
220 if(
Detector->
type ==
"Sphere") solidpic = QPixmap(g4Sphere_xpm);
221 if(
Detector->
type ==
"Trd") solidpic = QPixmap(g4Trd_xpm);
222 if(
Detector->
type ==
"Ellipsoid") solidpic = QPixmap(g4EllipticalTube_xpm);
223 if(
Detector->
type ==
"Torus") solidpic = QPixmap(g4Torus_xpm);
224 if(
Detector->
type.find(
"CopyOf") != string::npos) solidpic = QPixmap(copy_xpm);
225 if(
Detector->
type.find(
"Operation:") != string::npos) solidpic = QPixmap(operation_xpm);
227 QLabel *solidPicL =
new QLabel();
228 solidPicL->setPixmap(solidpic);
232 QVBoxLayout *mainLayout =
new QVBoxLayout;
233 mainLayout->addWidget(solidType);
234 for(
unsigned int i=0; i<dimTypes.size(); i++)
239 VPlacements ->setLayout(mainLayout);
243 QHBoxLayout *viewLayout =
new QHBoxLayout(
this);
244 viewLayout->addWidget(VPlacements);
245 viewLayout->addWidget(solidPicL);
247 for(
unsigned int i=0; i<dimTypes.size(); i++)
251 connect (
dimTypesEdit[i] , SIGNAL( textChanged (QString) ),
this, SLOT( change_dimension() ) );
256 void DimensionsTab::change_dimension()
258 vector<double> newdimensions;
260 for(
unsigned int i=0; i<dimTypes.size(); i++)
267 void PlacementTab::change_placement()
274 G4ThreeVector newpos(x, y, z);
QLabel * rotXLabel
label for x rotation
vector< QLineEdit * > dimTypesEdit
vector of line editor for dimension. Size depends on solid type
PlacementTab(detector *, QWidget *parent=0)
Constructor.
QLineEdit * rotYEdit
line editor for y rotation
QLineEdit * placeYEdit
line editor for y position
detector * Detector
pointer to detector
QLabel * rotZLabel
label for z rotation
string sensitivity
Defines the Sensitive Detector. possible choices: "no" "hits collection name".
QLabel * placeYLabel
label for y position
QLabel * placeZLabel
label for z position
vector< QLabel * > dimTypesLabel
vector of label for dimension. Size depends on solid type
G4ThreeVector pos
Position relative to the mother volume, as G4ThreeVector.
string gemc_tostring(QString input)
DimensionsTab(detector *, QWidget *parent=0)
Constructor.
QLineEdit * placeXEdit
line editor for x position
vector< vector< string > > dimensionstype(string solidtype)
Returns dimensions nomenclature for different solid type.
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 * placeXLabel
label for x position
SensitivityTab(detector *, QWidget *parent=0)
Constructor.
QLabel * rotYLabel
label for y rotation
string material
Volume Material name.
detector * Detector
Pointer to detector object.
string hitType
Hit Process routine name. A Hit Process MPHBaseClass derived class must exists with this name...
vector< identifier > identity
Vector of identifiers. Example: superlayer manual 1 type manual 2 segment manual 3 strip manual 4...
detector * Detector
Pointer to detector object.
string magfield
Magnetic Field. The string "no" means that the field is inherited from the mother volume...
QLineEdit * rotZEdit
line editor for z rotation
detector * Detector
pointer to detector
G4RotationMatrix rot
Rotation Matrix, defined by rotations along x,y,z axis relative to the mother volume.
string type
solid type. This follows the GEANT4 definitions
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
QLineEdit * rotXEdit
line editor for x rotation
double get_number(string)
Returns dimension from string, i.e. 100*cm.
DetectorEditor(detector *, QWidget *parent=0)
Constructor.
QLineEdit * placeZEdit
line editor for z position
string description
Volume Description for documentation.