Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -14,6 +14,11 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
4 August 2021 Alberto Ribon (hadr-gammanuc-V10-07-02)
|
||||
-----------------------------------------------------
|
||||
- G4LENDorBERTModel : set creator model ID for the secondaries, using
|
||||
the new version of G4PhysicsModelCatalog
|
||||
|
||||
16 April 2021 Ben Morgan (hadr-gammanuc-V10-07-01)
|
||||
--------------------------------------------------
|
||||
- Migrate build to modular CMake API
|
||||
|
||||
@@ -56,6 +56,7 @@ class G4LENDorBERTModel : public G4LENDModel
|
||||
private:
|
||||
G4LENDCombinedModel* lend;
|
||||
G4CascadeInterface* bert;
|
||||
G4int secID; // Creator model ID for the secondaries created by this model
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user