|
Lines 417-422
Link Here
|
| 417 |
InitialiseStep(track); |
417 |
InitialiseStep(track); |
| 418 |
if(!currentModel->IsActive(preStepKinEnergy)) { return x; } |
418 |
if(!currentModel->IsActive(preStepKinEnergy)) { return x; } |
| 419 |
|
419 |
|
|
|
420 |
// forced biasing only for primary particles |
| 421 |
if(biasManager) { |
| 422 |
if(0 == track.GetParentID()) { |
| 423 |
if(0 == track.GetCurrentStepNumber()) { |
| 424 |
biasFlag = true; |
| 425 |
biasManager->ResetForcedInteraction(); |
| 426 |
} |
| 427 |
if(biasFlag && biasManager->ForcedInteractionRegion(currentCoupleIndex)) { |
| 428 |
return biasManager->GetStepLimit(currentCoupleIndex, previousStepSize); |
| 429 |
} |
| 430 |
} |
| 431 |
} |
| 420 |
|
432 |
|
| 421 |
// compute mean free path |
433 |
// compute mean free path |
| 422 |
if(preStepKinEnergy < mfpKinEnergy) { |
434 |
if(preStepKinEnergy < mfpKinEnergy) { |
|
Lines 465-489
Link Here
|
| 465 |
} |
477 |
} |
| 466 |
currentInteractionLength = DBL_MAX; |
478 |
currentInteractionLength = DBL_MAX; |
| 467 |
} |
479 |
} |
| 468 |
|
|
|
| 469 |
|
| 470 |
/*forced biasing only for primary particles |
| 471 |
nb. we sample the intreaction length as per usual, then we scale it as below |
| 472 |
this ensures that the relative prob of each process occurring is correct |
| 473 |
whilst ensuring that the first interaction occurs within the forced interaction length*/ |
| 474 |
if(biasManager) { |
| 475 |
if(0 == track.GetParentID()) { |
| 476 |
if(1 == track.GetCurrentStepNumber()) { |
| 477 |
biasFlag = true; |
| 478 |
biasManager->ResetForcedInteraction(); |
| 479 |
} |
| 480 |
if(biasFlag && biasManager->ForcedInteractionRegion(currentCoupleIndex)) { |
| 481 |
G4double forcedLength = biasManager->GetStepLimit(currentCoupleIndex, previousStepSize); |
| 482 |
if (forcedLength > 0) x = (1 - exp(-(x/30000*mm)))*forcedLength;//NB, 30000*mm is arbitrary |
| 483 |
} |
| 484 |
} |
| 485 |
} |
| 486 |
|
| 487 |
return x; |
480 |
return x; |
| 488 |
} |
481 |
} |
| 489 |
|
482 |
|