40 static bool EGS_POINT_SOURCE_LOCAL inputSet =
false;
44 vector<EGS_Float> pos;
45 int err = input->
getInput(
"position",pos);
46 if (!err && pos.size() == 3) {
50 egsWarning(
"EGS_PointSource: missing/wrong 'position' input\n");
57 otype =
"EGS_PointSource";
82 static void setInputs() {
85 setBaseSourceInputs();
87 srcBlockInput->getSingleInput(
"library")->setValues({
"egs_point_source"});
90 srcBlockInput->addSingleInput(
"position",
true,
"The position of the point source: 'x y z'");
93 EGS_POINT_SOURCE_EXPORT
string getExample() {
97 # Example of egs_point_source
99 library = egs_point_source
112 EGS_POINT_SOURCE_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
116 return srcBlockInput;
121 return createSourceTemplate<EGS_PointSource>(input,f,
"point source");
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.
string otype
The object type.
void setUp()
Sets up the source type and description.
EGS_PointSource(int Q, EGS_BaseSpectrum *Spec, const EGS_Vector &Xo, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
A class representing 3D vectors.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.