Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4IStore Class Reference

#include <G4IStore.hh>

+ Inheritance diagram for G4IStore:

Public Member Functions

G4double GetImportance (const G4GeometryCell &gCell) const override
 
G4bool IsKnown (const G4GeometryCell &gCell) const override
 
void Clear ()
 
void SetWorldVolume ()
 
void SetParallelWorldVolume (const G4String &paraName)
 
const G4VPhysicalVolumeGetWorldVolume () const override
 
virtual const G4VPhysicalVolumeGetParallelWorldVolumePointer () const
 
void AddImportanceGeometryCell (G4double importance, const G4GeometryCell &gCell)
 
void AddImportanceGeometryCell (G4double importance, const G4VPhysicalVolume &, G4int aRepNum=0)
 
void ChangeImportance (G4double importance, const G4GeometryCell &gCell)
 
void ChangeImportance (G4double importance, const G4VPhysicalVolume &, G4int aRepNum=0)
 
G4double GetImportance (const G4VPhysicalVolume &, G4int aRepNum=0) const
 
- Public Member Functions inherited from G4VIStore
 G4VIStore ()
 
virtual ~G4VIStore ()
 

Static Public Member Functions

static G4IStoreGetInstance ()
 
static G4IStoreGetInstance (const G4String &ParallelWorldName)
 

Protected Member Functions

 G4IStore ()
 
 G4IStore (const G4String &ParallelWorldName)
 
 ~G4IStore () override
 

Detailed Description

Definition at line 49 of file G4IStore.hh.

Constructor & Destructor Documentation

◆ G4IStore() [1/2]

G4IStore::G4IStore ( )
explicitprotected

Definition at line 51 of file G4IStore.cc.

53 ->GetNavigatorForTracking()->GetWorldVolume())
54{
55}
const G4VPhysicalVolume & GetWorldVolume() const override
Definition G4IStore.cc:94
static G4TransportationManager * GetTransportationManager()

Referenced by GetInstance(), and GetInstance().

◆ G4IStore() [2/2]

G4IStore::G4IStore ( const G4String & ParallelWorldName)
explicitprotected

Definition at line 57 of file G4IStore.cc.

59 ->GetParallelWorld(ParallelWorldName))
60{
61#ifdef G4VERBOSE
62 G4cout << " G4IStore:: ParallelWorldName = "
63 << ParallelWorldName << G4endl;
64 G4cout << " G4IStore:: fParallelWorldVolume = "
65 << fWorldVolume->GetName() << G4endl;
66#endif
67}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const

◆ ~G4IStore()

G4IStore::~G4IStore ( )
overrideprotecteddefault

Member Function Documentation

◆ AddImportanceGeometryCell() [1/2]

void G4IStore::AddImportanceGeometryCell ( G4double importance,
const G4GeometryCell & gCell )

Definition at line 109 of file G4IStore.cc.

111{
112 if (importance < 0 )
113 {
114 Error("AddImportanceGeometryCell() - Invalid importance value given.");
115 }
116 if (!IsInWorld(gCell.GetPhysicalVolume()) )
117 {
118 Error("AddImportanceGeometryCell() - Physical volume not found!");
119 }
120 SetInternalIterator(gCell);
121 if (fCurrentIterator != fGeometryCelli.cend())
122 {
123 Error("AddImportanceGeometryCell() - Region already existing!");
124 }
125 fGeometryCelli[gCell] = importance;
126}
const G4VPhysicalVolume & GetPhysicalVolume() const

Referenced by AddImportanceGeometryCell().

◆ AddImportanceGeometryCell() [2/2]

void G4IStore::AddImportanceGeometryCell ( G4double importance,
const G4VPhysicalVolume & aVolume,
G4int aRepNum = 0 )

Definition at line 128 of file G4IStore.cc.

131{
132 AddImportanceGeometryCell(importance, G4GeometryCell(aVolume, aRepNum));
133}
void AddImportanceGeometryCell(G4double importance, const G4GeometryCell &gCell)
Definition G4IStore.cc:109

◆ ChangeImportance() [1/2]

void G4IStore::ChangeImportance ( G4double importance,
const G4GeometryCell & gCell )

Definition at line 135 of file G4IStore.cc.

137{
138 if (importance < 0 )
139 {
140 Error("ChangeImportance() - Invalid importance value given.");
141 }
142 if (!IsInWorld(gCell.GetPhysicalVolume()))
143 {
144 Error("ChangeImportance() - Physical volume not found!");
145 }
146 SetInternalIterator(gCell);
147 if (fCurrentIterator == fGeometryCelli.cend())
148 {
149 Error("ChangeImportance() - Region does not exist!");
150 }
151 fGeometryCelli[gCell] = importance;
152
153}

Referenced by ChangeImportance().

◆ ChangeImportance() [2/2]

void G4IStore::ChangeImportance ( G4double importance,
const G4VPhysicalVolume & aVolume,
G4int aRepNum = 0 )

