MURE
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Spectrum Class Reference

Base class to define spectra. More...

#include <Spectrum.hxx>

Inheritance diagram for Spectrum:
AlphaSpectrum BetaSpectrum GammaSpectrum NeutronSpectrum

Public Member Functions

 Spectrum (double Emin, double Emax, int NumberOfbins, bool log=false)
 Standard Constructor of a Spectrum.
 
 Spectrum (vector< double > LowerEnergy, bool check=true)
 User input bining Constructor of a Spectrum.
 
 Spectrum (double *LowerEnergy, int NumberOfBins, bool check=true)
 User input bining Constructor of a Spectrum.
 
 Spectrum (string BinningFileName, bool check=true)
 File User input bining Constructor of a 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.
 
 Spectrum (const Spectrum &spect)
 Copy constructor.
 
 ~Spectrum ()
 destructor
 
void SetZ (int Z)
 
void SetA (int A)
 
void SetName (string Name)
 
void SetNumberOfbins (int nbins)
 
void SetBin (int i, double intensity)
 
int GetZ ()
 
int GetA ()
 
string GetName ()
 
double GetBin (int i)
 
double * GetBin ()
 
double * GetLowerEnergy ()
 
double GetLowerEnergy (int i)
 
double GetEnergyBinWidth (int i)
 Return the energy width of the bin i ie fLowerEnergy[i+1]-fLowerEnergy[i].
 
double GetMiddleEnergy (int i)
 Return the centered energy of the bin i.
 
int GetBinNumber (double Energy)
 Return the Bin number corresponding on the Energy.
 
int GetNumberOfbins ()
 
bool IsLog ()
 
bool IsAlpha ()
 
bool IsNeutron ()
 
bool IsGamma ()
 
bool IsBeta ()
 
int GetParticleType ()
 get the particle type of this spectrum 1=n 2=g 3=e-
 
bool GotTheSameBinning (Spectrum *aSpectrum)
 True if this and aSpectrum have the same energy binning.
 
bool IsEmpty ()
 True if all intensities are 0.
 
bool IsTheSameSpectrum (Spectrum *SameOrNot)
 True if two spectra are completly identical.
 
void Initialize ()
 Set all Intensities to 0.
 
void CheckBin ()
 Check if Energy definition is correct (monotically increasing)
 
void AddEnergy (double Energy, double Intensity)
 Add Intensity at the bin corresponding to Energy.
 
void Contract (int ContractionFactor)
 Contract the Spectrum 's binning by a factor Contractionfactor.
 
double TotalActivity ()
 Sum of particules emmited at all energies.
 
double GetTotalNumberOfParticlesPerDecay ()
 
double GetTotalBecquerel ()
 
void Fill (Material *material, double volume)
 Fill a Spectrum for a material.
 
void FillFromFile (string filename)
 
void Dump (string filename="Spectrum.dat", bool WithEnergies=false)
 Dump the Neutron Spectrum histogram.
 
void Normalize (double Multiplicateur)
 multiply Intensity by Multiplicateur
 
void AddSpectrum (Spectrum *aSpectrum)
 Add aSpectrum to the current one.
 
void RemoveSpectrum (Spectrum *aSpectrum)
 Remove aSpectrum to the current one.
 
SpectrumNewSpectrumNormalized (Spectrum *UnNormalized, double Norm)
 multiply a UnNormalized spectrum by Norm and put it in a new NeutronSpectrum
 
SpectrumNewSpectrumNormalized2 (Spectrum *UnNormalized, double Norm)
 presque pareil mais pas tout a fait (BBBBBUUUUUG)
 
SpectrumConvertRayToGaussian (Spectrum *Spect_Raie, double FWHM)
 Convert a spectrum of discret rays in to several gaussian of the same Full width at half maximum (FWHM)
 

Protected Member Functions

void ElementSymbol (int Zd, char &Z1, char &Z2)
 Convert the Z of a nucleus in its symbol.
 
void CreateBins (double EnergyMin, double EnergyMax, int NumberOfbins)
 generates the bins
 
void CreateBins (vector< double > LowerEnergy)
 generates the bins
 
void CreateBins (double *LowerEnergy)
 generates the bins
 
bool IsDouble (const std::string &s)
 true is a string can be converted in a double
 
void ReadENSDFFile (int Adaughter, vector< string > &Buffer, int &NumOfLine)
 Read each line of the file and store them in buffer.
 
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
 
int fNumberOfbins
 Total number of bins.
 
double * fHistogram
 The histogram.
 
double * fLowerEnergy
 array of lower bounds of each bin (except the last value)
 
double fTotalParticlesEmitted
 
double fTotalNumberOfParticlesPerDecay
 
double fTotalBecquerel
 
int fZ
 Z of the mother nucleus.
 
int fA
 A of the mother nucleus.
 
string fName
 isotope Name of the neutron spectrum
 
