Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 28 // Created by Z. Francis 29 30 #include "G4DNAMeltonAttachmentModel.hh" 31 #include "G4SystemOfUnits.hh" 32 #include "G4DNAChemistryManager.hh" 33 #include "G4DNAMolecularMaterial.hh" 34 35 //....oooOO0OOooo........oooOO0OOooo........oo 36 37 using namespace std; 38 39 //#define MELTON_VERBOSE // prevent checking c 40 41 //....oooOO0OOooo........oooOO0OOooo........oo 42 43 G4DNAMeltonAttachmentModel::G4DNAMeltonAttachm 44 45 G4VEmModel(nam) 46 { 47 fpWaterDensity = nullptr; 48 49 SetLowEnergyLimit(4.*eV); 50 SetHighEnergyLimit(13.*eV); 51 52 verboseLevel = 0; 53 // Verbosity scale: 54 // 0 = nothing 55 // 1 = warning for energy non-conservation 56 // 2 = details of energy budget 57 // 3 = calculation of cross sections, file o 58 // 4 = entering in methods 59 60 #ifdef MELTON_VERBOSE 61 if (verboseLevel > 0) 62 { 63 G4cout << "Melton Attachment model is cons 64 << G4endl 65 << "Energy range: " 66 << LowEnergyLimit() / eV << " eV - 67 << HighEnergyLimit() / eV << " eV" 68 << G4endl; 69 } 70 #endif 71 72 fParticleChangeForGamma = nullptr; 73 fDissociationFlag = true; 74 fData = nullptr; 75 76 // Selection of stationary mode 77 78 statCode = false; 79 } 80 81 //....oooOO0OOooo........oooOO0OOooo........oo 82 83 G4DNAMeltonAttachmentModel::~G4DNAMeltonAttach 84 { 85 delete fData; 86 } 87 88 //....oooOO0OOooo........oooOO0OOooo........oo 89 90 void G4DNAMeltonAttachmentModel::Initialise(co 91 co 92 { 93 #ifdef MELTON_VERBOSE 94 if (verboseLevel > 3) 95 G4cout 96 << "Calling G4DNAMeltonAttachmentModel:: 97 #endif 98 99 // Only electron 100 101 if(particle->GetParticleName() != "e-") 102 { 103 G4Exception("G4DNAMeltonAttachmentModel::I 104 "em0002", 105 FatalException, 106 "Model not applicable to parti 107 } 108 109 // Energy limits 110 111 if (LowEnergyLimit() < 4.*eV) 112 { 113 G4ExceptionDescription errMsg; 114 errMsg << "G4DNAMeltonAttachmentModel: low 115 LowEnergyLimit()/eV << " eV to " << 4. << 116 117 G4Exception("G4DNAMeltonAttachmentModel::I 118 "Melton_LowerEBoundary", 119 JustWarning, 120 errMsg); 121 122 SetLowEnergyLimit(4*eV); 123 } 124 125 if (HighEnergyLimit() > 13.*eV) 126 { 127 G4ExceptionDescription errMsg; 128 errMsg << "G4DNAMeltonAttachmentModel: hig 129 HighEnergyLimit()/eV << " eV to " << 13. < 130 131 G4Exception("G4DNAMeltonAttachmentModel::I 132 "Melton_HigherEBoundary", 133 JustWarning, 134 errMsg); 135 136 SetHighEnergyLimit(13.*eV); 137 } 138 139 // Reading of data files 140 141 G4double scaleFactor = 1e-18*cm2; 142 143 // For total cross section 144 G4String fileElectron("dna/sigma_attachment_ 145 146 fData = new G4DNACrossSectionDataSet(new G4L 147 eV, sc 148 fData->LoadData(fileElectron); 149 150 151 #ifdef MELTON_VERBOSE 152 if( verboseLevel >0) 153 { 154 if (verboseLevel > 2) 155 { 156 G4cout << "Loaded cross section data for 157 } 158 159 G4cout << "Melton Attachment model is init 160 << "Energy range: " 161 << LowEnergyLimit() / eV << " eV - " 162 << HighEnergyLimit() / eV << " eV" 163 << G4endl; 164 } 165 #endif 166 167 // Initialize water density pointer 168 fpWaterDensity = G4DNAMolecularMaterial::Ins 169 GetNumMolPerVolTableFor(G4Material::GetM 170 171 if (isInitialised) return; 172 173 fParticleChangeForGamma = GetParticleChangeF 174 isInitialised = true; 175 } 176 177 //....oooOO0OOooo........oooOO0OOooo........oo 178 179 G4double 180 G4DNAMeltonAttachmentModel::CrossSectionPerVol 181 182 183 184 185 { 186 #ifdef MELTON_VERBOSE 187 if (verboseLevel > 3) 188 G4cout 189 << "Calling CrossSectionPerVolume() of G 190 << G4endl; 191 #endif 192 193 // Calculate total cross section for model 194 195 G4double sigma = 0.; 196 197 G4double waterDensity = (*fpWaterDensity)[ma 198 199 if (ekin >= LowEnergyLimit() && ekin <= High 200 sigma = fData->FindValue(ekin); 201 202 #ifdef MELTON_VERBOSE 203 if (verboseLevel > 2) 204 { 205 G4cout << "_______________________________ 206 G4cout << "=== G4DNAMeltonAttachmentModel 207 G4cout << "--- Kinetic energy(eV)=" << eki 208 << " particle : " << particleDefini 209 << G4endl; 210 G4cout << "--- Cross section per water mol 211 << sigma/cm/cm << G4endl; 212 G4cout << "--- Cross section per water mol 213 << sigma*waterDensity/(1./cm) << G4 214 G4cout << "--- G4DNAMeltonAttachmentModel 215 } 216 #endif 217 218 return sigma*waterDensity; 219 } 220 221 //....oooOO0OOooo........oooOO0OOooo........oo 222 223 void 224 G4DNAMeltonAttachmentModel:: 225 SampleSecondaries(std::vector<G4DynamicParticl 226 const G4MaterialCutsCouple* 227 const G4DynamicParticle* aDy 228 G4double, 229 G4double) 230 { 231 232 #ifdef MELTON_VERBOSE 233 if (verboseLevel > 3) 234 G4cout 235 << "Calling SampleSecondaries() of G4DNAMe 236 #endif 237 238 // Electron is killed 239 240 G4double electronEnergy0 = aDynamicElectron- 241 242 if (!statCode) 243 { 244 fParticleChangeForGamma->SetProposedKine 245 fParticleChangeForGamma->ProposeTrackSta 246 fParticleChangeForGamma->ProposeLocalEne 247 } 248 249 else 250 { 251 fParticleChangeForGamma->SetProposedKine 252 fParticleChangeForGamma->ProposeLocalEne 253 } 254 255 if(fDissociationFlag) 256 { 257 G4DNAChemistryManager::Instance()-> 258 CreateWaterMolecule(eDissociativeAttachm 259 -1, 260 fParticleChangeForGa 261 } 262 return; 263 } 264