31#ifdef G4LIB_USE_PYTHIA
35#include "G4UIdirectory.hh"
36#include "G4UIcmdWithoutParameter.hh"
37#include "G4UIcmdWithAString.hh"
38#include "G4UIcmdWithAnInteger.hh"
47 dir-> SetGuidance(
"Commands for Pythia event generation");
50 verbose-> SetGuidance(
"set verbose level");
51 verbose-> SetParameterName(
"verboseLevel",
false,
false);
52 verbose-> SetRange(
"verboseLevel>=0 && verboseLevel<=2");
55 mpylist-> SetGuidance(
"set argument of pylist (not called if mlist=0)");
56 mpylist-> SetParameterName(
"mlist",
false,
false);
57 mpylist-> SetRange(
"mlist>=0 && mlist<=3");
60 print-> SetGuidance(
"print user information.");
62 cpyinit=
new G4UIcommand(
"/generator/pythia/pyinit",
this);
63 cpyinit-> SetGuidance(
"call PYINIT");
66 cpyinit-> SetParameter(frame);
68 cpyinit-> SetParameter(beam);
70 cpyinit-> SetParameter(target);
72 cpyinit-> SetParameter(win);
75 cpystat-> SetGuidance(
"call PYSTAT");
76 cpystat-> SetParameterName(
"mstat",
false,
false);
77 cpystat-> SetRange(
"mstat>=1 && mstat<=5");
79 cpygive=
new G4UIcommand(
"/generator/pythia/pygive",
this);
80 cpygive-> SetGuidance(
"call PYGIVE");
82 cpygive-> SetParameter(parameter);
87 SetGuidance(
"Set user parameters in the Pythia common blocks");
90 setSeed-> SetGuidance(
"set initial seed.");
92 cpyrget=
new G4UIcommand(
"/generator/pythia/pyrget",
this);
93 cpyrget-> SetGuidance(
"call PYRGET");
96 cpyrget-> SetParameter(lun);
97 move=
new G4UIparameter(
"choice of adding a new record",
'i',
true);
98 move-> SetDefaultValue(-1);
99 cpyrget-> SetParameter(move);
101 cpyrset=
new G4UIcommand(
"/generator/pythia/pyrset",
this);
102 cpyrset-> SetGuidance(
"call PYRSET");
104 cpyrset-> SetParameter(lun);
105 move=
new G4UIparameter(
"choice of adding a new record",
'i',
true);
106 move-> SetDefaultValue(0);
107 cpyrset-> SetParameter(move);
111 printRandomStatus-> SetGuidance(
"print random number status.");
112 printRandomStatus-> SetParameterName(
"filename",
true,
false);
113 printRandomStatus-> SetDefaultValue(
"std::cout");
139 G4int level=
verbose-> GetNewIntValue(newValues);
140 gen-> SetVerboseLevel(level);
142 }
else if (command ==
mpylist) {
143 G4int mlist=
mpylist-> GetNewIntValue(newValues);
144 gen-> SetPylist(mlist);
146 }
else if (command ==
print) {
149 }
else if (command ==
cpyinit) {
150 const char* strvaluelist= newValues.c_str();
151 std::istringstream is(strvaluelist);
152 G4String sframe, sbeam, starget; G4double dwin;
153 is >> sframe >> sbeam >> starget >> dwin;
154 gen-> CallPyinit(sframe, sbeam, starget, dwin);
156 }
else if (command ==
cpystat) {
157 G4int imod=
cpystat-> GetNewIntValue(newValues);
158 gen-> CallPystat(imod);
160 }
else if (command ==
cpygive) {
165 gen-> SetUserParameters();
167 }
else if (command ==
setSeed) {
168 G4int iseed=
setSeed-> GetNewIntValue(newValues);
169 gen-> SetRandomSeed(iseed);
171 }
else if (command ==
cpyrget) {
172 const char* strvaluelist= newValues.c_str();
173 std::istringstream is(strvaluelist);
176 gen-> CallPyrget(lun, move);
178 }
else if (command ==
cpyrset) {
179 const char* strvaluelist= newValues.c_str();
180 std::istringstream is(strvaluelist);
183 gen-> CallPyrset(lun, move);
187 if (newValues ==
"std::cout") {
188 gen-> PrintRandomStatus();
192 ofs.open(s.c_str(), std::ios::out);
194 ofs.setf(std::ios::fixed | std::ios::showpoint);
195 gen-> PrintRandomStatus(ofs);
207 }
else if (command ==
mpylist) {
void Print(const std::vector< T > &data)
Definition of the HepMCG4PythiaInterface class.
Definition of the HepMCG4PythiaMessenger class.
A generic interface class with Pythia event generator via HepMC.
G4int GetVerboseLevel() const
G4UIcommand * setUserParameters
G4UIcmdWithAnInteger * mpylist
HepMCG4PythiaMessenger(HepMCG4PythiaInterface *agen)
void SetNewValue(G4UIcommand *command, G4String newValues)
G4UIcmdWithoutParameter * print
HepMCG4PythiaInterface * gen
G4String GetCurrentValue(G4UIcommand *command)
G4UIcmdWithAnInteger * verbose
G4UIcmdWithAString * printRandomStatus
~HepMCG4PythiaMessenger()
G4UIcmdWithAnInteger * setSeed
G4UIcmdWithAnInteger * cpystat