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 ////////////////////////////////////////////// 26 //////////////////////////////////////////////////////////////////////////////// 27 // 27 // // 28 // File: G4ITDecay.cc 28 // File: G4ITDecay.cc // 29 // Author: D.H. Wright (SLAC) 29 // Author: D.H. Wright (SLAC) // 30 // Date: 14 November 2014 30 // Date: 14 November 2014 // 31 // 31 // // 32 ////////////////////////////////////////////// 32 //////////////////////////////////////////////////////////////////////////////// 33 33 34 #include "G4ITDecay.hh" 34 #include "G4ITDecay.hh" 35 #include "G4IonTable.hh" 35 #include "G4IonTable.hh" 36 #include "G4ThreeVector.hh" 36 #include "G4ThreeVector.hh" 37 #include "G4LorentzVector.hh" 37 #include "G4LorentzVector.hh" 38 #include "G4DynamicParticle.hh" 38 #include "G4DynamicParticle.hh" 39 #include "G4DecayProducts.hh" 39 #include "G4DecayProducts.hh" 40 #include "G4PhotonEvaporation.hh" 40 #include "G4PhotonEvaporation.hh" 41 #include "G4VAtomDeexcitation.hh" 41 #include "G4VAtomDeexcitation.hh" 42 #include "G4AtomicShells.hh" 42 #include "G4AtomicShells.hh" 43 #include "G4Electron.hh" 43 #include "G4Electron.hh" 44 #include "G4LossTableManager.hh" 44 #include "G4LossTableManager.hh" 45 #include "G4Fragment.hh" 45 #include "G4Fragment.hh" 46 #include "G4SystemOfUnits.hh" 46 #include "G4SystemOfUnits.hh" 47 #include "G4PhysicalConstants.hh" 47 #include "G4PhysicalConstants.hh" 48 48 49 49 50 G4ITDecay::G4ITDecay(G4PhotonEvaporation* ptr) << 51 : G4NuclearDecay("IT decay", IT, 0.0, noFloa << 52 {} << 53 << 54 G4ITDecay::G4ITDecay(const G4ParticleDefinitio 50 G4ITDecay::G4ITDecay(const G4ParticleDefinition* theParentNucleus, 55 const G4double& branch, c << 51 const G4double& branch, const G4double& Qvalue, 56 const G4double& excitatio 52 const G4double& excitationE) 57 : G4NuclearDecay("IT decay", IT, excitationE << 53 : G4NuclearDecay("IT decay", IT, excitationE), transitionQ(Qvalue), >> 54 applyARM(true) 58 { 55 { 59 SetParent(theParentNucleus); // Store name 56 SetParent(theParentNucleus); // Store name of parent nucleus, delete G4MT_parent 60 SetBR(branch); 57 SetBR(branch); 61 SetNumberOfDaughters(1); << 62 SetDaughter(0, theParentNucleus); << 63 << 64 SetupDecay(theParentNucleus); << 65 } << 66 58 67 void G4ITDecay::SetupDecay(const G4ParticleDef << 68 { << 69 theParent = theParentNucleus; << 70 parentZ = theParentNucleus->GetAtomicNumber( 59 parentZ = theParentNucleus->GetAtomicNumber(); 71 parentA = theParentNucleus->GetAtomicMass(); << 60 parentA = theParentNucleus->GetAtomicMass(); >> 61 >> 62 SetNumberOfDaughters(1); >> 63 G4IonTable* theIonTable = >> 64 (G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable()); >> 65 SetDaughter(0, theIonTable->GetIon(parentZ, parentA, excitationE) ); 72 } 66 } 73 67 >> 68 >> 69 G4ITDecay::~G4ITDecay() >> 70 {} >> 71 >> 72 74 G4DecayProducts* G4ITDecay::DecayIt(G4double) 73 G4DecayProducts* G4ITDecay::DecayIt(G4double) 75 { 74 { >> 75 // Fill G4MT_parent with theParentNucleus (stored by SetParent in ctor) >> 76 if (G4MT_parent == 0) FillParent(); >> 77 76 // Set up final state 78 // Set up final state 77 // parentParticle is set at rest here becaus 79 // parentParticle is set at rest here because boost with correct momentum 78 // is done later 80 // is done later 79 G4LorentzVector atRest(theParent->GetPDGMass << 81 G4LorentzVector atRest(G4MT_parent->GetPDGMass(), 80 G4DynamicParticle parentParticle(theParent, << 82 G4ThreeVector(0.,0.,0.) ); >> 83 G4DynamicParticle parentParticle(G4MT_parent, atRest); 81 G4DecayProducts* products = new G4DecayProdu 84 G4DecayProducts* products = new G4DecayProducts(parentParticle); 82 85 83 // Let G4PhotonEvaporation do the decay << 86 // Let G4PhotonEvaporation do the decay 84 G4Fragment parentNucleus(parentA, parentZ, a << 87 G4PhotonEvaporation* photoEvap = new G4PhotonEvaporation; 85 << 88 photoEvap->RDMForced(true); 86 // one emission, parent nucleaus become less << 89 photoEvap->SetICM(true); 87 G4Fragment* eOrGamma = photonEvaporation->Em << 90 88 << 91 G4Fragment* nucleus = new G4Fragment(parentA, parentZ, atRest); 89 // Modified nuclide is returned as dynDaught << 92 G4Fragment* eOrGamma = photoEvap->EmittedFragment(nucleus); 90 auto theIonTable = G4ParticleTable::GetParti << 93 >> 94 // Daughter nuclide is returned in nucleus pointer >> 95 G4double finalDaughterExcitation = nucleus->GetExcitationEnergy(); >> 96 if (finalDaughterExcitation < 1*keV) finalDaughterExcitation = 0.0; >> 97 G4LorentzVector daughterMomentum = nucleus->GetMomentum(); >> 98 G4IonTable* theIonTable = >> 99 (G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable() ); 91 G4ParticleDefinition* daughterIon = 100 G4ParticleDefinition* daughterIon = 92 theIonTable->GetIon(parentZ, parentA, pare << 101 theIonTable->GetIon(parentZ, parentA, finalDaughterExcitation); 93 G4Ions::FloatLevelBase << 94 G4DynamicParticle* dynDaughter = new G4Dynam 102 G4DynamicParticle* dynDaughter = new G4DynamicParticle(daughterIon, 95 << 103 daughterMomentum); >> 104 delete nucleus; 96 105 97 if (nullptr != eOrGamma) { << 106 if (eOrGamma) { 98 G4DynamicParticle* eOrGammaDyn = 107 G4DynamicParticle* eOrGammaDyn = 99 new G4DynamicParticle(eOrGamma->GetParti 108 new G4DynamicParticle(eOrGamma->GetParticleDefinition(), 100 eOrGamma->GetMomen 109 eOrGamma->GetMomentum() ); 101 eOrGammaDyn->SetProperTime(eOrGamma->GetCr 110 eOrGammaDyn->SetProperTime(eOrGamma->GetCreationTime() ); 102 products->PushProducts(eOrGammaDyn); 111 products->PushProducts(eOrGammaDyn); 103 delete eOrGamma; 112 delete eOrGamma; 104 113 105 // Now do atomic relaxation if e- is emitt << 114 // Now do atomic relaxation 106 if (applyARM) { 115 if (applyARM) { 107 G4int shellIndex = photonEvaporation->Ge << 116 G4int shellIndex = photoEvap->GetVacantShellNumber(); 108 if (shellIndex > -1) { 117 if (shellIndex > -1) { 109 G4VAtomDeexcitation* atomDeex = 118 G4VAtomDeexcitation* atomDeex = 110 G4LossTableManager::Instance()->Atom 119 G4LossTableManager::Instance()->AtomDeexcitation(); 111 if (atomDeex->IsFluoActive() && parent << 120 if (atomDeex->IsFluoActive() && parentZ > 5 && parentZ < 100) { 112 G4int nShells = G4AtomicShells::GetN 121 G4int nShells = G4AtomicShells::GetNumberOfShells(parentZ); 113 if (shellIndex >= nShells) shellInde 122 if (shellIndex >= nShells) shellIndex = nShells; 114 G4AtomicShellEnumerator as = G4Atomi 123 G4AtomicShellEnumerator as = G4AtomicShellEnumerator(shellIndex); 115 const G4AtomicShell* shell = atomDee 124 const G4AtomicShell* shell = atomDeex->GetAtomicShell(parentZ, as); 116 std::vector<G4DynamicParticle*> armP 125 std::vector<G4DynamicParticle*> armProducts; 117 126 118 // VI, SI 127 // VI, SI 119 // Allows fixing of Bugzilla 1727 128 // Allows fixing of Bugzilla 1727 >> 129 //const G4double deexLimit = 0.1*keV; 120 G4double deexLimit = 0.1*keV; 130 G4double deexLimit = 0.1*keV; 121 if (G4EmParameters::Instance()->Deex 131 if (G4EmParameters::Instance()->DeexcitationIgnoreCut()) deexLimit =0.; 122 // 132 // 123 133 124 atomDeex->GenerateParticles(&armProd 134 atomDeex->GenerateParticles(&armProducts, shell, parentZ, deexLimit, 125 135 deexLimit); 126 G4double productEnergy = 0.; 136 G4double productEnergy = 0.; 127 for (G4int i = 0; i < G4int(armProdu 137 for (G4int i = 0; i < G4int(armProducts.size()); i++) 128 productEnergy += armProducts[i]->G 138 productEnergy += armProducts[i]->GetKineticEnergy(); 129 139 130 G4double deficit = shell->BindingEne 140 G4double deficit = shell->BindingEnergy() - productEnergy; 131 if (deficit > 0.0) { 141 if (deficit > 0.0) { 132 // Add a dummy electron to make up 142 // Add a dummy electron to make up extra energy 133 G4double cosTh = 1.-2.*G4UniformRa 143 G4double cosTh = 1.-2.*G4UniformRand(); 134 G4double sinTh = std::sqrt(1.- cos 144 G4double sinTh = std::sqrt(1.- cosTh*cosTh); 135 G4double phi = twopi*G4UniformRand 145 G4double phi = twopi*G4UniformRand(); 136 146 137 G4ThreeVector electronDirection(si 147 G4ThreeVector electronDirection(sinTh*std::sin(phi), 138 si 148 sinTh*std::cos(phi), cosTh); 139 G4DynamicParticle* extra = 149 G4DynamicParticle* extra = 140 new G4DynamicParticle(G4Electron 150 new G4DynamicParticle(G4Electron::Electron(), electronDirection, 141 deficit); 151 deficit); 142 armProducts.push_back(extra); 152 armProducts.push_back(extra); 143 } 153 } 144 154 145 std::size_t nArm = armProducts.size( << 155 G4int nArm = armProducts.size(); 146 if (nArm > 0) { 156 if (nArm > 0) { 147 G4ThreeVector bst = dynDaughter->G 157 G4ThreeVector bst = dynDaughter->Get4Momentum().boostVector(); 148 for (std::size_t i = 0; i < nArm; << 158 for (G4int i = 0; i < nArm; ++i) { 149 G4DynamicParticle* dp = armProdu 159 G4DynamicParticle* dp = armProducts[i]; 150 G4LorentzVector lv = dp->Get4Mom 160 G4LorentzVector lv = dp->Get4Momentum().boost(bst); 151 dp->Set4Momentum(lv); 161 dp->Set4Momentum(lv); 152 products->PushProducts(dp); 162 products->PushProducts(dp); 153 } 163 } 154 } 164 } 155 } 165 } 156 } 166 } 157 } // if ARM on 167 } // if ARM on 158 } // eOrGamma 168 } // eOrGamma 159 169 160 products->PushProducts(dynDaughter); 170 products->PushProducts(dynDaughter); 161 171 162 // Energy conservation check 172 // Energy conservation check 163 /* 173 /* 164 G4int newSize = products->entries(); 174 G4int newSize = products->entries(); 165 G4DynamicParticle* temp = 0; 175 G4DynamicParticle* temp = 0; 166 G4double KEsum = 0.0; 176 G4double KEsum = 0.0; 167 for (G4int i = 0; i < newSize; i++) { 177 for (G4int i = 0; i < newSize; i++) { 168 temp = products->operator[](i); 178 temp = products->operator[](i); 169 KEsum += temp->GetKineticEnergy(); 179 KEsum += temp->GetKineticEnergy(); 170 } 180 } 171 G4double eCons = G4MT_parent->GetPDGMass() - 181 G4double eCons = G4MT_parent->GetPDGMass() - dynDaughter->GetMass() - KEsum; 172 G4cout << " IT check: Ediff (keV) = " << eCo 182 G4cout << " IT check: Ediff (keV) = " << eCons/keV << G4endl; 173 */ 183 */ >> 184 delete photoEvap; >> 185 174 return products; 186 return products; 175 } 187 } 176 188 177 189 178 void G4ITDecay::DumpNuclearInfo() 190 void G4ITDecay::DumpNuclearInfo() 179 { 191 { 180 if (theParent != nullptr) { << 192 G4cout << " G4ITDecay for parent nucleus " << GetParentName() << G4endl; 181 G4cout << " G4ITDecay for parent nucleus " << 193 G4cout << " decays to " << GetDaughterName(0) 182 } << 194 << " + gammas (or electrons), with branching ratio " << GetBR() >> 195 << "% and Q value " << transitionQ << G4endl; 183 } 196 } 184 197 185 198