Class to handle kinematics variables and the geometry of the galaxy. More...
#include <grid.h>
Public Member Functions | |
| TGrid () | |
| TGrid (double, int, int, double) | |
| vector< double > & | GetR () |
| vector< double > & | GetZ () |
| vector< double > & | GetEk () |
| vector< double > & | GetBeta () |
| vector< double > & | GetGamma () |
| vector< double > & | GetMomentum () |
| vector< double > & | GetBetaEl () |
| vector< double > & | GetGammaEl () |
| vector< double > & | GetMomentumEl () |
| const double | GetDeltaR () const |
| const double | GetDeltaZ () const |
| const double | GetDeltaE () const |
| const int | GetDimR () const |
| const int | GetDimZ () const |
| const int | GetDimE () const |
| int | index (int ir, int iz) |
| Compute linearized index for 2-D spatial matrices. | |
| int | index (int ir, int iz, int ip) |
| Compute linearized index for 3-D momentum-spatial matrices. | |
| ~TGrid () | |
Protected Attributes | |
| int | dimE |
| int | dimr |
| int | dimz |
| double | zmax |
| double | zmin |
| double | Deltar |
| double | Deltaz |
| double | Ekin_factor |
| double | DeltalogE |
| vector< double > | r |
| vector< double > | z |
| vector< double > | Ek |
| vector< double > | beta |
| vector< double > | gamma |
| vector< double > | momentum |
| vector< double > | betael |
| vector< double > | gammael |
| vector< double > | momentumel |
Class to handle kinematics variables and the geometry of the galaxy.
Definition at line 25 of file grid.h.
| TGrid::TGrid | ( | double | Ekfact, | |
| int | numr, | |||
| int | numz, | |||
| double | zmax_ | |||
| ) |
Constructor given some input.
| Ekfact | Delta E / E. | |
| numr | Dimension of the radial grid. | |
| numz | Dimension of the vertical grid. | |
| zmax_ | Height of the simulation box. |
Definition at line 12 of file grid.cc.
References beta, betael, DeltalogE, Deltar, Deltaz, dimE, dimr, dimz, Ek, Ekin_factor, Ekmax, Ekmin, gamma, gammael, MeleGeV, momentum, momentumel, mp, r, Rmax, Rmin, z, zmax, and zmin.
00012 { 00013 00014 dimr = numr; 00015 dimz = numz; 00016 zmax = zmax_; 00017 zmin = -zmax; 00018 Deltar =(Rmax-Rmin)/(double)(dimr-1); 00019 Deltaz =(zmax-zmin)/(double)(dimz-1); 00020 Ekin_factor = Ekfact; 00021 DeltalogE = log(Ekin_factor); 00022 dimE = int(log(Ekmax/Ekmin)/DeltalogE + 1.9); 00023 00024 for (int i = 0; i < dimE; ++i) { 00025 if (dimE == 1) Ek.push_back(Ekmin); 00026 else Ek.push_back(exp(log(Ekmin)+(double)i*log(Ekin_factor))); 00027 00028 gamma.push_back(1.0+Ek.back()/mp); 00029 beta.push_back(sqrt(1.0-1.0/pow(gamma.back(),2))); 00030 momentum.push_back(gamma.back()*mp*beta.back()); 00031 00032 gammael.push_back(1.0+Ek.back()/MeleGeV); 00033 betael.push_back(sqrt(1.0-1.0/pow(gammael.back(),2))); 00034 momentumel.push_back(gammael.back()*MeleGeV*betael.back()); 00035 } 00036 for (int i = 0; i < dimr; ++i) r.push_back(Rmin + (double)i*Deltar); 00037 for (int i = 0; i < dimz; ++i) z.push_back(zmin + (double)i*Deltaz); 00038 00039 }
| TGrid::~TGrid | ( | ) | [inline] |
| vector<double>& TGrid::GetBeta | ( | ) | [inline] |
Returns the beta grid.
Definition at line 43 of file grid.h.
References beta.
Referenced by TParticle::ComputeSecondarySource(), TCoulombLoss::TCoulombLoss(), TDiffusionCoefficient::TDiffusionCoefficient(), TGalpropXSec::TGalpropXSec(), TInelasticCrossSection::TInelasticCrossSection(), TIonizationLoss::TIonizationLoss(), and TSpallationNetwork::TSpallationNetwork().
| vector<double>& TGrid::GetBetaEl | ( | ) | [inline] |
Returns the beta grid for electrons.
Definition at line 50 of file grid.h.
References betael.
Referenced by TBremsstrahlungLoss::TBremsstrahlungLoss(), TCoulombLoss::TCoulombLoss(), TDiffusionCoefficient::TDiffusionCoefficient(), TIonizationLoss::TIonizationLoss(), TISRF::TISRF(), and TSynchrotronLoss::TSynchrotronLoss().
| const double TGrid::GetDeltaE | ( | ) | const [inline] |
Returns log_{10}(Delta E/E).
Definition at line 61 of file grid.h.
References DeltalogE.
Referenced by TSpallationNetwork::TSpallationNetwork().
| const double TGrid::GetDeltaR | ( | ) | const [inline] |
Returns Delta r.
Definition at line 57 of file grid.h.
References Deltar.
Referenced by DRAGON::particle_modulated_spectrum(), TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), TDiffusionCoefficient::TDiffusionCoefficient(), and TDMSource::TDMSource().
| const double TGrid::GetDeltaZ | ( | ) | const [inline] |
Returns Delta z.
Definition at line 59 of file grid.h.
References Deltaz.
Referenced by DRAGON::particle_modulated_spectrum(), TAstrophysicalSource::TAstrophysicalSource(), TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), TDiffusionCoefficient::TDiffusionCoefficient(), TDMSource::TDMSource(), TGas::TGas(), TH2Gas::TH2Gas(), THIGas::THIGas(), and THIIGas::THIIGas().
| const int TGrid::GetDimE | ( | ) | const [inline] |
Returns dimE.
Definition at line 68 of file grid.h.
References dimE.
Referenced by DRAGON::particle_modulated_spectrum(), DRAGON::PrintChi2(), DRAGON::PrintRatios(), TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), TEnergyLoss::TEnergyLoss(), TISRF::TISRF(), and TSpectrum::TSpectrum().
| const int TGrid::GetDimR | ( | ) | const [inline] |
Returns dimr.
Definition at line 64 of file grid.h.
References dimr.
Referenced by TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), and TEnergyLoss::TEnergyLoss().
| const int TGrid::GetDimZ | ( | ) | const [inline] |
Returns dimz.
Definition at line 66 of file grid.h.
References dimz.
Referenced by TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), and TEnergyLoss::TEnergyLoss().
| vector<double>& TGrid::GetEk | ( | ) | [inline] |
Returns the kinetic energy grid.
Definition at line 41 of file grid.h.
References Ek.
Referenced by TParticle::FindNormalization(), DRAGON::particle_modulated_spectrum(), TWebber03::Print(), DRAGON::PrintChi2(), DRAGON::PrintRatios(), TGalpropXSec::TGalpropXSec(), TInelasticCrossSection::TInelasticCrossSection(), TSpallationNetwork::TSpallationNetwork(), and TSpectrum::TSpectrum().
| vector<double>& TGrid::GetGamma | ( | ) | [inline] |
Returns the boost factor grid.
Definition at line 45 of file grid.h.
References gamma.
Referenced by TParticle::ComputeSecondarySource(), TCREvolutorADI::Run(), TCREvolutor::Run(), TCoulombLoss::TCoulombLoss(), and TIonizationLoss::TIonizationLoss().
| vector<double>& TGrid::GetGammaEl | ( | ) | [inline] |
Returns the boost factor grid for electrons.
Definition at line 52 of file grid.h.
References gammael.
Referenced by TBremsstrahlungLoss::TBremsstrahlungLoss(), TCoulombLoss::TCoulombLoss(), TIonizationLoss::TIonizationLoss(), TISRF::TISRF(), and TSynchrotronLoss::TSynchrotronLoss().
| vector<double>& TGrid::GetMomentum | ( | ) | [inline] |
Returns the momentum grid.
Definition at line 47 of file grid.h.
References momentum.
Referenced by Galaxy::Galaxy(), TCREvolutorADI::Run(), TCREvolutor::Run(), TDiffusionCoefficient::TDiffusionCoefficient(), TSpallationNetwork::TSpallationNetwork(), and TSpectrum::TSpectrum().
| vector<double>& TGrid::GetMomentumEl | ( | ) | [inline] |
Returns the momentum grid for electrons.
Definition at line 54 of file grid.h.
References momentumel.
Referenced by Galaxy::Galaxy(), TCREvolutorADI::Run(), TCREvolutor::Run(), TDiffusionCoefficient::TDiffusionCoefficient(), and TSpectrum::TSpectrum().
| vector<double>& TGrid::GetR | ( | ) | [inline] |
Returns the R grid.
Definition at line 37 of file grid.h.
References r.
Referenced by TParticle::FindNormalization(), DRAGON::particle_modulated_spectrum(), TParticle::PrintSpectrum(), TAstrophysicalSource::TAstrophysicalSource(), TBField::TBField(), TDiffusionCoefficient::TDiffusionCoefficient(), TDMSource::TDMSource(), TGas::TGas(), TH2Gas::TH2Gas(), THIGas::THIGas(), THIIGas::THIIGas(), and TISRF::TISRF().
| vector<double>& TGrid::GetZ | ( | ) | [inline] |
Returns the Z grid.
Definition at line 39 of file grid.h.
References z.
Referenced by TParticle::FindNormalization(), DRAGON::particle_modulated_spectrum(), TParticle::PrintSpectrum(), TAstrophysicalSource::TAstrophysicalSource(), TBField::TBField(), TConvectionVelocity::TConvectionVelocity(), TDiffusionCoefficient::TDiffusionCoefficient(), TDMSource::TDMSource(), TGas::TGas(), TH2Gas::TH2Gas(), THIGas::THIGas(), THIIGas::THIIGas(), and TISRF::TISRF().
| int TGrid::index | ( | int | ir, | |
| int | iz, | |||
| int | ip | |||
| ) | [inline] |
| int TGrid::index | ( | int | ir, | |
| int | iz | |||
| ) | [inline] |
Compute linearized index for 2-D spatial matrices.
| ir | radial index | |
| iz | vertical index |
Definition at line 71 of file grid.h.
References dimz.
Referenced by TParticle::ComputeSecondarySource(), TCREvolutorADI::Run(), TCREvolutor::Run(), TBremsstrahlungLoss::TBremsstrahlungLoss(), TCoulombLoss::TCoulombLoss(), and TIonizationLoss::TIonizationLoss().
00071 { return ir*dimz+iz; }
vector<double> TGrid::beta [protected] |
vector<double> TGrid::betael [protected] |
Array of points in the beta grid (electrons).
Definition at line 121 of file grid.h.
Referenced by GetBetaEl(), TGrid(), and ~TGrid().
double TGrid::DeltalogE [protected] |
Radial grid spacing (logarithmic).
Definition at line 113 of file grid.h.
Referenced by GetDeltaE(), and TGrid().
double TGrid::Deltar [protected] |
double TGrid::Deltaz [protected] |
Vertical grid spacing.
Definition at line 111 of file grid.h.
Referenced by GetDeltaZ(), and TGrid().
int TGrid::dimE [protected] |
int TGrid::dimr [protected] |
int TGrid::dimz [protected] |
vector<double> TGrid::Ek [protected] |
double TGrid::Ekin_factor [protected] |
vector<double> TGrid::gamma [protected] |
Array of points in the boost grid.
Definition at line 118 of file grid.h.
Referenced by GetGamma(), TGrid(), and ~TGrid().
vector<double> TGrid::gammael [protected] |
Array of points in the boost grid (electrons).
Definition at line 122 of file grid.h.
Referenced by GetGammaEl(), TGrid(), and ~TGrid().
vector<double> TGrid::momentum [protected] |
Array of points in the momentum grid.
Definition at line 119 of file grid.h.
Referenced by GetMomentum(), TGrid(), and ~TGrid().
vector<double> TGrid::momentumel [protected] |
Array of points in the momentum grid (electrons).
Definition at line 123 of file grid.h.
Referenced by GetMomentumEl(), TGrid(), and ~TGrid().
vector<double> TGrid::r [protected] |
vector<double> TGrid::z [protected] |
double TGrid::zmax [protected] |
double TGrid::zmin [protected] |
1.6.3