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

CompositeDiffuse.h

Go to the documentation of this file.
00001 // CompositeDiffuse.h: interface for the CompositeDiffuse class.
00014 #include "FluxSvc/EventSource.h"
00015 #include "CompositeSource.h"
00016 #include <vector>
00017 
00018 #include "dom/DOM_Document.hpp"
00019 #include "dom/DOM_Element.hpp"
00020 #include "xml/Dom.h"
00021 #include "xml/IFile.h"
00022 #include "xml/XmlParser.h"
00023 #include <string>
00024 #include <typeinfo>
00025 
00026 //#include <cmath>
00027 //#include <algorithm>
00028 //#include <functional>
00029 #include <fstream>
00030 //#include <iostream>
00031 
00032 class FluxSource;
00033 
00035 class CompositeDiffuse: public CompositeSource { 
00036 public:
00037     
00038     typedef struct{
00039         double l;
00040         double b;
00041         double flux;
00042         double energyIndex;
00043     }PointSourceData;
00044 
00045     CompositeDiffuse(double totalFlux):
00046       m_totalFlux(totalFlux),m_unclaimedFlux(totalFlux)
00047       {
00048           fillTable();
00049           setFileFlux();
00050       }
00051       
00052       ~CompositeDiffuse(){}
00053       
00054       
00057       FluxSource* event (double time);
00058       
00060       void CompositeDiffuse::addSource (EventSource* aSource);
00061       
00063       void addNewSource();
00064       
00065       double remainingFluxInterval();
00066       
00067       //sets the total flux integrated over the input file, for later use
00068       void setFileFlux();
00069       
00071       void fillTable();
00072       
00073       //stolen from FluxMgr, this collects xml and dtd and prepares an input
00074       //file for parsing by the DOM parser.
00075       std::string writeXmlFile(const std::vector<std::string>& fileList);
00076 
00079       char* writeLogHistogram();
00080 
00082       void writeSourceCharacteristic(std::ostream& out);
00083       
00084 private:
00085     double m_totalFlux; // The total flux from the entire sky, particles/sec/m^2/steradian.
00086     double m_unclaimedFlux; // The amount of the flux "unaccounted for" by the known sources
00087     double getRandomFlux();
00088     //long double pofi(long double intensity);
00089     long double logNlogS(long double flux);
00090     std::vector<std::pair<double,double> > m_logNLogS; // inputted logN.logS graph, to be used for finding random fluxes.
00091     std::vector<PointSourceData> m_listOfDiffuseSources; //information on the sources which got added randomly.
00092     double m_minFlux; //the minimum flux to be considered in the spectrum
00093     double m_maxFlux; //the maximum flux to be considered.
00094     double m_totalIntegratedFlux; //integrated flux, using input file.
00095     std::string m_dtd; //the DTD document for the XML data to be read in.
00097     std::map<std::string, DOM_Element > m_sources;
00098 };

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