52 : fParticleName(particlename),
54 fImportanceConfigurator(0),
57 fWeightCutOffConfigurator(0),
59 fWeightWindowConfigurator(0),
71 : fParticleName(particlename),
72 fWorldName(worldName),
73 fImportanceConfigurator(0),
76 fWeightCutOffConfigurator(0),
78 fWeightWindowConfigurator(0),
96 if (fImportanceConfigurator)
98 delete fImportanceConfigurator;
99 fImportanceConfigurator = 0;
101 if (fWeightWindowConfigurator)
103 delete fWeightWindowConfigurator;
104 fWeightWindowConfigurator = 0;
111 if (fWeightCutOffConfigurator)
113 delete fWeightCutOffConfigurator;
114 fWeightCutOffConfigurator = 0;
122 fConfigurators.clear();
123 fIsConfigured =
false;
131 G4cout <<
"WARNING - G4GeometrySampler::IsConfigured()"
132 <<
" Some initalization exists, use ClearSampling()"
133 <<
" before a new initialization !" <<
G4endl;
163 G4cout <<
"G4GeometrySampler:: preparing importance sampling WorldName is " << fWorldName <<
G4endl;
167 fImportanceConfigurator =
172 if (!fImportanceConfigurator)
174 G4Exception(
"G4GeometrySampler::PrepareImportanceSampling()",
176 "Failed allocation of G4ImportanceConfigurator !");
186 G4cout <<
"G4GeometrySampler:: preparing weight roulette" <<
G4endl;
195 fWeightCutOffConfigurator =
203 if (!fWeightCutOffConfigurator)
205 G4Exception(
"G4GeometrySampler::PrepareWeightRoulett()",
207 "Failed allocation of G4WeightCutOffConfigurator !");
217 G4cout <<
"G4GeometrySampler:: preparing weight window" <<
G4endl;
221 fWeightWindowConfigurator =
225 placeOfAction, paraflag);
239 fIsConfigured =
true;
247 if (fImportanceConfigurator)
249 fConfigurators.push_back(fImportanceConfigurator);
251 if (fWeightWindowConfigurator)
253 fConfigurators.push_back(fWeightWindowConfigurator);
278 #ifdef G4MULTITHREADED
279 G4cout <<
" make sure AddProcess() is invoked for biasing!!! " <<
G4endl;
292 for (G4Configurators::iterator it = fConfigurators.begin();
293 it != fConfigurators.end(); it++)
300 if (fWeightCutOffConfigurator)
320 fParticleName = particlename;
virtual G4bool IsConfigured() const
void SetWorld(const G4VPhysicalVolume *world)
virtual void Configure(G4VSamplerConfigurator *preConf)=0
virtual void PrepareWeightWindow(G4VWeightWindowStore *wwstore, G4VWeightWindowAlgorithm *wwAlg, G4PlaceOfAction placeOfAction)
G4Navigator * GetNavigatorForTracking() const
G4GeometrySampler(G4VPhysicalVolume *worldvolume, const G4String &particlename)
void SetParallel(G4bool paraflag)
void SetWorldName(G4String Name)
virtual const G4VPhysicalVolume & GetWorldVolume() const =0
virtual void ClearSampling()
G4GLOB_DLL std::ostream G4cout
virtual void AddProcess()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
virtual void Configure(G4VSamplerConfigurator *preConf)
virtual void PrepareWeightRoulett(G4double wsurvive, G4double wlimit, G4double isource)
void SetParticle(const G4String &particlename)
virtual const G4VPhysicalVolume & GetWorldVolume() const =0
G4VPhysicalVolume * GetWorldVolume() const
virtual void PrepareImportanceSampling(G4VIStore *istore, const G4VImportanceAlgorithm *ialg)
virtual ~G4GeometrySampler()