Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4GeometrySampler Class Reference

#include <G4GeometrySampler.hh>

Inheritance diagram for G4GeometrySampler:
G4VSampler

Public Member Functions

virtual void AddProcess ()
 
virtual void ClearSampling ()
 
virtual void Configure ()
 
 G4GeometrySampler (G4String worldvolumeName, const G4String &particlename)
 
 G4GeometrySampler (G4VPhysicalVolume *worldvolume, const G4String &particlename)
 
G4String GetParticleName ()
 
virtual G4bool IsConfigured () const
 
virtual void PrepareImportanceSampling (G4VIStore *istore, const G4VImportanceAlgorithm *ialg)
 
virtual void PrepareWeightRoulett (G4double wsurvive, G4double wlimit, G4double isource)
 
virtual void PrepareWeightWindow (G4VWeightWindowStore *wwstore, G4VWeightWindowAlgorithm *wwAlg, G4PlaceOfAction placeOfAction)
 
void SetParallel (G4bool paraflag)
 
void SetParticle (const G4String &particlename)
 
void SetWorld (const G4VPhysicalVolume *world)
 
virtual ~G4GeometrySampler ()
 

Private Member Functions

 G4GeometrySampler (const G4GeometrySampler &)
 
G4GeometrySampleroperator= (const G4GeometrySampler &)
 

Private Attributes

G4Configurators fConfigurators
 
G4ImportanceConfiguratorfImportanceConfigurator
 
G4bool fIsConfigured
 
G4VIStorefIStore
 
G4String fParticleName
 
G4WeightCutOffConfiguratorfWeightCutOffConfigurator
 
G4WeightWindowConfiguratorfWeightWindowConfigurator
 
const G4VPhysicalVolumefWorld
 
G4String fWorldName
 
G4VWeightWindowStorefWWStore
 
G4bool paraflag
 

Detailed Description

Definition at line 52 of file G4GeometrySampler.hh.

Constructor & Destructor Documentation

◆ G4GeometrySampler() [1/3]

G4GeometrySampler::G4GeometrySampler ( G4VPhysicalVolume worldvolume,
const G4String particlename 
)
explicit

Definition at line 49 of file G4GeometrySampler.cc.

51 : fParticleName(particlename),
52 fWorld(world),
54 // fScoreConfigurator(0),
55 // fGCellFinder(0),
57 fIStore(0),
59 fWWStore(0),
60 fIsConfigured(false)
61{
62 paraflag = false;
63 // fWorldName = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetName();
64 // if(fWorld == G4TransportationManager::GetTransportationManager()->GetParallelWorld(fWorld->GetName())) paraflag = true;
65 // G4cout << "G4GeometrySampler:: Making geometry sampler with world: " << fWorld->GetName() << G4endl;
66}
G4VWeightWindowStore * fWWStore
const G4VPhysicalVolume * fWorld
G4WeightWindowConfigurator * fWeightWindowConfigurator
G4ImportanceConfigurator * fImportanceConfigurator
G4WeightCutOffConfigurator * fWeightCutOffConfigurator

References paraflag.

◆ G4GeometrySampler() [2/3]

G4GeometrySampler::G4GeometrySampler ( G4String  worldvolumeName,
const G4String particlename 
)
explicit

Definition at line 68 of file G4GeometrySampler.cc.

70 : fParticleName(particlename),
71 fWorldName(worldName),
73 // fScoreConfigurator(0),
74 // fGCellFinder(0),
76 fIStore(0),
78 fWWStore(0),
79 fIsConfigured(false)
80{
81 paraflag = false;
83 // fWorld = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
84 // G4cout << "G4GeometrySampler:: Making geometry sampler with world: " << fWorld->GetName() << G4endl;
85 //G4TransportationManager::GetTransportationManager()->GetParallelWorld(parallelworldName)
86}
G4VPhysicalVolume * GetWorldVolume() const
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const

References fWorld, G4TransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetTransportationManager(), G4Navigator::GetWorldVolume(), and paraflag.

◆ ~G4GeometrySampler()

G4GeometrySampler::~G4GeometrySampler ( )
virtual

Definition at line 88 of file G4GeometrySampler.cc.

89{
90 // ClearSampling();
91}

◆ G4GeometrySampler() [3/3]

G4GeometrySampler::G4GeometrySampler ( const G4GeometrySampler )
private

Member Function Documentation

◆ AddProcess()

void G4GeometrySampler::AddProcess ( )
virtual

Definition at line 286 of file G4GeometrySampler.cc.

287{
288
289 G4VSamplerConfigurator *preConf = 0;
290 G4int i = 0;
291 for (G4Configurators::iterator it = fConfigurators.begin();
292 it != fConfigurators.end(); it++)
293 {
294 i++;
295 G4VSamplerConfigurator *currConf =*it;
296 currConf->Configure(preConf);
297 preConf = *it;
298 }
300 {
302 }
303
304 return;
305}
int G4int
Definition: G4Types.hh:85
G4Configurators fConfigurators
virtual void Configure(G4VSamplerConfigurator *preConf)=0
virtual void Configure(G4VSamplerConfigurator *preConf)

References G4WeightCutOffConfigurator::Configure(), G4VSamplerConfigurator::Configure(), fConfigurators, and fWeightCutOffConfigurator.

Referenced by Configure(), G4ImportanceBiasing::ConstructProcess(), and G4WeightWindowBiasing::ConstructProcess().

◆ ClearSampling()

void G4GeometrySampler::ClearSampling ( )
virtual

Implements G4VSampler.

Definition at line 93 of file G4GeometrySampler.cc.

94{
96 {
99 }
101 {
104 }
105// if (fScoreConfigurator)
106// {
107// delete fScoreConfigurator;
108// fScoreConfigurator = 0;
109// }
111 {
114 }
115// if (fGCellFinder)
116// {
117// delete fGCellFinder;
118// fGCellFinder = 0;
119// }
120 fIStore = 0;
121 fConfigurators.clear();
122 fIsConfigured = false;
123}

References fConfigurators, fImportanceConfigurator, fIsConfigured, fIStore, fWeightCutOffConfigurator, and fWeightWindowConfigurator.

◆ Configure()

void G4GeometrySampler::Configure ( )
virtual

Implements G4VSampler.

Definition at line 234 of file G4GeometrySampler.cc.

235{
236 if (!IsConfigured())
237 {
238 fIsConfigured = true;
239
240// if (fScoreConfigurator)
241// {
242// G4cout << " score configurator push_back " << G4endl;
243// fConfigurators.push_back(fScoreConfigurator);
244// G4cout << " pushed " << G4endl;
245// }
247 {
249 }
251 {
253 }
254
255 // G4cout << " vsampler configurator loop " << G4endl;
256 // G4VSamplerConfigurator *preConf = 0;
257 // G4int i = 0;
258 // for (G4Configurators::iterator it = fConfigurators.begin();
259 // it != fConfigurators.end(); it++)
260 // {
261 // i++;
262 // G4cout << " looping " << i << G4endl;
263 // G4VSamplerConfigurator *currConf =*it;
264 // G4cout << " sampler configurator " << G4endl;
265 // currConf->Configure(preConf);
266 // G4cout << " configure preconf " << G4endl;
267 // preConf = *it;
268 // }
269 // if (fWeightCutOffConfigurator)
270 // {
271 // G4cout << " NEW weight window configure " << G4endl;
272 // fWeightCutOffConfigurator->Configure(0);
273 // G4cout << " configured " << G4endl;
274 // }
275 }
276
277#ifdef G4MULTITHREADED
278 G4cout << " make sure AddProcess() is invoked for biasing!!! " << G4endl;
279#else
280 AddProcess();
281#endif
282
283 return;
284}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual G4bool IsConfigured() const
virtual void AddProcess()

References AddProcess(), fConfigurators, fImportanceConfigurator, fIsConfigured, fWeightWindowConfigurator, G4cout, G4endl, and IsConfigured().

Referenced by G4ImportanceBiasing::ConstructProcess(), and G4WeightWindowBiasing::ConstructProcess().

◆ GetParticleName()

G4String G4GeometrySampler::GetParticleName ( )
inline

Definition at line 83 of file G4GeometrySampler.hh.

83{return fParticleName;};

References fParticleName.

◆ IsConfigured()

G4bool G4GeometrySampler::IsConfigured ( ) const
virtual

Implements G4VSampler.

Definition at line 125 of file G4GeometrySampler.cc.

126{
127 G4bool isconf = false;
128 if (fIsConfigured)
129 {
130 G4cout << "WARNING - G4GeometrySampler::IsConfigured()"
131 << " Some initialization exists, use ClearSampling()"
132 << " before a new initialization !" << G4endl;
133 isconf = true;
134 }
135 return isconf;
136}
bool G4bool
Definition: G4Types.hh:86

References fIsConfigured, G4cout, and G4endl.

Referenced by Configure().

◆ operator=()

G4GeometrySampler & G4GeometrySampler::operator= ( const G4GeometrySampler )
private

◆ PrepareImportanceSampling()

void G4GeometrySampler::PrepareImportanceSampling ( G4VIStore istore,
const G4VImportanceAlgorithm ialg 
)
virtual

Implements G4VSampler.

Definition at line 159 of file G4GeometrySampler.cc.

161{
162 G4cout << "G4GeometrySampler:: preparing importance sampling WorldName is " << fWorldName << G4endl;
163 fIStore = istore;
164 // G4cout << "G4GeometrySampler:: creating istore, worldVolume: " << fWorld->GetName() << G4endl;
165
168 // new G4ImportanceConfigurator(fWorld, fParticleName, *fIStore, ialg, paraflag);
170
172 {
173 G4Exception("G4GeometrySampler::PrepareImportanceSampling()",
174 "FatalError", FatalException,
175 "Failed allocation of G4ImportanceConfigurator !");
176 }
177}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
void SetWorldName(const G4String &Name)
virtual const G4VPhysicalVolume & GetWorldVolume() const =0

References FatalException, fImportanceConfigurator, fIStore, fParticleName, fWorldName, G4cout, G4endl, G4Exception(), G4VIStore::GetWorldVolume(), paraflag, and G4ImportanceConfigurator::SetWorldName().

Referenced by G4ImportanceBiasing::ConstructProcess().

◆ PrepareWeightRoulett()

void G4GeometrySampler::PrepareWeightRoulett ( G4double  wsurvive,
G4double  wlimit,
G4double  isource 
)
virtual

Implements G4VSampler.

Definition at line 180 of file G4GeometrySampler.cc.

183{
184 // fGCellFinder = new G4GCellFinder(fWorld);
185 G4cout << "G4GeometrySampler:: preparing weight roulette" << G4endl;
186 // fGCellFinder = new G4GCellFinder();
187// if (!fGCellFinder)
188// {
189// G4Exception("G4GeometrySampler::PrepareWeightRoulett()",
190// "FatalError", FatalException,
191// "Failed allocation of G4GCellFinder !");
192// }
193
196 wsurvive,
197 wlimit,
198 isource,
199 fIStore,
200 paraflag);
201 //*fGCellFinder, paraflag);
203 {
204 G4Exception("G4GeometrySampler::PrepareWeightRoulett()",
205 "FatalError", FatalException,
206 "Failed allocation of G4WeightCutOffConfigurator !");
207 }
208}

References FatalException, fIStore, fParticleName, fWeightCutOffConfigurator, fWorld, G4cout, G4endl, G4Exception(), and paraflag.

◆ PrepareWeightWindow()

