42 vector<EGS_Float> dir;
43 if (!input->
getInput(
"direction",dir)) {
44 if (dir.size() != 3)
egsWarning(
"EGS_ParallelBeam: you must input"
45 " 3 numbers in the 'direction' input\n"
46 " but I got %d => ignoring the input\n",dir.size());
51 EGS_Float norm =
uo.length();
53 egsWarning(
"EGS_ParallelBeam: the length of the direction"
54 " vector can not be zero => ignoring your input\n");
72 int err = input->
getInput(
"shape name",sname);
74 egsWarning(
"EGS_ParallelBeam: missing/wrong inline shape "
75 "definition and missing wrong 'shape name' input\n");
85 void EGS_ParallelBeam::setUp() {
86 otype =
"EGS_ParallelBeam";
91 description =
"Parallel beam from a shape of type ";
114 return createSourceTemplate<EGS_ParallelBeam>(input,f,
"parallel beam");
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_ParallelBeam(int Q, EGS_BaseSpectrum *Spec, EGS_BaseShape *Shape, const string &Name="", EGS_ObjectFactory *f=0)
Constructor.
EGS_BaseSpectrum * s
The energy spectrum of this source.
EGS_Vector uo
The direction of the particles.
int q
The charge of this simple source.
const string & getObjectType() const
Get the object type.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
const string & getType() const
Get the spectrum type.
string otype
The object type.
Base class for 'simple' particle sources.
EGS_BaseShape * shape
The shape.
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.