00001 // $Header: /nfs/slac/g/glast/ground/cvs/flux/flux/CompositeSource.h,v 1.8 2001/10/18 03:30:16 srobinsn Exp $ 00002 00003 #ifndef CompositeSource_h 00004 #define CompositeSource_h 1 00005 00006 #include "flux/EventSource.h" 00007 #include <vector> 00008 00009 class FluxSource; 00010 00012 class CompositeSource : public EventSource { 00013 public: 00015 CompositeSource (double aRate = 1.0); 00016 virtual ~CompositeSource(); 00017 00018 00020 void addSource (EventSource* aSource); 00021 void rmvSource (EventSource* aSource); 00022 00025 virtual FluxSource* event (); 00026 00028 virtual double rate ()const; 00029 virtual void rate ( double ); 00030 00032 virtual double flux()const{return rate()/totalArea();} 00033 00035 virtual std::string fullTitle () const; 00036 00038 virtual std::string displayTitle () const; 00039 00041 void printOn(std::ostream& out)const; 00042 00044 std::string findSource()const; 00045 00047 int numSource()const; 00048 00049 //number of times we've iterated the front() pointer into sourcelist 00050 //to get the current particle - represents the source 00051 int m_numofiters; 00052 00054 std::vector< EventSource* >& sourceList (); 00055 const std::vector< EventSource* >& sourceList () const; 00056 void sourceList (const std::vector< EventSource* >& value); 00057 protected: 00058 virtual void setupXML (const DOM_Element&); 00059 00060 private: 00061 std::vector< EventSource* > m_sourceList; 00062 EventSource* m_recent; 00063 }; 00064 00065 inline std::vector< EventSource* >& CompositeSource::sourceList () 00066 { 00067 return m_sourceList; 00068 } 00069 00070 inline const std::vector< EventSource* >& CompositeSource::sourceList () const 00071 { 00072 return m_sourceList; 00073 } 00074 00075 inline void CompositeSource::sourceList (const std::vector< EventSource* >& value) 00076 { 00077 m_sourceList = value; 00078 } 00079 #endif
1.2.3 written by Dimitri van Heesch,
© 1997-2000