46 int err = input->
getInput(
"charge",Q);
51 if (!
s)
egsWarning(
"EGS_BaseSimpleSource::EGS_BaseSimpleSource:\n"
52 " no spectrum was defined\n");
56 source_creator(
string(
"egs++/dso/")+CONFIG_NAME,
"EGS_BaseSource");
60 EGS_Object *o = source_creator.createObjects(i,
"source definition",
61 "source",
"simulation source",
"createSource",
true);
66 EGS_Object *o = source_creator.getObject(Name);
74 egsWarning(
"EGS_BaseSource::getSource(): dynamic cast failed?\n"
75 " Object named %s is of type %s. Trying simple cast\n",
83 source_creator.addKnownObject(o);
87 source_creator.addKnownTypeId(tid);
static EGS_BaseSource * createSource(EGS_Input *)
Create sources from the information pointed to by input.
EGS_BaseSimpleSource(int Q, EGS_BaseSpectrum *Spec, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
EGS_BaseSource class header file.
static void addKnownSource(EGS_BaseSource *o)
Add a known source object to the source factory.
static EGS_BaseSpectrum * createSpectrum(EGS_Input *inp)
Create and return a pointer to a spectrum object from the information pointed to by inp...
EGS_BaseSpectrum * s
The energy spectrum of this source.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
static EGS_BaseSource * getSource(const string &Name)
Get a pointer to the source named Name.
int q
The charge of this simple source.
const string & getObjectType() const
Get the object type.
static void addKnownTypeId(const char *name)
Add a known source object typeid to the source factory.
Base source class. All particle sources must be derived from this class.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.