00001
00002
00003 #ifndef FLUX_MGR_H
00004 #define FLUX_MGR_H
00005
00018 #include "CompositeSource.h"
00019
00020 #include "FluxSvc/FluxSource.h"
00021
00022 #include "dom/DOM_Document.hpp"
00023 #include "dom/DOM_Element.hpp"
00024 #include "xml/XmlParser.h"
00025 #include "FluxSvc/ISpectrumFactory.h"
00026 #include <map>
00027 #include <list>
00028 #include <string>
00029 #include "geometry/CoordTransform.h"
00030
00031 class FluxMgr
00032 {
00033
00034 public:
00035
00037 FluxMgr(const std::vector<std::string>& fileList, std::string dtd="");
00038
00039 ~FluxMgr();
00040
00042 EventSource* source(std::string name);
00043
00045 std::list<std::string> sourceList() const;
00046
00048 void setArea(double area);
00049
00051 void test(std::ostream& out, std::string source_name, int count);
00052
00054 void setOrientation(std::pair<double,double> ang);
00055
00057 std::pair<double,double> getOrientation();
00058
00060 std::vector<std::pair< std::string ,std::list<std::string> > > sourceOriginList() const;
00061
00063 void setGlastPosition(std::pair<double,double> pos);
00064
00065 void addFactory(std::string name, const ISpectrumFactory* factory );
00066
00068 void setExpansion (double p);
00069
00071 void pass ( double t);
00072
00074 GPStime time () const;
00075
00077 void synch ();
00078
00080 void sampleintvl ( double t );
00081
00083 std::pair<double,double> location();
00084
00085
00087 Rotation CELTransform(double time);
00088
00090 Rotation orientTransform(double time);
00091
00093 Rotation FluxMgr::transformGlastToGalactic(double time);
00094
00096 void setRockType(GPS::RockType rockType);
00097 void setRockType(int rockType);
00098 private:
00099
00102 DOM_Element getLibrarySource(const DOMString& id);
00103
00104
00105
00106 void defaultFile();
00107 void init(const std::vector<std::string>& fileList);
00108
00109 EventSource* getSourceFromXML(const DOM_Element& src);
00110
00111 DOM_Document m_library_doc;
00112
00113 DOM_Element s_library;
00114
00115 std::vector<DOM_Document> m_library_doclist;
00116
00117 std::vector<DOM_Element> s_librarylist;
00118
00120
00121 std::map<std::string, std::pair<DOM_Element,std::string> > m_sources;
00122
00124 std::string writeXmlFile( const std::vector<std::string>& fileList);
00125
00127 std::string m_dtd;
00128 };
00129 #endif