7 #include "G4ParticleTable.hh" 10 #include "CLHEP/Units/PhysicalConstants.h" 11 using namespace CLHEP;
29 QLabel *neventLabel =
new QLabel(tr(
"N. Particles/Event"));
30 QLabel *timewindowLabel = NULL;
31 if( type ==
"Primary") timewindowLabel =
new QLabel(tr(
"Dummy, not displayed\n"));
32 if( type ==
"Lumi1") timewindowLabel =
new QLabel(tr(
"Time Window"));
33 if( type ==
"Lumi2") timewindowLabel =
new QLabel(tr(
""));
34 QLabel *bunchLabel =
new QLabel(tr(
"Bunch Time"));
35 neventLabel->setFixedHeight(10);
36 timewindowLabel->setFixedHeight(10);
37 bunchLabel->setFixedHeight(10);
38 QHBoxLayout *lumiHLayout =
new QHBoxLayout;
39 lumiHLayout->addSpacing(45);
40 lumiHLayout->addWidget(neventLabel);
41 lumiHLayout->addSpacing(25);
42 lumiHLayout->addWidget(timewindowLabel);
43 lumiHLayout->addSpacing(20);
44 lumiHLayout->addWidget(bunchLabel);
46 nevents =
new QLineEdit();
47 timewindow =
new QLineEdit();
48 time_bunch =
new QLineEdit();
49 nevents->setMaximumWidth(100);
50 timewindow->setMaximumWidth(100);
51 time_bunch->setMaximumWidth(100);
52 nevents->setMinimumHeight(18);
53 timewindow->setMinimumHeight(18);
54 time_bunch->setMinimumHeight(18);
55 QHBoxLayout *lumiHLayout2 =
new QHBoxLayout;
56 lumiHLayout2->addWidget(nevents);
57 if( type ==
"Lumi1") lumiHLayout2->addWidget(timewindow);
58 if( type ==
"Lumi2") lumiHLayout2->addSpacing(135);
59 lumiHLayout2->addWidget(time_bunch);
61 QString L_ne =
stringify(lnevents).c_str();
62 nevents->setText(L_ne);
64 QString L_tw =
stringify(twindow/ns).c_str() + QString(
"*ns");
65 timewindow->setText(L_tw);
67 QString L_tb =
stringify(tbunch/ns).c_str() + QString(
"*ns");
68 time_bunch->setText(L_tb);
70 connect ( nevents , SIGNAL( textChanged(
const QString & ) ), parent, SLOT( changePars() ) );
71 connect ( timewindow , SIGNAL( textChanged(
const QString & ) ), parent, SLOT( changePars() ) );
72 connect ( time_bunch , SIGNAL( textChanged(
const QString & ) ), parent, SLOT( changePars() ) );
74 LumiGroup =
new QGroupBox(tr(
""));
75 QVBoxLayout *LLayout =
new QVBoxLayout;
76 LLayout->addLayout(lumiHLayout);
77 LLayout->addLayout(lumiHLayout2);
78 LLayout->addStretch(1);
79 LumiGroup->setMaximumHeight(52);
81 LumiGroup->setLayout(LLayout);
100 connect (
momControl->
momLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
101 connect (
momControl->
rmomLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
102 connect (
momControl->
momUnits , SIGNAL( currentIndexChanged(
int) ) , parent, SLOT( changePars() ) );
103 connect (
momControl->
theLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
104 connect (
momControl->
rtheLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
105 connect (
momControl->
theUnits , SIGNAL( currentIndexChanged(
int) ) , parent, SLOT( changePars() ) );
106 connect (
momControl->
phiLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
107 connect (
momControl->
rphiLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
108 connect (
momControl->
theUnits , SIGNAL( currentIndexChanged(
int) ) , parent, SLOT( changePars() ) );
114 connect (
vtxControl->
vxLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
115 connect (
vtxControl->
vyLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
116 connect (
vtxControl->
vzLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
117 connect (
vtxControl->
vtxUnits , SIGNAL( currentIndexChanged(
int) ) , parent, SLOT( changePars() ) );
118 connect (
vtxControl->
rvrLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
119 connect (
vtxControl->
rvzLE , SIGNAL( textEdited(
const QString &)), parent, SLOT( changePars() ) );
124 QVBoxLayout *mainLayout =
new QVBoxLayout;
125 if(
type ==
"Lumi1" ||
type ==
"Lumi2")
130 mainLayout->addStretch(1);
131 setLayout(mainLayout);
143 string lumi_event = L_ne +
", " + L_tw +
", " + L_tb;
144 if(t != 0) lumi_event = L_ne +
", " +
stringify(t) +
"*ns, " + L_tb;
147 cout <<
" - GUI Generator Settings: " <<
type <<
" lumi event " << lumi_event << endl;
QComboBox * beam_particle
particleTab(QWidget *, goptions *, string)
vector< string > get_info(string input, string chars)
get information from strings such as "5*GeV, 2*deg, 10*deg", parses out strings in second argument ...
double get_number(string v, int warn_no_unit)
Returns number with dimension from string, i.e. 100*cm.
string stringify(double x)
map< string, aopt > optMap
Options map.
string get_lumi_event(double)
lumiEvent(goptions *Opts, QWidget *, string)
string qs_tostring(QString input)
QGroupBox * momentumGroup