#include <G4EmBiasingManager.hh>
|
| G4EmBiasingManager () |
|
| ~G4EmBiasingManager () |
|
void | Initialise (const G4ParticleDefinition &part, const G4String &procName, G4int verbose) |
|
void | ActivateForcedInteraction (G4double length=0.0, const G4String &r="") |
|
void | ActivateSecondaryBiasing (const G4String ®ion, G4double factor, G4double energyLimit) |
|
G4double | GetStepLimit (G4int coupleIdx, G4double previousStep) |
|
G4double | ApplySecondaryBiasing (std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0) |
|
G4double | ApplySecondaryBiasing (std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForLoss *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0) |
|
G4double | ApplySecondaryBiasing (std::vector< G4Track * > &, G4int coupleIdx) |
|
G4bool | SecondaryBiasingRegion (G4int coupleIdx) |
|
G4bool | ForcedInteractionRegion (G4int coupleIdx) |
|
void | ResetForcedInteraction () |
|
Definition at line 67 of file G4EmBiasingManager.hh.
G4EmBiasingManager::G4EmBiasingManager |
( |
| ) |
|
Definition at line 65 of file G4EmBiasingManager.cc.
66 : nForcedRegions(0),nSecBiasedRegions(0),eIonisation(
nullptr),
67 currentStepLimit(0.0),startTracking(
true)
69 fSafetyMin = 1.e-6*
mm;
static constexpr double mm
static G4Electron * Electron()
G4EmBiasingManager::~G4EmBiasingManager |
( |
| ) |
|
void G4EmBiasingManager::ActivateForcedInteraction |
( |
G4double |
length = 0.0 , |
|
|
const G4String & |
r = "" |
|
) |
| |
Definition at line 146 of file G4EmBiasingManager.cc.
151 if(name ==
"" || name ==
"world" || name ==
"World") {
152 name =
"DefaultRegionForTheWorld";
156 G4cout <<
"### G4EmBiasingManager::ForcedInteraction WARNING: "
158 << rname <<
"> is unknown" <<
G4endl;
163 if (0 < nForcedRegions) {
164 for (
G4int i=0; i<nForcedRegions; ++i) {
165 if (reg == forcedRegions[i]) {
166 lengthForRegion[i] = val;
172 G4cout <<
"### G4EmBiasingManager::ForcedInteraction WARNING: "
173 << val <<
" < 0.0, so no activation for the G4Region <"
174 << rname <<
">" <<
G4endl;
179 forcedRegions.push_back(reg);
180 lengthForRegion.push_back(val);
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static const G4double reg
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
Definition at line 187 of file G4EmBiasingManager.cc.
196 if(name ==
"" || name ==
"world" || name ==
"World") {
197 name =
"DefaultRegionForTheWorld";
201 G4cout <<
"### G4EmBiasingManager::ActivateBremsstrahlungSplitting "
202 <<
"WARNING: G4Region <"
203 << rname <<
"> is unknown" <<
G4endl;
217 }
else if(0.0 < factor) {
223 if (0 < nSecBiasedRegions) {
224 for (
G4int i=0; i<nSecBiasedRegions; ++i) {
225 if (reg == secBiasedRegions[i]) {
226 secBiasedWeight[i] = w;
227 nBremSplitting[i] = nsplit;
228 secBiasedEnegryLimit[i] = energyLimit;
240 secBiasedRegions.push_back(reg);
241 secBiasedWeight.push_back(w);
242 nBremSplitting.push_back(nsplit);
243 secBiasedEnegryLimit.push_back(energyLimit);
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static const G4double reg
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
Definition at line 320 of file G4EmBiasingManager.cc.
330 G4int index = idxSecBiasedCouple[coupleIdx];
333 size_t n = vd.size();
338 if(0 < n && vd[0]->GetKineticEnergy() < secBiasedEnegryLimit[index]) {
340 G4int nsplit = nBremSplitting[index];
344 if(safety > fSafetyMin) { ApplyRangeCut(vd, track, eloss, safety); }
347 }
else if(1 == nsplit) {
348 weight = ApplyRussianRoulette(vd, index);
352 G4double tmpEnergy = pPartChange->GetProposedKineticEnergy();
353 G4ThreeVector tmpMomDir = pPartChange->GetProposedMomentumDirection();
355 weight = ApplySplitting(vd, track, currentModel, index, tcut);
357 pPartChange->SetProposedKineticEnergy(tmpEnergy);
358 pPartChange->ProposeMomentumDirection(tmpMomDir);
Definition at line 272 of file G4EmBiasingManager.cc.
282 G4int index = idxSecBiasedCouple[coupleIdx];
285 size_t n = vd.size();
290 if(0 < n && vd[0]->GetKineticEnergy() < secBiasedEnegryLimit[index]) {
292 G4int nsplit = nBremSplitting[index];
296 if(safety > fSafetyMin) { ApplyRangeCut(vd, track, eloss, safety); }
299 }
else if(1 == nsplit) {
300 weight = ApplyRussianRoulette(vd, index);
304 G4double tmpEnergy = pPartChange->GetProposedKineticEnergy();
305 G4ThreeVector tmpMomDir = pPartChange->GetProposedMomentumDirection();
307 weight = ApplySplitting(vd, track, currentModel, index, tcut);
309 pPartChange->SetProposedKineticEnergy(tmpEnergy);
310 pPartChange->ProposeMomentumDirection(tmpMomDir);
G4double G4EmBiasingManager::ApplySecondaryBiasing |
( |
std::vector< G4Track * > & |
track, |
|
|
G4int |
coupleIdx |
|
) |
| |
Definition at line 368 of file G4EmBiasingManager.cc.
371 G4int index = idxSecBiasedCouple[coupleIdx];
374 size_t n = track.size();
379 if(0 < n && track[0]->GetKineticEnergy() < secBiasedEnegryLimit[index]) {
381 G4int nsplit = nBremSplitting[index];
385 weight = secBiasedWeight[index];
386 for(
size_t k=0; k<
n; ++k) {
G4bool G4EmBiasingManager::ForcedInteractionRegion |
( |
G4int |
coupleIdx | ) |
|
|
inline |
Definition at line 177 of file G4EmBiasingManager.hh.
180 if(nForcedRegions > 0) {
181 if(idxForcedCouple[coupleIdx] >= 0) { res =
true; }
Definition at line 250 of file G4EmBiasingManager.cc.
254 startTracking =
false;
255 G4int i = idxForcedCouple[coupleIdx];
259 currentStepLimit = lengthForRegion[i];
260 if(currentStepLimit > 0.0) { currentStepLimit *=
G4UniformRand(); }
263 currentStepLimit -= previousStep;
265 if(currentStepLimit < 0.0) { currentStepLimit = 0.0; }
266 return currentStepLimit;
Definition at line 80 of file G4EmBiasingManager.cc.
90 if(0 < nForcedRegions) { idxForcedCouple.resize(numOfCouples, -1); }
91 if(0 < nSecBiasedRegions) { idxSecBiasedCouple.resize(numOfCouples, -1); }
94 for (
size_t j=0; j<numOfCouples; ++j) {
98 if(0 < nForcedRegions) {
99 for(
G4int i=0; i<nForcedRegions; ++i) {
100 if(forcedRegions[i]) {
101 if(pcuts == forcedRegions[i]->GetProductionCuts()) {
102 idxForcedCouple[j] = i;
108 if(0 < nSecBiasedRegions) {
109 for(
G4int i=0; i<nSecBiasedRegions; ++i) {
110 if(secBiasedRegions[i]) {
111 if(pcuts == secBiasedRegions[i]->GetProductionCuts()) {
112 idxSecBiasedCouple[j] = i;
119 if (nForcedRegions > 0 && 0 < verbose) {
120 G4cout <<
" Forced Interaction is activated for "
123 <<
" inside G4Regions: " <<
G4endl;
124 for (
G4int i=0; i<nForcedRegions; ++i) {
125 const G4Region* r = forcedRegions[i];
129 if (nSecBiasedRegions > 0 && 0 < verbose) {
130 G4cout <<
" Secondary biasing is activated for "
133 <<
" inside G4Regions: " <<
G4endl;
134 for (
G4int i=0; i<nSecBiasedRegions; ++i) {
135 const G4Region* r = secBiasedRegions[i];
138 <<
" BiasingWeight= " << secBiasedWeight[i] <<
G4endl;
const G4String & GetName() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4ProductionCuts * GetProductionCuts() const
void G4EmBiasingManager::ResetForcedInteraction |
( |
| ) |
|
|
inline |
G4bool G4EmBiasingManager::SecondaryBiasingRegion |
( |
G4int |
coupleIdx | ) |
|
|
inline |
Definition at line 168 of file G4EmBiasingManager.hh.
171 if(nSecBiasedRegions > 0) {
172 if(idxSecBiasedCouple[coupleIdx] >= 0) { res =
true; }
The documentation for this class was generated from the following files: