Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

EventSource.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/FluxSvc/FluxSvc/EventSource.h,v 1.9 2002/10/07 23:42:18 srobinsn Exp $
00002 
00003 
00004 #ifndef EventSource_h
00005 #define EventSource_h 1
00006 
00018 #include <string>
00019 
00020 #include "../src/GPS.h"
00021 
00022 
00023 class DOM_Element;
00024 class FluxSource;
00025 
00026 
00027 class EventSource
00028 {
00029 public:
00031     EventSource (double aFlux = 1.0, unsigned acode = 0);
00032     EventSource (const DOM_Element& xelem);
00033     virtual ~EventSource();
00034     
00036     virtual double interval (double) = 0;
00037     
00039     // virtual double  rate ( double solid_angle, double flux );        
00040     virtual double  rate (double time)const;
00041     virtual void    setRate ( double );
00042     
00044     virtual FluxSource* event (double) = 0;       
00045     
00047     virtual std::string fullTitle () const;
00048     virtual std::string displayTitle () const;
00049     
00051     virtual double      flux (double time) const;
00052     virtual void      setFlux (double value);
00053     
00055     void      disable (){m_enabled=false;}
00056     void      enable(){m_enabled=true;}
00057     bool enabled()const{return m_enabled;}
00058     
00060     virtual double      solidAngle () const;
00061     void      solidAngle ( double );
00062     
00064     const std::string& name () const;
00065     void name (const std::string& value);
00066     
00068     unsigned  code () const;
00069     virtual void  code ( unsigned );
00070     
00072     static double       totalArea ();
00073     static void totalArea ( double value );
00074     
00076     virtual Orbit*    makeOrbit () const;
00077     
00079     virtual int eventNumber()const{return -1;} 
00080     
00082     virtual std::string findSource()const{return "";}
00083     
00084     
00086     virtual int numSource()const{return -1;}
00087     
00088     virtual double time()const{return m_time;}
00089     virtual void setTime(double time){m_time=time;}
00090     
00091     
00092     //return how many sources are in the sourcelist (defaults to 1 if only a single FluxSource)
00093     virtual int howManySources(){return 1;}
00094 
00096     virtual void writeSourceCharacteristic(std::ostream& out){
00097         out << fullTitle() << std::endl;
00098         out<< "default message - no sources" << std::endl;
00099     }
00100     
00101     //double m_time;    // elapsed time, really only needed for EventSource
00102 private:
00103     double m_time;    // elapsed time, really only needed for EventSource
00104     
00105     bool m_enabled;           // toggle that it is enabled
00106     double m_flux;              // representative flux for this event source...
00107     double m_solid_angle;     // solid angle over which the rate is computed    (in steradians)
00108     std::string m_name;       // name of the event source (UI)
00109     unsigned  m_code;         // code id for this event source - for identification in the tuple.
00110     
00111     static unsigned int  s_id;    // id for new EventSources...
00112     static double s_total_area;   // total area for flux generation (in square meters)
00113 };
00114 
00115 // inline function declarations:
00116 
00117 inline  double EventSource::solidAngle () const { return m_solid_angle; }
00118 inline  void EventSource::solidAngle ( double value ) { m_solid_angle = value; }
00119 
00120 inline const std::string& EventSource::name () const    {   return m_name;  }
00121 inline void EventSource::name (const std::string& value)    { m_name = value;   }
00122 
00123 inline double    EventSource::totalArea () { return s_total_area; }
00124 inline void    EventSource::totalArea (double value) { s_total_area = value; }
00125 
00126 inline unsigned EventSource::code () const { return m_code; }
00127 inline void EventSource::code ( unsigned c ) { m_code = c; }
00128 
00129 #endif

Generated on Wed Oct 16 14:01:29 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001