12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Toolkit FundamentalsNote• An importance value must be assigned to every cell.The different cases:• Cell is not in storeNot filling a certain cell in the store will cause an exception.• Importance value = zeroTracks of the chosen particle type will be killed.• importance values > 0Normal allowed values• Importance value smaller zeroNot allowed!3.7.1.4. The Importance Sampling AlgorithmImportance sampling supports using a customized importance sampling algorithm. To this end, the sampler interfaceG4VSampler may be given a pointer to the interface G4VImportanceAlgorithm:class G4VImportanceAlgorithm{public:G4VImportanceAlgorithm();virtual ~G4VImportanceAlgorithm();virtual G4Nsplit_Weight Calculate(G4double ipre,G4double ipost,G4double init_w) const = 0;};The method Calculate() takes the arguments:• ipre, ipost: importance of the previous cell and the importance of the current cell, respectively.• init_w: the particles weightIt returns the struct:class G4Nsplit_Weight{public:G4int fN;G4double fW;};• fN: the calculated number of particles to exit the importance sampling• fW: the weight of the particlesThe user may have a customized algorithm used by providing a class inheriting fromG4VImportanceAlgorithm.If no customized algorithm is given to the sampler the default importance sampling algorithm is used. This algorithmis implemented in G4ImportanceAlgorithm.3.7.1.5. The Weight Window TechniqueThe weight window technique is a weight-based alternative to importance sampling:• applies splitting and Russian roulette depending on space (cells) and energy55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!