32 #ifdef G4LIB_USE_PYTHIA
40 #include "HepMCG4PythiaMessenger.hh"
41 #include "HepMCG4PythiaInterface.hh"
48 dir-> SetGuidance(
"Commands for Pythia event generation");
51 verbose-> SetGuidance(
"set verbose level");
52 verbose-> SetParameterName(
"verboseLevel",
false,
false);
53 verbose-> SetRange(
"verboseLevel>=0 && verboseLevel<=2");
56 mpylist-> SetGuidance(
"set argument of pylist (not called if mlist=0)");
57 mpylist-> SetParameterName(
"mlist",
false,
false);
58 mpylist-> SetRange(
"mlist>=0 && mlist<=3");
61 print-> SetGuidance(
"print user information.");
63 cpyinit=
new G4UIcommand(
"/generator/pythia/pyinit",
this);
64 cpyinit-> SetGuidance(
"call PYINIT");
67 cpyinit-> SetParameter(frame);
69 cpyinit-> SetParameter(beam);
71 cpyinit-> SetParameter(target);
73 cpyinit-> SetParameter(win);
76 cpystat-> SetGuidance(
"call PYSTAT");
77 cpystat-> SetParameterName(
"mstat",
false,
false);
78 cpystat-> SetRange(
"mstat>=1 && mstat<=5");
80 cpygive=
new G4UIcommand(
"/generator/pythia/pygive",
this);
81 cpygive-> SetGuidance(
"call PYGIVE");
83 cpygive-> SetParameter(parameter);
88 SetGuidance(
"Set user parameters in the Pythia common blocks");
91 setSeed-> SetGuidance(
"set initial seed.");
93 cpyrget=
new G4UIcommand(
"/generator/pythia/pyrget",
this);
94 cpyrget-> SetGuidance(
"call PYRGET");
97 cpyrget-> SetParameter(lun);
98 move=
new G4UIparameter(
"choice of adding a new record",
'i',
true);
99 move-> SetDefaultValue(-1);
100 cpyrget-> SetParameter(move);
102 cpyrset=
new G4UIcommand(
"/generator/pythia/pyrset",
this);
103 cpyrset-> SetGuidance(
"call PYRSET");
105 cpyrset-> SetParameter(lun);
106 move=
new G4UIparameter(
"choice of adding a new record",
'i',
true);
107 move-> SetDefaultValue(0);
108 cpyrset-> SetParameter(move);
112 printRandomStatus-> SetGuidance(
"print random number status.");
113 printRandomStatus-> SetParameterName(
"filename",
true,
false);
114 printRandomStatus-> SetDefaultValue(
"std::cout");
141 gen-> SetVerboseLevel(level);
143 }
else if (command ==
mpylist) {
145 gen-> SetPylist(mlist);
147 }
else if (command ==
print) {
150 }
else if (command ==
cpyinit) {
151 const char* strvaluelist= newValues.c_str();
152 std::istringstream is(strvaluelist);
154 is >> sframe >> sbeam >> starget >> dwin;
155 gen-> CallPyinit(sframe, sbeam, starget, dwin);
157 }
else if (command ==
cpystat) {
159 gen-> CallPystat(imod);
161 }
else if (command ==
cpygive) {
166 gen-> SetUserParameters();
168 }
else if (command ==
setSeed) {
170 gen-> SetRandomSeed(iseed);
172 }
else if (command ==
cpyrget) {
173 const char* strvaluelist= newValues.c_str();
174 std::istringstream is(strvaluelist);
177 gen-> CallPyrget(lun, move);
179 }
else if (command ==
cpyrset) {
180 const char* strvaluelist= newValues.c_str();
181 std::istringstream is(strvaluelist);
184 gen-> CallPyrset(lun, move);
188 if (newValues ==
"std::cout") {
189 gen-> PrintRandomStatus();
193 ofs.open(s.c_str(), std::ios::out);
195 ofs.setf(std::ios::fixed | std::ios::showpoint);
196 gen-> PrintRandomStatus(ofs);
208 }
else if (command ==
mpylist) {
HepMCG4PythiaInterface * gen
G4UIcmdWithAnInteger * verbose
void print(G4double elem)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValues)
G4UIcmdWithAnInteger * mpylist
~HepMCG4PythiaMessenger()
G4UIcmdWithAnInteger * cpystat
G4UIcommand * setUserParameters
void Print(G4Element &ele)
G4int GetVerboseLevel() const
G4UIcmdWithAString * printRandomStatus
G4UIcmdWithAnInteger * setSeed
G4UIcmdWithoutParameter * print
A generic interface class with Pythia event generator via HepMC.
HepMCG4PythiaMessenger(HepMCG4PythiaInterface *agen)