void G4GeometrySampler::PrepareWeightWindow ( G4VWeightWindowStore wwstore,
G4VWeightWindowAlgorithm wwAlg,
G4PlaceOfAction  placeOfAction 
)
virtual

Implements G4VSampler.

Definition at line 211 of file G4GeometrySampler.cc.

214{
215
216 G4cout << "G4GeometrySampler:: preparing weight window" << G4endl;
217
218 fWWStore = wwstore;
219
222 *fWWStore,
223 wwAlg,
224 placeOfAction, paraflag);
225
226 // fWeightWindowConfigurator =
227 // new G4WeightWindowConfigurator(fWorld, fParticleName,
228 // *fWWStore,
229 // wwAlg,
230 // placeOfAction, paraflag);
231
232}
virtual const G4VPhysicalVolume & GetWorldVolume() const =0

References fParticleName, fWeightWindowConfigurator, fWWStore, G4cout, G4endl, G4VWeightWindowStore::GetWorldVolume(), and paraflag.

Referenced by G4WeightWindowBiasing::ConstructProcess().

◆ SetParallel()

void G4GeometrySampler::SetParallel ( G4bool  paraflag)
virtual

Implements G4VSampler.

Definition at line 307 of file G4GeometrySampler.cc.

308{
309 paraflag = para;
310}

References paraflag.

Referenced by G4ImportanceBiasing::ConstructProcess(), and G4WeightWindowBiasing::ConstructProcess().

◆ SetParticle()

void G4GeometrySampler::SetParticle ( const G4String particlename)

Definition at line 317 of file G4GeometrySampler.cc.

318{
319 fParticleName = particlename;
320}

References fParticleName.

◆ SetWorld()

void G4GeometrySampler::SetWorld ( const G4VPhysicalVolume world)

Definition at line 312 of file G4GeometrySampler.cc.

313{
314 fWorld = World;
315}

References fWorld.

Field Documentation

◆ fConfigurators

G4Configurators G4GeometrySampler::fConfigurators
private

Definition at line 104 of file G4GeometrySampler.hh.

Referenced by AddProcess(), ClearSampling(), and Configure().

◆ fImportanceConfigurator

G4ImportanceConfigurator* G4GeometrySampler::fImportanceConfigurator
private

Definition at line 96 of file G4GeometrySampler.hh.

Referenced by ClearSampling(), Configure(), and PrepareImportanceSampling().

◆ fIsConfigured

G4bool G4GeometrySampler::fIsConfigured
private

Definition at line 103 of file G4GeometrySampler.hh.

Referenced by ClearSampling(), Configure(), and IsConfigured().

◆ fIStore

G4VIStore* G4GeometrySampler::fIStore
private

◆ fParticleName

G4String G4GeometrySampler::fParticleName
private

◆ fWeightCutOffConfigurator

G4WeightCutOffConfigurator* G4GeometrySampler::fWeightCutOffConfigurator
private

Definition at line 99 of file G4GeometrySampler.hh.

Referenced by AddProcess(), ClearSampling(), and PrepareWeightRoulett().

◆ fWeightWindowConfigurator

G4WeightWindowConfigurator* G4GeometrySampler::fWeightWindowConfigurator
private

Definition at line 101 of file G4GeometrySampler.hh.

Referenced by ClearSampling(), Configure(), and PrepareWeightWindow().

◆ fWorld

const G4VPhysicalVolume* G4GeometrySampler::fWorld
private

Definition at line 94 of file G4GeometrySampler.hh.

Referenced by G4GeometrySampler(), PrepareWeightRoulett(), and SetWorld().

◆ fWorldName

G4String G4GeometrySampler::fWorldName
private

Definition at line 95 of file G4GeometrySampler.hh.

Referenced by PrepareImportanceSampling().

◆ fWWStore

G4VWeightWindowStore* G4GeometrySampler::fWWStore
private

Definition at line 102 of file G4GeometrySampler.hh.

Referenced by PrepareWeightWindow().

◆ paraflag

G4bool G4GeometrySampler::paraflag
private

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