Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4WeightWindowAlgorithm.cc,v 1.8 2006/06/29 18:18:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4WeightWindowAlgorithm.cc,v 1.11 2007/11/09 15:43:07 ahoward Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -66,29 +66,38 @@ G4WeightWindowAlgorithm::Calculate(G4double init_w,
|
||||
if (init_w > upperWeight) {
|
||||
// splitting
|
||||
|
||||
G4double wi_ws = init_w/survivalWeight;
|
||||
G4int int_wi_ws = static_cast<int>(wi_ws);
|
||||
//TB G4double wi_ws = init_w/survivalWeight;
|
||||
//TB
|
||||
G4double temp_wi_ws = init_w/upperWeight;
|
||||
G4int split_i = static_cast<int>(temp_wi_ws);
|
||||
if(split_i != temp_wi_ws) split_i++;
|
||||
G4double wi_ws = init_w/split_i;
|
||||
|
||||
//TB
|
||||
//TB G4int int_wi_ws = static_cast<int>(wi_ws);
|
||||
|
||||
// values in case integer mode or in csae of double
|
||||
// mode and the lower number of splits will be diced
|
||||
nw.fN = int_wi_ws;
|
||||
nw.fW = survivalWeight;
|
||||
//TB nw.fN = int_wi_ws;
|
||||
//TB nw.fW = survivalWeight;
|
||||
nw.fN = split_i;
|
||||
nw.fW = wi_ws;
|
||||
|
||||
if (wi_ws <= fMaxNumberOfSplits) {
|
||||
if (wi_ws > int_wi_ws) {
|
||||
// double mode
|
||||
G4double p2 = wi_ws - int_wi_ws;
|
||||
G4double r = G4UniformRand();
|
||||
if (r<p2) {
|
||||
nw.fN = int_wi_ws + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// fMaxNumberOfSplits < wi_ws
|
||||
nw.fN = fMaxNumberOfSplits;
|
||||
nw.fW = init_w/fMaxNumberOfSplits;
|
||||
}
|
||||
//TB if (wi_ws <= fMaxNumberOfSplits) {
|
||||
//TB if (wi_ws > int_wi_ws) {
|
||||
//TB // double mode
|
||||
//TB G4double p2 = wi_ws - int_wi_ws;
|
||||
//TB G4double r = G4UniformRand();
|
||||
//TB if (r<p2) {
|
||||
//TB nw.fN = int_wi_ws + 1;
|
||||
//TB }
|
||||
//TB }
|
||||
//TB }
|
||||
//TB else {
|
||||
//TB // fMaxNumberOfSplits < wi_ws
|
||||
//TB nw.fN = fMaxNumberOfSplits;
|
||||
//TB nw.fW = init_w/fMaxNumberOfSplits;
|
||||
//TB }
|
||||
|
||||
|
||||
} else if (init_w < lowerWeightBound) {
|
||||
|
||||
Reference in New Issue
Block a user