GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSNavigatorManager.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_NAVIGATORS_GGEMSNAVIGATORMANAGER_HH
2 #define GUARD_GGEMS_NAVIGATORS_GGEMSNAVIGATORMANAGER_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 
36 
41 class GGEMS_EXPORT GGEMSNavigatorManager
42 {
43  private:
48 
52  ~GGEMSNavigatorManager(void);
53 
54  public:
61  {
62  static GGEMSNavigatorManager instance;
63  return instance;
64  }
65 
71  GGEMSNavigatorManager(GGEMSNavigatorManager const& navigator_manager) = delete;
72 
78  GGEMSNavigatorManager& operator=(GGEMSNavigatorManager const& navigator_manager) = delete;
79 
85  GGEMSNavigatorManager(GGEMSNavigatorManager const&& navigator_manager) = delete;
86 
92  GGEMSNavigatorManager& operator=(GGEMSNavigatorManager const&& navigator_manager) = delete;
93 
99  void Store(GGEMSNavigator* navigator);
100 
106  void StoreWorld(GGEMSWorld* world);
107 
113  void Initialize(bool const& is_tracking = false) const;
114 
119  void PrintInfos(void) const;
120 
126  inline GGsize GetNumberOfNavigators(void) const {return number_of_navigators_;}
127 
133  inline GGEMSNavigator** GetNavigators(void) const {return navigators_;}
134 
141  inline GGEMSNavigator* GetNavigator(std::string const& navigator_name) const
142  {
143  // Loop over the navigator
144  for (GGsize i = 0; i < number_of_navigators_; ++i) {
145  if (navigator_name == navigators_[i]->GetNavigatorName()) {
146  return navigators_[i];
147  }
148  }
149  GGEMSMisc::ThrowException("GGEMSNavigatorManager", "GetNavigator", "Name of the navigator unknown!!!");
150  return nullptr;
151  }
152 
159  {
160  GGsize number_of_registered_solid = 0;
161  // Loop over number of navigator
162  for (GGsize i = 0; i < number_of_navigators_; ++i) {
163  number_of_registered_solid += navigators_[i]->GetNumberOfSolids();
164  }
165 
166  return number_of_registered_solid;
167  }
168 
174  void FindSolid(GGsize const& thread_index) const;
175 
181  void ProjectToSolid(GGsize const& thread_index) const;
182 
188  void TrackThroughSolid(GGsize const& thread_index) const;
189 
194  void SaveResults(void) const;
195 
201  void WorldTracking(GGsize const& thread_index) const;
202 
208  void ComputeDose(GGsize const& thread_index);
209 
214  void Clean(void);
215 
216  private:
220 };
221 
222 #endif // End of GUARD_GGEMS_NAVIGATORS_GGEMSNAVIGATORMANAGER_HH
GGEMSNavigatorManager::GetNumberOfRegisteredSolids
GGsize GetNumberOfRegisteredSolids(void) const
get the number of current registered solid
Definition: GGEMSNavigatorManager.hh:158
GGEMSNavigatorManager::GetNumberOfNavigators
GGsize GetNumberOfNavigators(void) const
Get the number of navigators.
Definition: GGEMSNavigatorManager.hh:126
GGEMSNavigatorManager::operator=
GGEMSNavigatorManager & operator=(GGEMSNavigatorManager const &navigator_manager)=delete
Avoid assignement of the class by reference.
GGEMSNavigatorManager::number_of_navigators_
GGsize number_of_navigators_
Definition: GGEMSNavigatorManager.hh:218
GGEMSNavigatorManager::navigators_
GGEMSNavigator ** navigators_
Definition: GGEMSNavigatorManager.hh:217
GGEMSNavigatorManager::GetInstance
static GGEMSNavigatorManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSNavigatorManager.hh:60
GGEMSWorld.hh
GGEMS class handling global world (space between navigators) in GGEMS.
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSNavigatorManager::operator=
GGEMSNavigatorManager & operator=(GGEMSNavigatorManager const &&navigator_manager)=delete
Avoid copy of the class by rvalue reference.
GGEMSNavigatorManager::world_
GGEMSWorld * world_
Definition: GGEMSNavigatorManager.hh:219
GGEMSNavigatorManager
GGEMS class handling the navigators (detector + phantom) in GGEMS.
Definition: GGEMSNavigatorManager.hh:42
GGEMSWorld
GGEMS class handling global world (space between navigators) in GGEMS.
Definition: GGEMSWorld.hh:56
GGEMSNavigatorManager::GGEMSNavigatorManager
GGEMSNavigatorManager(GGEMSNavigatorManager const &navigator_manager)=delete
Avoid copy of the class by reference.
GGEMSNavigator
Parent GGEMS class for navigator.
Definition: GGEMSNavigator.hh:55
GGEMSNavigatorManager::GetNavigator
GGEMSNavigator * GetNavigator(std::string const &navigator_name) const
get the navigator by the name
Definition: GGEMSNavigatorManager.hh:141
GGEMSNavigatorManager::GGEMSNavigatorManager
GGEMSNavigatorManager(GGEMSNavigatorManager const &&navigator_manager)=delete
Avoid copy of the class by rvalue reference.
GGEMSNavigatorManager::GetNavigators
GGEMSNavigator ** GetNavigators(void) const
get the list of navigators
Definition: GGEMSNavigatorManager.hh:133
GGEMSNavigator.hh
Parent GGEMS class for navigation.
GGEMSMisc::ThrowException
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
Definition: GGEMSTools.cc:61