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);
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;
ifstream the_file
Phase space data stream.
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, false on failure.
EGS_AliasTable class header file.
EGS_BaseSource class header file.
EGS_Float Pinc
Number of incident particles that created the file.
int Nrestart
Number of times the file was restarted.
char * record
Memory to read a particle into.
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, false on failure.
A class representing 3D vectors.
bool mode2
true, if a MODE2 file
EGS_I64 Nread
Number of particles read so far.
Base random number generator class. All random number generators should be derived from this class...
EGS_RandomGenerator class header file.
string the_file_name
The phase-space file name.
int Nrecycle
Number of times to recycle current particle.
A phase-space file source.
int Nrecycle_g
Number of times to recycle a photon.
int Nrecycle_e
Number of times to recycle a charged particle.
int recl
The particle record length.
int Nuse
Number of times current particle was used so far.
Base source class. All particle sources must be derived from this class.