Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCLParticleSampler.hh
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 /** \file G4INCLParticleSampler.hh
38  * \brief Class for sampling particles in a nucleus
39  *
40  * \date 18 July 2012
41  * \author Davide Mancusi
42  */
43 
44 #ifndef G4INCLPARTICLESAMPLER_HH_
45 #define G4INCLPARTICLESAMPLER_HH_
46 
47 #include "G4INCLNuclearDensity.hh"
49 
50 namespace G4INCL {
51 
53 
54  public:
55  /** \brief Constructor.
56  *
57  * \param A the mass number
58  * \param Z the charge number
59  */
60  ParticleSampler(const G4int A, const G4int Z);
61 
62  /// \brief Destructor
64 
65  /// \brief Getter for theDensity
66  NuclearDensity const *getDensity() const { return theDensity; }
67 
68  /// \brief Getter for thePotential
69  NuclearPotential::INuclearPotential const *getPotential() const { return thePotential; }
70 
71  /// \brief Getter for rpCorrelationCoefficient
73 // assert(t==Proton || t==Neutron);
74  return rpCorrelationCoefficient[t];
75  }
76 
77  /// \brief Setter for theDensity
78  void setDensity(NuclearDensity const * const d);
79 
80  /// \brief Setter for thePotential
82 
83  /// \brief Setter for rpCorrelationCoefficient
84  void setRPCorrelationCoefficient(const ParticleType t, const G4double corrCoeff) {
85 // assert(t==Proton || t==Neutron);
86  rpCorrelationCoefficient[t] = corrCoeff;
87  }
88 
90 
91  private:
92 
93  void updateSampleOneParticleMethods();
94 
95  typedef Particle *(ParticleSampler::*ParticleSamplerMethod)(const ParticleType t) const;
96 
97  /** \brief Sample a list of particles.
98  *
99  * This method is a pointer to the method that does the real work for protons.
100  */
101  ParticleSamplerMethod sampleOneProton;
102 
103  /** \brief Sample a list of particles.
104  *
105  * This method is a pointer to the method that does the real work for neutrons.
106  */
107  ParticleSamplerMethod sampleOneNeutron;
108 
109  /// \brief Sample one particle taking into account the rp-correlation
110  Particle *sampleOneParticleWithRPCorrelation(const ParticleType t) const;
111 
112  /// \brief Sample one particle not taking into account the rp-correlation
113  Particle *sampleOneParticleWithoutRPCorrelation(const ParticleType t) const;
114 
115  /// \brief Sample one particle with a fuzzy rp-correlation
116  Particle *sampleOneParticleWithFuzzyRPCorrelation(const ParticleType t) const;
117 
118  /// \brief Mass number
119  const G4int theA;
120 
121  /// \brief Charge number
122  const G4int theZ;
123 
124  /// \brief Array of pointers to the r-space CDF table
125  InverseInterpolationTable const *theRCDFTable[UnknownParticle];
126 
127  /// \brief Array of pointers to the p-space CDF table
128  InverseInterpolationTable const *thePCDFTable[UnknownParticle];
129 
130  /// \brief Pointer to the Cluster's NuclearDensity
131  NuclearDensity const *theDensity;
132 
133  /// \brief Pointer to the Cluster's NuclearPotential
134  NuclearPotential::INuclearPotential const *thePotential;
135 
136  /// \brief Correlation coefficients for the r-p correlation
137  G4double rpCorrelationCoefficient[UnknownParticle];
138  };
139 
140 }
141 
142 #endif // G4INCLPARTICLESAMPLER_HH_
ParticleList sampleParticles(ThreeVector const &position)
NuclearDensity const * getDensity() const
Getter for theDensity.
Abstract interface to the nuclear potential.
const char * p
Definition: xmltok.h:285
NuclearPotential::INuclearPotential const * getPotential() const
Getter for thePotential.
int G4int
Definition: G4Types.hh:78
G4double getRPCorrelationCoefficient(const ParticleType t) const
Getter for rpCorrelationCoefficient.
void setDensity(NuclearDensity const *const d)
Setter for theDensity.
void setRPCorrelationCoefficient(const ParticleType t, const G4double corrCoeff)
Setter for rpCorrelationCoefficient.
ParticleSampler(const G4int A, const G4int Z)
Constructor.
Class for interpolating the inverse of a 1-dimensional function.
void setPotential(NuclearPotential::INuclearPotential const *const p)
Setter for thePotential.
double G4double
Definition: G4Types.hh:76