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