Definition at line 155 of file G4IStore.cc.

158{
159 ChangeImportance(importance, G4GeometryCell(aVolume, aRepNum));
160}
void ChangeImportance(G4double importance, const G4GeometryCell &gCell)
Definition G4IStore.cc:135

◆ Clear()

void G4IStore::Clear ( )

Definition at line 71 of file G4IStore.cc.

72{
73 fGeometryCelli.clear();
74}

◆ GetImportance() [1/2]

G4double G4IStore::GetImportance ( const G4GeometryCell & gCell) const
overridevirtual

Implements G4VIStore.

Definition at line 179 of file G4IStore.cc.

180{
181 G4AutoLock l(&IStoreMutex);
182 SetInternalIterator(gCell);
183 auto gCellIterator = fCurrentIterator;
184 if (gCellIterator == fGeometryCelli.cend())
185 {
186 std::ostringstream err_mess;
187 err_mess << "GetImportance() - Region does not exist!" << G4endl
188 << "Geometry cell, " << gCell
189 << ", not found in: " << fGeometryCelli << ".";
190 Error(err_mess.str());
191 return 0.;
192 }
193 G4double importance_value = (*fCurrentIterator).second;
194 l.unlock();
195
196 return importance_value;
197}
double G4double
Definition G4Types.hh:83

◆ GetImportance() [2/2]

G4double G4IStore::GetImportance ( const G4VPhysicalVolume & aVolume,
G4int aRepNum = 0 ) const

Definition at line 162 of file G4IStore.cc.

164{
165 G4AutoLock l(&IStoreMutex);
166 SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
167 auto gCellIterator = fCurrentIterator;
168 if (gCellIterator == fGeometryCelli.cend())
169 {
170 Error("GetImportance() - Region does not exist!");
171 return 0.;
172 }
173 G4double importance_value = (*fCurrentIterator).second;
174 l.unlock();
175
176 return importance_value;
177}

◆ GetInstance() [1/2]

G4IStore * G4IStore::GetInstance ( )
static

Definition at line 234 of file G4IStore.cc.

235{
236 if (fInstance == nullptr)
237 {
238#ifdef G4VERBOSE
239 G4cout << "G4IStore:: Creating new MASS IStore " << G4endl;
240#endif
241 fInstance = new G4IStore();
242 }
243 return fInstance;
244}

Referenced by G4ImportanceBiasing::ConstructProcess().

◆ GetInstance() [2/2]

G4IStore * G4IStore::GetInstance ( const G4String & ParallelWorldName)
static

Definition at line 251 of file G4IStore.cc.

252{
253 if (fInstance == nullptr)
254 {
255#ifdef G4VERBOSE
256 G4cout << "G4IStore:: Creating new Parallel IStore "
257 << ParallelWorldName << G4endl;
258#endif
259 fInstance = new G4IStore(ParallelWorldName);
260 }
261 return fInstance;
262}

◆ GetParallelWorldVolumePointer()

const G4VPhysicalVolume * G4IStore::GetParallelWorldVolumePointer ( ) const
virtual

Definition at line 99 of file G4IStore.cc.

100{
101 return fWorldVolume;
102}

◆ GetWorldVolume()

const G4VPhysicalVolume & G4IStore::GetWorldVolume ( ) const
overridevirtual

Implements G4VIStore.

Definition at line 94 of file G4IStore.cc.

95{
96 return *fWorldVolume;
97}

◆ IsKnown()

G4bool G4IStore::IsKnown ( const G4GeometryCell & gCell) const
overridevirtual

Implements G4VIStore.

Definition at line 199 of file G4IStore.cc.

200{
201 G4AutoLock l(&IStoreMutex);
202 G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
203
204 if ( inWorldKnown )
205 {
206 SetInternalIterator(gCell);
207 inWorldKnown = (fCurrentIterator != fGeometryCelli.cend());
208 }
209 l.unlock();
210
211 return inWorldKnown;
212}
bool G4bool
Definition G4Types.hh:86

◆ SetParallelWorldVolume()

void G4IStore::SetParallelWorldVolume ( const G4String & paraName)

Definition at line 85 of file G4IStore.cc.

86{
87 G4cout << " G4IStore:: SetParallelWorldVolume " << G4endl;
89 ->GetParallelWorld(paraName);
90 G4cout << " ParallelWorld volume is: " << fWorldVolume->GetName() << G4endl;
91 // fGeometryCelli = new G4GeometryCellImportance;
92}
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)

◆ SetWorldVolume()

void G4IStore::SetWorldVolume ( )

Definition at line 76 of file G4IStore.cc.

77{
78 G4cout << " G4IStore:: SetWorldVolume " << G4endl;
81 G4cout << " World volume is: " << fWorldVolume->GetName() << G4endl;
82 // fGeometryCelli = new G4GeometryCellImportance;
83}
G4VPhysicalVolume * GetWorldVolume() const
G4Navigator * GetNavigatorForTracking() const

The documentation for this class was generated from the following files: