Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
37 #include "G4INCLNuclearDensity.hh"
38 #include "G4INCLParticleTable.hh"
39 #include "G4INCLGlobals.hh"
40 #include <algorithm>
41 
42 namespace G4INCL {
43 
45  theA(A),
46  theZ(Z),
47  theMaximumRadius((*rpCorrelationTable)(1.)),
48  theNuclearRadius(ParticleTable::getNuclearRadius(theA,theZ)),
49  rFromP(rpCorrelationTable),
50  // The interpolation table for local-energy look-ups is simply obtained by
51  // inverting the r-p correlation table.
52  tFromR(new InverseInterpolationTable(rFromP->getNodeValues(), rFromP->getNodeAbscissae()))
53  {
54  DEBUG("Interpolation table for local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
55  << std::endl
56  << tFromR->print()
57  << std::endl);
58  initializeTransmissionRadii();
59  }
60 
62  // We don't delete the rFromP table, which is cached in the
63  // NuclearDensityFactory
64  delete tFromR;
65  }
66 
68  theA(rhs.theA),
69  theZ(rhs.theZ),
70  theMaximumRadius(rhs.theMaximumRadius),
71  theNuclearRadius(rhs.theNuclearRadius),
72  // rFromP is owned by NuclearDensityFactory, so shallow copy is sufficient
73  rFromP(rhs.rFromP),
74  // deep copy for tFromR
75  tFromR(new InverseInterpolationTable(*(rhs.tFromR)))
76  {
77  std::copy(rhs.transmissionRadius, rhs.transmissionRadius+UnknownParticle, transmissionRadius);
78  }
79 
81  NuclearDensity temporaryDensity(rhs);
82  swap(temporaryDensity);
83  return *this;
84  }
85 
87  std::swap(theA, rhs.theA);
88  std::swap(theZ, rhs.theZ);
89  std::swap(theMaximumRadius, rhs.theMaximumRadius);
90  std::swap(theNuclearRadius, rhs.theNuclearRadius);
91  std::swap_ranges(transmissionRadius, transmissionRadius+UnknownParticle, rhs.transmissionRadius);
92  std::swap(rFromP, rhs.rFromP);
93  std::swap(tFromR, rhs.tFromR);
94  }
95 
96  void NuclearDensity::initializeTransmissionRadii() {
97  const G4double theProtonRadius = 0.88; // fm
98  const G4double theProtonTransmissionRadius = theNuclearRadius + theProtonRadius;
99 
100  transmissionRadius[Proton] = theProtonTransmissionRadius;
101  transmissionRadius[PiPlus] = theNuclearRadius;
102  transmissionRadius[PiMinus] = theNuclearRadius;
103  transmissionRadius[DeltaPlusPlus] = theProtonTransmissionRadius;
104  transmissionRadius[DeltaPlus] = theProtonTransmissionRadius;
105  transmissionRadius[DeltaMinus] = theProtonTransmissionRadius;
106  transmissionRadius[Composite] = theNuclearRadius;
107  // transmission radii for neutral particles intentionally left uninitialised
108  }
109 
111  return (*rFromP)(p);
112  }
113 
115  return (*tFromR)(r);
116  }
117 
118 }