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 // * 20 // * * 21 // * Parts of this code which have been devel 21 // * Parts of this code which have been developed by QinetiQ Ltd * 22 // * under contract to the European Space Agen 22 // * under contract to the European Space Agency (ESA) are the * 23 // * intellectual property of ESA. Rights to u 23 // * intellectual property of ESA. Rights to use, copy, modify and * 24 // * redistribute this software for general pu 24 // * redistribute this software for general public use are granted * 25 // * in compliance with any licensing, distrib 25 // * in compliance with any licensing, distribution and development * 26 // * policy adopted by the Geant4 Collaboratio 26 // * policy adopted by the Geant4 Collaboration. This code has been * 27 // * written by QinetiQ Ltd for the European S 27 // * written by QinetiQ Ltd for the European Space Agency, under ESA * 28 // * contract 17191/03/NL/LvH (Aurora Programm 28 // * contract 17191/03/NL/LvH (Aurora Programme). * 29 // * 29 // * * 30 // * By using, copying, modifying or distri 30 // * By using, copying, modifying or distributing the software (or * 31 // * any work based on the software) you ag 31 // * any work based on the software) you agree to acknowledge its * 32 // * use in resulting scientific publicati 32 // * use in resulting scientific publications, and indicate your * 33 // * acceptance of all terms of the Geant4 Sof 33 // * acceptance of all terms of the Geant4 Software license. * 34 // ******************************************* 34 // ******************************************************************** 35 // 35 // 36 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 // 37 // 38 // MODULE: G4WilsonAblationModel. 38 // MODULE: G4WilsonAblationModel.cc 39 // 39 // 40 // Version: 1.0 40 // Version: 1.0 41 // Date: 08/12/2009 41 // Date: 08/12/2009 42 // Author: P R Truscott 42 // Author: P R Truscott 43 // Organisation: QinetiQ Ltd, UK 43 // Organisation: QinetiQ Ltd, UK 44 // Customer: ESA/ESTEC, NOORDWIJK 44 // Customer: ESA/ESTEC, NOORDWIJK 45 // Contract: 17191/03/NL/LvH 45 // Contract: 17191/03/NL/LvH 46 // 46 // 47 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 47 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 // 48 // 49 // CHANGE HISTORY 49 // CHANGE HISTORY 50 // -------------- 50 // -------------- 51 // 51 // 52 // 6 October 2003, P R Truscott, QinetiQ Ltd, 52 // 6 October 2003, P R Truscott, QinetiQ Ltd, UK 53 // Created. 53 // Created. 54 // 54 // 55 // 15 March 2004, P R Truscott, QinetiQ Ltd, U 55 // 15 March 2004, P R Truscott, QinetiQ Ltd, UK 56 // Beta release 56 // Beta release 57 // 57 // 58 // 08 December 2009, P R Truscott, QinetiQ Ltd 58 // 08 December 2009, P R Truscott, QinetiQ Ltd, UK 59 // Ver 1.0 59 // Ver 1.0 60 // Updated as a result of changes in the G4Eva 60 // Updated as a result of changes in the G4Evaporation classes. These changes 61 // affect mostly SelectSecondariesByEvaporatio 61 // affect mostly SelectSecondariesByEvaporation, and now you have variables 62 // associated with the evaporation model which 62 // associated with the evaporation model which can be changed: 63 // OPTxs to select the inverse cross-sectio 63 // OPTxs to select the inverse cross-section 64 // OPTxs = 0 => Dostrovski's parameter 64 // OPTxs = 0 => Dostrovski's parameterization 65 // OPTxs = 1 or 2 => Chatterjee's paramater 65 // OPTxs = 1 or 2 => Chatterjee's paramaterization 66 // OPTxs = 3 or 4 => Kalbach's parameteriza 66 // OPTxs = 3 or 4 => Kalbach's parameterization 67 // useSICB => use superimposed Coulo 67 // useSICB => use superimposed Coulomb Barrier for inverse cross 68 // sections 68 // sections 69 // Other problem found with G4Fragment definit 69 // Other problem found with G4Fragment definition using Lorentz vector and 70 // **G4ParticleDefinition**. This does not al 70 // **G4ParticleDefinition**. This does not allow A and Z to be defined for the 71 // fragment for some reason. Now the fragment 71 // fragment for some reason. Now the fragment is defined more explicitly: 72 // G4Fragment *fragment = new G4Fragment(A, 72 // G4Fragment *fragment = new G4Fragment(A, Z, lorentzVector); 73 // to avoid this quirk. Bug found in SelectSe 73 // to avoid this quirk. Bug found in SelectSecondariesByDefault: *type is now 74 // equated to evapType[i] whereas previously i 74 // equated to evapType[i] whereas previously it was equated to fragType[i]. 75 // 75 // 76 // 06 August 2015, A. Ribon, CERN << 77 // Migrated std::exp and std::pow to the faste << 78 // << 79 // 09 June 2017, C. Mancini Terracciano, INFN << 80 // Fixed bug on the initialization of Photon E << 81 // << 82 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 76 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 83 ////////////////////////////////////////////// 77 //////////////////////////////////////////////////////////////////////////////// 84 // 78 // 85 #include <iomanip> 79 #include <iomanip> 86 #include <numeric> 80 #include <numeric> 87 81 88 #include "G4WilsonAblationModel.hh" 82 #include "G4WilsonAblationModel.hh" 89 #include "G4PhysicalConstants.hh" 83 #include "G4PhysicalConstants.hh" 90 #include "G4SystemOfUnits.hh" 84 #include "G4SystemOfUnits.hh" 91 #include "Randomize.hh" 85 #include "Randomize.hh" 92 #include "G4ParticleTable.hh" 86 #include "G4ParticleTable.hh" 93 #include "G4IonTable.hh" 87 #include "G4IonTable.hh" 94 #include "G4Alpha.hh" 88 #include "G4Alpha.hh" 95 #include "G4He3.hh" 89 #include "G4He3.hh" 96 #include "G4Triton.hh" 90 #include "G4Triton.hh" 97 #include "G4Deuteron.hh" 91 #include "G4Deuteron.hh" 98 #include "G4Proton.hh" 92 #include "G4Proton.hh" 99 #include "G4Neutron.hh" 93 #include "G4Neutron.hh" 100 #include "G4AlphaEvaporationChannel.hh" 94 #include "G4AlphaEvaporationChannel.hh" 101 #include "G4He3EvaporationChannel.hh" 95 #include "G4He3EvaporationChannel.hh" 102 #include "G4TritonEvaporationChannel.hh" 96 #include "G4TritonEvaporationChannel.hh" 103 #include "G4DeuteronEvaporationChannel.hh" 97 #include "G4DeuteronEvaporationChannel.hh" 104 #include "G4ProtonEvaporationChannel.hh" 98 #include "G4ProtonEvaporationChannel.hh" 105 #include "G4NeutronEvaporationChannel.hh" 99 #include "G4NeutronEvaporationChannel.hh" 106 #include "G4PhotonEvaporation.hh" << 107 #include "G4LorentzVector.hh" 100 #include "G4LorentzVector.hh" 108 #include "G4VEvaporationChannel.hh" 101 #include "G4VEvaporationChannel.hh" 109 102 110 #include "G4Exp.hh" << 111 #include "G4Pow.hh" << 112 << 113 #include "G4PhysicsModelCatalog.hh" << 114 << 115 ////////////////////////////////////////////// 103 //////////////////////////////////////////////////////////////////////////////// 116 // 104 // 117 G4WilsonAblationModel::G4WilsonAblationModel() 105 G4WilsonAblationModel::G4WilsonAblationModel() 118 { 106 { 119 // 107 // 120 // 108 // 121 // Send message to stdout to advise that the G 109 // Send message to stdout to advise that the G4Abrasion model is being used. 122 // 110 // 123 PrintWelcomeMessage(); 111 PrintWelcomeMessage(); 124 // 112 // 125 // 113 // 126 // Set the default verbose level to 0 - no out 114 // Set the default verbose level to 0 - no output. 127 // 115 // 128 verboseLevel = 0; 116 verboseLevel = 0; 129 // 117 // 130 // 118 // 131 // Set the binding energy per nucleon .... did 119 // Set the binding energy per nucleon .... did I mention that this is a crude 132 // model for nuclear de-excitation? 120 // model for nuclear de-excitation? 133 // 121 // 134 B = 10.0 * MeV; 122 B = 10.0 * MeV; 135 // 123 // 136 // 124 // 137 // It is possuble to switch off secondary part 125 // It is possuble to switch off secondary particle production (other than the 138 // final nuclear fragment). The default is on 126 // final nuclear fragment). The default is on. 139 // 127 // 140 produceSecondaries = true; 128 produceSecondaries = true; 141 // 129 // 142 // 130 // 143 // Now we need to define the decay modes. We' 131 // Now we need to define the decay modes. We're using the G4Evaporation model 144 // to help determine the kinematics of the dec 132 // to help determine the kinematics of the decay. 145 // 133 // 146 nFragTypes = 6; 134 nFragTypes = 6; 147 fragType[0] = G4Alpha::Alpha(); 135 fragType[0] = G4Alpha::Alpha(); 148 fragType[1] = G4He3::He3(); 136 fragType[1] = G4He3::He3(); 149 fragType[2] = G4Triton::Triton(); 137 fragType[2] = G4Triton::Triton(); 150 fragType[3] = G4Deuteron::Deuteron(); 138 fragType[3] = G4Deuteron::Deuteron(); 151 fragType[4] = G4Proton::Proton(); 139 fragType[4] = G4Proton::Proton(); 152 fragType[5] = G4Neutron::Neutron(); 140 fragType[5] = G4Neutron::Neutron(); 153 for(G4int i=0; i<200; ++i) { fSig[i] = 0.0; << 154 // 141 // 155 // 142 // 156 // Set verboseLevel default to no output. 143 // Set verboseLevel default to no output. 157 // 144 // 158 verboseLevel = 0; 145 verboseLevel = 0; 159 theChannelFactory = new G4EvaporationFactory << 146 theChannelFactory = new G4EvaporationFactory(); 160 theChannels = theChannelFactory->GetChannel( 147 theChannels = theChannelFactory->GetChannel(); 161 // 148 // 162 // 149 // 163 // Set defaults for evaporation classes. Thes 150 // Set defaults for evaporation classes. These can be overridden by user 164 // "set" methods. 151 // "set" methods. 165 // 152 // 166 OPTxs = 3; 153 OPTxs = 3; 167 useSICB = false; 154 useSICB = false; 168 fragmentVector = 0; 155 fragmentVector = 0; 169 << 170 secID = G4PhysicsModelCatalog::GetModelID("m << 171 } 156 } 172 ////////////////////////////////////////////// 157 //////////////////////////////////////////////////////////////////////////////// 173 // 158 // 174 G4WilsonAblationModel::~G4WilsonAblationModel( 159 G4WilsonAblationModel::~G4WilsonAblationModel() 175 {} << 160 { 176 << 161 if (theChannels != 0) theChannels = 0; >> 162 if (theChannelFactory != 0) delete theChannelFactory; >> 163 } 177 ////////////////////////////////////////////// 164 //////////////////////////////////////////////////////////////////////////////// 178 // 165 // 179 G4FragmentVector *G4WilsonAblationModel::Break 166 G4FragmentVector *G4WilsonAblationModel::BreakItUp 180 (const G4Fragment &theNucleus) 167 (const G4Fragment &theNucleus) 181 { 168 { 182 // 169 // 183 // 170 // 184 // Initilise the pointer to the G4FragmentVect 171 // Initilise the pointer to the G4FragmentVector used to return the information 185 // about the breakup. 172 // about the breakup. 186 // 173 // 187 fragmentVector = new G4FragmentVector; 174 fragmentVector = new G4FragmentVector; 188 fragmentVector->clear(); 175 fragmentVector->clear(); 189 // 176 // 190 // 177 // 191 // Get the A, Z and excitation of the nucleus. 178 // Get the A, Z and excitation of the nucleus. 192 // 179 // 193 G4int A = theNucleus.GetA_asInt(); 180 G4int A = theNucleus.GetA_asInt(); 194 G4int Z = theNucleus.GetZ_asInt(); 181 G4int Z = theNucleus.GetZ_asInt(); 195 G4double ex = theNucleus.GetExcitationEnergy 182 G4double ex = theNucleus.GetExcitationEnergy(); 196 if (verboseLevel >= 2) 183 if (verboseLevel >= 2) 197 { 184 { 198 G4cout <<"oooooooooooooooooooooooooooooooo 185 G4cout <<"oooooooooooooooooooooooooooooooooooooooo" 199 <<"oooooooooooooooooooooooooooooooo 186 <<"oooooooooooooooooooooooooooooooooooooooo" 200 <<G4endl; 187 <<G4endl; 201 G4cout.precision(6); 188 G4cout.precision(6); 202 G4cout <<"IN G4WilsonAblationModel" <<G4en 189 G4cout <<"IN G4WilsonAblationModel" <<G4endl; 203 G4cout <<"Initial prefragment A=" <<A 190 G4cout <<"Initial prefragment A=" <<A 204 <<", Z=" <<Z 191 <<", Z=" <<Z 205 <<", excitation energy = " <<ex/MeV 192 <<", excitation energy = " <<ex/MeV <<" MeV" 206 <<G4endl; 193 <<G4endl; 207 } 194 } 208 // 195 // 209 // 196 // 210 // Check that there is a nucleus to speak of. 197 // Check that there is a nucleus to speak of. It's possible there isn't one 211 // or its just a proton or neutron. In either 198 // or its just a proton or neutron. In either case, the excitation energy 212 // (from the Lorentz vector) is not used. 199 // (from the Lorentz vector) is not used. 213 // 200 // 214 if (A == 0) 201 if (A == 0) 215 { 202 { 216 if (verboseLevel >= 2) 203 if (verboseLevel >= 2) 217 { 204 { 218 G4cout <<"No nucleus to decay" <<G4endl; 205 G4cout <<"No nucleus to decay" <<G4endl; 219 G4cout <<"oooooooooooooooooooooooooooooo 206 G4cout <<"oooooooooooooooooooooooooooooooooooooooo" 220 <<"oooooooooooooooooooooooooooooo 207 <<"oooooooooooooooooooooooooooooooooooooooo" 221 <<G4endl; 208 <<G4endl; 222 } 209 } 223 return fragmentVector; 210 return fragmentVector; 224 } 211 } 225 else if (A == 1) 212 else if (A == 1) 226 { 213 { 227 G4LorentzVector lorentzVector = theNucleus 214 G4LorentzVector lorentzVector = theNucleus.GetMomentum(); 228 lorentzVector.setE(lorentzVector.e()-ex+10 215 lorentzVector.setE(lorentzVector.e()-ex+10.0*eV); 229 if (Z == 0) 216 if (Z == 0) 230 { 217 { 231 G4Fragment *fragment = new G4Fragment(lo 218 G4Fragment *fragment = new G4Fragment(lorentzVector,G4Neutron::Neutron()); 232 if (fragment != nullptr) { fragment->Set << 233 fragmentVector->push_back(fragment); 219 fragmentVector->push_back(fragment); 234 } 220 } 235 else 221 else 236 { 222 { 237 G4Fragment *fragment = new G4Fragment(lo 223 G4Fragment *fragment = new G4Fragment(lorentzVector,G4Proton::Proton()); 238 if (fragment != nullptr) { fragment->Set << 239 fragmentVector->push_back(fragment); 224 fragmentVector->push_back(fragment); 240 } 225 } 241 if (verboseLevel >= 2) 226 if (verboseLevel >= 2) 242 { 227 { 243 G4cout <<"Final fragment is in fact only 228 G4cout <<"Final fragment is in fact only a nucleon) :" <<G4endl; 244 G4cout <<(*fragmentVector)[0] <<G4endl; 229 G4cout <<(*fragmentVector)[0] <<G4endl; 245 G4cout <<"oooooooooooooooooooooooooooooo 230 G4cout <<"oooooooooooooooooooooooooooooooooooooooo" 246 <<"oooooooooooooooooooooooooooooo 231 <<"oooooooooooooooooooooooooooooooooooooooo" 247 <<G4endl; 232 <<G4endl; 248 } 233 } 249 return fragmentVector; 234 return fragmentVector; 250 } 235 } 251 // 236 // 252 // 237 // 253 // Then the number of nucleons ablated (either 238 // Then the number of nucleons ablated (either as nucleons or light nuclear 254 // fragments) is based on a simple argument fo 239 // fragments) is based on a simple argument for the binding energy per nucleon. 255 // 240 // 256 G4int DAabl = (G4int) (ex / B); 241 G4int DAabl = (G4int) (ex / B); 257 if (DAabl > A) DAabl = A; 242 if (DAabl > A) DAabl = A; 258 // The following lines are no longer accurate 243 // The following lines are no longer accurate given we now treat the final fragment 259 // if (verboseLevel >= 2) 244 // if (verboseLevel >= 2) 260 // G4cout <<"Number of nucleons ejected = " 245 // G4cout <<"Number of nucleons ejected = " <<DAabl <<G4endl; 261 246 262 // 247 // 263 // 248 // 264 // Determine the nuclear fragment from the abl 249 // Determine the nuclear fragment from the ablation process by sampling the 265 // Rudstam equation. 250 // Rudstam equation. 266 // 251 // 267 G4int AF = A - DAabl; 252 G4int AF = A - DAabl; 268 G4int ZF = 0; 253 G4int ZF = 0; 269 << 270 if (AF > 0) 254 if (AF > 0) 271 { 255 { 272 G4Pow* g4calc = G4Pow::GetInstance(); << 273 G4double AFd = (G4double) AF; 256 G4double AFd = (G4double) AF; 274 G4double R = 11.8 / g4calc->powZ(AF, 0.45) << 257 G4double R = 11.8 / std::pow(AFd, 0.45); 275 G4int minZ = std::max(1, Z - DAabl); << 258 G4int minZ = Z - DAabl; >> 259 if (minZ <= 0) minZ = 1; 276 // 260 // 277 // 261 // 278 // Here we define an integral probability dist 262 // Here we define an integral probability distribution based on the Rudstam 279 // equation assuming a constant AF. 263 // equation assuming a constant AF. 280 // 264 // 281 G4int zmax = std::min(199, Z); << 265 G4double sig[100]; 282 G4double sum = 0.0; 266 G4double sum = 0.0; 283 for (ZF=minZ; ZF<=zmax; ++ZF) << 267 for (G4int ii=minZ; ii<= Z; ii++) 284 { 268 { 285 sum += G4Exp(-R*g4calc->powA(std::abs(ZF << 269 sum += std::exp(-R*std::pow(std::abs(ii - 0.486*AFd + 3.8E-04*AFd*AFd),1.5)); 286 fSig[ZF] = sum; << 270 sig[ii] = sum; 287 } 271 } 288 // 272 // 289 // 273 // 290 // Now sample that distribution to determine a 274 // Now sample that distribution to determine a value for ZF. 291 // 275 // 292 sum *= G4UniformRand(); << 276 G4double xi = G4UniformRand(); 293 for (ZF=minZ; ZF<=zmax; ++ZF) { << 277 G4int iz = minZ; 294 if(sum <= fSig[ZF]) { break; } << 278 G4bool found = false; 295 } << 279 while (iz <= Z && !found) >> 280 { >> 281 found = (xi <= sig[iz]/sum); >> 282 if (!found) iz++; >> 283 } >> 284 if (iz > Z) >> 285 ZF = Z; >> 286 else >> 287 ZF = iz; 296 } 288 } 297 G4int DZabl = Z - ZF; 289 G4int DZabl = Z - ZF; 298 // 290 // 299 // 291 // 300 // Now determine the nucleons or nuclei which 292 // Now determine the nucleons or nuclei which have bee ablated. The preference 301 // is for the production of alphas, then other 293 // is for the production of alphas, then other nuclei in order of decreasing 302 // binding energy. The energies assigned to th 294 // binding energy. The energies assigned to the products of the decay are 303 // provisional for the moment (the 10eV is jus 295 // provisional for the moment (the 10eV is just to avoid errors with negative 304 // excitation energies due to rounding). 296 // excitation energies due to rounding). 305 // 297 // 306 G4double totalEpost = 0.0; 298 G4double totalEpost = 0.0; 307 evapType.clear(); 299 evapType.clear(); 308 for (G4int ift=0; ift<nFragTypes; ift++) 300 for (G4int ift=0; ift<nFragTypes; ift++) 309 { 301 { 310 G4ParticleDefinition *type = fragType[ift] 302 G4ParticleDefinition *type = fragType[ift]; 311 G4double n = std::floor((G4double) DAabl 303 G4double n = std::floor((G4double) DAabl / type->GetBaryonNumber() + 1.0E-10); 312 G4double n1 = 1.0E+10; 304 G4double n1 = 1.0E+10; 313 if (fragType[ift]->GetPDGCharge() > 0.0) 305 if (fragType[ift]->GetPDGCharge() > 0.0) 314 n1 = std::floor((G4double) DZabl / type- 306 n1 = std::floor((G4double) DZabl / type->GetPDGCharge() + 1.0E-10); 315 if (n > n1) n = n1; 307 if (n > n1) n = n1; 316 if (n > 0.0) 308 if (n > 0.0) 317 { 309 { 318 G4double mass = type->GetPDGMass(); 310 G4double mass = type->GetPDGMass(); 319 for (G4int j=0; j<(G4int) n; j++) 311 for (G4int j=0; j<(G4int) n; j++) 320 { 312 { 321 totalEpost += mass; 313 totalEpost += mass; 322 evapType.push_back(type); 314 evapType.push_back(type); 323 } 315 } 324 DAabl -= (G4int) (n * type->GetBaryonNum 316 DAabl -= (G4int) (n * type->GetBaryonNumber() + 1.0E-10); 325 DZabl -= (G4int) (n * type->GetPDGCharge 317 DZabl -= (G4int) (n * type->GetPDGCharge() + 1.0E-10); 326 } 318 } 327 } 319 } 328 // 320 // 329 // 321 // 330 // Determine the properties of the final nucle 322 // Determine the properties of the final nuclear fragment. Note that if 331 // the final fragment is predicted to have a n 323 // the final fragment is predicted to have a nucleon number of zero, then 332 // really it's the particle last in the vector 324 // really it's the particle last in the vector evapType which becomes the 333 // final fragment. Therefore delete this from 325 // final fragment. Therefore delete this from the vector if this is the 334 // case. 326 // case. 335 // 327 // 336 G4double massFinalFrag = 0.0; 328 G4double massFinalFrag = 0.0; 337 if (AF > 0) 329 if (AF > 0) 338 massFinalFrag = G4ParticleTable::GetPartic 330 massFinalFrag = G4ParticleTable::GetParticleTable()->GetIonTable()-> 339 GetIonMass(ZF,AF); 331 GetIonMass(ZF,AF); 340 else 332 else 341 { 333 { 342 G4ParticleDefinition *type = evapType[evap 334 G4ParticleDefinition *type = evapType[evapType.size()-1]; 343 AF = type->GetBary 335 AF = type->GetBaryonNumber(); 344 ZF = (G4int) (type 336 ZF = (G4int) (type->GetPDGCharge() + 1.0E-10); 345 evapType.erase(evapType.end()-1); 337 evapType.erase(evapType.end()-1); 346 } 338 } 347 totalEpost += massFinalFrag; 339 totalEpost += massFinalFrag; 348 // 340 // 349 // 341 // 350 // Provide verbose output on the nuclear fragm 342 // Provide verbose output on the nuclear fragment if requested. 351 // 343 // 352 if (verboseLevel >= 2) 344 if (verboseLevel >= 2) 353 { 345 { 354 G4cout <<"Final fragment A=" <<AF 346 G4cout <<"Final fragment A=" <<AF 355 <<", Z=" <<ZF 347 <<", Z=" <<ZF 356 <<G4endl; 348 <<G4endl; 357 for (G4int ift=0; ift<nFragTypes; ift++) 349 for (G4int ift=0; ift<nFragTypes; ift++) 358 { 350 { 359 G4ParticleDefinition *type = fragType[if 351 G4ParticleDefinition *type = fragType[ift]; 360 G4long n = std::count(evapType.cbegin(), << 352 G4int n = std::count(evapType.begin(),evapType.end(),type); 361 if (n > 0) 353 if (n > 0) 362 G4cout <<"Particle type: " <<std::setw 354 G4cout <<"Particle type: " <<std::setw(10) <<type->GetParticleName() 363 <<", number of particles emitte 355 <<", number of particles emitted = " <<n <<G4endl; 364 } 356 } 365 } 357 } 366 // 358 // 367 // Add the total energy from the fragment. No 359 // Add the total energy from the fragment. Note that the fragment is assumed 368 // to be de-excited and does not undergo photo 360 // to be de-excited and does not undergo photo-evaporation .... I did mention 369 // this is a bit of a crude model? 361 // this is a bit of a crude model? 370 // 362 // 371 G4double massPreFrag = theNucleus.GetGr 363 G4double massPreFrag = theNucleus.GetGroundStateMass(); 372 G4double totalEpre = massPreFrag + ex 364 G4double totalEpre = massPreFrag + ex; 373 G4double excess = totalEpre - tota 365 G4double excess = totalEpre - totalEpost; 374 // G4Fragment *resultNucleus(theNucleus); 366 // G4Fragment *resultNucleus(theNucleus); 375 G4Fragment *resultNucleus = new G4Fragment(A 367 G4Fragment *resultNucleus = new G4Fragment(A, Z, theNucleus.GetMomentum()); 376 G4ThreeVector boost(0.0,0.0,0.0); 368 G4ThreeVector boost(0.0,0.0,0.0); 377 std::size_t nEvap = 0; << 369 G4int nEvap = 0; 378 if (produceSecondaries && evapType.size()>0) 370 if (produceSecondaries && evapType.size()>0) 379 { 371 { 380 if (excess > 0.0) 372 if (excess > 0.0) 381 { 373 { 382 SelectSecondariesByEvaporation (resultNu 374 SelectSecondariesByEvaporation (resultNucleus); 383 nEvap = fragmentVector->size(); 375 nEvap = fragmentVector->size(); 384 boost = resultNucleus->GetMomentum().fin 376 boost = resultNucleus->GetMomentum().findBoostToCM(); 385 if (evapType.size() > 0) 377 if (evapType.size() > 0) 386 SelectSecondariesByDefault (boost); 378 SelectSecondariesByDefault (boost); 387 } 379 } 388 else 380 else 389 SelectSecondariesByDefault(G4ThreeVector 381 SelectSecondariesByDefault(G4ThreeVector(0.0,0.0,0.0)); 390 } 382 } 391 383 392 if (AF > 0) 384 if (AF > 0) 393 { 385 { 394 G4double mass = G4ParticleTable::GetPartic 386 G4double mass = G4ParticleTable::GetParticleTable()->GetIonTable()-> 395 GetIonMass(ZF,AF); 387 GetIonMass(ZF,AF); 396 G4double e = mass + 10.0*eV; 388 G4double e = mass + 10.0*eV; 397 G4double p = std::sqrt(e*e-mass*mass); 389 G4double p = std::sqrt(e*e-mass*mass); 398 G4ThreeVector direction(0.0,0.0,1.0); 390 G4ThreeVector direction(0.0,0.0,1.0); 399 G4LorentzVector lorentzVector = G4LorentzV 391 G4LorentzVector lorentzVector = G4LorentzVector(direction*p, e); 400 lorentzVector.boost(-boost); 392 lorentzVector.boost(-boost); 401 G4Fragment* frag = new G4Fragment(AF, ZF, 393 G4Fragment* frag = new G4Fragment(AF, ZF, lorentzVector); 402 if (frag != nullptr) { frag->SetCreatorMod << 403 fragmentVector->push_back(frag); 394 fragmentVector->push_back(frag); 404 } 395 } 405 delete resultNucleus; 396 delete resultNucleus; 406 // 397 // 407 // 398 // 408 // Provide verbose output on the ablation prod 399 // Provide verbose output on the ablation products if requested. 409 // 400 // 410 if (verboseLevel >= 2) 401 if (verboseLevel >= 2) 411 { 402 { 412 if (nEvap > 0) 403 if (nEvap > 0) 413 { 404 { 414 G4cout <<"----------------------" <<G4en 405 G4cout <<"----------------------" <<G4endl; 415 G4cout <<"Evaporated particles :" <<G4en 406 G4cout <<"Evaporated particles :" <<G4endl; 416 G4cout <<"----------------------" <<G4en 407 G4cout <<"----------------------" <<G4endl; 417 } 408 } 418 std::size_t ie = 0; << 409 G4int ie = 0; 419 for (auto iter = fragmentVector->cbegin(); << 410 G4FragmentVector::iterator iter; 420 iter != fragmentVector->cend(); << 411 for (iter = fragmentVector->begin(); iter != fragmentVector->end(); iter++) 421 { 412 { 422 if (ie == nEvap) 413 if (ie == nEvap) 423 { 414 { 424 // G4cout <<*iter <<G4endl; 415 // G4cout <<*iter <<G4endl; 425 G4cout <<"---------------------------- 416 G4cout <<"---------------------------------" <<G4endl; 426 G4cout <<"Particles from default emiss 417 G4cout <<"Particles from default emission :" <<G4endl; 427 G4cout <<"---------------------------- 418 G4cout <<"---------------------------------" <<G4endl; 428 } 419 } 429 G4cout <<*iter <<G4endl; 420 G4cout <<*iter <<G4endl; 430 } 421 } 431 G4cout <<"oooooooooooooooooooooooooooooooo 422 G4cout <<"oooooooooooooooooooooooooooooooooooooooo" 432 <<"oooooooooooooooooooooooooooooooo 423 <<"oooooooooooooooooooooooooooooooooooooooo" 433 <<G4endl; 424 <<G4endl; 434 } 425 } 435 426 436 return fragmentVector; 427 return fragmentVector; 437 } 428 } 438 ////////////////////////////////////////////// 429 //////////////////////////////////////////////////////////////////////////////// 439 // 430 // 440 void G4WilsonAblationModel::SelectSecondariesB 431 void G4WilsonAblationModel::SelectSecondariesByEvaporation 441 (G4Fragment *intermediateNucleus) 432 (G4Fragment *intermediateNucleus) 442 { 433 { 443 G4Fragment theResidualNucleus = *intermediat 434 G4Fragment theResidualNucleus = *intermediateNucleus; 444 G4bool evaporate = true; 435 G4bool evaporate = true; 445 // Loop checking, 05-Aug-2015, Vladimir Ivan << 446 while (evaporate && evapType.size() != 0) 436 while (evaporate && evapType.size() != 0) 447 { 437 { 448 // 438 // 449 // 439 // 450 // Here's the cheaky bit. We're hijacking the 440 // Here's the cheaky bit. We're hijacking the G4Evaporation model, in order to 451 // more accurately sample to kinematics, but t 441 // more accurately sample to kinematics, but the species of the nuclear 452 // fragments will be the ones of our choosing 442 // fragments will be the ones of our choosing as above. 453 // 443 // 454 std::vector <G4VEvaporationChannel*> theC 444 std::vector <G4VEvaporationChannel*> theChannels1; 455 theChannels1.clear(); 445 theChannels1.clear(); 456 std::vector <G4VEvaporationChannel*>::iter 446 std::vector <G4VEvaporationChannel*>::iterator i; 457 VectorOfFragmentTypes::iterator iter; 447 VectorOfFragmentTypes::iterator iter; 458 std::vector <VectorOfFragmentTypes::iterat 448 std::vector <VectorOfFragmentTypes::iterator> iters; 459 iters.clear(); 449 iters.clear(); 460 iter = std::find(evapType.begin(), evapTyp 450 iter = std::find(evapType.begin(), evapType.end(), G4Alpha::Alpha()); 461 if (iter != evapType.end()) 451 if (iter != evapType.end()) 462 { 452 { 463 theChannels1.push_back(new G4AlphaEvapor 453 theChannels1.push_back(new G4AlphaEvaporationChannel); 464 i = theChannels1.end() - 1; 454 i = theChannels1.end() - 1; 465 (*i)->SetOPTxs(OPTxs); 455 (*i)->SetOPTxs(OPTxs); 466 (*i)->UseSICB(useSICB); 456 (*i)->UseSICB(useSICB); 467 // (*i)->Initialize(theResidualNucleus); 457 // (*i)->Initialize(theResidualNucleus); 468 iters.push_back(iter); 458 iters.push_back(iter); 469 } 459 } 470 iter = std::find(evapType.begin(), evapTyp 460 iter = std::find(evapType.begin(), evapType.end(), G4He3::He3()); 471 if (iter != evapType.end()) 461 if (iter != evapType.end()) 472 { 462 { 473 theChannels1.push_back(new G4He3Evaporat 463 theChannels1.push_back(new G4He3EvaporationChannel); 474 i = theChannels1.end() - 1; 464 i = theChannels1.end() - 1; 475 (*i)->SetOPTxs(OPTxs); 465 (*i)->SetOPTxs(OPTxs); 476 (*i)->UseSICB(useSICB); 466 (*i)->UseSICB(useSICB); 477 // (*i)->Initialize(theResidualNucleus); 467 // (*i)->Initialize(theResidualNucleus); 478 iters.push_back(iter); 468 iters.push_back(iter); 479 } 469 } 480 iter = std::find(evapType.begin(), evapTyp 470 iter = std::find(evapType.begin(), evapType.end(), G4Triton::Triton()); 481 if (iter != evapType.end()) 471 if (iter != evapType.end()) 482 { 472 { 483 theChannels1.push_back(new G4TritonEvapo 473 theChannels1.push_back(new G4TritonEvaporationChannel); 484 i = theChannels1.end() - 1; 474 i = theChannels1.end() - 1; 485 (*i)->SetOPTxs(OPTxs); 475 (*i)->SetOPTxs(OPTxs); 486 (*i)->UseSICB(useSICB); 476 (*i)->UseSICB(useSICB); 487 // (*i)->Initialize(theResidualNucleus); 477 // (*i)->Initialize(theResidualNucleus); 488 iters.push_back(iter); 478 iters.push_back(iter); 489 } 479 } 490 iter = std::find(evapType.begin(), evapTyp 480 iter = std::find(evapType.begin(), evapType.end(), G4Deuteron::Deuteron()); 491 if (iter != evapType.end()) 481 if (iter != evapType.end()) 492 { 482 { 493 theChannels1.push_back(new G4DeuteronEva 483 theChannels1.push_back(new G4DeuteronEvaporationChannel); 494 i = theChannels1.end() - 1; 484 i = theChannels1.end() - 1; 495 (*i)->SetOPTxs(OPTxs); 485 (*i)->SetOPTxs(OPTxs); 496 (*i)->UseSICB(useSICB); 486 (*i)->UseSICB(useSICB); 497 // (*i)->Initialize(theResidualNucleus); 487 // (*i)->Initialize(theResidualNucleus); 498 iters.push_back(iter); 488 iters.push_back(iter); 499 } 489 } 500 iter = std::find(evapType.begin(), evapTyp 490 iter = std::find(evapType.begin(), evapType.end(), G4Proton::Proton()); 501 if (iter != evapType.end()) 491 if (iter != evapType.end()) 502 { 492 { 503 theChannels1.push_back(new G4ProtonEvapo 493 theChannels1.push_back(new G4ProtonEvaporationChannel); 504 i = theChannels1.end() - 1; 494 i = theChannels1.end() - 1; 505 (*i)->SetOPTxs(OPTxs); 495 (*i)->SetOPTxs(OPTxs); 506 (*i)->UseSICB(useSICB); 496 (*i)->UseSICB(useSICB); 507 // (*i)->Initialize(theResidualNucleus); 497 // (*i)->Initialize(theResidualNucleus); 508 iters.push_back(iter); 498 iters.push_back(iter); 509 } 499 } 510 iter = std::find(evapType.begin(), evapTyp 500 iter = std::find(evapType.begin(), evapType.end(), G4Neutron::Neutron()); 511 if (iter != evapType.end()) 501 if (iter != evapType.end()) 512 { 502 { 513 theChannels1.push_back(new G4NeutronEvap 503 theChannels1.push_back(new G4NeutronEvaporationChannel); 514 i = theChannels1.end() - 1; 504 i = theChannels1.end() - 1; 515 (*i)->SetOPTxs(OPTxs); 505 (*i)->SetOPTxs(OPTxs); 516 (*i)->UseSICB(useSICB); 506 (*i)->UseSICB(useSICB); 517 // (*i)->Initialize(theResidualNucleus); 507 // (*i)->Initialize(theResidualNucleus); 518 iters.push_back(iter); 508 iters.push_back(iter); 519 } 509 } 520 std::size_t nChannels = theChannels1.size( << 510 G4int nChannels = theChannels1.size(); 521 511 522 G4double totalProb = 0.0; 512 G4double totalProb = 0.0; 523 G4int ich = 0; 513 G4int ich = 0; 524 G4double probEvapType[6] = {0.0}; 514 G4double probEvapType[6] = {0.0}; 525 for (auto iterEv=theChannels1.cbegin(); << 515 std::vector<G4VEvaporationChannel*>::iterator iterEv; 526 iterEv!=theChannels1.cend(); ++i << 516 for (iterEv=theChannels1.begin(); iterEv!=theChannels1.end(); iterEv++) { 527 totalProb += (*iterEv)->GetEmissionProba 517 totalProb += (*iterEv)->GetEmissionProbability(intermediateNucleus); 528 probEvapType[ich] = totalProb; 518 probEvapType[ich] = totalProb; 529 ++ich; 519 ++ich; 530 } 520 } 531 if (totalProb > 0.0) { 521 if (totalProb > 0.0) { 532 // 522 // 533 // 523 // 534 // The emission probability for at least one o 524 // The emission probability for at least one of the evaporation channels is 535 // positive, therefore work out which one shou 525 // positive, therefore work out which one should be selected and decay 536 // the nucleus. 526 // the nucleus. 537 // 527 // 538 G4double xi = totalProb*G4UniformRand(); 528 G4double xi = totalProb*G4UniformRand(); 539 std::size_t ii = 0; << 529 G4int ii = 0; 540 for (ii=0; ii<nChannels; ++ii) << 530 for (ii=0; ii<nChannels; ii++) { 541 { << 542 if (xi < probEvapType[ii]) { break; } 531 if (xi < probEvapType[ii]) { break; } 543 } 532 } 544 if (ii >= nChannels) { ii = nChannels - 533 if (ii >= nChannels) { ii = nChannels - 1; } 545 G4FragmentVector *evaporationResult = th 534 G4FragmentVector *evaporationResult = theChannels1[ii]-> 546 BreakUpFragment(intermediateNucleus); << 535 BreakUp(*intermediateNucleus); 547 if ((*evaporationResult)[0] != nullptr) << 548 { << 549 (*evaporationResult)[0]->SetCreatorMod << 550 } << 551 fragmentVector->push_back((*evaporationR 536 fragmentVector->push_back((*evaporationResult)[0]); 552 intermediateNucleus = (*evaporationResul << 537 *intermediateNucleus = *(*evaporationResult)[1]; >> 538 //delete evaporationResult->back(); 553 delete evaporationResult; 539 delete evaporationResult; >> 540 //evapType.erase(iters[ii]); 554 } 541 } 555 else 542 else 556 { 543 { 557 // 544 // 558 // 545 // 559 // Probability for further evaporation is nil 546 // Probability for further evaporation is nil so have to escape from this 560 // routine and set the energies of the seconda 547 // routine and set the energies of the secondaries to 10eV. 561 // 548 // 562 evaporate = false; 549 evaporate = false; 563 } 550 } 564 } 551 } 565 552 566 return; 553 return; 567 } 554 } 568 ////////////////////////////////////////////// 555 //////////////////////////////////////////////////////////////////////////////// 569 // 556 // 570 void G4WilsonAblationModel::SelectSecondariesB 557 void G4WilsonAblationModel::SelectSecondariesByDefault (G4ThreeVector boost) 571 { 558 { 572 for (std::size_t i=0; i<evapType.size(); ++i << 559 for (unsigned i=0; i<evapType.size(); i++) 573 { 560 { 574 G4ParticleDefinition *type = evapType[i]; 561 G4ParticleDefinition *type = evapType[i]; 575 G4double mass = type->GetPDGM 562 G4double mass = type->GetPDGMass(); 576 G4double e = mass + 10.0*e 563 G4double e = mass + 10.0*eV; 577 G4double p = std::sqrt(e*e 564 G4double p = std::sqrt(e*e-mass*mass); 578 G4double costheta = 2.0*G4Uniform 565 G4double costheta = 2.0*G4UniformRand() - 1.0; 579 G4double sintheta = std::sqrt((1. 566 G4double sintheta = std::sqrt((1.0 - costheta)*(1.0 + costheta)); 580 G4double phi = twopi * G4Uni 567 G4double phi = twopi * G4UniformRand() * rad; 581 G4ThreeVector direction(sintheta*std::cos( 568 G4ThreeVector direction(sintheta*std::cos(phi),sintheta*std::sin(phi),costheta); 582 G4LorentzVector lorentzVector = G4LorentzV 569 G4LorentzVector lorentzVector = G4LorentzVector(direction*p, e); 583 lorentzVector.boost(-boost); 570 lorentzVector.boost(-boost); 584 // Possibility that the following line is not 571 // Possibility that the following line is not correctly carrying over A and Z 585 // from particle definition. Force values. P 572 // from particle definition. Force values. PRT 03/12/2009. 586 // G4Fragment *fragment = 573 // G4Fragment *fragment = 587 // new G4Fragment(lorentzVector, type); 574 // new G4Fragment(lorentzVector, type); 588 G4int A = type->GetBaryonNumber(); 575 G4int A = type->GetBaryonNumber(); 589 G4int Z = (G4int) (type->GetPDGCharge() + 576 G4int Z = (G4int) (type->GetPDGCharge() + 1.0E-10); 590 G4Fragment *fragment = 577 G4Fragment *fragment = 591 new G4Fragment(A, Z, lorentzVector); 578 new G4Fragment(A, Z, lorentzVector); 592 if (fragment != nullptr) { fragment->SetCr << 579 593 fragmentVector->push_back(fragment); 580 fragmentVector->push_back(fragment); 594 } 581 } 595 } 582 } 596 ////////////////////////////////////////////// 583 //////////////////////////////////////////////////////////////////////////////// 597 // 584 // 598 void G4WilsonAblationModel::PrintWelcomeMessag 585 void G4WilsonAblationModel::PrintWelcomeMessage () 599 { 586 { 600 G4cout <<G4endl; 587 G4cout <<G4endl; 601 G4cout <<" ********************************* 588 G4cout <<" *****************************************************************" 602 <<G4endl; 589 <<G4endl; 603 G4cout <<" Nuclear ablation model for nuclea 590 G4cout <<" Nuclear ablation model for nuclear-nuclear interactions activated" 604 <<G4endl; 591 <<G4endl; 605 G4cout <<" (Written by QinetiQ Ltd for the E 592 G4cout <<" (Written by QinetiQ Ltd for the European Space Agency)" 606 <<G4endl; 593 <<G4endl; 607 G4cout <<" !!! WARNING: This model is not we 594 G4cout <<" !!! WARNING: This model is not well validation and should not be used for accurate simulation !!!" 608 <<G4endl; 595 <<G4endl; 609 G4cout <<" ********************************* 596 G4cout <<" *****************************************************************" 610 <<G4endl; 597 <<G4endl; 611 G4cout << G4endl; 598 G4cout << G4endl; 612 599 613 return; 600 return; 614 } 601 } 615 ////////////////////////////////////////////// 602 //////////////////////////////////////////////////////////////////////////////// 616 // 603 // 617 604