Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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 ( )

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 }
const XML_Char * name
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

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

Definition at line 92 of file G4PSTARStopping.cc.

References G4cout, and G4endl.

Referenced by GetElectronicDEDX().

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 precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double G4PSTARStopping::GetElectronicDEDX ( const G4Material mat,
G4double  energy 
)
inline

Definition at line 93 of file G4PSTARStopping.hh.

References GetElectronicDEDX(), and GetIndex().

95 {
96  return GetElectronicDEDX(GetIndex(mat), energy);
97 }
G4int GetIndex(const G4Material *)
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
G4double GetElectronicDEDX(G4int idx, G4double energy)
G4int G4PSTARStopping::GetIndex ( const G4Material mat)

Definition at line 76 of file G4PSTARStopping.cc.

References G4Material::GetName().

Referenced by GetElectronicDEDX().

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 }
const G4String & GetName() const
Definition: G4Material.hh:176
const XML_Char * name
int G4int
Definition: G4Types.hh:78

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