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

#include <G4ASTARStopping.hh>

Public Member Functions

 G4ASTARStopping ()
 
 ~G4ASTARStopping ()
 
void Initialise ()
 
G4int GetIndex (const G4Material *) const
 
G4int GetIndex (const G4String &) const
 
G4double GetElectronicDEDX (G4int idx, G4double energy) const
 
G4double GetElectronicDEDX (const G4Material *, G4double energy) const
 

Detailed Description

Definition at line 61 of file G4ASTARStopping.hh.

Constructor & Destructor Documentation

◆ G4ASTARStopping()

G4ASTARStopping::G4ASTARStopping ( )
explicit

Definition at line 54 of file G4ASTARStopping.cc.

54 : nvectors(0), emin(CLHEP::keV)
55{
56 // 1st initialisation
57 Initialise();
58}

◆ ~G4ASTARStopping()

G4ASTARStopping::~G4ASTARStopping ( )

Definition at line 62 of file G4ASTARStopping.cc.

63{
64 if(0 < nvectors) {
65 for(size_t i=0; i<nvectors; ++i) { delete sdata[i]; }
66 }
67}

Member Function Documentation

◆ GetElectronicDEDX() [1/2]

G4double G4ASTARStopping::GetElectronicDEDX ( const G4Material mat,
G4double  energy 
) const
inline

Definition at line 140 of file G4ASTARStopping.hh.

141{
142 return GetElectronicDEDX(GetIndex(mat), energy);
143}
G4int GetIndex(const G4Material *) const
G4double GetElectronicDEDX(G4int idx, G4double energy) const

◆ GetElectronicDEDX() [2/2]

G4double G4ASTARStopping::GetElectronicDEDX ( G4int  idx,
G4double  energy 
) const
inline

Definition at line 128 of file G4ASTARStopping.hh.

129{
130 G4double res = 0.0;
131 if (idx<0 || idx>= G4int(nvectors)) { PrintWarning(idx); }
132 if(energy < emin) { res = (*(sdata[idx]))[0]*std::sqrt(energy/emin); }
133 else { res = sdata[idx]->Value(energy); }
134 return res;
135}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85

Referenced by GetElectronicDEDX().

◆ GetIndex() [1/2]

G4int G4ASTARStopping::GetIndex ( const G4Material mat) const
inline

Definition at line 99 of file G4ASTARStopping.hh.

100{
101 G4int idx = -1;
102 for (size_t i=0; i<nvectors; ++i){
103 if (mat == materials[i]){
104 idx = i;
105 break;
106 }
107 }
108 return idx;
109}

Referenced by GetElectronicDEDX().

◆ GetIndex() [2/2]

G4int G4ASTARStopping::GetIndex ( const G4String nam) const
inline

Definition at line 113 of file G4ASTARStopping.hh.

114{
115 G4int idx = -1;
116 for (size_t i=0; i<nvectors; ++i){
117 if (nam == materials[i]->GetName()){
118 idx = i;
119 break;
120 }
121 }
122 return idx;
123}

◆ Initialise()

void G4ASTARStopping::Initialise ( )

Definition at line 81 of file G4ASTARStopping.cc.

82{
83 // this method may be called several times during initialisation
85 if(nmat == (G4int)nvectors) { return; }
86
87 // loop via material list to add extra data
88 G4int j;
89 for(G4int i=0; i<nmat; ++i) {
90 const G4Material* mat = (*(G4Material::GetMaterialTable()))[i];
91
92 G4bool isThere = false;
93 for(j=0; j<(G4int)nvectors; ++j) {
94 if(mat == materials[j]) {
95 isThere = true;
96 break;
97 }
98 }
99 if(!isThere) {
100 // check list of NIST materials
101 G4String mname = mat->GetName();
102 for(j=0; j<74; ++j) {
103 if(mname == nameNIST[j]) {
104 FindData(j, mat);
105 isThere = true;
106 break;
107 }
108 }
109 if(!isThere) {
110 G4String form = mat->GetChemicalFormula();
111 for(j=0; j<numberOfMolecula; ++j) {
112 if(form == molecularName[j]) {
113 FindData(molecularIndex[j], mat);
114 break;
115 }
116 }
117 }
118 }
119 }
120}
bool G4bool
Definition: G4Types.hh:86
const G4String & GetChemicalFormula() const
Definition: G4Material.hh:176
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:644
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:637
const G4String & GetName() const
Definition: G4Material.hh:175

Referenced by G4ASTARStopping(), and G4BraggIonModel::Initialise().


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