63 #ifdef DEBUG_APPLICATION
64 #define CHECK_GET_APPLICATION(a,b) \
65 EGS_Application *a = EGS_Application::activeApplication(); \
66 if( !a ) egsFatal("%s: no active application!\n",b);
68 #define CHECK_GET_APPLICATION(a,b) \
69 EGS_Application *a = EGS_Application::activeApplication();
98 #define egsGetRNGPointers F77_OBJ_(egs_get_rng_pointers,EGS_GET_RNG_POINTERS)
99 extern __extc__
void egsGetRNGPointers(EGS_I32 *, EGS_I32 *);
100 #define egsGetRNGArray F77_OBJ_(egs_get_rng_array,EGS_GET_RNG_ARRAY)
101 extern __extc__
void egsGetRNGArray(EGS_Float *);
102 #define egsSetRNGState F77_OBJ_(egs_set_rng_state,EGS_SET_RNG_STATE)
103 extern __extc__
void egsSetRNGState(
const EGS_I32 *,
const EGS_Float *);
104 #define egsGetSteps F77_OBJ_(egs_get_steps,EGS_GET_STEPS)
105 extern __extc__
void egsGetSteps(
double *,
double *);
106 #define egsSetSteps F77_OBJ_(egs_set_steps,EGS_SET_STEPS)
107 extern __extc__
void egsSetSteps(
const double *,
const double *);
108 #define egsOpenUnits F77_OBJ_(egs_open_units,EGS_OPEN_UNITS)
109 extern __extc__
void egsOpenUnits(
const EGS_I32 *);
110 #define egsGetElectronData F77_OBJ_(egs_get_electron_data,EGS_GET_ELECTRON_DATA)
111 extern __extc__
void egsGetElectronData(
void (*func)(EGS_I32 *,EGS_Float *,
112 EGS_Float *,EGS_Float *,EGS_Float *),
const EGS_I32 *,
const EGS_I32 *);
113 #define egsGetPhotonData F77_OBJ_(egs_get_photon_data,EGS_GET_PHOTON_DATA)
114 extern __extc__
void egsGetPhotonData(
void (*func)(EGS_I32 *,EGS_Float *,
115 EGS_Float *,EGS_Float *,EGS_Float *),
const EGS_I32 *,
const EGS_I32 *);
117 static EGS_Float *__help1, *__help2, *__help3, *__help4;
118 static EGS_I32 *__ihelp;
119 static void __help_get_data(EGS_I32 *nbin,EGS_Float *emin, EGS_Float *emax,
120 EGS_Float *a, EGS_Float *b) {
128 static void __init_interpolator(
int q,
int imed,
int type,
131 egsGetElectronData(__help_get_data,&imed,&type);
134 egsGetPhotonData(__help_get_data,&imed,&type);
136 i.
initialize(*__ihelp,*__help1,*__help2,__help3,__help4);
145 static EGS_LOCAL
void __egs_iovar(
int nio,
int ns,
146 const char *source,
char *var) {
148 egsFatal(
"Mortran variable is not long enough to hold %s\n",source);
151 for (j=0; j<ns; j++) {
155 for (j=ns+1; j<nio; j++) {
160 static EGS_LOCAL
char __write_buf[8192];
161 extern __extc__
void F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(
int *,
163 void EGS_LOCAL __write_to_fortran_file(
const char *msg, ...) {
166 vsprintf(__write_buf,msg,ap);
169 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,__write_buf,
170 strlen(__write_buf));
172 void EGS_LOCAL __write_to_fortran_file_and_exit(
const char *msg, ...) {
175 vsprintf(__write_buf,msg,ap);
178 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,__write_buf,
179 strlen(__write_buf));
183 extern __extc__
void F77_OBJ_(egs_set_defaults,EGS_SET_DEFAULTS)();
184 extern __extc__
void F77_OBJ_(egs_init1,EGS_INIT1)();
186 F77_OBJ_(egs_set_defaults,EGS_SET_DEFAULTS)();
187 __egs_iovar(64,app_name.size(),app_name.c_str(),
the_egsio->user_code);
188 __egs_iovar(128,hen_house.size(),hen_house.c_str(),
the_egsio->hen_house);
189 __egs_iovar(128,egs_home.size(),egs_home.c_str(),
the_egsio->egs_home);
190 __egs_iovar(256,input_file.size(),input_file.c_str(),
the_egsio->input_file);
191 __egs_iovar(256,final_output_file.size(),final_output_file.c_str(),
193 __egs_iovar(256,pegs_file.size(),pegs_file.c_str(),
the_egsio->pegs_file);
201 F77_OBJ_(egs_init1,EGS_INIT1)();
245 class EGS_LOCAL EGS_TransportProperty {
248 vector<string> options;
249 vector<string> *str_v;
250 vector<EGS_Float> *f_v;
254 EGS_Float *float_input;
261 EGS_TransportProperty(
const char *Name, EGS_I32 *val) :
262 name(Name), type(0), int_input(val) {};
264 EGS_TransportProperty(
const char *Name, EGS_Float *val) :
265 name(Name), type(1), float_input(val) {};
267 EGS_TransportProperty(
const char *Name,
int L,
char *val) :
268 name(Name), type(3), len(L), char_input(val) {};
270 EGS_TransportProperty(
const char *Name,
int L,
int N,vector<string> *str):
271 name(Name), str_v(str), type(4), len(L), nitem(N) {};
273 EGS_TransportProperty(
const char *Name,
int N,vector<EGS_Float> *f):
274 name(Name), f_v(f), type(5), nitem(N) {};
276 void addOption(
const char *opt) {
277 options.push_back(opt);
280 void setOption(
const int &index,
const char *opt) {
281 options[index] = opt;
286 int err = input->
getInput(name,aux);
291 else if (type == 0) {
293 int err = input->
getInput(name,aux);
298 else if (type == 3) {
299 int err = input->
getInput(name,charinp);
301 int l = charinp.size();
306 for (j=0; j<l; j++) {
307 char_input[j] = charinp[j];
309 for (j=l; j<len; j++) {
314 charinp = string(char_input).substr(0,len);
317 else if (type == 4) {
318 int err = input->
getInput(name,*str_v);
320 vector<string> str = *str_v;
322 int number = str.size();
324 str.erase(str.begin()+nitem,str.end());
327 for (
int i=0; i<number; i++) {
328 if (str[i].size()>len) {
329 str[i] = str[i].substr(0,len);
335 else if (type == 5) {
336 int err = input->
getInput(name,*f_v);
338 vector<EGS_Float> fv = *f_v;
340 int number = fv.size();
342 fv.erase(fv.begin()+nitem,fv.end());
350 EGS_I32 iaux = input->
getInput(name,options,0,&is_ok);
354 egsWarning(
"Property %s: %d\n",name.c_str(),*int_input);
359 for (
int j=name.size(); j<nc; j++) {
365 else if (type == 1) {
368 else if (type == 3) {
369 egsInformation(
"%s\n",(
string(char_input).substr(0,len)).c_str());
371 else if (type == 5) {
372 for (vector<EGS_Float>::iterator it = f_v->begin() ; it != f_v->end(); ++it) {
383 return sizeof(EGS_Float);
385 else if (type == 3) {
388 else if (type == 4) {
391 else if (type == 5) {
395 return sizeof(EGS_I32);
403 EGS_Application(argc,argv), nmed(0), n_rng_buffer(0), final_job(false), io_flag(0) { }
433 egsWarning(
"In initCrossSections(): spin effects = %d\n",
437 transportp = input->
getInputItem(
"transport parameter");
442 extern "C" void F77_OBJ_(set_elastic_parameter,SET_ELASTIC_PARAMETER)();
446 egsWarning(
"initCrossSections(): no geometry?\n");
452 egsWarning(
"initCrossSections(): no media in this geometry?\n");
457 int *ind =
new int [
nmed];
458 for (j=0; j<
nmed; j++) {
460 int len = strlen(medname);
464 vector<string> ff_media, ff_names;
466 vector<EGS_Float> efield_v, bfield_v;
480 EGS_TransportProperty efield(
"Electric Field",3,&efield_v);
481 EGS_TransportProperty bfield(
"Magnetic Field",3,&bfield_v);
482 EGS_TransportProperty estepem(
"EM ESTEPE",&
the_emf->EMLMTIN);
488 EGS_TransportProperty skind(
"Skin depth for BCA",
490 EGS_TransportProperty pxsec(
"Photon cross sections",16,
the_media->
pxsec);
491 EGS_TransportProperty pxsec_out(
"Photon cross-sections output",&
the_egsio->xsec_out);
492 pxsec_out.addOption(
"Off");
493 pxsec_out.addOption(
"On");
498 bc.addOption(
"Simple");
499 bc.addOption(
"norej");
500 EGS_TransportProperty radc(
"Radiative Compton corrections",
502 radc.addOption(
"Off");
503 radc.addOption(
"On");
507 photonuc.addOption(
"Off");
508 photonuc.addOption(
"On");
511 rayl.addOption(
"Off");
512 rayl.addOption(
"On");
513 rayl.addOption(
"custom");
514 EGS_TransportProperty ff_med(
"ff media names",24,MXMED,&ff_media);
515 EGS_TransportProperty ff_files(
"ff file names",128,MXMED, &ff_names);
518 relax.addOption(
"Off");
519 relax.addOption(
"On");
520 relax.addOption(
"eadl");
521 relax.addOption(
"simple");
523 EGS_TransportProperty iphter(
"Photoelectron angular sampling",
525 iphter.addOption(
"Off");
526 iphter.addOption(
"On");
528 spin.addOption(
"Off");
529 spin.addOption(
"On");
531 trip.addOption(
"Off");
532 trip.addOption(
"On");
533 EGS_TransportProperty eii(
"Electron Impact Ionization",16,
the_media->
eiixsec);
535 brem.addOption(
"BH");
536 brem.addOption(
"NIST");
537 brem.addOption(
"NRC");
539 bang.addOption(
"Simple");
540 bang.addOption(
"KM");
542 pair.addOption(
"BH");
543 pair.addOption(
"NRC");
545 pang.addOption(
"Off");
546 pang.addOption(
"Simple");
547 pang.addOption(
"KM");
548 pang.addOption(
"Uniform");
549 pang.addOption(
"Blend");
550 EGS_TransportProperty tran(
"Electron-step algorithm",
552 tran.addOption(
"EGSnrc");
553 tran.addOption(
"PRESTA-I");
554 tran.addOption(
"PRESTA-II");
555 tran.addOption(
"default");
556 EGS_TransportProperty bca(
"Boundary crossing algorithm",
558 bca.addOption(
"Exact");
559 bca.addOption(
"PRESTA-I");
562 efield.getInput(transportp);
563 bfield.getInput(transportp);
564 estepem.getInput(transportp);
565 ecut.getInput(transportp);
566 pcut.getInput(transportp);
567 smax.getInput(transportp);
569 estep.getInput(transportp);
570 ximax.getInput(transportp);
571 skind.getInput(transportp);
572 pxsec.getInput(transportp);
573 pxsec_out.getInput(transportp);
574 cxsec.getInput(transportp);
575 photonucxsec.getInput(transportp);
576 photonuc.getInput(transportp);
577 bc.getInput(transportp);
578 radc.getInput(transportp);
579 rayl.getInput(transportp);
581 ff_med.getInput(transportp);
582 ff_files.getInput(transportp);
585 relax.getInput(transportp);
593 relax.setOption(1,
"eadl");
596 iphter.getInput(transportp);
597 spin.getInput(transportp);
598 trip.getInput(transportp);
599 eii.getInput(transportp);
601 brem.getInput(transportp);
602 bang.getInput(transportp);
603 pair.getInput(transportp);
604 pang.getInput(transportp);
605 tran.getInput(transportp);
609 bca.getInput(transportp);
611 if (egsEquivStr(
string(
"mcdf-xcom "),
616 else if (egsEquivStr(
string(
"mcdf-epdl "),
629 "\n Simplified atomic relaxation not allowed"
630 "\n with shellwise PE cross sections. Resetting"
631 "\n to detailed EADL atomic relaxation!!!\n\n");
634 relax.setOption(1,
"eadl");
642 F77_OBJ_(set_elastic_parameter,SET_ELASTIC_PARAMETER)();
674 for (
int imed=0; imed<
nmed; imed++) {
678 __init_interpolator(1,imed1,type,
i_ededx[imed]);
680 __init_interpolator(1,imed1,type,
i_pdedx[imed]);
682 __init_interpolator(1,imed1,type,
i_esig[imed]);
684 __init_interpolator(1,imed1,type,
i_psig[imed]);
686 __init_interpolator(1,imed1,type,
i_ebr1[imed]);
688 __init_interpolator(1,imed1,type,
i_pbr1[imed]);
690 __init_interpolator(1,imed1,type,
i_pbr2[imed]);
692 __init_interpolator(0,imed1,type,
i_gmfp[imed]);
694 __init_interpolator(0,imed1,type,
i_gbr1[imed]);
696 __init_interpolator(0,imed1,type,
i_gbr2[imed]);
698 __init_interpolator(0,imed1,type,
i_cohe[imed]);
700 __init_interpolator(0,imed1,type,
i_photonuc[imed]);
706 "================================\n\n");
707 EGS_Float Emax = source ? source->getEmax() : 0;
709 for (j=0; j<
nmed; j++) {
727 egsInformation(
"\n\nTransport parameter and cross section options:\n"
728 "==============================================\n");
733 egsEquivStr(
string(
"xcom "),
738 egsEquivStr(
string(
"epdl "),
759 photonucxsec.info(nc);
772 if (efield.size()==3) {
777 if (efield_v[0]*efield_v[0]+efield_v[1]*efield_v[1]+efield_v[2]*efield_v[2] > 0) {
782 if (bfield.size()==3) {
791 if (efield.size()==3 || bfield.size()==3) {
793 if (bfield_v[0]*bfield_v[0]+bfield_v[1]*bfield_v[1]+bfield_v[2]*bfield_v[2] > 0) {
797 egsInformation(
"==============================================\n\n");
814 const vector<string> &str_medium,
815 const vector<string> &str_file) {
818 for (i=0; i<str_medium.size(); i++) {
819 for (k=0; k<str_medium[i].size(); k++) {
823 for (i=0; i<str_file.size(); i++) {
824 for (k=0; k<str_file[i].size(); k++) {
840 string str_eii,off,on;
843 for (
int i=0; i<len; i++) {
853 if (str_eii == off) {
856 else if (str_eii == on) {
862 #define MAX_STEP 100000
863 EGS_Vector steps_x[MAX_STEP], steps_u[MAX_STEP];
864 int steps_ireg[MAX_STEP], steps_inew[MAX_STEP];
865 EGS_Float steps_ustepi[MAX_STEP], steps_ustepf[MAX_STEP];
953 egsGetRNGPointers(&np,&ip);
958 egsWarning(
"EGS_AdvancedApplication::outputData(): egsGetRNGPointers"
959 " returns a huge number? (%d)\n",np);
962 EGS_Float *array =
new EGS_Float [np];
963 egsGetRNGArray(array);
964 (*data_out) <<
" " << np <<
" " << ip << endl;
965 for (
int j=0; j<np; j++) {
966 (*data_out) << array[j] <<
" ";
969 double ch_steps, all_steps;
970 egsGetSteps(&ch_steps,&all_steps);
971 (*data_out) << ch_steps <<
" " << all_steps << endl;
982 (*data_in) >> np >> ip;
987 egsWarning(
"EGS_AdvancedApplication::readData(): got huge size "
988 "for the mortran random array? (%d)\n",np);
991 EGS_Float *array =
new EGS_Float [np];
992 for (
int j=0; j<np; j++) {
993 (*data_in) >> array[j];
998 egsSetRNGState(&ip,array);
1000 double ch_steps, all_steps;
1001 (*data_in) >> ch_steps >> all_steps;
1002 egsSetSteps(&ch_steps,&all_steps);
1003 return data_in->good() ? 0 : 13;
1017 if (np > 10000000) {
1018 egsWarning(
"EGS_AdvancedApplication::addState(): got huge size "
1019 "for the mortran random array? (%d)\n",np);
1022 EGS_Float *array =
new EGS_Float [np];
1023 for (
int j=0; j<np; j++) {
1029 egsSetRNGState(&ip,array);
1031 double ch_steps, all_steps;
1032 data >> ch_steps >> all_steps;
1033 double ch_steps_old, all_steps_old;
1034 egsGetSteps(&ch_steps_old,&all_steps_old);
1035 ch_steps += ch_steps_old;
1036 all_steps += all_steps_old;
1037 egsSetSteps(&ch_steps,&all_steps);
1038 return data.good() ? 0 : 13;
1043 double ch_steps = 0, all_steps = 0;
1044 egsSetSteps(&ch_steps,&all_steps);
1050 egsGetRNGPointers(&np,&ip);
1057 void EGS_AdvancedApplication::appInformation(
const char *msg) {
1066 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1071 void EGS_AdvancedApplication::appWarning(
const char *msg) {
1080 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1085 void EGS_AdvancedApplication::appFatal(
const char *msg) {
1092 F77_OBJ_(egs_write_string,EGS_WRITE_STRING)(&ounit,msg,strlen(msg));
1099 double &all_steps)
const {
1100 egsGetSteps(&ch_steps,&all_steps);
1134 void EGS_AdvancedApplication::enterNewRegion() {
1164 egsGetRNGPointers(&np,&ip);
1167 " new buffer size (%d) is not the same as previous size(%d) ?\n",
1189 EGS_Float EGS_AdvancedApplication::getMediumRho(
int ind) {
1197 EGS_Float EGS_AdvancedApplication::getEdep() {
1201 void EGS_AdvancedApplication::setEdep(EGS_Float edep) {
1205 EGS_Float EGS_AdvancedApplication::getEcut() {
1209 EGS_Float EGS_AdvancedApplication::getPcut() {
1213 EGS_Float EGS_AdvancedApplication::getRM() {
1217 void EGS_AdvancedApplication::setRadiativeSplitting(
const EGS_Float &nsplit) {
1224 EGS_Float EGS_AdvancedApplication::getTVSTEP() {
1228 EGS_Interpolator *EGS_AdvancedApplication::getDEDX(
const int &imed,
const int &iq) {
1240 void EGS_AdvancedApplication::setLatch(
const int &ip,
const int &latch) {
1244 void EGS_AdvancedApplication::incLatch(
const int &ip,
const int &increment) {
1248 int EGS_AdvancedApplication::getNp() {
1252 int EGS_AdvancedApplication::getNpOld() {
1259 void EGS_AdvancedApplication::setLatch(
int latch) {
1265 CHECK_GET_APPLICATION(app,
"egsHowfar()");
1268 if (ireg < 0 || the_stack->wt[np] == 0) {
1273 int inew = app->howfar(ireg,
1279 if (steps_n < MAX_STEP) {
1284 steps_ireg[steps_n] = ireg;
1285 steps_inew[steps_n] = inew;
1286 steps_ustepi[steps_n] = tsave;
1291 for (
int j=0; j<steps_n; j++)
1292 egsWarning(
"%d x=(%g,%g,%g) u=(%g,%g,%g) ireg=%d inew=%d ustepi=%g"
1293 " ustepf=%g\n",j,steps_x[j].x,steps_x[j].y,steps_x[j].z,
1294 steps_u[j].x,steps_u[j].y,steps_u[j].z,
1295 steps_ireg[j],steps_inew[j],steps_ustepi[j],
1303 app->enterNewRegion();
1312 CHECK_GET_APPLICATION(app,
"egsHownear()");
1320 CHECK_GET_APPLICATION(app,
"egsFillRandomArray()");
1321 app->fillRandomArray(*n,rarray);
1329 CHECK_GET_APPLICATION(app,
"egsAusgab()");
1340 *iarg = app->userScoring(*iarg);
1344 CHECK_GET_APPLICATION(app,
"egsStartParticle()");
1354 app->startNewParticle();
__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...
int io_flag
determines how to write info
EGS_I32 transport_algorithm
void getElectronSteps(double &ch_steps, double &all_steps) const
Get the number of condensed history and all electron steps.
EGS_Float rhor_new
Mass density ratio in the new region.
int i_rng_buffer
Pointer to the RNG buffer.
__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...
virtual void resetState()=0
Reset the state to a previously saved state.
EGS_I32 medium
Current medium.
int initCrossSections()
Initialize the run-time cross section data.
__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...
virtual int readData()
Read intermediate results.
EGS_Float E
particle energy in MeV
__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...
EGS_Float rhor
Mass density ratio.
virtual void describeSimulation()
Describe the simulation.
EGS_AusgabObject interface class header file.
virtual int combineResults()
Combine results from parallel runs.
virtual void describeUserCode() const
Describe the user code.
EGS_BaseSource class header file.
void setRayleighData(const vector< string > &str_medium, const vector< string > &str_file)
Custom Rayleigh data setup.
virtual void resetCounter()
Reset the application to a 'pristine' state.
EGS_Interpolator * i_pbr2
positron branching 2 interpolator
int outputData()
Output intermediate results.
virtual void saveRNGState()
virtual ~EGS_AdvancedApplication()
Destructor.
virtual void saveState()=0
Save the RNG state.
This file defines the C/C++ interface to the EGSnrc mortran back-end.
AusgabCall
Possible calls to the user scoring function ausgab().
int finishSimulation()
Finish the simulation.
virtual void outputResults()
Output the simulation results.
A class representing 3D vectors.
__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...
int readData()
Read intermediate results.
EGS_Interpolator * i_gbr2
photon branching 2 interpolator
bool hasRhoScaling() const
Does this geometry object have a mass density scaling feature?
EGS_I32 medium_new
Medium in the new region.
Global egspp functions header file.
EGS_AdvancedApplication class header 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...
virtual void appInformation(const char *)
Write an information message.
__extc__ void egsFinish(void)
Finish a simulation.
virtual void finishRun()
Finish a simulation.
virtual void appFatal(const char *)
Write a warning message and exit.
virtual void resetRNGState()
EGS_Interpolator * i_cohe
photon Rayleigh interpolator
__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...
bool final_job
Is this the final job of a parallel run ?
__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...
void setAusgabCall(AusgabCall call, bool on_or_off)
Turns on or off a call to the user scoring function ausgab()
__extc__ EGS_I32 egsAddMedium(const char *medname, EGS_I32 length)
Add a medium to the list of media.
void startNewParticle()
Start the transport of a new particle.
static void setActiveGeometryList(int list)
Set the currently active geometry list.
EGS_Interpolator * i_gmfp
photon mean-free-path interpolator
EGS_Interpolator * i_ededx
electron stopping power interpolator
virtual EGS_Float getBScaling(int ireg) const
Get the B field scaling factor in region ireg.
EGS_RandomGenerator * rndm
the random number generator
EGS_Float * rng_buffer
RNG buffer.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
int initEGSnrcBackEnd()
Initialize the EGSnrc mortran back-end.
static int nMedia()
Get the number of media registered so far by all geometries.
EGS_RandomGenerator class header file.
ostream * data_out
data output stream
EGS_Interpolator * i_gbr1
photon branching 1 interpolator
int shower()
Simulate a single shower.
__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...
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
#define egsFillRandomArray
A class for fast run-time interpolations.
EGS_RunControl * run
the run control object.
static string base_revision
Holds the CVS revision number of the egs_advanced_application.cpp file.
istream * data_in
data input stream
bool hasBScaling() const
Does this geometry object have a B field scaling feature?
void describeSimulation()
Describe the simulation.
int i_parallel
Job index in parallel runs.
Attempts to fix broken math header files.
int ir
particle region index
void setEIIData(EGS_I32 len)
Set EII flag and xsection file name.
virtual EGS_Float getRelativeRho(int ireg) const
Get the relative mass density in region ireg.
string app_name
The application name.
void initialize(int nbin, EGS_Float Xmin, EGS_Float Xmax, const EGS_Float *values)
Initialize the interpolator.
virtual int outputData()
Output intermediate results.
__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...
EGS_Interpolator * i_ebr1
electron branching interpolator
int app_index
the index of this application.
__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...
virtual int finishSimulation()
Analyze and output the results.
EGS_Float rm
Electron rest energy.
virtual EGS_I64 randomNumbersUsed() const
Returns the number of random numbers used.
EGS_Interpolator * i_psig
positron cross section interpolator
virtual int addState(istream &data)
Add data from a parallel job.
int latch
latch variable (useful as a flag on many occasions)
int n_rng_buffer
Size of the RNG buffer.
EGS_I64 randomNumbersUsed() const
Get the number of random numbers used.
EGS_Float skindepth_for_bca
EGS_SimpleContainer< EGS_AusgabObject * > a_objects_list
The ausgab objects.
virtual void appWarning(const char *)
Write a warning message.
static const char * getMediumName(int ind)
Get the name of medium with index ind.
void resetCounter()
Reset the application to a 'pristine' state.
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.
__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...
__extc__ void egsShower(void)
Transport the particles currently on the particle stack.
__extc__ void egsHatch(void)
Initialize cross section data from a PEGS4 data file.
EGS_Float wt
statistical weight
EGS_Interpolator * i_pdedx
positron stopping power interpolator
int helpInit(EGS_Input *, bool do_hatch)
Helper function used in initCrossSections() and describeSimulation().
EGS_Interpolator class header file.
EGS_BaseGeometry * geometry
the geometry of this simulation
void checkDeviceFull(FILE *)
Check if a device holding a given stream is full.
virtual int finishSimulation()
Finish the simulation.
int addState(istream &)
Add data from a parallel job.
Base class for advanced EGSnrc C++ applications.
EGS_RunControl and EGS_JCFControl class header file.
EGS_Interpolator * i_photonuc
photonuclear interpolator
EGS_AdvancedApplication(int argc, char **argv)
Constructor.
EGS_Interpolator * i_pbr1
positron branching 1 interpolator
EGS_Interpolator * i_esig
electron cross section interpolator
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.
string final_output_file
The final output file name.