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

Public Methods | |
| virtual float | operator() (float) const |
| virtual const char * | particleName () const=0 |
| subclasses need to specify correct particle type. More... | |
| virtual double | flux (double time) const |
| calculate the flux, particles/m^2/sr. (default zero). More... | |
| virtual double | solidAngle () const |
| calcualte effective solid angle (default zero). More... | |
| virtual std::string | title () const=0 |
| return a title describing the spectrum. More... | |
| float | fraction (float energy) |
| inverse of the operator: given a KE, return number in [0,1) for choosing limits. More... | |
| virtual | ~Spectrum () |
| virtual double | interval (double time) |
| a randomized interval to the next event - default is 1/rate(). More... | |
| virtual std::pair< float, float > | dir (float energy) const |
| virtual double | energySrc (HepRandomEngine *engine, double time=0) |
| new interface for Hirosima classes. More... | |
| virtual std::pair< double, double > | dir (double energy, HepRandomEngine *engine) |
Protected Methods | |
| Spectrum (const std::vector< float > &) | |
| Spectrum () | |
| virtual void | parseParamList (std::string input, std::vector< float > &output) const |
Protected Attributes | |
| double | m_lat |
| double | m_lon |
| double | m_currentInterval |
Spectrum is the base class for all of the particle sources internal to FluxSvc.
$Header $
Definition at line 28 of file Spectrum.h.
|
|
Definition at line 18 of file Spectrum.cxx.
00018 {}
|
|
|
Definition at line 84 of file Spectrum.h.
00084 {};
|
|
|
Definition at line 85 of file Spectrum.h.
|
|
||||||||||||
|
Reimplemented from ISpectrum. Reimplemented in TimeCandle. Definition at line 53 of file Spectrum.cxx. References dir().
00054 {
00055 // default that needs fixing!
00056 return dir(energy);
00057 }
|
|
|
Reimplemented in AlbedoPSpectrum, CHIMESpectrum, GalElSpectrum, HeSpectrum, and TimeCandle. Definition at line 30 of file Spectrum.cxx. Referenced by dir().
00031 {
00032 // Purpose: return solid angle pair (costh, phi) for the given energy
00033 // Input:: the given energy.
00034 // default: random except for Earth occultation
00035 //here's an attempt at random default distributions as above:
00036 return std::make_pair(((RandFlat::shoot(1.0))*1.4)-0.4,(RandFlat::shoot(1.0))*2*M_PI);
00037
00038 }
|
|
||||||||||||
|
new interface for Hirosima classes.
Reimplemented from ISpectrum. Reimplemented in TimeCandle. Definition at line 46 of file Spectrum.cxx.
00047 {
00048 // default implementation, which works for other Spectrum objects
00049 return (*this)(engine->flat());
00050 }
|
|
|
calculate the flux, particles/m^2/sr. (default zero).
Reimplemented from ISpectrum. Reimplemented in AlbedoPSpectrum, CHIMESpectrum, GalElSpectrum, HeSpectrum, and TimeDepSpectrum. Definition at line 21 of file Spectrum.cxx. Referenced by interval().
00021 {
00022 return 0.; // flag that we don't have a flux
00023 }
|
|
|
inverse of the operator: given a KE, return number in [0,1) for choosing limits.
|
|
|
a randomized interval to the next event - default is 1/rate().
Reimplemented from ISpectrum. Reimplemented in TimeCandle. Definition at line 72 of file Spectrum.cxx. References flux(), and solidAngle().
00073 {
00074 double r = (solidAngle()*flux(time)*6.);
00075
00076 if (r == 0){ return -1.;
00077 }else{
00078 double p = RandFlat::shoot(1.);
00079 return (-1.)*(log(1.-p))/r;
00080 }
00081 }
|
|
|
Reimplemented in AlbedoPSpectrum, CHIMESpectrum, FILESpectrum, GalElSpectrum, HeSpectrum, SimpleSpectrum, TimeDepSpectrum, and TimeCandle. Definition at line 37 of file Spectrum.h.
00037 {return 0;};
|
|
||||||||||||
|
Definition at line 59 of file Spectrum.cxx. Referenced by AlbedoPSpectrum::AlbedoPSpectrum(), GalElSpectrum::GalElSpectrum(), HeSpectrum::HeSpectrum(), and CHIMESpectrum::init().
00060 {
00061
00062 int i=0;
00063 for(;!input.empty() && i!=std::string::npos;){
00064 float f = ::atof( input.c_str() );
00065 output.push_back(f);
00066 i=input.find_first_of(",");
00067 input= input.substr(i+1);
00068 }
00069 }
|
|
|
subclasses need to specify correct particle type.
Reimplemented from ISpectrum. Reimplemented in AlbedoPSpectrum, CHIMESpectrum, FILESpectrum, GalElSpectrum, HeSpectrum, SimpleSpectrum, TimeDepSpectrum, and TimeCandle. Definition at line 41 of file Spectrum.cxx.
00041 {
00042 static const char x='p';
00043 return &x;
00044 }
|
|
|
calcualte effective solid angle (default zero).
Reimplemented from ISpectrum. Reimplemented in AlbedoPSpectrum, CHIMESpectrum, GalElSpectrum, and HeSpectrum. Definition at line 25 of file Spectrum.cxx. Referenced by interval().
00026 {
00027 return 1.0; // flag that doesn't calculate
00028 }
|
|
|
return a title describing the spectrum.
Reimplemented from ISpectrum. Reimplemented in AlbedoPSpectrum, CHIMESpectrum, FILESpectrum, GalElSpectrum, HeSpectrum, SimpleSpectrum, TimeDepSpectrum, and TimeCandle. |
|
|
Definition at line 92 of file Spectrum.h. |
|
|
Definition at line 91 of file Spectrum.h. Referenced by AlbedoPSpectrum::operator()(), HeSpectrum::rad2(), CHIMESpectrum::rad2(), HeSpectrum::setPosition(), GalElSpectrum::setPosition(), and CHIMESpectrum::setPosition(). |
|
|
Definition at line 91 of file Spectrum.h. Referenced by AlbedoPSpectrum::operator()(), HeSpectrum::rad2(), CHIMESpectrum::rad2(), HeSpectrum::setPosition(), GalElSpectrum::setPosition(), and CHIMESpectrum::setPosition(). |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001