Import Geant4 11.3.0 source tree
This commit is contained in:
@@ -34,7 +34,7 @@ using namespace GIDI;
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4GIDI::G4GIDI( G4int ip, string &dataDirectory ) {
|
||||
G4GIDI::G4GIDI( G4int ip, const string &dataDirectory ) {
|
||||
|
||||
init( ip );
|
||||
addDataDirectory( dataDirectory );
|
||||
@@ -103,7 +103,7 @@ G4int G4GIDI::numberOfDataDirectories( void ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4int G4GIDI::addDataDirectory( string &dataDirectory ) {
|
||||
G4int G4GIDI::addDataDirectory( const string &dataDirectory ) {
|
||||
|
||||
for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter ) {
|
||||
if( (*iter)->path( ) == dataDirectory ) return( 0 );
|
||||
@@ -117,7 +117,7 @@ G4int G4GIDI::addDataDirectory( string &dataDirectory ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4int G4GIDI::removeDataDirectory( string &dataDirectory ) {
|
||||
G4int G4GIDI::removeDataDirectory( const string &dataDirectory ) {
|
||||
|
||||
for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter ) {
|
||||
if( dataDirectory == (*iter)->path( ) ) {
|
||||
@@ -156,7 +156,7 @@ vector<string> *G4GIDI::getDataDirectories( void ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4bool G4GIDI::isThisDataAvailable( string &lib_name, G4int iZ, G4int iA, G4int iM ) {
|
||||
G4bool G4GIDI::isThisDataAvailable( const string &lib_name, G4int iZ, G4int iA, G4int iM ) {
|
||||
|
||||
G4bool b;
|
||||
char *targetName = G4GIDI_Misc_Z_A_m_ToName( iZ, iA, iM );
|
||||
@@ -170,7 +170,7 @@ G4bool G4GIDI::isThisDataAvailable( string &lib_name, G4int iZ, G4int iA, G4int
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4bool G4GIDI::isThisDataAvailable( string &lib_name, string &targetName ) {
|
||||
G4bool G4GIDI::isThisDataAvailable( const string &lib_name, const string &targetName ) {
|
||||
|
||||
char *path = dataFilename( lib_name, targetName );
|
||||
|
||||
@@ -183,7 +183,7 @@ G4bool G4GIDI::isThisDataAvailable( string &lib_name, string &targetName ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
char *G4GIDI::dataFilename( string &lib_name, G4int iZ, G4int iA, G4int iM ) {
|
||||
char *G4GIDI::dataFilename( const string &lib_name, G4int iZ, G4int iA, G4int iM ) {
|
||||
|
||||
char *targetName = G4GIDI_Misc_Z_A_m_ToName( iZ, iA, iM ), *fileName;
|
||||
|
||||
@@ -196,7 +196,7 @@ char *G4GIDI::dataFilename( string &lib_name, G4int iZ, G4int iA, G4int iM ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
char *G4GIDI::dataFilename( string &lib_name, string &targetSymbol ) {
|
||||
char *G4GIDI::dataFilename( const string &lib_name, const string &targetSymbol ) {
|
||||
|
||||
char *path;
|
||||
|
||||
@@ -223,7 +223,7 @@ vector<string> *G4GIDI::getNamesOfAvailableLibraries( G4int iZ, G4int iA, G4int
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
vector<string> *G4GIDI::getNamesOfAvailableLibraries( string &targetName ) {
|
||||
vector<string> *G4GIDI::getNamesOfAvailableLibraries( const string &targetName ) {
|
||||
|
||||
vector<string> *listOfLibraries = new vector<string>( );
|
||||
|
||||
@@ -259,7 +259,7 @@ vector<string> *G4GIDI::getNamesOfAvailableTargets( void ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4GIDI_target *G4GIDI::readTarget( string &lib_name, G4int iZ, G4int iA, G4int iM, G4bool bind ) {
|
||||
G4GIDI_target *G4GIDI::readTarget( const string &lib_name, G4int iZ, G4int iA, G4int iM, G4bool bind ) {
|
||||
|
||||
char *targetName = G4GIDI_Misc_Z_A_m_ToName( iZ, iA, iM );
|
||||
G4GIDI_target *target;
|
||||
@@ -273,7 +273,7 @@ G4GIDI_target *G4GIDI::readTarget( string &lib_name, G4int iZ, G4int iA, G4int i
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4GIDI_target *G4GIDI::readTarget( string &lib_name, string &targetName, G4bool bind ) {
|
||||
G4GIDI_target *G4GIDI::readTarget( const string &lib_name, const string &targetName, G4bool bind ) {
|
||||
|
||||
for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
|
||||
if( (*iter_targets)->name == targetName ) return( nullptr );
|
||||
@@ -303,7 +303,7 @@ G4GIDI_target *G4GIDI::getAlreadyReadTarget( G4int iZ, G4int iA, G4int iM ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4GIDI_target *G4GIDI::getAlreadyReadTarget( string &targetSymbol ) {
|
||||
G4GIDI_target *G4GIDI::getAlreadyReadTarget( const string &targetSymbol ) {
|
||||
|
||||
for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
|
||||
if( ( (*iter_targets)->name == targetSymbol ) ) return( *iter_targets );
|
||||
@@ -341,7 +341,7 @@ G4int G4GIDI::freeTarget( G4int iZ, G4int iA, G4int iM ) {
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4int G4GIDI::freeTarget( string &targetSymbol ) {
|
||||
G4int G4GIDI::freeTarget( const string &targetSymbol ) {
|
||||
|
||||
for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
|
||||
if( (*iter_targets)->name == targetSymbol ) return( freeTarget( *iter_targets ) );
|
||||
|
||||
@@ -34,7 +34,7 @@ using namespace GIDI;
|
||||
/*
|
||||
***************************************************************
|
||||
*/
|
||||
G4GIDI_map::G4GIDI_map( std::string &dataDirectory ) {
|
||||
G4GIDI_map::G4GIDI_map( const std::string &dataDirectory ) {
|
||||
|
||||
smr_initialize( &smr, smr_status_Ok, 0 );
|
||||
map = MCGIDI_map_readFile( &smr, NULL, dataDirectory.c_str( ) );
|
||||
|
||||
@@ -185,15 +185,13 @@ G4LENDManager::~G4LENDManager()
|
||||
{
|
||||
|
||||
// deleting target
|
||||
for ( std::vector < lend_target >::iterator
|
||||
it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
|
||||
for ( auto it = v_lend_target.cbegin() ; it != v_lend_target.cend() ; ++it )
|
||||
{
|
||||
(*it).lend->freeTarget( it->target );
|
||||
}
|
||||
|
||||
// deleting lend
|
||||
for ( std::map < G4ParticleDefinition* , G4GIDI* >::iterator
|
||||
it = proj_lend_map.begin() ; it != proj_lend_map.end() ; it++ )
|
||||
for ( auto it = proj_lend_map.cbegin() ; it != proj_lend_map.cend() ; ++it )
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
@@ -205,7 +203,7 @@ G4LENDManager::~G4LENDManager()
|
||||
|
||||
|
||||
|
||||
G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4String evaluation , G4int iZ , G4int iA , G4int iM )
|
||||
G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , const G4String& evaluation , G4int iZ , G4int iA , G4int iM )
|
||||
{
|
||||
|
||||
G4GIDI_target* anLENDTarget = NULL;
|
||||
@@ -217,8 +215,7 @@ G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4Stri
|
||||
G4int iTarg = GetNucleusEncoding( iZ , iA , iM );
|
||||
|
||||
// Searching in current map
|
||||
for ( std::vector < lend_target >::iterator
|
||||
it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
|
||||
for ( auto it = v_lend_target.cbegin() ; it != v_lend_target.cend() ; ++it )
|
||||
{
|
||||
if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation )
|
||||
{
|
||||
@@ -228,7 +225,7 @@ G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4Stri
|
||||
}
|
||||
|
||||
|
||||
if ( proj_lend_map.find ( proj ) == proj_lend_map.end() ) {
|
||||
if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() ) {
|
||||
G4cout << proj->GetParticleName() << " is not supported by this LEND library." << G4endl;
|
||||
return anLENDTarget; // return NULL
|
||||
}
|
||||
@@ -252,7 +249,7 @@ G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4Stri
|
||||
new_target.evaluation = evaluation;
|
||||
new_target.target_code = iTarg;
|
||||
|
||||
v_lend_target.push_back( new_target );
|
||||
v_lend_target.push_back( std::move(new_target) );
|
||||
|
||||
// found EXACT
|
||||
return anLENDTarget;
|
||||
@@ -275,8 +272,7 @@ G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4Stri
|
||||
{
|
||||
G4cout << " However you can use following evaluation(s) for the target. " << G4endl;
|
||||
|
||||
std::vector< std::string >::iterator its;
|
||||
for ( its = available->begin() ; its != available->end() ; its++ )
|
||||
for ( auto its = available->cbegin() ; its != available->cend() ; ++its )
|
||||
G4cout << *its << G4endl;
|
||||
|
||||
G4cout << G4endl;
|
||||
@@ -298,8 +294,7 @@ G4GIDI_target* G4LENDManager::GetLENDTarget( G4ParticleDefinition* proj , G4Stri
|
||||
if ( verboseLevel > 1 ) {
|
||||
G4cout << " However you can use following evaluation(s) for natural abundace of the target. " << G4endl;
|
||||
|
||||
std::vector< std::string >::iterator its;
|
||||
for ( its = available_nat->begin() ; its != available_nat->end() ; its++ )
|
||||
for ( auto its = available_nat->cbegin() ; its != available_nat->cend() ; ++its )
|
||||
G4cout << *its << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
@@ -319,7 +314,7 @@ std::vector< G4String > G4LENDManager::IsLENDTargetAvailable ( G4ParticleDefinit
|
||||
{
|
||||
|
||||
std::vector< G4String > vEvaluation;
|
||||
if ( proj_lend_map.find ( proj ) == proj_lend_map.end() )
|
||||
if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() )
|
||||
{
|
||||
G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
|
||||
return vEvaluation; // return empty
|
||||
@@ -329,8 +324,7 @@ std::vector< G4String > G4LENDManager::IsLENDTargetAvailable ( G4ParticleDefinit
|
||||
std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
|
||||
|
||||
if ( available->size() > 0 ) {
|
||||
std::vector< std::string >::iterator its;
|
||||
for ( its = available->begin() ; its != available->end() ; its++ )
|
||||
for ( auto its = available->cbegin() ; its != available->cend() ; ++its )
|
||||
vEvaluation.push_back ( *its );
|
||||
}
|
||||
delete available;
|
||||
@@ -409,7 +403,7 @@ G4double G4LENDManager::GetExcitationEnergyOfExcitedIsomer( G4int iZ , G4int iA
|
||||
G4double EE = 0.0;
|
||||
G4int nucCode = GetNucleusEncoding( iZ , iA , iM );
|
||||
auto it = mExcitationEnergy.find( nucCode );
|
||||
if ( it != mExcitationEnergy.end() ) {
|
||||
if ( it != mExcitationEnergy.cend() ) {
|
||||
EE = it->second;
|
||||
} else {
|
||||
if ( iM == 0 ) {
|
||||
|
||||
@@ -136,7 +136,6 @@ static int MCGIDI_angularEnergy_parsePointwiseFromTOM( statusMessageReporting *s
|
||||
if( ( pdfXY1 = MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf( smr, XYs, interpolationXY, energyOutProbabilityUnits ) ) == NULL ) goto err;
|
||||
y = ptwXY_integrateDomain( pdfXY1, &status );
|
||||
if( ( status = ptwXY_setValueAtX( pdfXY2, XYs->value, y ) ) != nfu_Okay ) goto errA;
|
||||
if( status != nfu_Okay ) goto errA;
|
||||
|
||||
if( y == 0 ) {
|
||||
if( ( status = ptwXY_add_double( pdfXY1, 0.5 ) ) != nfu_Okay ) goto errA;
|
||||
|
||||
@@ -142,7 +142,6 @@ static int MCGIDI_energyAngular_linear_parseFromTOM( statusMessageReporting *smr
|
||||
if( ( pdfXY1 = MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf( smr, XYs, interpolationXY, multiplicityProbabilityUnits ) ) == NULL ) goto err;
|
||||
y = ptwXY_integrateDomain( pdfXY1, &status );
|
||||
if( ( status = ptwXY_setValueAtX( pdfXY2, energyOutFactor * XYs->value, y ) ) != nfu_Okay ) goto errA;
|
||||
if( status != nfu_Okay ) goto errA;
|
||||
|
||||
if( y == 0 ) {
|
||||
if( ( status = ptwXY_add_double( pdfXY1, 0.5 ) ) != nfu_Okay ) goto errA;
|
||||
|
||||
@@ -298,7 +298,7 @@ ptwXYPoints *ptwXY_div_ptwXY( ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, nfu_stat
|
||||
*status = nfu_otherInterpolation;
|
||||
if( ptwXY1->interpolation == ptwXY_interpolationOther ) return( NULL );
|
||||
if( ptwXY2->interpolation == ptwXY_interpolationOther ) return( NULL );
|
||||
if( ( ptwXY1->interpolation == ptwXY_interpolationFlat ) || ( ptwXY1->interpolation == ptwXY_interpolationFlat ) )
|
||||
if( ( ptwXY1->interpolation == ptwXY_interpolationFlat ) || ( ptwXY2->interpolation == ptwXY_interpolationFlat ) )
|
||||
return( ptwXY_div_ptwXY_forFlats( ptwXY1, ptwXY2, status, safeDivide ) );
|
||||
|
||||
if( ( *status = ptwXY_areDomainsMutual( ptwXY1, ptwXY2 ) ) != nfu_Okay ) return( NULL );
|
||||
|
||||
Reference in New Issue
Block a user