TF1Map Class Reference

#include <TF1Map.h>

Inheritance diagram for TF1Map:
[legend]
Collaboration diagram for TF1Map:
[legend]

List of all members.

Public Member Functions

 TF1Map (const std::string &)
 ~TF1Map ()
float operator() (float) const
 The TF1 object manages the random draw, so that the float argument, normally a random draw from a [0,1[ distribution, is unused.
std::string title () const
const char * particleName () const
double energy (double time)
 Return an energy sampled from the TF1 distribution.
virtual double flux (double) const
 Overload of flux method to ensure proper call to m_flux.
 TF1Map (const std::string &)
 ~TF1Map ()
float operator() (float) const
 The TF1 object manages the random draw, so that the float argument, normally a random draw from a [0,1[ distribution, is unused.
std::string title () const
const char * particleName () const
double energy (double time)
 Return an energy sampled from the TF1 distribution.
virtual double flux (double) const
 Overload of flux method to ensure proper call to m_flux.

Private Attributes

TF1 p_tf1
 pointer to the TF1 object that reads the symbolic formula and does all the job
std::map< std::string,
std::string > 
m_parmap


Detailed Description

Definition at line 25 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.


Constructor & Destructor Documentation

TF1Map::TF1Map ( const std::string &  params  ) 

Definition at line 19 of file build/redhat5-i686-32bit-gcc41-Debug/src/TF1Map.cxx.

References MapSource::m_flux, m_parmap, and p_tf1.

00020   : MapSource(params)
00021 {
00022   facilities::Util::keyValueTokenize(params," \t,\n",m_parmap);
00023 
00024   std::string internal_name = m_parmap["tf1name"].c_str();
00025   int grid_bins = 0;
00026   grid_bins = std::atoi(m_parmap["tf1precision"].c_str());
00027 
00028   m_flux = std::atof(m_parmap["flux"].c_str());
00029   double e_min = std::atof(m_parmap["emin"].c_str());
00030   double e_max = std::atof(m_parmap["emax"].c_str());
00031   p_tf1 = TF1(internal_name.c_str(),m_parmap["formula"].c_str(), e_min, e_max);
00032 
00033   if(grid_bins!=0){
00034     p_tf1.SetNpx(grid_bins);
00035   }
00036 
00037   if(m_flux==0.)
00038     m_flux = p_tf1.Integral(e_min,e_max);
00039 }

TF1Map::~TF1Map (  )  [inline]

Definition at line 29 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

00029 {;}//{delete p_tf1;}

TF1Map::TF1Map ( const std::string &   ) 

TF1Map::~TF1Map (  )  [inline]

Definition at line 29 of file genericSources/TF1Map.h.

00029 {;}//{delete p_tf1;}


Member Function Documentation

double TF1Map::energy ( double  time  )  [inline, virtual]

Return an energy sampled from the TF1 distribution.

Reimplemented from MapSource.

Definition at line 48 of file genericSources/TF1Map.h.

00048 {      return (*this)(time);    }

double TF1Map::energy ( double  time  )  [inline, virtual]

Return an energy sampled from the TF1 distribution.

Reimplemented from MapSource.

Definition at line 48 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

00048 {      return (*this)(time);    }

virtual double TF1Map::flux ( double   )  const [inline, virtual]

Overload of flux method to ensure proper call to m_flux.

Returns:
Total flux (photons/m^2).
Parameters:
time Simulation time in seconds.

Reimplemented from MapSource.

Definition at line 54 of file genericSources/TF1Map.h.

References MapSource::m_flux.

00054 { return m_flux; } 

virtual double TF1Map::flux ( double   )  const [inline, virtual]

Overload of flux method to ensure proper call to m_flux.

Returns:
Total flux (photons/m^2).
Parameters:
time Simulation time in seconds.

Reimplemented from MapSource.

Definition at line 54 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

References MapSource::m_flux.

00054 { return m_flux; } 

float TF1Map::operator() ( float   )  const [inline, virtual]

The TF1 object manages the random draw, so that the float argument, normally a random draw from a [0,1[ distribution, is unused.

Reimplemented from MapSource.

Definition at line 34 of file genericSources/TF1Map.h.

References p_tf1.

00035     {
00036       return p_tf1.GetRandom();
00037     }

float TF1Map::operator() ( float   )  const [inline, virtual]

The TF1 object manages the random draw, so that the float argument, normally a random draw from a [0,1[ distribution, is unused.

Reimplemented from MapSource.

Definition at line 34 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

References p_tf1.

00035     {
00036       return p_tf1.GetRandom();
00037     }

const char* TF1Map::particleName (  )  const [inline, virtual]

Returns:
Particle type, "gamma".

Reimplemented from MapSource.

Definition at line 44 of file genericSources/TF1Map.h.

00044 {      return m_particle_name.c_str();    }

const char* TF1Map::particleName (  )  const [inline, virtual]

Returns:
Particle type, "gamma".

Reimplemented from MapSource.

Definition at line 44 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

00044 {      return m_particle_name.c_str();    }

std::string TF1Map::title (  )  const [inline, virtual]

Returns:
Title describing the spectrum.

Reimplemented from MapSource.

Definition at line 39 of file genericSources/TF1Map.h.

00040     {
00041       return "TF1Map";
00042     }

std::string TF1Map::title (  )  const [inline, virtual]

Returns:
Title describing the spectrum.

Reimplemented from MapSource.

Definition at line 39 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

00040     {
00041       return "TF1Map";
00042     }


Member Data Documentation

std::map< std::string, std::string > TF1Map::m_parmap [private]

Definition at line 60 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

Referenced by TF1Map().

TF1 TF1Map::p_tf1 [mutable, private]

pointer to the TF1 object that reads the symbolic formula and does all the job

Definition at line 59 of file build/redhat5-i686-32bit-gcc41-Debug/genericSources/TF1Map.h.

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


The documentation for this class was generated from the following files:

Generated on Wed Apr 3 13:20:46 2013 for celestialSources by  doxygen 1.5.8