Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GammaTransition.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//
27// -------------------------------------------------------------------
28// GEANT 4 class file
29//
30// CERN, Geneva, Switzerland
31//
32// File name: G4GammaTransition
33//
34// Author V.Ivanchenko 27 February 2015
35//
36// -------------------------------------------------------------------
37
38#include "G4GammaTransition.hh"
39#include "G4AtomicShells.hh"
40#include "Randomize.hh"
41#include "G4RandomDirection.hh"
42#include "G4Gamma.hh"
43#include "G4Electron.hh"
44#include "G4LorentzVector.hh"
45#include "G4SystemOfUnits.hh"
47
49 : polarFlag(false), fDirection(0.,0.,0.), fTwoJMAX(10), fVerbose(0)
50{}
51
54
57 G4double newExcEnergy,
58 G4double mpRatio,
59 G4int JP1,
60 G4int JP2,
61 G4int MP,
62 G4int shell,
63 G4bool isDiscrete,
64 G4bool gamma)
65{
66 G4Fragment* result = nullptr;
67 G4double bondEnergy = 0.0;
68 G4bool isGamma = gamma;
69 if (!isDiscrete) { isGamma = true; }
70
71 G4double excEnergy = nucleus->GetExcitationEnergy();
72
73 // check is IC electron can be emitted
74 if (!isGamma) {
75 if(0 <= shell) {
76 G4int Z = nucleus->GetZ_asInt();
77 if(Z <= 104) {
78 G4int idx = std::min(shell, G4AtomicShells::GetNumberOfShells(Z)-1);
79 bondEnergy = G4AtomicShells::GetBindingEnergy(Z, idx);
80 if (bondEnergy > excEnergy) {
81 isGamma = true;
82 }
83 } else {
84 isGamma = true;
85 }
86 } else {
87 isGamma = true;
88 }
89 }
90 if (fVerbose > 2) {
91 G4cout << "G4GammaTransition::GenerateGamma " << " Eexnew=" << newExcEnergy
92 << " Ebond=" << bondEnergy << G4endl;
93 }
94
95 // complete selection of secondary
97 G4int ne = nucleus->GetNumberOfElectrons();
98 if (0 == ne) { isGamma = true; }
99
100 if ( isGamma ) { part = G4Gamma::Gamma(); }
101 else {
102 part = G4Electron::Electron();
103 --ne;
104 nucleus->SetNumberOfElectrons(ne);
105 }
106
107 if (isGamma && polarFlag && isDiscrete && JP1 <= fTwoJMAX) {
108 SampleDirection(nucleus, mpRatio, JP1, JP2, MP);
109 } else {
111 }
112
113 // 4-vector of initial fragnet
114 G4LorentzVector lv = nucleus->GetMomentum();
115
116 // kinematics of the decay
117 G4double emass = part->GetPDGMass();
118 G4double m0 = nucleus->GetGroundStateMass() + excEnergy;
119 G4double m1 = nucleus->GetGroundStateMass() + newExcEnergy;
120 if (!isGamma) {
121 m0 += (ne + 1)*CLHEP::electron_mass_c2 - bondEnergy;
122 m1 += ne*CLHEP::electron_mass_c2;
123 }
124
125 // 2-body decay in rest frame
126 const G4double elim2 = 100.*CLHEP::eV*CLHEP::eV;
127 G4bool atRest = (lv.vect().mag2() < elim2);
128 G4ThreeVector bst(0.0, 0.0, 0.0);
129 if (!atRest) { bst = lv.boostVector(); }
130
131 //G4cout << "Ecm= " << ecm << " mass= " << mass << " emass= " << emass << G4endl;
132
133 G4double energy = 0.5*((m0 - m1)*(m0 + m1) + emass*emass)/m0;
134 G4double mom = (isGamma) ? energy : std::sqrt((energy - emass)*(energy + emass));
135
136 // emitted gamma or e-
137 G4LorentzVector res4mom(mom * fDirection.x(),
138 mom * fDirection.y(),
139 mom * fDirection.z(), energy);
140 // residual
141 energy = m0 - energy;
142 mom = std::sqrt((energy - m1)*(energy + m1));
143 lv.set(-mom*fDirection.x(), -mom*fDirection.y(), -mom*fDirection.z(), energy);
144
145 // Lab system transform for short lived level
146 if (!atRest) {
147 lv.boost(bst);
148 res4mom.boost(bst);
149 }
150
151 // modified primary fragment
152 nucleus->SetExcEnergyAndMomentum(newExcEnergy, lv);
153
154 // gamma or e- are produced
155 result = new G4Fragment(res4mom, part);
156
157 //G4cout << " DeltaE= " << e0 - lv.e() - res4mom.e() + emass
158 // << " Emass= " << emass << G4endl;
159 if(fVerbose > 2) {
160 G4cout << "G4GammaTransition::SampleTransition : " << *result << G4endl;
161 G4cout << " Left nucleus: " << *nucleus << G4endl;
162 }
163 return result;
164}
165
167 G4int twoJ1, G4int twoJ2, G4int mp)
168{
169 G4double cosTheta, phi;
170 G4NuclearPolarization* np = nuc->GetNuclearPolarization();
171 if(fVerbose > 2) {
172 G4cout << "G4GammaTransition::SampleDirection : 2J1= " << twoJ1
173 << " 2J2= " << twoJ2 << " ratio= " << ratio
174 << " mp= " << mp << G4endl;
175 G4cout << " Nucleus: " << *nuc << G4endl;
176 }
177 if(nullptr == np) {
178 cosTheta = 2*G4UniformRand() - 1.0;
179 phi = CLHEP::twopi*G4UniformRand();
180
181 } else {
182 // PhotonEvaporation dataset:
183 // The multipolarity number with 1,2,3,4,5,6,7 representing E0,E1,M1,E2,M2,E3,M3
184 // monopole transition and 100*Nx+Ny representing multipolarity transition with
185 // Ny and Ny taking the value 1,2,3,4,5,6,7 referring to E0,E1,M1,E2,M2,E3,M3,..
186 // For example a M1+E2 transition would be written 304.
187 // M1 is the primary transition (L) and E2 is the secondary (L')
188
189 G4double mpRatio = ratio;
190
191 G4int L0 = 0, Lp = 0;
192 if (mp > 99) {
193 L0 = mp/200;
194 Lp = (mp%100)/2;
195 } else {
196 L0 = mp/2;
197 Lp = 0;
198 mpRatio = 0.;
199 }
200 fPolTrans.SampleGammaTransition(np, twoJ1, twoJ2, L0, Lp, mpRatio, cosTheta, phi);
201 }
202
203 G4double sinTheta = std::sqrt((1.-cosTheta)*(1.+cosTheta));
204 fDirection.set(sinTheta*std::cos(phi),sinTheta*std::sin(phi),cosTheta);
205 if(fVerbose > 3) {
206 G4cout << "G4GammaTransition::SampleDirection done: " << fDirection << G4endl;
207 if(np) { G4cout << *np << G4endl; }
208 }
209}
CLHEP::HepLorentzVector G4LorentzVector
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition Randomize.hh:52
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
Hep3Vector vect() const
void set(double x, double y, double z, double t)
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
static G4int GetNumberOfShells(G4int Z)
static G4Electron * Electron()
Definition G4Electron.cc:91
virtual void SampleDirection(G4Fragment *nuc, G4double ratio, G4int twoJ1, G4int twoJ2, G4int mp)
G4PolarizationTransition fPolTrans
G4ThreeVector fDirection
virtual G4Fragment * SampleTransition(G4Fragment *nucleus, G4double newExcEnergy, G4double mpRatio, G4int JP1, G4int JP2, G4int MP, G4int shell, G4bool isDiscrete, G4bool isGamma)
static G4Gamma * Gamma()
Definition G4Gamma.cc:81