#include <EventSource.h>
Inheritance diagram for EventSource::

Public Methods | |
| EventSource (double aFlux=1.0, unsigned acode=0) | |
| ctor/dtor. More... | |
| EventSource (const DOM_Element &xelem) | |
| virtual | ~EventSource () |
| virtual double | interval (double)=0 |
| a randomized interval to the next event - default is 1/rate(). More... | |
| virtual double | rate (double time) const |
| calculate the rate for a given flux/solid angle integral (NOTE: integral of solid angle). More... | |
| virtual void | setRate (double) |
| virtual FluxSource * | event (double)=0 |
| abstract method - create an event. More... | |
| virtual std::string | fullTitle () const |
| UI titles - used for tuple header (verbose) or window title (display). More... | |
| virtual std::string | displayTitle () const |
| virtual double | flux (double time) const |
| flux for this source in (p/(m^2*sr*sec)). More... | |
| virtual void | setFlux (double value) |
| void | disable () |
| disable/enable, test this particular source. More... | |
| void | enable () |
| bool | enabled () const |
| virtual double | solidAngle () const |
| integral of solid angle over which flux is incident. More... | |
| void | solidAngle (double) |
| const std::string & | name () const |
| name of this flux source - for UI. More... | |
| void | name (const std::string &value) |
| unsigned | code () const |
| code - for monte-carlo study. More... | |
| virtual void | code (unsigned) |
| virtual Orbit * | makeOrbit () const |
| makeOrbit - creates an orbit appropriate for this source. More... | |
| virtual int | eventNumber () const |
| virtual event number: should be filled in by subclass. More... | |
| virtual std::string | findSource () const |
| say which source created the current particle. More... | |
| virtual int | numSource () const |
| return a unique number correcponding to that spectrum. More... | |
| virtual double | time () const |
| virtual void | setTime (double time) |
| virtual int | howManySources () |
| virtual void | writeSourceCharacteristic (std::ostream &out) |
| write the characteristics of the current source distribution to a stream. More... | |
Static Public Methods | |
| double | totalArea () |
| area. More... | |
| void | totalArea (double value) |
Private Attributes | |
| double | m_time |
| bool | m_enabled |
| double | m_flux |
| double | m_solid_angle |
| std::string | m_name |
| unsigned | m_code |
Static Private Attributes | |
| unsigned int | s_id = 0 |
| double | s_total_area = 6. |
$Header $
Definition at line 27 of file EventSource.h.
|
||||||||||||
|
ctor/dtor.
Definition at line 16 of file EventSource.cxx. References code(), m_name, and s_id.
|
|
|
Definition at line 28 of file EventSource.cxx. References m_code, m_flux, m_name, m_solid_angle, and s_id.
00029 : m_enabled(true), m_flux(1.0), m_solid_angle(1.), m_code(0) 00030 { 00031 m_name = xml::Dom::getAttribute(xelem, "name"); 00032 m_flux = atof (xml::Dom::getAttribute(xelem, "flux").c_str()); 00033 00034 std::string code_str = xml::Dom::getAttribute(xelem, "code"); 00035 if (code_str != std::string("")) { 00036 m_code = atoi(code_str.c_str()); 00037 } 00038 else { 00039 m_code = ++s_id; 00040 } 00041 00042 // this is set by default to be overriden when the solid_angle 00043 // element is present... 00044 DOM_Element angles = 00045 xml::Dom::findFirstChildByName(xelem, "solid_angle"); 00046 00047 if (angles != DOM_Element()) { 00048 double mincos = atof(xml::Dom::getAttribute(angles, "mincos").c_str()); 00049 double maxcos = atof(xml::Dom::getAttribute(angles, "maxcos").c_str()); 00050 00051 m_solid_angle = (maxcos - mincos)*2*M_PI; 00052 } 00053 else if (xml::Dom::findFirstChildByName(xelem, "direction") != DOM_Element()) 00054 m_solid_angle = 1.; 00055 } |
|
|
Definition at line 58 of file EventSource.cxx.
00059 {}
|
|
|
Definition at line 127 of file EventSource.h. References m_code.
00127 { m_code = c; }
|
|
|
code - for monte-carlo study.
Definition at line 126 of file EventSource.h. References m_code. Referenced by EventSource().
00126 { return m_code; }
|
|
|
disable/enable, test this particular source.
Definition at line 55 of file EventSource.h. References m_enabled.
00055 {m_enabled=false;}
|
|
|
Reimplemented in FluxSource, and CompositeSource. Definition at line 96 of file EventSource.cxx. References m_name. Referenced by FluxSource::displayTitle(), and CompositeSource::displayTitle().
00096 { return m_name; }
|
|
|
Definition at line 56 of file EventSource.h. References m_enabled.
00056 {m_enabled=true;}
|
|
|
Definition at line 57 of file EventSource.h. References m_enabled. Referenced by FluxSource::flux().
00057 {return m_enabled;}
|
|
|
abstract method - create an event.
Reimplemented in FluxSource, CompositeDiffuse, and CompositeSource. Referenced by Flux::generate(), rootplot::rootplot(), and FluxMgr::test(). |
|
|
virtual event number: should be filled in by subclass.
Reimplemented in FluxSource. Definition at line 79 of file EventSource.h.
00079 {return -1;}
|
|
|
say which source created the current particle.
Reimplemented in CompositeSource. Definition at line 82 of file EventSource.h.
00082 {return "";}
|
|
|
flux for this source in (p/(m^2*sr*sec)).
Reimplemented in FluxSource, and CompositeSource. Definition at line 61 of file EventSource.cxx. References m_flux. Referenced by FluxSource::flux(), and rootplot::rootplot().
00062 {
00063 // Purpose and Method: This method returns the flux of the particular source.
00064 // Inputs - current time
00065 // Outputs - flux, in units of (particles/(m^2*sr*sec))
00066 return m_flux; // default if not overridden
00067 }
|
|
|
UI titles - used for tuple header (verbose) or window title (display).
Reimplemented in FluxSource, and CompositeSource. Definition at line 94 of file EventSource.cxx. Referenced by FluxMgr::test(), and writeSourceCharacteristic().
00095 { return std::string("EventSource"); }
|
|
|
Reimplemented in CompositeSource. Definition at line 93 of file EventSource.h. Referenced by FluxMgr::test().
00093 {return 1;}
|
|
|
a randomized interval to the next event - default is 1/rate().
Reimplemented in FluxSource, and CompositeSource. Referenced by Flux::generate(), and FluxMgr::test(). |
|
|
makeOrbit - creates an orbit appropriate for this source.
Definition at line 87 of file EventSource.cxx.
00088 {
00089 return new Orbit;
00090 }
|
|
|
Definition at line 121 of file EventSource.h. References m_name.
00121 { m_name = value; }
|
|
|
name of this flux source - for UI.
Definition at line 120 of file EventSource.h. References m_name. Referenced by CompositeDiffuse::fillTable(), and Flux::name().
00120 { return m_name; }
|
|
|
return a unique number correcponding to that spectrum.
Reimplemented in CompositeSource. Definition at line 86 of file EventSource.h. Referenced by FluxMgr::test().
00086 {return -1;}
|
|
|
calculate the rate for a given flux/solid angle integral (NOTE: integral of solid angle).
Reimplemented in CompositeSource. Definition at line 74 of file EventSource.cxx. Referenced by rootplot::rootplot(), setRate(), and FluxMgr::test().
00075 {
00076 // Purpose and Method: This method returns the rate of particles entering the detector.
00077 // Inputs - current time
00078 // Outputs - rate, in units of (particles/sec)
00079 return enabled()? (solidAngle()*flux(time)*s_total_area) :0;
00080 }
|
|
|
Definition at line 69 of file EventSource.cxx. References m_flux. Referenced by CompositeSource::addSource(), CompositeSource::rmvSource(), and setRate().
00069 {
00070 m_flux = value;
00071 }
|
|
|
Reimplemented in CompositeSource. Definition at line 82 of file EventSource.cxx. References m_solid_angle, rate(), s_total_area, and setFlux(). Referenced by CompositeSource::setRate().
00083 {
00084 setFlux( rate/(m_solid_angle*s_total_area) );
00085 }
|
|
|
Definition at line 89 of file EventSource.h. References m_time, and time(). Referenced by FluxSource::event(), CompositeSource::event(), and CompositeDiffuse::event().
|
|
|
Definition at line 118 of file EventSource.h. References m_solid_angle.
00118 { m_solid_angle = value; }
|
|
|
integral of solid angle over which flux is incident.
Reimplemented in FluxSource. Definition at line 117 of file EventSource.h. References m_solid_angle. Referenced by CompositeDiffuse::remainingFluxInterval(), FluxSource::setAcceptance(), and FluxSource::solidAngle().
00117 { return m_solid_angle; }
|
|
|
Definition at line 88 of file EventSource.h. References m_time. Referenced by CompositeSource::addSource(), FluxSource::calculateInterval(), FluxSource::computeLaunch(), FluxSource::event(), CompositeSource::event(), CompositeDiffuse::event(), FluxSource::flux(), CompositeSource::flux(), CompositeSource::printOn(), CompositeSource::rate(), CompositeSource::rmvSource(), CompositeSource::setRate(), setTime(), FluxSource::spectrum(), and CompositeDiffuse::~CompositeDiffuse().
00088 {return m_time;}
|
|
|
Definition at line 124 of file EventSource.h. References s_total_area.
00124 { s_total_area = value; }
|
|
|
area.
Definition at line 123 of file EventSource.h. References s_total_area. Referenced by CompositeSource::flux(), rootplot::rootplot(), FluxSource::setAcceptance(), Flux::setTargetArea(), and FluxMgr::test().
00123 { return s_total_area; }
|
|
|
write the characteristics of the current source distribution to a stream.
Reimplemented in CompositeDiffuse. Definition at line 96 of file EventSource.h. References fullTitle(). Referenced by Flux::writeSourceCharacteristic().
00096 {
00097 out << fullTitle() << std::endl;
00098 out<< "default message - no sources" << std::endl;
00099 }
|
|
|
Definition at line 109 of file EventSource.h. Referenced by code(), and EventSource(). |
|
|
Definition at line 105 of file EventSource.h. |
|
|
Definition at line 106 of file EventSource.h. Referenced by EventSource(), flux(), and setFlux(). |
|
|
Definition at line 108 of file EventSource.h. Referenced by displayTitle(), EventSource(), and name(). |
|
|
Definition at line 107 of file EventSource.h. Referenced by EventSource(), setRate(), and solidAngle(). |
|
|
Definition at line 103 of file EventSource.h. |
|
|
Definition at line 13 of file EventSource.cxx. Referenced by EventSource(). |
|
|
Definition at line 14 of file EventSource.cxx. |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001