38 #ifndef EGS_POINT_SOURCE_
39 #define EGS_POINT_SOURCE_
48 #ifdef BUILD_POINT_SOURCE_DLL
49 #define EGS_POINT_SOURCE_EXPORT __declspec(dllexport)
51 #define EGS_POINT_SOURCE_EXPORT __declspec(dllimport)
53 #define EGS_POINT_SOURCE_LOCAL
57 #ifdef HAVE_VISIBILITY
58 #define EGS_POINT_SOURCE_EXPORT __attribute__ ((visibility ("default")))
59 #define EGS_POINT_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
61 #define EGS_POINT_SOURCE_EXPORT
62 #define EGS_POINT_SOURCE_LOCAL
139 EGS_Float sinz = 1-u.
z*u.
z;
142 EGS_Float cphi, sphi;
167 return (valid && s != 0);
virtual void getPositionDirection(EGS_RandomGenerator *rndm, EGS_Vector &x, EGS_Vector &u, EGS_Float &wt)=0
Sample a particle position and direction.
EGS_PointSource(int Q, EGS_BaseSpectrum *Spec, const EGS_Vector &Xo, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
EGS_BaseSource class header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.
A class representing 3D vectors.
void getAzimuth(EGS_Float &cphi, EGS_Float &sphi)
Sets cphi and sphi to the cosine and sine of a random angle uniformely distributed between 0 and ...
EGS_I64 count
Number of statistically independent particles delivered so far.
Base random number generator class. All random number generators should be derived from this class...
EGS_RandomGenerator class header file.
virtual EGS_Float getFluence() const =0
Return the fluence this source has emitted so far.
EGS_Float getUniform()
Returns a random number uniformly distributed between zero (inclusive) and 1 (exclusive).
virtual bool storeFluenceState(ostream &data_out) const
Store the fluence state of this source to the data stream data_out.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
Base class for energy spectra. All energy spectra in the EGSnrc C++ class library are derived from th...
Base class for 'simple' particle sources.
virtual bool isValid() const
Is this a valid source?
virtual bool setFluenceState(istream &data)
Set the data related to the sampling of positions and directions to a state contained in the stream d...