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

HeSpectrum.h

Go to the documentation of this file.
00001 // $Id: HeSpectrum.h,v 1.8 2001/10/20 07:20:34 srobinsn Exp $
00002 
00003 // File: HeSpectrum.h
00004 //
00009 //
00035 #ifndef HE_SPECTRUM_H
00036 #define HE_SPECTRUM_H
00037 
00038 #include "flux/Spectrum.h"
00039 #include "facilities/Observer.h"
00040 #include <vector>
00041 #include <string>
00042 
00043 
00044 class HeSpectrum : public Spectrum
00045 {
00046   
00047  public:
00048     HeSpectrum(const std::string& params);
00049 
00050     virtual double calculate_rate(double old_rate);
00051 
00053     virtual double flux() const;
00054 
00056     virtual double solidAngle()const;
00057  
00061     float flux(float cut) const;
00062 
00063 
00064     virtual float operator() (float)const;
00065 
00066     float cutoff () const {return m_cutoff;};
00067 
00068     virtual void setPosition(double lat, double lon);
00069 
00071     int askGPS();
00072     
00074     float findCutoff(float rflux) const;
00075 
00077     float findCutoff(float lat, float lon) const;
00078   
00080     virtual std::pair<float,float> dir(float energy)const;
00081 
00082     virtual std::string title() const;
00083     virtual const char * particleName() const;
00084     inline  const char * nameOf() const {return "HeSpectrum";}
00085     //   use default destructor, copy constructor, and assignment op.
00086     
00088     void setParticleName(std::string name);
00089 
00090     typedef std::pair<int,float> Intrp;
00091  private:
00092     double HeSpectrum::flux(double lat, double lon) const;
00093 
00095     class InterpVec : public std::vector<float> {
00096 
00097     public:
00098         InterpVec();  // constructor
00099         Intrp search(float x) const;
00100         float interpolate(Intrp) const;
00101     };
00102 
00103     void init(float lat, float lon);
00104     InterpVec m_en; // values of energy in the table
00105     InterpVec m_fl; // values of integral flux in the table
00106     InterpVec m_fluxes; // integral flux, unmodulated by earth's field
00107     float m_expo;   // exponent of power-law spectrum above table (integral)
00108     float m_normfact; // fraction of sky not blocked by earth
00109     float m_tot;    // total flux above the current cutoff energy
00110     float m_upper;  // total flux in the power-law part of spectrum
00111     float m_etop;   // energy at which table transitions to power law
00112     float m_cutoff; // current cutoff energy
00113     float m_coscutoff;  // zenith angle of horizon
00114     float m_fluxTbl[73][13];  // table of total flux vs. latitude and longitude
00115     float m_flux;   // current flux (set when cutoff changes)
00116 
00117     float rad2() const; // square of distance (in km) from dipole center
00118     float exposure(float E) const;  // geomagnetic cutoff factor
00119     float cosomega(float E) const;  // Opening angle of Størmer cone
00120     static const float m_rearth;    // radius of earth in km
00121     static const float m_altitude;  // altitude of circular orbit
00122 
00123     std::string m_particle_name;
00124     ObserverAdapter< HeSpectrum > m_observer; //obsever tag
00125 
00126 };
00127 
00128 #endif // HE_SPECTRUM_H
00129 

Generated at Wed Nov 21 12:20:34 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000