Geant4 10.7.0
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

virtual G4double GetImportance (const G4GeometryCell &gCell) const
 
virtual G4bool IsKnown (const G4GeometryCell &gCell) const
 
void Clear ()
 
void SetWorldVolume ()
 
void SetParallelWorldVolume (const G4String &paraName)
 
virtual const G4VPhysicalVolumeGetWorldVolume () const
 
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 ()
 
virtual G4double GetImportance (const G4GeometryCell &gCell) const =0
 
virtual G4bool IsKnown (const G4GeometryCell &gCell) const =0
 
virtual const G4VPhysicalVolumeGetWorldVolume () const =0
 

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

Definition at line 49 of file G4IStore.hh.

Constructor & Destructor Documentation

◆ G4IStore() [1/2]

G4IStore::G4IStore ( )
explicitprotected

Definition at line 48 of file G4IStore.cc.

50 ->GetNavigatorForTracking()->GetWorldVolume())
51{
52}
virtual const G4VPhysicalVolume & GetWorldVolume() const
Definition: G4IStore.cc:93
static G4TransportationManager * GetTransportationManager()

Referenced by GetInstance().

◆ G4IStore() [2/2]

G4IStore::G4IStore ( const G4String ParallelWorldName)
explicitprotected

Definition at line 54 of file G4IStore.cc.

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

◆ ~G4IStore()

G4IStore::~G4IStore ( )
protected

Definition at line 66 of file G4IStore.cc.

67{
68}

Member Function Documentation

◆ AddImportanceGeometryCell() [1/2]

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

Definition at line 108 of file G4IStore.cc.

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

Referenced by AddImportanceGeometryCell().

◆ AddImportanceGeometryCell() [2/2]

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

Definition at line 127 of file G4IStore.cc.

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

◆ ChangeImportance() [1/2]

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

Definition at line 134 of file G4IStore.cc.

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

Referenced by ChangeImportance().

◆ ChangeImportance() [2/2]

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

Definition at line 154 of file G4IStore.cc.

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

◆ Clear()

void G4IStore::Clear ( )

Definition at line 70 of file G4IStore.cc.

71{
72 fGeometryCelli.clear();
73}

◆ GetImportance() [1/2]

G4double G4IStore::GetImportance ( const G4GeometryCell gCell) const
virtual

Implements G4VIStore.

Definition at line 181 of file G4IStore.cc.

182{
183#ifdef G4MULTITHREADED
184 G4MUTEXLOCK(&G4IStore::IStoreMutex);
185#endif
186 SetInternalIterator(gCell);
187 auto gCellIterator = fCurrentIterator;
188 if (gCellIterator == fGeometryCelli.cend())
189 {
190 std::ostringstream err_mess;
191 err_mess << "GetImportance() - Region does not exist!" << G4endl
192 << "Geometry cell, " << gCell
193 << ", not found in: " << fGeometryCelli << ".";
194 Error(err_mess.str());
195 return 0.;
196 }
197 G4double importance_value = (*fCurrentIterator).second;
198#ifdef G4MULTITHREADED
199 G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
200#endif
201 return importance_value;
202 // return (*fCurrentIterator).second;
203}
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
double G4double
Definition: G4Types.hh:83

◆ GetImportance() [2/2]

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

Definition at line 161 of file G4IStore.cc.

163{
164#ifdef G4MULTITHREADED
165 G4MUTEXLOCK(&G4IStore::IStoreMutex);
166#endif
167 SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
168 auto gCellIterator = fCurrentIterator;
169 if (gCellIterator == fGeometryCelli.cend())
170 {
171 Error("GetImportance() - Region does not exist!");
172 return 0.;
173 }
174 G4double importance_value = (*fCurrentIterator).second;
175#ifdef G4MULTITHREADED
176 G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
177#endif
178 return importance_value;
179}

◆ GetInstance() [1/2]

G4IStore * G4IStore::GetInstance ( )
static

Definition at line 243 of file G4IStore.cc.

244{
245 if (fInstance == nullptr)
246 {
247#ifdef G4VERBOSE
248 G4cout << "G4IStore:: Creating new MASS IStore " << G4endl;
249#endif
250 fInstance = new G4IStore();
251 }
252 return fInstance;
253}
G4IStore()
Definition: G4IStore.cc:48

Referenced by G4ImportanceBiasing::ConstructProcess().

◆ GetInstance() [2/2]

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

Definition at line 260 of file G4IStore.cc.

261{
262 if (fInstance == nullptr)
263 {
264#ifdef G4VERBOSE
265 G4cout << "G4IStore:: Creating new Parallel IStore "
266 << ParallelWorldName << G4endl;
267#endif
268 fInstance = new G4IStore(ParallelWorldName);
269 }
270 return fInstance;
271}

◆ GetParallelWorldVolumePointer()

const G4VPhysicalVolume * G4IStore::GetParallelWorldVolumePointer ( ) const
virtual

Definition at line 98 of file G4IStore.cc.

99{
100 return fWorldVolume;
101}

◆ GetWorldVolume()

const G4VPhysicalVolume & G4IStore::GetWorldVolume ( ) const
virtual

Implements G4VIStore.

Definition at line 93 of file G4IStore.cc.

94{
95 return *fWorldVolume;
96}

◆ IsKnown()

G4bool G4IStore::IsKnown ( const G4GeometryCell gCell) const
virtual

Implements G4VIStore.

Definition at line 205 of file G4IStore.cc.

206{
207#ifdef G4MULTITHREADED
208 G4MUTEXLOCK(&G4IStore::IStoreMutex);
209#endif
210 G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
211
212 if ( inWorldKnown )
213 {
214 SetInternalIterator(gCell);
215 inWorldKnown = (fCurrentIterator != fGeometryCelli.cend());
216 }
217#ifdef G4MULTITHREADED
218 G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
219#endif
220 return inWorldKnown;
221}
bool G4bool
Definition: G4Types.hh:86

◆ SetParallelWorldVolume()

void G4IStore::SetParallelWorldVolume ( const G4String paraName)

Definition at line 84 of file G4IStore.cc.

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

◆ SetWorldVolume()

void G4IStore::SetWorldVolume ( )

Definition at line 75 of file G4IStore.cc.

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

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