![]() |
SatAndLight
2.2.2-hubble
Simulation toolkit for space telescopes
|
Astrophysical source spectra and light curves. More...
#include <SpecTime.h>


Public Member Functions | |
| void | ApplyExtinction (TGraph *aArea=NULL) |
| Applies extinction processes to the flux. | |
| double | DrawEnergy (const double aTime) |
| Draws an energy value at a given time. | |
| TH2D * | GetFlux (void) |
| Returns a pointer to the flux TH2D object. | |
| TH1D * | GetLightCurve (const double aEnergyMin=0.0, const double aEnergyMax=-1.0) |
| Returns the source light curve between two energies. | |
| double | GetMagnitude (const double aTimeMin, const double aTimeMax, TGraph *aEnergyTransmission) |
| Returns the mean magnitude. | |
| TH1D * | GetMagnitude (TGraph *aEnergyTransmission) |
| Returns the magnitude light curve. | |
| int | GetParticleN (const ULong64_t aTime, const UInt_t aDuration, const double aCosTheta=1.0) |
| Computes the number of particles generated between 2 times. | |
| TH2D * | GetRate (void) |
| Returns a pointer to the flux TH2D object. | |
| TH1D * | GetSpectrum (const double aTimeMin=0.0, const double aTimeMax=-1.0, const bool aObserved=false) |
| Returns the source energy spectrum between two times. | |
| double | GetTimeMax (void) |
| Returns the maximum time defining the SpecTime object. | |
| double | GetTimeMin (void) |
| Returns the minimum time defining the SpecTime object. | |
| void | MakeBandLimited (const double aFlux, const double aEnergyMin, const double aEnergyMax, TGraph *aArea=NULL) |
| Makes a band-limited flux SpecTime object. | |
| void | MakeExpDecayEnergy (const double aFlux, const double aEnergyDecay, TGraph *aArea=NULL) |
| Makes an energy exponential decay flux SpecTime object. | |
| void | MakeExpDecayTime (const double aFlux, const double aTimeDecay, const double aEnergyMin, const double aEnergyMax, TGraph *aArea=NULL) |
| Makes a time exponential decay flux SpecTime object. | |
| void | MakeGRBData (TH1D *aLightCurveExp, const double aE1, const double aE2, const double aPhotonIndex, const double aNint, const double aNgal, const double aZ, TGraph *aAreaExp, TGraph *aArea=NULL) |
| Makes a SpecTime object using GRB data. | |
| void | MakeGRBModel0 (const double aFlux, const double aTime0, const double aAlpha, const double aEnergy0, const double aBeta, TGraph *aArea=NULL) |
| Makes a SpecTime object using a GRB model (0). | |
| void | MakeGRBModel1 (const double aFlux, const double aEnergy0, const double aAlpha, const double aBeta, TGraph *aArea=NULL) |
| Makes a SpecTime object using a GRB model (I). | |
| void | MakeRate (const double aArea) |
| Computes the rate given a constant integration area. | |
| void | MakeRate (TGraph *aArea) |
| Computes the rate given an integration area. | |
| void | MakeUniform (const double aFlux, TGraph *aArea=NULL) |
| Makes a uniform flux SpecTime object. | |
| void | SetFlux (TH2D *aFlux, TGraph *aArea=NULL) |
| Defines a new flux fonction. | |
| void | SetPhotoElectricCrossSection (TGraph *aGraph) |
| Sets the photo-electric cross-section. | |
Constructors and destructors | |
| SpecTime (const int aNt, const double *aTimeBins, const int aNe, const double *aEnergyBins) | |
| SpecTime class constuctor. | |
| SpecTime (const int aNt, const double aTimeMin, const double aTimeMax, const bool aUseTimeLog, const int aNe, const double aEnergyMin, const double aEnergyMax, const bool aUseEnergyLog) | |
| SpecTime class constuctor. | |
| SpecTime (TH2D *aFlux, TH2D *aRate=NULL) | |
| SpecTime class constuctor. | |
| virtual | ~SpecTime (void) |
| SpecTime class destructor. | |
Public Member Functions inherited from Extinction | |
| double | GetMeiksin2006 (const double aRedshift, const double aEnergyObs) |
| Returns the intergalactic extinction factor predicted by the Meiksin 2006 model. | |
| TGraph * | GetMeiksin2006 (const double aRedshift, const unsigned int aN, const double aWavelengthObsMin, const double aWavelengthObsMax) |
| Returns the intergalactic extinction factor as a function of the wavelength predicted by the Meiksin 2006 model. | |
| double | GetPei1992 (const double aEnergy, const double aExtinctionV, const string aExtLaw) |
| Returns the galactic dust extinction factor predicted by the Pei 1992 model. | |
| TGraph * | GetScaleFactorPei1992 (const string aExtLaw="MW") |
| Returns the extinction scaling factor as a function of the wavelength. | |
| double | GetSourceExtinction (const double aEnergyObs) |
| Returns the overall extinction factor (transmission) for an astrophysical source. | |
| void | SetSource (const double aRedshift, const double aMwExtinctionV, const double aHostExtinctionV) |
| Defines the source properties. | |
| Extinction (void) | |
| Constructor of the Extinction class. | |
| virtual | ~Extinction (void) |
| Destructor of the Extinction class. | |
Protected Attributes | |
| TH2D * | flux |
| Source flux \({\cal{F}}(E,t)\). | |
| TH2D * | flux_x |
| Source flux \({\cal{F}}(E,t)\) after extinction. | |
| TRandom3 * | randgen |
| Random generator. | |
| TH2D * | rate |
| Source rate \({\cal{R}}(E,t)\). | |
Private Member Functions | |
| void | ConstructHistos (const int aNt, const double *aTimeBins, const int aNe, const double *aEnergyBins) |
| for constructors. | |
| void | MakeCum (void) |
| Computes cumulative rate. | |
Private Attributes | |
| TGraph * | photoelectric_xsec |
| Photo-electric cross-section. | |
| double ** | rate_cum |
| Cumulative rate (over \(E\)). | |
Astrophysical source spectra and light curves.
A SpecTime object is used to describe an astrophysical source spectrum as a function of time. It describes both the time and energy distributions of astro-particles. It includes 2-dimensional histograms (TH2D) to describe the particle flux, \({\cal{F}}(E,t)=\frac{d^4N}{dSdtdE}(E,t)\), and the particle rate, \({\cal{R}}(E,t)=\frac{d^2N}{dtdE}(E,t)\). A area of interest \(S(E)\) must be provided to derive the rate from the flux:
\[ {\cal{R}}(E,t)=\frac{d^2N}{dtdE}(E,t)=\iint_S{\cal{F}}(E,t)dS=\iint_S\frac{d^4N}{dSdtdE}(E,t)dS. \]
The flux and rate functions are represented by 2-dimensional histograms (TH2D in ROOT). The x-axis is binned in time and the y-axis is binned in energy. By convention, the flux is measured in the observer reference frame. It means that energies are redshifted. It also means that extinction processes, described by the Extinction class, are included in the flux.
This class offers many methods (MakeUniform(), MakeBandLimited(), MakeExpDecayTime(), MakeExpDecayEnergy(), MakeGRBModel1(),...) to compute realistic (or not) flux/rate models.
Finally, the SpecTime object can be used to randomly draw particle parameters.
| SpecTime::SpecTime | ( | const int | aNt, |
| const double * | aTimeBins, | ||
| const int | aNe, | ||
| const double * | aEnergyBins | ||
| ) |
SpecTime class constuctor.
In this constructor TH2D objects are initialized and the binning must be provided. The binning can no longer be changed.
| [in] | aNt | Number of time bins. |
| [in] | aTimeBins | Pointer to an array of bin limits \([\mathrm{ms}]\). |
| [in] | aNe | Number of energy bins. |
| [in] | aEnergyBins | Pointer to an array of bin limits \([\mathrm{keV}]\). |
| SpecTime::SpecTime | ( | const int | aNt, |
| const double | aTimeMin, | ||
| const double | aTimeMax, | ||
| const bool | aUseTimeLog, | ||
| const int | aNe, | ||
| const double | aEnergyMin, | ||
| const double | aEnergyMax, | ||
| const bool | aUseEnergyLog | ||
| ) |
SpecTime class constuctor.
The flux and rate functions are represented by 2-dimensional histograms (TH2D in ROOT). The x-axis is binned in time and the y-axis is binned in energy. In this constructor TH2D objects are initialized and the binning must be provided. The binning can no longer be changed.
| [in] | aNt | Number of time bins. |
| [in] | aTimeMin | Minimum time \([\mathrm{ms}]\). |
| [in] | aTimeMax | Maximum time \([\mathrm{ms}]\). |
| [in] | aUseTimeLog | Flag to use logarithmic bins (true) or linear bins (false) for time. |
| [in] | aNe | Number of energy bins. |
| [in] | aEnergyMin | Minimum energy \([\mathrm{keV}]\). |
| [in] | aEnergyMax | Maximum energy \([\mathrm{keV}]\). |
| [in] | aUseEnergyLog | Flag to use logarithmic bins (true) or linear bins (false) for energy. |
| SpecTime::SpecTime | ( | TH2D * | aFlux, |
| TH2D * | aRate = NULL |
||
| ) |
SpecTime class constuctor.
The flux and rate functions are represented by 2-dimensional histograms (TH2D in ROOT). The x-axis is binned in time and the y-axis is binned in energy. In this constructor TH2D objects are initialized using input histograms with or without content.
| [in] | aFlux | Flux histogram. |
| [in] | aRate | Rate histogram. If a pointer to NULL is provided, a copy of the flux histogram is used. |
|
virtual |
SpecTime class destructor.
| void SpecTime::ApplyExtinction | ( | TGraph * | aArea = NULL | ) |
Applies extinction processes to the flux.
For a distant astrophysical source, the flux must include extinction processes \(X(E)\). Extinction processes can be applied with this function. The extinction is modeled with the Extinction class. Before calling this function, the properties of the source must be defined with Extinction::SetSource().
The original flux object (without extinction), as defined with the constructor or with the MakeXXX functions, is kept in memory. It means that this function can be called multiple times in a row with updated source properties. The original flux object is applied the latest extinction parameters.
| [in] | aArea | Pointer to a valid TGraph object to describe the area as a function of energy in \([\mathrm{mm}^2]\). |
|
private |
for constructors.
| double SpecTime::DrawEnergy | ( | const double | aTime | ) |
Draws an energy value at a given time.
The energy value is randomly drawn following the rate function, using an input time.
| [in] | aTime | Time \([\mathrm{ms}]\). |
|
inline |
Returns a pointer to the flux TH2D object.
| TH1D * SpecTime::GetLightCurve | ( | const double | aEnergyMin = 0.0, |
| const double | aEnergyMax = -1.0 |
||
| ) |
Returns the source light curve between two energies.
The light curve is defined as:
\[ {\cal{L}}(t)=\frac{dN}{dt}(t)=\int_{E_{min}}^{E_{max}}{{\cal{R}}(E,t)dE}. \]
It is obtained by integrating the rate object (TH2D) over energies.
| double SpecTime::GetMagnitude | ( | const double | aTimeMin, |
| const double | aTimeMax, | ||
| TGraph * | aEnergyTransmission | ||
| ) |
Returns the mean magnitude.
The magnitude is defined in The magnitude definition. It is obtained by integrating the flux object (TH2D) over energies. The flux is weighted by an energy transmission function which must be provided as a TGraph. The transmission is interpolated if within the TGraph energy range, extrapolated otherwise. Here the magnitude is averaged between two times.
| [in] | aTimeMin | Minimum time, \(t_{min}\), in \([\mathrm{ms}]\). Use 0.0 to use the start time of the SpecTime object. |
| [in] | aTimeMax | Maximum time, \(t_{max}\), in \([\mathrm{ms}]\). Use -1.0 to use the stop time of the SpecTime object. |
| [in] | aEnergyTransmission | Energy transmission function \(\Delta(E)\) |
| TH1D * SpecTime::GetMagnitude | ( | TGraph * | aEnergyTransmission | ) |
Returns the magnitude light curve.
The magnitude is defined in The magnitude definition. It is obtained by integrating the flux object (TH2D) over energies. The flux is weighted by an energy transmission function which must be provided as a TGraph. The transmission is interpolated if within the TGraph energy range, extrapolated otherwise.
| [in] | aEnergyTransmission | Energy transmission function \(\Delta(E)\) |
| int SpecTime::GetParticleN | ( | const ULong64_t | aTime, |
| const UInt_t | aDuration, | ||
| const double | aCosTheta = 1.0 |
||
| ) |
Computes the number of particles generated between 2 times.
The rate object is integrated over time (time range is given) and energy (full range) to get the mean number of particles. The actual number of particles is randomly drawn from a Poisson distribution with this mean value.
It is possible to correct the mean value for non-axis emission. The \(\cos\theta\) value must then be provided, where \(\theta\) is the angle between the detector axis and the source direction.
| [in] | aTime | Start time [ms]. |
| [in] | aDuration | Time duration [ms]. |
| [in] | aCosTheta | Non-axis correction: \(\cos\theta\). |
|
inline |
Returns a pointer to the flux TH2D object.
| TH1D * SpecTime::GetSpectrum | ( | const double | aTimeMin = 0.0, |
| const double | aTimeMax = -1.0, |
||
| const bool | aObserved = false |
||
| ) |
Returns the source energy spectrum between two times.
The energy spectrum is defined as:
\[ {\cal{S}}(E)=\frac{1}{t_{max}-t_{min}}\int_{t_{min}}^{t_{max}}{{\cal{F}}(E,t)dt} \]
It is obtained by integrating the flux object (TH2D) over time.
It is also possible to request the observed source energy spectrum by integrating the rate object:
\[ {\cal{S}}_{obs}(E)=\frac{1}{t_{max}-t_{min}}\int_{t_{min}}^{t_{max}}{{\cal{R}}(E,t)dt} \]
| [in] | aTimeMin | Minimum time, \(t_{min}\), in \([\mathrm{ms}]\). Use 0.0 to use the start time of the SpecTime object. |
| [in] | aTimeMax | Maximum time, \(t_{max}\), in \([\mathrm{ms}]\). Use -1.0 to use the stop time of the SpecTime object. |
| [in] | aObserved | Set this to true to return the observed source energy spectrum. |
|
inline |
Returns the maximum time defining the SpecTime object.
|
inline |
Returns the minimum time defining the SpecTime object.
| void SpecTime::MakeBandLimited | ( | const double | aFlux, |
| const double | aEnergyMin, | ||
| const double | aEnergyMax, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes a band-limited flux SpecTime object.
The flux is constant beween two energy values and is constant over time:
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \Theta(E-E_{min}) \times \Theta(E_{max}-E). \]
The minimum and maximum energies must be within the energy range defined in the constructor. If not, they are adjusted to fit the original energy range.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Constant flux value, \({\cal{F}}_0\), in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aEnergyMin | Minimum energy \([\mathrm{keV}]\). |
| [in] | aEnergyMax | Maximum energy \([\mathrm{keV}]\). |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
|
private |
Computes cumulative rate.
| void SpecTime::MakeExpDecayEnergy | ( | const double | aFlux, |
| const double | aEnergyDecay, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes an energy exponential decay flux SpecTime object.
The flux is constant over time and decays in energy following an exponential distribution:
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \exp\left(-\frac{E-E_0}{\epsilon}\right), \]
where \({\cal{F}}_0\) is the flux at the minimum energy \(E_0\), defined in the constructor, and \(\epsilon\) is the flux energy decay. The flux is only computed in the limits defined in the constructor, it is null elsewhere.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Flux \({\cal{F}}_0\) value in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aEnergyDecay | Flux energy decay \(\epsilon\) in \([\mathrm{keV}]\). |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeExpDecayTime | ( | const double | aFlux, |
| const double | aTimeDecay, | ||
| const double | aEnergyMin, | ||
| const double | aEnergyMax, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes a time exponential decay flux SpecTime object.
The flux is constant beween two energy values and decays in time following an exponential distribution:
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \exp\left(-\frac{t-t_0}{\tau}\right) \times \Theta(E-E_{min}) \times \Theta(E_{max}-E), \]
where \({\cal{F}}_0\) is the flux at the initial time \(t_0\), defined in the constructor, and \(\tau\) is the flux time decay. The minimum and maximum energies must be within the energy range defined in the constructor. If not, they are adjusted to fit the original energy range.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Initial flux \({\cal{F}}_0\) value in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aTimeDecay | Flux time decay \(\tau\) in \([\mathrm{ms}]\). |
| [in] | aEnergyMin | Minimum energy \([\mathrm{keV}]\). |
| [in] | aEnergyMax | Maximum energy \([\mathrm{keV}]\). |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeGRBData | ( | TH1D * | aLightCurveExp, |
| const double | aE1, | ||
| const double | aE2, | ||
| const double | aPhotonIndex, | ||
| const double | aNint, | ||
| const double | aNgal, | ||
| const double | aZ, | ||
| TGraph * | aAreaExp, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes a SpecTime object using GRB data.
The source flux is modeled as:
\[ {\cal{F}}(E,t) = f_1(t)\times f_2(E), \]
where the energy dependence includes the energy absorption due to the photo-electric effect and is described by:
\[ f_2(E) = A\times E^{-\lambda} \times \exp{\left(-N_H^{int}\sigma(E)\right)} \times \exp{\left(-N_H^{Gal}\sigma(E/(1+z))\right)}. \]
The time dependence is derived from experimental data using the light curve:
\[ {\cal{L}}_{exp}(t) = \frac{dN_{exp}}{dt}(t) = \int_{E_1}^{E_2}{{\cal{R}}_{exp}(E,t)dE} = \int_{E_1}^{E_2}{S_{exp}(E)\times {\cal{F}}(E,t) dE}. \]
Here the rate is derived from the flux using the experiment effective area \(S_{exp}(E)\) and is integrated over the energy range \(E_1\)- \(E_2\).
Then it comes:
\[ f_1(t) = \frac{{\cal{L}}_{exp}(t)}{\int_{E_1}^{E_2}{S_{exp}(E)\times f_2(E) dE}}. \]
Finally:
\[ {\cal{F}}(E,t) = {\cal{L}}_{exp}(t)\times \frac{E^{-\lambda} \times \exp{\left(-N_H^{int}\sigma(E)\right)} \times \exp{\left(-N_H^{Gal}\sigma(E/(1+z))\right)}}{\int_{E_1}^{E_2}{S_{exp}(E)\times E^{-\lambda} \times \exp{\left(-N_H^{int}\sigma(E)\right)} \times \exp{\left(-N_H^{Gal}\sigma(E/(1+z))\right)} dE}}. \]
This equation is used to compute the flux object. The integral at the denominator is calculated using the numerical precision of \(S_{exp}(E)\).
The example below shows the resulting SpecTime object obtained with GRB091020 downloaded from the Swift/XRT database. The absorption at low energies is included.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aLightCurveExp | Experimental light curve \({\cal{L}}_{exp}(t)\). |
| [in] | aE1 | Lower energy bound \(E_1\) used for \({\cal{L}}_{exp}(t)\), in \([keV]\). |
| [in] | aE1 | Upper energy bound \(E_2\) used for \({\cal{L}}_{exp}(t)\), in \([keV]\). |
| [in] | aPhotonIndex | Photon index \(\lambda\). |
| [in] | aNint | Intrinsic column density. The unit should be consistent with the cross-section of the photo-electric effect. |
| [in] | aNgal | Galactic column density. The unit should be consistent with the cross-section of the photo-electric effect. |
| [in] | aZ | Absorber redshift \(z\). |
| [in] | aAreaExp | Effective area for the experiment \(S_{exp}(E)\). The energy range of this function must entirely contain the \(E_1\)- \(E_2\) range (no extrapolation). The points are assumed to be sorted in energy. |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeGRBModel0 | ( | const double | aFlux, |
| const double | aTime0, | ||
| const double | aAlpha, | ||
| const double | aEnergy0, | ||
| const double | aBeta, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes a SpecTime object using a GRB model (0).
The particle flux is a power law in time and energy:
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \left(\frac{t}{t_0}\right)^{-\alpha} \times \left(\frac{E}{E_0}\right)^{-\beta} \]
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Reference flux \({\cal{F}}_0\) value in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aTime0 | Reference time, \(t_0\), in \([\mathrm{ms}]\). |
| [in] | aAlpha | Time index, \(\alpha\). |
| [in] | aEnergy0 | Reference energy, \(E_0\), in \([\mathrm{keV}]\). |
| [in] | aBeta | Spectral index, \(\beta\). |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeGRBModel1 | ( | const double | aFlux, |
| const double | aEnergy0, | ||
| const double | aAlpha, | ||
| const double | aBeta, | ||
| TGraph * | aArea = NULL |
||
| ) |
Makes a SpecTime object using a GRB model (I).
The particle flux energy dependency is modeled using BATSE Observations of Gamma-Ray Burst Spectra. I. Spectral Diversity as a reference:
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \left(\frac{E}{100\,\mathrm{keV}}\right)^\alpha \times \exp\left(-\frac{E}{E_0}\right), \; E < E_0~(\alpha-\beta), \]
and
\[ {\cal{F}}(E,t) = {\cal{F}}_0 \times \left(\frac{E_0(\alpha-\beta)}{100\,\mathrm{keV}}\right)^{(\alpha-\beta)} \times \left(\frac{E}{100\,\mathrm{keV}}\right)^\beta \times \exp(\beta-\alpha), \; E\geq E_0~(\alpha-\beta). \]
This model was constructed so that it and its derivative are continuous. The resulting flux is constant over the time range specified in the constructor and is null eslewhere.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Flux \({\cal{F}}_0\) value in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aEnergy0 | Energy transition, \(E_0\), in \([\mathrm{keV}]\). |
| [in] | aAlpha | Spectral index, \(\alpha\), at low energy. |
| [in] | aBeta | Spectral index, \(\beta\), at high energy. |
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeRate | ( | const double | aArea | ) |
Computes the rate given a constant integration area.
The flux must be set first (e.g. SetFlux()). The flux is assumed to be uniform over the area of interest. This area is considered to be independent of the energy (constant). The rate is then computed as:
\[ {\cal{R}}(E,t)=\frac{d^2N}{dtdE}(E,t)=\iint_S{\cal{F}}(E,t)dS=S\times {\cal{F}}(E,t). \]
| [in] | aArea | Area of interest \(S\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeRate | ( | TGraph * | aArea | ) |
Computes the rate given an integration area.
The flux must be set first (e.g. SetFlux()). The flux is assumed to be uniform over the area of interest. This area is provided as a TGraph object to include an energy dependency: x-axis = energy in \([\mathrm{keV}]\), y-axis = area in \([\mathrm{mm}^2]\). The rate is then computed as:
\[ {\cal{R}}(E,t)=\frac{d^2N}{dtdE}(E,t)=\iint_S{\cal{F}}(E,t)dS=S(E)\times {\cal{F}}(E,t). \]
The rate is set to 0, if the energy is not in the range of the TGraph. When within the range, a linear interpolation is performed to access the area at a given energy.
| [in] | aArea | Area of interest \(S(E)\) in \([\mathrm{mm}^2]\). |
| void SpecTime::MakeUniform | ( | const double | aFlux, |
| TGraph * | aArea = NULL |
||
| ) |
Makes a uniform flux SpecTime object.
The particle flux is constant over energies and times (in the limits declared in SpecTime()):
\[ {\cal{F}}(E,t) = {\cal{F}}_0. \]
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Constant flux \({\cal{F}}_0\) value in \([\mathrm{keV}^{-1}\mathrm{ms}^{-1}\mathrm{mm}^{-2}]\). |
| [in] | aArea | Area of interest in \([\mathrm{mm}^2]\). |
| void SpecTime::SetFlux | ( | TH2D * | aFlux, |
| TGraph * | aArea = NULL |
||
| ) |
Defines a new flux fonction.
The input flux histogram must comply with the definition of a Flux object. In particular, one must make sure to use correct Units units for all quantities.
Moreover, one must be careful with the parameters given in SpecTime(). The time and energy bins will not be modified. However the input time and energy bins will be resampled to match the resolution declared in SpecTime(). Upsampling and downsampling are supported.
Additionally, it is possible to provide an area of interest to compute the associated rate. The MakeRate() function is called at the end of this function.
| [in] | aFlux | Pointer to a valid TH2D object. It can be deleted after calling this function. |
| [in] | aArea | Pointer to a valid TGraph object to describe the area as a function of energy in \([\mathrm{mm}^2]\). |
|
inline |
Sets the photo-electric cross-section.
This is given as a TGraph as a function of energy \([keV]\). It is locally saved.
| [in] | aGraph | Pointer to a valid TGraph object to describe the photo-electric cross-section. The points are assumed to be sorted in energy. |
|
protected |
Source flux \({\cal{F}}(E,t)\).
|
protected |
Source flux \({\cal{F}}(E,t)\) after extinction.
|
private |
Photo-electric cross-section.
|
protected |
Random generator.
|
protected |
Source rate \({\cal{R}}(E,t)\).
|
private |
Cumulative rate (over \(E\)).