Geant4 9.6.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 ()
 
G4int GetIndex (const G4Material *)
 
G4double GetElectronicDEDX (G4int idx, G4double energy)
 
G4double GetElectronicDEDX (const G4Material *, G4double energy)
 

Detailed Description

Definition at line 62 of file G4PSTARStopping.hh.

Constructor & Destructor Documentation

◆ G4PSTARStopping()

G4PSTARStopping::G4PSTARStopping ( )

Definition at line 56 of file G4PSTARStopping.cc.

57{
58 currentMaterial = 0;
59 matIndex = -1;
60
61 name.resize(74,"");
62 sdata.resize(74,0);
63
64 Initialise();
65}

◆ ~G4PSTARStopping()

G4PSTARStopping::~G4PSTARStopping ( )

Definition at line 69 of file G4PSTARStopping.cc.

70{
71 for(size_t i=0; i<74; ++i) { delete sdata[i]; }
72}

Member Function Documentation

◆ GetElectronicDEDX() [1/2]

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

Definition at line 92 of file G4PSTARStopping.hh.

94{
95 return GetElectronicDEDX(GetIndex(mat), energy);
96}
G4int GetIndex(const G4Material *)
G4double GetElectronicDEDX(G4int idx, G4double energy)

◆ GetElectronicDEDX() [2/2]

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

Definition at line 92 of file G4PSTARStopping.cc.

93{
94 G4double res = 0.0;
95 if (i<0 || i>73){
96 G4cout << "### G4PSTARStopping WARNING: index "
97 << i << " is out of range!" << G4endl;
98 return res;
99 }
100 if(energy < emin) { res = (*(sdata[i]))[0]*std::sqrt(energy/emin); }
101 else { res = sdata[i]->Value(energy); }
102 return res;
103}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by GetElectronicDEDX().

◆ GetIndex()

G4int G4PSTARStopping::GetIndex ( const G4Material mat)

Definition at line 76 of file G4PSTARStopping.cc.

77{
78 if (mat == currentMaterial) { return matIndex; }
79 G4String matName = mat->GetName();
80 for (G4int i=0; i<74; ++i){
81 if (matName == name[i]){
82 matIndex = i;
83 currentMaterial = mat;
84 return i;
85 }
86 }
87 return -1;
88}
int G4int
Definition: G4Types.hh:66
const G4String & GetName() const
Definition: G4Material.hh:177

Referenced by GetElectronicDEDX().


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