File indexing completed on 2025-02-23 09:22:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "DamageModel.hh"
0031
0032
0033
0034 DamageModel::DamageModel()
0035 {
0036 fpDamageMessenger = new DamageModelMessenger(this);
0037 }
0038
0039
0040
0041 G4bool DamageModel::IsDirectStrandBreak(const G4double& d) const
0042 {
0043 G4bool bool_val = false;
0044 if (d < fDirectDmgLower) {
0045 bool_val = false;
0046 }
0047 else if (d >= fDirectDmgUpper) {
0048 bool_val = true;
0049 }
0050 else {
0051 bool_val = (G4UniformRand() < ((d - fDirectDmgLower) / (fDirectDmgUpper - fDirectDmgLower)));
0052 }
0053 return bool_val;
0054 }
0055
0056
0057
0058 G4bool DamageModel::IsIndirectBaseDamage(const G4MolecularConfiguration* mol) const
0059 {
0060 G4bool bool_val = false;
0061 if (mol->GetDefinition() == fOH) {
0062 bool_val = (G4UniformRand() < fBaseOH);
0063 }
0064 else if (mol->GetDefinition() == fH) {
0065 bool_val = (G4UniformRand() < fBaseH);
0066 }
0067 else if (mol->GetDefinition() == fe_aq) {
0068 bool_val = (G4UniformRand() < fBaseEaq);
0069 }
0070 else {
0071 bool_val = false;
0072 }
0073 return bool_val;
0074 }
0075
0076
0077
0078 G4bool DamageModel::IsIndirectStrandDamage(const G4MolecularConfiguration* mol) const
0079 {
0080 G4bool bool_val = false;
0081 if (mol->GetDefinition() == fOH) {
0082 bool_val = (G4UniformRand() < fStrandOH);
0083 }
0084 else if (mol->GetDefinition() == G4Hydrogen::Definition()) {
0085 bool_val = (G4UniformRand() < fStrandH);
0086 }
0087 else if (mol->GetDefinition() == G4Electron_aq::Definition()) {
0088 bool_val = (G4UniformRand() < fStrandEaq);
0089 }
0090 else {
0091 bool_val = false;
0092 }
0093 return bool_val;
0094 }
0095
0096
0097
0098 G4bool DamageModel::IsInducedStrandBreak(const G4MolecularConfiguration* mol) const
0099 {
0100 G4bool bool_val = false;
0101 if (mol->GetDefinition() == fOH) {
0102 bool_val = (G4UniformRand() < fInductionOH);
0103 }
0104 else if (mol->GetDefinition() == G4Hydrogen::Definition()) {
0105 bool_val = (G4UniformRand() < fInductionH);
0106 }
0107 else if (mol->GetDefinition() == G4Electron_aq::Definition()) {
0108 bool_val = (G4UniformRand() < fInductionEaq);
0109 }
0110 else {
0111 bool_val = false;
0112 }
0113 return bool_val;
0114 }
0115
0116
0117
0118 void DamageModel::CheckValidProbability(const G4String& str, G4double p)
0119 {
0120 if ((p < 0) || (p > 1)) {
0121 G4ExceptionDescription errmsg;
0122 errmsg << "Invalid probability for " << str;
0123 G4Exception("DamageModel", "ERR_INVALID_PROB", FatalException, errmsg);
0124 }
0125 }