MURE
Loading...
Searching...
No Matches
Spectrum.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _Spectrum_
20#define _Spectrum_
21
22#include <string>
23#include <iosfwd>
24#include <vector>
25
26using namespace std;
27#include "Material.hxx"
28
29class Material;
30
37
50{
51 public:
52
54
63 Spectrum(double Emin, double Emax, int NumberOfbins, bool log = false);
64
66
74 Spectrum(vector<double> LowerEnergy, bool check = true);
75
77
86 Spectrum(double *LowerEnergy, int NumberOfBins, bool check = true);
87
89
99 Spectrum(string BinningFileName, bool check = true);
100
102
113 Spectrum(int NumberOfBins, double a, double b, double c, bool check = true);
114
115 Spectrum(const Spectrum &spect);
116 ~Spectrum();
117
118 void SetZ(int Z)
119 {
120 fZ = Z;
121 }
122 void SetA(int A)
123 {
124 fA = A;
125 }
126 void SetName(string Name)
127 {
128 fName = Name;
129 }
130 void SetNumberOfbins(int nbins)
131 {
132 fNumberOfbins = nbins;
133 }
134 void SetBin(int i, double intensity)
135 {
136 fHistogram[i] = intensity;
137 }
138 //void SetCalibration(double KeVbyChan){fEnergyCalibration=KeVbyChan;}//!< Set the calibration in keV per Channel
139
140 int GetZ()
141 {
142 return fZ;
143 }
144 int GetA()
145 {
146 return fA;
147 }
148 string GetName()
149 {
150 return fName;
151 }
152 double GetBin(int i)
153 {
154 return fHistogram[i];
155 }
156 double *GetBin()
157 {
158 return fHistogram;
159 }
161 {
162 return fLowerEnergy;
163 }
164 double GetLowerEnergy(int i)
165 {
166 return fLowerEnergy[i];
167 }
168 //double GetCalibration() {return fEnergyCalibration;} //!< Return the kev by bins coefficient
169 double GetEnergyBinWidth(int i);
170 double GetMiddleEnergy(int i);
171 int GetBinNumber(double Energy);
173 {
174 return fNumberOfbins;
175 }
176 bool IsLog()
177 {
178 return fIsLog;
179 }
180 bool IsAlpha()
181 {
182 return fIsAlpha;
183 }
185 {
186 return fIsNeutron;
187 }
188 bool IsGamma()
189 {
190 return fIsGamma;
191 }
192 bool IsBeta()
193 {
194 return fIsBeta;
195 }
196 int GetParticleType();
197 bool GotTheSameBinning(Spectrum *aSpectrum);
198 bool IsEmpty();
199 bool IsTheSameSpectrum(Spectrum *SameOrNot);
200 void Initialize();
201 void CheckBin();
202 void AddEnergy(double Energy, double Intensity);
203 void Contract(int ContractionFactor);
204 double TotalActivity();
206 {
208 };
210 {
211 return fTotalBecquerel;
212 };
214
220 void Fill(Material *material, double volume);
221 void FillFromFile(string filename);
222 void Dump(string filename = "Spectrum.dat", bool WithEnergies = false);
223 void Normalize(double Multiplicateur);
224 void AddSpectrum(Spectrum *aSpectrum);
225 void RemoveSpectrum(Spectrum *aSpectrum);
226 Spectrum *NewSpectrumNormalized(Spectrum *UnNormalized, double Norm);
227 Spectrum *NewSpectrumNormalized2(Spectrum *UnNormalized, double Norm);
228 Spectrum *ConvertRayToGaussian(Spectrum *Spect_Raie, double FWHM);
229
230 protected:
231 bool fIsLog;
233 double *fHistogram;
234 double *fLowerEnergy;
238 int fZ;
239 int fA;
240 string fName;
241 bool fIsAlpha;
242 bool fIsBeta;
243 bool fIsGamma;
245 void ElementSymbol(int Zd, char &Z1, char &Z2);
246 void CreateBins(double EnergyMin, double EnergyMax, int NumberOfbins);
247 void CreateBins(vector<double> LowerEnergy);
248 void CreateBins(double *LowerEnergy);
249 bool IsDouble(const std::string &s);
250 void ReadENSDFFile(int Adaughter, vector <string> &Buffer, int &NumOfLine);
251 bool FindFirstLinesOfDecayModeCard(vector<string> const &Buffer, char Z1, char Z2, vector<int> &BeginRecordLine, string DecayMode, string DecayModeBis = ""); //<!Find the first lines of ensdf decay mode cards
252
253};
254#endif
Header file for Material class.
A Material constituing a Cell.
Definition Material.hxx:83
Base class to define spectra.
Definition Spectrum.hxx:50
double GetMiddleEnergy(int i)
Return the centered energy of the bin i.
Definition Spectrum.cxx:291
int GetBinNumber(double Energy)
Return the Bin number corresponding on the Energy.
Definition Spectrum.cxx:310
Spectrum * NewSpectrumNormalized(Spectrum *UnNormalized, double Norm)
multiply a UnNormalized spectrum by Norm and put it in a new NeutronSpectrum
Definition Spectrum.cxx:511
double GetTotalBecquerel()
Definition Spectrum.hxx:209
double GetBin(int i)
Definition Spectrum.hxx:152
bool IsTheSameSpectrum(Spectrum *SameOrNot)
True if two spectra are completly identical.
Definition Spectrum.cxx:701
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 (FWH...
Definition Spectrum.cxx:750
void AddSpectrum(Spectrum *aSpectrum)
Add aSpectrum to the current one.
Definition Spectrum.cxx:445
void SetBin(int i, double intensity)
Definition Spectrum.hxx:134
bool IsGamma()
Definition Spectrum.hxx:188
void SetName(string Name)
Definition Spectrum.hxx:126
void Contract(int ContractionFactor)
Contract the Spectrum 's binning by a factor Contractionfactor.
bool IsNeutron()
Definition Spectrum.hxx:184
string fName
isotope Name of the neutron spectrum
Definition Spectrum.hxx:240
int GetA()
Definition Spectrum.hxx:144
bool fIsGamma
true for Gamma Spectrum
Definition Spectrum.hxx:243
double fTotalParticlesEmitted
Definition Spectrum.hxx:235
void RemoveSpectrum(Spectrum *aSpectrum)
Remove aSpectrum to the current one.
Definition Spectrum.cxx:463
bool fIsBeta
true for Beta Spectrum
Definition Spectrum.hxx:242
int GetZ()
Definition Spectrum.hxx:140
bool IsDouble(const std::string &s)
true is a string can be converted in a double
Definition Spectrum.cxx:611
string GetName()
Definition Spectrum.hxx:148
void SetNumberOfbins(int nbins)
Definition Spectrum.hxx:130
void Dump(string filename="Spectrum.dat", bool WithEnergies=false)
Dump the Neutron Spectrum histogram.
Definition Spectrum.cxx:552
int fNumberOfbins
Total number of bins.
Definition Spectrum.hxx:232
double GetLowerEnergy(int i)
Definition Spectrum.hxx:164
bool IsEmpty()
True if all intensities are 0.
Definition Spectrum.cxx:414
void Initialize()
Set all Intensities to 0.
Definition Spectrum.cxx:222
bool IsLog()
Definition Spectrum.hxx:176
int GetParticleType()
get the particle type of this spectrum 1=n 2=g 3=e-
Definition Spectrum.cxx:529
bool fIsAlpha
true for Alpha Spectrum
Definition Spectrum.hxx:241
void FillFromFile(string filename)
Definition Spectrum.cxx:728
void Fill(Material *material, double volume)
Fill a Spectrum for a material.
Definition Spectrum.cxx:356
double * GetLowerEnergy()
Definition Spectrum.hxx:160
bool FindFirstLinesOfDecayModeCard(vector< string > const &Buffer, char Z1, char Z2, vector< int > &BeginRecordLine, string DecayMode, string DecayModeBis="")
Definition Spectrum.cxx:663
int fZ
Z of the mother nucleus.
Definition Spectrum.hxx:238
double GetEnergyBinWidth(int i)
Return the energy width of the bin i ie fLowerEnergy[i+1]-fLowerEnergy[i].
Definition Spectrum.cxx:346
void ReadENSDFFile(int Adaughter, vector< string > &Buffer, int &NumOfLine)
Read each line of the file and store them in buffer.
Definition Spectrum.cxx:618
double fTotalNumberOfParticlesPerDecay
Definition Spectrum.hxx:236
void CheckBin()
Check if Energy definition is correct (monotically increasing)
Definition Spectrum.cxx:271
int GetNumberOfbins()
Definition Spectrum.hxx:172
bool fIsLog
true for Log bining
Definition Spectrum.hxx:231
void ElementSymbol(int Zd, char &Z1, char &Z2)
Convert the Z of a nucleus in its symbol.
Definition Spectrum.cxx:593
void SetA(int A)
Definition Spectrum.hxx:122
double * fLowerEnergy
array of lower bounds of each bin (except the last value)
Definition Spectrum.hxx:234
bool fIsNeutron
true for neutron Spectrum
Definition Spectrum.hxx:244
void CreateBins(double EnergyMin, double EnergyMax, int NumberOfbins)
generates the bins
Definition Spectrum.cxx:246
bool IsAlpha()
Definition Spectrum.hxx:180
double * fHistogram
The histogram.
Definition Spectrum.hxx:233
void AddEnergy(double Energy, double Intensity)
Add Intensity at the bin corresponding to Energy.
Definition Spectrum.cxx:280
bool GotTheSameBinning(Spectrum *aSpectrum)
True if this and aSpectrum have the same energy binning.
Definition Spectrum.cxx:426
bool IsBeta()
Definition Spectrum.hxx:192
double TotalActivity()
Sum of particules emmited at all energies.
Definition Spectrum.cxx:796
~Spectrum()
destructor
Definition Spectrum.cxx:216
double * GetBin()
Definition Spectrum.hxx:156
void Normalize(double Multiplicateur)
multiply Intensity by Multiplicateur
Definition Spectrum.cxx:481
Spectrum * NewSpectrumNormalized2(Spectrum *UnNormalized, double Norm)
presque pareil mais pas tout a fait (BBBBBUUUUUG)
Definition Spectrum.cxx:494
int fA
A of the mother nucleus.
Definition Spectrum.hxx:239
double fTotalBecquerel
Definition Spectrum.hxx:237
double GetTotalNumberOfParticlesPerDecay()
Definition Spectrum.hxx:205
void SetZ(int Z)
Definition Spectrum.hxx:118
the namespace of the Standard C++

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