60 num_written(0), transform(trans), boundary_step(1E-4) {
65 int err = inp->getInput(
"phsp output directory", dir);
67 dir = egsJoinPath(app->getAppDir(), app->getWorkDir());
71 egsFatal(
"PHSPControl:: unable to access directory %s\n", dir.c_str());
74 fname = egsJoinPath(dir, app->getOutputFile())+
".phsp";
76 vector<string> yn_choices;
77 yn_choices.push_back(
"no");
78 yn_choices.push_back(
"yes");
80 print_header = (bool)inp->getInput(
"print header", yn_choices, 0);
85 vector<string> access_choices;
86 access_choices.push_back(
"append");
87 access_choices.push_back(
"write");
88 int imode = inp->getInput(
"access mode", access_choices, 0);
91 }
else if (imode == 1) {
94 egsFatal(
"PHSPControl:: unknown access mode\n");
121 EGS_Vector new_loc(p->x);
122 EGS_Vector new_dir(p->u);
123 EGS_Vector new_dir_norm(p->u);
125 new_dir_norm.normalize();
135 IAEA_I32 n_stat = p->wt < 1. ? 0 : 1;
138 const IAEA_Float E = (IAEA_Float)p->E,
139 wt = (IAEA_Float)p->wt,
140 x = (IAEA_Float)new_loc.x,
141 y = (IAEA_Float)new_loc.y,
142 z = (IAEA_Float)new_loc.z,
143 u = (IAEA_Float)new_dir.x,
144 v = (IAEA_Float)new_dir.y,
145 w = (IAEA_Float)new_dir.z;
147 const IAEA_Float extra_float = 0.;
148 const IAEA_I32 extra_int = 0;
150 iaea_write_particle(&
id, &n_stat, &type, &E, &wt, &x, &y, &z, &u, &v, &w, &extra_float, &extra_int);
156 int np = the_stack->np - 1;
157 the_stack->wt[np] = 0;
PHSPControl(EGS_Input *inp, EGS_AffineTransform *trans, EGS_AdvancedApplication *app, Publisher *pub)
PHSP Control constructor.