Base class to define spectra. More...
#include <Spectrum.hxx>
Public Member Functions | |
Spectrum (double Emin, double Emax, int NumberOfbins, bool log=false) | |
Standard Constructor of a Spectrum. More... | |
Spectrum (vector< double > LowerEnergy, bool check=true) | |
User input bining Constructor of a Spectrum. More... | |
Spectrum (double *LowerEnergy, int NumberOfBins, bool check=true) | |
User input bining Constructor of a Spectrum. More... | |
Spectrum (string BinningFileName, bool check=true) | |
File User input bining Constructor of a Spectrum. More... | |
Spectrum (int NumberOfBins, double a, double b, double c, bool check=true) | |
Constructor of a Spectrum with binning build with this calibration law : E(Lowerbin)=a*Lowerbin*Lowerbin + b*Lowerbin + c. More... | |
Spectrum (const Spectrum &spect) | |
Copy constructor. More... | |
~Spectrum () | |
destructor More... | |
void | SetZ (int Z) |
Set Z of the mother nucleus. More... | |
void | SetA (int A) |
Set A of the mother nucleus. More... | |
void | SetName (string Name) |
Set the NeutronSpectrum name. More... | |
void | SetNumberOfbins (int nbins) |
Set the number of bins. More... | |
void | SetBin (int i, double intensity) |
Set the intensity value of bin i. More... | |
int | GetZ () |
Return the Z of the mother of the nuclei which emit Neutron. More... | |
int | GetA () |
Return the A of the mother of the nuclei which emit Neutron. More... | |
string | GetName () |
Return the NeutronSpectrum's isotope name. More... | |
double | GetBin (int i) |
Return the Intensity at bin i. More... | |
double * | GetBin () |
Get the Intensity vector. More... | |
double * | GetLowerEnergy () |
Get the Energy vector. More... | |
double | GetLowerEnergy (int i) |
Return the lower energy bound of the bin i. More... | |
double | GetEnergyBinWidth (int i) |
Return the energy width of the bin i ie fLowerEnergy[i+1]-fLowerEnergy[i]. More... | |
double | GetMiddleEnergy (int i) |
Return the centered energy of the bin i. More... | |
int | GetBinNumber (double Energy) |
Return the Bin number corresponding on the Energy. More... | |
int | GetNumberOfbins () |
Return the number of bins. More... | |
bool | IsLog () |
True if the binning is logaritmic. More... | |
bool | IsAlpha () |
True if the spectrum is an AlphaSpectrum. More... | |
bool | IsNeutron () |
True if the spectrum is a NeutronSpectrum. More... | |
bool | IsGamma () |
True if the spectrum is a GammaSpectrum. More... | |
bool | IsBeta () |
True if the spectrum is a BetaSpectrum. More... | |
int | GetParticleType () |
get the particle type of this spectrum 1=n 2=g 3=e- More... | |
bool | GotTheSameBinning (Spectrum *aSpectrum) |
True if this and aSpectrum have the same energy binning. More... | |
bool | IsEmpty () |
True if all intensities are 0. More... | |
bool | IsTheSameSpectrum (Spectrum *SameOrNot) |
True if two spectra are completly identical. More... | |
void | Initialize () |
Set all Intensities to 0. More... | |
void | CheckBin () |
Check if Energy definition is correct (monotically increasing) More... | |
void | AddEnergy (double Energy, double Intensity) |
Add Intensity at the bin corresponding to Energy. More... | |
void | Contract (int ContractionFactor) |
Contract the Spectrum 's binning by a factor Contractionfactor. More... | |
double | TotalActivity () |
void | Fill (Material *material, double volume) |
Fill a Spectrum for a material. More... | |
void | FillFromFile (string filename) |
void | Dump (string filename="Spectrum.dat", bool WithEnergies=false) |
Dump the Neutron Spectrum histogram. More... | |
void | Normalize (double Multiplicateur) |
multiply Intensity by Multiplicateur More... | |
void | AddSpectrum (Spectrum *aSpectrum) |
Add aSpectrum to the current one. More... | |
void | RemoveSpectrum (Spectrum *aSpectrum) |
Remove aSpectrum to the current one. More... | |
Spectrum * | NewSpectrumNormalized (Spectrum *UnNormalized, double Norm) |
multiply a UnNormalized spectrum by Norm and put it in a new NeutronSpectrum More... | |
Spectrum * | NewSpectrumNormalized2 (Spectrum *UnNormalized, double Norm) |
presque pareil mais pas tout a fait (BBBBBUUUUUG) More... | |
Spectrum * | ConvertRayToGaussian (Spectrum *Spect_Raie, double FWHM) |
Convert a spectrum of discret rays in to several gaussian of the same Full width at half maximum (FWHM) More... | |
Protected Member Functions | |
void | ElementSymbol (int Zd, char &Z1, char &Z2) |
Convert the Z of a nucleus in its symbol. More... | |
void | CreateBins (double EnergyMin, double EnergyMax, int NumberOfbins) |
generates the bins More... | |
void | CreateBins (vector< double > LowerEnergy) |
generates the bins More... | |
void | CreateBins (double *LowerEnergy) |
generates the bins More... | |
bool | IsDouble (const std::string &s) |
true is a string can be converted in a double More... | |
void | ReadENDSFFile (int Adaughter, vector< string > &Buffer, int &NumOfLine) |
Read each line of the file and store them in buffer. More... | |
bool | FindFirstLinesOfDecayModeCard (vector< string > const &Buffer, char Z1, char Z2, vector< int > &BeginRecordLine, string DecayMode, string DecayModeBis="") |
Protected Attributes | |
bool | fIsLog |
true for Log bining More... | |
int | fNumberOfbins |
Total number of bins. More... | |
double * | fHistogram |
The histogram. More... | |
double * | fLowerEnergy |
array of lower bounds of each bin (except the last value) More... | |
int | fZ |
Z of the mother nucleus. More... | |
int | fA |
A of the mother nucleus. More... | |
string | fName |
isotope Name of the neutron spectrum More... | |
bool | fIsAlpha |
true for Alpha Spectrum More... | |
bool | fIsBeta |
true for Beta Spectrum More... | |
bool | fIsGamma |
true for Gamma Spectrum More... | |
bool | fIsNeutron |
true for neutron Spectrum More... | |
Base class to define spectra.
Spectra available are Gamma spectrum, alpha spectrum , Neutron Spectrum and Beta Spectrum
Spectrum::Spectrum | ( | double | Emin, |
double | Emax, | ||
int | NumberOfbins, | ||
bool | log = false |
||
) |
Standard Constructor of a Spectrum.
Emin | : Lower Energy bound of the Spectrum |
Emax | : Upper Energy bound of the Spectrum |
NumberOfbins | : Number of bins |
log | : true if logaritmic binning is wanted (default=false) |
This constructor creates the Energy binnig automatically. The binning is constant for linear bins and with constant log step for log binsNormal Constructor.
Spectrum::Spectrum | ( | vector< double > | LowerEnergy, |
bool | check = true |
||
) |
User input bining Constructor of a Spectrum.
LowerEnergy | : Lower energy bounds of each bin vector + upper energy bound of the last bin. |
check | : if true verify that bins are ordered |
Usefull for non constant binning. Energy range of bin number i is :fLowerEnergy[i] <= Energy < fLowerEnergy[i+1]
Spectrum::Spectrum | ( | double * | LowerEnergy, |
int | NumberOfBins, | ||
bool | check = true |
||
) |
User input bining Constructor of a Spectrum.
LowerEnergy | : Lower energy bounds of each bin array + upper energy bound of the last bin. |
NumberOfBins | : Number of Lower energy bounds of each bin (the LowerEnergy array dim is thus NumberOfBins+1 |
check | : if true verify that bins are ordered |
Usefull for non constant binning. Energy range of bin number i is :fLowerEnergy[i] <= Energy < fLowerEnergy[i+1]Make your own binning.
Spectrum::Spectrum | ( | string | BinningFileName, |
bool | check = true |
||
) |
File User input bining Constructor of a Spectrum.
BinningFileName | : The binning file name containing the lower eenrgy bounds of bins. |
check | : if true verify that bins are ordered |
Usefull for non constant binning. The file must start with N, the number of bins. Then, follow the lower bounds of each bins (N real values) and then the upper bound of the last energy bin (the (N+1) value). Thus the file must contains N+2 line for N lower bin bounds.
Spectrum::Spectrum | ( | int | NumberOfBins, |
double | a, | ||
double | b, | ||
double | c, | ||
bool | check = true |
||
) |
Constructor of a Spectrum with binning build with this calibration law : E(Lowerbin)=a*Lowerbin*Lowerbin + b*Lowerbin + c.
NumberOfBins | : Number of Lower energy bounds of each bin (the LowerEnergy array dim is thus NumberOfBins+1 |
a | : first coefficient of the calibration law (eV) |
b | : second coefficient of the calibration law (eV) |
c | : third coefficient of the calibration law (eV) |
check | : if true verify that bins are ordered |
Usefull for experimental spectra
Spectrum::Spectrum | ( | const Spectrum & | spect | ) |
Copy constructor.
Spectrum::~Spectrum | ( | ) |
destructor
void Spectrum::AddEnergy | ( | double | Energy, |
double | Intensity | ||
) |
Add Intensity at the bin corresponding to Energy.
void Spectrum::AddSpectrum | ( | Spectrum * | aSpectrum | ) |
Add aSpectrum to the current one.
void Spectrum::CheckBin | ( | ) |
Check if Energy definition is correct (monotically increasing)
void Spectrum::Contract | ( | int | ContractionFactor | ) |
Contract the Spectrum 's binning by a factor Contractionfactor.
Convert a spectrum of discret rays in to several gaussian of the same Full width at half maximum (FWHM)
|
protected |
generates the bins
|
protected |
generates the bins
|
protected |
generates the bins
void Spectrum::Dump | ( | string | filename = "Spectrum.dat" , |
bool | WithEnergies = false |
||
) |
Dump the Neutron Spectrum histogram.
|
protected |
Convert the Z of a nucleus in its symbol.
void Spectrum::Fill | ( | Material * | material, |
double | volume | ||
) |
void Spectrum::FillFromFile | ( | string | filename | ) |
|
protected |
|
inline |
Return the A of the mother of the nuclei which emit Neutron.
|
inline |
Return the Intensity at bin i.
|
inline |
Get the Intensity vector.
int Spectrum::GetBinNumber | ( | double | Energy | ) |
Return the Bin number corresponding on the Energy.
double Spectrum::GetEnergyBinWidth | ( | int | i | ) |
Return the energy width of the bin i ie fLowerEnergy[i+1]-fLowerEnergy[i].
|
inline |
Get the Energy vector.
|
inline |
Return the lower energy bound of the bin i.
double Spectrum::GetMiddleEnergy | ( | int | i | ) |
Return the centered energy of the bin i.
|
inline |
Return the NeutronSpectrum's isotope name.
|
inline |
Return the number of bins.
int Spectrum::GetParticleType | ( | ) |
get the particle type of this spectrum 1=n 2=g 3=e-
|
inline |
Return the Z of the mother of the nuclei which emit Neutron.
bool Spectrum::GotTheSameBinning | ( | Spectrum * | aSpectrum | ) |
True if this and aSpectrum have the same energy binning.
void Spectrum::Initialize | ( | ) |
Set all Intensities to 0.
|
inline |
True if the spectrum is an AlphaSpectrum.
|
inline |
True if the spectrum is a BetaSpectrum.
|
protected |
true is a string can be converted in a double
bool Spectrum::IsEmpty | ( | ) |
True if all intensities are 0.
|
inline |
True if the spectrum is a GammaSpectrum.
|
inline |
True if the binning is logaritmic.
|
inline |
True if the spectrum is a NeutronSpectrum.
bool Spectrum::IsTheSameSpectrum | ( | Spectrum * | SameOrNot | ) |
True if two spectra are completly identical.
multiply a UnNormalized spectrum by Norm and put it in a new NeutronSpectrum
presque pareil mais pas tout a fait (BBBBBUUUUUG)
void Spectrum::Normalize | ( | double | Multiplicateur | ) |
multiply Intensity by Multiplicateur
|
protected |
Read each line of the file and store them in buffer.
void Spectrum::RemoveSpectrum | ( | Spectrum * | aSpectrum | ) |
Remove aSpectrum to the current one.
|
inline |
Set A of the mother nucleus.
|
inline |
Set the intensity value of bin i.
|
inline |
Set the NeutronSpectrum name.
|
inline |
Set the number of bins.
|
inline |
Set Z of the mother nucleus.
double Spectrum::TotalActivity | ( | ) |
Sum of particules emmited at all energies
|
protected |
A of the mother nucleus.
|
protected |
The histogram.
|
protected |
true for Alpha Spectrum
|
protected |
true for Beta Spectrum
|
protected |
true for Gamma Spectrum
|
protected |
true for Log bining
|
protected |
true for neutron Spectrum
|
protected |
array of lower bounds of each bin (except the last value)
|
protected |
isotope Name of the neutron spectrum
|
protected |
Total number of bins.
|
protected |
Z of the mother nucleus.