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

Spectrum.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/FluxSvc/src/Spectrum.h,v 1.8 2002/07/25 05:18:59 srobinsn Exp $
00002 
00003 
00004 #ifndef GLAST_SPECTRUM_H
00005 #define GLAST_SPECTRUM_H
00006 
00018 #include <string>
00019 #include <utility>
00020 #include <vector>
00021 #include "FluxSvc/ISpectrum.h"
00022 //forward declaration
00023 class HepRandomEngine;
00024 
00025 
00028 class Spectrum : public ISpectrum {
00029 public:
00030     
00031     //    class  Direction : public std::pair<float,float> {
00032     //    public:
00033     //        double costh()const{return this.first;}
00034     //        double phi()const {return this.second;}
00035     //    };
00036     
00037     virtual float operator()(float /*r*/)const{return 0;};
00038     // this is all that these objects do. Must be virtual for
00039     // polymorphism
00040     // returns kinetic energy for random number r in [0,1). 
00041     // requried that it be monatonic
00042     // NB. Default is to return zero, an indicator that the actual Spectrum object
00043     //     implements a method that makes direct use of the random generator
00044     
00045     //virtual double calculate_rate (double old_rate) = 0;
00046     
00048     virtual const char * particleName()const=0;
00049     
00051     virtual double    flux (double time ) const;
00052     
00053     
00055     virtual double solidAngle()const;
00056     
00058     virtual std::string title()const=0;
00059     
00062     float fraction(float energy);
00063     
00064     virtual ~Spectrum();
00065     
00067     virtual double interval (double time);
00068     
00069     virtual std::pair<float,float> dir(float energy)const;
00070     
00072     virtual double energySrc(HepRandomEngine* engine, double time=0);
00073     
00078     virtual std::pair<double,double> dir(double energy, HepRandomEngine* engine);
00079     
00080     
00081     
00082     
00083 protected:
00084     Spectrum(const std::vector<float>& /*params*/){};
00085     Spectrum(/* double lat = 0, double lon = 0, double time=0*/) 
00086         /*: m_lat(0), m_lon(0), m_time(0)*/{}
00087         // all constructors protected to ensure an abstract class
00088         
00089         virtual void parseParamList(std::string input, std::vector<float>& output) const;
00090     
00091     double    m_lat, m_lon;   // latitude and longitudinal coordinates
00092     double m_currentInterval; // so we only find the interval for each particle once.
00093     
00094 };
00095 
00096 #endif    

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