Geant4  10.00.p02
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 // 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 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
38 #include "G4INCLKinematicsUtils.hh"
40 #include "G4INCLRandom.hh"
41 #include "G4INCLGlobals.hh"
42 #include "G4INCLLogger.hh"
43 
44 namespace G4INCL {
45 
47  Particle *p2)
48  : particle1(p1), particle2(p2)
49  {}
50 
52 
54  const G4double ramass = 0.0;
55  const G4int maxTries = 100000;
56  G4int nTries = 0;
57  deltaProd101: G4double rndm = Random::shoot();
58  nTries++;
59  G4double y = std::tan(Math::pi*(rndm-0.5));
60  G4double x = 1232.+0.5*130.*y+ramass;
61  if (x < ParticleTable::effectiveDeltaDecayThreshold && (nTries < maxTries))
62  goto deltaProd101;
63  if (ecm < x + ParticleTable::effectiveNucleonMass + 1.0 && (nTries < maxTries)) goto deltaProd101;
64 
65  // generation of the delta mass with the penetration factor
66  // (see prc56(1997)2431)
67  y=ecm*ecm;
68  G4double q2=(y-1.157776E6)*(y-6.4E5)/y/4.0; // 1.157776E6 = 1076^2, 6.4E5 = 800^2
69  G4double q3=std::pow(std::sqrt(q2), 3.);
70  G4double f3max=q3/(q3+5.832E6); // 5.832E6 = 180^3
71  y=x*x;
72  q2=(y-1.157776E6)*(y-6.4E5)/y/4.0; // 1.157776E6 = 1076^2, 6.4E5 = 800^2
73  q3=std::pow(std::sqrt(q2), 3.);
74  G4double f3=q3/(q3+5.832E6); // 5.832E6 = 180^3
75  rndm = Random::shoot();
76  if (rndm > f3/f3max && (nTries < maxTries)) goto deltaProd101;
77  if(nTries >= maxTries) {
78  INCL_WARN("DeltaProductionChannel::sampleDeltaMass loop was stopped because maximum number of tries was reached. Delta mass " << x << " MeV with CM energy " << ecm << " MeV may be unphysical." << std::endl);
79  }
80  return x;
81  }
82 
92  // 100 IF (K4.NE.1) GO TO 101 // ThA K4 = 2 by default
93  // ParticleType p1TypeOld = particle1->getType();
94  // ParticleType p2TypeOld = particle2->getType();
96 
97  const G4int isospin = ParticleTable::getIsospin(particle1->getType()) +
99 
100  // Calculate the outcome of the channel:
101  G4double pin = particle1->getMomentum().mag();
102  G4double rndm = 0.0, b = 0.0;
103 
104  G4double xmdel = sampleDeltaMass(ecm);
105  // deltaProduction103: // This label is not used
107  if (pnorm <= 0.0) pnorm=0.000001;
108  G4int index=0;
109  G4int index2=0;
110  rndm = Random::shoot();
111  if (rndm < 0.5) index=1;
112  if (isospin == 0) { // pn case
113  rndm = Random::shoot();
114  if (rndm < 0.5) index2=1;
115  }
116 
117  // G4double x=0.001*0.5*ecm*std::sqrt(ecm*ecm-4.*ParticleTable::effectiveNucleonMass2)
118  // / ParticleTable::effectiveNucleonMass;
120  if(x < 1.4) {
121  b=(5.287/(1.+std::exp((1.3-x)/0.05)))*1.e-6;
122  } else {
123  b=(4.65+0.706*(x-1.4))*1.e-6;
124  }
125  G4double xkh = 2.*b*pin*pnorm;
126  rndm = Random::shoot();
127  G4double ctet=1.0+std::log(1.-rndm*(1.-std::exp(-2.*xkh)))/xkh;
128  if(std::abs(ctet) > 1.0) ctet = Math::sign(ctet);
129  G4double stet = std::sqrt(1.-ctet*ctet);
130 
131  rndm = Random::shoot();
132  G4double fi = Math::twoPi*rndm;
133  G4double cfi = std::cos(fi);
134  G4double sfi = std::sin(fi);
135  // delta production: correction of the angular distribution 02/09/02
136 
138  G4double zz = std::pow(particle1->getMomentum().getZ(), 2);
139  G4double xp1, xp2, xp3;
140  if (xx >= zz*1.e-8) {
141  G4double yn = std::sqrt(xx);
142  G4double zn = yn*pin;
143  G4double ex[3], ey[3], ez[3];
147  ez[0] = p1/pin;
148  ez[1] = p2/pin;
149  ez[2] = p3/pin;
150  ex[0] = p2/yn;
151  ex[1] = -p1/yn;
152  ex[2] = 0.0;
153  ey[0] = p1*p3/zn;
154  ey[1] = p2*p3/zn;
155  ey[2] = -xx/zn;
156  xp1 = (ex[0]*cfi*stet+ey[0]*sfi*stet+ez[0]*ctet)*pnorm;
157  xp2 = (ex[1]*cfi*stet+ey[1]*sfi*stet+ez[1]*ctet)*pnorm;
158  xp3 = (ex[2]*cfi*stet+ey[2]*sfi*stet+ez[2]*ctet)*pnorm;
159  }else {
160  xp1=pnorm*stet*cfi;
161  xp2=pnorm*stet*sfi;
162  xp3=pnorm*ctet;
163  }
164  // end of correction angular distribution of delta production
165  G4double e3 = std::sqrt(xp1*xp1+xp2*xp2+xp3*xp3
167  // if(k4.ne.0) go to 161
168 
169  // long-lived delta
170  if (index != 1) {
171  ThreeVector mom(xp1, xp2, xp3);
172  particle1->setMomentum(mom);
173  // e1=ecm-eout1
174  } else {
175  ThreeVector mom(-xp1, -xp2, -xp3);
176  particle1->setMomentum(mom);
177  // e1=ecm-eout1
178  }
179 
180  particle1->setEnergy(ecm - e3);
181  particle2->setEnergy(e3);
183 
184  // SYMMETRIZATION OF CHARGES IN pn -> N DELTA
185  // THE TEST ON "INDEX" ABOVE SYMETRIZES THE EXCITATION OF ONE
186  // OF THE NUCLEONS WITH RESPECT TO THE DELTA EXCITATION
187  // (SEE NOTE 16/10/97)
190  if (isospin == 0) {
191  if(index2 == 1) {
192  G4int isi=is1;
193  is1=is2;
194  is2=isi;
195  }
196  particle1->setHelicity(0.0);
197  } else {
198  rndm = Random::shoot();
199  if (rndm >= 0.25) {
200  is1=3*is1;
201  is2=-is2;
202  }
203  particle1->setHelicity(ctet*ctet);
204  }
205 
208  } else if(is1 == ParticleTable::getIsospin(DeltaZero)) {
210  } else if(is1 == ParticleTable::getIsospin(DeltaPlus)) {
212  } else if(is1 == ParticleTable::getIsospin(DeltaPlusPlus)) {
214  }
215 
216  if(is2 == ParticleTable::getIsospin(Proton)) {
218  } else if(is2 == ParticleTable::getIsospin(Neutron)) {
220  }
221 
222  if(particle1->isDelta()) particle1->setMass(xmdel);
223  if(particle2->isDelta()) particle2->setMass(xmdel);
224 
225  FinalState *fs = new FinalState;
228  return fs;
229  }
230 }
void setMass(G4double mass)
Set the mass of the particle in MeV/c^2.
const G4double pi
const G4INCL::ThreeVector & getMomentum() const
Get the momentum vector.
G4bool isDelta() const
Is it a Delta?
#define INCL_WARN(x)
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
int G4int
Definition: G4Types.hh:78
void setEnergy(G4double energy)
Set the energy of the particle in MeV.
Final state of an interaction.
G4double perp2() const
static const G4double f3
G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
const G4double effectiveNucleonMass2
G4INCL::ParticleType getType() const
Get the particle type.
void setType(ParticleType t)
const G4double twoPi
G4double getX() const
G4double shoot()
Generate flat distribution of random numbers.
Definition: G4INCLRandom.cc:74
G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.
G4double mag() const
Get the length of the vector.
double G4double
Definition: G4Types.hh:76
G4ThreadLocal G4double effectiveDeltaDecayThreshold
G4double totalEnergyInCM(Particle const *const p1, Particle const *const p2)
static const G4double e3
G4int sign(const T t)
A simple sign function that allows us to port fortran code to c++ more easily.
const G4double effectiveNucleonMass
void addModifiedParticle(Particle *p)
G4double getZ() const
void setHelicity(G4double h)
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
Set the momentum vector.
G4double getY() const