Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLNuclearDensity.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// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
41#include "G4INCLGlobals.hh"
42#include <algorithm>
43
44namespace G4INCL {
45
47 theA(A),
48 theZ(Z),
49 theMaximumRadius((*rpCorrelationTable)(1.)),
50 theNuclearRadius(ParticleTable::getNuclearRadius(theA,theZ)),
51 rFromP(rpCorrelationTable),
52 // The interpolation table for local-energy look-ups is simply obtained by
53 // inverting the r-p correlation table.
54 tFromR(new InverseInterpolationTable(rFromP->getNodeValues(), rFromP->getNodeAbscissae()))
55 {
56 DEBUG("Interpolation table for local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
57 << std::endl
58 << tFromR->print()
59 << std::endl);
60 initializeTransmissionRadii();
61 }
62
64 // We don't delete the rFromP table, which is cached in the
65 // NuclearDensityFactory
66 delete tFromR;
67 }
68
70 theA(rhs.theA),
71 theZ(rhs.theZ),
72 theMaximumRadius(rhs.theMaximumRadius),
73 theNuclearRadius(rhs.theNuclearRadius),
74 // rFromP is owned by NuclearDensityFactory, so shallow copy is sufficient
75 rFromP(rhs.rFromP),
76 // deep copy for tFromR
77 tFromR(new InverseInterpolationTable(*(rhs.tFromR)))
78 {
79 std::copy(rhs.transmissionRadius, rhs.transmissionRadius+UnknownParticle, transmissionRadius);
80 }
81
83 NuclearDensity temporaryDensity(rhs);
84 swap(temporaryDensity);
85 return *this;
86 }
87
89 std::swap(theA, rhs.theA);
90 std::swap(theZ, rhs.theZ);
91 std::swap(theMaximumRadius, rhs.theMaximumRadius);
92 std::swap(theNuclearRadius, rhs.theNuclearRadius);
93 std::swap_ranges(transmissionRadius, transmissionRadius+UnknownParticle, rhs.transmissionRadius);
94 std::swap(rFromP, rhs.rFromP);
95 std::swap(tFromR, rhs.tFromR);
96 }
97
98 void NuclearDensity::initializeTransmissionRadii() {
99 const G4double theProtonRadius = 0.88; // fm
100 const G4double theProtonTransmissionRadius = theNuclearRadius + theProtonRadius;
101
102 transmissionRadius[Proton] = theProtonTransmissionRadius;
103 transmissionRadius[PiPlus] = theNuclearRadius;
104 transmissionRadius[PiMinus] = theNuclearRadius;
105 transmissionRadius[DeltaPlusPlus] = theProtonTransmissionRadius;
106 transmissionRadius[DeltaPlus] = theProtonTransmissionRadius;
107 transmissionRadius[DeltaMinus] = theProtonTransmissionRadius;
108 transmissionRadius[Composite] = theNuclearRadius;
109 // transmission radii for neutral particles intentionally left uninitialised
110 }
111
113 return (*rFromP)(p);
114 }
115
117 return (*tFromR)(r);
118 }
119
120}
#define DEBUG(x)
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
Class for interpolating the inverse of a 1-dimensional function.
G4double getMaxRFromP(G4double p) const
Get the maximum allowed radius for a given momentum.
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
NuclearDensity & operator=(const NuclearDensity &rhs)
Assignment operator.
G4double getMaxTFromR(G4double r) const
NuclearDensity(G4int A, G4int Z, InverseInterpolationTable *rpCorrelationTable)