37 #ifndef EGS_ANGULAR_SPREAD_SOURCE_
38 #define EGS_ANGULAR_SPREAD_SOURCE_
48 #ifdef BUILD_ANGULAR_SPREAD_SOURCE_DLL
49 #define EGS_ANGULAR_SPREAD_SOURCE_EXPORT __declspec(dllexport)
51 #define EGS_ANGULAR_SPREAD_SOURCE_EXPORT __declspec(dllimport)
53 #define EGS_ANGULAR_SPREAD_SOURCE_LOCAL
57 #ifdef HAVE_VISIBILITY
58 #define EGS_ANGULAR_SPREAD_SOURCE_EXPORT __attribute__ ((visibility ("default")))
59 #define EGS_ANGULAR_SPREAD_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
61 #define EGS_ANGULAR_SPREAD_SOURCE_EXPORT
62 #define EGS_ANGULAR_SPREAD_SOURCE_LOCAL
130 int &q,
int &latch, EGS_Float &E, EGS_Float &wt,
132 EGS_I64 c = source->getNextParticle(rndm,q,latch,E,wt,x,u);
140 EGS_Float cphi, sphi;
142 EGS_Float sint = sqrt(1-cost*cost);
143 u.rotate(cost,sint,cphi,sphi);
149 return source->getEmax();
152 return source->getFluence();
155 return source->storeState(data);
158 return source->setState(data);
161 return source->addState(data_in);
164 source->resetCounter();
167 bool isValid()
const {
168 return (source != 0);
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 ...
Global egspp functions header file.
virtual bool addState(istream &data_in)
Add data from the stream data_in to the source state.
static void deleteObject(EGS_Object *o)
Delete an object.
virtual void resetCounter()
Reset the source state.
virtual bool storeState(ostream &data_out) const
Store the source state into the stream data_out.
A source that adds additional Gaussian angular spread to another source.
Base random number generator class. All random number generators should be derived from this class...
EGS_RandomGenerator class header file.
virtual bool setState(istream &data_in)
Set the source state based on data from the stream data_in.
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 EGS_I64 getNextParticle(EGS_RandomGenerator *rndm, int &q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u)=0
Sample the next source particle from the source probability distribution.
virtual EGS_Float getEmax() const =0
Return the maximum energy of this source.
Base source class. All particle sources must be derived from this class.