[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // 05-11-21 NeutronHP or Low Energy Parameterization Models |
---|
| 28 | // Implemented by T. Koi (SLAC/SCCS) |
---|
| 29 | // If NeutronHP data do not available for an element, then Low Energy |
---|
| 30 | // Parameterization models handle the interactions of the element. |
---|
| 31 | // |
---|
| 32 | |
---|
| 33 | #include "G4NeutronHPorLCaptureData.hh" |
---|
| 34 | #include "G4Neutron.hh" |
---|
| 35 | #include "G4ElementTable.hh" |
---|
| 36 | #include "G4NeutronHPData.hh" |
---|
| 37 | |
---|
| 38 | #include "G4PhysicsVector.hh" |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | G4NeutronHPorLCaptureData::G4NeutronHPorLCaptureData( G4NeutronHPChannel* pChannel , std::set< G4String >* pSet ) |
---|
| 43 | { |
---|
| 44 | theCaptureChannel = pChannel; |
---|
| 45 | unavailable_elements = pSet; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | G4bool G4NeutronHPorLCaptureData::IsApplicable(const G4DynamicParticle*aP, const G4Element* anElement) |
---|
| 51 | { |
---|
| 52 | G4bool result = true; |
---|
| 53 | G4double eKin = aP->GetKineticEnergy(); |
---|
| 54 | if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false; |
---|
| 55 | if ( unavailable_elements->find( anElement->GetName() ) != unavailable_elements->end() ) result = false; |
---|
| 56 | return result; |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | G4NeutronHPorLCaptureData::G4NeutronHPorLCaptureData() |
---|
| 60 | { |
---|
| 61 | // BuildPhysicsTable(*G4Neutron::Neutron()); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | G4NeutronHPorLCaptureData::~G4NeutronHPorLCaptureData() |
---|
| 67 | { |
---|
| 68 | // delete theCrossSections; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | void G4NeutronHPorLCaptureData::BuildPhysicsTable( const G4ParticleDefinition& aP ) |
---|
| 74 | { |
---|
| 75 | if( &aP!=G4Neutron::Neutron() ) |
---|
| 76 | throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!"); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | void G4NeutronHPorLCaptureData::DumpPhysicsTable(const G4ParticleDefinition& aP) |
---|
| 82 | { |
---|
| 83 | if(&aP!=G4Neutron::Neutron()) |
---|
| 84 | throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!"); |
---|
| 85 | // G4cout << "G4NeutronHPorLCaptureData::DumpPhysicsTable still to be implemented"<<G4endl; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | #include "G4Nucleus.hh" |
---|
| 91 | #include "G4NucleiPropertiesTable.hh" |
---|
| 92 | #include "G4Neutron.hh" |
---|
| 93 | #include "G4Electron.hh" |
---|
| 94 | |
---|
| 95 | G4double G4NeutronHPorLCaptureData:: |
---|
| 96 | GetCrossSection(const G4DynamicParticle* aP, const G4Element*anE, G4double aT) |
---|
| 97 | { |
---|
| 98 | |
---|
| 99 | // G4cout << "Choice G4NeutronHPorLCaptureData for element " << anE->GetName() << G4endl; |
---|
| 100 | G4double result = 0; |
---|
| 101 | // G4bool outOfRange; |
---|
| 102 | G4int index = anE->GetIndex(); |
---|
| 103 | |
---|
| 104 | // prepare neutron |
---|
| 105 | G4double eKinetic = aP->GetKineticEnergy(); |
---|
| 106 | G4ReactionProduct theNeutron( aP->GetDefinition() ); |
---|
| 107 | theNeutron.SetMomentum( aP->GetMomentum() ); |
---|
| 108 | theNeutron.SetKineticEnergy( eKinetic ); |
---|
| 109 | |
---|
| 110 | // prepare thermal nucleus |
---|
| 111 | G4Nucleus aNuc; |
---|
| 112 | G4double eps = 0.0001; |
---|
| 113 | G4double theA = anE->GetN(); |
---|
| 114 | G4double theZ = anE->GetZ(); |
---|
| 115 | G4double eleMass; |
---|
| 116 | eleMass = ( G4NucleiPropertiesTable::GetNuclearMass(static_cast<G4int>(theZ+eps), static_cast<G4int>(theA+eps)) |
---|
| 117 | ) / G4Neutron::Neutron()->GetPDGMass(); |
---|
| 118 | |
---|
| 119 | G4ReactionProduct boosted; |
---|
| 120 | G4double aXsection; |
---|
| 121 | |
---|
| 122 | // MC integration loop |
---|
| 123 | G4int counter = 0; |
---|
| 124 | G4double buffer = 0; |
---|
| 125 | G4int size = G4int(std::max(10., aT/60*kelvin)); |
---|
| 126 | G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum(); |
---|
| 127 | G4double neutronVMag = neutronVelocity.mag(); |
---|
| 128 | while(counter == 0 || std::abs(buffer-result/std::max(1,counter)) > 0.03*buffer) |
---|
| 129 | { |
---|
| 130 | if(counter) buffer = result/counter; |
---|
| 131 | while (counter<size) |
---|
| 132 | { |
---|
| 133 | counter ++; |
---|
| 134 | G4ReactionProduct aThermalNuc = aNuc.GetThermalNucleus(eleMass, aT); |
---|
| 135 | boosted.Lorentz(theNeutron, aThermalNuc); |
---|
| 136 | G4double theEkin = boosted.GetKineticEnergy(); |
---|
| 137 | //aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange); |
---|
| 138 | aXsection = theCaptureChannel[index].GetXsec( theEkin ); |
---|
| 139 | // velocity correction. |
---|
| 140 | G4ThreeVector targetVelocity = 1./aThermalNuc.GetMass()*aThermalNuc.GetMomentum(); |
---|
| 141 | aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag; |
---|
| 142 | result += aXsection; |
---|
| 143 | } |
---|
| 144 | size += size; |
---|
| 145 | } |
---|
| 146 | result /= counter; |
---|
| 147 | return result; |
---|
| 148 | } |
---|