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

GRBSim Class Reference

Simulator engine of a GRB source. More...

#include <GRBSim.h>

List of all members.

Public Methods

 GRBSim (long seed=0)
 The simulation can be initialized by setting the seed of the Random engine generator. If seed is 0, a Random GRB is computed.

 GRBSim (const std::string &params)
 ~GRBSim ()
 destructor.

void MakeGRB (double time_offset=0.)
 Starts the GRB simulation. More...

std::vector< double > ComputeFlux (const double time)
void setSpectrum (std::vector< double > myspectrum)
 Sets the private data member m_spectrum to myspectrum.

std::pair< float, float > GRBdir ()
 The direction of the GRB is chosen randomly in the sky.

std::vector< double > Spectrum ()
 Returns a vector contains the flux in .

std::vector< double > Energy ()
std::vector< double > DeltaE ()
 Is the energy bin size in (the energy is in log scale!).

double Tmax ()
 Corresponds to the time (in the GLAST frame) in which the burst ends.

double Area ()
double Flux (int en)
 Returns the value of the flux ( ).

double Energy (int en)
 Return the en energy bin.

double IFlux (std::vector< double > spctrmVec, double enmin=cst::enmin, double enmax=cst::enmax)
 Return the integrated flux ( for energy greather than en. More...

double IRate (std::vector< double > spctrmVec, double enmin=cst::enmin, double enmax=cst::enmax)
 Return the integrated photon rate ( ) for energy greather than enmin. More...

double DrawPhotonFromSpectrum (std::vector< double > spctrmVec, float u=0.0, double enmin=cst::enmin)
 returns a photon energy sampled from the current spectrum vector. More...

double EnergyPh ()
long parseParamList (std::string input, int index)

Public Attributes

GRBConstantsmyParam
 Gathers all relevant constants for the simulation.


Detailed Description

Simulator engine of a GRB source.

This class initializes the simulation generating shells with random Lorentz factors and stacks the shells in a vector. The evolution with the time is evaluated for all the shells and when two shells have the same radius they collide, and a GRBShock is created. All the shocks are staked in a vector. For each shock is evaluated the observed time at which it occurs. This time is used to sort the vector. GRBsim compute the spectrum at a given time and returns it in a vector. This class returns the energy of a photon (chosen from the spectrum), the flux and the rate.

Author:
Nicola Omodei nicola.omodei@pi.infn.it , Johann Cohen-Tanugi johann.cohen@pi.infn.it


Member Function Documentation

double GRBSim::Area   [inline]
 

Is the Area of sphere having as radius the distance of the source (in )

std::vector<double> GRBSim::ComputeFlux const double    time
 

Compute the Flux, at given time. It returns a vector.

Parameters:
time  is the time in which the spectrum is calculated.

double GRBSim::DrawPhotonFromSpectrum std::vector< double >    spctrmVec,
float    u = 0.0,
double    enmin = cst::enmin
 

returns a photon energy sampled from the current spectrum vector.

This is essentially a copycat from the ROOT TH1::GetRandom() method.

Parameters:
spctrmVec  the current spectrum vector m_spectrum.
u  uniform random number.
enmin  minimal energy below which no photon energy is drawn. This is to avoid generation of low energy photons without interest to GLAST.

std::vector<double> GRBSim::Energy   [inline]
 

Is the vector that contains the energy bin,in , in wich the flux is evaluated.

double GRBSim::EnergyPh   [inline]
 

Return the minimum energy for the photon drawn

double GRBSim::IFlux std::vector< double >    spctrmVec,
double    enmin = cst::enmin,
double    enmax = cst::enmax
 

Return the integrated flux ( for energy greather than en.

It calculates the following integral:

Parameters:
spctrmVec  is the vector of double that contains the spectrum to be integrated.
enmin  minimal energy below which no photon energy is drawn. This is to avoid generation of low energy photons without interest to GLAST.
enmax  upper limit of the integral.

double GRBSim::IRate std::vector< double >    spctrmVec,
double    enmin = cst::enmin,
double    enmax = cst::enmax
 

Return the integrated photon rate ( ) for energy greather than enmin.

It calculates the following integral:

Parameters:
spctrmVec  is the vector of double that contains the spectrum to be integrated.
enmin  minimal energy below which no photon energy is drawn. This is to avoid generation of low energy photons without interest to GLAST.
enmax  upper limit of the integral.

void GRBSim::MakeGRB double    time_offset = 0.
 

Starts the GRB simulation.

Initialize the simulation

long GRBSim::parseParamList std::string    input,
int    index
 

Parse the parameter list.


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 11:43:33 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001