Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
@@ -1,66 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// G4EventGenerator
#include "G4EventGenerator.hh"
#include "G4SystemOfUnits.hh"
G4EventGenerator::G4EventGenerator()
{
SetMinEnergy (0 *GeV);
SetMaxEnergy (0 *GeV);
}
G4EventGenerator::G4EventGenerator(const G4EventGenerator &) : G4HadronicInteraction()
{
}
G4EventGenerator::~G4EventGenerator()
{
}
const G4EventGenerator & G4EventGenerator::operator=(const G4EventGenerator &)
{
throw G4HadronicException(__FILE__, __LINE__,
"G4EventGenerator::operator= meant to not be accessable");
return *this;
}
G4bool G4EventGenerator::operator==(const G4EventGenerator &) const
{
return false;
}
G4bool G4EventGenerator::operator!=(const G4EventGenerator &) const
{
return true;
}
@@ -29,7 +29,7 @@
#include "G4StringModel.hh"
G4StringModel::G4StringModel() : G4VHighEnergyGenerator(),
the3DNucleus(0), theStringFragmentationModel(0),theGenerator(0)
the3DNucleus(0), theStringFragmentationModel(0)
{
}
@@ -39,7 +39,7 @@ G4StringModel::~G4StringModel()
// private:
G4StringModel::G4StringModel(const G4StringModel &) : G4VHighEnergyGenerator(),
the3DNucleus(0), theStringFragmentationModel(0),theGenerator(0)
the3DNucleus(0), theStringFragmentationModel(0)
{
}
@@ -196,9 +196,11 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
G4V3DNucleus * ProjResNucleus=theThis->GetProjectileNucleus();
G4int numberProtonProjectileResidual( 0 ), numberNeutronProjectileResidual( 0 );
if(ProjResNucleus != 0)
{
theNuclNucleon = ProjResNucleus->StartLoop() ? ProjResNucleus->GetNextNucleon() : NULL;
G4int numberProtonProjectileHits( 0 ), numberNeutronProjectileHits( 0 );
while( theNuclNucleon )
{
if(theNuclNucleon->AreYouHit())
@@ -211,6 +213,8 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
ExcitationEp +=theNuclNucleon->GetBindingEnergy();
#endif
theNuclNucleon->SetMomentum(tmp);
if ( theNuclNucleon->GetDefinition() == G4Proton::Proton() ) ++numberProtonProjectileHits;
if ( theNuclNucleon->GetDefinition() == G4Neutron::Neutron() ) ++numberNeutronProjectileHits;
}
theNuclNucleon = ProjResNucleus->GetNextNucleon();
}
@@ -221,12 +225,16 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
<<ExcitationEp<<G4endl;
G4cout<<"Projectile residual 4 momentum "<<ProjectileResidual4Momentum<<G4endl;
#endif
numberProtonProjectileResidual = thePrimary.GetDefinition()->GetPDGCharge() - numberProtonProjectileHits;
numberNeutronProjectileResidual = thePrimary.GetDefinition()->GetBaryonNumber()
- thePrimary.GetDefinition()->GetPDGCharge() - numberNeutronProjectileHits;
}
G4V3DNucleus * ResNucleus=theThis->GetWoundedNucleus();
// loop over wounded nucleus
theNuclNucleon = ResNucleus->StartLoop() ? ResNucleus->GetNextNucleon() : NULL;
G4int numberProtonTargetHits( 0 ), numberNeutronTargetHits( 0 );
while( theNuclNucleon )
{
if(theNuclNucleon->AreYouHit())
@@ -239,6 +247,8 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
ExcitationEt +=theNuclNucleon->GetBindingEnergy();
#endif
theNuclNucleon->SetMomentum(tmp);
if ( theNuclNucleon->GetDefinition() == G4Proton::Proton() ) ++numberProtonTargetHits;
if ( theNuclNucleon->GetDefinition() == G4Neutron::Neutron() ) ++numberNeutronTargetHits;
}
theNuclNucleon = ResNucleus->GetNextNucleon();
}
@@ -257,6 +267,30 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
G4cout<<"Bsum Qsum "<<Bsum<<" "<<Qsum<<G4endl<<G4endl;
#endif
// Re-sample in the case of unphysical nuclear residual:
// 1 (H), 2 (2He), and 3 (3Li) protons alone without neutrons can exist, but not more;
// no bound states of 2 or more neutrons without protons can exist.
G4int numberProtonTargetResidual = theNucleus.GetZ_asInt() - numberProtonTargetHits;
G4int numberNeutronTargetResidual = theNucleus.GetA_asInt() - theNucleus.GetZ_asInt() - numberNeutronTargetHits;
G4bool unphysicalResidual = false;
if ( ( numberProtonTargetResidual > 3 && numberNeutronTargetResidual == 0 ) ||
( numberProtonTargetResidual == 0 && numberNeutronTargetResidual > 1 ) ) {
unphysicalResidual = true;
//G4cout << "***UNPHYSICAL TARGET RESIDUAL*** Z=" << numberProtonTargetResidual
// << " ; N=" << numberNeutronTargetResidual;
}
if ( ( numberProtonProjectileResidual > 3 && numberNeutronProjectileResidual == 0 ) ||
( numberProtonProjectileResidual == 0 && numberNeutronProjectileResidual > 1 ) ) {
unphysicalResidual = true;
//G4cout << "***UNPHYSICAL PROJECTILE RESIDUAL*** Z=" << numberProtonProjectileResidual
// << " ; N=" << numberNeutronProjectileResidual;
}
if ( unphysicalResidual ) {
//G4cout << " -> REJECTING COLLISION because of unphysical residual !" << G4endl;
Success = false;
continue;
}
//=========================================================================================
// Fragment strings
#ifdef debug_PartonStringModel