#include <GalElSpectrum.h>
Inheritance diagram for GalElSpectrum::

Public Methods | |
| GalElSpectrum (const std::string ¶ms) | |
| ctor. More... | |
| virtual | ~GalElSpectrum () |
| virtual double | calculate_rate (double old_rate) |
| virtual double | flux (double) const |
| calculate flux for the current cutoff. More... | |
| virtual double | solidAngle () const |
| calcualte effective solid angle for the given energy. More... | |
| float | flux (float cut) const |
| Total flux in electrons / m^2 sec ster. More... | |
| virtual float | flux (float lat, float lon) const |
| virtual float | flux (std::pair< double, double > coords) const |
| virtual float | operator() (float) const |
| float | cutoff () const |
| virtual void | setPosition (float lat, float lon) |
| virtual void | setPosition (std::pair< double, double > coords) |
| int | askGPS () |
| this one asks the GPS for position. More... | |
| float | findCutoff (float rflux) const |
| determine the cutoff value which will produce the desired flux. More... | |
| float | findCutoff (float lat, float lon) const |
| determine the cutoff value at a geographical location. More... | |
| float | findCutoff (std::pair< double, double > coords) const |
| virtual std::pair< float, float > | dir (float energy) const |
| return solid angle pair (costh, phi) for the given energy. More... | |
| virtual std::string | title () const |
| return a title describing the spectrum. More... | |
| virtual const char * | particleName () const |
| subclasses need to specify correct particle type. More... | |
| const char * | nameOf () const |
| void | setParticleName (std::string name) |
| set the particle name. (default is "p"). More... | |
Private Methods | |
| void | init (float lat, float lon) |
Private Attributes | |
| CHIMESpectrum | m_pspec |
| float | m_expo |
| float | m_norm |
| float | m_normfact |
| float | m_cutoff |
| float | m_coscutoff |
| float | m_flux |
| std::string | m_particle_name |
| ObserverAdapter< GalElSpectrum > | m_observer |
Static Private Attributes | |
| const float | m_rearth = 6371.f |
| const float | m_altitude = 600.f |
As with CHIMESpectrum, the flux normalization is handled in a screwy way. We should come up with a better way to handle this. The value returned is in electrons/(m^2 sec ster), as if it was isotropic. This value is obtained by taking the observed isotropic flux and multiplying by a correction factor for the fraction of the sky blocked by the earth. Thus the total integrated flux in electrons/(m^2 sec) can be obtained by multiplying by 4*pi.
Definition at line 43 of file GalElSpectrum.h.
|
|
ctor.
Definition at line 23 of file GalElSpectrum.cxx. References init(), and Spectrum::parseParamList().
00023 :m_pspec(paramstring) { 00024 std::vector<float> params; 00025 00026 parseParamList(paramstring,params); 00027 00028 float lat = params.size()>0? params[0] : 0; 00029 float lon = params.size()>1? params[1] : 0; 00030 init(lat, lon); 00031 } |
|
|
Definition at line 34 of file GalElSpectrum.cxx.
00034 {};
|
|
|
this one asks the GPS for position.
Definition at line 77 of file GalElSpectrum.cxx. References GPS::instance(), and setPosition(). Referenced by init().
00077 {
00078 setPosition(GPS::instance()->lat(), GPS::instance()->lon());
00079 return 0;
00080 }
|
|
|
Definition at line 36 of file GalElSpectrum.cxx. References flux(), and GPS::instance().
00036 {
00037 return flux(GPS::instance()->lat(), GPS::instance()->lon());
00038 }
|
|
|
Definition at line 67 of file GalElSpectrum.h. References m_cutoff.
00067 {return m_cutoff;};
|
|
|
return solid angle pair (costh, phi) for the given energy.
Reimplemented from Spectrum. Definition at line 95 of file GalElSpectrum.cxx. References m_coscutoff.
00095 {
00096 float earthazi = 2.*M_PI* HepRandom::getTheGenerator()->flat();
00097 float coszenith = m_coscutoff + (1.-m_coscutoff)*
00098 HepRandom::getTheGenerator()->flat();
00099 return std::make_pair<float,float>(coszenith, earthazi);
00100 }
|
|
|
Definition at line 91 of file GalElSpectrum.cxx. References findCutoff().
00091 {
00092 return findCutoff(coords.first, coords.second);
00093 }
|
|
||||||||||||
|
determine the cutoff value at a geographical location.
Definition at line 86 of file GalElSpectrum.cxx. References CHIMESpectrum::findCutoff(), and m_pspec.
00086 {
00087 float ProtonCut = m_pspec.findCutoff(lat,lon);
00088 return sqrt(ProtonCut*(ProtonCut+2.*0.938));
00089 }
|
|
|
determine the cutoff value which will produce the desired flux.
Definition at line 82 of file GalElSpectrum.cxx. References m_expo, and m_norm. Referenced by findCutoff(), flux(), and setPosition().
|
|
|
Definition at line 57 of file GalElSpectrum.cxx. References flux().
00057 {
00058 return flux(coords.first, coords.second);
00059 }
|
|
||||||||||||
|
Definition at line 52 of file GalElSpectrum.cxx. References findCutoff(), and flux().
00052 {
00053 float Ecut = findCutoff(lat,lon);
00054 return flux(Ecut);
00055 }
|
|
|
Total flux in electrons / m^2 sec ster.
Definition at line 48 of file GalElSpectrum.cxx. References m_expo, m_norm, and m_normfact.
00048 {
00049 return -m_normfact * (m_norm / m_expo) * pow(cut, m_expo);
00050 }
|
|
|
calculate flux for the current cutoff.
Reimplemented from Spectrum. Definition at line 40 of file GalElSpectrum.cxx. References m_cutoff, m_expo, m_norm, and m_normfact. Referenced by calculate_rate(), flux(), and setPosition().
00040 {
00041 return -m_normfact * (m_norm / m_expo) * pow(m_cutoff, m_expo);
00042 }
|
|
||||||||||||
|
Definition at line 114 of file GalElSpectrum.cxx. References askGPS(), GPS::instance(), m_altitude, m_coscutoff, m_expo, m_norm, m_normfact, m_observer, m_particle_name, m_rearth, GPS::notification(), and setPosition(). Referenced by GalElSpectrum().
00114 {
00115 m_normfact = .5*(1.+sqrt(m_altitude*(m_altitude+2.*m_rearth)) /
00116 (m_rearth+m_altitude));
00117 m_expo = static_cast<float>(-3.086 + 1.);
00118 m_norm = 227.f;
00119 setPosition(lat, lon);
00120 m_coscutoff = -sqrt(m_altitude*m_altitude+2.*m_altitude*m_rearth)
00121 / (m_altitude+m_rearth);
00122 m_particle_name = "e-";
00123 m_observer.setAdapter( new ActionAdapter<GalElSpectrum>(this,
00124 &GalElSpectrum::askGPS) );
00125 GPS::instance()->notification().attach( &m_observer );
00126 }
|
|
|
Definition at line 88 of file GalElSpectrum.h.
00088 {return "GalElSpectrum";}
|
|
|
Reimplemented from Spectrum. Definition at line 61 of file GalElSpectrum.cxx. References m_cutoff, and m_expo.
|
|
|
subclasses need to specify correct particle type.
Reimplemented from Spectrum. Definition at line 106 of file GalElSpectrum.cxx. References m_particle_name.
00106 {
00107 return m_particle_name.c_str();
00108 }
|
|
|
set the particle name. (default is "p").
Definition at line 110 of file GalElSpectrum.cxx. References m_particle_name.
00110 {
00111 m_particle_name = name;
00112 }
|
|
|
Definition at line 73 of file GalElSpectrum.cxx. References setPosition().
00073 {
00074 GalElSpectrum::setPosition(coords.first, coords.second);
00075 }
|
|
||||||||||||
|
Definition at line 65 of file GalElSpectrum.cxx. References findCutoff(), flux(), m_cutoff, m_flux, Spectrum::m_lat, Spectrum::m_lon, m_pspec, and CHIMESpectrum::setPosition(). Referenced by askGPS(), init(), and setPosition().
00065 {
00066 m_pspec.setPosition(lat, lon);
00067 m_lat = lat;
00068 m_lon = lon;
00069 m_cutoff = findCutoff(lat,lon);
00070 m_flux = flux(m_cutoff);
00071 }
|
|
|
calcualte effective solid angle for the given energy.
Reimplemented from Spectrum. Definition at line 44 of file GalElSpectrum.cxx.
00044 {
00045 return 4. * M_PI;
00046 }
|
|
|
return a title describing the spectrum.
Reimplemented from Spectrum. Definition at line 102 of file GalElSpectrum.cxx.
00102 {
00103 return "GalElSpectrum";
00104 }
|
|
|
Definition at line 21 of file GalElSpectrum.cxx. Referenced by init(). |
|
|
Definition at line 101 of file GalElSpectrum.h. |
|
|
Definition at line 100 of file GalElSpectrum.h. Referenced by cutoff(), flux(), operator()(), and setPosition(). |
|
|
Definition at line 97 of file GalElSpectrum.h. Referenced by findCutoff(), flux(), init(), and operator()(). |
|
|
Definition at line 102 of file GalElSpectrum.h. Referenced by setPosition(). |
|
|
Definition at line 98 of file GalElSpectrum.h. Referenced by findCutoff(), flux(), and init(). |
|
|
Definition at line 99 of file GalElSpectrum.h. |
|
|
Definition at line 108 of file GalElSpectrum.h. Referenced by init(). |
|
|
Definition at line 107 of file GalElSpectrum.h. Referenced by init(), particleName(), and setParticleName(). |
|
|
Definition at line 95 of file GalElSpectrum.h. Referenced by findCutoff(), and setPosition(). |
|
|
Definition at line 20 of file GalElSpectrum.cxx. Referenced by init(). |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001