bool fIsAlpha
 true for Alpha Spectrum
 
bool fIsBeta
 true for Beta Spectrum
 
bool fIsGamma
 true for Gamma Spectrum
 
bool fIsNeutron
 true for neutron Spectrum
 

Detailed Description

Base class to define spectra.

Spectra available are Gamma spectrum, alpha spectrum , Neutron Spectrum and Beta Spectrum

See also
GammaSpectrum
AlphaSpectrum
BetaSpectrum
NeutronSpectrum
Author
BLG
Version
1.0

Constructor & Destructor Documentation

◆ Spectrum() [1/6]

Spectrum::Spectrum ( double  Emin,
double  Emax,
int  NumberOfbins,
bool  log = false 
)

Standard Constructor of a Spectrum.

Parameters
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 bins Normal Constructor.

◆ Spectrum() [2/6]

Spectrum::Spectrum ( vector< double >  LowerEnergy,
bool  check = true 
)

User input bining Constructor of a Spectrum.

Parameters
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() [3/6]

Spectrum::Spectrum ( double *  LowerEnergy,
int  NumberOfBins,
bool  check = true 
)

User input bining Constructor of a Spectrum.

Parameters
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() [4/6]

Spectrum::Spectrum ( string  BinningFileName,
bool  check = true 
)

File User input bining Constructor of a Spectrum.

Parameters
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() [5/6]

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.

Parameters
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() [6/6]

Spectrum::Spectrum ( const Spectrum spect)

Copy constructor.

◆ ~Spectrum()

Spectrum::~Spectrum ( )

destructor

Member Function Documentation

◆ AddEnergy()

void Spectrum::AddEnergy ( double  Energy,
double  Intensity 
)

Add Intensity at the bin corresponding to Energy.

◆ AddSpectrum()

void Spectrum::AddSpectrum ( Spectrum aSpectrum)

Add aSpectrum to the current one.

◆ CheckBin()

void Spectrum::CheckBin ( )

Check if Energy definition is correct (monotically increasing)

◆ Contract()

void Spectrum::Contract ( int  ContractionFactor)

Contract the Spectrum 's binning by a factor Contractionfactor.

◆ ConvertRayToGaussian()

Spectrum * 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)

◆ CreateBins() [1/3]

void Spectrum::CreateBins ( double *  LowerEnergy)
protected

generates the bins

◆ CreateBins() [2/3]

void Spectrum::CreateBins ( double  EnergyMin,
double  EnergyMax,
int  NumberOfbins 
)
protected

generates the bins

◆ CreateBins() [3/3]

void Spectrum::CreateBins ( vector< double >  LowerEnergy)
protected

generates the bins

◆ Dump()

void Spectrum::Dump ( string  filename = "Spectrum.dat",
bool  WithEnergies = false 
)

Dump the Neutron Spectrum histogram.

◆ ElementSymbol()

void Spectrum::ElementSymbol ( int  Zd,
char &  Z1,
char &  Z2 
)
protected

Convert the Z of a nucleus in its symbol.

◆ Fill()

void Spectrum::Fill ( Material material,
double  volume 
)

Fill a Spectrum for a material.

Parameters
material: the Material used to fill the Spectrum.
volume: the volume of the sample containing the material

◆ FillFromFile()

void Spectrum::FillFromFile ( string  filename)

◆ FindFirstLinesOfDecayModeCard()

bool Spectrum::FindFirstLinesOfDecayModeCard ( vector< string > const &  Buffer,
char  Z1,
char  Z2,
vector< int > &  BeginRecordLine,
string  DecayMode,
string  DecayModeBis = "" 
)
protected

◆ GetA()

int Spectrum::GetA ( )
inline

< Return the A of the mother of the nuclei which emit Neutron

◆ GetBin() [1/2]

double * Spectrum::GetBin ( )
inline

<Get the Intensity vector

◆ GetBin() [2/2]

double Spectrum::GetBin ( int  i)
inline

< Return the Intensity at bin i

◆ GetBinNumber()

int Spectrum::GetBinNumber ( double  Energy)

Return the Bin number corresponding on the Energy.

◆ GetEnergyBinWidth()

double Spectrum::GetEnergyBinWidth ( int  i)

Return the energy width of the bin i ie fLowerEnergy[i+1]-fLowerEnergy[i].

◆ GetLowerEnergy() [1/2]

double * Spectrum::GetLowerEnergy ( )
inline

<Get the Energy vector

◆ GetLowerEnergy() [2/2]

double Spectrum::GetLowerEnergy ( int  i)
inline

< Return the lower energy bound of the bin i

◆ GetMiddleEnergy()

double Spectrum::GetMiddleEnergy ( int  i)

Return the centered energy of the bin i.

◆ GetName()

string Spectrum::GetName ( )
inline

< Return the NeutronSpectrum's isotope name

◆ GetNumberOfbins()

int Spectrum::GetNumberOfbins ( )
inline

