Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
+34 -1
View File
@@ -1,4 +1,4 @@
# $Id: History 104803 2017-06-19 07:13:32Z gcosmo $
# $Id: History 107438 2017-11-13 07:38:19Z gcosmo $
# -----------------------------------------------------------
==================================================
@@ -15,6 +15,39 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
10 November 2017 Tatsumi Koi (hadr-lend-V10-03-12)
-----------------------------------------------
-Fix gamma(2.2MeV) emission from n captured by H
-Fix minor problem on DumpLENDTargetInfo
-Fix misplaced description in this file
7 November 2017 Tatsumi Koi (hadr-lend-V10-03-11)
-----------------------------------------------
-Fix typo in names of cross section data set
10 October 2017 Tatsumi Koi (hadr-lend-V10-03-10)
-----------------------------------------------
-Adding G4LENDCombinedModel and G4LENDCombinedCrossSection
-Adding DumpLENDTargetInfo
-Reducing default (VerboseLevel=0) output from models and cross sections
9 October 2017 Tatsumi Koi (hadr-lend-V10-03-09)
-----------------------------------------------
-G4LENDCrossSection: IsIsoApplicable returns false for the case of target is not exist
-G4LENDModel: ApplyYourself returns unchanged final state for the case of target is not exist with warning message
2 October 2017 Tatsumi Koi (hadr-lend-V10-03-08)
-----------------------------------------------
-Fix bug in G4LENDElastic
21 June 2017 Tatsumi Koi (hadr-lend-V10-03-07)
-----------------------------------------------
-Fix Coverity 63049
27 June 2017 Tatsumi Koi (hadr-lend-V10-03-06)
-----------------------------------------------
-Fix Coverity 63063
14 June 2017 Tatsumi Koi (hadr-lend-V10-03-05)
-----------------------------------------------
-Fix Coverity 63066
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4LENDCombinedCrossSection_h
#define G4LENDCombinedCrossSection_h 1
// Class Description
// LEND is Geant4 interface for GIDI (General Interaction Data Interface)
// which gives a discription of nuclear and atomic reactions, such as
// Binary collision cross sections
// Particle number multiplicity distributions of reaction products
// Energy and angular distributions of reaction products
// Derived calculational constants
// GIDI is developped at Lawrence Livermore National Laboratory
// Class Description - End
// 170912 First implementation done by T. Koi (SLAC/EPP)
#include "G4LENDCrossSection.hh"
class G4LENDElasticCrossSection;
class G4LENDInelasticCrossSection;
class G4LENDCaptureCrossSection;
class G4LENDFissionCrossSection;
class G4HadProjectile;
class G4LENDCombinedCrossSection : public G4LENDCrossSection
{
public:
G4LENDCombinedCrossSection( G4ParticleDefinition* pd );
~G4LENDCombinedCrossSection(){;};
void BuildPhysicsTable( const G4ParticleDefinition& );
G4double GetIsoCrossSection( const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/ ,
const G4Isotope* , const G4Element* , const G4Material* );
G4int SelectChannel( const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/ ,
const G4Isotope* , const G4Element* , const G4Material* );
private:
G4LENDElasticCrossSection* elasticXS;
G4LENDInelasticCrossSection* inelasticXS;
G4LENDCaptureCrossSection* captureXS;
G4LENDFissionCrossSection* fissionXS;
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4LENDCombinedModel_h
#define G4LENDCombinedModel_h 1
// Class Description
// LEND is Geant4 interface for GIDI (General Interaction Data Interface)
// which gives a discription of nuclear and atomic reactions, such as
// Binary collision cross sections
// Particle number multiplicity distributions of reaction products
// Energy and angular distributions of reaction products
// Derived calculational constants
// GIDI is developped at Lawrence Livermore National Laboratory
// Class Description - End
// 170912 First implementation done by T. Koi (SLAC/EPP)
#include "G4LENDModel.hh"
class G4LENDCombinedCrossSection;
class G4LENDElastic;
class G4LENDInelastic;
class G4LENDCapture;
class G4LENDFission;
class G4LENDCombinedModel : public G4LENDModel
{
public:
G4LENDCombinedModel( G4ParticleDefinition* pd );
~G4LENDCombinedModel(){;};
void BuildPhysicsTable(const G4ParticleDefinition&);
G4HadFinalState* ApplyYourself( const G4HadProjectile& aTrack, G4Nucleus& aTargetNucleus );
G4bool HasData( const G4DynamicParticle* , G4int iZ , G4int iA , G4int iM,
const G4Isotope* , const G4Element* , const G4Material* );
private:
G4LENDCombinedCrossSection* crossSection;
G4LENDElastic* elastic;
G4LENDInelastic* inelastic;
G4LENDCapture* capture;
G4LENDFission* fission;
G4LENDModel* channels[4];
};
#endif
@@ -84,7 +84,7 @@ class G4LENDCrossSection : public G4VCrossSectionDataSet
void BuildPhysicsTable( const G4ParticleDefinition& );
void DumpPhysicsTable( const G4ParticleDefinition& );
void DumpLENDTargetInfo( G4bool force = false );
//TK110810
//G4double GetCrossSection( const G4DynamicParticle* , const G4Element* , G4double aT );
@@ -126,6 +126,7 @@ class G4LENDCrossSection : public G4VCrossSectionDataSet
//G4String name;
G4ParticleDefinition* proj;
void create_used_target_map();
G4GIDI_target* get_target_from_map( G4int nuclear_code );
virtual G4double getLENDCrossSection( G4GIDI_target* , G4double , G4double ) { return 0.0; };
// elow ehigh xs_elow xs_ehigh ke (<elow)
G4double GetUltraLowEnergyExtrapolatedXS( G4double , G4double , G4double , G4double , G4double );
@@ -49,7 +49,7 @@ class G4LENDFissionCrossSection : public G4LENDCrossSection
//G4LENDFissionCrossSection()
//{;};
G4LENDFissionCrossSection( G4ParticleDefinition* pd )
:G4LENDCrossSection("LENDEFissionCrossSection")
:G4LENDCrossSection("LENDFissionCrossSection")
{
proj = pd;
//name = "LEND Fission Cross Section for ";
@@ -50,7 +50,7 @@ class G4LENDInelasticCrossSection : public G4LENDCrossSection
G4LENDInelasticCrossSection()
{;};
G4LENDInelasticCrossSection( G4ParticleDefinition* pd )
:G4LENDCrossSection("LENDEInelasitcCrossSection")
:G4LENDCrossSection("LENDInelasitcCrossSection")
{
proj = pd;
//name = "LEND Inelastic Cross Section for ";
@@ -64,6 +64,7 @@ class G4LENDModel : public G4HadronicInteraction
void AllowAnyCandidateTarget(){ allow_any = true; recreate_used_target_map(); };
//Same argument to the CrossSectionDataSet
void BuildPhysicsTable( const G4ParticleDefinition& ){ recreate_used_target_map(); };
void DumpLENDTargetInfo( G4bool force = false );
private:
@@ -75,6 +76,9 @@ class G4LENDModel : public G4HadronicInteraction
void create_used_target_map();
void recreate_used_target_map();
G4GIDI_target* get_target_from_map( G4int nuclear_code );
G4HadFinalState* returnUnchanged( const G4HadProjectile& aTrack, G4HadFinalState* theResult );
G4ParticleDefinition* proj;
G4LENDManager* lend_manager;
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 94435 2015-11-17 14:24:19Z gcosmo $
# $Id: sources.cmake 106463 2017-10-11 08:05:17Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -60,6 +60,8 @@ GEANT4_DEFINE_MODULE(NAME G4had_lend
G4LENDCapture.hh
G4LENDCaptureCrossSection.hh
G4LENDCrossSection.hh
G4LENDCombinedCrossSection.hh
G4LENDCombinedModel.hh
G4LENDElastic.hh
G4LENDElasticCrossSection.hh
G4LENDFission.hh
@@ -100,6 +102,8 @@ GEANT4_DEFINE_MODULE(NAME G4had_lend
G4GIDI_target.cc
G4LENDCapture.cc
G4LENDCaptureCrossSection.cc
G4LENDCombinedCrossSection.cc
G4LENDCombinedModel.cc
G4LENDCrossSection.cc
G4LENDElastic.cc
G4LENDElasticCrossSection.cc
@@ -52,8 +52,8 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
//std::vector<G4GIDI_Product>* products = aTarget->getCaptureFinalState( ke*MeV, temp, NULL, NULL );
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) return returnUnchanged( aTrack , theResult );
std::vector<G4GIDI_Product>* products = aTarget->getCaptureFinalState( ke*MeV, temp, MyRNG, NULL );
G4int ipZ = aTrack.GetDefinition()->GetAtomicNumber();
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4LENDCombinedCrossSection.hh"
#include "G4LENDElasticCrossSection.hh"
#include "G4LENDInelasticCrossSection.hh"
#include "G4LENDCaptureCrossSection.hh"
#include "G4LENDFissionCrossSection.hh"
#include "Randomize.hh"
G4LENDCombinedCrossSection::G4LENDCombinedCrossSection( G4ParticleDefinition* pd )
:G4LENDCrossSection("LENDCombinedCrossSection")
{
proj = pd;
elasticXS = new G4LENDElasticCrossSection( pd );
inelasticXS = new G4LENDInelasticCrossSection( pd );
captureXS = new G4LENDCaptureCrossSection( pd );
fissionXS = new G4LENDFissionCrossSection( pd );
}
void G4LENDCombinedCrossSection::BuildPhysicsTable( const G4ParticleDefinition& pd )
{
elasticXS->BuildPhysicsTable( pd );
inelasticXS->BuildPhysicsTable( pd );
captureXS->BuildPhysicsTable( pd );
fissionXS->BuildPhysicsTable( pd );
create_used_target_map();
}
G4double G4LENDCombinedCrossSection::GetIsoCrossSection( const G4DynamicParticle* dp , G4int iZ , G4int iA ,
const G4Isotope* isotope , const G4Element* /*elment*/ , const G4Material* material )
{
G4double XS = 0.0;
XS += elasticXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XS += inelasticXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XS += captureXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XS += fissionXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
//G4cout << "G4LENDCombinedCrossSection::GetIsoCrossSection " << XS/CLHEP::barn << " [barn]" << G4endl;
return XS;
}
G4int G4LENDCombinedCrossSection::SelectChannel( const G4DynamicParticle* dp , G4int iZ , G4int iA ,
const G4Isotope* isotope , const G4Element* /*elment*/ , const G4Material* material )
{
G4int ichannel=-1;
G4double XSs[4];
XSs[0] = elasticXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XSs[1] = XSs[0] + inelasticXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XSs[2] = XSs[1] + captureXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
XSs[3] = XSs[2] + fissionXS->GetIsoCrossSection( dp, iZ, iA, isotope, NULL , material );
G4double total = XSs[3];
G4double random = G4UniformRand();
for ( G4int i = 0 ; i != 4 ; i++ ) {
if ( random*total <= XSs[i] ) {
ichannel = i;
break;
}
}
return ichannel;
}
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4LENDCombinedModel.hh"
#include "G4LENDCombinedCrossSection.hh"
#include "G4LENDElastic.hh"
#include "G4LENDInelastic.hh"
#include "G4LENDCapture.hh"
#include "G4LENDFission.hh"
#include "G4DynamicParticle.hh"
G4LENDCombinedModel::G4LENDCombinedModel( G4ParticleDefinition* pd )
:G4LENDModel( "LENDCombinedModel" ) {
proj = pd;
crossSection = new G4LENDCombinedCrossSection( pd );
elastic = new G4LENDElastic( pd );
inelastic = new G4LENDInelastic( pd );
capture = new G4LENDCapture( pd );
fission = new G4LENDFission( pd );
channels[0] = elastic;
channels[1] = inelastic;
channels[2] = capture;
channels[3] = fission;
}
void G4LENDCombinedModel::BuildPhysicsTable(const G4ParticleDefinition& projectile) {
crossSection->BuildPhysicsTable( projectile );
create_used_target_map();
}
G4bool G4LENDCombinedModel::HasData( const G4DynamicParticle* , G4int iZ, G4int iA , G4int iM,
const G4Isotope* , const G4Element* , const G4Material* ) {
G4bool result = false;
if ( get_target_from_map ( lend_manager->GetNucleusEncoding ( iZ, iA , iM ) ) != NULL ) result=true;
return result;
}
G4HadFinalState * G4LENDCombinedModel::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg ){
G4LENDModel* channel = NULL;
G4int iZ = aTarg.GetZ_asInt();
G4int iA = aTarg.GetA_asInt();
//To pass kinetic energy, need to generate dynamic particle
G4DynamicParticle* dp = new G4DynamicParticle( proj , G4ThreeVector(0.,0.,1.) , aTrack.GetKineticEnergy() );
G4int ichannel = crossSection->SelectChannel( dp , iZ , iA , aTarg.GetIsotope(), NULL , aTrack.GetMaterial() );
delete dp;
//ichannel=1;
channel = channels[ichannel];
return channel->ApplyYourself(aTrack,aTarg);
}
@@ -43,15 +43,41 @@
#include "G4ElementTable.hh"
#include "G4HadronicException.hh"
//TK110811
G4bool G4LENDCrossSection::IsIsoApplicable( const G4DynamicParticle* dp, G4int /*iZ*/ , G4int /*aA*/ ,
const G4Element* /*element*/ , const G4Material* /*material*/ )
G4bool G4LENDCrossSection::IsIsoApplicable( const G4DynamicParticle* dp, G4int iZ , G4int iA ,
const G4Element* element , const G4Material* /*material*/ )
{
G4double eKin = dp->GetKineticEnergy();
if ( dp->GetDefinition() != proj ) return false;
if ( eKin > GetMaxKinEnergy() || eKin < GetMinKinEnergy() ) return false;
return true;
//G4cout << "G4LENDCrossSection::GetIsoIsIsoApplicable this->GetName() = " << this->GetName() << ", iZ = " << iZ << ", iA = " << iA << ", allow_nat = " << allow_nat << G4endl;
//Check existence of target data
if ( element != NULL ) {
if ( element->GetNumberOfIsotopes() != 0 ) {
std::vector< const G4Isotope*> vIsotope;
for ( size_t i = 0 ; i != element->GetNumberOfIsotopes() ; i++ ) {
if ( element->GetIsotope( i )->GetN() == iA ) vIsotope.push_back( element->GetIsotope( i ) );
}
for ( size_t i = 0 ; i != vIsotope.size() ; i++ ) {
G4int iM = vIsotope[i]->Getm();
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) ) != NULL ) return true;
}
//No isomer has data
//Check natural aboundance data for the element
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
} else {
//Check for iZ and iA under assuming iM = 0
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , 0 ) ) != NULL ) return true;
//Check natural aboundance data for the element
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
}
} else {
//Check for iZ and iA under assuming iM = 0
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , 0 ) ) != NULL ) return true;
//Check natural aboundance data for iZ
if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
}
return false;
}
G4double G4LENDCrossSection::GetIsoCrossSection( const G4DynamicParticle* dp , G4int iZ , G4int iA ,
@@ -61,10 +87,18 @@ G4double G4LENDCrossSection::GetIsoCrossSection( const G4DynamicParticle* dp , G
G4double xs = 0.0;
G4double ke = dp->GetKineticEnergy();
G4double temp = material->GetTemperature();
G4int iM = isotope->Getm();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
G4int iM = 0;
if ( isotope != NULL ) iM = isotope->Getm();
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) {
G4String message;
message = this->GetName();
message += " is unexpectedly called.";
//G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , JustWarning ,
G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , FatalException ,
message );
}
xs = getLENDCrossSection ( aTarget , ke , temp );
return xs;
@@ -330,24 +364,7 @@ void G4LENDCrossSection::create_used_target_map()
}
}
}
G4cout << "Dump UsedTarget for " << GetName() << G4endl;
//G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) , Pointer of Target" << G4endl;
G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
for ( std::map< G4int , G4LENDUsedTarget* >::iterator
it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
{
G4cout
<< " " << it->second->GetWantedEvaluation()
<< ", " << it->second->GetWantedZ()
<< ", " << it->second->GetWantedA()
<< " -> " << it->second->GetActualEvaluation()
<< ", " << it->second->GetActualZ()
<< ", " << it->second->GetActualA()
//<< ", " << it->second->GetTarget()
<< G4endl;
}
DumpLENDTargetInfo();
}
// elow ehigh xs_elow xs_ehigh ke (ke < elow)
@@ -360,3 +377,32 @@ G4double G4LENDCrossSection::GetUltraLowEnergyExtrapolatedXS( G4double x1, G4dou
G4double result = a * 1/std::sqrt(ke) + b;
return result;
}
G4GIDI_target* G4LENDCrossSection::get_target_from_map( G4int nuclear_code ) {
G4GIDI_target* target = NULL;
if ( usedTarget_map.find( nuclear_code ) != usedTarget_map.end() ) {
target = usedTarget_map.find( nuclear_code )->second->GetTarget();
}
return target;
}
void G4LENDCrossSection::DumpLENDTargetInfo( G4bool force ) {
if ( lend_manager->GetVerboseLevel() >= 1 || force ) {
if ( usedTarget_map.size() == 0 ) create_used_target_map();
G4cout << "Dumping UsedTarget of " << GetName() << " for " << proj->GetParticleName() << G4endl;
G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
for ( std::map< G4int , G4LENDUsedTarget* >::iterator
it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ ) {
G4cout
<< " " << it->second->GetWantedEvaluation()
<< ", " << it->second->GetWantedZ()
<< ", " << it->second->GetWantedA()
<< " -> " << it->second->GetActualEvaluation()
<< ", " << it->second->GetActualZ()
<< ", " << it->second->GetActualA()
<< G4endl;
}
}
}
@@ -51,12 +51,12 @@ G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4
G4double ke = aTrack.GetKineticEnergy();
//G4HadFinalState* theResult = new G4HadFinalState();
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
//G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, NULL, NULL );
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) return returnUnchanged( aTrack , theResult );
G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, MyRNG , NULL );
G4double phi = twopi*G4UniformRand();
@@ -121,7 +121,8 @@ G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4
theTarget.SetTotalEnergy(std::sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
theNeutron.Lorentz(theNeutron, -1.*theCMS);
theNeutron.Lorentz(theNeutron, -1.*theCMS);
theTarget.Lorentz(theTarget, -1.*theCMS);
//110913 Add Protection for very low energy (1e-6eV) scattering
if ( theNeutron.GetKineticEnergy() <= 0 )
@@ -129,22 +130,18 @@ G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4
theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
}
theTarget.Lorentz(theTarget, -1.*theCMS);
if ( theTarget.GetKineticEnergy() < 0 )
{
theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
}
//110913 END
theTarget.Lorentz(theTarget, -1.*theCMS);
theResult->SetEnergyChange(theNeutron.GetKineticEnergy());
theResult->SetMomentumChange(theNeutron.GetMomentum().unit());
G4DynamicParticle* theRecoil = new G4DynamicParticle;
theRecoil->SetDefinition( target_pd );
theRecoil->SetMomentum( theTarget.GetMomentum() );
theResult->AddSecondary( theRecoil );
return theResult;
@@ -47,7 +47,8 @@ G4HadFinalState * G4LENDFission::ApplyYourself(const G4HadProjectile& aTrack, G4
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) return returnUnchanged( aTrack , theResult );
std::vector<G4GIDI_Product>* products = aTarget->getFissionFinalState( ke*MeV, temp, MyRNG, NULL );
if ( products != NULL )
{
@@ -55,8 +55,8 @@ G4HadFinalState * G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack,
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
//std::vector<G4GIDI_Product>* products = aTarget->getOthersFinalState( ke*MeV, temp, MyRNG, NULL );
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) return returnUnchanged( aTrack , theResult );
std::vector<G4GIDI_Product>* products;
for ( G4int i = 0 ; i != 1024 ; i++ ) {
@@ -148,25 +148,7 @@ void G4LENDModel::create_used_target_map()
}
}
G4cout << "Dump UsedTarget for " << GetModelName() << G4endl;
//G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) , Pointer of Target" << G4endl;
G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
for ( std::map< G4int , G4LENDUsedTarget* >::iterator
it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
{
G4cout
<< " " << it->second->GetWantedEvaluation()
<< ", " << it->second->GetWantedZ()
<< ", " << it->second->GetWantedA()
<< " -> " << it->second->GetActualEvaluation()
<< ", " << it->second->GetActualZ()
<< ", " << it->second->GetActualA()
//<< ", " << it->second->GetTarget()
<< G4endl;
}
DumpLENDTargetInfo();
}
@@ -267,3 +249,45 @@ G4HadFinalState * G4LENDModel::ApplyYourself(const G4HadProjectile& aTrack, G4Nu
return theResult;
}
G4HadFinalState* G4LENDModel::returnUnchanged(const G4HadProjectile& aTrack, G4HadFinalState* theResult ) {
if ( lend_manager->GetVerboseLevel() >= 1 ) {
G4String message;
message = "Produce unchanged final state is requested in ";
message += this->GetModelName();
message += ". Cross section and model likely have an inconsistency.";
G4Exception( "G4LENDModel::returnUnchanged(,)" , "LENDModel-01" , JustWarning ,
message );
}
theResult->SetEnergyChange( aTrack.GetKineticEnergy() );
theResult->SetMomentumChange( aTrack.Get4Momentum().getV().unit() );
return theResult;
}
G4GIDI_target* G4LENDModel::get_target_from_map( G4int nuclear_code ) {
G4GIDI_target* target = NULL;
if ( usedTarget_map.find( nuclear_code ) != usedTarget_map.end() ) {
target = usedTarget_map.find( nuclear_code )->second->GetTarget();
}
return target;
}
void G4LENDModel::DumpLENDTargetInfo( G4bool force ) {
if ( lend_manager->GetVerboseLevel() >= 1 || force ) {
if ( usedTarget_map.size() == 0 ) create_used_target_map();
G4cout << "Dumping UsedTarget of " << GetModelName() << " for " << proj->GetParticleName() << G4endl;
G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
for ( std::map< G4int , G4LENDUsedTarget* >::iterator
it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ ) {
G4cout
<< " " << it->second->GetWantedEvaluation()
<< ", " << it->second->GetWantedZ()
<< ", " << it->second->GetWantedA()
<< " -> " << it->second->GetActualEvaluation()
<< ", " << it->second->GetActualZ()
<< ", " << it->second->GetActualA()
<< G4endl;
}
}
}
@@ -173,7 +173,7 @@ int MCGIDI_angular_parseFromTOM( statusMessageReporting *smr, xDataTOM_element *
err:
if( pdfXY != NULL ) ptwXY_free( pdfXY );
if( cdfX != NULL ) cdfX = ptwX_free( cdfX );
MCGIDI_angular_free( smr, angular );
if ( angular != NULL ) MCGIDI_angular_free( smr, angular );
return( 1 );
}
/*
@@ -111,6 +111,15 @@ int MCGIDI_outputChannel_parseFromTOM( statusMessageReporting *smr, xDataTOM_ele
targetMass_MeV = MCGIDI_reaction_getTargetMass_MeV( smr, reaction );
productMass_MeV = MCGIDI_product_getMass_MeV( smr, &(outputChannel->products[0]) );
residualMass_MeV = MCGIDI_product_getMass_MeV( smr, &(outputChannel->products[1]) );
//TK 17-11-10 for v1.3
//A temporary fix for emission of gamma(2.2MeV) from n captured by H
// capture gamma D
if ( reaction->ENDF_MT == 102 && productMass_MeV == 0 && ( outputChannel->products[1].pop->A == 2 && outputChannel->products[1].pop->Z == 1 ) ) {
//include/PoPs_data.h:#define e_Mass 5.4857990943e-4 /* electron mass in AMU */
residualMass_MeV += 5.4857990943e-4*MCGIDI_AMU2MeV;
}
MCGIDI_product_setTwoBodyMasses( smr, &(outputChannel->products[0]), projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV );
}
@@ -516,7 +516,8 @@ ptwXPoints *ptwXY_groupTwoFunctions( ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, p
err:
ptwXY_free( ff );
if( gg != NULL ) ptwXY_free( gg );
if( f != NULL ) ptwXY_free( ff );
// Coverity #63063
if( f != NULL ) ptwXY_free( f );
if( g != NULL ) ptwXY_free( g );
if( groupedData != NULL ) ptwX_free( groupedData );
return( NULL );