Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -14,6 +14,17 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
29 May 2019 Dennis Wright (hadr-lend-V10-05-01)
|
||||
-------------------------------------------------
|
||||
- G4LENDCapture::ApplyYourself : fix Coverity memory leak of products_from_PE
|
||||
|
||||
17 May 2019 Alberto Ribon (hadr-lend-V10-05-00)
|
||||
-----------------------------------------------
|
||||
- GIDI_settings_group, GIDI_settings_flux_order, GIDI_settings_flux,
|
||||
GIDI_settings_processedFlux : added assignment operator in these classes
|
||||
(which had the copy constructor and destructor) to fix a few warnings
|
||||
seen for the first time in g++ 9.1 .
|
||||
|
||||
9 November 2018 Gabriele Cosmo (hadr-lend-V10-04-00)
|
||||
-----------------------------------------------
|
||||
-MCGIDI_misc: fixed printout typo.
|
||||
|
||||
@@ -43,6 +43,7 @@ class GIDI_settings_group {
|
||||
GIDI_settings_group( std::string const &label, int length, double const *values );
|
||||
GIDI_settings_group( std::string const &label, std::vector<double> const &boundaries );
|
||||
GIDI_settings_group( GIDI_settings_group const &group );
|
||||
GIDI_settings_group& operator=( const GIDI_settings_group &group );
|
||||
~GIDI_settings_group( );
|
||||
|
||||
inline double operator[]( int const index ) const { return( mBoundaries[index] ); }
|
||||
@@ -105,6 +106,7 @@ class GIDI_settings_flux_order {
|
||||
std::vector<double> const &energies /**< List of energies where flux is given. */,
|
||||
std::vector<double> const &fluxes /**< List of flux value for each energies value. */ );
|
||||
GIDI_settings_flux_order( GIDI_settings_flux_order const &fluxOrder /**< Legendre flux order to copy. */ );
|
||||
GIDI_settings_flux_order& operator=( const GIDI_settings_flux_order &fluxOrder );
|
||||
~GIDI_settings_flux_order( );
|
||||
|
||||
inline int getOrder( void ) const { return( mOrder ); }
|
||||
@@ -128,6 +130,7 @@ class GIDI_settings_flux {
|
||||
GIDI_settings_flux( std::string const &label, double temperature_MeV );
|
||||
GIDI_settings_flux( char const *label, double temperature_MeV );
|
||||
GIDI_settings_flux( GIDI_settings_flux const &flux );
|
||||
GIDI_settings_flux& operator=( const GIDI_settings_flux &flux );
|
||||
~GIDI_settings_flux( );
|
||||
|
||||
GIDI_settings_flux_order const *operator[]( int order ) const;
|
||||
@@ -175,6 +178,7 @@ class GIDI_settings_processedFlux {
|
||||
public:
|
||||
GIDI_settings_processedFlux( GIDI_settings_flux const &flux, GIDI::ptwXPoints *groupX );
|
||||
GIDI_settings_processedFlux( GIDI_settings_processedFlux const &flux );
|
||||
GIDI_settings_processedFlux& operator=( const GIDI_settings_processedFlux &flux );
|
||||
~GIDI_settings_processedFlux( );
|
||||
|
||||
inline double getTemperature( ) const { return( mFlux.getTemperature( ) ); }
|
||||
|
||||
@@ -137,7 +137,7 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
|
||||
G4FragmentVector* products_from_PE = photonEvaporation.BreakItUp(nucleus);
|
||||
G4FragmentVector::iterator it;
|
||||
|
||||
for ( it = products_from_PE->begin(); it != products_from_PE->end(); it++)
|
||||
for (it = products_from_PE->begin(); it != products_from_PE->end(); it++)
|
||||
{
|
||||
if ( (*it)->GetZ_asInt() == iZ + ipZ && (*it)->GetA_asInt() == iA + ipA ) needResidual = false;
|
||||
G4DynamicParticle* theSec = new G4DynamicParticle;
|
||||
@@ -152,6 +152,7 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
|
||||
}
|
||||
theResult->AddSecondary( theSec );
|
||||
}
|
||||
delete products_from_PE;
|
||||
}
|
||||
|
||||
//if necessary, generate residual nucleus
|
||||
|
||||
@@ -56,6 +56,15 @@ void GIDI_settings_flux_order::initialize( int order, int length, double const *
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_flux_order& GIDI_settings_flux_order::operator=( const GIDI_settings_flux_order &fluxOrder ) {
|
||||
if ( this != &fluxOrder ) {
|
||||
initialize( fluxOrder.mOrder, fluxOrder.size(), &(fluxOrder.mEnergies[0]), &(fluxOrder.mFluxes[0]) );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_flux_order::~GIDI_settings_flux_order( ) {
|
||||
|
||||
}
|
||||
@@ -111,6 +120,17 @@ GIDI_settings_flux::GIDI_settings_flux( GIDI_settings_flux const &flux ) {
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_flux& GIDI_settings_flux::operator=( const GIDI_settings_flux &flux ) {
|
||||
if ( this != &flux ) {
|
||||
mLabel = flux.getLabel();
|
||||
mTemperature = flux.mTemperature;
|
||||
for( std::vector<GIDI_settings_flux_order>::const_iterator iter = flux.mFluxOrders.begin( ); iter < flux.mFluxOrders.end( ); ++iter ) addFluxOrder( *iter );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_flux::~GIDI_settings_flux( ) {
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,15 @@ void GIDI_settings_group::initialize( std::string const &label, int size1, int l
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_group& GIDI_settings_group::operator=( const GIDI_settings_group &group ) {
|
||||
if ( this != &group ) {
|
||||
initialize( group.mLabel, group.size(), group.size(), &(group.mBoundaries[0]) );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_group::~GIDI_settings_group( ) {
|
||||
|
||||
}
|
||||
|
||||
@@ -167,6 +167,33 @@ GIDI_settings_processedFlux::GIDI_settings_processedFlux( GIDI_settings_processe
|
||||
}
|
||||
return;
|
||||
|
||||
err:
|
||||
for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter ) ptwXY_free( *iter );
|
||||
for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter ) ptwX_free( *iter );
|
||||
throw 1;
|
||||
}
|
||||
/*
|
||||
=========================================================
|
||||
*/
|
||||
GIDI_settings_processedFlux& GIDI_settings_processedFlux::operator=( const GIDI_settings_processedFlux &flux ) {
|
||||
if ( this != &flux ) {
|
||||
// Clean-up existing things
|
||||
for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter ) ptwXY_free( *iter );
|
||||
for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter ) ptwX_free( *iter );
|
||||
// Now assign
|
||||
mFlux = flux.mFlux;
|
||||
nfu_status status_nf;
|
||||
ptwXYPoints *fluxXY;
|
||||
ptwXPoints *fluxX;
|
||||
for( int order = 0; order < (int) mFlux.size( ); ++order ) {
|
||||
if( ( fluxXY = ptwXY_clone( flux.mFluxXY[order], &status_nf ) ) == NULL ) goto err;
|
||||
mFluxXY.push_back( fluxXY );
|
||||
if( ( fluxX = ptwX_clone( flux.mGroupedFlux[order], &status_nf ) ) == NULL ) goto err;
|
||||
mGroupedFlux.push_back( fluxX );
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
|
||||
err:
|
||||
for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter ) ptwXY_free( *iter );
|
||||
for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter ) ptwX_free( *iter );
|
||||
|
||||
Reference in New Issue
Block a user