#include <G4PSTARStopping.hh>
Public Member Functions | |
G4PSTARStopping () | |
~G4PSTARStopping () | |
G4int | GetIndex (const G4Material *) |
G4double | GetElectronicDEDX (G4int idx, G4double energy) |
G4double | GetElectronicDEDX (const G4Material *, G4double energy) |
Definition at line 62 of file G4PSTARStopping.hh.
G4PSTARStopping::G4PSTARStopping | ( | ) |
Definition at line 56 of file G4PSTARStopping.cc.
00057 { 00058 currentMaterial = 0; 00059 matIndex = -1; 00060 00061 name.resize(74,""); 00062 sdata.resize(74,0); 00063 00064 Initialise(); 00065 }
G4PSTARStopping::~G4PSTARStopping | ( | ) |
G4double G4PSTARStopping::GetElectronicDEDX | ( | const G4Material * | , | |
G4double | energy | |||
) | [inline] |
Definition at line 92 of file G4PSTARStopping.hh.
References GetElectronicDEDX(), and GetIndex().
00094 { 00095 return GetElectronicDEDX(GetIndex(mat), energy); 00096 }
Definition at line 92 of file G4PSTARStopping.cc.
References G4cout, and G4endl.
Referenced by GetElectronicDEDX().
00093 { 00094 G4double res = 0.0; 00095 if (i<0 || i>73){ 00096 G4cout << "### G4PSTARStopping WARNING: index " 00097 << i << " is out of range!" << G4endl; 00098 return res; 00099 } 00100 if(energy < emin) { res = (*(sdata[i]))[0]*std::sqrt(energy/emin); } 00101 else { res = sdata[i]->Value(energy); } 00102 return res; 00103 }
G4int G4PSTARStopping::GetIndex | ( | const G4Material * | ) |
Definition at line 76 of file G4PSTARStopping.cc.
References G4Material::GetName().
Referenced by GetElectronicDEDX().
00077 { 00078 if (mat == currentMaterial) { return matIndex; } 00079 G4String matName = mat->GetName(); 00080 for (G4int i=0; i<74; ++i){ 00081 if (matName == name[i]){ 00082 matIndex = i; 00083 currentMaterial = mat; 00084 return i; 00085 } 00086 } 00087 return -1; 00088 }