Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLElasticChannel.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// INCL++ intra-nuclear cascade model
27// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
28// Davide Mancusi, CEA
29// Alain Boudard, CEA
30// Sylvie Leray, CEA
31// Joseph Cugnon, University of Liege
32//
33// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
40#include "G4INCLRandom.hh"
44#include "G4INCLGlobals.hh"
45
46namespace G4INCL {
47
49 :theNucleus(n), particle1(p1), particle2(p2)
50 {
51 }
52
54 {
55 }
56
58 {
59 ParticleType p1TypeOld = particle1->getType();
60 ParticleType p2TypeOld = particle2->getType();
61
62 /* Concerning the way we calculate the lab momentum, see the considerations
63 * in CrossSections::elasticNNLegacy().
64 */
65 const G4double s = KinematicsUtils::squareTotalEnergyInCM(particle1, particle2);
67
68 const G4int isospin = ParticleTable::getIsospin(particle1->getType()) +
70
71 // Calculate the outcome of the channel:
72 G4double psq = particle1->getMomentum().mag2();
73 G4double pnorm = std::sqrt(psq);
75 G4double btmax = 4.0 * psq * b;
76 G4double z = std::exp(-btmax);
77 G4double ranres = Random::shoot();
78 G4double y = 1.0 - ranres * (1.0 - z);
79 G4double T = std::log(y)/b;
80 G4int iexpi = 0;
81 G4double apt = 1.0;
82
83 // Handle np case
84 if((particle1->getType() == Proton && particle2->getType() == Neutron) ||
85 (particle1->getType() == Neutron && particle2->getType() == Proton)) {
86 if(pl > 800.0) {
87 const G4double x = 0.001 * pl; // Transform to GeV
88 apt = (800.0/pl)*(800.0/pl);
89 G4double cpt = std::max(6.23 * std::exp(-1.79*x), 0.3);
90 G4double alphac = 100.0 * 1.0e-6;
91 G4double aaa = (1 + apt) * (1 - std::exp(-btmax))/b;
92 G4double argu = psq * alphac;
93
94 if(argu >= 8) {
95 argu = 0.0;
96 } else {
97 argu = std::exp(-4.0 * argu);
98 }
99
100 G4double aac = cpt * (1.0 - argu)/alphac;
101 G4double fracpn = aaa/(aac + aaa);
102 if(Random::shoot() > fracpn) {
103 z = std::exp(-4.0 * psq *alphac);
104 iexpi = 1;
105 y = 1.0 - ranres*(1.0 - z);
106 T = std::log(y)/alphac;
107 }
108 }
109 }
110
111 G4double ctet = 1.0 + 0.5*T/psq;
112 if(std::abs(ctet) > 1.0) ctet = Math::sign(ctet);
113 G4double stet = std::sqrt(1.0 - ctet*ctet);
114 G4double rndm = Random::shoot();
115
116 G4double fi = Math::twoPi * rndm;
117 G4double cfi = std::cos(fi);
118 G4double sfi = std::sin(fi);
119
120 G4double xx = particle1->getMomentum().perp2();
121 G4double zz = std::pow(particle1->getMomentum().getZ(), 2);
122
123 if(xx >= (zz * 1.0e-8)) {
124 ThreeVector p = particle1->getMomentum();
125 G4double yn = std::sqrt(xx);
126 G4double zn = yn * pnorm;
127 G4double ex[3], ey[3], ez[3];
128 ez[0] = p.getX() / pnorm;
129 ez[1] = p.getY() / pnorm;
130 ez[2] = p.getZ() / pnorm;
131
132 // Vector Ex is chosen arbitrarily:
133 ex[0] = p.getY() / yn;
134 ex[1] = -p.getX() / yn;
135 ex[2] = 0.0;
136
137 ey[0] = p.getX() * p.getZ() / zn;
138 ey[1] = p.getY() * p.getZ() / zn;
139 ey[2] = -xx/zn;
140
141 G4double pX = (ex[0]*cfi*stet + ey[0]*sfi*stet + ez[0]*ctet) * pnorm;
142 G4double pY = (ex[1]*cfi*stet + ey[1]*sfi*stet + ez[1]*ctet) * pnorm;
143 G4double pZ = (ex[2]*cfi*stet + ey[2]*sfi*stet + ez[2]*ctet) * pnorm;
144
145 ThreeVector p1momentum = ThreeVector(pX, pY, pZ);
146 particle1->setMomentum(p1momentum);
147 particle2->setMomentum(-p1momentum);
148 } else { // if(xx < (zz * 1.0e-8)) {
149 G4double momZ = particle1->getMomentum().getZ();
150 G4double pX = momZ * cfi * stet;
151 G4double pY = momZ * sfi * stet;
152 G4double pZ = momZ * ctet;
153
154 ThreeVector p1momentum(pX, pY, pZ);
155 particle1->setMomentum(p1momentum);
156 particle2->setMomentum(-p1momentum);
157 }
158
159 // Handle backward scattering here.
160
161 if((particle1->getType() == Proton && particle2->getType() == Neutron) ||
162 (particle1->getType() == Neutron && particle2->getType() == Proton)) {
163 rndm = Random::shoot();
164 apt = 1.0;
165 if(pl > 800.0) {
166 apt = std::pow(800.0/pl, 2);
167 }
168 if(iexpi == 1 || rndm > 1.0/(1.0 + apt)) {
169 particle1->setType(p2TypeOld);
170 particle2->setType(p1TypeOld);
171 }
172 }
173
174 // Note: there is no need to update the kinetic energies of the particles,
175 // as this is elastic scattering.
176
177 FinalState *fs = new FinalState();
178 fs->addModifiedParticle(particle1);
179 fs->addModifiedParticle(particle2);
180
181 return fs;
182
183 }
184
185}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
static G4double calculateNNDiffCrossSection(G4double energyCM, G4int iso)
Calculate the slope of the NN DDXS.
ElasticChannel(Nucleus *n, Particle *p1, Particle *p2)
void addModifiedParticle(Particle *p)
static G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
static G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.
static G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
static const G4double effectiveNucleonMass
const G4INCL::ThreeVector & getMomentum() const
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4INCL::ParticleType getType() const
void setType(ParticleType t)
static G4double shoot()
Definition: G4INCLRandom.hh:99
G4double getY() const
G4double getZ() const
G4double perp2() const
G4double mag2() const
G4double getX() const
G4int sign(T t)
const G4double twoPi