Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LENDCombinedModel.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// 2012-09-17 T. Koi (SLAC/EPP): First implementation
27// 2024-07-17 D.M.Wright (LLNL): Added GetFatalEnergyCheckLevels() to call equivalent function
28// in the selected channel. This fixes incorrect implemenation
29// and prevents crash.
30
33#include "G4LENDElastic.hh"
34#include "G4LENDInelastic.hh"
35#include "G4LENDCapture.hh"
36#include "G4LENDFission.hh"
37#include "G4DynamicParticle.hh"
38
40:G4LENDModel( "LENDCombinedModel" ) {
41 proj = pd;
42 crossSection = new G4LENDCombinedCrossSection( pd );
43 elastic = new G4LENDElastic( pd );
44 inelastic = new G4LENDInelastic( pd );
45 capture = new G4LENDCapture( pd );
46 fission = new G4LENDFission( pd );
47 channels[0] = elastic;
48 channels[1] = inelastic;
49 channels[2] = capture;
50 channels[3] = fission;
51}
52
54 crossSection->BuildPhysicsTable( projectile );
56}
57
59 const G4Isotope* , const G4Element* , const G4Material* ) {
60
61 G4bool result = false;
62 if ( get_target_from_map ( lend_manager->GetNucleusEncoding ( iZ, iA , iM ) ) != NULL ) result=true;
63 return result;
64}
65
66
68
69 G4LENDModel* channel = NULL;
70
71 G4int iZ = aTarg.GetZ_asInt();
72 G4int iA = aTarg.GetA_asInt();
73 //To pass kinetic energy, need to generate dynamic particle
74 G4DynamicParticle* dp = new G4DynamicParticle( proj , G4ThreeVector(0.,0.,1.) , aTrack.GetKineticEnergy() );
75 G4int ichannel = crossSection->SelectChannel( dp , iZ , iA , aTarg.GetIsotope(), NULL , aTrack.GetMaterial() );
76 delete dp;
77 channel = channels[ichannel];
78 channel_selected = channel; // needed by std::pair() defined below
79 return channel->ApplyYourself(aTrack,aTarg);
80}
81
82// must call the right CheckLevels (Fission is different from other channels)
83const std::pair<G4double, G4double> G4LENDCombinedModel::GetFatalEnergyCheckLevels() const
84{
85 /* D. M. Wright debug statement
86 std::cout << "G4LENDCombinedModel "
87 << " " << channel_selected->GetModelName()
88 << " GetFatalEnergyCheckLevels"
89 << std::endl;
90 */
91 return channel_selected->GetFatalEnergyCheckLevels();
92}
CLHEP::Hep3Vector G4ThreeVector
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
const G4Material * GetMaterial() const
G4double GetKineticEnergy() const
G4bool HasData(const G4DynamicParticle *, G4int iZ, G4int iA, G4int iM, const G4Isotope *, const G4Element *, const G4Material *)
virtual const std::pair< G4double, G4double > GetFatalEnergyCheckLevels() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
G4LENDCombinedModel(G4ParticleDefinition *pd)
void BuildPhysicsTable(const G4ParticleDefinition &)
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
G4LENDManager * lend_manager
G4LENDModel(G4String name="LENDModel")
void create_used_target_map()
G4ParticleDefinition * proj
G4GIDI_target * get_target_from_map(G4int nuclear_code)
G4int GetA_asInt() const
Definition G4Nucleus.hh:78
G4int GetZ_asInt() const
Definition G4Nucleus.hh:84
const G4Isotope * GetIsotope()
Definition G4Nucleus.hh:90