Geant4  10.01.p01
G4INCLCrossSections.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 
38 #include "G4INCLCrossSections.hh"
39 #include "G4INCLKinematicsUtils.hh"
40 #include "G4INCLParticleTable.hh"
41 #include "G4INCLLogger.hh"
44 // #include <cassert>
45 
46 namespace G4INCL {
47 
48  namespace {
49  G4ThreadLocal ICrossSections *theCrossSections;
50  }
51 
52  namespace CrossSections {
53  G4double elastic(Particle const * const p1, Particle const * const p2) {
54  return theCrossSections->elastic(p1,p2);
55  }
56 
57  G4double total(Particle const * const p1, Particle const * const p2) {
58  return theCrossSections->total(p1,p2);
59  }
60 
61  G4double NDeltaToNN(Particle const * const p1, Particle const * const p2) {
62  return theCrossSections->NDeltaToNN(p1,p2);
63  }
64 
65  G4double NNToNDelta(Particle const * const p1, Particle const * const p2) {
66  return theCrossSections->NNToNDelta(p1,p2);
67  }
68 
69  G4double NNToxPiNN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
70  return theCrossSections->NNToxPiNN(xpi,p1,p2);
71  }
72 
73  G4double piNToDelta(Particle const * const p1, Particle const * const p2) {
74  return theCrossSections->piNToDelta(p1,p2);
75  }
76 
77  G4double piNToxPiN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
78  return theCrossSections->piNToxPiN(xpi,p1,p2);
79  }
80 
82  return theCrossSections->calculateNNAngularSlope(energyCM, iso);
83  }
84 
85  G4double interactionDistancePiN(const G4double projectileKineticEnergy) {
86  ThreeVector nullVector;
87  ThreeVector unitVector(0., 0., 1.);
88 
89  Particle piPlusProjectile(PiPlus, unitVector, nullVector);
90  piPlusProjectile.setEnergy(piPlusProjectile.getMass()+projectileKineticEnergy);
91  piPlusProjectile.adjustMomentumFromEnergy();
92  Particle piZeroProjectile(PiZero, unitVector, nullVector);
93  piZeroProjectile.setEnergy(piZeroProjectile.getMass()+projectileKineticEnergy);
94  piZeroProjectile.adjustMomentumFromEnergy();
95  Particle piMinusProjectile(PiMinus, unitVector, nullVector);
96  piMinusProjectile.setEnergy(piMinusProjectile.getMass()+projectileKineticEnergy);
97  piMinusProjectile.adjustMomentumFromEnergy();
98 
99  Particle protonTarget(Proton, nullVector, nullVector);
100  Particle neutronTarget(Neutron, nullVector, nullVector);
101  const G4double sigmapipp = total(&piPlusProjectile, &protonTarget);
102  const G4double sigmapipn = total(&piPlusProjectile, &neutronTarget);
103  const G4double sigmapi0p = total(&piZeroProjectile, &protonTarget);
104  const G4double sigmapi0n = total(&piZeroProjectile, &neutronTarget);
105  const G4double sigmapimp = total(&piMinusProjectile, &protonTarget);
106  const G4double sigmapimn = total(&piMinusProjectile, &neutronTarget);
107  /* We compute the interaction distance from the largest of the pi-N cross
108  * sections. Note that this is different from INCL4.6, which just takes the
109  * average of the six, and will in general lead to a different geometrical
110  * cross section.
111  */
112  const G4double largestSigma = std::max(sigmapipp, std::max(sigmapipn, std::max(sigmapi0p, std::max(sigmapi0n, std::max(sigmapimp,sigmapimn)))));
113  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
114 
115  return interactionDistance;
116  }
117 
118  G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy) {
119 // assert(aSpecies.theType==Proton || aSpecies.theType==Neutron || aSpecies.theType==Composite);
120 // assert(aSpecies.theA>0);
121  ThreeVector nullVector;
122  ThreeVector unitVector(0.,0.,1.);
123 
124  const G4double kineticEnergyPerNucleon = kineticEnergy / aSpecies.theA;
125 
126  Particle protonProjectile(Proton, unitVector, nullVector);
127  protonProjectile.setEnergy(protonProjectile.getMass()+kineticEnergyPerNucleon);
128  protonProjectile.adjustMomentumFromEnergy();
129  Particle neutronProjectile(Neutron, unitVector, nullVector);
130  neutronProjectile.setEnergy(neutronProjectile.getMass()+kineticEnergyPerNucleon);
131  neutronProjectile.adjustMomentumFromEnergy();
132 
133  Particle protonTarget(Proton, nullVector, nullVector);
134  Particle neutronTarget(Neutron, nullVector, nullVector);
135  const G4double sigmapp = total(&protonProjectile, &protonTarget);
136  const G4double sigmapn = total(&protonProjectile, &neutronTarget);
137  const G4double sigmann = total(&neutronProjectile, &neutronTarget);
138  /* We compute the interaction distance from the largest of the NN cross
139  * sections. Note that this is different from INCL4.6, which just takes the
140  * average of the four, and will in general lead to a different geometrical
141  * cross section.
142  */
143  const G4double largestSigma = std::max(sigmapp, std::max(sigmapn, sigmann));
144  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
145 
146  return interactionDistance;
147  }
148 
150  theCrossSections = c;
151  }
152 
154  delete theCrossSections;
155  theCrossSections = NULL;
156  }
157 
158  void initialize(Config const * const theConfig) {
159  CrossSectionsType crossSections = theConfig->getCrossSectionsType();
160  if(crossSections == INCL46CrossSections)
162  else if(crossSections == MultiPionsCrossSections)
164  }
165  }
166 }
The INCL configuration object.
Definition: G4INCLConfig.hh:60
G4double getMass() const
Get the cached particle mass.
const G4double tenPi
G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy)
Compute the "interaction distance".
G4double NDeltaToNN(Particle const *const p1, Particle const *const p2)
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
void setCrossSections(ICrossSections *c)
void setEnergy(G4double energy)
Set the energy of the particle in MeV.
Cross sections used in INCL4.6.
G4double calculateNNAngularSlope(G4double energyCM, G4int iso)
Calculate the slope of the NN DDXS.
G4double NNToNDelta(Particle const *const p1, Particle const *const p2)
G4double total(Particle const *const p1, Particle const *const p2)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double interactionDistancePiN(const G4double projectileKineticEnergy)
Compute the "interaction distance".
void initialize(Config const *const theConfig)
Cross sections used in INCL Multipions.
G4double piNToDelta(Particle const *const p1, Particle const *const p2)
Abstract interface for the cross-section classes.
G4double piNToxPiN(const G4int xpi, Particle const *const p1, Particle const *const p2)
double G4double
Definition: G4Types.hh:76
CrossSectionsType getCrossSectionsType() const
Get the Cross Section type.
G4double NNToxPiNN(const G4int xpi, Particle const *const p1, Particle const *const p2)
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
Cross sections used in INCL4.6.
Cross sections used in INCL Multipions.
G4double elastic(Particle const *const p1, Particle const *const p2)