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

HeSpectrum.h

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

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