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

GalElSpectrum Class Reference

A quick and dirty implementation of the high-energy (galactic) cosmic ray spectrum. More...

#include <GalElSpectrum.h>

Inheritance diagram for GalElSpectrum:

Spectrum List of all members.

Public Methods

 GalElSpectrum (const std::string& params)
 ctor. More...

virtual ~GalElSpectrum ()
virtual double calculate_rate (double old_rate)
virtual double flux () 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

Detailed Description

A quick and dirty implementation of the high-energy (galactic) cosmic ray spectrum.

The spectrum is the power law found in Barwick et al., ApJ 498, 779 (1998). The low-energy rollover is ignored. Also ignored are the east-west effect and the gradual nature of the geomagnetic cutoff. The power law is cut off sharply at the cutoff energy and directions are isotropic above the horizon. The cutoff energy is obtained by querying a CHIMESpectrum object and adjusting for the smaller mass of the electron. (Actually the electron mass is assumed to be zero.)

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 38 of file GalElSpectrum.h.


Constructor & Destructor Documentation

GalElSpectrum::GalElSpectrum ( const std::string & paramstring )
 

ctor.

Definition at line 23 of file GalElSpectrum.cxx.

GalElSpectrum::~GalElSpectrum ( ) [virtual]
 

Definition at line 34 of file GalElSpectrum.cxx.


Member Function Documentation

int GalElSpectrum::askGPS ( )
 

this one asks the GPS for position.

Definition at line 77 of file GalElSpectrum.cxx.

double GalElSpectrum::calculate_rate ( double old_rate ) [virtual]
 

Definition at line 36 of file GalElSpectrum.cxx.

float GalElSpectrum::cutoff ( ) const [inline]
 

Definition at line 62 of file GalElSpectrum.h.

std::pair< float,float > GalElSpectrum::dir ( float energy ) const [virtual]
 

return solid angle pair (costh, phi) for the given energy.

Reimplemented from Spectrum.

Definition at line 95 of file GalElSpectrum.cxx.

float GalElSpectrum::findCutoff ( std::pair< double,double > coords ) const
 

Definition at line 91 of file GalElSpectrum.cxx.

float GalElSpectrum::findCutoff ( float lat,
float lon ) const
 

determine the cutoff value at a geographical location.

Definition at line 86 of file GalElSpectrum.cxx.

float GalElSpectrum::findCutoff ( float rflux ) const
 

determine the cutoff value which will produce the desired flux.

Definition at line 82 of file GalElSpectrum.cxx.

Referenced by findCutoff(), flux(), and setPosition().

float GalElSpectrum::flux ( std::pair< double,double > coords ) const [virtual]
 

Definition at line 57 of file GalElSpectrum.cxx.

float GalElSpectrum::flux ( float lat,
float lon ) const [virtual]
 

Definition at line 52 of file GalElSpectrum.cxx.

float GalElSpectrum::flux ( float cut ) const
 

Total flux in electrons / m^2 sec ster.

Definition at line 48 of file GalElSpectrum.cxx.

double GalElSpectrum::flux ( ) const [virtual]
 

calculate flux for the current cutoff.

Reimplemented from Spectrum.

Definition at line 40 of file GalElSpectrum.cxx.

Referenced by calculate_rate(), flux(), and setPosition().

void GalElSpectrum::init ( float lat,
float lon ) [private]
 

Definition at line 114 of file GalElSpectrum.cxx.

Referenced by GalElSpectrum().

const char * GalElSpectrum::nameOf ( ) const [inline]
 

Definition at line 83 of file GalElSpectrum.h.

float GalElSpectrum::operator() ( float x ) const [virtual]
 

Reimplemented from Spectrum.

Definition at line 61 of file GalElSpectrum.cxx.

const char * GalElSpectrum::particleName ( ) const [virtual]
 

subclasses need to specify correct particle type.

Reimplemented from Spectrum.

Definition at line 106 of file GalElSpectrum.cxx.

void GalElSpectrum::setParticleName ( std::string name )
 

set the particle name. (default is "p").

Definition at line 110 of file GalElSpectrum.cxx.

void GalElSpectrum::setPosition ( std::pair< double,double > coords ) [virtual]
 

Definition at line 73 of file GalElSpectrum.cxx.

void GalElSpectrum::setPosition ( float lat,
float lon ) [virtual]
 

Definition at line 65 of file GalElSpectrum.cxx.

Referenced by askGPS(), init(), and setPosition().

double GalElSpectrum::solidAngle ( ) const [virtual]
 

calcualte effective solid angle for the given energy.

Reimplemented from Spectrum.

Definition at line 44 of file GalElSpectrum.cxx.

std::string GalElSpectrum::title ( ) const [virtual]
 

return a title describing the spectrum.

Reimplemented from Spectrum.

Definition at line 102 of file GalElSpectrum.cxx.


Member Data Documentation

const float GalElSpectrum::m_altitude = 600.f [static, private]
 

Definition at line 21 of file GalElSpectrum.cxx.

float GalElSpectrum::m_coscutoff [private]
 

Definition at line 96 of file GalElSpectrum.h.

float GalElSpectrum::m_cutoff [private]
 

Definition at line 95 of file GalElSpectrum.h.

float GalElSpectrum::m_expo [private]
 

Definition at line 92 of file GalElSpectrum.h.

float GalElSpectrum::m_flux [private]
 

Definition at line 97 of file GalElSpectrum.h.

float GalElSpectrum::m_norm [private]
 

Definition at line 93 of file GalElSpectrum.h.

float GalElSpectrum::m_normfact [private]
 

Definition at line 94 of file GalElSpectrum.h.

ObserverAdapter< GalElSpectrum > GalElSpectrum::m_observer [private]
 

Definition at line 103 of file GalElSpectrum.h.

std::string GalElSpectrum::m_particle_name [private]
 

Definition at line 102 of file GalElSpectrum.h.

CHIMESpectrum GalElSpectrum::m_pspec [private]
 

Definition at line 90 of file GalElSpectrum.h.

const float GalElSpectrum::m_rearth = 6371.f [static, private]
 

Definition at line 20 of file GalElSpectrum.cxx.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 12:20:36 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000