// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * 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. * // * * // * This code implementation is the intellectual property of the * // * authors in the GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // neutron_hp -- source file // J.P. Wellisch, Nov-1996 // A prototype of the low energy neutron transport model. // #include "G4NeutronHPCaptureData.hh" #include "G4Neutron.hh" #include "G4ElementTable.hh" #include "G4NeutronHPData.hh" G4bool G4NeutronHPCaptureData::IsApplicable(const G4DynamicParticle*aP, const G4Element*anE) { G4bool result = true; G4double eKin = aP->GetKineticEnergy(); if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false; return result; } G4NeutronHPCaptureData::G4NeutronHPCaptureData() { BuildPhysicsTable(*G4Neutron::Neutron()); } G4NeutronHPCaptureData::~G4NeutronHPCaptureData() { delete theCrossSections; } void G4NeutronHPCaptureData::BuildPhysicsTable(const G4ParticleDefinition& aP) { if(&aP!=G4Neutron::Neutron()) G4Exception("Attempt to use NeutronHP data for particles other than neutrons!!!"); size_t numberOfElements = G4Element::GetNumberOfElements(); theCrossSections = new G4PhysicsTable( numberOfElements ); // make a PhysicsVector for each element static const G4ElementTable *theElementTable = G4Element::GetElementTable(); for( size_t i=0; iMakePhysicsVector((*theElementTable)[i], this); theCrossSections->push_back(physVec); } } void G4NeutronHPCaptureData::DumpPhysicsTable(const G4ParticleDefinition& aP) { if(&aP!=G4Neutron::Neutron()) G4Exception("Attempt to use NeutronHP data for particles other than neutrons!!!"); G4cout << "G4NeutronHPCaptureData::DumpPhysicsTable still to be implemented"<GetIndex(); // prepare neutron G4double eKinetic = aP->GetKineticEnergy(); G4ReactionProduct theNeutron( aP->GetDefinition() ); theNeutron.SetMomentum( aP->GetMomentum() ); theNeutron.SetKineticEnergy( eKinetic ); // prepare thermal nucleus G4Nucleus aNuc; G4double eps = 0.0001; G4double theA = anE->GetN(); G4double theZ = anE->GetZ(); G4double eleMass; eleMass = ( G4NucleiPropertiesTable::GetAtomicMass(static_cast(theZ+eps), static_cast(theA+eps))- theZ*G4Electron::ElectronDefinition()->GetPDGMass() ) / G4Neutron::Neutron()->GetPDGMass(); G4ReactionProduct boosted; G4double aXsection; // MC integration loop G4int counter = 0; G4double buffer = 0; G4int size = G4int(G4std::max(10., aT/60*kelvin)); G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum(); G4double neutronVMag = neutronVelocity.mag(); while(counter == 0 || abs(buffer-result/counter) > 0.03*buffer) { if(counter) buffer = result/counter; while (counter