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
@@ -14,7 +14,20 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
20-Nov2018 A. Ribon hadr-partonstring-mgt-V10-04-03
28-Nov-2019 A. Ribon hadr-partonstring-mgt-V10-05-02
- G4VPartonStringModel : fixed bug (use of "=" instead of "==" in
if-statement, found by Coverity) in the Scatter method.
19-Nov-2019 A. Ribon hadr-partonstring-mgt-V10-05-01
- G4EventGenerator, G4InteractionCode, G4VertexCode : deleted unused classes.
14-Nov-2019 A. Ribon hadr-partonstring-mgt-V10-05-00
- G4VPartonStringModel : re-sample the string formation in the case that
the (either target or projectile) nuclear residual is an unphysical
combination of nucleons (i.e. more than three protons with no neutron,
or more than one neutron with no proton).
20-Nov-2018 A. Ribon hadr-partonstring-mgt-V10-04-03
- Minor clean-up: no changes in the random sequence.
05-Nov-2018 G. V. Uzhinsky hadr-partonstring-mgt-V10-04-02
@@ -1,55 +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. *
// ********************************************************************
//
//
//
#ifndef G4EventGenerator_h
#define G4EventGenerator_h 1
#include "G4HadronicInteraction.hh"
#include "G4VertexCode.hh"
#include "G4InteractionCode.hh"
class G4EventGenerator : public G4HadronicInteraction
{
public:
G4EventGenerator();
~G4EventGenerator();
private:
G4EventGenerator(const G4EventGenerator &right);
const G4EventGenerator & operator=(const G4EventGenerator &right);
G4bool operator==(const G4EventGenerator &right) const;
G4bool operator!=(const G4EventGenerator &right) const;
public:
virtual G4double GetWidth(G4VertexCode &theCode) = 0;
virtual G4double GetCrossSection(G4InteractionCode &theCode) = 0;
virtual G4ReactionProduct * GetFinalState(G4InteractionCode &theCode) = 0;
// please also define ApplyYourself for scattering off Hydrogen
};
#endif
@@ -1,55 +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. *
// ********************************************************************
//
//
//
#ifndef G4InteractionCode_h
#define G4InteractionCode_h 1
class G4InteractionCode
{
public:
G4InteractionCode(G4String & aCode);
void SetCode(G4String & aCode);
G4String GetCode();
private:
G4String theCode;
};
inline void G4InteractionCode::SetCode(G4String & aCode)
{
theCode = aCode;
}
inline G4String G4InteractionCode::GetCode()
{
return theCode;
}
#endif
@@ -29,8 +29,8 @@
#define G4StringModel_h 1
#include "G4VHighEnergyGenerator.hh"
#include "G4EventGenerator.hh"
#include "G4KineticTrackVector.hh"
class G4V3DNucleus;
class G4VStringFragmentation;
@@ -50,17 +50,14 @@ class G4StringModel : public G4VHighEnergyGenerator
public:
void Set3DNucleus(G4V3DNucleus *const value);
void SetStringFragmentationModel(G4VStringFragmentation *const value);
void SetGenerator(G4EventGenerator *const value);
private:
const G4V3DNucleus * Get3DNucleus() const;
const G4VStringFragmentation * GetStringFragmentationModel() const;
const G4EventGenerator * GetGenerator() const;
private:
G4V3DNucleus *the3DNucleus;
G4VStringFragmentation *theStringFragmentationModel;
G4EventGenerator *theGenerator;
};
inline const G4V3DNucleus * G4StringModel::Get3DNucleus() const
@@ -83,15 +80,5 @@ inline void G4StringModel::SetStringFragmentationModel(G4VStringFragmentation *c
theStringFragmentationModel = value;
}
inline const G4EventGenerator * G4StringModel::GetGenerator() const
{
return theGenerator;
}
inline void G4StringModel::SetGenerator(G4EventGenerator *const value)
{
theGenerator = value;
}
#endif
@@ -1,55 +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. *
// ********************************************************************
//
//
//
#ifndef G4VertexCode_h
#define G4VertexCode_h 1
#include "G4String.hh"
class G4VertexCode
{
public:
G4VertexCode(G4String & aCode);
void SetCode(G4String & aCode);
G4String GetCode();
private:
G4String theCode;
};
inline void G4VertexCode::SetCode(G4String & aCode)
{
theCode = aCode;
}
inline G4String G4VertexCode::GetCode()
{
return theCode;
}
#endif
@@ -45,17 +45,13 @@ include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4had_string_man
HEADERS
G4EventGenerator.hh
G4InteractionCode.hh
G4InteractionContent.hh
G4StringModel.hh
G4VParticipants.hh
G4VPartonStringModel.hh
G4VSplitableHadron.hh
G4VStringFragmentation.hh
G4VertexCode.hh
SOURCES
G4EventGenerator.cc
G4InteractionContent.cc
G4StringModel.cc
G4VParticipants.cc
@@ -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