// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // neutron_hp -- source file // J.P. Wellisch, Nov-1996 // A prototype of the low energy neutron transport model. // //080612 Bug fix contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #2,3 //080709 Bug fix Sampling Legendre expansion by T. Koi //101110 Bug fix in MF=6, LAW=2 case; contribution from E. Mendoza, D. Cano-Ott (CIEMAT) // #include "G4NeutronHPDiscreteTwoBody.hh" #include "G4Gamma.hh" #include "G4Electron.hh" #include "G4Positron.hh" #include "G4Neutron.hh" #include "G4Proton.hh" #include "G4Deuteron.hh" #include "G4Triton.hh" #include "G4He3.hh" #include "G4Alpha.hh" #include "G4NeutronHPVector.hh" #include "G4NeutronHPLegendreStore.hh" G4ReactionProduct * G4NeutronHPDiscreteTwoBody::Sample(G4double anEnergy, G4double massCode, G4double ) { // Interpolation still only for the most used parts; rest to be Done @@@@@ G4ReactionProduct * result = new G4ReactionProduct; G4int Z = static_cast(massCode/1000); G4int A = static_cast(massCode-1000*Z); if(massCode==0) { result->SetDefinition(G4Gamma::Gamma()); } else if(A==0) { result->SetDefinition(G4Electron::Electron()); if(Z==1) result->SetDefinition(G4Positron::Positron()); } else if(A==1) { result->SetDefinition(G4Neutron::Neutron()); if(Z==1) result->SetDefinition(G4Proton::Proton()); } else if(A==2) { result->SetDefinition(G4Deuteron::Deuteron()); } else if(A==3) { result->SetDefinition(G4Triton::Triton()); if(Z==2) result->SetDefinition(G4He3::He3()); } else if(A==4) { result->SetDefinition(G4Alpha::Alpha()); if(Z!=2) throw G4HadronicException(__FILE__, __LINE__, "Unknown ion case 1"); } else { throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPDiscreteTwoBody: Unknown ion case 2"); } // get cosine(theta) G4int i(0), it(0); G4double cosTh(0); for(i=0; ianEnergy) break; } if(it==0||it==nEnergy-1) { if(theCoeff[it].GetRepresentation()==0) { //TK Legendre expansion G4NeutronHPLegendreStore theStore(1); theStore.SetCoeff(0, theCoeff); theStore.SetManager(theManager); //cosTh = theStore.SampleMax(anEnergy); //080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #3 cosTh = theStore.SampleDiscreteTwoBody(anEnergy); } else if(theCoeff[it].GetRepresentation()==12) // means LINLIN { G4NeutronHPVector theStore; G4InterpolationManager aManager; aManager.Init(LINLIN, theCoeff[it].GetNumberOfPoly()/2); theStore.SetInterpolationManager(aManager); for(i=0;iGetMass() + GetNeutron()->GetMass() // - result->GetMass() - GetQValue(); //G4double kinE = restEnergy/(1+result->GetMass()/residualMass); // non relativistic @@ G4double A1 = GetTarget()->GetMass()/GetNeutron()->GetMass(); G4double A1prim = result->GetMass()/GetNeutron()->GetMass(); G4double E1 = (A1+1)*(A1+1)/A1/A1*anEnergy; G4double kinE = (A1+1-A1prim)/(A1+1)/(A1+1)*(A1*E1+(1+A1)*GetQValue()); result->SetKineticEnergy(kinE); // non relativistic @@ G4double phi = twopi*G4UniformRand(); G4double theta = std::acos(cosTh); G4double sinth = std::sin(theta); G4double mtot = result->GetTotalMomentum(); G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) ); result->SetMomentum(tempVector); // some garbage collection // return the result return result; }