Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::ElasticChannel Class Reference

#include <G4INCLElasticChannel.hh>

+ Inheritance diagram for G4INCL::ElasticChannel:

Public Member Functions

 ElasticChannel (Nucleus *n, Particle *p1, Particle *p2)
 
virtual ~ElasticChannel ()
 
FinalStategetFinalState ()
 
- Public Member Functions inherited from G4INCL::IChannel
 IChannel ()
 
virtual ~IChannel ()
 
virtual G4INCL::FinalStategetFinalState ()=0
 

Detailed Description

Definition at line 49 of file G4INCLElasticChannel.hh.

Constructor & Destructor Documentation

◆ ElasticChannel()

G4INCL::ElasticChannel::ElasticChannel ( Nucleus n,
Particle p1,
Particle p2 
)

Definition at line 48 of file G4INCLElasticChannel.cc.

49 :theNucleus(n), particle1(p1), particle2(p2)
50 {
51 }

◆ ~ElasticChannel()

G4INCL::ElasticChannel::~ElasticChannel ( )
virtual

Definition at line 53 of file G4INCLElasticChannel.cc.

54 {
55 }

Member Function Documentation

◆ getFinalState()

FinalState * G4INCL::ElasticChannel::getFinalState ( )
virtual

Implements G4INCL::IChannel.

Definition at line 57 of file G4INCLElasticChannel.cc.

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 }
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.
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 getZ() const
G4double perp2() const
G4double mag2() const
G4int sign(T t)
const G4double twoPi

The documentation for this class was generated from the following files: