Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // ABLAXX statistical de-excitation model 26 // ABLAXX statistical de-excitation model 27 // Jose Luis Rodriguez, UDC (translation from << 27 // Jose Luis Rodriguez, GSI (translation from ABLA07 and contact person) 28 // Pekka Kaitaniemi, HIP (initial translation 28 // Pekka Kaitaniemi, HIP (initial translation of ablav3p) 29 // Aleksandra Kelic, GSI (ABLA07 code) 29 // Aleksandra Kelic, GSI (ABLA07 code) 30 // Davide Mancusi, CEA (contact person INCL) 30 // Davide Mancusi, CEA (contact person INCL) 31 // Aatos Heikkinen, HIP (project coordination) 31 // Aatos Heikkinen, HIP (project coordination) 32 // 32 // 33 33 34 #include "globals.hh" 34 #include "globals.hh" 35 #include <cmath> << 36 #include <iostream> 35 #include <iostream> >> 36 #include <cmath> 37 37 38 #include "G4AblaInterface.hh" 38 #include "G4AblaInterface.hh" 39 #include "G4DoubleHyperDoubleNeutron.hh" << 39 #include "G4ParticleDefinition.hh" 40 #include "G4DoubleHyperH4.hh" << 40 #include "G4ReactionProductVector.hh" >> 41 #include "G4ReactionProduct.hh" 41 #include "G4DynamicParticle.hh" 42 #include "G4DynamicParticle.hh" 42 #include "G4ExcitationHandler.hh" << 43 #include "G4HyperAlpha.hh" << 44 #include "G4HyperH4.hh" << 45 #include "G4HyperHe5.hh" << 46 #include "G4HyperTriton.hh" << 47 #include "G4IonTable.hh" 43 #include "G4IonTable.hh" 48 #include "G4ParticleDefinition.hh" << 44 #include "G4SystemOfUnits.hh" 49 #include "G4PhysicalConstants.hh" 45 #include "G4PhysicalConstants.hh" 50 #include "G4PhysicsModelCatalog.hh" 46 #include "G4PhysicsModelCatalog.hh" 51 #include "G4ReactionProduct.hh" << 47 #include "G4ExcitationHandler.hh" 52 #include "G4ReactionProductVector.hh" << 48 #include "G4HyperTriton.hh" 53 #include "G4SystemOfUnits.hh" << 49 #include "G4HyperH4.hh" >> 50 #include "G4HyperAlpha.hh" >> 51 #include "G4DoubleHyperH4.hh" >> 52 #include "G4DoubleHyperDoubleNeutron.hh" >> 53 #include "G4HyperHe5.hh" 54 54 55 G4AblaInterface::G4AblaInterface(G4ExcitationH << 55 G4AblaInterface::G4AblaInterface(G4ExcitationHandler* ptr) : 56 : G4VPreCompoundModel(ptr, "ABLAXX") << 56 G4VPreCompoundModel(ptr, "ABLAXX"), 57 , ablaResult(new G4VarNtp) << 57 ablaResult(new G4VarNtp), 58 , theABLAModel(new G4Abla(ablaResult)) << 58 volant(new G4Volant), 59 , eventNumber(0) << 59 theABLAModel(new G4Abla(volant, ablaResult)), 60 , secID(-1) << 60 eventNumber(0), 61 , isInitialised(false) << 61 secID(-1), 62 { << 62 isInitialised(false) 63 secID = G4PhysicsModelCatalog::GetModelID( << 63 { 64 // G4cout << "### NEW PrecompoundModel " < << 64 secID = G4PhysicsModelCatalog::GetModelID("model_" + GetModelName()); 65 if (!ptr) << 65 // G4cout << "### NEW PrecompoundModel " << this << G4endl; 66 SetExcitationHandler(new G4ExcitationH << 66 if (!ptr) SetExcitationHandler(new G4ExcitationHandler); 67 InitialiseModel(); << 67 InitialiseModel(); 68 G4cout << G4endl << "G4AblaInterface::Init << 68 G4cout << G4endl << "G4AblaInterface::InitialiseModel() was right." << G4endl; 69 } 69 } 70 70 71 G4AblaInterface::~G4AblaInterface() 71 G4AblaInterface::~G4AblaInterface() 72 { 72 { 73 applyYourselfResult.Clear(); << 73 delete volant; 74 delete ablaResult; << 74 delete ablaResult; 75 delete theABLAModel; << 75 delete theABLAModel; 76 delete GetExcitationHandler(); << 76 delete GetExcitationHandler(); 77 } 77 } 78 78 79 void G4AblaInterface::BuildPhysicsTable(const << 79 void G4AblaInterface::BuildPhysicsTable(const G4ParticleDefinition&) 80 << 81 void G4AblaInterface::InitialiseModel() << 82 { 80 { 83 if (isInitialised) << 81 InitialiseModel(); 84 return; << 85 isInitialised = true; << 86 theABLAModel->initEvapora(); << 87 theABLAModel->SetParameters(); << 88 GetExcitationHandler()->Initialise(); << 89 } 82 } 90 83 91 G4HadFinalState* G4AblaInterface::ApplyYoursel << 84 void G4AblaInterface::InitialiseModel() 92 { 85 { 93 // This method is adapted from G4PreCompo << 86 if (isInitialised) return; 94 // and it is used only by Binary Cascade ( << 87 isInitialised = true; 95 // Abla for nuclear de-excitation. This me << 88 theABLAModel->initEvapora(); 96 // for proton and neutron projectile with << 89 theABLAModel->SetParameters(); 97 // creating a "compound" nucleus made by t << 90 GetExcitationHandler()->Initialise(); 98 // projectile", before calling the DeExcit << 91 } 99 const G4ParticleDefinition* primary = theP << 92 100 if (primary != G4Neutron::Definition() && << 93 G4ReactionProductVector *G4AblaInterface::DeExcite(G4Fragment& aFragment) { 101 { << 94 if (!isInitialised) InitialiseModel(); 102 G4ExceptionDescription ed; << 95 103 ed << "G4AblaModel is used for "; << 96 volant->clear(); 104 if (primary) << 97 ablaResult->clear(); 105 ed << primary->GetParticleName(); << 98 106 G4Exception("G4AblaInterface::ApplyYou << 99 const G4int ARem = aFragment.GetA_asInt(); 107 return nullptr; << 100 const G4int ZRem = aFragment.GetZ_asInt(); 108 } << 101 const G4int SRem = -aFragment.GetNumberOfLambdas(); // Strangeness = - (Number of lambdas) 109 << 102 const G4double eStarRem = aFragment.GetExcitationEnergy() / MeV; 110 G4int Zp = 0; << 103 const G4double jRem = aFragment.GetAngularMomentum().mag() / hbar_Planck; 111 G4int Ap = 1; << 104 const G4LorentzVector& pRem = aFragment.GetMomentum(); 112 if (primary == G4Proton::Definition()) << 105 const G4double pxRem = pRem.x() / MeV; 113 Zp = 1; << 106 const G4double pyRem = pRem.y() / MeV; 114 G4double timePrimary = thePrimary.GetGloba << 107 const G4double pzRem = pRem.z() / MeV; 115 G4int A = theNucleus.GetA_asInt(); << 108 116 G4int Z = theNucleus.GetZ_asInt(); << 109 ++eventNumber; 117 G4LorentzVector p = thePrimary.Get4Momentu << 110 118 G4double mass = G4NucleiProperties::GetNuc << 111 theABLAModel->DeexcitationAblaxx(ARem, ZRem, eStarRem, jRem, pxRem, pyRem, 119 p += G4LorentzVector(0.0, 0.0, 0.0, mass); << 112 pzRem, (G4int)eventNumber, SRem); 120 << 113 121 G4Fragment anInitialState(A + Ap, Z + Zp, << 114 G4ReactionProductVector* result = new G4ReactionProductVector; 122 anInitialState.SetNumberOfExcitedParticle( << 115 123 anInitialState.SetNumberOfHoles(1, Zp); << 116 for(G4int j = 0; j < ablaResult->ntrack; ++j) 124 anInitialState.SetCreationTime(thePrimary. << 117 { // Copy ABLA result to the EventInfo 125 anInitialState.SetCreatorModelID(secID); << 118 G4ReactionProduct* product = 126 << 119 toG4Particle(ablaResult->avv[j], ablaResult->zvv[j], ablaResult->svv[j], 127 G4ReactionProductVector* deExciteResult = << 120 ablaResult->enerj[j], ablaResult->pxlab[j], 128 << 121 ablaResult->pylab[j], ablaResult->pzlab[j]); 129 applyYourselfResult.Clear(); << 122 if(product) 130 applyYourselfResult.SetStatusChange(stopAn << 131 for (auto const& prod : *deExciteResult) << 132 { 123 { 133 G4DynamicParticle* aNewDP = << 124 product->SetCreatorModelID(secID); 134 new G4DynamicParticle(prod->GetDef << 125 result->push_back(product); 135 G4HadSecondary aNew = G4HadSecondary(a << 136 G4double time = std::max(prod->GetForm << 137 aNew.SetTime(timePrimary + time); << 138 aNew.SetCreatorModelID(prod->GetCreato << 139 delete prod; << 140 applyYourselfResult.AddSecondary(aNew) << 141 } 126 } 142 delete deExciteResult; << 127 } 143 return &applyYourselfResult; << 128 return result; 144 } 129 } 145 130 146 G4ReactionProductVector* G4AblaInterface::DeEx << 131 G4ParticleDefinition *G4AblaInterface::toG4ParticleDefinition(G4int A, G4int Z, G4int S) const { 147 { << 132 if (A == 1 && Z == 1 && S == 0 ) return G4Proton::Proton(); 148 if (!isInitialised) << 133 else if(A == 1 && Z == 0 && S == 0 ) return G4Neutron::Neutron(); 149 InitialiseModel(); << 134 else if(A == 1 && Z == 0 && S == -1) return G4Lambda::Lambda(); 150 << 135 else if(A == -1 && Z == 1 && S == 0 ) return G4PionPlus::PionPlus(); 151 ablaResult->clear(); << 136 else if(A == -1 && Z == -1 && S == 0 ) return G4PionMinus::PionMinus(); 152 << 137 else if(A == -1 && Z == 0 && S == 0 ) return G4PionZero::PionZero(); 153 const G4int ARem = aFragment.GetA_asInt(); << 138 else if(A == 0 && Z == 0 && S == 0 ) return G4Gamma::Gamma(); 154 const G4int ZRem = aFragment.GetZ_asInt(); << 139 else if(A == 2 && Z == 1 && S == 0 ) return G4Deuteron::Deuteron(); 155 const G4int SRem = -aFragment.GetNumberOfL << 140 else if(A == 3 && Z == 1 && S == 0 ) return G4Triton::Triton(); 156 const G4double eStarRem = aFragment.GetExc << 141 else if(A == 3 && Z == 2 && S == 0 ) return G4He3::He3(); 157 const G4double jRem = aFragment.GetAngular << 142 else if(A == 3 && Z == 1 && S == -1) return G4HyperTriton::Definition(); 158 const G4LorentzVector& pRem = aFragment.Ge << 143 else if(A == 4 && Z == 2 && S == 0 ) return G4Alpha::Alpha(); 159 const G4double pxRem = pRem.x() / MeV; << 144 else if(A == 4 && Z == 1 && S == -1) return G4HyperH4::Definition(); 160 const G4double pyRem = pRem.y() / MeV; << 145 else if(A == 4 && Z == 2 && S == -1) return G4HyperAlpha::Definition(); 161 const G4double pzRem = pRem.z() / MeV; << 146 else if(A == 4 && Z == 1 && S == -2) return G4DoubleHyperH4::Definition(); 162 << 147 else if(A == 4 && Z == 0 && S == -2) return G4DoubleHyperDoubleNeutron::Definition(); 163 ++eventNumber; << 148 else if(A == 5 && Z == 2 && S == -1) return G4HyperHe5::Definition(); 164 << 149 else if(A > 0 && Z > 0 && A > Z ) 165 theABLAModel->DeexcitationAblaxx(ARem, ZRe << 150 { // Returns ground state ion definition. 166 << 151 auto ionfromtable = G4IonTable::GetIonTable()->GetIon(Z, A, std::abs(S), 0); // S is the number of lambdas 167 G4ReactionProductVector* result = new G4Re << 152 if(ionfromtable) 168 << 153 return ionfromtable; 169 for (G4int j = 0; j < ablaResult->ntrack; << 170 { // Copy ABLA result to the EventInfo << 171 G4ReactionProduct* product = toG4Parti << 172 << 173 << 174 << 175 << 176 << 177 << 178 if (product) << 179 { << 180 product->SetCreatorModelID(secID); << 181 result->push_back(product); << 182 } << 183 } << 184 return result; << 185 } << 186 << 187 G4ParticleDefinition* G4AblaInterface::toG4Par << 188 { << 189 if (A == 1 && Z == 1 && S == 0) << 190 return G4Proton::Proton(); << 191 else if (A == 1 && Z == 0 && S == 0) << 192 return G4Neutron::Neutron(); << 193 else if (A == 1 && Z == 0 && S == -1) << 194 return G4Lambda::Lambda(); << 195 else if (A == -1 && Z == 1 && S == 0) << 196 return G4PionPlus::PionPlus(); << 197 else if (A == -1 && Z == -1 && S == 0) << 198 return G4PionMinus::PionMinus(); << 199 else if (A == -1 && Z == 0 && S == 0) << 200 return G4PionZero::PionZero(); << 201 else if (A == 0 && Z == 0 && S == 0) << 202 return G4Gamma::Gamma(); << 203 else if (A == 2 && Z == 1 && S == 0) << 204 return G4Deuteron::Deuteron(); << 205 else if (A == 3 && Z == 1 && S == 0) << 206 return G4Triton::Triton(); << 207 else if (A == 3 && Z == 2 && S == 0) << 208 return G4He3::He3(); << 209 else if (A == 3 && Z == 1 && S == -1) << 210 return G4HyperTriton::Definition(); << 211 else if (A == 4 && Z == 2 && S == 0) << 212 return G4Alpha::Alpha(); << 213 else if (A == 4 && Z == 1 && S == -1) << 214 return G4HyperH4::Definition(); << 215 else if (A == 4 && Z == 2 && S == -1) << 216 return G4HyperAlpha::Definition(); << 217 else if (A == 4 && Z == 1 && S == -2) << 218 return G4DoubleHyperH4::Definition(); << 219 else if (A == 4 && Z == 0 && S == -2) << 220 return G4DoubleHyperDoubleNeutron::Def << 221 else if (A == 5 && Z == 2 && S == -1) << 222 return G4HyperHe5::Definition(); << 223 else if (A > 0 && Z > 0 && A > Z) << 224 { // Returns ground state ion definition. << 225 auto ionfromtable = G4IonTable::GetIon << 226 if (ionfromtable) << 227 return ionfromtable; << 228 else << 229 { << 230 G4cout << "Can't convert particle << 231 << " to G4ParticleDefinitio << 232 return 0; << 233 } << 234 } << 235 else 154 else 236 { // Error, unrecognized particle << 155 { 237 G4cout << "Can't convert particle with << 156 G4cout << "Can't convert particle with A=" << A << ", Z=" << Z << ", S=" << S 238 << " to G4ParticleDefinition, t << 157 << " to G4ParticleDefinition, trouble ahead" << G4endl; 239 return 0; << 158 return 0; 240 } << 159 } 241 } << 160 } 242 << 161 else 243 G4ReactionProduct* << 162 { // Error, unrecognized particle 244 G4AblaInterface::toG4Particle(G4int A, G4i << 163 G4cout << "Can't convert particle with A=" << A << ", Z=" << Z << ", S=" << S 245 { << 164 << " to G4ParticleDefinition, trouble ahead" << G4endl; 246 G4ParticleDefinition* def = toG4ParticleDe << 165 return 0; 247 if (def == 0) << 166 } 248 { // Check if we have a valid particle def << 167 } 249 return 0; << 168 250 } << 169 G4ReactionProduct* G4AblaInterface::toG4Particle(G4int A, G4int Z, G4int S, 251 << 170 G4double kinE, G4double px, 252 const G4double energy = kinE * MeV; << 171 G4double py, G4double pz) const { 253 const G4ThreeVector momentum(px, py, pz); << 172 G4ParticleDefinition* def = toG4ParticleDefinition(A, Z, S); 254 const G4ThreeVector momentumDirection = mo << 173 if(def == 0) 255 G4DynamicParticle p(def, momentumDirection << 174 { // Check if we have a valid particle definition 256 G4ReactionProduct* r = new G4ReactionProdu << 175 return 0; 257 (*r) = p; << 176 } 258 return r; << 177 >> 178 const G4double energy = kinE * MeV; >> 179 const G4ThreeVector momentum(px, py, pz); >> 180 const G4ThreeVector momentumDirection = momentum.unit(); >> 181 G4DynamicParticle p(def, momentumDirection, energy); >> 182 G4ReactionProduct* r = new G4ReactionProduct(def); >> 183 (*r) = p; >> 184 return r; 259 } 185 } 260 186 261 void G4AblaInterface::ModelDescription(std::os 187 void G4AblaInterface::ModelDescription(std::ostream& outFile) const 262 { 188 { 263 outFile << "ABLA++ does not provide an imp << 189 outFile << "ABLA++ does not provide an implementation of the ApplyYourself method!\n\n"; 264 "method!\n\n"; << 265 } 190 } 266 191 267 void G4AblaInterface::DeExciteModelDescription 192 void G4AblaInterface::DeExciteModelDescription(std::ostream& outFile) const 268 { 193 { 269 outFile << "ABLA++ is a statistical model << 194 outFile 270 << "the gamma emission and the eva << 195 << "ABLA++ is a statistical model for nuclear de-excitation. It simulates\n" 271 << "particles and IMFs, as well as << 196 << "the gamma emission and the evaporation of neutrons, light charged\n" 272 << "included in Geant4 is a C++ tr << 197 << "particles and IMFs, as well as fission where applicable. The code\n" 273 << "code ABLA07. Although the mode << 198 << "included in Geant4 is a C++ translation of the original Fortran\n" 274 << "hypernuclei by including the e << 199 << "code ABLA07. Although the model has been recently extended to\n" 275 << "More details about the physics << 200 << "hypernuclei by including the evaporation of lambda particles.\n" 276 << "Physics Reference Manual and i << 201 << "More details about the physics are available in the Geant4\n" 277 << "References:\n" << 202 << "Physics Reference Manual and in the reference articles.\n\n" 278 << "(1) A. Kelic, M. V. Ricciardi, << 203 << "References:\n" 279 << "ICTP-IAEA Advanced Workshop on << 204 << "(1) A. Kelic, M. V. Ricciardi, and K. H. Schmidt, in Proceedings of " 280 << "ICTP Trieste, Italy, 4–8 Feb << 205 "Joint\n" 281 "Leray, Y. Yariv, A. Mengoni, A << 206 << "ICTP-IAEA Advanced Workshop on Model Codes for Spallation Reactions,\n" 282 "INDC(NDS)-530, Vienna, 2008), << 207 << "ICTP Trieste, Italy, 4–8 February 2008, edited by D. Filges, S. Leray, " 283 << "(2) J.L. Rodriguez-Sanchez, J. << 208 "Y. Yariv,\n" 284 << "(3) J.L. Rodriguez-Sanchez et << 209 << "A. Mengoni, A. Stanculescu, and G. Mank (IAEA INDC(NDS)-530, Vienna, " 285 << "(4) J.L. Rodriguez-Sanchez et << 210 "2008), pp. 181–221.\n\n" >> 211 << "(2) J.L. Rodriguez-Sanchez, J.-C. David et al., Phys. Rev. C 98, " >> 212 "021602 (2018)\n\n"; 286 } 213 } >> 214 287 215