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 Fundamentalsvoid AddUpperEboundLowerWeightPairs(const G4GeometryCell &gCell,const G4UpperEnergyToLowerWeightMap&enWeMap);void SetGeneralUpperEnergyBounds(conststd::set & enBounds);private::...};The user may choose equal energy bounds <strong>for</strong> all cells. In this case a set of upper energy bounds must be given tothe store using the method SetGeneralUpperEnergyBounds. If a general set of energy bounds have beenset AddLowerWeights can be used to add the cells.Alternatively, the user may chose different energy regions <strong>for</strong> different cells. In this case the user must provide amapping of upper energy bounds to lower weight bounds <strong>for</strong> every cell using the method AddUpperEbound-LowerWeightPairs.Weight window algorithms implementing the interface class G4VWeightWindowAlgorithm can be used todefine a customized algorithm:class G4VWeightWindowAlgorithm {public:G4VWeightWindowAlgorithm();virtual ~G4VWeightWindowAlgorithm();virtual G4Nsplit_Weight Calculate(G4double init_w,G4double lowerWeightBound) const = 0;};A concrete implementation is provided and used as a default:class G4WeightWindowAlgorithm : public G4VWeightWindowAlgorithm {public:G4WeightWindowAlgorithm(G4double upperLimitFaktor = 5,G4double survivalFaktor = 3,G4int maxNumberOfSplits = 5);virtual ~G4WeightWindowAlgorithm();virtual G4Nsplit_Weight Calculate(G4double init_w,G4double lowerWeightBound) const;private:...};The constructor takes three parameters which are used to: calculate the upper weight bound (upperLimitFaktor),calculate the survival weight (survivalFaktor), and introduce a maximal number (maxNumberOfSplits) of copiesto be created in one go.In addition, the inverse of the maxNumberOfSplits is used to specify the minimum survival probability in caseof Russian roulette.3.7.1.6. The Weight Roulette TechniqueWeight roulette (also called weight cutoff) is usually applied if importance sampling and implicit capture are usedtogether. Implicit capture is not described here but it is useful to note that this procedure reduces a particle weightin every collision instead of killing the particle with some probability.Together with importance sampling the weight of a particle may become so low that it does not change any resultsignificantly. Hence tracking a very low weight particle is a waste of computing time. Weight roulette is appliedin order to solve this problem.The weight roulette conceptWeight roulette takes into account the importance "Ic" of the current cell and the importance "Is" of the cell inwhich the source is located, by using the ratio "R=Is/Ic".57

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

Saved successfully!

Ooh no, something went wrong!