GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSRangeCuts.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_PHYSICS_GGEMSRANGECUTS_HH
2 #define GUARD_GGEMS_PHYSICS_GGEMSRANGECUTS_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 
39 
40 class GGEMSMaterials;
42 
43 typedef std::unordered_map<std::string, GGfloat> EnergyCutUMap;
49 class GGEMS_EXPORT GGEMSRangeCuts
50 {
51  public:
55  GGEMSRangeCuts(void);
56 
60  ~GGEMSRangeCuts(void);
61 
67  GGEMSRangeCuts(GGEMSRangeCuts const& range_cuts) = delete;
68 
74  GGEMSRangeCuts& operator=(GGEMSRangeCuts const& range_cuts) = delete;
75 
81  GGEMSRangeCuts(GGEMSRangeCuts const&& range_cuts) = delete;
82 
88  GGEMSRangeCuts& operator=(GGEMSRangeCuts const&& range_cuts) = delete;
89 
95  void SetPhotonDistanceCut(GGfloat const& cut);
96 
102  void SetElectronDistanceCut(GGfloat const& cut);
103 
109  void SetPositronDistanceCut(GGfloat const& cut);
110 
116  inline GGfloat GetPhotonDistanceCut(void) const {return distance_cut_photon_;}
117 
123  inline EnergyCutUMap GetPhotonEnergyCut(void) const {return energy_cuts_photon_;}
124 
130  inline GGfloat GetElectronDistanceCut(void) const {return distance_cut_electron_;}
131 
137  inline EnergyCutUMap GetElectronEnergyCut(void) const {return energy_cuts_electron_;}
138 
144  inline GGfloat GetPositronDistanceCut(void) const {return distance_cut_positron_;}
145 
151  inline EnergyCutUMap GetPositronEnergyCut(void) const {return energy_cuts_positron_;}
152 
158  void ConvertCutsFromDistanceToEnergy(GGEMSMaterials* materials);
159 
160  private:
169  GGfloat ConvertToEnergy(GGEMSMaterialTables* material_table, GGushort const& index_mat, std::string const& particle_name);
170 
178  void BuildElementsLossTable(GGEMSMaterialTables* material_table, GGushort const& index_mat, std::string const& particle_name);
179 
186  void BuildAbsorptionLengthTable(GGEMSMaterialTables* material_table, GGushort const& index_mat);
187 
194  void BuildMaterialLossTable(GGEMSMaterialTables* material_table, GGushort const& index_mat);
195 
203  GGfloat ComputePhotonCrossSection(GGuchar const& atomic_number, GGfloat const& energy) const;
204 
212  GGfloat ComputeLossElectron(GGuchar const& atomic_number, GGfloat const& energy) const;
213 
221  GGfloat ComputeLossPositron(GGuchar const& atomic_number, GGfloat const& energy) const;
222 
229  GGfloat ConvertLengthToEnergyCut(GGfloat const& length_cut) const;
230 
231  private:
236  // Photon
240  // Electron
244  // Positron
251 };
252 
253 #endif // GUARD_GGEMS_PHYSICS_GGEMSRANGECUTS_HH
GGEMSRangeCuts::operator=
GGEMSRangeCuts & operator=(GGEMSRangeCuts const &range_cuts)=delete
Avoid assignement by reference.
GGEMSRangeCuts::GetPositronEnergyCut
EnergyCutUMap GetPositronEnergyCut(void) const
get the map of energy cut with material for positron
Definition: GGEMSRangeCuts.hh:151
GGEMSRangeCuts
GGEMS class storing and converting the cut in energy cut.
Definition: GGEMSRangeCuts.hh:50
GGEMSRangeCuts::GetPhotonDistanceCut
GGfloat GetPhotonDistanceCut(void) const
get the photon length cut
Definition: GGEMSRangeCuts.hh:116
GGEMSRangeCuts::distance_cut_photon_
GGfloat distance_cut_photon_
Definition: GGEMSRangeCuts.hh:237
GGEMSMaterials
GGEMS class handling material(s) for a specific navigator.
Definition: GGEMSMaterials.hh:49
GGEMSRangeCuts::min_energy_
GGfloat min_energy_
Definition: GGEMSRangeCuts.hh:232
GGEMSRangeCuts::GetPhotonEnergyCut
EnergyCutUMap GetPhotonEnergyCut(void) const
get the map of energy cut with material
Definition: GGEMSRangeCuts.hh:123
GGushort
#define GGushort
Definition: GGEMSTypes.hh:217
GGEMSRangeCuts::energy_cuts_photon_
EnergyCutUMap energy_cuts_photon_
Definition: GGEMSRangeCuts.hh:238
GGEMSRangeCuts::range_table_material_
GGEMSLogEnergyTable * range_table_material_
Definition: GGEMSRangeCuts.hh:248
GGEMSRangeCuts::number_of_bins_
GGsize number_of_bins_
Definition: GGEMSRangeCuts.hh:234
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSRangeCuts::GGEMSRangeCuts
GGEMSRangeCuts(GGEMSRangeCuts const &range_cuts)=delete
Avoid copy by reference.
GGEMSRangeCuts::max_energy_
GGfloat max_energy_
Definition: GGEMSRangeCuts.hh:233
GGEMSRangeCuts::energy_cuts_electron_
EnergyCutUMap energy_cuts_electron_
Definition: GGEMSRangeCuts.hh:242
GGEMSRangeCuts::distance_cut_positron_
GGfloat distance_cut_positron_
Definition: GGEMSRangeCuts.hh:245
GGEMSRangeCuts::number_of_tables_
GGsize number_of_tables_
Definition: GGEMSRangeCuts.hh:250
EnergyCutUMap
std::unordered_map< std::string, GGfloat > EnergyCutUMap
Definition: GGEMSRangeCuts.hh:41
GGEMSMaterialTables_t
Structure storing the material tables on OpenCL device.
Definition: GGEMSMaterialTables.hh:42
GGEMSRangeCuts::GetElectronEnergyCut
EnergyCutUMap GetElectronEnergyCut(void) const
get the map of energy cut with material for electron
Definition: GGEMSRangeCuts.hh:137
GGEMSRangeCuts::GGEMSRangeCuts
GGEMSRangeCuts(GGEMSRangeCuts const &&range_cuts)=delete
Avoid copy by rvalue reference.
GGEMSRangeCuts::loss_table_dedx_table_elements_
GGEMSLogEnergyTable ** loss_table_dedx_table_elements_
Definition: GGEMSRangeCuts.hh:249
GGEMSMaterials.hh
GGEMS class handling material(s) for a specific navigator.
GGEMSLogEnergyTable
GGEMS class computing log table for cut convertion from length to energy.
Definition: GGEMSLogEnergyTable.hh:52
GGuchar
#define GGuchar
Definition: GGEMSTypes.hh:203
GGEMSRangeCuts::energy_cuts_positron_
EnergyCutUMap energy_cuts_positron_
Definition: GGEMSRangeCuts.hh:246
GGEMSRangeCuts::GetPositronDistanceCut
GGfloat GetPositronDistanceCut(void) const
get the positron length cut
Definition: GGEMSRangeCuts.hh:144
GGEMSRangeCuts::operator=
GGEMSRangeCuts & operator=(GGEMSRangeCuts const &&range_cuts)=delete
Avoid copy by rvalue reference.
GGEMSRangeCuts::distance_cut_electron_
GGfloat distance_cut_electron_
Definition: GGEMSRangeCuts.hh:241
GGEMSRangeCuts::GetElectronDistanceCut
GGfloat GetElectronDistanceCut(void) const
get the electron length cut for photon
Definition: GGEMSRangeCuts.hh:130
GGfloat
#define GGfloat
Definition: GGEMSTypes.hh:273