Loading...
Searching...
No Matches
GB06BOptrSplitAndKillByImportance.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26/// \file GB06/src/GB06BOptrSplitAndKillByImportance.cc
27/// \brief Implementation of the GB06BOptrSplitAndKillByImportance class
28//
31
32#include "G4BiasingProcessInterface.hh"
33#include "G4ParallelGeometriesLimiterProcess.hh"
34#include "G4BiasingProcessSharedData.hh"
35
36
37#include "G4ParticleDefinition.hh"
38#include "G4ParticleTable.hh"
39#include "G4VProcess.hh"
40
41#include "G4TransportationManager.hh"
42#include "G4TouchableHandle.hh"
43
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
48 G4String name)
49 : G4VBiasingOperator(name),
50 fParallelWorld ( nullptr ),
51 fParallelWorldIndex ( -1 ),
52 fBiasingLimiterProcess ( nullptr )
53{
54 fParticleToBias = G4ParticleTable::GetParticleTable()->FindParticle(particleName);
55
56 if ( fParticleToBias == 0 )
57 {
58 G4ExceptionDescription ed;
59 ed << "Particle `" << particleName << "' not found !" << G4endl;
60 G4Exception("GB06BOptrSplitAndKillByImportance(...)",
61 "exGB06.01",
62 JustWarning,
63 ed);
64 }
65
67 new GB06BOptnSplitAndKillByImportance("splitterFor_"+particleName);
68
69}
70
71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72
77
78//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79
81{
82 // ---------------
83 // -- Setup stage:
84 // ---------------
85 // -- get the particle process manager...
86 const G4ProcessManager* processManager = fParticleToBias->GetProcessManager();
87 // -- ... to obtain the biasing information shared among this particle processes:
88 fBiasingSharedData = G4BiasingProcessInterface::GetSharedData( processManager );
89 // -- Remember the index of the parallel world:
90 fBiasingLimiterProcess = fBiasingSharedData->GetParallelGeometriesLimiterProcess();
92
93 // -- Setup the biasing operation:
94 fSplitAndKillByImportance-> SetBiasingSharedData( fBiasingSharedData );
96 fSplitAndKillByImportance-> SetImportanceMap( &fImportanceMap );
97
98}
99
100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101
105 const G4BiasingProcessInterface* /*callingProcess*/)
106{
107 // -- Check if current particle type is the one to bias:
108 if ( track->GetDefinition() != fParticleToBias ) return 0;
109
110 // -- if so, request biasing:
112
113}
114
Definition of the GB06BOptnSplitAndKillByImportance class.
Definition of the GB06BOptrSplitAndKillByImportance class.
const G4ParallelGeometriesLimiterProcess * fBiasingLimiterProcess
GB06BOptrSplitAndKillByImportance(G4String particleToBias, G4String name="SplitAndKillByImportance")
const G4BiasingProcessSharedData * fBiasingSharedData
GB06BOptnSplitAndKillByImportance * fSplitAndKillByImportance
virtual G4VBiasingOperation * ProposeNonPhysicsBiasingOperation(const G4Track *, const G4BiasingProcessInterface *) final

Applications | User Support | Publications | Collaboration