#include <G4EmSaturation.hh>
Public Member Functions | |
G4EmSaturation () | |
virtual | ~G4EmSaturation () |
G4double | VisibleEnergyDeposition (const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double length, G4double edepTotal, G4double edepNIEL=0.0) |
G4double | VisibleEnergyDeposition (const G4Step *) |
G4double | FindG4BirksCoefficient (const G4Material *) |
void | SetVerbose (G4int) |
void | DumpBirksCoefficients () |
void | DumpG4BirksCoefficients () |
Definition at line 69 of file G4EmSaturation.hh.
G4EmSaturation::G4EmSaturation | ( | ) |
Definition at line 58 of file G4EmSaturation.cc.
References G4NistManager::Instance().
00059 { 00060 verbose = 1; 00061 manager = 0; 00062 00063 curMaterial = 0; 00064 curBirks = 0.0; 00065 curRatio = 1.0; 00066 curChargeSq = 1.0; 00067 nMaterials = 0; 00068 00069 electron = 0; 00070 proton = 0; 00071 nist = G4NistManager::Instance(); 00072 00073 Initialise(); 00074 }
G4EmSaturation::~G4EmSaturation | ( | ) | [virtual] |
void G4EmSaturation::DumpBirksCoefficients | ( | ) |
Definition at line 233 of file G4EmSaturation.cc.
References G4cout, and G4endl.
00234 { 00235 if(nMaterials > 0) { 00236 G4cout << "### Birks coeffitients used in run time" << G4endl; 00237 for(G4int i=0; i<nMaterials; ++i) { 00238 G4double br = matPointers[i]->GetIonisation()->GetBirksConstant(); 00239 G4cout << " " << matNames[i] << " " 00240 << br*MeV/mm << " mm/MeV" << " " 00241 << br*matPointers[i]->GetDensity()*MeV*cm2/g 00242 << " g/cm^2/MeV" 00243 << G4endl; 00244 } 00245 } 00246 }
void G4EmSaturation::DumpG4BirksCoefficients | ( | ) |
Definition at line 250 of file G4EmSaturation.cc.
References G4cout, and G4endl.
00251 { 00252 if(nG4Birks > 0) { 00253 G4cout << "### Birks coeffitients for Geant4 materials" << G4endl; 00254 for(G4int i=0; i<nG4Birks; ++i) { 00255 G4cout << " " << g4MatNames[i] << " " 00256 << g4MatData[i]*MeV/mm << " mm/MeV" << G4endl; 00257 } 00258 } 00259 }
G4double G4EmSaturation::FindG4BirksCoefficient | ( | const G4Material * | ) |
Definition at line 136 of file G4EmSaturation.cc.
References G4cout, G4endl, and G4Material::GetName().
00137 { 00138 G4String name = mat->GetName(); 00139 // is this material in the vector? 00140 00141 for(G4int j=0; j<nG4Birks; ++j) { 00142 if(name == g4MatNames[j]) { 00143 if(verbose > 0) 00144 G4cout << "### G4EmSaturation::FindG4BirksCoefficient for " 00145 << name << " is " << g4MatData[j]*MeV/mm << " mm/MeV " 00146 << G4endl; 00147 return g4MatData[j]; 00148 } 00149 } 00150 return FindBirksCoefficient(mat); 00151 }
void G4EmSaturation::SetVerbose | ( | G4int | ) | [inline] |
Definition at line 137 of file G4EmSaturation.hh.
References G4Track::GetMaterialCutsCouple(), G4Step::GetNonIonizingEnergyDeposit(), G4Track::GetParticleDefinition(), G4Step::GetStepLength(), G4Step::GetTotalEnergyDeposit(), G4Step::GetTrack(), and VisibleEnergyDeposition().
00139 { 00140 G4Track* track = step->GetTrack(); 00141 return VisibleEnergyDeposition(track->GetParticleDefinition(), 00142 track->GetMaterialCutsCouple(), 00143 step->GetStepLength(), 00144 step->GetTotalEnergyDeposit(), 00145 step->GetNonIonizingEnergyDeposit()); 00146 }
G4double G4EmSaturation::VisibleEnergyDeposition | ( | const G4ParticleDefinition * | , | |
const G4MaterialCutsCouple * | , | |||
G4double | length, | |||
G4double | edepTotal, | |||
G4double | edepNIEL = 0.0 | |||
) |
Definition at line 83 of file G4EmSaturation.cc.
References G4MaterialCutsCouple::GetMaterial(), G4ParticleDefinition::GetPDGEncoding(), G4LossTableManager::GetRange(), and G4Proton::Proton().
Referenced by G4Scintillation::PostStepDoIt(), and VisibleEnergyDeposition().
00089 { 00090 if(edep <= 0.0) { return 0.0; } 00091 00092 G4double evis = edep; 00093 G4double bfactor = FindBirksCoefficient(couple->GetMaterial()); 00094 00095 if(bfactor > 0.0) { 00096 00097 G4int pdgCode = p->GetPDGEncoding(); 00098 // atomic relaxations for gamma incident 00099 if(22 == pdgCode) { 00100 evis /= (1.0 + bfactor*edep/manager->GetRange(electron,edep,couple)); 00101 00102 // energy loss 00103 } else { 00104 00105 // protections 00106 G4double nloss = niel; 00107 if(nloss < 0.0) nloss = 0.0; 00108 G4double eloss = edep - nloss; 00109 00110 // neutrons 00111 if(2112 == pdgCode || eloss < 0.0 || length <= 0.0) { 00112 nloss = edep; 00113 eloss = 0.0; 00114 } 00115 00116 // continues energy loss 00117 if(eloss > 0.0) { eloss /= (1.0 + bfactor*eloss/length); } 00118 00119 // non-ionizing energy loss 00120 if(nloss > 0.0) { 00121 if(!proton) { proton = G4Proton::Proton(); } 00122 G4double escaled = nloss*curRatio; 00123 G4double range = manager->GetRange(proton,escaled,couple)/curChargeSq; 00124 nloss /= (1.0 + bfactor*nloss/range); 00125 } 00126 00127 evis = eloss + nloss; 00128 } 00129 } 00130 00131 return evis; 00132 }