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