Geant4  10.02.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"
45 // #include <cassert>
46 
47 namespace G4INCL {
48 
49  namespace {
50  G4ThreadLocal ICrossSections *theCrossSections;
51  }
52 
53  namespace CrossSections {
54  G4double elastic(Particle const * const p1, Particle const * const p2) {
55  return theCrossSections->elastic(p1,p2);
56  }
57 
58  G4double total(Particle const * const p1, Particle const * const p2) {
59  return theCrossSections->total(p1,p2);
60  }
61 
62  G4double NDeltaToNN(Particle const * const p1, Particle const * const p2) {
63  return theCrossSections->NDeltaToNN(p1,p2);
64  }
65 
66  G4double NNToNDelta(Particle const * const p1, Particle const * const p2) {
67  return theCrossSections->NNToNDelta(p1,p2);
68  }
69 
70  G4double NNToxPiNN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
71  return theCrossSections->NNToxPiNN(xpi,p1,p2);
72  }
73 
74  G4double piNToDelta(Particle const * const p1, Particle const * const p2) {
75  return theCrossSections->piNToDelta(p1,p2);
76  }
77 
78  G4double piNToxPiN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
79  return theCrossSections->piNToxPiN(xpi,p1,p2);
80  }
81 
83  return theCrossSections->calculateNNAngularSlope(energyCM, iso);
84  }
85 
86  G4double interactionDistancePiN(const G4double projectileKineticEnergy) {
87  ThreeVector nullVector;
88  ThreeVector unitVector(0., 0., 1.);
89 
90  Particle piPlusProjectile(PiPlus, unitVector, nullVector);
91  piPlusProjectile.setEnergy(piPlusProjectile.getMass()+projectileKineticEnergy);
92  piPlusProjectile.adjustMomentumFromEnergy();
93  Particle piZeroProjectile(PiZero, unitVector, nullVector);
94  piZeroProjectile.setEnergy(piZeroProjectile.getMass()+projectileKineticEnergy);
95  piZeroProjectile.adjustMomentumFromEnergy();
96  Particle piMinusProjectile(PiMinus, unitVector, nullVector);
97  piMinusProjectile.setEnergy(piMinusProjectile.getMass()+projectileKineticEnergy);
98  piMinusProjectile.adjustMomentumFromEnergy();
99 
100  Particle protonTarget(Proton, nullVector, nullVector);
101  Particle neutronTarget(Neutron, nullVector, nullVector);
102  const G4double sigmapipp = total(&piPlusProjectile, &protonTarget);
103  const G4double sigmapipn = total(&piPlusProjectile, &neutronTarget);
104  const G4double sigmapi0p = total(&piZeroProjectile, &protonTarget);
105  const G4double sigmapi0n = total(&piZeroProjectile, &neutronTarget);
106  const G4double sigmapimp = total(&piMinusProjectile, &protonTarget);
107  const G4double sigmapimn = total(&piMinusProjectile, &neutronTarget);
108  /* We compute the interaction distance from the largest of the pi-N cross
109  * sections. Note that this is different from INCL4.6, which just takes the
110  * average of the six, and will in general lead to a different geometrical
111  * cross section.
112  */
113  const G4double largestSigma = std::max(sigmapipp, std::max(sigmapipn, std::max(sigmapi0p, std::max(sigmapi0n, std::max(sigmapimp,sigmapimn)))));
114  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
115 
116  return interactionDistance;
117  }
118 
119  G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy) {
120 // assert(aSpecies.theType==Proton || aSpecies.theType==Neutron || aSpecies.theType==Composite);
121 // assert(aSpecies.theA>0);
122  ThreeVector nullVector;
123  ThreeVector unitVector(0.,0.,1.);
124 
125  const G4double kineticEnergyPerNucleon = kineticEnergy / aSpecies.theA;
126 
127  Particle protonProjectile(Proton, unitVector, nullVector);
128  protonProjectile.setEnergy(protonProjectile.getMass()+kineticEnergyPerNucleon);
129  protonProjectile.adjustMomentumFromEnergy();
130  Particle neutronProjectile(Neutron, unitVector, nullVector);
131  neutronProjectile.setEnergy(neutronProjectile.getMass()+kineticEnergyPerNucleon);
132  neutronProjectile.adjustMomentumFromEnergy();
133 
134  Particle protonTarget(Proton, nullVector, nullVector);
135  Particle neutronTarget(Neutron, nullVector, nullVector);
136  const G4double sigmapp = total(&protonProjectile, &protonTarget);
137  const G4double sigmapn = total(&protonProjectile, &neutronTarget);
138  const G4double sigmann = total(&neutronProjectile, &neutronTarget);
139  /* We compute the interaction distance from the largest of the NN cross
140  * sections. Note that this is different from INCL4.6, which just takes the
141  * average of the four, and will in general lead to a different geometrical
142  * cross section.
143  */
144  const G4double largestSigma = std::max(sigmapp, std::max(sigmapn, sigmann));
145  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
146 
147  return interactionDistance;
148  }
149 
151  theCrossSections = c;
152  }
153 
155  delete theCrossSections;
156  theCrossSections = NULL;
157  }
158 
159  void initialize(Config const * const theConfig) {
160  CrossSectionsType crossSections = theConfig->getCrossSectionsType();
161  if(crossSections == INCL46CrossSections)
163  else if(crossSections == MultiPionsCrossSections)
165  else if(crossSections == TruncatedMultiPionsCrossSections) {
166  const G4int nMaxPi = theConfig->getMaxNumberMultipions();
167  if(nMaxPi>0)
169  else {
170  INCL_WARN("Truncated multipion cross sections were requested, but the specified maximum\n"
171  << "number of pions is <=0. Falling back to standard multipion cross-sections.\n");
173  }
174  }
175  }
176  }
177 }
The INCL configuration object.
Definition: G4INCLConfig.hh:60
G4double getMass() const
Get the cached particle mass.
Truncated multipion cross sections.
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 INCL_WARN(x)
#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)
G4int getMaxNumberMultipions() const
Get the maximum number of pions for multipion collisions.
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)