Geant4 10.7.0
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 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 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 G4int GetVerboseLevel () 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
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

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 piPlus = G4PionPlus::PionPlus();
66 piMinus = G4PionMinus::PionMinus();
67
68 aPower = 0.75;
69 elow = 20.0*CLHEP::MeV;
70}
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97

◆ ~G4UPiNuclearCrossSection()

G4UPiNuclearCrossSection::~G4UPiNuclearCrossSection ( )
override

Definition at line 72 of file G4UPiNuclearCrossSection.cc.

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

Member Function Documentation

◆ BuildPhysicsTable()

void G4UPiNuclearCrossSection::BuildPhysicsTable ( const G4ParticleDefinition p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 169 of file G4UPiNuclearCrossSection.cc.

170{
171 //G4cout << "G4UPiNuclearCrossSection::BuildPhysicsTable for "
172 // << p.GetParticleName() << " " << piPlusElastic << G4endl;
173 if(piPlusElastic) { return; }
174
175 if(&p != piPlus && &p != piMinus) {
177 ed << "This cross section is applicable only to pions and not to "
178 << p.GetParticleName() << G4endl;
179 G4Exception("G4UPiNuclearCrossSection::BuildPhysicsTable", "had001",
180 FatalException, ed);
181 return;
182 }
183
184 if(!piPlusElastic) {
185#ifdef G4MULTITHREADED
186 G4MUTEXLOCK(&pionUXSMutex);
187 if(!piPlusElastic) {
188#endif
189 isMaster = true;
190#ifdef G4MULTITHREADED
191 }
192 G4MUTEXUNLOCK(&pionUXSMutex);
193#endif
194 }
195 if(!isMaster) { return; }
196
198 G4Pow* g4pow = G4Pow::GetInstance();
199 for(G4int i=0; i<NZ; ++i) {
200 theA[i] = nist->GetAtomicMassAmu(theZ[i]);
201 }
202 for(G4int i=1; i<93; ++i) {
203 APower[i] = g4pow->powA(nist->GetAtomicMassAmu(i),aPower);
204 }
205 G4int idx = 1;
206 for(G4int i=3; i<93; ++i) {
207 if(theZ[idx] == i) {
208 idxZ[i] = -idx;
209 ++idx;
210 } else {
211 idxZ[i] = idx;
212 }
213 }
214
215 piPlusElastic = new G4PhysicsTable();
216 piPlusInelastic = new G4PhysicsTable();
217 piMinusElastic = new G4PhysicsTable();
218 piMinusInelastic = new G4PhysicsTable();
219
220 LoadData();
221 //G4cout << "### Initialisation done " << G4endl;
222}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
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 590 of file G4UPiNuclearCrossSection.cc.

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

◆ DumpPhysicsTable()

void G4UPiNuclearCrossSection::DumpPhysicsTable ( const G4ParticleDefinition p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 154 of file G4UPiNuclearCrossSection.cc.

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

◆ GetElasticCrossSection()

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

Definition at line 106 of file G4UPiNuclearCrossSection.hh.

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

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

◆ GetInelasticCrossSection()

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

Definition at line 115 of file G4UPiNuclearCrossSection.hh.

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

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 99 of file G4UPiNuclearCrossSection.cc.

101{
102 return (1 < Z);
103}

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