Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // Authors: S. Meylan and C. Villagrasa (IRSN, 25 // Authors: S. Meylan and C. Villagrasa (IRSN, France) 26 // Models come from 26 // Models come from 27 // M. Bug et al, Rad. Phys and Chem. 130, 459- 27 // M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017) 28 28 29 #include "G4DNAPTBIonisationStructure.hh" 29 #include "G4DNAPTBIonisationStructure.hh" 30 #include "G4Material.hh" << 31 #include "G4SystemOfUnits.hh" 30 #include "G4SystemOfUnits.hh" 32 31 33 G4DNAPTBIonisationStructure::G4DNAPTBIonisatio 32 G4DNAPTBIonisationStructure::G4DNAPTBIonisationStructure() 34 { 33 { 35 fpTHF = G4Material::GetMaterial("THF", false << 34 energyConstant["G4_WATER"].push_back(10.79*eV); 36 fpPY = G4Material::GetMaterial("PY", false); << 35 energyConstant["G4_WATER"].push_back(13.39*eV); 37 fpPU = G4Material::GetMaterial("PU", false); << 36 energyConstant["G4_WATER"].push_back(16.05*eV); 38 fpTMP = G4Material::GetMaterial("TMP", false << 37 energyConstant["G4_WATER"].push_back(32.30*eV); 39 fpG4_WATER = G4Material::GetMaterial("G4_WAT << 38 energyConstant["G4_WATER"].push_back(539.0*eV); 40 fpBackbone_THF = G4Material::GetMaterial("ba << 39 41 fpCytosine_PY = G4Material::GetMaterial("cyt << 40 energyConstant["THF"].push_back(9.74*eV); 42 fpThymine_PY = G4Material::GetMaterial("thym << 41 energyConstant["THF"].push_back(12.31*eV); 43 fpAdenine_PU = G4Material::GetMaterial("aden << 42 energyConstant["THF"].push_back(12.99*eV); 44 fpBackbone_TMP = G4Material::GetMaterial("ba << 43 energyConstant["THF"].push_back(13.57*eV); 45 fpGuanine_PU = G4Material::GetMaterial("guan << 44 energyConstant["THF"].push_back(13.60*eV); 46 fpN2 = G4Material::GetMaterial("N2", false); << 45 energyConstant["THF"].push_back(15.11*eV); 47 << 46 energyConstant["THF"].push_back(15.97*eV); 48 // MPietrzak << 47 energyConstant["THF"].push_back(16.28*eV); 49 if (fpN2 != nullptr) { << 48 energyConstant["THF"].push_back(18.19*eV); 50 auto index = fpN2->GetIndex(); << 49 energyConstant["THF"].push_back(18.69*eV); 51 energyConstant[index].push_back(15.58 * eV << 50 energyConstant["THF"].push_back(22.14*eV); 52 energyConstant[index].push_back(17.07 * eV << 51 energyConstant["THF"].push_back(22.25*eV); 53 energyConstant[index].push_back(21.00 * eV << 52 energyConstant["THF"].push_back(27.21*eV); 54 energyConstant[index].push_back(41.72 * eV << 53 energyConstant["THF"].push_back(28.97*eV); 55 energyConstant[index].push_back(409.9*eV); << 54 energyConstant["THF"].push_back(36.97*eV); 56 } << 55 energyConstant["THF"].push_back(305.07*eV); 57 << 56 energyConstant["THF"].push_back(305.08*eV); 58 // MPietrzak << 57 energyConstant["THF"].push_back(306.17*eV); 59 if (fpG4_WATER != nullptr) { << 58 energyConstant["THF"].push_back(306.17*eV); 60 auto index = fpG4_WATER->GetIndex(); << 59 energyConstant["THF"].push_back(557.94*eV); 61 energyConstant[index].push_back(10.79 * eV << 60 62 energyConstant[index].push_back(13.39 * eV << 61 energyConstant["PY"].push_back(9.73*eV); 63 energyConstant[index].push_back(16.05 * eV << 62 energyConstant["PY"].push_back(10.96*eV); 64 energyConstant[index].push_back(32.30 * eV << 63 energyConstant["PY"].push_back(11.54*eV); 65 energyConstant[index].push_back(539.0 * eV << 64 energyConstant["PY"].push_back(12.58*eV); 66 } << 65 energyConstant["PY"].push_back(15.96*eV); 67 if (fpTHF != nullptr) { << 66 energyConstant["PY"].push_back(16.27*eV); 68 auto index = fpTHF->GetIndex(); << 67 energyConstant["PY"].push_back(16.53*eV); 69 energyConstant[index].push_back(9.74 * eV) << 68 energyConstant["PY"].push_back(17.98*eV); 70 energyConstant[index].push_back(12.31 * eV << 69 energyConstant["PY"].push_back(19.37*eV); 71 energyConstant[index].push_back(12.99 * eV << 70 energyConstant["PY"].push_back(20.52*eV); 72 energyConstant[index].push_back(13.57 * eV << 71 energyConstant["PY"].push_back(24.55*eV); 73 energyConstant[index].push_back(13.60 * eV << 72 energyConstant["PY"].push_back(24.64*eV); 74 energyConstant[index].push_back(15.11 * eV << 73 energyConstant["PY"].push_back(29.75*eV); 75 energyConstant[index].push_back(15.97 * eV << 74 energyConstant["PY"].push_back(33.02*eV); 76 energyConstant[index].push_back(16.28 * eV << 75 energyConstant["PY"].push_back(36.57*eV); 77 energyConstant[index].push_back(18.19 * eV << 76 energyConstant["PY"].push_back(305.92*eV); 78 energyConstant[index].push_back(18.69 * eV << 77 energyConstant["PY"].push_back(307.09*eV); 79 energyConstant[index].push_back(22.14 * eV << 78 energyConstant["PY"].push_back(307.09*eV); 80 energyConstant[index].push_back(22.25 * eV << 79 energyConstant["PY"].push_back(307.52*eV); 81 energyConstant[index].push_back(27.21 * eV << 80 energyConstant["PY"].push_back(423.44*eV); 82 energyConstant[index].push_back(28.97 * eV << 81 energyConstant["PY"].push_back(423.44*eV); 83 energyConstant[index].push_back(36.97 * eV << 82 84 energyConstant[index].push_back(305.07 * e << 83 energyConstant["PU"].push_back(9.58*eV); 85 energyConstant[index].push_back(305.08 * e << 84 energyConstant["PU"].push_back(10.57*eV); 86 energyConstant[index].push_back(306.17 * e << 85 energyConstant["PU"].push_back(10.97*eV); 87 energyConstant[index].push_back(306.17 * e << 86 energyConstant["PU"].push_back(12.22*eV); 88 energyConstant[index].push_back(557.94 * e << 87 energyConstant["PU"].push_back(12.92*eV); 89 } << 88 energyConstant["PU"].push_back(13.44*eV); 90 << 89 energyConstant["PU"].push_back(15.05*eV); 91 if (fpPY != nullptr) { << 90 energyConstant["PU"].push_back(16.56*eV); 92 auto index = fpPY->GetIndex(); << 91 energyConstant["PU"].push_back(17.18*eV); 93 energyConstant[index].push_back(9.73 * eV) << 92 energyConstant["PU"].push_back(17.88*eV); 94 energyConstant[index].push_back(10.96 * eV << 93 energyConstant["PU"].push_back(17.90*eV); 95 energyConstant[index].push_back(11.54 * eV << 94 energyConstant["PU"].push_back(19.11*eV); 96 energyConstant[index].push_back(12.58 * eV << 95 energyConstant["PU"].push_back(20.09*eV); 97 energyConstant[index].push_back(15.96 * eV << 96 energyConstant["PU"].push_back(21.70*eV); 98 energyConstant[index].push_back(16.27 * eV << 97 energyConstant["PU"].push_back(23.52*eV); 99 energyConstant[index].push_back(16.53 * eV << 98 energyConstant["PU"].push_back(24.35*eV); 100 energyConstant[index].push_back(17.98 * eV << 99 energyConstant["PU"].push_back(25.41*eV); 101 energyConstant[index].push_back(19.37 * eV << 100 energyConstant["PU"].push_back(29.34*eV); 102 energyConstant[index].push_back(20.52 * eV << 101 energyConstant["PU"].push_back(32.44*eV); 103 energyConstant[index].push_back(24.55 * eV << 102 energyConstant["PU"].push_back(33.67*eV); 104 energyConstant[index].push_back(24.64 * eV << 103 energyConstant["PU"].push_back(36.26*eV); 105 energyConstant[index].push_back(29.75 * eV << 104 energyConstant["PU"].push_back(38.22*eV); 106 energyConstant[index].push_back(33.02 * eV << 105 energyConstant["PU"].push_back(306.53*eV); 107 energyConstant[index].push_back(36.57 * eV << 106 energyConstant["PU"].push_back(307.19*eV); 108 energyConstant[index].push_back(305.92 * e << 107 energyConstant["PU"].push_back(307.64*eV); 109 energyConstant[index].push_back(307.09 * e << 108 energyConstant["PU"].push_back(308.14*eV); 110 energyConstant[index].push_back(307.09 * e << 109 energyConstant["PU"].push_back(308.17*eV); 111 energyConstant[index].push_back(307.52 * e << 110 energyConstant["PU"].push_back(423.31*eV); 112 energyConstant[index].push_back(423.44 * e << 111 energyConstant["PU"].push_back(423.43*eV); 113 energyConstant[index].push_back(423.44 * e << 112 energyConstant["PU"].push_back(423.64*eV); 114 } << 113 energyConstant["PU"].push_back(423.98*eV); 115 << 114 116 if (fpPU != nullptr) { << 115 energyConstant["TMP"].push_back(10.81*eV); 117 auto index = fpPU->GetIndex(); << 116 energyConstant["TMP"].push_back(10.81*eV); 118 energyConstant[index].push_back(9.58 * eV) << 117 energyConstant["TMP"].push_back(12.90*eV); 119 energyConstant[index].push_back(10.57 * eV << 118 energyConstant["TMP"].push_back(13.32*eV); 120 energyConstant[index].push_back(10.97 * eV << 119 energyConstant["TMP"].push_back(13.32*eV); 121 energyConstant[index].push_back(12.22 * eV << 120 energyConstant["TMP"].push_back(13.59*eV); 122 energyConstant[index].push_back(12.92 * eV << 121 energyConstant["TMP"].push_back(14.33*eV); 123 energyConstant[index].push_back(13.44 * eV << 122 energyConstant["TMP"].push_back(14.33*eV); 124 energyConstant[index].push_back(15.05 * eV << 123 energyConstant["TMP"].push_back(15.90*eV); 125 energyConstant[index].push_back(16.56 * eV << 124 energyConstant["TMP"].push_back(17.09*eV); 126 energyConstant[index].push_back(17.18 * eV << 125 energyConstant["TMP"].push_back(17.09*eV); 127 energyConstant[index].push_back(17.88 * eV << 126 energyConstant["TMP"].push_back(17.13*eV); 128 energyConstant[index].push_back(17.90 * eV << 127 energyConstant["TMP"].push_back(17.85*eV); 129 energyConstant[index].push_back(19.11 * eV << 128 energyConstant["TMP"].push_back(17.85*eV); 130 energyConstant[index].push_back(20.09 * eV << 129 energyConstant["TMP"].push_back(18.44*eV); 131 energyConstant[index].push_back(21.70 * eV << 130 energyConstant["TMP"].push_back(19.37*eV); 132 energyConstant[index].push_back(23.52 * eV << 131 energyConstant["TMP"].push_back(19.37*eV); 133 energyConstant[index].push_back(24.35 * eV << 132 energyConstant["TMP"].push_back(21.40*eV); 134 energyConstant[index].push_back(25.41 * eV << 133 energyConstant["TMP"].push_back(26.20*eV); 135 energyConstant[index].push_back(29.34 * eV << 134 energyConstant["TMP"].push_back(26.20*eV); 136 energyConstant[index].push_back(32.44 * eV << 135 energyConstant["TMP"].push_back(27.43*eV); 137 energyConstant[index].push_back(33.67 * eV << 136 energyConstant["TMP"].push_back(35.23*eV); 138 energyConstant[index].push_back(36.26 * eV << 137 energyConstant["TMP"].push_back(37.67*eV); 139 energyConstant[index].push_back(38.22 * eV << 138 energyConstant["TMP"].push_back(37.67*eV); 140 energyConstant[index].push_back(306.53 * e << 139 energyConstant["TMP"].push_back(39.64*eV); 141 energyConstant[index].push_back(307.19 * e << 140 energyConstant["TMP"].push_back(152.42*eV); 142 energyConstant[index].push_back(307.64 * e << 141 energyConstant["TMP"].push_back(152.42*eV); 143 energyConstant[index].push_back(308.14 * e << 142 energyConstant["TMP"].push_back(152.44*eV); 144 energyConstant[index].push_back(308.17 * e << 143 energyConstant["TMP"].push_back(209.59*eV); 145 energyConstant[index].push_back(423.31 * e << 144 energyConstant["TMP"].push_back(306.92*eV); 146 energyConstant[index].push_back(423.43 * e << 145 energyConstant["TMP"].push_back(306.92*eV); 147 energyConstant[index].push_back(423.64 * e << 146 energyConstant["TMP"].push_back(306.92*eV); 148 energyConstant[index].push_back(423.98 * e << 147 energyConstant["TMP"].push_back(557.34*eV); 149 } << 148 energyConstant["TMP"].push_back(559.40*eV); 150 << 149 energyConstant["TMP"].push_back(559.40*eV); 151 if (fpTMP != nullptr) { << 150 energyConstant["TMP"].push_back(559.41*eV); 152 auto index = fpTMP->GetIndex(); << 151 energyConstant["TMP"].push_back(2178.05*eV); 153 energyConstant[index].push_back(10.81 * eV << 152 154 energyConstant[index].push_back(10.81 * eV << 153 std::map<G4String, std::vector<G4double> >::iterator it; 155 energyConstant[index].push_back(12.90 * eV << 154 for(it=energyConstant.begin();it!=energyConstant.end();it++) 156 energyConstant[index].push_back(13.32 * eV << 155 { 157 energyConstant[index].push_back(13.32 * eV << 156 nLevels[it->first] = (it->second).size(); 158 energyConstant[index].push_back(13.59 * eV << 157 } 159 energyConstant[index].push_back(14.33 * eV << 160 energyConstant[index].push_back(14.33 * eV << 161 energyConstant[index].push_back(15.90 * eV << 162 energyConstant[index].push_back(17.09 * eV << 163 energyConstant[index].push_back(17.09 * eV << 164 energyConstant[index].push_back(17.13 * eV << 165 energyConstant[index].push_back(17.85 * eV << 166 energyConstant[index].push_back(17.85 * eV << 167 energyConstant[index].push_back(18.44 * eV << 168 energyConstant[index].push_back(19.37 * eV << 169 energyConstant[index].push_back(19.37 * eV << 170 energyConstant[index].push_back(21.40 * eV << 171 energyConstant[index].push_back(26.20 * eV << 172 energyConstant[index].push_back(26.20 * eV << 173 energyConstant[index].push_back(27.43 * eV << 174 energyConstant[index].push_back(35.23 * eV << 175 energyConstant[index].push_back(37.67 * eV << 176 energyConstant[index].push_back(37.67 * eV << 177 energyConstant[index].push_back(39.64 * eV << 178 energyConstant[index].push_back(152.42 * e << 179 energyConstant[index].push_back(152.42 * e << 180 energyConstant[index].push_back(152.44 * e << 181 energyConstant[index].push_back(209.59 * e << 182 energyConstant[index].push_back(306.92 * e << 183 energyConstant[index].push_back(306.92 * e << 184 energyConstant[index].push_back(306.92 * e << 185 energyConstant[index].push_back(557.34 * e << 186 energyConstant[index].push_back(559.40 * e << 187 energyConstant[index].push_back(559.40 * e << 188 energyConstant[index].push_back(559.41 * e << 189 energyConstant[index].push_back(2178.05 * << 190 } << 191 << 192 for (const auto& [index, levels] : energyCon << 193 nLevels[index] = (G4int)levels.size(); << 194 } << 195 } 158 } 196 159 197 G4double G4DNAPTBIonisationStructure::Ionisati << 160 >> 161 G4DNAPTBIonisationStructure::~G4DNAPTBIonisationStructure() >> 162 { } >> 163 >> 164 >> 165 G4double G4DNAPTBIonisationStructure::IonisationEnergy(G4int level, const G4String& materialName) 198 { 166 { 199 size_t matNameModif = ReplaceMaterial(materi << 167 G4String matNameModif = ReplaceMaterial(materialName); 200 168 201 // check if the material exist in the map << 169 // check if the material exist in the map 202 if (energyConstant.find(matNameModif) == ene << 170 if(energyConstant.find(matNameModif)==energyConstant.end()) 203 std::ostringstream oss; << 171 { 204 oss << "Material name was not found in ene << 172 std::ostringstream oss; 205 << materialID; << 173 oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif; 206 G4Exception( << 174 G4Exception("G4DNAPTBIonisationStructure::IonisationEnergy","em0002", 207 "G4DNAPTBIonisationStructure::Ionisation << 175 FatalException, oss.str().c_str()); 208 } << 176 } 209 177 210 G4double ionisation = 0.; << 178 G4double ionisation = 0.; 211 179 212 if (level >= 0 && level < nLevels[matNameMod << 180 if (level >=0 && level < nLevels[matNameModif]) ionisation = energyConstant[matNameModif][level]; 213 181 214 return ionisation; << 182 return ionisation; 215 } 183 } 216 184 217 G4int G4DNAPTBIonisationStructure::NumberOfLev << 185 G4int G4DNAPTBIonisationStructure::NumberOfLevels(const G4String& materialName) 218 { 186 { 219 auto matNameModif = ReplaceMaterial(material << 187 G4String matNameModif = ReplaceMaterial(materialName); 220 188 221 // check if the material exist in the map << 189 // check if the material exist in the map 222 if (nLevels.find(matNameModif) == nLevels.en << 190 if(nLevels.find(matNameModif)==nLevels.end()) 223 std::ostringstream oss; << 191 { 224 oss << "Material name was not found in ene << 192 std::ostringstream oss; 225 << matNameModif; << 193 oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif; 226 G4Exception( << 194 G4Exception("G4DNAPTBIonisationStructure::NumberOfLevels","em0002", 227 "G4DNAPTBIonisationStructure::NumberOfLe << 195 FatalException, oss.str().c_str()); 228 } << 196 } 229 197 230 return nLevels[matNameModif]; << 198 return nLevels[matNameModif]; 231 } 199 } 232 200 233 size_t G4DNAPTBIonisationStructure::ReplaceMat << 201 G4String G4DNAPTBIonisationStructure::ReplaceMaterial(const G4String& materialName) 234 { 202 { 235 if (fpBackbone_THF != nullptr && materialID << 203 G4String materialNameModified (materialName); 236 return fpTHF->GetIndex(); << 204 237 } << 205 if(materialName=="backbone_THF") materialNameModified = "THF"; 238 if (fpBackbone_TMP != nullptr && materialID << 206 else if(materialName=="backbone_TMP") materialNameModified = "TMP"; 239 return fpTMP->GetIndex(); << 207 else if(materialName=="adenine_PU") materialNameModified = "PU"; 240 } << 208 else if(materialName=="guanine_PU") materialNameModified = "PU"; 241 if (fpAdenine_PU != nullptr && materialID == << 209 else if(materialName=="thymine_PY") materialNameModified = "PY"; 242 return fpPU->GetIndex(); << 210 else if(materialName=="cytosine_PY") materialNameModified = "PY"; 243 } << 211 244 if (fpGuanine_PU != nullptr && materialID == << 212 return materialNameModified; 245 return fpPU->GetIndex(); << 246 } << 247 if (fpThymine_PY != nullptr && materialID == << 248 return fpPY->GetIndex(); << 249 } << 250 if (fpCytosine_PY != nullptr && materialID = << 251 return fpPY->GetIndex(); << 252 } << 253 return materialID; << 254 } 213 } 255 214