gsystem
Loading...
Searching...
No Matches
gworld.h
Go to the documentation of this file.
1#pragma once
2
3// gsystem
4#include "gsystem.h"
5#include "gmodifier.h"
6#include "gsystem_options.h"
8
9// C++
10#include <map>
11#include <string>
12#include <vector>
13#include <memory>
14
36class GWorld : public GBase<GWorld>
37{
38public:
51 explicit GWorld(const std::shared_ptr<GOptions>& gopts);
52
62 explicit GWorld(const std::shared_ptr<GOptions>& gopts, SystemList systems);
63
70 [[nodiscard]] SystemMap* getSystemsMap() const { return gsystemsMap.get(); }
71
78 [[nodiscard]] int get_number_of_volumes() const { return static_cast<int>(gsystemsMap->size()); }
79
89 std::vector<std::string> getSensitiveDetectorsList();
90
91private:
92 std::shared_ptr<GOptions> gopts;
93
96 std::unique_ptr<SystemMap> gsystemsMap = std::make_unique<SystemMap>();
97
106 void create_gsystemsMap(SystemList systems);
107
110 std::map<std::string, std::shared_ptr<GModifier>> gmodifiersMap;
111
123 [[nodiscard]] GVolume* searchForVolume(const std::string& volumeName, const std::string& purpose) const;
124
135 std::map<std::string, std::unique_ptr<GSystemFactory>> createSystemFactory();
136
142 void load_systems();
143
151 void load_gmodifiers();
152
163 void assignG4Names();
164};
Geometry volume record loaded into a GSystem.
Definition gvolume.h:33
Builds the “world” as a collection of systems, volumes, and post-load modifiers.
Definition gworld.h:37
int get_number_of_volumes() const
Returns the number of systems currently registered in the world.
Definition gworld.h:78
std::vector< std::string > getSensitiveDetectorsList()
Collect the list of sensitive detector identifiers.
Definition gworld.cc:132
GWorld(const std::shared_ptr< GOptions > &gopts)
Construct the world from configuration.
Definition gworld.cc:18
SystemMap * getSystemsMap() const
Returns a pointer to the internal system map.
Definition gworld.h:70
std::vector< SystemPtr > SystemList
Definition gsystem.h:237
std::map< std::string, SystemPtr > SystemMap
Definition gsystem.h:236
Option definitions and extraction helpers for the gsystem module.