Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLCascade.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// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
39#ifndef G4INCLCascade_hh
40#define G4INCLCascade_hh 1
41
42#include "G4INCLParticle.hh"
43#include "G4INCLNucleus.hh"
45#include "G4INCLEventAction.hh"
47#include "G4INCLAvatarAction.hh"
48#include "G4INCLEventInfo.hh"
49#include "G4INCLGlobalInfo.hh"
50#include "G4INCLLogger.hh"
51#include "G4INCLConfig.hh"
52#include "G4INCLRootFinder.hh"
53
54namespace G4INCL {
55 class INCL {
56 public:
57 INCL(Config const * const config);
58
59 ~INCL();
60
61 G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z);
62 G4bool initializeTarget(const G4int A, const G4int Z);
63 inline const EventInfo &processEvent() {
64 return processEvent(
65 theConfig->getProjectileSpecies(),
66 theConfig->getProjectileKineticEnergy(),
67 theConfig->getTargetA(),
68 theConfig->getTargetZ()
69 );
70 }
72 ParticleSpecies const &projectileSpecies,
73 const G4double kineticEnergy,
74 const G4int targetA,
75 const G4int targetZ
76 );
77
78 void finalizeGlobalInfo();
79 const GlobalInfo &getGlobalInfo() const { return theGlobalInfo; }
80
81 std::string configToString() { return theConfig->echo(); }
82
83 private:
84 IPropagationModel *propagationModel;
85 G4int theA, theZ;
86 G4bool targetInitSuccess;
87 G4double maxImpactParameter;
88 G4double maxUniverseRadius;
89 G4double maxInteractionDistance;
90 G4double fixedImpactParameter;
91 EventAction *eventAction;
92 PropagationAction *propagationAction;
93 AvatarAction *avatarAction;
94 Config const * const theConfig;
95 Nucleus *nucleus;
96
97 EventInfo theEventInfo;
98 GlobalInfo theGlobalInfo;
99
100 /// \brief Remnant size below which cascade stops
101 G4int minRemnantSize;
102
103 /// \brief Class to adjust remnant recoil
104 class RecoilFunctor : public RootFunctor {
105 public:
106 /** \brief Prepare for calling the () operator and scaleParticleEnergies
107 *
108 * The constructor sets the private class members.
109 */
110 RecoilFunctor(Nucleus * const n, const EventInfo &ei) :
111 RootFunctor(0., 1E6),
112 nucleus(n),
113 outgoingParticles(n->getStore()->getOutgoingParticles()),
114 theEventInfo(ei) {
115 for(ParticleIter p=outgoingParticles.begin(); p!=outgoingParticles.end(); ++p) {
116 particleMomenta.push_back((*p)->getMomentum());
117 particleKineticEnergies.push_back((*p)->getKineticEnergy());
118 }
119 }
120 virtual ~RecoilFunctor() {}
121
122 /** \brief Compute the energy-conservation violation.
123 *
124 * \param x scale factor for the particle energies
125 * \return the energy-conservation violation
126 */
127 G4double operator()(const G4double x) const {
128 scaleParticleEnergies(x);
129 return nucleus->getConservationBalance(theEventInfo,true).energy;
130 }
131
132 /// \brief Clean up after root finding
133 void cleanUp(const G4bool success) const {
134 if(!success)
135 scaleParticleEnergies(1.);
136 }
137
138 private:
139 /// \brief Pointer to the nucleus
140 Nucleus *nucleus;
141 /// \brief List of final-state particles.
142 ParticleList const &outgoingParticles;
143 // \brief Reference to the EventInfo object
144 EventInfo const &theEventInfo;
145 /// \brief Initial momenta of the outgoing particles
146 std::list<ThreeVector> particleMomenta;
147 /// \brief Initial kinetic energies of the outgoing particles
148 std::list<G4double> particleKineticEnergies;
149
150 /** \brief Scale the kinetic energies of the outgoing particles.
151 *
152 * \param rescale scale factor
153 */
154 void scaleParticleEnergies(const G4double rescale) const {
155 // Rescale the energies (and the momenta) of the outgoing particles.
156 ThreeVector pBalance = nucleus->getIncomingMomentum();
157 std::list<ThreeVector>::const_iterator iP = particleMomenta.begin();
158 std::list<G4double>::const_iterator iE = particleKineticEnergies.begin();
159 for( ParticleIter i = outgoingParticles.begin(); i != outgoingParticles.end(); ++i, ++iP, ++iE)
160 {
161 const G4double mass = (*i)->getMass();
162 const G4double newKineticEnergy = (*iE) * rescale;
163
164 (*i)->setMomentum(*iP);
165 (*i)->setEnergy(mass + newKineticEnergy);
166 (*i)->adjustMomentumFromEnergy();
167
168 pBalance -= (*i)->getMomentum();
169 }
170
171 nucleus->setMomentum(pBalance);
172 const G4double remnantMass = ParticleTable::getTableMass(nucleus->getA(),nucleus->getZ()) + nucleus->getExcitationEnergy();
173 const G4double pRem2 = pBalance.mag2();
174 const G4double recoilEnergy = pRem2/
175 (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
176 nucleus->setEnergy(remnantMass + recoilEnergy);
177 }
178 };
179
180 /// \brief Class to adjust remnant recoil in the reaction CM system
181 class RecoilCMFunctor : public RootFunctor {
182 public:
183 /** \brief Prepare for calling the () operator and scaleParticleEnergies
184 *
185 * The constructor sets the private class members.
186 */
187 RecoilCMFunctor(Nucleus * const n, const EventInfo &ei) :
188 RootFunctor(0., 1E6),
189 nucleus(n),
190 theIncomingMomentum(nucleus->getIncomingMomentum()),
191 outgoingParticles(n->getStore()->getOutgoingParticles()),
192 theEventInfo(ei) {
193 thePTBoostVector = nucleus->getIncomingMomentum()/nucleus->getInitialEnergy();
194 for(ParticleIter p=outgoingParticles.begin(); p!=outgoingParticles.end(); ++p) {
195 (*p)->boost(thePTBoostVector);
196 particleCMMomenta.push_back((*p)->getMomentum());
197 }
198 }
199 virtual ~RecoilCMFunctor() {}
200
201 /** \brief Compute the energy-conservation violation.
202 *
203 * \param x scale factor for the particle energies
204 * \return the energy-conservation violation
205 */
206 G4double operator()(const G4double x) const {
207 scaleParticleCMMomenta(x);
208 return nucleus->getConservationBalance(theEventInfo,true).energy;
209 }
210
211 /// \brief Clean up after root finding
212 void cleanUp(const G4bool success) const {
213 if(!success)
214 scaleParticleCMMomenta(1.);
215 }
216
217 private:
218 /// \brief Pointer to the nucleus
219 Nucleus *nucleus;
220 /// \brief Projectile-target CM boost vector
221 ThreeVector thePTBoostVector;
222 /// \brief Incoming momentum
223 ThreeVector theIncomingMomentum;
224 /// \brief List of final-state particles.
225 ParticleList const &outgoingParticles;
226 // \brief Reference to the EventInfo object
227 EventInfo const &theEventInfo;
228 /// \brief Initial CM momenta of the outgoing particles
229 std::list<ThreeVector> particleCMMomenta;
230
231 /** \brief Scale the kinetic energies of the outgoing particles.
232 *
233 * \param rescale scale factor
234 */
235 void scaleParticleCMMomenta(const G4double rescale) const {
236 // Rescale the CM momenta of the outgoing particles.
237 ThreeVector remnantMomentum = theIncomingMomentum;
238 std::list<ThreeVector>::const_iterator iP = particleCMMomenta.begin();
239 for( ParticleIter i = outgoingParticles.begin(); i != outgoingParticles.end(); ++i, ++iP)
240 {
241 (*i)->setMomentum(*iP * rescale);
242 (*i)->adjustEnergyFromMomentum();
243 (*i)->boost(-thePTBoostVector);
244
245 remnantMomentum -= (*i)->getMomentum();
246 }
247
248 nucleus->setMomentum(remnantMomentum);
249 const G4double remnantMass = ParticleTable::getTableMass(nucleus->getA(),nucleus->getZ()) + nucleus->getExcitationEnergy();
250 const G4double pRem2 = remnantMomentum.mag2();
251 const G4double recoilEnergy = pRem2/
252 (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
253 nucleus->setEnergy(remnantMass + recoilEnergy);
254 }
255 };
256
257 /** \brief Rescale the energies of the outgoing particles.
258 *
259 * Allow for the remnant recoil energy by rescaling the energy (and
260 * momenta) of the outgoing particles.
261 */
262 void rescaleOutgoingForRecoil();
263
264#ifndef INCLXX_IN_GEANT4_MODE
265 /** \brief Run global conservation checks
266 *
267 * Check that energy and momentum are correctly conserved. If not, issue
268 * a warning.
269 *
270 * Also feeds the balance variables in theEventInfo.
271 *
272 * \param afterRecoil whether to take into account nuclear recoil
273 */
274 void globalConservationChecks(G4bool afterRecoil);
275#endif
276
277 /** \brief Stopping criterion for the cascade
278 *
279 * Returns true if the cascade should continue, and false if any of the
280 * stopping criteria is satisfied.
281 */
282 G4bool continueCascade();
283
284 /** \brief Make a projectile pre-fragment out of geometrical spectators
285 *
286 * The projectile pre-fragment is assigned an excitation energy given
287 * by \f$E_\mathrm{sp}-E_\mathrm{i,A}\f$, where \f$E_\mathrm{sp}\f$ is the
288 * sum of the energies of the spectator particles, and \f$E_\mathrm{i,A}\f$
289 * is the sum of the smallest \f$A\f$ particle energies initially present
290 * in the projectile, \f$A\f$ being the mass of the projectile
291 * pre-fragment. This is equivalent to assuming that the excitation
292 * energy is given by the sum of the transitions of all excited
293 * projectile components to the "holes" left by the participants.
294 *
295 * This method can modify the outgoing list and adds a projectile
296 * pre-fragment.
297 *
298 * \return the number of dynamical spectators that were merged back in
299 * the projectile
300 */
301 G4int makeProjectileRemnant();
302
303 /** \brief Make a compound nucleus
304 *
305 * Selects the projectile components that can actually enter their
306 * potential and puts them into the target nucleus. If the CN excitation
307 * energy turns out to be negative, the event is considered a
308 * transparent. This method modifies theEventInfo and theGlobalInfo.
309 */
310 void makeCompoundNucleus();
311
312 /// \brief Initialise the cascade
313 G4bool preCascade(ParticleSpecies const projectileSpecies, const G4double kineticEnergy);
314
315 /// \brief The actual cascade loop
316 void cascade();
317
318 /// \brief Finalise the cascade and clean up
319 void postCascade();
320
321 /** \brief Initialise the maximum interaction distance.
322 *
323 * Used in forced CN events.
324 */
325 void initMaxInteractionDistance(ParticleSpecies const &p, const G4double kineticEnergy);
326
327 /** \brief Initialize the universe radius.
328 *
329 * Used for determining the energy-dependent size of the volume particles
330 * live in.
331 */
332 void initUniverseRadius(ParticleSpecies const &p, const G4double kineticEnergy, const G4int A, const G4int Z);
333 };
334}
335
336#endif
Simple container for output of event results.
Simple container for output of calculation-wide results.
Static root-finder algorithm.
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4int getTargetA() const
Get the target mass number.
ParticleSpecies getProjectileSpecies() const
Get the projectile species.
std::string const echo() const
Echo the input options.
G4int getTargetZ() const
Get the target charge number.
G4float getProjectileKineticEnergy() const
Get the projectile kinetic energy.
G4bool initializeTarget(const G4int A, const G4int Z)
const EventInfo & processEvent()
const GlobalInfo & getGlobalInfo() const
void finalizeGlobalInfo()
std::string configToString()
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z)
ConservationBalance getConservationBalance(EventInfo const &theEventInfo, const G4bool afterRecoil) const
Compute charge, mass, energy and momentum balance.
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
RootFunctor(const G4double x0, const G4double x1)
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter