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