MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Spectrum.hxx
Go to the documentation of this file.
1 #ifndef _Spectrum_
2 #define _Spectrum_
3 
4 #include "MureHeaders.hxx"
5 using namespace std;
6 
12 
25 class Spectrum
26 {
27  public:
28 
30 
39  Spectrum(double Emin,double Emax,int NumberOfbins,bool log=false);
40 
42 
50  Spectrum(vector<double> LowerEnergy,bool check=true);
51 
53 
62  Spectrum(double* LowerEnergy,int NumberOfBins,bool check=true);
63 
65 
76  Spectrum(string BinningFileName,bool check=true);
77 
79 
90  Spectrum(int NumberOfBins,double a,double b,double c,bool check=true);
91 
92  Spectrum(const Spectrum &spect);
93  ~Spectrum();
94 
95  void SetZ(int Z){fZ=Z;}
96  void SetA(int A){fA=A;}
97  void SetName(string Name){fName=Name;}
98  void SetNumberOfbins(int nbins){fNumberOfbins=nbins;}
99  void SetBin(int i, double intensity) {fHistogram[i]=intensity;}
100  //void SetCalibration(double KeVbyChan){fEnergyCalibration=KeVbyChan;}//!< Set the calibration in keV per Channel
101 
102  int GetZ(){return fZ;}
103  int GetA(){return fA;}
104  string GetName(){return fName;}
105  double GetBin(int i) {return fHistogram[i];}
106  double *GetBin() {return fHistogram;}
107  double *GetLowerEnergy(){return fLowerEnergy;}
108  double GetLowerEnergy(int i) {return fLowerEnergy[i];}
109  //double GetCalibration() {return fEnergyCalibration;} //!< Return the kev by bins coefficient
110  double GetEnergyBinWidth(int i);
111  double GetMiddleEnergy(int i);
112  int GetBinNumber(double Energy);
113  int GetNumberOfbins() {return fNumberOfbins;}
114  bool IsLog(){return fIsLog;}
115  bool IsAlpha(){return fIsAlpha;}
116  bool IsNeutron(){return fIsNeutron;}
117  bool IsGamma(){return fIsGamma;}
118  bool IsBeta(){return fIsBeta;}
119  int GetParticleType();
120  bool GotTheSameBinning(Spectrum *aSpectrum);
121  bool IsEmpty();
122  bool IsTheSameSpectrum(Spectrum* SameOrNot);
123  void Initialize();
124  void CheckBin();
125  void AddEnergy(double Energy, double Intensity);
126  void Contract(int ContractionFactor);
127  double TotalActivity();
128 
135  void Fill(Material* material,double volume);
136  void FillFromFile(string filename);
137  void Dump(string filename="Spectrum.dat",bool WithEnergies=false);
138  void Normalize(double Multiplicateur);
139  void AddSpectrum(Spectrum* aSpectrum);
140  void RemoveSpectrum(Spectrum* aSpectrum);
141  Spectrum* NewSpectrumNormalized(Spectrum* UnNormalized,double Norm);
142  Spectrum* NewSpectrumNormalized2(Spectrum* UnNormalized,double Norm);
143  Spectrum* ConvertRayToGaussian(Spectrum* Spect_Raie,double FWHM);
144 
145  protected:
146  bool fIsLog;
148  double* fHistogram;
149  double* fLowerEnergy;
150  int fZ;
151  int fA;
152  string fName;
153  bool fIsAlpha;
154  bool fIsBeta;
155  bool fIsGamma;
156  bool fIsNeutron;
157  void ElementSymbol(int Zd,char& Z1,char& Z2);
158  void CreateBins(double EnergyMin,double EnergyMax, int NumberOfbins);
159  void CreateBins(vector<double> LowerEnergy);
160  void CreateBins(double* LowerEnergy );
161  bool IsDouble(const std::string& s);
162  void ReadENDSFFile(int Adaughter,vector <string> &Buffer, int &NumOfLine);
163  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
164 
165 };
166 #endif
bool IsAlpha()
True if the spectrum is an AlphaSpectrum.
Definition: Spectrum.hxx:115
bool IsBeta()
True if the spectrum is a BetaSpectrum.
Definition: Spectrum.hxx:118
bool IsGamma()
True if the spectrum is a GammaSpectrum.
Definition: Spectrum.hxx:117
void SetNumberOfbins(int nbins)
Set the number of bins.
Definition: Spectrum.hxx:98
int fZ
Z of the mother nucleus.
Definition: Spectrum.hxx:150
double * fHistogram
The histogram.
Definition: Spectrum.hxx:148
int GetA()
Return the A of the mother of the nuclei which emit Neutron.
Definition: Spectrum.hxx:103
int GetZ()
Return the Z of the mother of the nuclei which emit Neutron.
Definition: Spectrum.hxx:102
bool IsLog()
True if the binning is logaritmic.
Definition: Spectrum.hxx:114
bool fIsNeutron
true for neutron Spectrum
Definition: Spectrum.hxx:156
bool fIsBeta
true for Beta Spectrum
Definition: Spectrum.hxx:154
bool IsNeutron()
True if the spectrum is a NeutronSpectrum.
Definition: Spectrum.hxx:116
string GetName()
Return the NeutronSpectrum&#39;s isotope name.
Definition: Spectrum.hxx:104
string fName
isotope Name of the neutron spectrum
Definition: Spectrum.hxx:152
void SetName(string Name)
Set the NeutronSpectrum name.
Definition: Spectrum.hxx:97
bool fIsLog
true for Log bining
Definition: Spectrum.hxx:146
Base class to define spectra.
Definition: Spectrum.hxx:25
double * GetLowerEnergy()
Get the Energy vector.
Definition: Spectrum.hxx:107
double GetLowerEnergy(int i)
Return the lower energy bound of the bin i.
Definition: Spectrum.hxx:108
double * GetBin()
Get the Intensity vector.
Definition: Spectrum.hxx:106
double * fLowerEnergy
array of lower bounds of each bin (except the last value)
Definition: Spectrum.hxx:149
File including all headers.
void SetZ(int Z)
Set Z of the mother nucleus.
Definition: Spectrum.hxx:95
A Material constituing a Cell.
Definition: Material.hxx:53
int GetNumberOfbins()
Return the number of bins.
Definition: Spectrum.hxx:113
double GetBin(int i)
Return the Intensity at bin i.
Definition: Spectrum.hxx:105
bool fIsGamma
true for Gamma Spectrum
Definition: Spectrum.hxx:155
bool fIsAlpha
true for Alpha Spectrum
Definition: Spectrum.hxx:153
int fNumberOfbins
Total number of bins.
Definition: Spectrum.hxx:147
int fA
A of the mother nucleus.
Definition: Spectrum.hxx:151
void SetBin(int i, double intensity)
Set the intensity value of bin i.
Definition: Spectrum.hxx:99
void SetA(int A)
Set A of the mother nucleus.
Definition: Spectrum.hxx:96

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014