Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * 18 // * * 21 // * Parts of this code which have been devel 19 // * Parts of this code which have been developed by QinetiQ Ltd * 22 // * under contract to the European Space Agen << 20 // * under contract to the European Space Agency (ESA) are the * 23 // * intellectual property of ESA. Rights to u 21 // * intellectual property of ESA. Rights to use, copy, modify and * 24 // * redistribute this software for general pu 22 // * redistribute this software for general public use are granted * 25 // * in compliance with any licensing, distrib 23 // * in compliance with any licensing, distribution and development * 26 // * policy adopted by the Geant4 Collaboratio 24 // * policy adopted by the Geant4 Collaboration. This code has been * 27 // * written by QinetiQ Ltd for the European S 25 // * written by QinetiQ Ltd for the European Space Agency, under ESA * 28 // * contract 17191/03/NL/LvH (Aurora Programm << 26 // * contract 17191/03/NL/LvH (Aurora Programme). * 29 // * 27 // * * 30 // * By using, copying, modifying or distri << 28 // * By copying, distributing or modifying the Program (or any work * 31 // * any work based on the software) you ag << 29 // * based on the Program) you indicate your acceptance of this * 32 // * use in resulting scientific publicati << 30 // * statement, and all its terms. * 33 // * acceptance of all terms of the Geant4 Sof << 34 // ******************************************* 31 // ******************************************************************** 35 // 32 // 36 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% << 33 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 // 34 // 38 // MODULE: G4WilsonAbrasionModel. 35 // MODULE: G4WilsonAbrasionModel.cc 39 // 36 // 40 // Version: 1.0 << 37 // Version: B.1 41 // Date: 08/12/2009 << 38 // Date: 15/04/04 42 // Author: P R Truscott 39 // Author: P R Truscott 43 // Organisation: QinetiQ Ltd, UK 40 // Organisation: QinetiQ Ltd, UK 44 // Customer: ESA/ESTEC, NOORDWIJK 41 // Customer: ESA/ESTEC, NOORDWIJK 45 // Contract: 17191/03/NL/LvH 42 // Contract: 17191/03/NL/LvH 46 // 43 // 47 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% << 44 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 // 45 // 49 // CHANGE HISTORY 46 // CHANGE HISTORY 50 // -------------- 47 // -------------- 51 // 48 // 52 // 6 October 2003, P R Truscott, QinetiQ Ltd, 49 // 6 October 2003, P R Truscott, QinetiQ Ltd, UK 53 // Created. 50 // Created. 54 // 51 // 55 // 15 March 2004, P R Truscott, QinetiQ Ltd, U 52 // 15 March 2004, P R Truscott, QinetiQ Ltd, UK 56 // Beta release 53 // Beta release 57 // 54 // 58 // 18 January 2005, M H Mendenhall, Vanderbilt << 55 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 59 // Pointers to theAbrasionGeometry and product << 56 //////////////////////////////////////////////////////////////////////////////// 60 // handler deleted to prevent memory leaks. A << 61 // fragment previously not properly defined. << 62 // << 63 // 08 December 2009, P R Truscott, QinetiQ Ltd << 64 // ver 1.0 << 65 // There was originally a possibility of the m << 66 // considering Couloumb repulsion, rm, being t << 67 // rm >= fradius * (rP + rT) << 68 // where fradius is currently 0.99, then it is << 69 // unchanged. Additional conditions to escape << 70 // parameter: if the loop counter evtcnt reach << 71 // continued. << 72 // Additional clauses have been included in << 73 // G4WilsonAbrasionModel::GetNucleonInduced << 74 // Previously it was possible to get sqrt of n << 75 // algorithm not properly defined if either: << 76 // rT > rP && rsq < rTsq - rPsq) or (rP > r << 77 // << 78 // 12 June 2012, A. Ribon, CERN, Switzerland << 79 // Fixing trivial warning errors of shadowed v << 80 // << 81 // 4 August 2015, A. Ribon, CERN, Switzerland << 82 // Replacing std::exp and std::pow with the fa << 83 // << 84 // 7 August 2015, A. Ribon, CERN, Switzerland << 85 // Checking of 'while' loops. << 86 // 57 // 87 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% << 88 ////////////////////////////////////////////// << 89 << 90 #include "G4WilsonAbrasionModel.hh" 58 #include "G4WilsonAbrasionModel.hh" 91 #include "G4WilsonRadius.hh" 59 #include "G4WilsonRadius.hh" 92 #include "G4NuclearAbrasionGeometry.hh" 60 #include "G4NuclearAbrasionGeometry.hh" 93 #include "G4WilsonAblationModel.hh" 61 #include "G4WilsonAblationModel.hh" 94 62 95 #include "G4PhysicalConstants.hh" << 96 #include "G4SystemOfUnits.hh" << 97 #include "G4ExcitationHandler.hh" 63 #include "G4ExcitationHandler.hh" 98 #include "G4Evaporation.hh" 64 #include "G4Evaporation.hh" >> 65 #include "G4FermiBreakUp.hh" >> 66 #include "G4StatMF.hh" 99 #include "G4ParticleDefinition.hh" 67 #include "G4ParticleDefinition.hh" 100 #include "G4DynamicParticle.hh" 68 #include "G4DynamicParticle.hh" 101 #include "Randomize.hh" 69 #include "Randomize.hh" 102 #include "G4Fragment.hh" 70 #include "G4Fragment.hh" >> 71 #include "G4VNuclearDensity.hh" >> 72 #include "G4NuclearShellModelDensity.hh" >> 73 #include "G4NuclearFermiDensity.hh" >> 74 #include "G4FermiMomentum.hh" 103 #include "G4ReactionProductVector.hh" 75 #include "G4ReactionProductVector.hh" 104 #include "G4LorentzVector.hh" 76 #include "G4LorentzVector.hh" 105 #include "G4ParticleMomentum.hh" 77 #include "G4ParticleMomentum.hh" 106 #include "G4Poisson.hh" 78 #include "G4Poisson.hh" 107 #include "G4ParticleTable.hh" 79 #include "G4ParticleTable.hh" 108 #include "G4IonTable.hh" 80 #include "G4IonTable.hh" 109 #include "globals.hh" 81 #include "globals.hh" 110 << 82 //////////////////////////////////////////////////////////////////////////////// 111 #include "G4Exp.hh" << 83 // 112 #include "G4Pow.hh" << 84 G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4bool useAblation1) 113 << 114 #include "G4PhysicsModelCatalog.hh" << 115 << 116 << 117 G4WilsonAbrasionModel::G4WilsonAbrasionModel(G << 118 : G4HadronicInteraction("G4WilsonAbrasion"), << 119 { 85 { 120 // Send message to stdout to advise that the << 86 // >> 87 // >> 88 // Send message to stdout to advise that the G4Abrasion model is being used. >> 89 // 121 PrintWelcomeMessage(); 90 PrintWelcomeMessage(); 122 << 91 // 123 // Set the default verbose level to 0 - no o << 92 // >> 93 // Set the default verbose level to 0 - no output. >> 94 // 124 verboseLevel = 0; 95 verboseLevel = 0; 125 useAblation = useAblation1; 96 useAblation = useAblation1; 126 theAblation = nullptr; << 97 // 127 << 98 // 128 // No de-excitation handler has been supplie << 99 // No de-excitation handler has been supplied - define the default handler. 129 << 100 // 130 theExcitationHandler = new G4ExcitationHandl << 101 theExcitationHandler = new G4ExcitationHandler; >> 102 theExcitationHandlerx = new G4ExcitationHandler; 131 if (useAblation) 103 if (useAblation) 132 { 104 { 133 theAblation = new G4WilsonAblationModel; 105 theAblation = new G4WilsonAblationModel; 134 theAblation->SetVerboseLevel(verboseLevel) 106 theAblation->SetVerboseLevel(verboseLevel); 135 theExcitationHandler->SetEvaporation(theAb << 107 theExcitationHandler->SetEvaporation(theAblation); >> 108 theExcitationHandlerx->SetEvaporation(theAblation); 136 } 109 } 137 << 110 else 138 // Set the minimum and maximum range for the << 111 { 139 // this is in energy per nucleon number). << 112 theAblation = NULL; 140 << 113 G4Evaporation * theEvaporation = new G4Evaporation; >> 114 G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp; >> 115 G4StatMF * theMF = new G4StatMF; >> 116 theExcitationHandler->SetEvaporation(theEvaporation); >> 117 theExcitationHandler->SetFermiModel(theFermiBreakUp); >> 118 theExcitationHandler->SetMultiFragmentation(theMF); >> 119 theExcitationHandler->SetMaxAandZForFermiBreakUp(12, 6); >> 120 theExcitationHandler->SetMinEForMultiFrag(5.0*MeV); >> 121 >> 122 theEvaporation = new G4Evaporation; >> 123 theFermiBreakUp = new G4FermiBreakUp; >> 124 theExcitationHandlerx->SetEvaporation(theEvaporation); >> 125 theExcitationHandlerx->SetFermiModel(theFermiBreakUp); >> 126 theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6); >> 127 } >> 128 // >> 129 // >> 130 // Set the minimum and maximum range for the model (despite nomanclature, this >> 131 // is in energy per nucleon number). >> 132 // 141 SetMinEnergy(70.0*MeV); 133 SetMinEnergy(70.0*MeV); 142 SetMaxEnergy(10.1*GeV); 134 SetMaxEnergy(10.1*GeV); 143 isBlocked = false; 135 isBlocked = false; 144 << 136 // 145 // npK, when mutiplied by the nuclear Fermi << 137 // 146 // momentum over which the secondary nucleon << 138 // npK, when mutiplied by the nuclear Fermi momentum, determines the range of 147 << 139 // momentum over which the secondary nucleon momentum is sampled. 148 r0sq = 0.0; << 140 // 149 npK = 5.0; << 141 npK = 5.0; 150 B = 10.0 * MeV; << 142 B = 10.0 * MeV; 151 third = 1.0 / 3.0; << 143 third = 1.0 / 3.0; 152 fradius = 0.99; << 144 conserveEnergy = false; 153 conserveEnergy = false; << 154 conserveMomentum = true; 145 conserveMomentum = true; 155 << 156 // Creator model ID for the secondaries crea << 157 secID = G4PhysicsModelCatalog::GetModelID( " << 158 } << 159 << 160 void G4WilsonAbrasionModel::ModelDescription(s << 161 { << 162 outFile << "G4WilsonAbrasionModel is a macro << 163 << "nucleus-nucleus collisions using << 164 << "The smaller projectile nucleus g << 165 << "target nucleus, leaving a residu << 166 << "region where the projectile and << 167 << "is then treated as a highly exci << 168 << "model is based on the NUCFRG2 mo << 169 << "projectile energies between 70 M << 170 } 146 } 171 << 147 //////////////////////////////////////////////////////////////////////////////// 172 G4WilsonAbrasionModel::G4WilsonAbrasionModel(G << 148 // 173 G4HadronicInteraction("G4WilsonAbrasion"), se << 149 G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4ExcitationHandler *aExcitationHandler) 174 { 150 { >> 151 // >> 152 // 175 // Send message to stdout to advise that the G 153 // Send message to stdout to advise that the G4Abrasion model is being used. 176 << 154 // 177 PrintWelcomeMessage(); 155 PrintWelcomeMessage(); 178 << 156 // >> 157 // 179 // Set the default verbose level to 0 - no out 158 // Set the default verbose level to 0 - no output. 180 << 159 // 181 verboseLevel = 0; 160 verboseLevel = 0; 182 << 161 // 183 theAblation = nullptr; //A.R. 26-Jul-2012 << 184 useAblation = false; //A.R. 14-Aug-2012 << 185 << 186 // 162 // 187 // The user is able to provide the excitation 163 // The user is able to provide the excitation handler as well as an argument 188 // which is provided in this instantiation is 164 // which is provided in this instantiation is used to determine 189 // whether the spectators of the interaction a 165 // whether the spectators of the interaction are free following the abrasion. 190 // 166 // 191 theExcitationHandler = aExcitationHandler; << 167 theExcitationHandler = aExcitationHandler; >> 168 theExcitationHandlerx = new G4ExcitationHandler; >> 169 G4Evaporation * theEvaporation = new G4Evaporation; >> 170 G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp; >> 171 theExcitationHandlerx->SetEvaporation(theEvaporation); >> 172 theExcitationHandlerx->SetFermiModel(theFermiBreakUp); >> 173 theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6); 192 // 174 // 193 // 175 // 194 // Set the minimum and maximum range for the m 176 // Set the minimum and maximum range for the model (despite nomanclature, this 195 // is in energy per nucleon number). 177 // is in energy per nucleon number). 196 // 178 // 197 SetMinEnergy(70.0*MeV); 179 SetMinEnergy(70.0*MeV); 198 SetMaxEnergy(10.1*GeV); 180 SetMaxEnergy(10.1*GeV); 199 isBlocked = false; 181 isBlocked = false; 200 // 182 // 201 // 183 // 202 // npK, when mutiplied by the nuclear Fermi mo 184 // npK, when mutiplied by the nuclear Fermi momentum, determines the range of 203 // momentum over which the secondary nucleon m 185 // momentum over which the secondary nucleon momentum is sampled. 204 // 186 // 205 r0sq = 0.0; << 206 npK = 5.0; 187 npK = 5.0; 207 B = 10.0 * MeV; 188 B = 10.0 * MeV; 208 third = 1.0 / 3.0; 189 third = 1.0 / 3.0; 209 fradius = 0.99; << 210 conserveEnergy = false; 190 conserveEnergy = false; 211 conserveMomentum = true; 191 conserveMomentum = true; 212 << 213 // Creator model ID for the secondaries crea << 214 secID = G4PhysicsModelCatalog::GetModelID( " << 215 } 192 } 216 ////////////////////////////////////////////// 193 //////////////////////////////////////////////////////////////////////////////// 217 // 194 // 218 G4WilsonAbrasionModel::~G4WilsonAbrasionModel( << 195 G4WilsonAbrasionModel::~G4WilsonAbrasionModel () 219 { 196 { >> 197 // >> 198 // >> 199 // The destructor doesn't have to do a great deal! >> 200 // 220 delete theExcitationHandler; 201 delete theExcitationHandler; >> 202 delete theExcitationHandlerx; 221 } 203 } 222 ////////////////////////////////////////////// 204 //////////////////////////////////////////////////////////////////////////////// 223 // 205 // 224 G4HadFinalState *G4WilsonAbrasionModel::ApplyY 206 G4HadFinalState *G4WilsonAbrasionModel::ApplyYourself ( 225 const G4HadProjectile &theTrack, G4Nucleus & 207 const G4HadProjectile &theTrack, G4Nucleus &theTarget) 226 { 208 { 227 // 209 // 228 // 210 // 229 // The secondaries will be returned in G4HadFi 211 // The secondaries will be returned in G4HadFinalState &theParticleChange - 230 // initialise this. The original track will a 212 // initialise this. The original track will always be discontinued and 231 // secondaries followed. 213 // secondaries followed. 232 // 214 // 233 theParticleChange.Clear(); 215 theParticleChange.Clear(); 234 theParticleChange.SetStatusChange(stopAndKil 216 theParticleChange.SetStatusChange(stopAndKill); 235 // 217 // 236 // 218 // 237 // Get relevant information about the projecti 219 // Get relevant information about the projectile and target (A, Z, energy/nuc, 238 // momentum, etc). 220 // momentum, etc). 239 // 221 // 240 const G4ParticleDefinition *definitionP = th 222 const G4ParticleDefinition *definitionP = theTrack.GetDefinition(); 241 const G4double AP = definitionP->GetBaryonN << 223 const G4double AP = definitionP->GetBaryonNumber(); 242 const G4double ZP = definitionP->GetPDGChar << 224 const G4double ZP = definitionP->GetPDGCharge(); 243 G4LorentzVector pP = theTrack.Get4Momentum() << 225 G4LorentzVector pP = theTrack.Get4Momentum(); 244 G4double E = theTrack.GetKineticEner << 226 G4double E = theTrack.GetKineticEnergy()/AP; 245 G4double AT = theTarget.GetA_asInt(); << 227 G4double AT = theTarget.GetN(); 246 G4double ZT = theTarget.GetZ_asInt(); << 228 G4double ZT = theTarget.GetZ(); 247 G4double TotalEPre = theTrack.GetTotalEnergy << 229 G4double TotalEPre = theTrack.GetTotalEnergy() + 248 theTarget.AtomicMass(AT, ZT) + theTarget.G 230 theTarget.AtomicMass(AT, ZT) + theTarget.GetEnergyDeposit(); 249 G4double TotalEPost = 0.0; 231 G4double TotalEPost = 0.0; 250 // 232 // 251 // 233 // 252 // Determine the radii of the projectile and t 234 // Determine the radii of the projectile and target nuclei. 253 // 235 // 254 G4WilsonRadius aR; 236 G4WilsonRadius aR; 255 G4double rP = aR.GetWilsonRadius(AP); 237 G4double rP = aR.GetWilsonRadius(AP); 256 G4double rT = aR.GetWilsonRadius(AT); 238 G4double rT = aR.GetWilsonRadius(AT); 257 G4double rPsq = rP * rP; 239 G4double rPsq = rP * rP; 258 G4double rTsq = rT * rT; 240 G4double rTsq = rT * rT; 259 if (verboseLevel >= 2) 241 if (verboseLevel >= 2) 260 { 242 { 261 G4cout <<"################################ 243 G4cout <<"########################################" 262 <<"################################ 244 <<"########################################" 263 <<G4endl; 245 <<G4endl; 264 G4cout.precision(6); 246 G4cout.precision(6); 265 G4cout <<"IN G4WilsonAbrasionModel" <<G4en 247 G4cout <<"IN G4WilsonAbrasionModel" <<G4endl; 266 G4cout <<"Initial projectile A=" <<AP 248 G4cout <<"Initial projectile A=" <<AP 267 <<", Z=" <<ZP 249 <<", Z=" <<ZP 268 <<", radius = " <<rP/fermi <<" fm" 250 <<", radius = " <<rP/fermi <<" fm" 269 <<G4endl; 251 <<G4endl; 270 G4cout <<"Initial target A=" <<AT 252 G4cout <<"Initial target A=" <<AT 271 <<", Z=" <<ZT 253 <<", Z=" <<ZT 272 <<", radius = " <<rT/fermi <<" fm" 254 <<", radius = " <<rT/fermi <<" fm" 273 <<G4endl; 255 <<G4endl; 274 G4cout <<"Projectile momentum and Energy/n 256 G4cout <<"Projectile momentum and Energy/nuc = " <<pP <<" ," <<E <<G4endl; 275 } 257 } 276 // 258 // 277 // 259 // 278 // The following variables are used to determi 260 // The following variables are used to determine the impact parameter in the 279 // near-field (i.e. taking into consideration 261 // near-field (i.e. taking into consideration the electrostatic repulsion). 280 // 262 // 281 G4double rm = ZP * ZT * elm_coupling / (E 263 G4double rm = ZP * ZT * elm_coupling / (E * AP); 282 G4double r = 0.0; 264 G4double r = 0.0; 283 G4double rsq = 0.0; 265 G4double rsq = 0.0; 284 // 266 // 285 // 267 // 286 // Initialise some of the variables which wll 268 // Initialise some of the variables which wll be used to calculate the chord- 287 // length for nucleons in the projectile and t 269 // length for nucleons in the projectile and target, and hence calculate the 288 // number of abraded nucleons and the excitati 270 // number of abraded nucleons and the excitation energy. 289 // 271 // 290 G4NuclearAbrasionGeometry *theAbrasionGeomet << 272 G4NuclearAbrasionGeometry *theAbrasionGeometry = NULL; 291 G4double CT = 0.0; 273 G4double CT = 0.0; 292 G4double F = 0.0; 274 G4double F = 0.0; 293 G4int Dabr = 0; 275 G4int Dabr = 0; 294 // 276 // 295 // 277 // 296 // The following loop is performed until the n 278 // The following loop is performed until the number of nucleons which are 297 // abraded by the process is >1, i.e. an inter 279 // abraded by the process is >1, i.e. an interaction MUST occur. 298 // 280 // 299 G4bool skipInteraction = false; // It will << 281 while (Dabr == 0) 300 const G4int maxNumberOfLoops = 1000; << 301 G4int loopCounter = -1; << 302 while (Dabr == 0 && ++loopCounter < maxNumbe << 303 { 282 { 304 // 283 // 305 // 284 // 306 // Sample the impact parameter. For the momen 285 // Sample the impact parameter. For the moment, this class takes account of 307 // electrostatic effects on the impact paramet 286 // electrostatic effects on the impact parameter, but (like HZETRN AND NUCFRG2) 308 // does not make any correction for the effect 287 // does not make any correction for the effects of nuclear-nuclear repulsion. 309 // 288 // 310 G4double rPT = rP + rT; 289 G4double rPT = rP + rT; 311 G4double rPTsq = rPT * rPT; 290 G4double rPTsq = rPT * rPT; 312 // << 313 // << 314 // This is a "catch" to make sure we don't go << 315 // energy is too low to overcome nuclear repul << 316 // value of rm < fradius * rPT then we're unli << 317 // impact parameter (energy of incident partic << 318 // << 319 if (rm >= fradius * rPT) { << 320 skipInteraction = true; << 321 } << 322 // << 323 // << 324 // Now sample impact parameter until the crite << 325 // and target overlap, but repulsion is taken << 326 // << 327 G4int evtcnt = 0; << 328 r = 1.1 * rPT; 291 r = 1.1 * rPT; 329 while (r > rPT && ++evtcnt < 1000) /* Loo << 292 while (r > rPT) 330 { 293 { 331 G4double bsq = rPTsq * G4UniformRand(); 294 G4double bsq = rPTsq * G4UniformRand(); 332 r = (rm + std::sqrt(rm*rm + 4 295 r = (rm + std::sqrt(rm*rm + 4.0*bsq)) / 2.0; 333 } 296 } 334 // << 335 // << 336 // We've tried to sample this 1000 times, but << 337 // << 338 if (evtcnt >= 1000) { << 339 skipInteraction = true; << 340 } << 341 << 342 rsq = r * r; 297 rsq = r * r; 343 // 298 // 344 // 299 // 345 // Now determine the chord-length through the 300 // Now determine the chord-length through the target nucleus. 346 // 301 // 347 if (rT > rP) 302 if (rT > rP) 348 { 303 { 349 G4double x = (rPsq + rsq - rTsq) / 2.0 / 304 G4double x = (rPsq + rsq - rTsq) / 2.0 / r; 350 if (x > 0.0) CT = 2.0 * std::sqrt(rTsq - 305 if (x > 0.0) CT = 2.0 * std::sqrt(rTsq - x*x); 351 else CT = 2.0 * std::sqrt(rTsq - 306 else CT = 2.0 * std::sqrt(rTsq - rsq); 352 } 307 } 353 else 308 else 354 { 309 { 355 G4double x = (rTsq + rsq - rPsq) / 2.0 / 310 G4double x = (rTsq + rsq - rPsq) / 2.0 / r; 356 if (x > 0.0) CT = 2.0 * std::sqrt(rTsq - 311 if (x > 0.0) CT = 2.0 * std::sqrt(rTsq - x*x); 357 else CT = 2.0 * rT; 312 else CT = 2.0 * rT; 358 } 313 } 359 // 314 // 360 // 315 // 361 // Determine the number of abraded nucleons. 316 // Determine the number of abraded nucleons. Note that the mean number of 362 // abraded nucleons is used to sample the Pois 317 // abraded nucleons is used to sample the Poisson distribution. The Poisson 363 // distribution is sampled only ten times with 318 // distribution is sampled only ten times with the current impact parameter, 364 // and if it fails after this to find a case f 319 // and if it fails after this to find a case for which the number of abraded 365 // nucleons >1, the impact parameter is re-sam 320 // nucleons >1, the impact parameter is re-sampled. 366 // 321 // 367 delete theAbrasionGeometry; << 368 theAbrasionGeometry = new G4NuclearAbrasio 322 theAbrasionGeometry = new G4NuclearAbrasionGeometry(AP,AT,r); 369 F = theAbrasionGeometry- 323 F = theAbrasionGeometry->F(); 370 G4double lambda = 16.6*fermi / G4Pow:: << 324 G4double lambda = 16.6*fermi / std::pow(E/MeV,0.26); 371 G4double Mabr = F * AP * (1.0 - G4Ex << 325 G4double Mabr = F * AP * (1.0 - std::exp(-CT/lambda)); 372 G4long n = 0; 326 G4long n = 0; 373 for (G4int i = 0; i<10; ++i) << 327 for (G4int i = 0; i<10; i++) 374 { 328 { 375 n = G4Poisson(Mabr); 329 n = G4Poisson(Mabr); 376 if (n > 0) 330 if (n > 0) 377 { 331 { 378 if (n>AP) Dabr = (G4int) AP; 332 if (n>AP) Dabr = (G4int) AP; 379 else Dabr = (G4int) n; 333 else Dabr = (G4int) n; 380 break; 334 break; 381 } 335 } 382 } 336 } 383 } // End of while loop << 384 << 385 if ( loopCounter >= maxNumberOfLoops || skip << 386 // Assume nuclei do not collide and return << 387 theParticleChange.SetStatusChange(isAlive) << 388 theParticleChange.SetEnergyChange(theTrack << 389 theParticleChange.SetMomentumChange(theTra << 390 if (verboseLevel >= 2) { << 391 G4cout <<"Particle energy too low to ove << 392 G4cout <<"Event rejected and original tr << 393 G4cout <<"############################## << 394 <<"############################## << 395 <<G4endl; << 396 } << 397 delete theAbrasionGeometry; << 398 return &theParticleChange; << 399 } 337 } 400 << 401 if (verboseLevel >= 2) 338 if (verboseLevel >= 2) 402 { 339 { 403 G4cout <<G4endl; 340 G4cout <<G4endl; 404 G4cout <<"Impact parameter = " <<r/ferm 341 G4cout <<"Impact parameter = " <<r/fermi <<" fm" <<G4endl; 405 G4cout <<"# Abraded nucleons = " <<Dabr < 342 G4cout <<"# Abraded nucleons = " <<Dabr <<G4endl; 406 } 343 } 407 // 344 // 408 // 345 // 409 // The number of abraded nucleons must be no g 346 // The number of abraded nucleons must be no greater than the number of 410 // nucleons in either the projectile or the ta 347 // nucleons in either the projectile or the target. If AP - Dabr < 2 or 411 // AT - Dabr < 2 then either we have only a nu 348 // AT - Dabr < 2 then either we have only a nucleon left behind in the 412 // projectile/target or we've tried to abrade 349 // projectile/target or we've tried to abrade too many nucleons - and Dabr 413 // should be limited. 350 // should be limited. 414 // 351 // 415 if (AP - (G4double) Dabr < 2.0) Dabr = (G4in 352 if (AP - (G4double) Dabr < 2.0) Dabr = (G4int) AP; 416 if (AT - (G4double) Dabr < 2.0) Dabr = (G4in 353 if (AT - (G4double) Dabr < 2.0) Dabr = (G4int) AT; 417 // 354 // 418 // 355 // 419 // Determine the abraded secondary nucleons fr 356 // Determine the abraded secondary nucleons from the projectile. *fragmentP 420 // is a pointer to the prefragment from the pr 357 // is a pointer to the prefragment from the projectile and nSecP is the number 421 // of nucleons in theParticleChange which have 358 // of nucleons in theParticleChange which have been abraded. The total energy 422 // from these is determined. 359 // from these is determined. 423 // 360 // 424 G4ThreeVector boost = pP.findBoostToCM(); 361 G4ThreeVector boost = pP.findBoostToCM(); 425 G4Fragment *fragmentP = GetAbradedNucleons ( 362 G4Fragment *fragmentP = GetAbradedNucleons (Dabr, AP, ZP, rP); 426 G4int nSecP = (G4int)theParticleCh << 363 G4int nSecP = theParticleChange.GetNumberOfSecondaries(); 427 G4int i = 0; 364 G4int i = 0; 428 for (i=0; i<nSecP; ++i) << 365 for (i=0; i<nSecP; i++) 429 { 366 { 430 TotalEPost += theParticleChange.GetSeconda 367 TotalEPost += theParticleChange.GetSecondary(i)-> 431 GetParticle()->GetTotalEnergy(); 368 GetParticle()->GetTotalEnergy(); 432 } 369 } 433 // 370 // 434 // 371 // 435 // Determine the number of spectators in the i 372 // Determine the number of spectators in the interaction region for the 436 // projectile. 373 // projectile. 437 // 374 // 438 G4int DspcP = (G4int) (AP*F) - Dabr; 375 G4int DspcP = (G4int) (AP*F) - Dabr; 439 if (DspcP <= 0) DspcP = 0; 376 if (DspcP <= 0) DspcP = 0; 440 else if (DspcP > AP-Dabr) DspcP = ((G4int) A 377 else if (DspcP > AP-Dabr) DspcP = ((G4int) AP) - Dabr; 441 // 378 // 442 // 379 // 443 // Determine excitation energy associated with 380 // Determine excitation energy associated with excess surface area of the 444 // projectile (EsP) and the excitation due to 381 // projectile (EsP) and the excitation due to scattering of nucleons which are 445 // retained within the projectile (ExP). Add 382 // retained within the projectile (ExP). Add the total energy from the excited 446 // nucleus to the total energy of the secondar 383 // nucleus to the total energy of the secondaries. 447 // 384 // 448 G4bool excitationAbsorbedByProjectile = fals 385 G4bool excitationAbsorbedByProjectile = false; 449 if (fragmentP != nullptr) << 386 if (fragmentP != NULL) 450 { 387 { 451 G4double EsP = theAbrasionGeometry->GetExc 388 G4double EsP = theAbrasionGeometry->GetExcitationEnergyOfProjectile(); 452 G4double ExP = 0.0; 389 G4double ExP = 0.0; 453 if (Dabr < AT) 390 if (Dabr < AT) 454 excitationAbsorbedByProjectile = G4Unifo 391 excitationAbsorbedByProjectile = G4UniformRand() < 0.5; 455 if (excitationAbsorbedByProjectile) 392 if (excitationAbsorbedByProjectile) 456 ExP = GetNucleonInducedExcitation(rP, rT 393 ExP = GetNucleonInducedExcitation(rP, rT, r); 457 G4double xP = EsP + ExP; 394 G4double xP = EsP + ExP; 458 if (xP > B*(AP-Dabr)) xP = B*(AP-Dabr); 395 if (xP > B*(AP-Dabr)) xP = B*(AP-Dabr); 459 G4LorentzVector lorentzVector = fragmentP- 396 G4LorentzVector lorentzVector = fragmentP->GetMomentum(); 460 lorentzVector.setE(lorentzVector.e()+xP); 397 lorentzVector.setE(lorentzVector.e()+xP); 461 fragmentP->SetMomentum(lorentzVector); 398 fragmentP->SetMomentum(lorentzVector); 462 TotalEPost += lorentzVector.e(); 399 TotalEPost += lorentzVector.e(); 463 } 400 } 464 G4double EMassP = TotalEPost; 401 G4double EMassP = TotalEPost; 465 // 402 // 466 // 403 // 467 // Determine the abraded secondary nucleons fr 404 // Determine the abraded secondary nucleons from the target. Note that it's 468 // assumed that the same number of nucleons ar 405 // assumed that the same number of nucleons are abraded from the target as for 469 // the projectile, and obviously no boost is a 406 // the projectile, and obviously no boost is applied to the products. *fragmentT 470 // is a pointer to the prefragment from the ta 407 // is a pointer to the prefragment from the target and nSec is the total number 471 // of nucleons in theParticleChange which have 408 // of nucleons in theParticleChange which have been abraded. The total energy 472 // from these is determined. 409 // from these is determined. 473 // 410 // 474 G4Fragment *fragmentT = GetAbradedNucleons ( 411 G4Fragment *fragmentT = GetAbradedNucleons (Dabr, AT, ZT, rT); 475 G4int nSec = (G4int)theParticleChange.GetNum << 412 G4int nSec = theParticleChange.GetNumberOfSecondaries(); 476 for (i=nSecP; i<nSec; ++i) << 413 for (i=nSecP; i<nSec; i++) 477 { 414 { 478 TotalEPost += theParticleChange.GetSeconda 415 TotalEPost += theParticleChange.GetSecondary(i)-> 479 GetParticle()->GetTotalEnergy(); 416 GetParticle()->GetTotalEnergy(); 480 } 417 } 481 // 418 // 482 // 419 // 483 // Determine the number of spectators in the i 420 // Determine the number of spectators in the interaction region for the 484 // target. 421 // target. 485 // 422 // 486 G4int DspcT = (G4int) (AT*F) - Dabr; 423 G4int DspcT = (G4int) (AT*F) - Dabr; 487 if (DspcT <= 0) DspcT = 0; 424 if (DspcT <= 0) DspcT = 0; 488 else if (DspcT > AP-Dabr) DspcT = ((G4int) A 425 else if (DspcT > AP-Dabr) DspcT = ((G4int) AT) - Dabr; 489 // 426 // 490 // 427 // 491 // Determine excitation energy associated with 428 // Determine excitation energy associated with excess surface area of the 492 // target (EsT) and the excitation due to scat 429 // target (EsT) and the excitation due to scattering of nucleons which are 493 // retained within the target (ExT). Add the 430 // retained within the target (ExT). Add the total energy from the excited 494 // nucleus to the total energy of the secondar 431 // nucleus to the total energy of the secondaries. 495 // 432 // 496 if (fragmentT != nullptr) << 433 if (fragmentT != NULL) 497 { 434 { 498 G4double EsT = theAbrasionGeometry->GetExc 435 G4double EsT = theAbrasionGeometry->GetExcitationEnergyOfTarget(); 499 G4double ExT = 0.0; 436 G4double ExT = 0.0; 500 if (!excitationAbsorbedByProjectile) 437 if (!excitationAbsorbedByProjectile) 501 ExT = GetNucleonInducedExcitation(rT, rP 438 ExT = GetNucleonInducedExcitation(rT, rP, r); 502 G4double xT = EsT + ExT; 439 G4double xT = EsT + ExT; 503 if (xT > B*(AT-Dabr)) xT = B*(AT-Dabr); 440 if (xT > B*(AT-Dabr)) xT = B*(AT-Dabr); 504 G4LorentzVector lorentzVector = fragmentT- 441 G4LorentzVector lorentzVector = fragmentT->GetMomentum(); 505 lorentzVector.setE(lorentzVector.e()+xT); 442 lorentzVector.setE(lorentzVector.e()+xT); 506 fragmentT->SetMomentum(lorentzVector); 443 fragmentT->SetMomentum(lorentzVector); 507 TotalEPost += lorentzVector.e(); 444 TotalEPost += lorentzVector.e(); 508 } 445 } 509 // 446 // 510 // 447 // 511 // Now determine the difference between the pr 448 // Now determine the difference between the pre and post interaction 512 // energy - this will be used to determine the 449 // energy - this will be used to determine the Lorentz boost if conservation 513 // of energy is to be imposed/attempted. 450 // of energy is to be imposed/attempted. 514 // 451 // 515 G4double deltaE = TotalEPre - TotalEPost; 452 G4double deltaE = TotalEPre - TotalEPost; 516 if (deltaE > 0.0 && conserveEnergy) 453 if (deltaE > 0.0 && conserveEnergy) 517 { 454 { 518 G4double beta = std::sqrt(1.0 - EMassP*EMa << 455 G4double beta = std::sqrt(1.0 - EMassP*EMassP/std::pow(deltaE+EMassP,2.0)); 519 boost = boost / boost.mag() * beta; 456 boost = boost / boost.mag() * beta; 520 } 457 } 521 // 458 // 522 // 459 // 523 // Now boost the secondaries from the projecti 460 // Now boost the secondaries from the projectile. 524 // 461 // 525 G4ThreeVector pBalance = pP.vect(); 462 G4ThreeVector pBalance = pP.vect(); 526 for (i=0; i<nSecP; ++i) << 463 for (i=0; i<nSecP; i++) 527 { 464 { 528 G4DynamicParticle *dynamicP = theParticleC 465 G4DynamicParticle *dynamicP = theParticleChange.GetSecondary(i)-> 529 GetParticle(); 466 GetParticle(); 530 G4LorentzVector lorentzVector = dynamicP-> 467 G4LorentzVector lorentzVector = dynamicP->Get4Momentum(); 531 lorentzVector.boost(-boost); 468 lorentzVector.boost(-boost); 532 dynamicP->Set4Momentum(lorentzVector); 469 dynamicP->Set4Momentum(lorentzVector); 533 pBalance -= lorentzVector.vect(); 470 pBalance -= lorentzVector.vect(); 534 } 471 } 535 // 472 // 536 // 473 // 537 // Set the boost for the projectile prefragmen 474 // Set the boost for the projectile prefragment. This is now based on the 538 // conservation of momentum. However, if the 475 // conservation of momentum. However, if the user selected momentum of the 539 // prefragment is not to be conserved this sim 476 // prefragment is not to be conserved this simply boosted to the velocity of the 540 // original projectile times the ratio of the 477 // original projectile times the ratio of the unexcited to the excited mass 541 // of the prefragment (the excitation increase 478 // of the prefragment (the excitation increases the effective mass of the 542 // prefragment, and therefore modifying the bo 479 // prefragment, and therefore modifying the boost is an attempt to prevent 543 // the momentum of the prefragment being exces 480 // the momentum of the prefragment being excessive). 544 // 481 // 545 if (fragmentP != nullptr) << 482 if (fragmentP != NULL) 546 { 483 { 547 G4LorentzVector lorentzVector = fragmentP- 484 G4LorentzVector lorentzVector = fragmentP->GetMomentum(); 548 G4double fragmentM = lorentzVec << 485 G4double m = lorentzVector.m(); 549 if (conserveMomentum) 486 if (conserveMomentum) 550 fragmentP->SetMomentum 487 fragmentP->SetMomentum 551 (G4LorentzVector(pBalance,std::sqrt(pB << 488 (G4LorentzVector(pBalance,std::sqrt(pBalance.mag2()+m*m+1.0*eV*eV))); 552 else 489 else 553 { 490 { 554 G4double fragmentGroundStateM = fragment << 491 G4double mg = fragmentP->GetGroundStateMass(); 555 fragmentP->SetMomentum(lorentzVector.boo << 492 fragmentP->SetMomentum(lorentzVector.boost(-boost * mg/m)); 556 } 493 } 557 } 494 } 558 // 495 // 559 // 496 // 560 // Output information to user if verbose infor 497 // Output information to user if verbose information requested. 561 // 498 // 562 if (verboseLevel >= 2) 499 if (verboseLevel >= 2) 563 { 500 { 564 G4cout <<G4endl; 501 G4cout <<G4endl; 565 G4cout <<"-------------------------------- 502 G4cout <<"-----------------------------------" <<G4endl; 566 G4cout <<"Secondary nucleons from projecti 503 G4cout <<"Secondary nucleons from projectile:" <<G4endl; 567 G4cout <<"-------------------------------- 504 G4cout <<"-----------------------------------" <<G4endl; 568 G4cout.precision(7); 505 G4cout.precision(7); 569 for (i=0; i<nSecP; ++i) << 506 for (i=0; i<nSecP; i++) 570 { 507 { 571 G4cout <<"Particle # " <<i <<G4endl; 508 G4cout <<"Particle # " <<i <<G4endl; 572 theParticleChange.GetSecondary(i)->GetPa 509 theParticleChange.GetSecondary(i)->GetParticle()->DumpInfo(); 573 G4DynamicParticle *dyn = theParticleChan 510 G4DynamicParticle *dyn = theParticleChange.GetSecondary(i)->GetParticle(); 574 G4cout <<"New nucleon (P) " <<dyn->GetDe 511 G4cout <<"New nucleon (P) " <<dyn->GetDefinition()->GetParticleName() 575 <<" : " <<dyn->Get4M 512 <<" : " <<dyn->Get4Momentum() 576 <<G4endl; 513 <<G4endl; 577 } 514 } 578 G4cout <<"---------------------------" <<G 515 G4cout <<"---------------------------" <<G4endl; 579 G4cout <<"The projectile prefragment:" <<G 516 G4cout <<"The projectile prefragment:" <<G4endl; 580 G4cout <<"---------------------------" <<G 517 G4cout <<"---------------------------" <<G4endl; 581 if (fragmentP != nullptr) << 518 if (fragmentP != NULL) 582 G4cout <<*fragmentP <<G4endl; 519 G4cout <<*fragmentP <<G4endl; 583 else 520 else 584 G4cout <<"(No residual prefragment)" <<G 521 G4cout <<"(No residual prefragment)" <<G4endl; 585 G4cout <<G4endl; 522 G4cout <<G4endl; 586 G4cout <<"-------------------------------" 523 G4cout <<"-------------------------------" <<G4endl; 587 G4cout <<"Secondary nucleons from target:" 524 G4cout <<"Secondary nucleons from target:" <<G4endl; 588 G4cout <<"-------------------------------" 525 G4cout <<"-------------------------------" <<G4endl; 589 G4cout.precision(7); 526 G4cout.precision(7); 590 for (i=nSecP; i<nSec; ++i) << 527 for (i=nSecP; i<nSec; i++) 591 { 528 { 592 G4cout <<"Particle # " <<i <<G4endl; 529 G4cout <<"Particle # " <<i <<G4endl; 593 theParticleChange.GetSecondary(i)->GetPa 530 theParticleChange.GetSecondary(i)->GetParticle()->DumpInfo(); 594 G4DynamicParticle *dyn = theParticleChan 531 G4DynamicParticle *dyn = theParticleChange.GetSecondary(i)->GetParticle(); 595 G4cout <<"New nucleon (T) " <<dyn->GetDe 532 G4cout <<"New nucleon (T) " <<dyn->GetDefinition()->GetParticleName() 596 <<" : " <<dyn->Get4M 533 <<" : " <<dyn->Get4Momentum() 597 <<G4endl; 534 <<G4endl; 598 } 535 } 599 G4cout <<"-----------------------" <<G4end 536 G4cout <<"-----------------------" <<G4endl; 600 G4cout <<"The target prefragment:" <<G4end 537 G4cout <<"The target prefragment:" <<G4endl; 601 G4cout <<"-----------------------" <<G4end 538 G4cout <<"-----------------------" <<G4endl; 602 if (fragmentT != nullptr) << 539 if (fragmentT != NULL) 603 G4cout <<*fragmentT <<G4endl; 540 G4cout <<*fragmentT <<G4endl; 604 else 541 else 605 G4cout <<"(No residual prefragment)" <<G 542 G4cout <<"(No residual prefragment)" <<G4endl; 606 } 543 } 607 // 544 // 608 // 545 // 609 // Now we can decay the nuclear fragments if p 546 // Now we can decay the nuclear fragments if present. The secondaries are 610 // collected and boosted as well. This is per 547 // collected and boosted as well. This is performed first for the projectile... 611 // 548 // 612 if (fragmentP !=nullptr) << 549 if (fragmentP !=NULL) 613 { 550 { 614 G4ReactionProductVector *products = nullpt << 551 G4ReactionProductVector *products = NULL; 615 // if (fragmentP->GetZ_asInt() != fragm << 552 if (fragmentP->GetZ() != fragmentP->GetA()) 616 products = theExcitationHandler->BreakItUp << 553 products = theExcitationHandler->BreakItUp(*fragmentP); 617 // else << 554 else 618 // products = theExcitationHandlerx->Bre << 555 products = theExcitationHandlerx->BreakItUp(*fragmentP); 619 delete fragmentP; 556 delete fragmentP; 620 fragmentP = nullptr; << 557 fragmentP = NULL; 621 558 622 G4ReactionProductVector::iterator iter; 559 G4ReactionProductVector::iterator iter; 623 for (iter = products->begin(); iter != pro 560 for (iter = products->begin(); iter != products->end(); ++iter) 624 { 561 { 625 G4DynamicParticle *secondary = 562 G4DynamicParticle *secondary = 626 new G4DynamicParticle((*iter)->GetDefi 563 new G4DynamicParticle((*iter)->GetDefinition(), 627 (*iter)->GetTotalEnergy(), (*iter)->Ge 564 (*iter)->GetTotalEnergy(), (*iter)->GetMomentum()); 628 theParticleChange.AddSecondary (secondar << 629 G4String particleName = (*iter)->GetDefi 565 G4String particleName = (*iter)->GetDefinition()->GetParticleName(); 630 delete (*iter); // get rid of leftover p << 631 if (verboseLevel >= 2 && particleName.fi 566 if (verboseLevel >= 2 && particleName.find("[",0) < particleName.size()) 632 { 567 { 633 G4cout <<"------------------------" << 568 G4cout <<"------------------------" <<G4endl; 634 G4cout <<"The projectile fragment:" << 569 G4cout <<"The projectile fragment:" <<G4endl; 635 G4cout <<"------------------------" << 570 G4cout <<"------------------------" <<G4endl; 636 G4cout <<" fragmentP = " <<particleNam 571 G4cout <<" fragmentP = " <<particleName 637 <<" Energy = " <<secondary-> 572 <<" Energy = " <<secondary->GetKineticEnergy() 638 <<G4endl; 573 <<G4endl; 639 } 574 } 640 } 575 } 641 delete products; << 642 } 576 } 643 // 577 // 644 // 578 // 645 // Now decay the target nucleus - no boost is 579 // Now decay the target nucleus - no boost is applied since in this 646 // approximation it is assumed that there is n 580 // approximation it is assumed that there is negligible momentum transfer from 647 // the projectile. 581 // the projectile. 648 // 582 // 649 if (fragmentT != nullptr) << 583 if (fragmentT != NULL) 650 { 584 { 651 G4ReactionProductVector *products = nullpt << 585 G4ReactionProductVector *products = NULL; 652 // if (fragmentT->GetZ_asInt() != fragm << 586 if (fragmentT->GetZ() != fragmentT->GetA()) 653 products = theExcitationHandler->BreakIt 587 products = theExcitationHandler->BreakItUp(*fragmentT); 654 // else << 588 else 655 // products = theExcitationHandlerx->Bre << 589 products = theExcitationHandlerx->BreakItUp(*fragmentT); 656 // delete fragmentT; << 590 delete fragmentT; 657 fragmentT = nullptr; << 591 fragmentT = NULL; 658 592 659 G4ReactionProductVector::iterator iter; 593 G4ReactionProductVector::iterator iter; 660 for (iter = products->begin(); iter != pro 594 for (iter = products->begin(); iter != products->end(); ++iter) 661 { 595 { 662 G4DynamicParticle *secondary = 596 G4DynamicParticle *secondary = 663 new G4DynamicParticle((*iter)->GetDefi 597 new G4DynamicParticle((*iter)->GetDefinition(), 664 (*iter)->GetTotalEnergy(), (*iter)->Ge 598 (*iter)->GetTotalEnergy(), (*iter)->GetMomentum()); 665 theParticleChange.AddSecondary (secondar << 599 theParticleChange.AddSecondary (secondary); 666 G4String particleName = (*iter)->GetDefi 600 G4String particleName = (*iter)->GetDefinition()->GetParticleName(); 667 delete (*iter); // get rid of leftover p << 668 if (verboseLevel >= 2 && particleName.fi 601 if (verboseLevel >= 2 && particleName.find("[",0) < particleName.size()) 669 { 602 { 670 G4cout <<"--------------------" <<G4en 603 G4cout <<"--------------------" <<G4endl; 671 G4cout <<"The target fragment:" <<G4en 604 G4cout <<"The target fragment:" <<G4endl; 672 G4cout <<"--------------------" <<G4en 605 G4cout <<"--------------------" <<G4endl; 673 G4cout <<" fragmentT = " <<particleNam 606 G4cout <<" fragmentT = " <<particleName 674 <<" Energy = " <<secondary-> 607 <<" Energy = " <<secondary->GetKineticEnergy() 675 <<G4endl; 608 <<G4endl; 676 } 609 } 677 } 610 } 678 delete products; << 679 } 611 } 680 612 681 if (verboseLevel >= 2) 613 if (verboseLevel >= 2) 682 G4cout <<"############################### 614 G4cout <<"########################################" 683 <<"############################### 615 <<"########################################" 684 <<G4endl; 616 <<G4endl; 685 617 686 delete theAbrasionGeometry; 618 delete theAbrasionGeometry; >> 619 687 return &theParticleChange; 620 return &theParticleChange; 688 } 621 } 689 ////////////////////////////////////////////// 622 //////////////////////////////////////////////////////////////////////////////// 690 // 623 // 691 G4Fragment *G4WilsonAbrasionModel::GetAbradedN 624 G4Fragment *G4WilsonAbrasionModel::GetAbradedNucleons (G4int Dabr, G4double A, 692 G4double Z, G4double r) 625 G4double Z, G4double r) 693 { 626 { 694 // 627 // 695 // 628 // 696 // Initialise variables. tau is the Fermi rad 629 // Initialise variables. tau is the Fermi radius of the nucleus. The variables 697 // p..., C... and gamma are used to help sampl << 630 // p..., C... and g(amma) are used to help sample the secondary nucleon 698 // spectrum. 631 // spectrum. 699 // 632 // 700 633 701 G4double pK = hbarc * G4Pow::GetInstance() << 634 G4double pK = hbarc * std::pow(9.0 * pi / 4.0 * A, third) / (1.29 * r); 702 if (A <= 24.0) pK *= -0.229*G4Pow::GetInstan << 635 if (A <= 24.0) pK *= -0.229*std::pow(A,third) + 1.62; 703 G4double pKsq = pK * pK; 636 G4double pKsq = pK * pK; 704 G4double p1sq = 2.0/5.0 * pKsq; 637 G4double p1sq = 2.0/5.0 * pKsq; 705 G4double p2sq = 6.0/5.0 * pKsq; 638 G4double p2sq = 6.0/5.0 * pKsq; 706 G4double p3sq = 500.0 * 500.0; 639 G4double p3sq = 500.0 * 500.0; 707 G4double C1 = 1.0; 640 G4double C1 = 1.0; 708 G4double C2 = 0.03; 641 G4double C2 = 0.03; 709 G4double C3 = 0.0002; 642 G4double C3 = 0.0002; 710 G4double gamma = 90.0 * MeV; << 643 G4double g = 90.0 * MeV; 711 G4double maxn = C1 + C2 + C3; 644 G4double maxn = C1 + C2 + C3; 712 // 645 // 713 // 646 // 714 // initialise the number of secondary nucleons 647 // initialise the number of secondary nucleons abraded to zero, and initially set 715 // the type of nucleon abraded to proton ... j 648 // the type of nucleon abraded to proton ... just for now. 716 // 649 // 717 G4double Aabr = 0.0; 650 G4double Aabr = 0.0; 718 G4double Zabr = 0.0; 651 G4double Zabr = 0.0; 719 G4ParticleDefinition *typeNucleon = G4Proton 652 G4ParticleDefinition *typeNucleon = G4Proton::ProtonDefinition(); 720 G4DynamicParticle *dynamicNucleon = nullptr; << 653 G4DynamicParticle *dynamicNucleon = NULL; 721 G4ParticleMomentum pabr(0.0, 0.0, 0.0); 654 G4ParticleMomentum pabr(0.0, 0.0, 0.0); 722 // 655 // 723 // 656 // 724 // Now go through each abraded nucleon and sam 657 // Now go through each abraded nucleon and sample type, spectrum and angle. 725 // 658 // 726 G4bool isForLoopExitAnticipated = false; << 659 for (G4int i=0; i<Dabr; i++) 727 for (G4int i=0; i<Dabr; ++i) << 728 { 660 { 729 // 661 // 730 // 662 // 731 // Sample the nucleon momentum distribution by 663 // Sample the nucleon momentum distribution by simple rejection techniques. We 732 // reject values of p == 0.0 since this causes 664 // reject values of p == 0.0 since this causes bad behaviour in the sinh term. 733 // 665 // 734 G4double p = 0.0; 666 G4double p = 0.0; 735 G4bool found = false; 667 G4bool found = false; 736 const G4int maxNumberOfLoops = 100000; << 668 while (!found) 737 G4int loopCounter = -1; << 738 while (!found && ++loopCounter < maxNumber << 739 { 669 { 740 while (p <= 0.0) p = npK * pK * G4Unifor << 670 while (p <= 0.0) p = npK * pK * G4UniformRand(); 741 G4double psq = p * p; 671 G4double psq = p * p; 742 found = maxn * G4UniformRand() < C1*G4Ex << 672 found = maxn * G4UniformRand() < C1*std::exp(-psq/p1sq/2.0) + 743 C2*G4Exp(-psq/p2sq/2.0) + C3*G4Exp(-ps << 673 C2*std::exp(-psq/p2sq/2.0) + C3*std::exp(-psq/p3sq/2.0) + p/g/std::sinh(p/g); 744 } << 745 if ( loopCounter >= maxNumberOfLoops ) << 746 { << 747 isForLoopExitAnticipated = true; << 748 break; << 749 } 674 } 750 // 675 // 751 // 676 // 752 // Determine the type of particle abraded. Ca 677 // Determine the type of particle abraded. Can only be proton or neutron, 753 // and the probability is determine to be prop 678 // and the probability is determine to be proportional to the ratio as found 754 // in the nucleus at each stage. 679 // in the nucleus at each stage. 755 // 680 // 756 G4double prob = (Z-Zabr)/(A-Aabr); 681 G4double prob = (Z-Zabr)/(A-Aabr); 757 if (G4UniformRand()<prob) 682 if (G4UniformRand()<prob) 758 { 683 { 759 Zabr++; 684 Zabr++; 760 typeNucleon = G4Proton::ProtonDefinition 685 typeNucleon = G4Proton::ProtonDefinition(); 761 } 686 } 762 else 687 else 763 typeNucleon = G4Neutron::NeutronDefiniti 688 typeNucleon = G4Neutron::NeutronDefinition(); 764 Aabr++; 689 Aabr++; 765 // 690 // 766 // 691 // 767 // The angular distribution of the secondary n 692 // The angular distribution of the secondary nucleons is approximated to an 768 // isotropic distribution in the rest frame of 693 // isotropic distribution in the rest frame of the nucleus (this will be Lorentz 769 // boosted later. 694 // boosted later. 770 // 695 // 771 G4double costheta = 2.*G4UniformRand()-1.0 696 G4double costheta = 2.*G4UniformRand()-1.0; 772 G4double sintheta = std::sqrt((1.0 - costh 697 G4double sintheta = std::sqrt((1.0 - costheta)*(1.0 + costheta)); 773 G4double phi = 2.0*pi*G4UniformRand() 698 G4double phi = 2.0*pi*G4UniformRand()*rad; 774 G4ThreeVector direction(sintheta*std::cos( 699 G4ThreeVector direction(sintheta*std::cos(phi),sintheta*std::sin(phi),costheta); 775 G4double nucleonMass = typeNucleon->GetPDG 700 G4double nucleonMass = typeNucleon->GetPDGMass(); 776 G4double E = std::sqrt(p*p + nuc 701 G4double E = std::sqrt(p*p + nucleonMass*nucleonMass)-nucleonMass; 777 dynamicNucleon = new G4DynamicParticle(typ 702 dynamicNucleon = new G4DynamicParticle(typeNucleon,direction,E); 778 theParticleChange.AddSecondary (dynamicNuc << 703 theParticleChange.AddSecondary (dynamicNucleon); 779 pabr += p*direction; 704 pabr += p*direction; 780 } 705 } 781 // 706 // 782 // 707 // 783 // Next determine the details of the nuclear p 708 // Next determine the details of the nuclear prefragment .. that is if there 784 // is one or more protons in the residue. (No 709 // is one or more protons in the residue. (Note that the 1 eV in the total 785 // energy is a safety factor to avoid any poss 710 // energy is a safety factor to avoid any possibility of negative rest mass 786 // energy.) 711 // energy.) 787 // 712 // 788 G4Fragment *fragment = nullptr; << 713 G4Fragment *fragment = NULL; 789 if ( ! isForLoopExitAnticipated && Z-Zabr>=1 << 714 if (Z-Zabr>=1.0) 790 { 715 { 791 G4double ionMass = G4ParticleTable::GetPar 716 G4double ionMass = G4ParticleTable::GetParticleTable()->GetIonTable()-> 792 GetIonMass(G4lrint(Z-Za 717 GetIonMass(G4lrint(Z-Zabr),G4lrint(A-Aabr)); 793 G4double E = std::sqrt(pabr.mag2() + 718 G4double E = std::sqrt(pabr.mag2() + ionMass*ionMass); 794 G4LorentzVector lorentzVector = G4LorentzV 719 G4LorentzVector lorentzVector = G4LorentzVector(-pabr, E + 1.0*eV); 795 fragment = 720 fragment = 796 new G4Fragment((G4int) (A-Aabr), (G4int) 721 new G4Fragment((G4int) (A-Aabr), (G4int) (Z-Zabr), lorentzVector); 797 } 722 } 798 723 799 return fragment; 724 return fragment; 800 } 725 } 801 ////////////////////////////////////////////// 726 //////////////////////////////////////////////////////////////////////////////// 802 // 727 // 803 G4double G4WilsonAbrasionModel::GetNucleonIndu 728 G4double G4WilsonAbrasionModel::GetNucleonInducedExcitation 804 (G4double rP, G4double rT, G4double r) 729 (G4double rP, G4double rT, G4double r) 805 { 730 { 806 // 731 // 807 // 732 // 808 // Initialise variables. 733 // Initialise variables. 809 // 734 // 810 G4double Cl = 0.0; 735 G4double Cl = 0.0; 811 G4double rPsq = rP * rP; 736 G4double rPsq = rP * rP; 812 G4double rTsq = rT * rT; 737 G4double rTsq = rT * rT; 813 G4double rsq = r * r; 738 G4double rsq = r * r; 814 // 739 // 815 // 740 // 816 // Depending upon the impact parameter, a diff 741 // Depending upon the impact parameter, a different form of the chord length is 817 // is used. 742 // is used. 818 // 743 // 819 if (r > rT) Cl = 2.0*std::sqrt(rPsq + 2.0*r* 744 if (r > rT) Cl = 2.0*std::sqrt(rPsq + 2.0*r*rT - rsq - rTsq); 820 else Cl = 2.0*rP; 745 else Cl = 2.0*rP; 821 // << 746 822 // << 747 G4double bP = (rPsq+rsq-rTsq)/2.0/r; 823 // The next lines have been changed to include << 748 G4double Ct = 2.0*std::sqrt(rPsq - bP*bP); 824 // projectile and target are too close, Ct is << 825 // Otherwise the standard Wilson algorithm sho << 826 // PRT 20091023. << 827 // << 828 G4double Ct = 0.0; << 829 if (rT > rP && rsq < rTsq - rPsq) Ct = << 830 else if (rP > rT && rsq < rPsq - rTsq) Ct = << 831 else { << 832 G4double bP = (rPsq+rsq-rTsq)/2.0/r; << 833 G4double x = rPsq - bP*bP; << 834 if (x < 0.0) { << 835 G4cerr <<"############################## << 836 <<"############################## << 837 <<G4endl; << 838 G4cerr <<"ERROR IN G4WilsonAbrasionModel << 839 <<G4endl; << 840 G4cerr <<"rPsq - bP*bP < 0.0 and cannot << 841 G4cerr <<"Set to zero instead" <<G4endl; << 842 G4cerr <<"############################## << 843 <<"############################## << 844 <<G4endl; << 845 } << 846 Ct = 2.0*std::sqrt(x); << 847 } << 848 749 849 G4double Ex = 13.0 * Cl / fermi; 750 G4double Ex = 13.0 * Cl / fermi; 850 if (Ct > 1.5*fermi) 751 if (Ct > 1.5*fermi) 851 Ex += 13.0 * Cl / fermi /3.0 * (Ct/fermi - 752 Ex += 13.0 * Cl / fermi /3.0 * (Ct/fermi - 1.5); 852 753 853 return Ex; 754 return Ex; 854 } 755 } 855 ////////////////////////////////////////////// 756 //////////////////////////////////////////////////////////////////////////////// 856 // 757 // 857 void G4WilsonAbrasionModel::SetUseAblation (G4 758 void G4WilsonAbrasionModel::SetUseAblation (G4bool useAblation1) 858 { 759 { 859 if (useAblation != useAblation1) 760 if (useAblation != useAblation1) 860 { 761 { 861 useAblation = useAblation1; 762 useAblation = useAblation1; >> 763 delete theExcitationHandler; >> 764 delete theExcitationHandlerx; >> 765 theExcitationHandler = new G4ExcitationHandler; >> 766 theExcitationHandlerx = new G4ExcitationHandler; 862 if (useAblation) 767 if (useAblation) 863 { 768 { 864 theAblation = new G4WilsonAblationModel; 769 theAblation = new G4WilsonAblationModel; 865 theAblation->SetVerboseLevel(verboseLeve 770 theAblation->SetVerboseLevel(verboseLevel); 866 theExcitationHandler->SetEvaporation(the 771 theExcitationHandler->SetEvaporation(theAblation); >> 772 theExcitationHandlerx->SetEvaporation(theAblation); 867 } 773 } 868 else 774 else 869 { 775 { 870 delete theExcitationHandler; << 776 theAblation = NULL; 871 theAblation = nullp << 777 G4Evaporation * theEvaporation = new G4Evaporation; 872 theExcitationHandler = new G4Excitation << 778 G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp; >> 779 G4StatMF * theMF = new G4StatMF; >> 780 theExcitationHandler->SetEvaporation(theEvaporation); >> 781 theExcitationHandler->SetFermiModel(theFermiBreakUp); >> 782 theExcitationHandler->SetMultiFragmentation(theMF); >> 783 theExcitationHandler->SetMaxAandZForFermiBreakUp(12, 6); >> 784 theExcitationHandler->SetMinEForMultiFrag(5.0*MeV); >> 785 >> 786 theEvaporation = new G4Evaporation; >> 787 theFermiBreakUp = new G4FermiBreakUp; >> 788 theExcitationHandlerx->SetEvaporation(theEvaporation); >> 789 theExcitationHandlerx->SetFermiModel(theFermiBreakUp); >> 790 theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6); 873 } 791 } 874 } 792 } 875 return; 793 return; 876 } 794 } 877 ////////////////////////////////////////////// 795 //////////////////////////////////////////////////////////////////////////////// 878 // 796 // 879 void G4WilsonAbrasionModel::PrintWelcomeMessag 797 void G4WilsonAbrasionModel::PrintWelcomeMessage () 880 { 798 { 881 G4cout <<G4endl; 799 G4cout <<G4endl; 882 G4cout <<" ********************************* 800 G4cout <<" *****************************************************************" 883 <<G4endl; 801 <<G4endl; 884 G4cout <<" Nuclear abrasion model for nuclea 802 G4cout <<" Nuclear abrasion model for nuclear-nuclear interactions activated" 885 <<G4endl; 803 <<G4endl; 886 G4cout <<" (Written by QinetiQ Ltd for the E 804 G4cout <<" (Written by QinetiQ Ltd for the European Space Agency)" 887 <<G4endl; 805 <<G4endl; 888 G4cout <<" ********************************* 806 G4cout <<" *****************************************************************" 889 <<G4endl; 807 <<G4endl; 890 G4cout << G4endl; 808 G4cout << G4endl; 891 809 892 return; 810 return; 893 } 811 } 894 ////////////////////////////////////////////// 812 //////////////////////////////////////////////////////////////////////////////// 895 // 813 // 896 814