Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ComponentBarNucleonNucleusXsc Class Reference

#include <G4ComponentBarNucleonNucleusXsc.hh>

+ Inheritance diagram for G4ComponentBarNucleonNucleusXsc:

Public Member Functions

 G4ComponentBarNucleonNucleusXsc ()
 
 ~G4ComponentBarNucleonNucleusXsc () override
 
G4double GetTotalIsotopeCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4int) final
 
G4double GetTotalElementCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4double) final
 
G4double GetInelasticIsotopeCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4int) final
 
G4double GetInelasticElementCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4double) final
 
G4double GetElasticElementCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4double) final
 
G4double GetElasticIsotopeCrossSection (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z, G4int) final
 
void ComputeCrossSections (const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z)
 
void BuildPhysicsTable (const G4ParticleDefinition &) final
 
void Description (std::ostream &) const final
 
G4double GetElementCrossSection (const G4DynamicParticle *aParticle, G4int Z)
 
G4double GetElasticCrossSection (const G4DynamicParticle *aParticle, G4int Z)
 
G4double GetTotalXsc ()
 
G4double GetElasticXsc ()
 
G4double GetInelasticXsc ()
 
- Public Member Functions inherited from G4VComponentCrossSection
 G4VComponentCrossSection (const G4String &nam="")
 
virtual ~G4VComponentCrossSection ()
 
G4double GetTotalElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
G4double GetInelasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
G4double GetElasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
virtual G4double ComputeQuasiElasticRatio (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Detailed Description

Definition at line 49 of file G4ComponentBarNucleonNucleusXsc.hh.

Constructor & Destructor Documentation

◆ G4ComponentBarNucleonNucleusXsc()

G4ComponentBarNucleonNucleusXsc::G4ComponentBarNucleonNucleusXsc ( )
explicit

Definition at line 56 of file G4ComponentBarNucleonNucleusXsc.cc.

57 : G4VComponentCrossSection("BarashenkovNucleonNucleusXsc"),
58 fTotalXsc(0.0), fInelasticXsc(0.0), fElasticXsc(0.0), isMaster(false)
59{
60 theNeutron = G4Neutron::Neutron();
61 theProton = G4Proton::Proton();
62}
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
static G4Proton * Proton()
Definition G4Proton.cc:90
G4VComponentCrossSection(const G4String &nam="")

◆ ~G4ComponentBarNucleonNucleusXsc()

G4ComponentBarNucleonNucleusXsc::~G4ComponentBarNucleonNucleusXsc ( )
override

Definition at line 66 of file G4ComponentBarNucleonNucleusXsc.cc.

67{
68 if(isMaster && nullptr != thePData) {
69 for(G4int i=0; i<NZ; ++i) {
70 delete (*thePData)[i];
71 delete (*theNData)[i];
72 }
73 delete thePData;
74 delete theNData;
75 thePData = nullptr;
76 theNData = nullptr;
77 }
78}
int G4int
Definition G4Types.hh:85

Member Function Documentation

◆ BuildPhysicsTable()

void G4ComponentBarNucleonNucleusXsc::BuildPhysicsTable ( const G4ParticleDefinition & )
finalvirtual

Reimplemented from G4VComponentCrossSection.

Definition at line 202 of file G4ComponentBarNucleonNucleusXsc.cc.

203{
204 if(nullptr != theNData) { return; }
205
206#ifdef G4MULTITHREADED
207 G4MUTEXLOCK(&barNNXSMutex);
208 if(!theNData) {
209#endif
210 isMaster = true;
211#ifdef G4MULTITHREADED
212 }
213 G4MUTEXUNLOCK(&barNNXSMutex);
214#endif
215 if(isMaster) { LoadData(); }
216}
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)

Referenced by G4NucleonNuclearCrossSection::BuildPhysicsTable().

◆ ComputeCrossSections()

void G4ComponentBarNucleonNucleusXsc::ComputeCrossSections ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z )

Definition at line 142 of file G4ComponentBarNucleonNucleusXsc.cc.

144{
145 G4int Z = std::min(ZZ, 92);
146 G4int it = 0;
147 for(; it<NZ; ++it) { if(Z <= theZ[it]) { break; } }
148 if( it >= NZ ) { it = NZ-1; }
149
150 std::vector<G4PiData*>* theData = (aParticle == theNeutron) ? theNData : thePData;
151
152 if( theZ[it] == Z ) {
153 fInelasticXsc = (*theData)[it]->ReactionXSection(kineticEnergy);
154 fTotalXsc = (*theData)[it]->TotalXSection(kineticEnergy);
155 } else {
156 if(0 == it) { it = 1; }
157 G4double x1 = (*theData)[it-1]->ReactionXSection(kineticEnergy);
158 G4double xt1 = (*theData)[it-1]->TotalXSection(kineticEnergy);
159 G4double x2 = (*theData)[it]->ReactionXSection(kineticEnergy);
160 G4double xt2 = (*theData)[it]->TotalXSection(kineticEnergy);
161 G4int Z1 = theZ[it-1];
162 G4int Z2 = theZ[it];
163
164 fInelasticXsc = Interpolate(Z1, Z2, Z, x1, x2);
165 fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
166 }
167
168 fElasticXsc = std::max(fTotalXsc - fInelasticXsc, 0.0);
169}
double G4double
Definition G4Types.hh:83

