Changeset 1347 for trunk/source/processes/hadronic/models/neutron_hp/src
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/processes/hadronic/models/neutron_hp/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPCaptureFS.cc
r962 r1347 31 31 // 26-January-07 Add G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION flag 32 32 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 33 // 101203 Bugzilla/Geant4 Problem 1155 Lack of residual in some case 33 34 // 34 35 #include "G4NeutronHPCaptureFS.hh" … … 43 44 G4HadFinalState * G4NeutronHPCaptureFS::ApplyYourself(const G4HadProjectile & theTrack) 44 45 { 46 45 47 G4int i; 46 48 theResult.Clear(); … … 108 110 } 109 111 112 113 110 114 // add them to the final state 111 115 … … 114 118 G4int nParticles = nPhotons; 115 119 if(1==nPhotons) nParticles = 2; 120 121 122 //Make at least one photon 123 //101203 TK 124 if ( nPhotons == 0 ) 125 { 126 G4ReactionProduct * theOne = new G4ReactionProduct; 127 theOne->SetDefinition( G4Gamma::Gamma() ); 128 G4double theta = pi*G4UniformRand(); 129 G4double phi = twopi*G4UniformRand(); 130 G4double sinth = std::sin(theta); 131 G4ThreeVector direction( sinth*std::cos(phi), sinth*std::sin(phi), std::cos(theta) ); 132 theOne->SetMomentum( direction ) ; 133 thePhotons->push_back(theOne); 134 nPhotons++; // 0 -> 1 135 } 136 //One photon case: energy set to Q-value 137 //101203 TK 138 if ( nPhotons == 1 ) 139 { 140 G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit(); 141 G4double Q = G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0, static_cast<G4int>(theBaseZ))->GetPDGMass() + G4Neutron::Neutron()->GetPDGMass() 142 - G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ))->GetPDGMass(); 143 thePhotons->operator[](0)->SetMomentum( Q*direction ); 144 } 145 // 116 146 117 147 // back to lab system … … 156 186 } 157 187 delete thePhotons; 188 189 //101203TK 190 G4bool residual = false; 191 G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable() 192 ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ)); 193 for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ ) 194 { 195 if ( theResult.GetSecondary(i)->GetParticle()->GetDefinition() == aRecoil ) residual = true; 196 } 197 198 if ( residual == false ) 199 { 200 G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable() 201 ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ)); 202 G4int nNonZero = 0; 203 G4LorentzVector p_photons(0,0,0,0); 204 for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ ) 205 { 206 p_photons += theResult.GetSecondary(i)->GetParticle()->Get4Momentum(); 207 // To many 0 momentum photons -> Check PhotonDist 208 if ( theResult.GetSecondary(i)->GetParticle()->Get4Momentum() > 0 ) nNonZero++; 209 } 210 211 // Can we include kinetic energy here? 212 G4double deltaE = ( theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy() ) 213 - ( p_photons.e() + aRecoil->GetPDGMass() ); 214 215 //Add photons 216 if ( nPhotons - nNonZero > 0 ) 217 { 218 //G4cout << "TKDB G4NeutronHPCaptureFS::ApplyYourself we will create additional " << nPhotons - nNonZero << " photons" << G4endl; 219 std::vector<G4double> vRand; 220 vRand.push_back( 0.0 ); 221 for ( G4int i = 0 ; i != nPhotons - nNonZero - 1 ; i++ ) 222 { 223 vRand.push_back( G4UniformRand() ); 224 } 225 vRand.push_back( 1.0 ); 226 std::sort( vRand.begin(), vRand.end() ); 227 228 std::vector<G4double> vEPhoton; 229 for ( G4int i = 0 ; i < (G4int)vRand.size() - 1 ; i++ ) 230 { 231 vEPhoton.push_back( deltaE * ( vRand[i+1] - vRand[i] ) ); 232 } 233 std::sort( vEPhoton.begin(), vEPhoton.end() ); 234 235 for ( G4int i = 0 ; i < nPhotons - nNonZero - 1 ; i++ ) 236 { 237 //Isotopic in LAB OK? 238 G4double theta = pi*G4UniformRand(); 239 G4double phi = twopi*G4UniformRand(); 240 G4double sinth = std::sin(theta); 241 G4double en = vEPhoton[i]; 242 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) ); 243 244 p_photons += G4LorentzVector ( tempVector, tempVector.mag() ); 245 G4DynamicParticle * theOne = new G4DynamicParticle; 246 theOne->SetDefinition( G4Gamma::Gamma() ); 247 theOne->SetMomentum( tempVector ); 248 theResult.AddSecondary(theOne); 249 } 250 251 // Add last photon 252 G4DynamicParticle * theOne = new G4DynamicParticle; 253 theOne->SetDefinition( G4Gamma::Gamma() ); 254 // For better momentum conservation 255 G4ThreeVector lastPhoton = -p_photons.vect().unit()*vEPhoton.back(); 256 p_photons += G4LorentzVector( lastPhoton , lastPhoton.mag() ); 257 theOne->SetMomentum( lastPhoton ); 258 theResult.AddSecondary(theOne); 259 } 260 261 //Add residual 262 G4DynamicParticle * theOne = new G4DynamicParticle; 263 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum() 264 - p_photons.vect(); 265 theOne->SetDefinition(aRecoil); 266 theOne->SetMomentum( aMomentum ); 267 theResult.AddSecondary(theOne); 268 269 } 270 //101203TK END 271 158 272 // clean up the primary neutron 159 273 theResult.SetStatusChange(stopAndKill); -
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPDiscreteTwoBody.cc
r962 r1347 30 30 //080612 Bug fix contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #2,3 31 31 //080709 Bug fix Sampling Legendre expansion by T. Koi 32 //101110 Bug fix in MF=6, LAW=2 case; contribution from E. Mendoza, D. Cano-Ott (CIEMAT) 32 33 // 33 34 #include "G4NeutronHPDiscreteTwoBody.hh" … … 111 112 for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++) 112 113 { 113 theStore.SetX(i, theCoeff[it].GetCoeff(i)); 114 theStore.SetY(i, theCoeff[it].GetCoeff(i)); 114 //101110 115 //theStore.SetX(i, theCoeff[it].GetCoeff(i)); 116 //theStore.SetY(i, theCoeff[it].GetCoeff(i)); 117 theStore.SetX(i/2, theCoeff[it].GetCoeff(i)); 118 theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1)); 115 119 i++; 116 120 } … … 125 129 for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++) 126 130 { 127 theStore.SetX(i, theCoeff[it].GetCoeff(i)); 128 theStore.SetY(i, theCoeff[it].GetCoeff(i)); 131 //101110 132 //theStore.SetX(i, theCoeff[it].GetCoeff(i)); 133 //theStore.SetY(i, theCoeff[it].GetCoeff(i)); 134 theStore.SetX(i/2, theCoeff[it].GetCoeff(i)); 135 theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1)); 129 136 i++; 130 137 } … … 161 168 for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++) 162 169 { 163 theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i)); 164 theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i)); 170 //101110 171 //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i)); 172 //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i)); 173 theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i)); 174 theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1)); 165 175 i++; 166 176 } … … 171 181 for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++) 172 182 { 183 //theBuff2.SetX(i, theCoeff[it].GetCoeff(i)); 184 //theBuff2.SetY(i, theCoeff[it].GetCoeff(i)); 173 185 theBuff2.SetX(i, theCoeff[it].GetCoeff(i)); 174 theBuff2.SetY(i, theCoeff[it].GetCoeff(i ));186 theBuff2.SetY(i, theCoeff[it].GetCoeff(i+1)); 175 187 i++; 176 188 } … … 215 227 for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++) 216 228 { 217 theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i)); 218 theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i)); 229 //101110 230 //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i)); 231 //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i)); 232 theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i)); 233 theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1)); 219 234 i++; 220 235 } … … 226 241 for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++) 227 242 { 228 theBuff2.SetX(i, theCoeff[it].GetCoeff(i)); 229 theBuff2.SetY(i, theCoeff[it].GetCoeff(i)); 243 //101110 244 //theBuff2.SetX(i, theCoeff[it].GetCoeff(i)); 245 //theBuff2.SetY(i, theCoeff[it].GetCoeff(i)); 246 theBuff2.SetX(i/2, theCoeff[it].GetCoeff(i)); 247 theBuff2.SetY(i/2, theCoeff[it].GetCoeff(i+1)); 230 248 i++; 231 249 } -
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPFinalState.cc
r968 r1347 27 27 //080721 Create adjust_final_state method by T. Koi 28 28 //080801 Residual reconstruction with theNDLDataA,Z (A, Z, and momentum are adjusted) by T. Koi 29 //101110 Set lower limit for gamma energy(1keV) by T. Koi 29 30 30 31 #include "G4NeutronHPFinalState.hh" … … 37 38 void G4NeutronHPFinalState::adjust_final_state ( G4LorentzVector init_4p_lab ) 38 39 { 40 41 G4double minimum_energy = 1*keV; 39 42 40 43 if ( adjustResult != true ) return; … … 175 178 176 179 // Adjust p 177 if ( dif_4p.v().mag() < 1*MeV ) 180 //if ( dif_4p.v().mag() < 1*MeV ) 181 if ( minimum_energy < dif_4p.v().mag() && dif_4p.v().mag() < 1*MeV ) 178 182 { 179 183 … … 184 188 else 185 189 { 186 //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) to adjust, so that give up tuning" << G4endl;190 //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) or too small(<1keV) to adjust, so that give up tuning" << G4endl; 187 191 } 188 192 … … 213 217 nSecondaries += 2; 214 218 G4double e1 = ( dif_4p.e() -dif_4p.v().mag() ) / 2; 215 G4double costh = 2.*G4UniformRand()-1.; 216 G4double phi = twopi*G4UniformRand(); 217 G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi), 218 std::sin(std::acos(costh))*std::sin(phi), 219 costh); 220 theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) ); 221 theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) ); 219 220 if ( minimum_energy < e1 ) 221 { 222 G4double costh = 2.*G4UniformRand()-1.; 223 G4double phi = twopi*G4UniformRand(); 224 G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi), 225 std::sin(std::acos(costh))*std::sin(phi), 226 costh); 227 theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) ); 228 theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) ); 229 } 230 else 231 { 232 //G4cout << "HP_DB Difference is too small(<1keV) to adjust, so that neglect it" << G4endl; 233 } 222 234 223 235 } -
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticBaseFS.cc
r962 r1347 31 31 // Introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi 32 32 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 33 // 101111 Add Special treatment for Be9(n,2n)Be8(2a) case by T. Koi 33 34 // 34 35 #include "G4NeutronHPInelasticBaseFS.hh" … … 360 361 else if(theEnergyAngData!=0) 361 362 { 363 362 364 G4double theGammaEnergy = theEnergyAngData->GetTotalMeanEnergy(); 363 365 G4double anEnergy = boosted.GetKineticEnergy(); … … 371 373 G4double eBindHe3 = G4NucleiProperties::GetBindingEnergy(3,2); 372 374 G4double eBindA = G4NucleiProperties::GetBindingEnergy(4,2); 375 G4int ia=0; 373 376 for(i=0; i<tmpHadrons->size(); i++) 374 377 { … … 396 399 { 397 400 eBindProducts+=eBindA; 398 } 399 } 401 ia++; 402 } 403 } 404 400 405 theGammaEnergy += eBindProducts; 406 407 //101111 408 //Special treatment for Be9 + n -> 2n + Be8 -> 2n + a + a 409 if ( (G4int)(theBaseZ+eps) == 4 && (G4int)(theBaseA+eps) == 9 ) 410 { 411 // This only valid for G4NDL3.13,,, 412 if ( std::abs( theNuclearMassDifference - 413 ( G4NucleiProperties::GetBindingEnergy( 8 , 4 ) - 414 G4NucleiProperties::GetBindingEnergy( 9 , 4 ) ) ) < 1*keV 415 && ia == 2 ) 416 { 417 theGammaEnergy -= (2*eBindA); 418 } 419 } 401 420 402 421 G4ReactionProductVector * theOtherPhotons = 0; -
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc
r1340 r1347 41 41 // add two_body_reaction 42 42 // 100909 add safty 43 // 101111 add safty for _nat_ data case in Binary reaction, but break conservation 43 44 // 44 45 #include "G4NeutronHPInelasticCompFS.hh" … … 681 682 G4double AA = hadron->GetDefinition()->GetPDGMass() / proj->GetDefinition()->GetPDGMass(); 682 683 G4double E1 = proj->GetKineticEnergy(); 683 G4double beta = std::sqrt ( A*(A+1-AA)/AA*(1+(1+A)/A*Q/E1) ); 684 685 // 101111 686 // In _nat_ data (Q+E1) could become negative value, following line is safty for this case. 687 //if ( (Q+E1) < 0 ) 688 if ( ( 1 + (1+A)/A*Q/E1 ) < 0 ) 689 { 690 // 1.0e-6 eV is additional safty for numeric precision 691 Q = -( A/(1+A)*E1 ) + 1.0e-6*eV; 692 } 693 694 G4double beta = std::sqrt ( A*(A+1-AA)/AA*( 1 + (1+A)/A*Q/E1 ) ); 684 695 G4double gamma = AA/(A+1-AA)*beta; 685 696 G4double E3 = AA/std::pow((1+A),2)*(beta*beta+1+2*beta*mu)*E1; -
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPPhotonDist.cc
r1055 r1347 39 39 // Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu) 40 40 // But it looks like never cause real effect in G4NDL3.13 (at least Natural elements) TK 41 // 101111 Change warning message for "repFlag == 2 && isoFlag != 1" case 41 42 // 42 43 // there is a lot of unused (and undebugged) code in this file. Kept for the moment just in case. @@ … … 124 125 if (isoFlag != 1) 125 126 { 126 if ( repFlag == 2 ) G4cout << " TKDB repFlag == 2 && isoFlag !=1" << G4endl;127 if ( repFlag == 2 ) G4cout << "G4NeutronHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." << G4endl; 127 128 aDataFile >> tabulationType >> nDiscrete2 >> nIso; 128 129 //080731
Note: See TracChangeset
for help on using the changeset viewer.