// // ******************************************************************** // * 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. // // 02-08-06 Modified Harmonise to reslove cross section trouble at high-end. T. KOI // #include "G4NeutronHPElementData.hh" G4NeutronHPElementData::G4NeutronHPElementData() { precision = 0.02; theFissionData = new G4NeutronHPVector; theCaptureData = new G4NeutronHPVector; theElasticData = new G4NeutronHPVector; theInelasticData = new G4NeutronHPVector; theIsotopeWiseData = 0; } G4NeutronHPElementData::~G4NeutronHPElementData() { delete theFissionData; delete theCaptureData; delete theElasticData; delete theInelasticData; delete [] theIsotopeWiseData; } void G4NeutronHPElementData::Init(G4Element * theElement) { G4int count = theElement->GetNumberOfIsotopes(); if(count == 0) count += theStableOnes.GetNumberOfIsotopes(static_cast(theElement->GetZ())); theIsotopeWiseData = new G4NeutronHPIsoData[count]; // filename = ein data-set je isotope. count = 0; G4int nIso = theElement->GetNumberOfIsotopes(); G4int Z = static_cast (theElement->GetZ()); G4int i1; if(nIso!=0) { for (i1=0; i1GetIsotope(i1)->GetN(); G4double frac = theElement->GetRelativeAbundanceVector()[i1]/perCent; UpdateData(A, Z, count++, frac); } }else{ // G4cout <<" Init: theStableOnes case: Z="<GetZ())<(theElement->GetZ()) ); i1++) { // G4cout <<" Init: theStableOnes in the loop"<ThinOut(precision); theInelasticData->ThinOut(precision); theCaptureData->ThinOut(precision); theFissionData->ThinOut(precision); } void G4NeutronHPElementData::UpdateData(G4int A, G4int Z, G4int index, G4double abundance) { //Reads in the Data, using G4NeutronHPIsoData[], and its Init // G4cout << "entered: ElementWiseData::UpdateData"<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()<GetVectorLength()); // G4cout << "Harmonise 1: "<GetEnergy(s)<<" "<GetEnergy(0)<GetEnergy(s)GetEnergy(0)&&sGetVectorLength() ) { theMerge->SetData(m++, theStore->GetEnergy(s), theStore->GetXsec(s)); s++; } G4NeutronHPVector *active = theStore; G4NeutronHPVector * passive = theNew; G4NeutronHPVector * tmp; G4int a = s, p = n, t; // G4cout << "Harmonise 2: "<GetVectorLength()<<" "<GetVectorLength()<GetVectorLength()&&pGetVectorLength()) { if(active->GetEnergy(a) <= passive->GetEnergy(p)) { theMerge->SetData(m, active->GetEnergy(a), active->GetXsec(a)); G4double x = theMerge->GetEnergy(m); G4double y = std::max(0., passive->GetXsec(x)); theMerge->SetData(m, x, theMerge->GetXsec(m)+y); m++; a++; } else { // G4cout << "swapping in Harmonise"<GetVectorLength()<<" "<GetVectorLength()) { theMerge->SetData(m++, active->GetEnergy(a), active->GetXsec(a)); a++; } // G4cout << "Harmonise 4: "<< p <<" "<GetVectorLength()<<" "<GetVectorLength()) { // Modified by T. KOI //theMerge->SetData(m++, passive->GetEnergy(p), passive->GetXsec(p)); G4double x = passive->GetEnergy(p); G4double y = std::max(0., active->GetXsec(x)); theMerge->SetData(m++, x, passive->GetXsec(p)+y); p++; } // G4cout <<"Harmonise 5: "<< theMerge->GetVectorLength() << " " << m << G4endl; delete theStore; theStore = theMerge; // G4cout <<"Harmonise 6: "<< theStore->GetVectorLength() << " " << m << G4endl; } G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector(G4Element * theElement, G4ParticleDefinition * theP, G4NeutronHPFissionData* theSet) { if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron"); Init ( theElement ); return GetData(theSet); } G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector(G4Element * theElement, G4ParticleDefinition * theP, G4NeutronHPCaptureData * theSet) { if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron"); Init ( theElement ); return GetData(theSet); } G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector(G4Element * theElement, G4ParticleDefinition * theP, G4NeutronHPElasticData * theSet) { if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron"); Init ( theElement ); return GetData(theSet); } G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector(G4Element * theElement, G4ParticleDefinition * theP, G4NeutronHPInelasticData * theSet) { if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron"); Init ( theElement ); return GetData(theSet); }