Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLDeltaProductionChannel.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// Alain Boudard, CEA-Saclay, France
28// Joseph Cugnon, University of Liege, Belgium
29// Jean-Christophe David, CEA-Saclay, France
30// Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
31// Sylvie Leray, CEA-Saclay, France
32// Davide Mancusi, CEA-Saclay, France
33//
34#define INCLXX_IN_GEANT4_MODE 1
35
36#include "globals.hh"
37
40#include "G4INCLRandom.hh"
41#include "G4INCLGlobals.hh"
42#include "G4INCLLogger.hh"
43
44namespace G4INCL {
45
46 const G4int DeltaProductionChannel::maxTries = 100000;
47
49 Nucleus *n)
50 : particle1(p1), particle2(p2), thenucleus(n) {}
51
53
54 G4double DeltaProductionChannel::sampleDeltaMass(G4double ecm) {
55 const G4double maxDeltaMass = ecm - ParticleTable::effectiveNucleonMass - 1.0;
56 const G4double maxDeltaMassRndm =
57 std::atan((maxDeltaMass - ParticleTable::effectiveDeltaMass) * 2. /
59 const G4double deltaMassRndmRange =
60 maxDeltaMassRndm - ParticleTable::minDeltaMassRndm;
61// assert(deltaMassRndmRange>0.);
62
63 G4double y=ecm*ecm;
64 G4double q2=(y-1.157776E6)*(y-6.4E5)/y/4.0; // 1.157776E6 = 1076^2, 6.4E5 = 800^2
65 G4double q3=std::pow(std::sqrt(q2), 3.);
66 const G4double f3max=q3/(q3+5.832E6); // 5.832E6 = 180^3
67 G4double x;
68
69 G4int nTries = 0;
70 G4bool success = false;
71 while(!success) { /* Loop checking, 10.07.2015, D.Mancusi */
72 if(++nTries >= maxTries) {
73 INCL_WARN("DeltaProductionChannel::sampleDeltaMass loop was stopped because maximum number of tries was reached. Minimum delta mass "
74 << ParticleTable::minDeltaMass << " MeV with CM energy " << ecm << " MeV may be unphysical." << '\n');
76 }
77
78 G4double rndm = ParticleTable::minDeltaMassRndm + Random::shoot() * deltaMassRndmRange;
79 y = std::tan(rndm);
81// assert(x>=ParticleTable::minDeltaMass && ecm >= x + ParticleTable::effectiveNucleonMass + 1.0);
82
83 // generation of the delta mass with the penetration factor
84 // (see prc56(1997)2431)
85 y=x*x;
86 q2=(y-1.157776E6)*(y-6.4E5)/y/4.0; // 1.157776E6 = 1076^2, 6.4E5 = 800^2
87 q3=std::pow(std::sqrt(q2), 3.);
88 const G4double f3=q3/(q3+5.832E6); // 5.832E6 = 180^3
89 rndm = Random::shoot();
90 if (rndm*f3max < f3)
91 success = true;
92 }
93 return x;
94 }
95
97 /**
98 * Delta production
99 *
100 * The production is not isotropic in this version it has the same
101 * exp(b*t) structure as the nn elastic scattering (formula 2.3 of
102 * j.cugnon et al, nucl phys a352(1981)505) parametrization of b
103 * taken from ref. prc56(1997)2431
104 */
105 // 100 IF (K4.NE.1) GO TO 101 // ThA K4 = 2 by default
106 // ParticleType p1TypeOld = particle1->getType();
107 // ParticleType p2TypeOld = particle2->getType();
108 G4double ecm = KinematicsUtils::totalEnergyInCM(particle1, particle2);
109
110 // For SRC
111 ParticleType p1TypeOld = particle1->getType();
112 ParticleType p2TypeOld = particle2->getType();
113
114 // INCL_INFO( particle1->print() << '\n');
115 // INCL_INFO( particle2->print() << '\n');
116
117 const G4int isospin = ParticleTable::getIsospin(particle1->getType()) +
118 ParticleTable::getIsospin(particle2->getType());
119
120 // Calculate the outcome of the channel:
121 const ThreeVector &particle1Momentum = particle1->getMomentum();
122 G4double pin = particle1Momentum.mag();
123 G4double rndm = 0.0, b = 0.0;
124
125 G4double xmdel = sampleDeltaMass(ecm);
126 // deltaProduction103: // This label is not used
128 if (pnorm <= 0.0) pnorm=0.000001;
129 G4int index=0;
130 G4int index2=0;
131 rndm = Random::shoot();
132 if (rndm < 0.5) index=1;
133 if (isospin == 0) { // pn case
134 rndm = Random::shoot();
135 if (rndm < 0.5) index2=1;
136 }
137
138 // G4double x=0.001*0.5*ecm*std::sqrt(ecm*ecm-4.*ParticleTable::effectiveNucleonMass2)
139 // / ParticleTable::effectiveNucleonMass;
141 if(x < 1.4) {
142 b=(5.287/(1.+std::exp((1.3-x)/0.05)))*1.e-6;
143 } else {
144 b=(4.65+0.706*(x-1.4))*1.e-6;
145 }
146 G4double xkh = 2.*b*pin*pnorm;
147 rndm = Random::shoot();
148 G4double ctet=1.0+std::log(1.-rndm*(1.-std::exp(-2.*xkh)))/xkh;
149 if(std::abs(ctet) > 1.0) ctet = Math::sign(ctet);
150 G4double stet = std::sqrt(1.-ctet*ctet);
151
152 rndm = Random::shoot();
153 G4double fi = Math::twoPi*rndm;
154 G4double cfi = std::cos(fi);
155 G4double sfi = std::sin(fi);
156 // delta production: correction of the angular distribution 02/09/02
157
158 G4double xx = particle1Momentum.perp2();
159 const G4double particle1MomentumZ = particle1Momentum.getZ();
160 G4double zz = std::pow(particle1MomentumZ, 2);
161 G4double xp1, xp2, xp3;
162 if (xx >= zz*1.e-8) {
163 G4double yn = std::sqrt(xx);
164 G4double zn = yn*pin;
165 G4double ex[3], ey[3], ez[3];
166 G4double p1 = particle1Momentum.getX();
167 G4double p2 = particle1Momentum.getY();
168 G4double p3 = particle1MomentumZ;
169 ez[0] = p1/pin;
170 ez[1] = p2/pin;
171 ez[2] = p3/pin;
172 ex[0] = p2/yn;
173 ex[1] = -p1/yn;
174 ex[2] = 0.0;
175 ey[0] = p1*p3/zn;
176 ey[1] = p2*p3/zn;
177 ey[2] = -xx/zn;
178 xp1 = (ex[0]*cfi*stet+ey[0]*sfi*stet+ez[0]*ctet)*pnorm;
179 xp2 = (ex[1]*cfi*stet+ey[1]*sfi*stet+ez[1]*ctet)*pnorm;
180 xp3 = (ex[2]*cfi*stet+ey[2]*sfi*stet+ez[2]*ctet)*pnorm;
181 }else {
182 xp1=pnorm*stet*cfi;
183 xp2=pnorm*stet*sfi;
184 xp3=pnorm*ctet;
185 }
186 // end of correction angular distribution of delta production
187 G4double e3 = std::sqrt(xp1*xp1+xp2*xp2+xp3*xp3
189 // if(k4.ne.0) go to 161
190
191 // long-lived delta
192 if (index != 1) {
193 ThreeVector mom(xp1, xp2, xp3);
194 particle1->setMomentum(mom);
195 // e1=ecm-eout1
196 } else {
197 ThreeVector mom(-xp1, -xp2, -xp3);
198 particle1->setMomentum(mom);
199 // e1=ecm-eout1
200 }
201
202 particle1->setEnergy(ecm - e3);
203 particle2->setEnergy(e3);
204 particle2->setMomentum(-particle1->getMomentum());
205
206 // SYMMETRIZATION OF CHARGES IN pn -> N DELTA
207 // THE TEST ON "INDEX" ABOVE SYMETRIZES THE EXCITATION OF ONE
208 // OF THE NUCLEONS WITH RESPECT TO THE DELTA EXCITATION
209 // (SEE NOTE 16/10/97)
210 G4int is1 = ParticleTable::getIsospin(particle1->getType());
211 G4int is2 = ParticleTable::getIsospin(particle2->getType());
212 if (isospin == 0) {
213 if(index2 == 1) {
214 G4int isi=is1;
215 is1=is2;
216 is2=isi;
217 }
218 particle1->setHelicity(0.0);
219 } else {
220 rndm = Random::shoot();
221 if (rndm >= 0.25) {
222 is1=3*is1;
223 is2=-is2;
224 }
225 particle1->setHelicity(ctet*ctet);
226 }
227
229 particle1->setType(DeltaMinus);
230 } else if(is1 == ParticleTable::getIsospin(DeltaZero)) {
231 particle1->setType(DeltaZero);
232 } else if(is1 == ParticleTable::getIsospin(DeltaPlus)) {
233 particle1->setType(DeltaPlus);
234 } else if(is1 == ParticleTable::getIsospin(DeltaPlusPlus)) {
235 particle1->setType(DeltaPlusPlus);
236 }
237
239 particle2->setType(Proton);
240 } else if(is2 == ParticleTable::getIsospin(Neutron)) {
241 particle2->setType(Neutron);
242 }
243
244 if (particle1->isDelta())
245 particle1->setMass(xmdel);
246 if (particle2->isDelta())
247 particle2->setMass(xmdel);
248
249 if (thenucleus) {
250 // std::cout<< "entrando" <<std::endl;
251 // std::cout<< particle1->print() <<std::endl;
252 // std::cout<< particle2->print() <<std::endl;
253 srcChannel = new SrcChannel(particle1, particle2, thenucleus);
254 srcChannel->fillFinalState(fs, p1TypeOld, p2TypeOld);
255 delete srcChannel;
256 } else {
257 fs->addModifiedParticle(particle1);
258 fs->addModifiedParticle(particle2);
259 }
260 }
261} // namespace G4INCL
#define INCL_WARN(x)
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
DeltaProductionChannel(Particle *, Particle *, Nucleus *n=nullptr)
void addModifiedParticle(Particle *p)
G4double getY() const
G4double getZ() const
G4double perp2() const
G4double getX() const
G4double totalEnergyInCM(Particle const *const p1, Particle const *const p2)
G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
const G4double twoPi
G4int sign(const T t)
const G4double effectiveDeltaWidth
const G4double effectiveDeltaMass
G4ThreadLocal G4double minDeltaMass
G4ThreadLocal G4double minDeltaMassRndm
const G4double effectiveNucleonMass2
G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
const G4double effectiveNucleonMass
G4double shoot()