Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 27 #include "DamageModelMessenger.hh" 28 29 #include "DamageModel.hh" 30 31 #include "G4UIcmdWith3VectorAndUnit.hh" 32 #include "G4UIcmdWithABool.hh" 33 #include "G4UIcmdWithADouble.hh" 34 #include "G4UIcmdWithADoubleAndUnit.hh" 35 #include "G4UIcmdWithAString.hh" 36 #include "G4UIcmdWithAnInteger.hh" 37 #include "G4UIcmdWithoutParameter.hh" 38 #include "G4UIdirectory.hh" 39 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 41 42 DamageModelMessenger::DamageModelMessenger(DamageModel* damageModel) 43 : fpDamageModel(damageModel), 44 fpDamageDirectory(nullptr), 45 fpIntEnergyLower(nullptr), 46 fpIntEnergyUpper(nullptr), 47 fpOHBaseChance(nullptr), 48 fpOHStrandChance(nullptr), 49 fpOHInductionChance(nullptr), 50 fpHBaseChance(nullptr), 51 fpHStrandChance(nullptr), 52 fpHInductionChance(nullptr), 53 fpEaqBaseChance(nullptr), 54 fpEaqStrandChance(nullptr), 55 fpEaqInductionChance(nullptr) 56 { 57 fpDamageDirectory = new G4UIdirectory("/dnadamage/"); 58 fpDamageDirectory->SetGuidance("Damage Model Parameters"); 59 60 fpIntEnergyLower = new G4UIcmdWithADoubleAndUnit("/dnadamage/directDamageLower", this); 61 fpIntEnergyLower->SetGuidance("Minimum Energy required for an SSB"); 62 fpIntEnergyLower->SetGuidance("Chance grows linearly until it reaches the upper value"); 63 fpIntEnergyLower->SetParameterName("Energy", false); 64 65 fpIntEnergyUpper = new G4UIcmdWithADoubleAndUnit("/dnadamage/directDamageUpper", this); 66 fpIntEnergyUpper->SetGuidance("Energy required for an SSB to definitely occur"); 67 fpIntEnergyUpper->SetParameterName("Energy", false); 68 69 // OH 70 71 fpOHBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectOHBaseChance", this); 72 fpOHBaseChance->SetGuidance("Chance [0,1] of a OH damaging a base"); 73 fpOHBaseChance->SetParameterName("Energy", false); 74 75 fpOHStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectOHStrandChance", this); 76 fpOHStrandChance->SetGuidance("Chance [0,1] of a OH damaging sugar-phosphate"); 77 fpOHStrandChance->SetParameterName("Energy", false); 78 79 fpOHInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionOHChance", this); 80 fpOHInductionChance->SetGuidance("Chance [0,1] of a Base + OH -> strand break"); 81 fpOHInductionChance->SetParameterName("Energy", false); 82 83 // H 84 85 fpHBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectHBaseChance", this); 86 fpHBaseChance->SetGuidance("Chance [0,1] of a H damaging a base"); 87 fpHBaseChance->SetParameterName("Energy", false); 88 89 fpHStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectHStrandChance", this); 90 fpHStrandChance->SetGuidance("Chance [0,1] of a H damaging sugar-phosphate"); 91 fpHStrandChance->SetParameterName("Energy", false); 92 93 fpHInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionHChance", this); 94 fpHInductionChance->SetGuidance("Chance [0,1] of a Base + H -> strand break"); 95 fpHInductionChance->SetParameterName("Energy", false); 96 97 // E_aq 98 99 fpEaqBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectEaqBaseChance", this); 100 fpEaqBaseChance->SetGuidance("Chance [0,1] of a Eaq damaging a base"); 101 fpEaqBaseChance->SetParameterName("Energy", false); 102 103 fpEaqStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectEaqStrandChance", this); 104 fpEaqStrandChance->SetGuidance("Chance [0,1] of a Eaq damaging sugar-phosphate"); 105 fpEaqStrandChance->SetParameterName("Energy", false); 106 107 fpEaqInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionEaqChance", this); 108 fpEaqInductionChance->SetGuidance("Chance [0,1] of a Base + Eaq -> strand break"); 109 fpEaqInductionChance->SetParameterName("Energy", false); 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 113 114 DamageModelMessenger::~DamageModelMessenger() 115 { 116 // interaction model 117 delete fpOHStrandChance; 118 delete fpOHInductionChance; 119 delete fpOHBaseChance; 120 delete fpHStrandChance; 121 delete fpHInductionChance; 122 delete fpHBaseChance; 123 delete fpEaqStrandChance; 124 delete fpEaqInductionChance; 125 delete fpEaqBaseChance; 126 delete fpIntEnergyLower; 127 delete fpIntEnergyUpper; 128 delete fpIntRangeDirect; 129 delete fpDamageDirectory; 130 } 131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 133 134 void DamageModelMessenger::SetNewValue(G4UIcommand* command, G4String newValue) 135 { 136 if (command == fpIntEnergyUpper) { 137 fpDamageModel->SetDirectDamageUpper(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(newValue)); 138 } 139 else if (command == fpIntEnergyLower) { 140 fpDamageModel->SetDirectDamageLower(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(newValue)); 141 } 142 else if (command == fpOHBaseChance) { 143 fpDamageModel->SetIndirectOHBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 144 } 145 else if (command == fpOHStrandChance) { 146 fpDamageModel->SetIndirectOHStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 147 } 148 else if (command == fpOHInductionChance) { 149 fpDamageModel->SetInductionOHChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 150 } 151 else if (command == fpHBaseChance) { 152 fpDamageModel->SetIndirectHBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 153 } 154 else if (command == fpHStrandChance) { 155 fpDamageModel->SetIndirectHStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 156 } 157 else if (command == fpHInductionChance) { 158 fpDamageModel->SetInductionHChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 159 } 160 else if (command == fpEaqBaseChance) { 161 fpDamageModel->SetIndirectEaqBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 162 } 163 else if (command == fpEaqStrandChance) { 164 fpDamageModel->SetIndirectEaqStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 165 } 166 else if (command == fpEaqInductionChance) { 167 fpDamageModel->SetInductionEaqChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue)); 168 } 169 } 170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 171