Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -27,12 +27,14 @@
#include "G4LENDCombinedModel.hh"
#include "G4CascadeInterface.hh"
#include "G4DynamicParticle.hh"
#include "G4PhysicsModelCatalog.hh"
G4LENDorBERTModel::G4LENDorBERTModel( G4ParticleDefinition* pd )
:G4LENDModel( "LENDorBERTModel" ) {
:G4LENDModel( "LENDorBERTModel" ), secID( -1 ) {
proj = pd;
lend = new G4LENDCombinedModel( proj );
bert = new G4CascadeInterface;
secID = G4PhysicsModelCatalog::GetModelID( "model_" + GetModelName() );
}
void G4LENDorBERTModel::BuildPhysicsTable(const G4ParticleDefinition& projectile) {
@@ -46,13 +48,13 @@ G4HadFinalState * G4LENDorBERTModel::ApplyYourself(const G4HadProjectile& aTrack
G4int iZ = aTarg.GetZ_asInt();
G4int iA = aTarg.GetA_asInt();
G4int iM = 0;
if ( aTarg.GetIsotope() != NULL ) iM = aTarg.GetIsotope()->Getm();
if ( aTarg.GetIsotope() != nullptr ) iM = aTarg.GetIsotope()->Getm();
G4DynamicParticle* dp = new G4DynamicParticle( aTrack.GetDefinition() , G4ThreeVector(0.,0.,1.) , aTrack.GetKineticEnergy() );
G4bool lendIsOK = lend->HasData( dp , iZ , iA , iM , aTarg.GetIsotope() , NULL , aTrack.GetMaterial() );
G4bool lendIsOK = lend->HasData( dp , iZ , iA , iM , aTarg.GetIsotope() , nullptr , aTrack.GetMaterial() );
delete dp;
G4HadronicInteraction* model=NULL;
G4HadronicInteraction* model = nullptr;
if ( lendIsOK ) {
//G4cout << "LEND is selected" << G4endl;
model = lend;
@@ -61,5 +63,14 @@ G4HadFinalState * G4LENDorBERTModel::ApplyYourself(const G4HadProjectile& aTrack
model = bert;
}
return model->ApplyYourself(aTrack,aTarg);
G4HadFinalState* result = model->ApplyYourself(aTrack,aTarg);
// Assign the creator model ID to the secondaries
if ( result != nullptr ) {
for ( size_t i = 0; i < result->GetNumberOfSecondaries(); ++i ) {
result->GetSecondary( i )->SetCreatorModelID( secID );
}
}
return result;
}