Geant4 9.6.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

 G4IStore (const G4VPhysicalVolume &worldvolume)
 
virtual ~G4IStore ()
 
virtual G4double GetImportance (const G4GeometryCell &gCell) const
 
virtual G4bool IsKnown (const G4GeometryCell &gCell) const
 
virtual const G4VPhysicalVolumeGetWorldVolume () 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
 

Detailed Description

Definition at line 52 of file G4IStore.hh.

Constructor & Destructor Documentation

◆ G4IStore()

G4IStore::G4IStore ( const G4VPhysicalVolume worldvolume)
explicit

Definition at line 42 of file G4IStore.cc.

42 :
43 fWorldVolume(worldvolume)
44{}

◆ ~G4IStore()

G4IStore::~G4IStore ( )
virtual

Definition at line 46 of file G4IStore.cc.

47{}

Member Function Documentation

◆ AddImportanceGeometryCell() [1/2]

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

Definition at line 59 of file G4IStore.cc.

60 {
61 if (importance < 0 ) {
62 Error("AddImportanceGeometryCell() - Invalid importance value given.");
63 }
64 if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
65 Error("AddImportanceGeometryCell() - Physical volume not found!");
66 }
67 SetInternalIterator(gCell);
68 if (fCurrentIterator!=fGeometryCelli.end()) {
69 Error("AddImportanceGeometryCell() - Region already existing!");
70 }
71 fGeometryCelli[gCell] = importance;
72}
const G4VPhysicalVolume & GetPhysicalVolume() const

Referenced by AddImportanceGeometryCell().

◆ AddImportanceGeometryCell() [2/2]

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

Definition at line 74 of file G4IStore.cc.

77{
79 G4GeometryCell(aVolume, aRepNum));
80}
void AddImportanceGeometryCell(G4double importance, const G4GeometryCell &gCell)
Definition: G4IStore.cc:59

◆ ChangeImportance() [1/2]

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

Definition at line 82 of file G4IStore.cc.

83 {
84 if (importance < 0 ) {
85 Error("ChangeImportance() - Invalid importance value given.");
86 }
87 if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
88 Error("ChangeImportance() - Physical volume not found!");
89 }
90 SetInternalIterator(gCell);
91 if (fCurrentIterator==fGeometryCelli.end()) {
92 Error("ChangeImportance() - Region does not exist!");
93 }
94 fGeometryCelli[gCell] = importance;
95
96}

Referenced by ChangeImportance().

◆ ChangeImportance() [2/2]

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

Definition at line 97 of file G4IStore.cc.

100{
101 ChangeImportance(importance, G4GeometryCell(aVolume, aRepNum));
102}
void ChangeImportance(G4double importance, const G4GeometryCell &gCell)
Definition: G4IStore.cc:82

◆ GetImportance() [1/2]

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

Implements G4VIStore.

Definition at line 117 of file G4IStore.cc.

118{
119 SetInternalIterator(gCell);
120 G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
121 if (gCellIterator==fGeometryCelli.end()) {
122 std::ostringstream err_mess;
123 err_mess << "GetImportance() - Region does not exist!" << G4endl
124 << "Geometry cell, " << gCell
125 << ", not found in: " << fGeometryCelli << ".";
126 Error(err_mess.str());
127 return 0.;
128 }
129 return (*fCurrentIterator).second;
130}
#define G4endl
Definition: G4ios.hh:52

◆ GetImportance() [2/2]

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

Definition at line 104 of file G4IStore.cc.

106{
107 SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
108 G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
109 if (gCellIterator==fGeometryCelli.end()) {
110 Error("GetImportance() - Region does not exist!");
111 return 0.;
112 }
113 return (*fCurrentIterator).second;
114}

◆ GetWorldVolume()

const G4VPhysicalVolume & G4IStore::GetWorldVolume ( ) const
virtual

Implements G4VIStore.

Definition at line 49 of file G4IStore.cc.

50{
51 return fWorldVolume;
52}

◆ IsKnown()

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

Implements G4VIStore.

Definition at line 132 of file G4IStore.cc.

132 {
133 G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
134
135 if ( inWorldKnown ) {
136 SetInternalIterator(gCell);
137 inWorldKnown = (fCurrentIterator!=fGeometryCelli.end());
138 }
139 return inWorldKnown;
140}
bool G4bool
Definition: G4Types.hh:67

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