65 #ifdef DEBUG_APPLICATION
66 #define CHECK_GET_APPLICATION(a,b) \
67 EGS_Application *a = EGS_Application::activeApplication(); \
68 if( !a ) egsFatal("%s: no active application!\n",b);
70 #define CHECK_GET_APPLICATION(a,b) \
71 EGS_Application *a = EGS_Application::activeApplication();
100 #define egsGetRNGPointers F77_OBJ_(egs_get_rng_pointers,EGS_GET_RNG_POINTERS)
101 extern __extc__
void egsGetRNGPointers(EGS_I32 *, EGS_I32 *);
102 #define egsGetRNGArray F77_OBJ_(egs_get_rng_array,EGS_GET_RNG_ARRAY)
103 extern __extc__
void egsGetRNGArray(EGS_Float *);
104 #define egsSetRNGState F77_OBJ_(egs_set_rng_state,EGS_SET_RNG_STATE)
105 extern __extc__
void egsSetRNGState(
const EGS_I32 *,
const EGS_Float *);
106 #define egsGetSteps F77_OBJ_(egs_get_steps,EGS_GET_STEPS)
107 extern __extc__
void egsGetSteps(
double *,
double *);
108 #define egsSetSteps F77_OBJ_(egs_set_steps,EGS_SET_STEPS)
109 extern __extc__
void egsSetSteps(
const double *,
const double *);
110 #define egsOpenUnits F77_OBJ_(egs_open_units,EGS_OPEN_UNITS)
111 extern __extc__
void egsOpenUnits(
const EGS_I32 *);
112 #define egsGetElectronData F77_OBJ_(egs_get_electron_data,EGS_GET_ELECTRON_DATA)
113 extern __extc__
void egsGetElectronData(
void (*func)(EGS_I32 *,EGS_Float *,
114 EGS_Float *,EGS_Float *,EGS_Float *),
const EGS_I32 *,
const EGS_I32 *);
115 #define egsGetPhotonData F77_OBJ_(egs_get_photon_data,EGS_GET_PHOTON_DATA)
116 extern __extc__
void egsGetPhotonData(
void (*func)(EGS_I32 *,EGS_Float *,
117 EGS_Float *,EGS_Float *,EGS_Float *),
const EGS_I32 *,
const EGS_I32 *);
119 static EGS_Float *__help1, *__help2, *__help3, *__help4;
120 static EGS_I32 *__ihelp;
121 static void __help_get_data(EGS_I32 *nbin,EGS_Float *emin, EGS_Float *emax,
122 EGS_Float *a, EGS_Float *b) {
130 static void __init_interpolator(
int q,
int imed,
int type,
133 egsGetElectronData(__help_get_data,&imed,&type);
136 egsGetPhotonData(__help_get_data,&imed,&type);
138 i.
initialize(*__ihelp,*__help1,*__help2,__help3,__help4);
147 static EGS_LOCAL
void __egs_iovar(
int nio,
int ns,
148 const char *source,
char *var) {
150 egsFatal(
"Mortran variable is not long enough to hold %s\n",source);
153 for (j=0; j<ns; j++) {
157 for (j=ns+1; j<nio; j++) {
162 static EGS_LOCAL
char __write_buf[8192];
163 extern __extc__
void F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(
int *,
165 void EGS_LOCAL __write_to_fortran_file(
const char *msg, ...) {
168 vsprintf(__write_buf,msg,ap);
171 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,__write_buf,
172 strlen(__write_buf));
174 void EGS_LOCAL __write_to_fortran_file_and_exit(
const char *msg, ...) {
177 vsprintf(__write_buf,msg,ap);
180 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,__write_buf,
181 strlen(__write_buf));
185 extern __extc__
void F77_OBJ_(egs_set_defaults,EGS_SET_DEFAULTS)();
186 extern __extc__
void F77_OBJ_(egs_init1,EGS_INIT1)();
188 F77_OBJ_(egs_set_defaults,EGS_SET_DEFAULTS)();
189 __egs_iovar(64,app_name.size(),app_name.c_str(),
the_egsio->user_code);
190 __egs_iovar(128,hen_house.size(),hen_house.c_str(),
the_egsio->hen_house);
191 __egs_iovar(128,egs_home.size(),egs_home.c_str(),
the_egsio->egs_home);
192 __egs_iovar(256,input_file.size(),input_file.c_str(),
the_egsio->input_file);
193 __egs_iovar(256,final_output_file.size(),final_output_file.c_str(),
195 __egs_iovar(256,pegs_file.size(),pegs_file.c_str(),
the_egsio->pegs_file);
203 F77_OBJ_(egs_init1,EGS_INIT1)();
247 class EGS_LOCAL EGS_TransportProperty {
250 vector<string> options;
251 vector<string> *str_v;
252 vector<EGS_Float> *f_v;
256 EGS_Float *float_input;
263 EGS_TransportProperty(
const char *Name, EGS_I32 *val) :
264 name(Name), type(0), int_input(val) {};
266 EGS_TransportProperty(
const char *Name, EGS_Float *val) :
267 name(Name), type(1), float_input(val) {};
269 EGS_TransportProperty(
const char *Name,
int L,
char *val) :
270 name(Name), type(3), len(L), char_input(val) {};
272 EGS_TransportProperty(
const char *Name,
int L,
int N,vector<string> *str):
273 name(Name), str_v(str), type(4), len(L), nitem(N) {};
275 EGS_TransportProperty(
const char *Name,
int N,vector<EGS_Float> *f):
276 name(Name), f_v(f), type(5), nitem(N) {};
278 void addOption(
const char *opt) {
279 options.push_back(opt);
282 void setOption(
const int &index,
const char *opt) {
283 options[index] = opt;
288 int err = input->
getInput(name,aux);
293 else if (type == 0) {
295 int err = input->
getInput(name,aux);
300 else if (type == 3) {
301 int err = input->
getInput(name,charinp);
303 int l = charinp.size();
308 for (j=0; j<l; j++) {
309 char_input[j] = charinp[j];
311 for (j=l; j<len; j++) {
316 charinp = string(char_input).substr(0,len);
319 else if (type == 4) {
320 int err = input->
getInput(name,*str_v);
322 vector<string> str = *str_v;
324 int number = str.size();
326 str.erase(str.begin()+nitem,str.end());
329 for (
int i=0; i<number; i++) {
330 if (str[i].size()>len) {
331 str[i] = str[i].substr(0,len);
337 else if (type == 5) {
338 int err = input->
getInput(name,*f_v);
340 vector<EGS_Float> fv = *f_v;
342 int number = fv.size();
344 fv.erase(fv.begin()+nitem,fv.end());
352 EGS_I32 iaux = input->
getInput(name,options,0,&is_ok);
356 egsWarning(
"Property %s: %d\n",name.c_str(),*int_input);
361 for (
int j=name.size(); j<nc; j++) {
367 else if (type == 1) {
370 else if (type == 3) {
371 egsInformation(
"%s\n",(
string(char_input).substr(0,len)).c_str());
373 else if (type == 5) {
374 for (vector<EGS_Float>::iterator it = f_v->begin() ; it != f_v->end(); ++it) {
385 return sizeof(EGS_Float);
387 else if (type == 3) {
390 else if (type == 4) {
393 else if (type == 5) {
397 return sizeof(EGS_I32);
405 EGS_Application(argc,argv), nmed(0), n_rng_buffer(0), final_job(false), io_flag(0) { }
435 egsWarning(
"In initCrossSections(): spin effects = %d\n",
444 extern "C" void F77_OBJ_(set_elastic_parameter,SET_ELASTIC_PARAMETER)();
448 egsWarning(
"initCrossSections(): no geometry?\n");
454 egsWarning(
"initCrossSections(): no media in this geometry?\n");
459 int *ind =
new int [
nmed];
460 for (j=0; j<
nmed; j++) {
462 int len = strlen(medname);
466 vector<string> ff_media, ff_names;
468 vector<EGS_Float> efield_v, bfield_v;
482 EGS_TransportProperty efield(
"Electric Field",3,&efield_v);
483 EGS_TransportProperty bfield(
"Magnetic Field",3,&bfield_v);
484 EGS_TransportProperty estepem(
"EM ESTEPE",&
the_emf->EMLMTIN);
490 EGS_TransportProperty skind(
"Skin depth for BCA",
492 EGS_TransportProperty pxsec(
"Photon cross sections",16,
the_media->
pxsec);
493 EGS_TransportProperty pxsec_out(
"Photon cross-sections output",&
the_egsio->xsec_out);
494 pxsec_out.addOption(
"Off");
495 pxsec_out.addOption(
"On");
500 bc.addOption(
"Simple");
501 bc.addOption(
"norej");
502 EGS_TransportProperty radc(
"Radiative Compton corrections",
504 radc.addOption(
"Off");
505 radc.addOption(
"On");
509 photonuc.addOption(
"Off");
510 photonuc.addOption(
"On");
513 rayl.addOption(
"Off");
514 rayl.addOption(
"On");
515 rayl.addOption(
"custom");
516 EGS_TransportProperty ff_med(
"ff media names",24,MXMED,&ff_media);
517 EGS_TransportProperty ff_files(
"ff file names",128,MXMED, &ff_names);
520 relax.addOption(
"Off");
521 relax.addOption(
"On");
522 relax.addOption(
"eadl");
523 relax.addOption(
"simple");
525 EGS_TransportProperty iphter(
"Photoelectron angular sampling",
527 iphter.addOption(
"Off");
528 iphter.addOption(
"On");
530 spin.addOption(
"Off");
531 spin.addOption(
"On");
533 trip.addOption(
"Off");
534 trip.addOption(
"On");
535 EGS_TransportProperty eii(
"Electron Impact Ionization",16,
the_media->
eiixsec);
537 brem.addOption(
"BH");
538 brem.addOption(
"NIST");
539 brem.addOption(
"NRC");
541 bang.addOption(
"Simple");
542 bang.addOption(
"KM");
544 pair.addOption(
"BH");
545 pair.addOption(
"NRC");
547 pang.addOption(
"Off");
548 pang.addOption(
"Simple");
549 pang.addOption(
"KM");
550 pang.addOption(
"Uniform");
551 pang.addOption(
"Blend");
552 EGS_TransportProperty tran(
"Electron-step algorithm",
554 tran.addOption(
"EGSnrc");
555 tran.addOption(
"PRESTA-I");
556 tran.addOption(
"PRESTA-II");
557 tran.addOption(
"default");
558 EGS_TransportProperty bca(
"Boundary crossing algorithm",
560 bca.addOption(
"Exact");
561 bca.addOption(
"PRESTA-I");
564 efield.getInput(transportp);
565 bfield.getInput(transportp);
566 estepem.getInput(transportp);
567 ecut.getInput(transportp);
568 pcut.getInput(transportp);
569 smax.getInput(transportp);
571 estep.getInput(transportp);
572 ximax.getInput(transportp);
573 skind.getInput(transportp);
574 pxsec.getInput(transportp);
575 pxsec_out.getInput(transportp);
576 cxsec.getInput(transportp);
577 photonucxsec.getInput(transportp);
578 photonuc.getInput(transportp);
579 bc.getInput(transportp);
580 radc.getInput(transportp);
581 rayl.getInput(transportp);
583 ff_med.getInput(transportp);
584 ff_files.getInput(transportp);
587 relax.getInput(transportp);
595 relax.setOption(1,
"eadl");
598 iphter.getInput(transportp);
599 spin.getInput(transportp);
600 trip.getInput(transportp);
601 eii.getInput(transportp);
603 brem.getInput(transportp);
604 bang.getInput(transportp);
605 pair.getInput(transportp);
606 pang.getInput(transportp);
607 tran.getInput(transportp);
611 bca.getInput(transportp);
613 if (egsEquivStr(
string(
"mcdf-xcom "),
618 else if (egsEquivStr(
string(
"mcdf-epdl "),
631 "\n Simplified atomic relaxation not allowed"
632 "\n with shellwise PE cross sections. Resetting"
633 "\n to detailed EADL atomic relaxation!!!\n\n");
636 relax.setOption(1,
"eadl");
644 F77_OBJ_(set_elastic_parameter,SET_ELASTIC_PARAMETER)();
676 for (
int imed=0; imed<
nmed; imed++) {
680 __init_interpolator(1,imed1,type,
i_ededx[imed]);
682 __init_interpolator(1,imed1,type,
i_pdedx[imed]);
684 __init_interpolator(1,imed1,type,
i_esig[imed]);
686 __init_interpolator(1,imed1,type,
i_psig[imed]);
688 __init_interpolator(1,imed1,type,
i_ebr1[imed]);
690 __init_interpolator(1,imed1,type,
i_pbr1[imed]);
692 __init_interpolator(1,imed1,type,
i_pbr2[imed]);
694 __init_interpolator(0,imed1,type,
i_gmfp[imed]);
696 __init_interpolator(0,imed1,type,
i_gbr1[imed]);
698 __init_interpolator(0,imed1,type,
i_gbr2[imed]);
700 __init_interpolator(0,imed1,type,
i_cohe[imed]);
702 __init_interpolator(0,imed1,type,
i_photonuc[imed]);
708 "================================\n\n");
711 for (j=0; j<
nmed; j++) {
729 egsInformation(
"\n\nTransport parameter and cross section options:\n"
730 "==============================================\n");
735 egsEquivStr(
string(
"xcom "),
740 egsEquivStr(
string(
"epdl "),
761 photonucxsec.info(nc);
774 if (efield.size()==3) {
779 if (efield_v[0]*efield_v[0]+efield_v[1]*efield_v[1]+efield_v[2]*efield_v[2] > 0) {
784 if (bfield.size()==3) {
793 if (efield.size()==3 || bfield.size()==3) {
795 if (bfield_v[0]*bfield_v[0]+bfield_v[1]*bfield_v[1]+bfield_v[2]*bfield_v[2] > 0) {
799 egsInformation(
"==============================================\n\n");
816 const vector<string> &str_medium,
817 const vector<string> &str_file) {
820 for (i=0; i<str_medium.size(); i++) {
821 for (k=0; k<str_medium[i].size(); k++) {
825 for (i=0; i<str_file.size(); i++) {
826 for (k=0; k<str_file[i].size(); k++) {
842 string str_eii,off,on;
845 for (
int i=0; i<len; i++) {
855 if (str_eii == off) {
858 else if (str_eii == on) {
864 #define MAX_STEP 100000
865 EGS_Vector steps_x[MAX_STEP], steps_u[MAX_STEP];
866 int steps_ireg[MAX_STEP], steps_inew[MAX_STEP];
867 EGS_Float steps_ustepi[MAX_STEP], steps_ustepf[MAX_STEP];
955 egsGetRNGPointers(&np,&ip);
960 egsWarning(
"EGS_AdvancedApplication::outputData(): egsGetRNGPointers"
961 " returns a huge number? (%d)\n",np);
964 EGS_Float *array =
new EGS_Float [np];
965 egsGetRNGArray(array);
966 (*data_out) <<
" " << np <<
" " << ip << endl;
967 for (
int j=0; j<np; j++) {
968 (*data_out) << array[j] <<
" ";
971 double ch_steps, all_steps;
972 egsGetSteps(&ch_steps,&all_steps);
973 (*data_out) << ch_steps <<
" " << all_steps << endl;
984 (*data_in) >> np >> ip;
989 egsWarning(
"EGS_AdvancedApplication::readData(): got huge size "
990 "for the mortran random array? (%d)\n",np);
993 EGS_Float *array =
new EGS_Float [np];
994 for (
int j=0; j<np; j++) {
995 (*data_in) >> array[j];
1000 egsSetRNGState(&ip,array);
1002 double ch_steps, all_steps;
1003 (*data_in) >> ch_steps >> all_steps;
1004 egsSetSteps(&ch_steps,&all_steps);
1005 return data_in->good() ? 0 : 13;
1019 if (np > 10000000) {
1020 egsWarning(
"EGS_AdvancedApplication::addState(): got huge size "
1021 "for the mortran random array? (%d)\n",np);
1024 EGS_Float *array =
new EGS_Float [np];
1025 for (
int j=0; j<np; j++) {
1031 egsSetRNGState(&ip,array);
1033 double ch_steps, all_steps;
1034 data >> ch_steps >> all_steps;
1035 double ch_steps_old, all_steps_old;
1036 egsGetSteps(&ch_steps_old,&all_steps_old);
1037 ch_steps += ch_steps_old;
1038 all_steps += all_steps_old;
1039 egsSetSteps(&ch_steps,&all_steps);
1040 return data.good() ? 0 : 13;
1045 double ch_steps = 0, all_steps = 0;
1046 egsSetSteps(&ch_steps,&all_steps);
1052 egsGetRNGPointers(&np,&ip);
1059 void EGS_AdvancedApplication::appInformation(
const char *msg) {
1068 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1073 void EGS_AdvancedApplication::appWarning(
const char *msg) {
1082 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1087 void EGS_AdvancedApplication::appFatal(
const char *msg) {
1094 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1101 double &all_steps)
const {
1102 egsGetSteps(&ch_steps,&all_steps);
1136 void EGS_AdvancedApplication::enterNewRegion() {
1166 egsGetRNGPointers(&np,&ip);
1169 " new buffer size (%d) is not the same as previous size(%d) ?\n",
1191 EGS_Float EGS_AdvancedApplication::getMediumRho(
int ind) {
1199 EGS_Float EGS_AdvancedApplication::getEdep() {
1203 void EGS_AdvancedApplication::setEdep(EGS_Float edep) {
1207 EGS_Float EGS_AdvancedApplication::getEcut() {
1211 EGS_Float EGS_AdvancedApplication::getPcut() {
1215 EGS_Float EGS_AdvancedApplication::getRM() {
1224 void EGS_AdvancedApplication::setRadiativeSplitting(
const EGS_Float &nsplit) {
1229 void EGS_AdvancedApplication::setRussianRoulette(
const EGS_Float &iSwitchRR) {
1230 if (iSwitchRR > 1.0) {
1242 void EGS_AdvancedApplication::splitTopParticleIsotropically(
const EGS_Float &fsplit) {
1256 int nsplit = int(fsplit);
1257 EGS_Float dsplit = fsplit - nsplit;
1263 for (
int i=0; i < nsplit; i++) {
1265 if (np >= MXSTACK) {
1266 egsFatal(
"\n\n******************************************\n"
1267 "ERROR: In EGS_AdvancedApplication::splitTopParticleIsotropically() :\n"
1268 "max. stack depth MXSTACK=%d < np=%d\n"
1269 "Stack overflow due to splitting!\n"
1270 "******************************************\n"
1284 EGS_Float sinz = 1-w*w;
1287 EGS_Float cphi, sphi;
1311 EGS_Float EGS_AdvancedApplication::getTVSTEP() {
1315 EGS_Interpolator *EGS_AdvancedApplication::getDEDX(
const int &imed,
const int &iq) {
1327 void EGS_AdvancedApplication::setLatch(
const int &ip,
const int &latch) {
1331 void EGS_AdvancedApplication::incLatch(
const int &ip,
const int &increment) {
1335 int EGS_AdvancedApplication::getNp() {
1339 int EGS_AdvancedApplication::getNpOld() {
1346 void EGS_AdvancedApplication::setLatch(
int latch) {
1352 CHECK_GET_APPLICATION(app,
"egsHowfar()");
1355 if (ireg < 0 || the_stack->wt[np] == 0) {
1360 int inew = app->howfar(ireg,
1366 if (steps_n < MAX_STEP) {
1371 steps_ireg[steps_n] = ireg;
1372 steps_inew[steps_n] = inew;
1373 steps_ustepi[steps_n] = tsave;
1378 for (
int j=0; j<steps_n; j++)
1379 egsWarning(
"%d x=(%g,%g,%g) u=(%g,%g,%g) ireg=%d inew=%d ustepi=%g"
1380 " ustepf=%g\n",j,steps_x[j].x,steps_x[j].y,steps_x[j].z,
1381 steps_u[j].x,steps_u[j].y,steps_u[j].z,
1382 steps_ireg[j],steps_inew[j],steps_ustepi[j],
1390 app->enterNewRegion();
1399 CHECK_GET_APPLICATION(app,
"egsHownear()");
1407 CHECK_GET_APPLICATION(app,
"egsFillRandomArray()");
1408 app->fillRandomArray(*n,rarray);
1416 CHECK_GET_APPLICATION(app,
"egsAusgab()");
1427 *iarg = app->userScoring(*iarg);
1431 CHECK_GET_APPLICATION(app,
"egsStartParticle()");
1441 app->startNewParticle();
void resetCounter()
Reset the application to a 'pristine' state.
int readData()
Read intermediate results.
virtual void saveRNGState()
int initCrossSections()
Initialize the run-time cross section data.
int io_flag
determines how to write info
EGS_I64 randomNumbersUsed() const
Get the number of random numbers used.
virtual void finishRun()
Finish a simulation.
virtual ~EGS_AdvancedApplication()
Destructor.
EGS_Interpolator * i_gbr2
photon branching 2 interpolator
EGS_Interpolator * i_esig
electron cross section interpolator
EGS_Float * rng_buffer
RNG buffer.
EGS_Interpolator * i_pbr1
positron branching 1 interpolator
int i_rng_buffer
Pointer to the RNG buffer.
void setEIIData(EGS_I32 len)
Set EII flag and xsection file name.
int outputData()
Output intermediate results.
static string base_revision
Holds the CVS revision number of the egs_advanced_application.cpp file.
EGS_Interpolator * i_psig
positron cross section interpolator
EGS_Interpolator * i_ededx
electron stopping power interpolator
bool final_job
Is this the final job of a parallel run ?
EGS_Interpolator * i_gmfp
photon mean-free-path interpolator
EGS_Interpolator * i_cohe
photon Rayleigh interpolator
void startNewParticle()
Start the transport of a new particle.
EGS_Interpolator * i_ebr1
electron branching interpolator
int finishSimulation()
Finish the simulation.
void setRayleighData(const vector< string > &str_medium, const vector< string > &str_file)
Custom Rayleigh data setup.
void getElectronSteps(double &ch_steps, double &all_steps) const
Get the number of condensed history and all electron steps.
void setAusgabCall(AusgabCall call, bool on_or_off)
Turns on or off a call to the user scoring function ausgab()
EGS_Interpolator * i_photonuc
photonuclear interpolator
EGS_Interpolator * i_pdedx
positron stopping power interpolator
int initEGSnrcBackEnd()
Initialize the EGSnrc mortran back-end.
EGS_Interpolator * i_pbr2
positron branching 2 interpolator
int n_rng_buffer
Size of the RNG buffer.
int helpInit(EGS_Input *, bool do_hatch)
Helper function used in initCrossSections() and describeSimulation().
EGS_AdvancedApplication(int argc, char **argv)
Constructor.
int shower()
Simulate a single shower.
EGS_Interpolator * i_gbr1
photon branching 1 interpolator
virtual void resetRNGState()
void describeSimulation()
Describe the simulation.
int addState(istream &)
Add data from a parallel job.
Base class for advanced EGSnrc C++ applications.
virtual EGS_I64 randomNumbersUsed() const
Returns the number of random numbers used.
EGS_RandomGenerator * rndm
the random number generator
virtual void resetCounter()
Reset the application to a 'pristine' state.
EGS_SimpleContainer< EGS_AusgabObject * > a_objects_list
The ausgab objects.
string output_file
The output file name (no extension)
virtual void setAusgabCall(AusgabCall call, bool on_or_off)
Turns on or off a call to the user scoring function ausgab.
virtual void describeSimulation()
Describe the simulation.
virtual int addState(istream &data)
Add data from a parallel job.
virtual int finishSimulation()
Analyze and output the results.
virtual void appFatal(const char *)
Write a warning message and exit.
virtual int outputData()
Output intermediate results.
EGS_Input * input
the input to this simulation.
string app_name
The application name.
virtual void outputResults()
Output the simulation results.
string final_output_file
The final output file name.
EGS_BaseGeometry * geometry
the geometry of this simulation
AusgabCall
Possible calls to the user scoring function ausgab().
int i_parallel
Job index in parallel runs.
istream * data_in
data input stream
int app_index
the index of this application.
virtual void appInformation(const char *)
Write an information message.
virtual void describeUserCode() const
Describe the user code.
ostream * data_out
data output stream
virtual void appWarning(const char *)
Write a warning message.
EGS_RunControl * run
the run control object.
virtual int combineResults()
Combine results from parallel runs.
void checkDeviceFull(FILE *)
Check if a device holding a given stream is full.
EGS_BaseSource * source
the particle source
virtual int readData()
Read intermediate results.
static int nMedia()
Get the number of media registered so far by all geometries.
virtual EGS_Float getBScaling(int ireg) const
Get the B field scaling factor in region ireg.
bool hasBScaling() const
Does this geometry object have a B field scaling feature?
static void setActiveGeometryList(int list)
Set the currently active geometry list.
virtual EGS_Float getRelativeRho(int ireg) const
Get the relative mass density in region ireg.
bool hasRhoScaling() const
Does this geometry object have a mass density scaling feature?
static const char * getMediumName(int ind)
Get the name of medium with index ind.
virtual EGS_Float getEmax() const =0
Return the maximum energy of this source.
A class for fast run-time interpolations.
void initialize(int nbin, EGS_Float Xmin, EGS_Float Xmax, const EGS_Float *values)
Initialize the interpolator.
virtual void saveState()=0
Save the RNG state.
EGS_Float getUniform()
Returns a random number uniformly distributed between zero (inclusive) and 1 (exclusive).
virtual void resetState()=0
Reset the state to a previously saved state.
virtual int finishSimulation()
Finish the simulation.
A class representing 3D vectors.
__extc__ void egsHownear(EGS_Float *tperp)
Calculate minimum perpendicular distance to any surrounding boundary and return it in tperp.
__extc__ void egsAusgab(EGS_I32 *iarg)
User scoring function.
__extc__ void egsFillRandomArray(const EGS_I32 *n, EGS_Float *rarray)
Get n random numbers stored in the array pointed to by rarray.
EGS_AdvancedApplication class header file.
EGS_AusgabObject interface class header file.
EGS_BaseSource class header file.
Global egspp functions header file.
This file defines the C/C++ interface to the EGSnrc mortran back-end.
__extc__ struct EGS_VarianceReduction * the_egsvr
The address of the mortran egs_vr common block as a pointer to a C-structure of type EGS_VarianceRedu...
__extc__ struct EGS_Useful * the_useful
The address of the mortran USEFUL common block as a pointer to a C-structure of type EGS_Useful.
__extc__ struct EGS_Bounds * the_bounds
The address of the morrtan BOUNDS common block as a pointer to a C-structure of type EGS_Bounds.
__extc__ struct EGS_Epcont * the_epcont
The address of the mortran EPCONT common block as a pointer to a C-structure of type EGS_Epcont.
#define egsHatch
Initialize cross section data from a PEGS4 data file.
__extc__ struct EGS_emfInputs * the_emf
The address of the mortran EMF-INPUTS common block as a pointer to a C-structure of type EGS_emfInput...
#define egsHowfar
Calculate distance to the next boundary along the current direction of motion.
#define egsShower
Transport the particles currently on the particle stack.
__extc__ EGS_I32 egsAddMedium(const char *medname, EGS_I32 length)
Add a medium to the list of media.
__extc__ struct EGS_EtControl * the_etcontrol
The address of the mortran Et_Control common block as a pointer to a C-structure of type EGS_EtContro...
__extc__ struct EGS_XOptions * the_xoptions
The address of the mortran cross section options common block as a pointer to a C-structure of type E...
#define egsStartParticle
Start the transport of a new particle.
#define egsFinish
Finish a simulation.
__extc__ struct EGS_Rayleigh * the_rayleigh
The address of the mortran rayleigh_inputs common block as a pointer to a C-structure of type EGS_Ray...
__extc__ struct EGS_Stack * the_stack
The address of the mortran STACK common block as a pointer to a C-structure of type EGS_Stack.
__extc__ struct EGS_Media * the_media
The address of the mortran MEDIA common block as a pointer to a C-structure of type EGS_Media
__extc__ struct EGS_IO * the_egsio
The address of the mortran egs_io common block as a pointer to a C-structure of type EGS_IO.
__extc__ struct EGS_Thresh * the_thresh
The address of the mortran THRESH common block as a pointer to a C-structure of type EGS_Thresh.
EGS_Interpolator class header file.
Attempts to fix broken math header files.
EGS_RandomGenerator class header file.
EGS_RunControl and EGS_JCFControl class header file.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.
EGS_Float skindepth_for_bca
EGS_I32 transport_algorithm
EGS_Float E
particle energy in MeV
int ir
particle region index
int latch
latch variable (useful as a flag on many occasions)
EGS_Float wt
statistical weight
EGS_Float rhor
Mass density ratio.
EGS_I32 medium
Current medium.
EGS_Float rm
Electron rest energy.
EGS_Float rhor_new
Mass density ratio in the new region.
EGS_I32 medium_new
Medium in the new region.