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

#include <G4PSTARStopping.hh>

Public Member Functions

 G4PSTARStopping ()
 
 ~G4PSTARStopping ()
 
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 62 of file G4PSTARStopping.hh.

Constructor & Destructor Documentation

◆ G4PSTARStopping()

G4PSTARStopping::G4PSTARStopping ( )
explicit

Definition at line 55 of file G4PSTARStopping.cc.

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

◆ ~G4PSTARStopping()

G4PSTARStopping::~G4PSTARStopping ( )

Definition at line 63 of file G4PSTARStopping.cc.

64{
65 if(0 < nvectors) {
66 for(G4int i=0; i<nvectors; ++i) { delete sdata[i]; }
67 }
68}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ GetElectronicDEDX() [1/2]

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

Definition at line 141 of file G4PSTARStopping.hh.

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

◆ GetElectronicDEDX() [2/2]

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

Definition at line 129 of file G4PSTARStopping.hh.

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

Referenced by GetElectronicDEDX().

◆ GetIndex() [1/2]

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

Definition at line 100 of file G4PSTARStopping.hh.

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

Referenced by GetElectronicDEDX().

◆ GetIndex() [2/2]

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

Definition at line 114 of file G4PSTARStopping.hh.

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

◆ Initialise()

void G4PSTARStopping::Initialise ( )

Definition at line 82 of file G4PSTARStopping.cc.

83{
84 // this method may be called several times during initialisation
86 if(nmat == nvectors) { return; }
87
88 // loop via material list to add extra data
89 G4int j;
90 for(G4int i=0; i<nmat; ++i) {
91 const G4Material* mat = (*(G4Material::GetMaterialTable()))[i];
92
93 G4bool isThere = false;
94 for(j=0; j<nvectors; ++j) {
95 if(mat == materials[j]) {
96 isThere = true;
97 break;
98 }
99 }
100 if(!isThere) {
101 // check list of NIST materials
102 G4String mname = mat->GetName();
103 for(j=0; j<74; ++j) {
104 if(mname == nameNIST[j]) {
105 FindData(j, mat);
106 isThere = true;
107 break;
108 }
109 }
110 if(!isThere) {
111 G4String form = mat->GetChemicalFormula();
112 for(j=0; j<numberOfMolecula; ++j) {
113 if(form == molecularName[j]) {
114 FindData(molecularIndex[j], mat);
115 break;
116 }
117 }
118 }
119 }
120 }
121}
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 G4PSTARStopping(), and G4BraggModel::Initialise().


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