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

#include <G4UPiNuclearCrossSection.hh>

+ Inheritance diagram for G4UPiNuclearCrossSection:

Public Member Functions

 G4UPiNuclearCrossSection ()
 
 ~G4UPiNuclearCrossSection () override
 
G4bool IsElementApplicable (const G4DynamicParticle *aParticle, G4int Z, const G4Material *) final
 
G4double GetElasticCrossSection (const G4DynamicParticle *aParticle, G4int Z, G4int A) const
 
G4double GetInelasticCrossSection (const G4DynamicParticle *aParticle, G4int Z, G4int A) const
 
void BuildPhysicsTable (const G4ParticleDefinition &) final
 
void DumpPhysicsTable (const G4ParticleDefinition &) final
 
void CrossSectionDescription (std::ostream &) const final
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
bool ForAllAtomsAndEnergies () const
 
void SetForAllAtomsAndEnergies (G4bool val)
 
const G4StringGetName () const
 
void SetName (const G4String &nam)
 
G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)=delete
 
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 
G4String name
 

Detailed Description

Definition at line 45 of file G4UPiNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4UPiNuclearCrossSection()

G4UPiNuclearCrossSection::G4UPiNuclearCrossSection ( )
explicit

Definition at line 61 of file G4UPiNuclearCrossSection.cc.

62 : G4VCrossSectionDataSet("G4UPiNuclearCrossSection")
63{
64 isMaster = false;
65 spline = false;
66
67 piPlus = G4PionPlus::PionPlus();
68 piMinus = G4PionMinus::PionMinus();
69
70 aPower = 0.75;
71 elow = 20.0*CLHEP::MeV;
72}
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97

◆ ~G4UPiNuclearCrossSection()

G4UPiNuclearCrossSection::~G4UPiNuclearCrossSection ( )
override

Definition at line 74 of file G4UPiNuclearCrossSection.cc.

75{
76 if(isMaster) {
77 if(piPlusElastic) {
78 piPlusElastic->clearAndDestroy();
79 delete piPlusElastic;
80 piPlusElastic = nullptr;
81 }
82 if(piPlusInelastic) {
83 piPlusInelastic->clearAndDestroy();
84 delete piPlusInelastic;
85 piPlusInelastic = nullptr;
86 }
87 if(piMinusElastic) {
88 piMinusElastic->clearAndDestroy();
89 delete piMinusElastic;
90 piMinusElastic = nullptr;
91 }
92 if(piMinusInelastic) {
93 piMinusInelastic->clearAndDestroy();
94 delete piMinusInelastic;
95 piMinusInelastic = nullptr;
96 }
97 }
98}
void clearAndDestroy()

Member Function Documentation

◆ BuildPhysicsTable()

void G4UPiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 173 of file G4UPiNuclearCrossSection.cc.

174{
175 //G4cout << "G4UPiNuclearCrossSection::BuildPhysicsTable for "
176 // << p.GetParticleName() << " " << piPlusElastic << G4endl;
177 if(piPlusElastic) { return; }
178
179 if(&p != piPlus && &p != piMinus) {
181 ed << "This cross section is applicable only to pions and not to "
182 << p.GetParticleName() << G4endl;
183 G4Exception("G4UPiNuclearCrossSection::BuildPhysicsTable", "had001",
184 FatalException, ed);
185 return;
186 }
187
188 if(!piPlusElastic) {
189#ifdef G4MULTITHREADED
190 G4MUTEXLOCK(&pionUXSMutex);
191 if(!piPlusElastic) {
192#endif
193 isMaster = true;
194#ifdef G4MULTITHREADED
195 }
196 G4MUTEXUNLOCK(&pionUXSMutex);
197#endif
198 }
199 if(!isMaster) { return; }
200
202 G4Pow* g4pow = G4Pow::GetInstance();
203 for(G4int i=0; i<NZ; ++i) {
204 theA[i] = nist->GetAtomicMassAmu(theZ[i]);
205 }
206 for(G4int i=1; i<93; ++i) {
207 APower[i] = g4pow->powA(nist->GetAtomicMassAmu(i),aPower);
208 }
209 G4int idx = 1;
210 for(G4int i=3; i<93; ++i) {
211 if(theZ[idx] == i) {
212 idxZ[i] = -idx;
213 ++idx;
214 } else {
215 idxZ[i] = idx;
216 }
217 }
218
219 piPlusElastic = new G4PhysicsTable();
220 piPlusInelastic = new G4PhysicsTable();
221 piMinusElastic = new G4PhysicsTable();
222 piMinusInelastic = new G4PhysicsTable();
223
224 LoadData();
225 //G4cout << "### Initialisation done " << G4endl;
226}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
static G4NistManager * Instance()
G4double GetAtomicMassAmu(const G4String &symb) const
const G4String & GetParticleName() const
Definition: G4Pow.hh:49
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230

