00001
00002
00003
00004
00005
00006 #include "Flux.h"
00007
00008 #include "flux/FluxSource.h"
00009 #include "flux/EventSource.h"
00010 #include "flux/FluxMgr.h"
00011 #include "flux/GPS.h"
00012
00013 Flux::Flux(std::string name)
00014 : m_time(0)
00015 {
00016 m_event = s_mgr->source(name);
00017 }
00018 Flux::~Flux()
00019 {
00020 delete m_flux;
00021 }
00022
00023 FluxMgr* Flux::s_mgr=0;
00024
00025 void Flux::mgr(FluxMgr* m){ s_mgr=m;}
00026
00027 std::string Flux::name() const
00028 {
00029 return m_flux->name();
00030 }
00031
00033 std::string Flux::title()const
00034 {
00035 return m_event->fullTitle();
00036 }
00037
00038
00039 void Flux::generate()
00040 {
00041 m_flux = m_event->event();
00042 m_time+= m_event->interval();
00043 }
00044
00045
00046 std::string Flux::particleName()const{
00047 return std::string(m_flux->spectrum()->particleName());
00048 }
00049
00050
00051 double Flux::energy()const
00052 {
00053 return m_flux->energy();
00054 }
00055
00056
00057 HepPoint3D Flux::launchPoint()const
00058 {
00059 return m_flux->launchPoint();
00060 }
00061
00062 double Flux::time()const
00063 {
00064 return m_time ;
00065 }
00066
00067 HepVector3D Flux::launchDir()const
00068 {
00069 return m_flux->launchDir();
00070 }
00071
00072
00073 double Flux::rate()const
00074 {
00075 return m_event->rate();
00076 }
00077
00079 void Flux::setTargetArea( double area)
00080 {
00081 m_event->totalArea(area);
00082 }
00083
00084 double Flux::targetArea()const
00085 {
00086 return m_event->totalArea();
00087 }
00088
00089
00091 std::string Flux::findSource()const
00092 {
00093 return m_event->findSource();
00094 }
00095
00097 int Flux::numSource()const
00098 {
00099 return m_event->numSource();
00100
00101 }
00102
00103
00104 void Flux::addFactory( const IFactory* factory ) {
00105 FactoryTable::instance()->addFactory( factory );
00106 }
00107
00108
00109 void Flux::addFactory(std::string name, const ISpectrumFactory* factory ) {
00110 SpectrumFactoryTable::instance()->addFactory(name,factory);
00111 }