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

CHIMESpectrum.h

Go to the documentation of this file.
00001 // $Id: CHIMESpectrum.h,v 1.9 2001/10/18 03:30:16 srobinsn Exp $
00002 
00003 
00004 // File: CHIMESpectrum.h
00005 //
00009 //
00010 //  Patrick Nolan, Stanford University, 1998
00011 //
00038 #ifndef CHIME_SPECTRUM_H
00039 #define CHIME_SPECTRUM_H
00040 
00041 #include "flux/Spectrum.h"
00042 #include "facilities/Observer.h"
00043 #include <vector>
00044 #include <string>
00045 
00046 
00047 class CHIMESpectrum : public Spectrum
00048 {
00049   
00050  public:
00051     CHIMESpectrum(const std::string& params);
00052 
00053     virtual double calculate_rate(double old_rate);
00054 
00056     virtual double flux() const;
00057 
00059     virtual double solidAngle()const;
00060 
00061 
00065     float flux(float cut) const;
00066 
00069     virtual float flux(float lat, float lon) const;
00070     virtual float flux(std::pair<double, double> coords) const;
00071 
00072     virtual float operator() (float)const;
00073 
00074     float cutoff () const {return m_cutoff;};
00075 
00076     virtual void setPosition(double lat, double lon);
00077     virtual void setPosition(std::pair<double,double> coords);
00078 
00080     int askGPS();
00081     
00083     float findCutoff(float rflux) const;
00084 
00086     float findCutoff(float lat, float lon) const;
00087     float findCutoff(std::pair<double,double> coords) const;
00088 
00090     virtual std::pair<float,float> dir(float energy)const;
00091 
00092     virtual std::string title() const;
00093     virtual const char * particleName() const;
00094     inline  const char * nameOf() const {return "CHIMESpectrum";}
00095     //   use default destructor, copy constructor, and assignment op.
00096     
00098     void setParticleName(std::string name);
00099  
00100 
00101     typedef std::pair<int,float> Intrp;
00102 
00103  protected:
00104     void init(std::string params);
00105  private:
00107     class InterpVec : public std::vector<float> {
00108 
00109     public:
00110         InterpVec();  // constructor
00111         Intrp search(float x) const;
00112         float interpolate(Intrp) const;
00113     };
00114 
00115     
00116     InterpVec m_en; // values of energy in the table
00117     InterpVec m_fl; // values of integral flux in the table
00118     InterpVec m_fluxes; // integral flux, unmodulated by earth's field
00119     float m_expo;   // exponent of power-law spectrum above table (integral)
00120     double /*float*/ m_normfact; // fraction of sky not blocked by earth
00121     float m_tot;    // total flux above the current cutoff energy
00122     float m_upper;  // total flux in the power-law part of spectrum
00123     float m_etop;   // energy at which table transitions to power law
00124     float m_cutoff; // current cutoff energy
00125     float m_coscutoff;  // zenith angle of horizon
00126     float m_fluxTbl[73][13];  // table of total flux vs. latitude and longitude
00127     float m_flux;   // current flux (set when cutoff changes)
00128 
00129     float rad2() const; // square of distance (in km) from dipole center
00130     float exposure(float E) const;  // geomagnetic cutoff factor
00131     float cosomega(float E) const;  // Opening angle of Størmer cone
00132     static const float m_rearth;    // radius of earth in km
00133     static const float m_altitude;  // altitude of circular orbit
00134 
00135     std::string m_particle_name;
00136     ObserverAdapter< CHIMESpectrum > m_observer; //obsever tag
00137 
00138 };
00139 
00140 class CHIMEMax : public CHIMESpectrum
00141 {
00142  public:
00143      CHIMEMax();
00144      ~CHIMEMax(){}
00145 };
00146 
00147 class CHIMEMin : public CHIMESpectrum
00148 {
00149  public:
00150      CHIMEMin();
00151      ~CHIMEMin(){}
00152 };
00153 
00154 
00155 class CHIMEAvg : public CHIMESpectrum
00156 {
00157  public:
00158      CHIMEAvg();
00159      ~CHIMEAvg(){}
00160 };
00161 
00162 
00163 #endif // CHIME_SPECTRUM_H
00164 

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