Referenced by G4BGGPionElasticXS::BuildPhysicsTable(), and G4BGGPionInelasticXS::BuildPhysicsTable().

◆ CrossSectionDescription()

void G4UPiNuclearCrossSection::CrossSectionDescription ( std::ostream &  outFile) const
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 594 of file G4UPiNuclearCrossSection.cc.

595{
596 outFile << "G4UPiNuclearCrossSection calculates the total, elastic and\n"
597 << "inelastic cross sections for pion scattering from nuclei\n"
598 << "heavier than hydrogen. It is based on the Barashenkov\n"
599 << "parameterization and is valid for all incident energies.\n";
600}

◆ DumpPhysicsTable()

void G4UPiNuclearCrossSection::DumpPhysicsTable ( const G4ParticleDefinition p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 158 of file G4UPiNuclearCrossSection.cc.

159{
160 if(&p == piPlus) {
161 G4cout << "### G4UPiNuclearCrossSection Elastic data for pi+" << G4endl;
162 G4cout << *piPlusElastic << G4endl;
163 G4cout << "### G4UPiNuclearCrossSection Inelastic data for pi+" << G4endl;
164 G4cout << *piPlusInelastic << G4endl;
165 } else if(&p == piMinus) {
166 G4cout << "### G4UPiNuclearCrossSection Elastic data for pi-" << G4endl;
167 G4cout << *piMinusElastic << G4endl;
168 G4cout << "### G4UPiNuclearCrossSection Inelastic data for pi-" << G4endl;
169 G4cout << *piMinusInelastic << G4endl;
170 }
171}
G4GLOB_DLL std::ostream G4cout

◆ GetElasticCrossSection()

G4double G4UPiNuclearCrossSection::GetElasticCrossSection ( const G4DynamicParticle aParticle,
G4int  Z,
G4int  A 
) const
inline

Definition at line 107 of file G4UPiNuclearCrossSection.hh.

109{
110 const G4PhysicsTable* table =
111 (dp->GetDefinition() == piPlus) ? piPlusElastic : piMinusElastic;
112 return Interpolate(Z, A, dp->GetKineticEnergy(), table);
113}
const G4int Z[17]
const G4double A[17]

Referenced by G4BGGPionElasticXS::BuildPhysicsTable(), and G4BGGPionElasticXS::GetElementCrossSection().

◆ GetInelasticCrossSection()

G4double G4UPiNuclearCrossSection::GetInelasticCrossSection ( const G4DynamicParticle aParticle,
G4int  Z,
G4int  A 
) const
inline

Definition at line 116 of file G4UPiNuclearCrossSection.hh.

118{
119 const G4PhysicsTable* table =
120 (dp->GetDefinition() == piPlus) ? piPlusInelastic : piMinusInelastic;
121 return Interpolate(Z, A, dp->GetKineticEnergy(), table);
122}

Referenced by G4BGGPionInelasticXS::BuildPhysicsTable(), and G4BGGPionInelasticXS::GetElementCrossSection().

◆ IsElementApplicable()

G4bool G4UPiNuclearCrossSection::IsElementApplicable ( const G4DynamicParticle aParticle,
G4int  Z,
const G4Material  
)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 101 of file G4UPiNuclearCrossSection.cc.

103{
104 return (1 < Z);
105}

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