43 source_shape(0), target_shape(0), ctry(0), dist(1) {
51 int err = input->
getInput(
"source shape name",sname);
53 egsWarning(
"EGS_CollimatedSource: missing/wrong inline source "
54 "shape definition and missing/wrong 'source shape name' input\n");
58 egsWarning(
"EGS_CollimatedSource: a shape named %s"
59 " does not exist\n",sname.c_str());
69 int err = input->
getInput(
"target shape name",sname);
71 egsWarning(
"EGS_CollimatedSource: missing/wrong inline target"
72 "shape definition and missing/wrong 'target shape name' input\n");
76 egsWarning(
"EGS_CollimatedSource: a shape named %s"
77 " does not exist\n",sname.c_str());
82 egsWarning(
"EGS_CollimatedSource: the target shape %s, which is"
83 " of type %s, does not support the getPointSourceDirection()"
88 int errd = input->
getInput(
"distance",auxd);
95 void EGS_CollimatedSource::setUp() {
96 otype =
"EGS_CollimatedSource";
101 description =
"Collimated source from a shape of type ";
127 createSourceTemplate<EGS_CollimatedSource>(input,f,
"collimated source");
static EGS_BaseShape * getShape(const string &Name)
Get a pointer to the shape named Name.
static EGS_BaseShape * createShape(EGS_Input *inp)
Create a shape from the information pointed to by inp.
virtual bool supportsDirectionMethod() const
Base class for 'simple' particle sources.
int q
The charge of this simple source.
EGS_BaseSpectrum * s
The energy spectrum of this source.
Base source class. All particle sources must be derived from this class.
string description
A short source description.
const string & getType() const
Get the spectrum type.
EGS_Float dist
source-target shape min. distance
EGS_CollimatedSource(int Q, EGS_BaseSpectrum *Spec, EGS_BaseShape *sshape, EGS_BaseShape *tshape, const string &Name="", EGS_ObjectFactory *f=0)
EGS_BaseShape * source_shape
the source shape
EGS_BaseShape * target_shape
the target shape
string otype
The object type.
const string & getObjectType() const
Get the object type.
const string & getObjectName() const
Get the object name.
A collimated isotropic source.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.