00001
00002
00003
00004
00005
00006
00007
00013 #include "../../FluxMgr.h"
00014 #include "FluxSvc/EventSource.h"
00015
00016 #include "../../SpectrumFactoryTable.h"
00017 #include "rootEnergyHist.h"
00018 #include "rootAngleHist.h"
00019
00020 #include <fstream>
00021
00022 class rootplot
00023 {
00024 public:
00025
00026 const int NUM_BINS;
00027 const int LOOP;
00028
00029 const double TIME;
00030
00031 const double ENERGY_MIN;
00032 const double ENERGY_MAX;
00033
00034 void help() {
00035 std::cout <<
00036 " Simple test program for a particle source.\n"
00037 " Command line args are \n"
00038 " '-sum' sums up the histograms'\n"
00039 " '-bins <number of bins for histogram>'\n"
00040 " '-events <number of events to create>'\n"
00041 " '-min' or '-energy_min' sets minimum energy\n"
00042 " '-max' or '-energy_max' sets maximum energy\n"
00043 " '-list' lists the available spectra\n"
00044 " '-file <file name>' writes energy vs. flux to filename.txt\n"
00045 " '-trueflux' graphs using flux using per steradian\n"
00046 " '-flux' graphs the flux vs. E instead of E*flux vs E\n"
00047 " '-flux_min' manually set lower limit for graph\n"
00048 " '-flux_max' manually set upper limit for graph\n"
00049 " '-graph <log | semilogx | semilogy | linear>'\n"
00050 " '-longsrc <sourcename>' for long-term energy averaging\n"
00051 " '-time <time in seconds>' for the flux at time\n"
00052 " '-help' for this help"
00053 << std::endl;
00054 }
00055
00056 void listSources(const std::list<std::string>& source_list ) {
00057 std::cout << "List of available sources:" << std::endl;
00058 for( std::list<std::string>::const_iterator it = source_list.begin();
00059 it != source_list.end(); ++it) {
00060 std::cout << '\t'<< *it << std::endl;
00061 }
00062 }
00063
00064 void listSpectra() {
00065 std::cout << "List of loaded Spectrum objects: " << std::endl;
00066 std::list<std::string> spectra(SpectrumFactoryTable::instance()->spectrumList());
00067 for( std::list<std::string>::const_iterator it = spectra.begin();
00068 it != spectra.end(); ++it) {
00069 std::cout << '\t'<< *it << std::endl;
00070 }
00071 }
00072
00073 #define DLL_DECL_SPECTRUM(x) extern const ISpectrumFactory& x##Factory; x##Factory.addRef();
00074
00075 void flux_load() {
00076
00077
00078 DLL_DECL_SPECTRUM( CHIMESpectrum);
00079 DLL_DECL_SPECTRUM( AlbedoPSpectrum);
00080 DLL_DECL_SPECTRUM( HeSpectrum);
00081 DLL_DECL_SPECTRUM( GalElSpectrum);
00082
00083
00084 DLL_DECL_SPECTRUM( FILESpectrum);
00085
00086
00087 }
00088
00089
00091 rootplot(std::vector<char*> argv);
00092
00093 };