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

ISpectrum Class Reference

The virtual interface for Spectrum-type objects. More...

#include <ISpectrum.h>

List of all members.

Public Member Functions

virtual const char * particleName () const=0
 particle name that must be known to the particle service

virtual double flux (double time) const=0
 calculate the flux, particles/m^2/sr.

virtual double solidAngle () const
 return effective solid angle that will be used to determine the actual rate.

virtual std::string title () const=0
 return a title describing the spectrum

virtual double interval (double time)=0
virtual double energy (double time=0)=0
 return energy, either GeV or MeV

virtual std::pair< double,
double > 
dir (double energy)=0
 return direction in a pair:


Detailed Description

The virtual interface for Spectrum-type objects.

Class for holding function definitions of Spectrums... an abstract base class.

Notes: The input variable "time" means the time when the event is called - that is, when the function flux(time1) gets called, what should be returned is the flux (c/s/m^2/sr) for the source at that time (time1), and/or when interval(time1) gets called, it is asking for the interval between time1 and the time when the next particle arrives.

However, using these finctions is tricky, since they seem to contradict each other (i.e. "what happens if the flux at a certain time is really low, but the interval to the next particle is really short?") The answer lies in understanding which figure the FluxSvc code will use to find the next particle, and it works this way:

1. FluxSvc will first call interval(time1) to find out when the next particle comes. if this is a "good" (nonnegative) number, then this will be the time when the next particle is understood to arrive. If this is instead a negative number (say -1), then the process will go to step 2:

2. FluxSvc will then call flux(time1) to determine the average flux for that time, and then calculate the arrival time for the next particle using the poisson distribution, as well as the solid angle of the source (since flux is in units of c/s/m^2/sr.)

So, if interval(time) is set up to already know when the next particle will arrive (this is necessary for sources with a high time-variance), then FluxSvc will just use it, and otherwise, flux(time) will be used to calculate the next time.

Author:
Sean Robinson
Header
/nfs/slac/g/glast/ground/cvs/FluxSvc/FluxSvc/ISpectrum.h,v 1.9 2003/03/06 00:53:16 srobinsn Exp

Definition at line 49 of file ISpectrum.h.


Member Function Documentation

virtual std::pair<double,double> ISpectrum::dir double  energy  )  [pure virtual]
 

return direction in a pair:

Parameters:
energy The generated energy, from previous call to energy
Returns:
direction is either in the format (cos theta, phi) for (zenith-local coordinates, or (l,b) (galactic coordinates).

virtual double ISpectrum::energy double  time = 0  )  [pure virtual]
 

return energy, either GeV or MeV

virtual double ISpectrum::flux double  time  )  const [pure virtual]
 

calculate the flux, particles/m^2/sr.

(default zero)

Parameters:
time the mission elapsed time in sec

virtual double ISpectrum::interval double  time  )  [pure virtual]
 

a (randomized) interval to the next event.

Parameters:
time the mission elapsed time in sec For time-independent rate, should correspond to exponential( 1/rate() ) Return negative to do this with flux()*solidAngle(). needs to know the cross-sectional area?

virtual const char* ISpectrum::particleName  )  const [pure virtual]
 

particle name that must be known to the particle service

virtual double ISpectrum::solidAngle  )  const [inline, virtual]
 

return effective solid angle that will be used to determine the actual rate.

If the source declared in the xml file is using the "use_spectrum" tag, telling FluxSvc to use all the directional information from the class itself, then the solid_angle function really only tells FluxSvc what angular area the flux is over, so that it can calculate a rate.

Definition at line 68 of file ISpectrum.h.

00068 {return  1.0;} //flag that doesen't calculate.

virtual std::string ISpectrum::title  )  const [pure virtual]
 

return a title describing the spectrum


The documentation for this class was generated from the following file:
Generated on Mon Dec 1 13:30:01 2008 by doxygen 1.3.3