38 #ifndef EGS_PHSP_SOURCE_
39 #define EGS_PHSP_SOURCE_
51 #ifdef BUILD_PHSP_SOURCE_DLL
52 #define EGS_PHSP_SOURCE_EXPORT __declspec(dllexport)
54 #define EGS_PHSP_SOURCE_EXPORT __declspec(dllimport)
56 #define EGS_PHSP_SOURCE_LOCAL
60 #ifdef HAVE_VISIBILITY
61 #define EGS_PHSP_SOURCE_EXPORT __attribute__ ((visibility ("default")))
62 #define EGS_PHSP_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
64 #define EGS_PHSP_SOURCE_EXPORT
65 #define EGS_PHSP_SOURCE_LOCAL
147 int &q,
int &latch, EGS_Float &E, EGS_Float &wt,
149 void setSimulationChunk(EGS_I64 nstart, EGS_I64 nrun,
int npar,
int nchunk);
150 EGS_Float getEmax()
const {
153 EGS_Float getFluence()
const {
154 double aux = ((double) Nread)/((double) Nparticle);
157 bool storeState(ostream &data)
const {
186 bool setState(istream &data) {
204 the_file.seekg((Npos+1)*recl,ios::beg);
208 bool addState(istream &data) {
209 EGS_I64 tmp_Nread = Nread, tmp_count = count;
210 bool res = setState(data);
215 void resetCounter() {
220 bool isValid()
const {
224 void setCutout(EGS_Float xmin, EGS_Float xmax, EGS_Float ymin,
231 void setFilter(
int,
int,
int,
const int *);
265 unsigned long filter1, filter2;
266 EGS_Float Xmin, Xmax, Ymin, Ymax;
267 EGS_Float wmin, wmax;
269 void openFile(
const string &);
273 struct EGS_LOCAL BeamParticle {
275 float E, u, v, x, y, wt;
280 inline void readParticle();
281 inline bool rejectParticle()
const;
Base source class. All particle sources must be derived from this class.
A phase-space file source.
int Nrestart
Number of times the file was restarted.
int Nrecycle_g
Number of times to recycle a photon.
int Nrecycle
Number of times to recycle current particle.
EGS_Float Emin
Minimum energy (obtained from the phsp file)
EGS_I64 Nfirst
first record this source can use
string the_file_name
The phase-space file name.
EGS_I64 Nparticle
Number of particles in the file.
int Nrecycle_e
Number of times to recycle a charged particle.
EGS_Float Emax
Maximum energy (obtained from the phsp file)
int recl
The particle record length.
EGS_I64 Nlast
Last record this source can use.
EGS_I64 Npos
Next record to be read.
ifstream the_file
Phase space data stream.
int Nuse
Number of times current particle was used so far.
char * record
Memory to read a particle into.
EGS_I64 Nread
Number of particles read so far.
EGS_I64 Nphoton
Number of photons in the file.
bool mode2
true, if a MODE2 file
EGS_Float Pinc
Number of incident particles that created the file.
Base random number generator class. All random number generators should be derived from this class.
A class representing 3D vectors.
EGS_AliasTable class header file.
EGS_BaseSource class header file.
EGS_RandomGenerator class header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.
bool EGS_EXPORT egsStoreI64(ostream &data, EGS_I64 n)
Writes the 64 bit integer n to the output stream data and returns true on success,...
bool EGS_EXPORT egsGetI64(istream &data, EGS_I64 &n)
Reads a 64 bit integer from the stream data and assigns it to n. Returns true on success,...