Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CascadeDeexcitation.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// $Id$
27//
28// Takes an arbitrary excited or unphysical nuclear state and produces
29// a final state with evaporated particles and (possibly) a stable nucleus.
30//
31// 20100926 M. Kelsey -- Move to new G4VCascadeDeexcitation base class.
32// 20110302 M. Kelsey -- Don't do "final" conservation check (not needed)
33
35#include "globals.hh"
36#include "G4BigBanger.hh"
39#include "G4InuclNuclei.hh"
40#include "G4InuclParticle.hh"
41
42
43// Constructor and destructor
44
46 : G4VCascadeDeexcitation("G4CascadeDeexcitation"),
47 theBigBanger(new G4BigBanger),
48 theNonEquilibriumEvaporator(new G4NonEquilibriumEvaporator),
49 theEquilibriumEvaporator(new G4EquilibriumEvaporator) {}
50
52 delete theBigBanger;
53 delete theNonEquilibriumEvaporator;
54 delete theEquilibriumEvaporator;
55}
56
57
58// Convert generic G4Fragment into Bertini particle
59
61 G4CollisionOutput& globalOutput) {
62 if (verboseLevel > 1) {
63 G4cout << " >>> G4CascadeDeexcitation::deExcite" << G4endl;
64 }
65
66 if (!fragment) {
67 if (verboseLevel > 1) G4cerr << " NULL pointer fragment" << G4endl;
68 return;
69 }
70
71 if (verboseLevel > 1) G4cout << *fragment << G4endl;
72
73 G4InuclNuclei target(*fragment);
74 collide(0, &target, globalOutput);
75}
76
77
78// Main processing
79
81 G4InuclParticle* target,
82 G4CollisionOutput& globalOutput) {
83 if (verboseLevel > 1) {
84 G4cout << " >>> G4CascadeDeexcitation::collide" << G4endl;
85 }
86
87 // Initialize colliders verbosity
88 theBigBanger->setVerboseLevel(verboseLevel);
89 theNonEquilibriumEvaporator->setVerboseLevel(verboseLevel);
90 theEquilibriumEvaporator->setVerboseLevel(verboseLevel);
91
92 // Ensure that input state is sensible
93 G4InuclNuclei* ntarget = dynamic_cast<G4InuclNuclei*>(target);
94 if (!ntarget) {
95 G4cerr << " G4CascadeDeexcitation ERROR: target must be G4InuclNuclei"
96 << G4endl;
97 return;
98 }
99
100 // Check if fragment should be broken up
101 if (explosion(ntarget)) {
102 if (verboseLevel > 1) G4cout << " big bang after cascade " << G4endl;
103
104 // Add result of explosion diretly to output and exit
105 theBigBanger->collide(0, target, globalOutput);
106 return;
107 }
108
109 // Fragment is unstable nucleus
110 output.reset();
111 theNonEquilibriumEvaporator->collide(0, target, output);
112
113 if (verboseLevel > 1) {
114 G4cout << " After NonEquilibriumEvaporator " << G4endl;
115 }
116
117 // Copy evaporated particles (not nuclear fragment) to output
119
120 // Use nuclear fragment left from non-equilibrium for next step
121 // NOT: Must make a copy before reset occurs below
123
124 output.reset();
125 theEquilibriumEvaporator->collide(0, &exciton, output);
126
127 if (verboseLevel > 1) {
128 G4cout << " After EquilibriumEvaporator " << G4endl;
129 }
130
131 globalOutput.add(output); // Evaporated particles and nucleus
132}
133
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
Definition: G4BigBanger.cc:65
virtual void setVerboseLevel(G4int verbose=0)
virtual G4bool explosion(G4InuclNuclei *target) const
virtual void collide(G4InuclParticle *, G4InuclParticle *target, G4CollisionOutput &globalOutput)
virtual void deExcite(G4Fragment *fragment, G4CollisionOutput &globalOutput)
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
void add(const G4CollisionOutput &right)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)