Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
G4IStore Class Reference

#include <G4IStore.hh>

Inheritance diagram for G4IStore:
G4VIStore

Public Member Functions

virtual ~G4IStore ()
 
virtual G4double GetImportance (const G4GeometryCell &gCell) const
 
virtual G4bool IsKnown (const G4GeometryCell &gCell) const
 
void Clear ()
 
void SetWorldVolume ()
 
void SetParallelWorldVolume (G4String paraName)
 
virtual const G4VPhysicalVolume & GetWorldVolume () const
 
virtual const G4VPhysicalVolume * GetParallelWorldVolumePointer () 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 G4IStore * GetInstance ()
 
static G4IStore * GetInstance (G4String ParallelWorldName)
 

Protected Member Functions

 G4IStore ()
 
 G4IStore (G4String ParallelWorldName)
 

Detailed Description

Definition at line 62 of file G4IStore.hh.

Constructor & Destructor Documentation

G4IStore::G4IStore ( )
explicitprotected

Definition at line 49 of file G4IStore.cc.

Referenced by GetInstance().

49  :
50 fWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume())
51 {}
virtual const G4VPhysicalVolume & GetWorldVolume() const
Definition: G4IStore.cc:84
static G4TransportationManager * GetTransportationManager()
G4IStore::G4IStore ( G4String  ParallelWorldName)
explicitprotected

Definition at line 53 of file G4IStore.cc.

References G4cout, G4endl, and G4VPhysicalVolume::GetName().

53  :
54 fWorldVolume(G4TransportationManager::GetTransportationManager()->GetParallelWorld(ParallelWorldName))
55 {
56  G4cout << " G4IStore:: ParallelWorldName = " << ParallelWorldName << G4endl;
57  G4cout << " G4IStore:: fParallelWorldVolume = " << fWorldVolume->GetName() << G4endl;
58 }
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
G4IStore::~G4IStore ( )
virtual

Definition at line 60 of file G4IStore.cc.

61 {}

Member Function Documentation

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

Definition at line 104 of file G4IStore.cc.

References G4GeometryCell::GetPhysicalVolume().

Referenced by AddImportanceGeometryCell(), B01DetectorConstruction::CreateImportanceStore(), B02ImportanceDetectorConstruction::CreateImportanceStore(), and main().

106 {
107  if (importance < 0 ) {
108  Error("AddImportanceGeometryCell() - Invalid importance value given.");
109  }
110  if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
111  Error("AddImportanceGeometryCell() - Physical volume not found!");
112  }
113  SetInternalIterator(gCell);
114  if (fCurrentIterator!=fGeometryCelli.end()) {
115  Error("AddImportanceGeometryCell() - Region already existing!");
116  }
117  fGeometryCelli[gCell] = importance;
118 }
const G4VPhysicalVolume & GetPhysicalVolume() const
void G4IStore::AddImportanceGeometryCell ( G4double  importance,
const G4VPhysicalVolume &  aVolume,
G4int  aRepNum = 0 
)

Definition at line 120 of file G4IStore.cc.

References AddImportanceGeometryCell().

123 {
124  AddImportanceGeometryCell(importance,
125  G4GeometryCell(aVolume, aRepNum));
126 }
void AddImportanceGeometryCell(G4double importance, const G4GeometryCell &gCell)
Definition: G4IStore.cc:104
void G4IStore::ChangeImportance ( G4double  importance,
const G4GeometryCell &  gCell 
)

Definition at line 128 of file G4IStore.cc.

References G4GeometryCell::GetPhysicalVolume().

Referenced by ChangeImportance().

129  {
130  if (importance < 0 ) {
131  Error("ChangeImportance() - Invalid importance value given.");
132  }
133  if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
134  Error("ChangeImportance() - Physical volume not found!");
135  }
136  SetInternalIterator(gCell);
137  if (fCurrentIterator==fGeometryCelli.end()) {
138  Error("ChangeImportance() - Region does not exist!");
139  }
140  fGeometryCelli[gCell] = importance;
141 
142 }
const G4VPhysicalVolume & GetPhysicalVolume() const
void G4IStore::ChangeImportance ( G4double  importance,
const G4VPhysicalVolume &  aVolume,
G4int  aRepNum = 0 
)

Definition at line 143 of file G4IStore.cc.

References ChangeImportance().

146 {
147  ChangeImportance(importance, G4GeometryCell(aVolume, aRepNum));
148 }
void ChangeImportance(G4double importance, const G4GeometryCell &gCell)
Definition: G4IStore.cc:128
void G4IStore::Clear ( )

Definition at line 63 of file G4IStore.cc.

64 {
65  fGeometryCelli.clear();
66 }
G4double G4IStore::GetImportance ( const G4GeometryCell &  gCell) const
virtual

Implements G4VIStore.

Definition at line 163 of file G4IStore.cc.

References G4endl.

164 {
165  SetInternalIterator(gCell);
166  G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
167  if (gCellIterator==fGeometryCelli.end()) {
168  std::ostringstream err_mess;
169  err_mess << "GetImportance() - Region does not exist!" << G4endl
170  << "Geometry cell, " << gCell
171  << ", not found in: " << fGeometryCelli << ".";
172  Error(err_mess.str());
173  return 0.;
174  }
175  return (*fCurrentIterator).second;
176 }
#define G4endl
Definition: G4ios.hh:61
G4double G4IStore::GetImportance ( const G4VPhysicalVolume &  aVolume,
G4int  aRepNum = 0 
) const

Definition at line 150 of file G4IStore.cc.

152 {
153  SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
154  G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
155  if (gCellIterator==fGeometryCelli.end()) {
156  Error("GetImportance() - Region does not exist!");
157  return 0.;
158  }
159  return (*fCurrentIterator).second;
160 }
G4IStore * G4IStore::GetInstance ( void  )
static

Definition at line 211 of file G4IStore.cc.

References G4cout, G4endl, and G4IStore().

Referenced by B03PhysicsList::AddBiasingProcess(), G4ImportanceBiasing::ConstructProcess(), B01DetectorConstruction::CreateImportanceStore(), B02ImportanceDetectorConstruction::CreateImportanceStore(), and main().

212 {
213  if (!fInstance)
214  {
215  G4cout << "G4IStore:: Creating new MASS IStore " << G4endl;
216  fInstance = new G4IStore();
217  }
218  return fInstance;
219 }
G4IStore()
Definition: G4IStore.cc:49
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4IStore * G4IStore::GetInstance ( G4String  ParallelWorldName)
static

Definition at line 226 of file G4IStore.cc.

References G4cout, G4endl, and G4IStore().

227 {
228  if (!fInstance)
229  {
230  G4cout << "G4IStore:: Creating new Parallel IStore " << ParallelWorldName << G4endl;
231  fInstance = new G4IStore(ParallelWorldName);
232  }
233  return fInstance;
234 }
G4IStore()
Definition: G4IStore.cc:49
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4VPhysicalVolume * G4IStore::GetParallelWorldVolumePointer ( ) const
virtual

Definition at line 94 of file G4IStore.cc.

Referenced by B03PhysicsList::AddBiasingProcess().

95 {
96  return fWorldVolume;
97 }
const G4VPhysicalVolume & G4IStore::GetWorldVolume ( ) const
virtual

Implements G4VIStore.

Definition at line 84 of file G4IStore.cc.

85 {
86  return *fWorldVolume;
87 }
G4bool G4IStore::IsKnown ( const G4GeometryCell &  gCell) const
virtual

Implements G4VIStore.

Definition at line 178 of file G4IStore.cc.

References G4GeometryCell::GetPhysicalVolume().

178  {
179  G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
180 
181  if ( inWorldKnown ) {
182  SetInternalIterator(gCell);
183  inWorldKnown = (fCurrentIterator!=fGeometryCelli.end());
184  }
185  return inWorldKnown;
186 }
bool G4bool
Definition: G4Types.hh:79
const G4VPhysicalVolume & GetPhysicalVolume() const
void G4IStore::SetParallelWorldVolume ( G4String  paraName)

Definition at line 76 of file G4IStore.cc.

References G4cout, G4endl, G4VPhysicalVolume::GetName(), G4TransportationManager::GetParallelWorld(), and G4TransportationManager::GetTransportationManager().

77 {
78  G4cout << " G4IStore:: SetParallelWorldVolume " << G4endl;
80  G4cout << " ParallelWorld volume is: " << fWorldVolume->GetName() << G4endl;
81  // fGeometryCelli = new G4GeometryCellImportance;
82 }
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
#define G4endl
Definition: G4ios.hh:61
void G4IStore::SetWorldVolume ( )

Definition at line 68 of file G4IStore.cc.

References G4cout, G4endl, G4VPhysicalVolume::GetName(), G4TransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetTransportationManager(), and G4Navigator::GetWorldVolume().

69 {
70  G4cout << " G4IStore:: SetWorldVolume " << G4endl;
72  G4cout << " World volume is: " << fWorldVolume->GetName() << G4endl;
73  // fGeometryCelli = new G4GeometryCellImportance;
74 }
G4Navigator * GetNavigatorForTracking() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetWorldVolume() const

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