GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSLogEnergyTable.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_PHYSICS_GGEMSLOGENERGYTABLE_HH
2 #define GUARD_GGEMS_PHYSICS_GGEMSLOGENERGYTABLE_HH
3 
4 // ************************************************************************
5 // * This file is part of GGEMS. *
6 // * *
7 // * GGEMS is free software: you can redistribute it and/or modify *
8 // * it under the terms of the GNU General Public License as published by *
9 // * the Free Software Foundation, either version 3 of the License, or *
10 // * (at your option) any later version. *
11 // * *
12 // * GGEMS is distributed in the hope that it will be useful, *
13 // * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 // * GNU General Public License for more details. *
16 // * *
17 // * You should have received a copy of the GNU General Public License *
18 // * along with GGEMS. If not, see <https://www.gnu.org/licenses/>. *
19 // * *
20 // ************************************************************************
21 
34 #ifdef _MSC_VER
35 #pragma warning(disable: 4251) // Deleting warning exporting STL members!!!
36 #endif
37 
38 #if __GNUC__ >= 6
39 #pragma GCC diagnostic ignored "-Wignored-attributes"
40 #endif
41 
42 #include <vector>
43 
44 #include "GGEMS/global/GGEMSExport.hh"
46 
51 class GGEMS_EXPORT GGEMSLogEnergyTable
52 {
53  public:
60  GGEMSLogEnergyTable(GGfloat const& lowest_energy, GGfloat const& highest_energy, GGsize const& number_of_bins);
61 
65  ~GGEMSLogEnergyTable(void);
66 
72  GGEMSLogEnergyTable(GGEMSLogEnergyTable const& log_energy_table) = delete;
73 
79  GGEMSLogEnergyTable& operator=(GGEMSLogEnergyTable const& log_energy_table) = delete;
80 
86  GGEMSLogEnergyTable(GGEMSLogEnergyTable const&& log_energy_table) = delete;
87 
93  GGEMSLogEnergyTable& operator=(GGEMSLogEnergyTable const&& log_energy_table) = delete;
94 
101  void SetValue(GGsize const& index, GGfloat const& value);
102 
109  inline GGfloat GetEnergy(GGsize const& index) const {return bins_.at(index);}
110 
117  inline GGfloat GetLossTableData(GGsize const& index) const {return loss_table_data_.at(index);}
118 
125  inline GGfloat GetLowEdgeEnergy(GGsize const& index) const {return bins_.at(index);}
126 
133  GGfloat GetLossTableValue(GGfloat const& energy) const;
134 
135  private:
142  GGsize FindBinLocation(GGfloat const& energy) const;
143 
151  GGsize FindBin(GGfloat const& energy, GGsize const& index) const;
152 
153  private:
157  std::vector<GGfloat> loss_table_data_;
158  std::vector<GGfloat> bins_;
161 };
162 
163 #endif // GUARD_GGEMS_PHYSICS_GGEMSLOGENERGYTABLE_HH
GGEMSLogEnergyTable::operator=
GGEMSLogEnergyTable & operator=(GGEMSLogEnergyTable const &log_energy_table)=delete
Avoid assignement by reference.
GGEMSLogEnergyTable::loss_table_data_
std::vector< GGfloat > loss_table_data_
Definition: GGEMSLogEnergyTable.hh:157
GGEMSLogEnergyTable::GetLowEdgeEnergy
GGfloat GetLowEdgeEnergy(GGsize const &index) const
get the energy at the bin index similar to GGEMSLogEnergyTable::GetEnergy
Definition: GGEMSLogEnergyTable.hh:125
GGEMSLogEnergyTable::bins_
std::vector< GGfloat > bins_
Definition: GGEMSLogEnergyTable.hh:158
GGEMSLogEnergyTable::GetLossTableData
GGfloat GetLossTableData(GGsize const &index) const
get the loss table data value at the bin index
Definition: GGEMSLogEnergyTable.hh:117
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSLogEnergyTable::edge_min_
GGfloat edge_min_
Definition: GGEMSLogEnergyTable.hh:154
GGEMSLogEnergyTable::base_bin_
GGfloat base_bin_
Definition: GGEMSLogEnergyTable.hh:160
GGEMSLogEnergyTable::edge_max_
GGfloat edge_max_
Definition: GGEMSLogEnergyTable.hh:155
GGEMSTypes.hh
Redefining types for OpenCL device and host.
GGEMSLogEnergyTable::operator=
GGEMSLogEnergyTable & operator=(GGEMSLogEnergyTable const &&log_energy_table)=delete
Avoid copy by rvalue reference.
GGEMSLogEnergyTable::GGEMSLogEnergyTable
GGEMSLogEnergyTable(GGEMSLogEnergyTable const &&log_energy_table)=delete
Avoid copy by rvalue reference.
GGEMSLogEnergyTable
GGEMS class computing log table for cut convertion from length to energy.
Definition: GGEMSLogEnergyTable.hh:52
GGEMSLogEnergyTable::GGEMSLogEnergyTable
GGEMSLogEnergyTable(GGEMSLogEnergyTable const &log_energy_table)=delete
Avoid copy by reference.
GGEMSLogEnergyTable::GetEnergy
GGfloat GetEnergy(GGsize const &index) const
get the energy at the bin index
Definition: GGEMSLogEnergyTable.hh:109
GGEMSLogEnergyTable::number_of_nodes_
GGsize number_of_nodes_
Definition: GGEMSLogEnergyTable.hh:156
GGfloat
#define GGfloat
Definition: GGEMSTypes.hh:273
GGEMSLogEnergyTable::bin_width_
GGfloat bin_width_
Definition: GGEMSLogEnergyTable.hh:159