< Return the number of bins

◆ GetParticleType()

int Spectrum::GetParticleType ( )

get the particle type of this spectrum 1=n 2=g 3=e-

◆ GetTotalBecquerel()

double Spectrum::GetTotalBecquerel ( )
inline

◆ GetTotalNumberOfParticlesPerDecay()

double Spectrum::GetTotalNumberOfParticlesPerDecay ( )
inline

◆ GetZ()

int Spectrum::GetZ ( )
inline

< Return the Z of the mother of the nuclei which emit Neutron

◆ GotTheSameBinning()

bool Spectrum::GotTheSameBinning ( Spectrum aSpectrum)

True if this and aSpectrum have the same energy binning.

◆ Initialize()

void Spectrum::Initialize ( )

Set all Intensities to 0.

◆ IsAlpha()

bool Spectrum::IsAlpha ( )
inline

< True if the spectrum is an AlphaSpectrum

◆ IsBeta()

bool Spectrum::IsBeta ( )
inline

< True if the spectrum is a BetaSpectrum

◆ IsDouble()

bool Spectrum::IsDouble ( const std::string &  s)
protected

true is a string can be converted in a double

◆ IsEmpty()

bool Spectrum::IsEmpty ( )

True if all intensities are 0.

◆ IsGamma()

bool Spectrum::IsGamma ( )
inline

< True if the spectrum is a GammaSpectrum

◆ IsLog()

bool Spectrum::IsLog ( )
inline

< True if the binning is logaritmic

◆ IsNeutron()

bool Spectrum::IsNeutron ( )
inline

< True if the spectrum is a NeutronSpectrum

◆ IsTheSameSpectrum()

bool Spectrum::IsTheSameSpectrum ( Spectrum SameOrNot)

True if two spectra are completly identical.

◆ NewSpectrumNormalized()

Spectrum * Spectrum::NewSpectrumNormalized ( Spectrum UnNormalized,
double  Norm 
)

multiply a UnNormalized spectrum by Norm and put it in a new NeutronSpectrum

◆ NewSpectrumNormalized2()

Spectrum * Spectrum::NewSpectrumNormalized2 ( Spectrum UnNormalized,
double  Norm 
)

presque pareil mais pas tout a fait (BBBBBUUUUUG)

◆ Normalize()

void Spectrum::Normalize ( double  Multiplicateur)

multiply Intensity by Multiplicateur

◆ ReadENSDFFile()

void Spectrum::ReadENSDFFile ( int  Adaughter,
vector< string > &  Buffer,
int &  NumOfLine 
)
protected

Read each line of the file and store them in buffer.

◆ RemoveSpectrum()

void Spectrum::RemoveSpectrum ( Spectrum aSpectrum)

Remove aSpectrum to the current one.

◆ SetA()

void Spectrum::SetA ( int  A)
inline

< Set A of the mother nucleus

◆ SetBin()

void Spectrum::SetBin ( int  i,
double  intensity 
)
inline

< Set the intensity value of bin i

◆ SetName()

void Spectrum::SetName ( string  Name)
inline

< Set the NeutronSpectrum name

◆ SetNumberOfbins()

void Spectrum::SetNumberOfbins ( int  nbins)
inline

< Set the number of bins

◆ SetZ()

void Spectrum::SetZ ( int  Z)
inline

< Set Z of the mother nucleus

◆ TotalActivity()

double Spectrum::TotalActivity ( )

Sum of particules emmited at all energies.

Member Data Documentation

◆ fA

int Spectrum::fA
protected

A of the mother nucleus.

◆ fHistogram

double* Spectrum::fHistogram
protected

The histogram.

◆ fIsAlpha

bool Spectrum::fIsAlpha
protected

true for Alpha Spectrum

◆ fIsBeta

bool Spectrum::fIsBeta
protected

true for Beta Spectrum

◆ fIsGamma

bool Spectrum::fIsGamma
protected

true for Gamma Spectrum

◆ fIsLog

bool Spectrum::fIsLog
protected

true for Log bining

◆ fIsNeutron

bool Spectrum::fIsNeutron
protected

true for neutron Spectrum

◆ fLowerEnergy

double* Spectrum::fLowerEnergy
protected

array of lower bounds of each bin (except the last value)

◆ fName

string Spectrum::fName
protected

isotope Name of the neutron spectrum

◆ fNumberOfbins

int Spectrum::fNumberOfbins
protected

Total number of bins.

◆ fTotalBecquerel

double Spectrum::fTotalBecquerel
protected

◆ fTotalNumberOfParticlesPerDecay

double Spectrum::fTotalNumberOfParticlesPerDecay
protected

◆ fTotalParticlesEmitted

double Spectrum::fTotalParticlesEmitted
protected

◆ fZ

int Spectrum::fZ
protected

Z of the mother nucleus.


The documentation for this class was generated from the following files:

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024