Referenced by GetElasticCrossSection(), GetElasticElementCrossSection(), GetElasticIsotopeCrossSection(), GetElementCrossSection(), GetInelasticElementCrossSection(), GetInelasticIsotopeCrossSection(), GetTotalElementCrossSection(), and GetTotalIsotopeCrossSection().

◆ Description()

void G4ComponentBarNucleonNucleusXsc::Description ( std::ostream & outFile) const
finalvirtual

Reimplemented from G4VComponentCrossSection.

Definition at line 189 of file G4ComponentBarNucleonNucleusXsc.cc.

190{
191 outFile << "G4ComponentBarNucleonNucleusXsc is a variant of the Barashenkov\n"
192 << "cross section parameterization to be used of protons and\n"
193 << "neutrons on targets heavier than hydrogen. It is intended for\n"
194 << "use as a cross section component and is currently used by\n"
195 << "G4BGGNucleonInelasticXS. It is valid for incident energies up\n"
196 << "to 1 TeV.\n";
197}

◆ GetElasticCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetElasticCrossSection ( const G4DynamicParticle * aParticle,
G4int Z )
inline

Definition at line 135 of file G4ComponentBarNucleonNucleusXsc.hh.

137{
138 ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(),Z);
139 return fElasticXsc;
140}
void ComputeCrossSections(const G4ParticleDefinition *aParticle, G4double kinEnergy, G4int Z)

◆ GetElasticElementCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetElasticElementCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4double  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 122 of file G4ComponentBarNucleonNucleusXsc.cc.

125{
126 ComputeCrossSections(aParticle, kinEnergy, Z);
127 return fElasticXsc;
128}

◆ GetElasticIsotopeCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetElasticIsotopeCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4int  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 132 of file G4ComponentBarNucleonNucleusXsc.cc.

135{
136 ComputeCrossSections(aParticle, kinEnergy, Z);
137 return fElasticXsc;
138}

◆ GetElasticXsc()

G4double G4ComponentBarNucleonNucleusXsc::GetElasticXsc ( )
inline

Definition at line 92 of file G4ComponentBarNucleonNucleusXsc.hh.

92{ return fElasticXsc; };

◆ GetElementCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetElementCrossSection ( const G4DynamicParticle * aParticle,
G4int Z )
inline

Definition at line 127 of file G4ComponentBarNucleonNucleusXsc.hh.

129{
130 ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(),Z);
131 return fInelasticXsc;
132}

◆ GetInelasticElementCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetInelasticElementCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4double  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 112 of file G4ComponentBarNucleonNucleusXsc.cc.

115{
116 ComputeCrossSections(aParticle, kinEnergy, Z);
117 return fInelasticXsc;
118}

◆ GetInelasticIsotopeCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetInelasticIsotopeCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4int  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 102 of file G4ComponentBarNucleonNucleusXsc.cc.

105{
106 ComputeCrossSections(aParticle, kinEnergy, Z);
107 return fInelasticXsc;
108}

◆ GetInelasticXsc()

G4double G4ComponentBarNucleonNucleusXsc::GetInelasticXsc ( )
inline

Definition at line 93 of file G4ComponentBarNucleonNucleusXsc.hh.

93{ return fInelasticXsc; };

◆ GetTotalElementCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetTotalElementCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4double  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 92 of file G4ComponentBarNucleonNucleusXsc.cc.

95{
96 ComputeCrossSections(aParticle, kinEnergy, Z);
97 return fTotalXsc;
98}

◆ GetTotalIsotopeCrossSection()

G4double G4ComponentBarNucleonNucleusXsc::GetTotalIsotopeCrossSection ( const G4ParticleDefinition * aParticle,
G4double kinEnergy,
G4int Z,
G4int  )
finalvirtual

Implements G4VComponentCrossSection.

Definition at line 82 of file G4ComponentBarNucleonNucleusXsc.cc.

85{
86 ComputeCrossSections(aParticle, kinEnergy, Z);
87 return fTotalXsc;
88}

◆ GetTotalXsc()

G4double G4ComponentBarNucleonNucleusXsc::GetTotalXsc ( )
inline

Definition at line 91 of file G4ComponentBarNucleonNucleusXsc.hh.

91{ return fTotalXsc; };

The documentation for this class was generated from the following files: