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

TimeCandle Class Reference

Spectrum: base class for energy spectrum objects TimeCandle: define a particle with a constant time of arrival. More...

#include <TimeCandle.h>

Inheritance diagram for TimeCandle::

Spectrum ISpectrum List of all members.

Public Methods

 TimeCandle (const std::string &params)
 TimeCandle ()
virtual float operator() (float f) const
virtual const char * particleName () const
 subclasses need to specify correct particle type. More...

virtual std::string title () const
 return a title describing the spectrum. More...

virtual std::pair< float,
float > 
dir (float) const
virtual std::pair< double,
double > 
dir (double energy, HepRandomEngine *engine)
double energySrc (HepRandomEngine *engine, double time)
 new interface for Hirosima classes. More...

double interval (double time)
 a randomized interval to the next event - default is 1/rate(). More...


Private Methods

float parseParamList (std::string input, int index)

Private Attributes

double m_T0
std::string m_name

Detailed Description

Spectrum: base class for energy spectrum objects TimeCandle: define a particle with a constant time of arrival.

$Header $

Definition at line 23 of file TimeCandle.h.


Constructor & Destructor Documentation

TimeCandle::TimeCandle const std::string &    params
 

Definition at line 23 of file TimeCandle.cxx.

00024 :m_name("TimeTick")
00025 ,m_T0(parseParamList(params,0))
00026 {}

TimeCandle::TimeCandle  
 

Definition at line 19 of file TimeCandle.cxx.

00020 :m_name("TimeTick")
00021 ,m_T0(30.)
00022 {}//default constructor


Member Function Documentation

virtual std::pair<double,double> TimeCandle::dir double    energy,
HepRandomEngine *    engine
[inline, virtual]
 

Parameters:
dir  direction is either in the format (cos theta, phi) (zenith-local coordinates, or (l,b) (galactic coordinates).

Reimplemented from Spectrum.

Definition at line 38 of file TimeCandle.h.

00038 {return std::make_pair<double,double>(1.0,0.0);}

virtual std::pair<float,float> TimeCandle::dir float    energy const [inline, virtual]
 

Reimplemented from Spectrum.

Definition at line 34 of file TimeCandle.h.

00034                                                 {
00035         return std::make_pair<float,float>(1.0,0.0);
00036     }     

double TimeCandle::energySrc HepRandomEngine *    engine,
double    time
[inline, virtual]
 

new interface for Hirosima classes.

Reimplemented from Spectrum.

Definition at line 40 of file TimeCandle.h.

00040 {  return (*this)(engine->flat());}

double TimeCandle::interval double    time [inline, virtual]
 

a randomized interval to the next event - default is 1/rate().

Reimplemented from Spectrum.

Definition at line 42 of file TimeCandle.h.

References m_T0.

00043     {        
00044         return m_T0;
00045     }

float TimeCandle::operator() float    f const [virtual]
 

Reimplemented from Spectrum.

Definition at line 41 of file TimeCandle.cxx.

00042 {
00043     return 1.;
00044 }

float TimeCandle::parseParamList std::string    input,
int    index
[private]
 

Definition at line 57 of file TimeCandle.cxx.

00058 {
00059     std::vector<float> output;
00060     int i=0;
00061     for(;!input.empty() && i!=std::string::npos;){
00062         float f = ::atof( input.c_str() );
00063         output.push_back(f);
00064         i=input.find_first_of(",");
00065         input= input.substr(i+1);
00066     } 
00067     return output[index];
00068 }

const char * TimeCandle::particleName   const [virtual]
 

subclasses need to specify correct particle type.

Reimplemented from Spectrum.

Definition at line 47 of file TimeCandle.cxx.

References m_name.

00048 {
00049     return m_name.c_str();
00050 }

std::string TimeCandle::title   const [virtual]
 

return a title describing the spectrum.

Reimplemented from Spectrum.

Definition at line 30 of file TimeCandle.cxx.

00031 {
00032     std::strstream s;
00033     s << particleName() << '(' << 1 << " GeV";
00034     //if( m_index >=1 ) s << ',' << m_index ;
00035     s << ")" << '\0';
00036     std::string t(s.str()); s.freeze(false);
00037     return t;
00038 }


Member Data Documentation

std::string TimeCandle::m_name [private]
 

Definition at line 50 of file TimeCandle.h.

Referenced by particleName().

double TimeCandle::m_T0 [private]
 

Definition at line 49 of file TimeCandle.h.

Referenced by interval().


The documentation for this class was generated from the following files:
Generated on Wed Oct 16 14:01:36 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001