Loading...
Searching...
No Matches
GB07BOptrLeadingParticle.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 GB07/src/GB07BOptrLeadingParticle.cc
27/// \brief Implementation of the GB07BOptrLeadingParticle class
28//
30#include "G4BiasingProcessInterface.hh"
31
32#include "G4BOptnLeadingParticle.hh"
33#include "G4ParticleDefinition.hh"
34#include "G4Gamma.hh"
35#include "G4Electron.hh"
36#include "G4Positron.hh"
37#include "G4PionZero.hh"
38#include "G4ProcessManager.hh"
39
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
44 : G4VBiasingOperator ( operatorName ),
45 fAnnihilation ( nullptr ),
46 fConversion ( nullptr ),
47 fDecay ( nullptr ),
48 fTwoParticleProcess ( nullptr )
49{
51 new G4BOptnLeadingParticle("LeadingParticleBiasingOperation");
52}
53
54//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
60
61//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62
66 const G4BiasingProcessInterface* callingProcess)
67{
68 // -- When the present method is called, we are at the process final state
69 // -- generation level. The process is given by the callingProcess argument,
70 // -- which, in our case, wrappes a physics process, to control it.
71 // -- To bias the final state generation, we return a biasing operation
72 // -- which is fLeadingParticleBiasingOperation here. Before returning it, we
73 // -- configure it depending on if the process is a two-particle final state
74 // -- or if it is a many-particle final state process. For the two-particle
75 // -- final state, one track is the leading and the other is alone in its category,
76 // -- so always surviving by default. We play a Russian roulette on it to
77 // -- trim also these two-particles final states.
78
79 if ( callingProcess == fTwoParticleProcess )
80 {
81 // -- secondary particle accompagnying the leading one will be
82 // -- killed with 2./3. probability (Russian roulette):
83 fLeadingParticleBiasingOperation->SetFurtherKillingProbability( 2./3.);
84 }
85 else
86 {
87 // -- -1.0 means no effect : no further killing is applied to secondary
88 // -- particles accompanying the leading one.
89 fLeadingParticleBiasingOperation->SetFurtherKillingProbability( -1.0 );
90 }
91
93}
94
95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96
97void
100{
101 // -- collect the two-particle final state processes:
102 fAnnihilation = nullptr;
103 fConversion = nullptr;
104 fDecay = nullptr;
105
106 // ---- collect e+ annihilation process:
107 auto positronProcesses = G4Positron::Definition()->GetProcessManager()->GetProcessList();
108 for ( size_t i = 0; i < positronProcesses->size(); ++i )
109 {
110 if ( (*positronProcesses)[i]->GetProcessName() == "biasWrapper(annihil)")
111 {
112 fAnnihilation = (*positronProcesses)[i];
113 break;
114 }
115 }
116
117 // ---- collect gamma conversion process:
118 auto gammaProcesses = G4Gamma::Definition()->GetProcessManager()->GetProcessList();
119 for ( size_t i = 0; i < gammaProcesses->size(); ++i )
120 {
121 if ( (*gammaProcesses)[i]->GetProcessName() == "biasWrapper(conv)")
122 {
123 fConversion = (*gammaProcesses)[i];
124 break;
125 }
126 }
127
128 // ---- collect pi0 decay process:
129 auto pi0Processes = G4PionZero::Definition()->GetProcessManager()->GetProcessList();
130 for ( size_t i = 0; i < pi0Processes->size(); ++i )
131 {
132 if ( (*pi0Processes)[i]->GetProcessName() == "biasWrapper(Decay)")
133 {
134 fDecay = (*pi0Processes)[i];
135 break;
136 }
137 }
138}
139
140//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141
142void
144StartTracking( const G4Track* track )
145{
146 // -- remember what is the two-particle final state process -if any- for this starting
147 // -- track:
148 fTwoParticleProcess = nullptr;
149 if ( track->GetDefinition() == G4Gamma ::Definition() ) fTwoParticleProcess = fConversion;
150 if ( track->GetDefinition() == G4Positron::Definition() ) fTwoParticleProcess = fAnnihilation;
151 if ( track->GetDefinition() == G4PionZero::Definition() ) fTwoParticleProcess = fDecay;
152}
Definition of the GB07BOptrLeadingParticle class.
G4BOptnLeadingParticle * fLeadingParticleBiasingOperation
virtual G4VBiasingOperation * ProposeFinalStateBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess) final
GB07BOptrLeadingParticle(G4String operatorName="LeadingParticleBiasingOperator")
virtual void StartTracking(const G4Track *track) final

Applications | User Support | Publications | Collaboration