GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSXRaySource.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_SOURCES_GGEMSXRAYSOURCE_HH
2 #define GUARD_GGEMS_SOURCES_GGEMSXRAYSOURCE_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 
35 
40 class GGEMS_EXPORT GGEMSXRaySource : public GGEMSSource
41 {
42  public:
47  explicit GGEMSXRaySource(std::string const& source_name);
48 
52  ~GGEMSXRaySource(void);
53 
59  GGEMSXRaySource(GGEMSXRaySource const& xray_source) = delete;
60 
66  GGEMSXRaySource& operator=(GGEMSXRaySource const& xray_source) = delete;
67 
73  GGEMSXRaySource(GGEMSXRaySource const&& xray_source) = delete;
74 
80  GGEMSXRaySource& operator=(GGEMSXRaySource const&& xray_source) = delete;
81 
88  void SetBeamAperture(GGfloat const& beam_aperture, std::string const& unit = "deg");
89 
98  void SetFocalSpotSize(GGfloat const& width, GGfloat const& height, GGfloat const& depth, std::string const& unit = "mm");
99 
106  void SetMonoenergy(GGfloat const& monoenergy, std::string const& unit = "keV");
107 
113  void SetPolyenergy(std::string const& energy_spectrum_filename);
114 
120  void Initialize(bool const& is_tracking = false) override;
121 
126  void PrintInfos(void) const override;
127 
134  void GetPrimaries(GGsize const& thread_index, GGsize const& number_of_particles) override;
135 
136  private:
141  void InitializeKernel(void) override;
142 
147  void FillEnergy(void);
148 
153  void CheckParameters(void) const override;
154 
155  private: // Specific members for GGEMSXRaySource
162  cl::Buffer** energy_spectrum_;
163  cl::Buffer** cdf_;
164 };
165 
172 extern "C" GGEMS_EXPORT GGEMSXRaySource* create_ggems_xray_source(char const* source_name);
173 
183 extern "C" GGEMS_EXPORT void set_position_ggems_xray_source(GGEMSXRaySource* xray_source, GGfloat const pos_x, GGfloat const pos_y, GGfloat const pos_z, char const* unit);
184 
191 extern "C" GGEMS_EXPORT void set_number_of_particles_xray_source(GGEMSXRaySource* xray_source, GGsize const number_of_particles);
192 
199 extern "C" GGEMS_EXPORT void set_source_particle_type_ggems_xray_source(GGEMSXRaySource* xray_source, char const* particle_name);
200 
208 extern "C" GGEMS_EXPORT void set_beam_aperture_ggems_xray_source(GGEMSXRaySource* xray_source, GGfloat const beam_aperture, char const* unit);
209 
219 extern "C" GGEMS_EXPORT void set_focal_spot_size_ggems_xray_source(GGEMSXRaySource* xray_source, GGfloat const width, GGfloat const height, GGfloat const depth, char const* unit);
220 
230 extern "C" GGEMS_EXPORT void set_rotation_ggems_xray_source(GGEMSXRaySource* xray_source, GGfloat const rx, GGfloat const ry, GGfloat const rz, char const* unit);
231 
239 extern "C" GGEMS_EXPORT void set_monoenergy_ggems_xray_source(GGEMSXRaySource* xray_source, GGfloat const monoenergy, char const* unit);
240 
247 extern "C" GGEMS_EXPORT void set_polyenergy_ggems_xray_source(GGEMSXRaySource* xray_source, char const* energy_spectrum);
248 
249 #endif // End of GUARD_GGEMS_SOURCES_GGEMSXRAYSOURCE_HH
set_beam_aperture_ggems_xray_source
void set_beam_aperture_ggems_xray_source(GGEMSXRaySource *xray_source, GGfloat const beam_aperture, char const *unit)
set the beam aperture of the x-ray source
Definition: GGEMSXRaySource.cc:502
GGEMSXRaySource::energy_spectrum_filename_
std::string energy_spectrum_filename_
Definition: GGEMSXRaySource.hh:160
GGEMSXRaySource::cdf_
cl::Buffer ** cdf_
Definition: GGEMSXRaySource.hh:163
GGEMSSource.hh
GGEMS mother class for the source.
GGEMSXRaySource::operator=
GGEMSXRaySource & operator=(GGEMSXRaySource const &xray_source)=delete
Avoid assignement by reference.
GGEMSXRaySource::GGEMSXRaySource
GGEMSXRaySource(GGEMSXRaySource const &&xray_source)=delete
Avoid copy by rvalue reference.
set_focal_spot_size_ggems_xray_source
void set_focal_spot_size_ggems_xray_source(GGEMSXRaySource *xray_source, GGfloat const width, GGfloat const height, GGfloat const depth, char const *unit)
Set the focal spot size of the x-ray source.
Definition: GGEMSXRaySource.cc:511
GGEMSXRaySource
This class define a XRay source in GGEMS useful for CT/CBCT simulation.
Definition: GGEMSXRaySource.hh:41
GGEMSSource::InitializeKernel
virtual void InitializeKernel(void)=0
Initialize kernel for specific source in OpenCL.
set_rotation_ggems_xray_source
void set_rotation_ggems_xray_source(GGEMSXRaySource *xray_source, GGfloat const rx, GGfloat const ry, GGfloat const rz, char const *unit)
Set the rotation of the source around global axis.
Definition: GGEMSXRaySource.cc:520
set_monoenergy_ggems_xray_source
void set_monoenergy_ggems_xray_source(GGEMSXRaySource *xray_source, GGfloat const monoenergy, char const *unit)
Set the monoenergy value for the GGEMSXRaySource.
Definition: GGEMSXRaySource.cc:529
GGEMSXRaySource::focal_spot_size_
GGfloat3 focal_spot_size_
Definition: GGEMSXRaySource.hh:157
set_position_ggems_xray_source
void set_position_ggems_xray_source(GGEMSXRaySource *xray_source, GGfloat const pos_x, GGfloat const pos_y, GGfloat const pos_z, char const *unit)
Set the position of the source in the global coordinates.
Definition: GGEMSXRaySource.cc:475
GGEMSSource::GetPrimaries
virtual void GetPrimaries(GGsize const &thread_index, GGsize const &number_of_particles)=0
Generate primary particles.
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSSource::PrintInfos
virtual void PrintInfos(void) const =0
Printing infos about the source.
GGEMSXRaySource::monoenergy_
GGfloat monoenergy_
Definition: GGEMSXRaySource.hh:159
create_ggems_xray_source
GGEMSXRaySource * create_ggems_xray_source(char const *source_name)
Get the GGEMSXRaySource pointer for python user.
Definition: GGEMSXRaySource.cc:466
GGEMSXRaySource::beam_aperture_
GGfloat beam_aperture_
Definition: GGEMSXRaySource.hh:156
GGfloat3
#define GGfloat3
Definition: GGEMSTypes.hh:275
GGEMSXRaySource::is_monoenergy_mode_
GGbool is_monoenergy_mode_
Definition: GGEMSXRaySource.hh:158
GGEMSSource::CheckParameters
virtual void CheckParameters(void) const
Check mandatory parameters for a source.
Definition: GGEMSSource.cc:177
GGEMSXRaySource::energy_spectrum_
cl::Buffer ** energy_spectrum_
Definition: GGEMSXRaySource.hh:162
GGEMSXRaySource::operator=
GGEMSXRaySource & operator=(GGEMSXRaySource const &&xray_source)=delete
Avoid copy by rvalue reference.
set_source_particle_type_ggems_xray_source
void set_source_particle_type_ggems_xray_source(GGEMSXRaySource *xray_source, char const *particle_name)
Set the type of the source particle.
Definition: GGEMSXRaySource.cc:493
GGEMSXRaySource::number_of_energy_bins_
GGsize number_of_energy_bins_
Definition: GGEMSXRaySource.hh:161
set_polyenergy_ggems_xray_source
void set_polyenergy_ggems_xray_source(GGEMSXRaySource *xray_source, char const *energy_spectrum)
Set the polyenergetic spectrum value for the GGEMSXRaySource.
Definition: GGEMSXRaySource.cc:538
GGEMSSource::Initialize
virtual void Initialize(bool const &is_tracking=false)
Initialize a GGEMS source.
Definition: GGEMSSource.cc:287
GGbool
#define GGbool
Definition: GGEMSTypes.hh:194
GGEMSXRaySource::GGEMSXRaySource
GGEMSXRaySource(GGEMSXRaySource const &xray_source)=delete
Avoid copy by reference.
set_number_of_particles_xray_source
void set_number_of_particles_xray_source(GGEMSXRaySource *xray_source, GGsize const number_of_particles)
Set the number of particles to simulate during the simulation.
Definition: GGEMSXRaySource.cc:484
GGfloat
#define GGfloat
Definition: GGEMSTypes.hh:273
GGEMSSource
GGEMS mother class for the source.
Definition: GGEMSSource.hh:45