38 #ifndef EGS_FANO_SOURCE_
39 #define EGS_FANO_SOURCE_
51 #ifdef BUILD_FANO_SOURCE_DLL
52 #define EGS_FANO_SOURCE_EXPORT __declspec(dllexport)
54 #define EGS_FANO_SOURCE_EXPORT __declspec(dllimport)
56 #define EGS_FANO_SOURCE_LOCAL
60 #ifdef HAVE_VISIBILITY
61 #define EGS_FANO_SOURCE_EXPORT __attribute__ ((visibility ("default")))
62 #define EGS_FANO_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
64 #define EGS_FANO_SOURCE_EXPORT
65 #define EGS_FANO_SOURCE_LOCAL
109 min_theta(85.), max_theta(95.), min_phi(0), max_phi(2*M_PI),
111 geom(geometry), regions(0), nrs(0) {
124 if (!geom->deref()) {
128 if (nrs > 0 && regions) {
135 bool ok =
true, okfano =
false;
139 x = shape->getRandomPoint(rndm);
140 ok = geom->isInside(x);
148 if (rndm->
getUniform()*max_mass_density > geom->getMediumRho(geom->medium(geom->isWhere(x)))) {
169 EGS_Float sinz = 1-u.
z*u.
z;
172 EGS_Float cphi, sphi;
173 EGS_Float phi = min_phi + (max_phi - min_phi)*rndm->
getUniform();
219 return (s != 0 && shape != 0);
230 EGS_Float min_theta, max_theta;
231 EGS_Float buf_1, buf_2;
234 EGS_Float max_mass_density;
virtual void getPositionDirection(EGS_RandomGenerator *rndm, EGS_Vector &x, EGS_Vector &u, EGS_Float &wt)=0
Sample a particle position and direction.
EGS_BaseSource class header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.
A class representing 3D vectors.
static void deleteObject(EGS_Object *o)
Delete an object.
Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape.
EGS_I64 count
Number of statistically independent particles delivered so far.
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
Base random number generator class. All random number generators should be derived from this class...
EGS_RandomGenerator class header file.
EGS_BaseShape and shape classes header file.
Attempts to fix broken math header files.
virtual EGS_Float getFluence() const =0
Return the fluence this source has emitted so far.
EGS_Float min_phi
avoid multi-calculating cos(min_theta) and cos(max_theta)
EGS_Float getUniform()
Returns a random number uniformly distributed between zero (inclusive) and 1 (exclusive).
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...
EGS_BaseGeometry class header file.
Base class for 'simple' particle sources.
virtual bool isValid() const
Is this a valid source?
EGS_FanoSource(int Q, EGS_BaseSpectrum *Spec, EGS_BaseShape *Shape, EGS_BaseGeometry *geometry, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.