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

AlbedoPSpectrum Class Reference

Calculate the earth albedo proton spectrum in low earth orbit. Uses data produced by AMS detector, preliminary graphs from web page. No angular or geographic dependence included. More...

#include <AlbedoPSpectrum.h>

Inheritance diagram for AlbedoPSpectrum:

Spectrum List of all members.

Public Methods

 AlbedoPSpectrum (const std::string& params)
 Constructor. Initial geographic lat and lon in degrees. More...

virtual double calculate_rate (double old_rate)
 Ask GPS where we are and find the flux at that point. More...

virtual double flux () const
 calculate flux for the current position. More...

virtual double solidAngle () const
 effective solid angle for the given energy. More...

virtual float flux (float lat, float lon) const
 flux as a function of latitude and longitude in 600 km orbit. More...

virtual float flux (std::pair<double, double> coords) const
 Flux for a specified position, packaged as a pair. More...

virtual float operator() (float) const
 sample a single particle energy from the spectrum. More...

virtual void setPosition (float lat, float lon)
 move to a new position and do the necessary initialization. More...

virtual void setPosition (std::pair<double,double> coords)
 Do the initialization necessary when moving to a new position. More...

int askGPS ()
 Ask the GPS where we are located. More...

virtual std::pair<float,float> dir (float energy) const
 sample a solid angle pair (costh,phi) from angular distribution. More...

virtual std::string title () const
 What's my name? More...

virtual const char* particleName () const
 What kind of particle do I make? (p for proton). More...

const char* nameOf () const
void setParticleName (std::string name)
 set the particle name. (default is "p"). More...


Private Methods

void init (const std::vector<float>& params)
 Initializes parameters during construction. More...

void FitParams (const double lat, const double lon, double& alf1, double& alf2, double& emin, double& emax, double& v1, double& v2, double& Ejoin) const
 Evaluate the coefficients of the broken power law albedo proton model. More...


Private Attributes

float m_flux
 current flux (set when cutoff changes). More...

std::string m_particle_name
ObserverAdapter< AlbedoPSpectrum > m_observer

Detailed Description

Calculate the earth albedo proton spectrum in low earth orbit. Uses data produced by AMS detector, preliminary graphs from web page. No angular or geographic dependence included.

Interface: The constructor arguments specify the satellite position (latitude, longitude) in degrees. The position can be changed by use of the setPosition() member. The total flux in protons/(m^2 sec ster) is returned by the flux() member. There are 3 ways to call flux(): With no arguments it uses the current cutoff energy. If there is one argument, it is assumed to be a cutoff. Two arguments are assumed to be latitude and longitude, and the corresponding cutoff is looked up. The stored current value is not changed. The operator() function returns a sampled energy value. The argument must be a float value between 0 and 1. The dir() member returns a sampled particle's direction. The argument is the particle energy, as produced by ().

Definition at line 37 of file AlbedoPSpectrum.h.


Constructor & Destructor Documentation

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

Constructor. Initial geographic lat and lon in degrees.

Definition at line 39 of file AlbedoPSpectrum.cxx.


Member Function Documentation

void AlbedoPSpectrum::FitParams ( const double lat,
const double lon,
double & alf1,
double & alf2,
double & emin,
double & emax,
double & v1,
double & v2,
double & Ejoin ) const [private]
 

Evaluate the coefficients of the broken power law albedo proton model.

Input: lat Magnetic latitude in degrees Output: alf1,alf2 Slopes of the two power laws emin,emax Artificial upper and lower cutoff energies v1,v2 Integrated fluxes of the two power laws Ejoin Energy at which the two power laws meet

flux (protons / m^s sec ster MeV) = a1 * (e/e1)^(-alf1) if emin < e < Ejoin a2 * (e/e2)^(-alf2> if Ejoin < e < emax when e is measured in GeV (following the AMS convention)

Definition at line 188 of file AlbedoPSpectrum.cxx.

Referenced by flux(), and operator()().

int AlbedoPSpectrum::askGPS ( )
 

Ask the GPS where we are located.

Definition at line 125 of file AlbedoPSpectrum.cxx.

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

Ask GPS where we are and find the flux at that point.

Definition at line 147 of file AlbedoPSpectrum.cxx.

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

sample a solid angle pair (costh,phi) from angular distribution.

Reimplemented from Spectrum.

Definition at line 155 of file AlbedoPSpectrum.cxx.

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

Flux for a specified position, packaged as a pair.

Definition at line 100 of file AlbedoPSpectrum.cxx.

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

flux as a function of latitude and longitude in 600 km orbit.

Definition at line 90 of file AlbedoPSpectrum.cxx.

double AlbedoPSpectrum::flux ( ) const [virtual]
 

calculate flux for the current position.

Reimplemented from Spectrum.

Definition at line 73 of file AlbedoPSpectrum.cxx.

Referenced by flux().

void AlbedoPSpectrum::init ( const std::vector< float >& params ) [private]
 

Initializes parameters during construction.

Definition at line 19 of file AlbedoPSpectrum.cxx.

Referenced by AlbedoPSpectrum().

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

Definition at line 68 of file AlbedoPSpectrum.h.

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

sample a single particle energy from the spectrum.

Reimplemented from Spectrum.

Definition at line 109 of file AlbedoPSpectrum.cxx.

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

What kind of particle do I make? (p for proton).

Reimplemented from Spectrum.

Definition at line 58 of file AlbedoPSpectrum.cxx.

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

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

Definition at line 65 of file AlbedoPSpectrum.cxx.

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

Do the initialization necessary when moving to a new position.

Definition at line 141 of file AlbedoPSpectrum.cxx.

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

move to a new position and do the necessary initialization.

Definition at line 133 of file AlbedoPSpectrum.cxx.

Referenced by askGPS(), and init().

double AlbedoPSpectrum::solidAngle ( ) const [virtual]
 

effective solid angle for the given energy.

Reimplemented from Spectrum.

Definition at line 80 of file AlbedoPSpectrum.cxx.

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

What's my name?

Reimplemented from Spectrum.

Definition at line 51 of file AlbedoPSpectrum.cxx.


Member Data Documentation

float AlbedoPSpectrum::m_flux [private]
 

current flux (set when cutoff changes).

Definition at line 80 of file AlbedoPSpectrum.h.

ObserverAdapter< AlbedoPSpectrum > AlbedoPSpectrum::m_observer [private]
 

Definition at line 83 of file AlbedoPSpectrum.h.

std::string AlbedoPSpectrum::m_particle_name [private]
 

Definition at line 82 of file AlbedoPSpectrum.h.


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