Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
46 // #include <cassert>
47 
48 namespace G4INCL {
49 
50  namespace {
51  G4ThreadLocal ICrossSections *theCrossSections;
52  }
53 
54  namespace CrossSections {
55  G4double elastic(Particle const * const p1, Particle const * const p2) {
56  return theCrossSections->elastic(p1,p2);
57  }
58 
59  G4double total(Particle const * const p1, Particle const * const p2) {
60  return theCrossSections->total(p1,p2);
61  }
62 
63  G4double NDeltaToNN(Particle const * const p1, Particle const * const p2) {
64  return theCrossSections->NDeltaToNN(p1,p2);
65  }
66 
67  G4double NNToNDelta(Particle const * const p1, Particle const * const p2) {
68  return theCrossSections->NNToNDelta(p1,p2);
69  }
70 
71  G4double NNToxPiNN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
72  return theCrossSections->NNToxPiNN(xpi,p1,p2);
73  }
74 
75  G4double piNToDelta(Particle const * const p1, Particle const * const p2) {
76  return theCrossSections->piNToDelta(p1,p2);
77  }
78 
79  G4double piNToxPiN(const G4int xpi, Particle const * const p1, Particle const * const p2) {
80  return theCrossSections->piNToxPiN(xpi,p1,p2);
81  }
82 
83  G4double piNToEtaN(Particle const * const p1, Particle const * const p2) {
84  return theCrossSections->piNToEtaN(p1,p2);
85  }
86 
87  G4double piNToOmegaN(Particle const * const p1, Particle const * const p2) {
88  return theCrossSections->piNToOmegaN(p1,p2);
89  }
90 
91  G4double piNToEtaPrimeN(Particle const * const p1, Particle const * const p2) {
92  return theCrossSections->piNToEtaPrimeN(p1,p2);
93  }
94 
95  G4double etaNToPiN(Particle const * const p1, Particle const * const p2) {
96  return theCrossSections->etaNToPiN(p1,p2);
97  }
98 
99  G4double etaNToPiPiN(Particle const * const p1, Particle const * const p2) {
100  return theCrossSections->etaNToPiPiN(p1,p2);
101  }
102 
103  G4double omegaNToPiN(Particle const * const p1, Particle const * const p2) {
104  return theCrossSections->omegaNToPiN(p1,p2);
105  }
106 
107  G4double omegaNToPiPiN(Particle const * const p1, Particle const * const p2) {
108  return theCrossSections->omegaNToPiPiN(p1,p2);
109  }
110 
111  G4double etaPrimeNToPiN(Particle const * const p1, Particle const * const p2) {
112  return theCrossSections->etaPrimeNToPiN(p1,p2);
113  }
114 
115  G4double NNToNNEta(Particle const * const p1, Particle const * const p2) {
116  return theCrossSections->NNToNNEta(p1,p2);
117  }
118 
119  G4double NNToNNEtaExclu(Particle const * const p1, Particle const * const p2) {
120  return theCrossSections->NNToNNEtaExclu(p1,p2);
121  }
122 
123  G4double NNToNNEtaxPi(const G4int xpi, Particle const * const p1, Particle const * const p2) {
124  return theCrossSections->NNToNNEtaxPi(xpi,p1,p2);
125  }
126 
127  G4double NNToNDeltaEta(Particle const * const p1, Particle const * const p2) {
128  return theCrossSections->NNToNDeltaEta(p1,p2);
129  }
130 
131  G4double NNToNNOmega(Particle const * const p1, Particle const * const p2) {
132  return theCrossSections->NNToNNOmega(p1,p2);
133  }
134 
135  G4double NNToNNOmegaExclu(Particle const * const p1, Particle const * const p2) {
136  return theCrossSections->NNToNNOmegaExclu(p1,p2);
137  }
138 
139  G4double NNToNNOmegaxPi(const G4int xpi, Particle const * const p1, Particle const * const p2) {
140  return theCrossSections->NNToNNOmegaxPi(xpi,p1,p2);
141  }
142 
143  G4double NNToNDeltaOmega(Particle const * const p1, Particle const * const p2) {
144  return theCrossSections->NNToNDeltaOmega(p1,p2);
145  }
146 
148  return theCrossSections->calculateNNAngularSlope(energyCM, iso);
149  }
150 
151  G4double interactionDistancePiN(const G4double projectileKineticEnergy) {
152  ThreeVector nullVector;
153  ThreeVector unitVector(0., 0., 1.);
154 
155  Particle piPlusProjectile(PiPlus, unitVector, nullVector);
156  piPlusProjectile.setEnergy(piPlusProjectile.getMass()+projectileKineticEnergy);
157  piPlusProjectile.adjustMomentumFromEnergy();
158  Particle piZeroProjectile(PiZero, unitVector, nullVector);
159  piZeroProjectile.setEnergy(piZeroProjectile.getMass()+projectileKineticEnergy);
160  piZeroProjectile.adjustMomentumFromEnergy();
161  Particle piMinusProjectile(PiMinus, unitVector, nullVector);
162  piMinusProjectile.setEnergy(piMinusProjectile.getMass()+projectileKineticEnergy);
163  piMinusProjectile.adjustMomentumFromEnergy();
164 
165  Particle protonTarget(Proton, nullVector, nullVector);
166  Particle neutronTarget(Neutron, nullVector, nullVector);
167  const G4double sigmapipp = total(&piPlusProjectile, &protonTarget);
168  const G4double sigmapipn = total(&piPlusProjectile, &neutronTarget);
169  const G4double sigmapi0p = total(&piZeroProjectile, &protonTarget);
170  const G4double sigmapi0n = total(&piZeroProjectile, &neutronTarget);
171  const G4double sigmapimp = total(&piMinusProjectile, &protonTarget);
172  const G4double sigmapimn = total(&piMinusProjectile, &neutronTarget);
173  /* We compute the interaction distance from the largest of the pi-N cross
174  * sections. Note that this is different from INCL4.6, which just takes the
175  * average of the six, and will in general lead to a different geometrical
176  * cross section.
177  */
178  const G4double largestSigma = std::max(sigmapipp, std::max(sigmapipn, std::max(sigmapi0p, std::max(sigmapi0n, std::max(sigmapimp,sigmapimn)))));
179  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
180 
181  return interactionDistance;
182  }
183 
184  G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy) {
185 // assert(aSpecies.theType==Proton || aSpecies.theType==Neutron || aSpecies.theType==Composite);
186 // assert(aSpecies.theA>0);
187  ThreeVector nullVector;
188  ThreeVector unitVector(0.,0.,1.);
189 
190  const G4double kineticEnergyPerNucleon = kineticEnergy / aSpecies.theA;
191 
192  Particle protonProjectile(Proton, unitVector, nullVector);
193  protonProjectile.setEnergy(protonProjectile.getMass()+kineticEnergyPerNucleon);
194  protonProjectile.adjustMomentumFromEnergy();
195  Particle neutronProjectile(Neutron, unitVector, nullVector);
196  neutronProjectile.setEnergy(neutronProjectile.getMass()+kineticEnergyPerNucleon);
197  neutronProjectile.adjustMomentumFromEnergy();
198 
199  Particle protonTarget(Proton, nullVector, nullVector);
200  Particle neutronTarget(Neutron, nullVector, nullVector);
201  const G4double sigmapp = total(&protonProjectile, &protonTarget);
202  const G4double sigmapn = total(&protonProjectile, &neutronTarget);
203  const G4double sigmann = total(&neutronProjectile, &neutronTarget);
204  /* We compute the interaction distance from the largest of the NN cross
205  * sections. Note that this is different from INCL4.6, which just takes the
206  * average of the four, and will in general lead to a different geometrical
207  * cross section.
208  */
209  const G4double largestSigma = std::max(sigmapp, std::max(sigmapn, sigmann));
210  const G4double interactionDistance = std::sqrt(largestSigma/Math::tenPi);
211 
212  return interactionDistance;
213  }
214 
216  theCrossSections = c;
217  }
218 
220  delete theCrossSections;
221  theCrossSections = NULL;
222  }
223 
224  void initialize(Config const * const theConfig) {
225  CrossSectionsType crossSections = theConfig->getCrossSectionsType();
226  if(crossSections == INCL46CrossSections)
228  else if(crossSections == MultiPionsCrossSections)
230  else if(crossSections == TruncatedMultiPionsCrossSections) {
231  const G4int nMaxPi = theConfig->getMaxNumberMultipions();
232  if(nMaxPi>0)
234  else {
235  INCL_WARN("Truncated multipion cross sections were requested, but the specified maximum\n"
236  << "number of pions is <=0. Falling back to standard multipion cross-sections.\n");
238  }
239  } else if(crossSections == MultiPionsAndResonancesCrossSections)
241  }
242  }
243 }
G4double NNToNNEtaxPi(const G4int xpi, Particle const *const p1, Particle const *const p2)
G4double getMass() const
Get the cached particle mass.
Truncated multipion cross sections.
G4double etaNToPiN(Particle const *const p1, Particle const *const p2)
const G4double tenPi
G4double omegaNToPiN(Particle const *const p1, Particle const *const p2)
G4double NNToNNOmegaxPi(const G4int xpi, Particle const *const p1, Particle const *const p2)
G4double etaNToPiPiN(Particle const *const p1, Particle const *const p2)
G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy)
Compute the &quot;interaction distance&quot;.
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)
G4double etaPrimeNToPiN(Particle const *const p1, Particle const *const p2)
Cross sections used in INCL4.6.
G4double piNToEtaN(Particle const *const p1, Particle const *const p2)
G4double piNToEtaPrimeN(Particle const *const p1, Particle const *const p2)
G4double calculateNNAngularSlope(G4double energyCM, G4int iso)
Calculate the slope of the NN DDXS.
G4double NNToNDeltaOmega(Particle const *const p1, Particle const *const p2)
G4double NNToNDelta(Particle const *const p1, Particle const *const p2)
G4double NNToNNEtaExclu(Particle const *const p1, Particle const *const p2)
G4double omegaNToPiPiN(Particle const *const p1, Particle const *const p2)
G4int getMaxNumberMultipions() const
Get the maximum number of pions for multipion collisions.
G4double NNToNDeltaEta(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 &quot;interaction distance&quot;.
Multipion and mesonic Resonances cross sections.
void initialize(Config const *const theConfig)
Cross sections used in INCL Multipions.
G4double NNToNNOmega(Particle const *const p1, Particle const *const p2)
G4double piNToDelta(Particle const *const p1, Particle const *const p2)
Abstract interface for the cross-section classes.
G4double NNToNNOmegaExclu(Particle const *const p1, Particle const *const p2)
G4double piNToxPiN(const G4int xpi, Particle const *const p1, Particle const *const p2)
G4double piNToOmegaN(Particle const *const p1, Particle const *const p2)
double G4double
Definition: G4Types.hh:76
tuple c
Definition: test.py:13
G4double NNToNNEta(Particle const *const p1, Particle const *const p2)
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)