47 regions(0), nrs(0), min_theta(0), max_theta(M_PI), min_phi(0), max_phi(2*M_PI),
48 max_mass_density(0.0) {
50 vector<EGS_Float> pos;
53 egsWarning(
"EGS_FanoSource: trying to construct the shape\n");
59 int err = input->
getInput(
"shape name",sname);
61 egsWarning(
"EGS_FanoSource: missing/wrong inline shape "
62 "definition and missing wrong 'shape name' input\n");
70 int err = input->
getInput(
"geometry",geom_name);
73 if (!geom)
egsFatal(
"EGS_FanoSource: no geometry named %s in input file!\n",
76 int errF = input->
getInput(
"max mass density", max_mass_density);
78 egsFatal(
"EGS_FanoSource: A Fano source requires a maximum density input.\n");
83 egsFatal(
"EGS_FanoSource: A Fano source requires a valid geometry name.\n");
87 err = input->
getInput(
"min theta", tmp_theta);
89 min_theta = tmp_theta/180.0*M_PI;
92 err = input->
getInput(
"max theta", tmp_theta);
94 max_theta = tmp_theta/180.0*M_PI;
97 err = input->
getInput(
"min phi", tmp_theta);
102 err = input->
getInput(
"max phi", tmp_theta);
104 max_phi = tmp_theta/180.0*M_PI;
107 buf_1 = cos(min_theta);
108 buf_2 = cos(max_theta);
113 void EGS_FanoSource::setUp() {
114 otype =
"EGS_FanoSource";
135 ostringstream str_density;
136 str_density << scientific << max_mass_density;
137 description +=
"\n maximum density = " + str_density.str() +
" g/cm3";
149 return createSourceTemplate<EGS_FanoSource>(input, f,
"fano source");
static EGS_BaseShape * createShape(EGS_Input *inp)
Create a shape from the information pointed to by inp.
static EGS_BaseShape * getShape(const string &Name)
Get a pointer to the shape named Name.
EGS_BaseSpectrum * s
The energy spectrum of this source.
static EGS_BaseGeometry * getGeometry(const string &Name)
Get a pointer to the geometry named Name.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
Attempts to fix broken math header files.
EGS_Float min_phi
avoid multi-calculating cos(min_theta) and cos(max_theta)
int q
The charge of this simple source.
const string & getObjectType() const
Get the object type.
EGS_BaseShape * shape
The shape from which particles are emitted.
int ref()
Increase the reference count to this geometry.
const string & getType() const
Get the spectrum type.
const string & getName() const
Get the name of this geometry.
string otype
The object type.
Base class for 'simple' particle sources.
EGS_FanoSource(int Q, EGS_BaseSpectrum *Spec, EGS_BaseShape *Shape, EGS_BaseGeometry *geometry, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
Base source class. All particle sources must be derived from this class.
string description
A short source description.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.