Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -0,0 +1,18 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4hadronic_inclxx_utils
# Package: Geant4.src.G4processes.G4hadronic.G4hadronic_models.G4had_inclxx.G4hadronic_inclxx_utils
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:56:53 bmorgan Exp $
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
@@ -0,0 +1,52 @@
# $Id: GNUmakefile,v 1.15 2010-09-23 05:02:14 mkelsey Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
#
# Map user environment/GMake variables onto preprocessor debugging flags
#
# 20100922 J. Yarba -- Add include directories for pre-compound model
# -----------------------------------------------------------
name := G4hadronic_inclxx_interface
ifndef G4INSTALL
G4INSTALL = ../../../../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -DG4HADRONIC_ALLOC_EXPORT
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPNumerics/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/processes/hadronic/management/include/ \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/management/include \
-I$(G4BASE)/processes/hadronic/models/util/include \
-I$(G4BASE)/processes/hadronic/models/pre_equilibrium/exciton_model/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/multifragmentation/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/fermi_breakup/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/photon_evaporation/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/management/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/handler/include/ \
-I$(G4BASE)/processes/hadronic/models/de_excitation/util/include/ \
-I$(G4BASE)/processes/hadronic/models/inclxx/incl_physics/include \
-I$(G4BASE)/processes/hadronic/models/inclxx/utils/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/particles/leptons/include \
-I$(G4BASE)/particles/bosons/include \
-I$(G4BASE)/particles/hadrons/mesons/include \
-I$(G4BASE)/particles/hadrons/barions/include \
-I$(G4BASE)/particles/hadrons/ions/include \
-I$(G4BASE)/particles/shortlived/include \
-I$(G4BASE)/materials/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,94 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// INCL++ intra-nuclear cascade model
// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
// Davide Mancusi, CEA
// Alain Boudard, CEA
// Sylvie Leray, CEA
// Joseph Cugnon, University of Liege
//
// INCL++ revision: v5.0_rc3
//
#define INCLXX_IN_GEANT4_MODE 1
#include "globals.hh"
#ifndef G4INCLXXFactory_hh
#define G4INCLXXFactory_hh 1
#include "G4Nucleus.hh"
#include "G4HadProjectile.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4Alpha.hh"
#include "G4ParticleTable.hh"
#include "G4INCLConfig.hh"
#include "G4INCLCascade.hh"
/**
* Build a new INCL++ instance with correct configuration and input information.
*/
class G4INCLXXFactory {
public:
/**
* Convert G4ParticleDefinition to corresponding INCL particle type
*/
static G4INCL::ParticleType toINCLParticleType(const G4ParticleDefinition*);
/**
* Convert INCL particle type to corresponding G4ParticleDefinition
*/
static const G4ParticleDefinition* fromINCLParticleType(G4INCL::ParticleType);
/**
* Create INCL projectile particle
*/
static G4INCL::Particle* createProjectile(const G4HadProjectile &);
/**
* Create the INCL model initialized with the target information
*/
static G4INCL::INCL* createModel(const G4Nucleus &);
static G4DynamicParticle* toG4Particle(G4int A, G4int Z , G4double kinE, G4double px, G4double py, G4double pz);
static G4ParticleDefinition* toG4ParticleDefinition (G4int A,
G4int Z);
static G4double remnant4MomentumScaling(G4double mass,
G4double kineticE,
G4double px, G4double py, G4double pz);
protected:
G4INCLXXFactory() {};
~G4INCLXXFactory() {};
};
#endif
@@ -0,0 +1,124 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// INCL++ intra-nuclear cascade model
// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
// Davide Mancusi, CEA
// Alain Boudard, CEA
// Sylvie Leray, CEA
// Joseph Cugnon, University of Liege
//
// INCL++ revision: v5.0_rc3
//
#define INCLXX_IN_GEANT4_MODE 1
#include "globals.hh"
#ifndef G4INCLXXInterface_hh
#define G4INCLXXInterface_hh 1
#include "G4Nucleon.hh"
#include "G4Nucleus.hh"
#include "G4HadronicInteraction.hh"
#include "G4VIntraNuclearTransportModel.hh"
#include "G4KineticTrackVector.hh"
#include "G4FragmentVector.hh"
#include "G4ParticleChange.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
// INCL++
#include "G4INCLCascade.hh"
// Geant4 de-excitation
#include "G4ExcitationHandler.hh"
#include <fstream>
#include <iostream>
using namespace std;
/**
* <h1>INCL G4intra-nuclear cascade with G4ExcitationHandler for de-excitation</h1>
*
* Interface for INCL. This G4interface handles basic hadron
* bullet particles (protons, neutrons, pions).
*
* Example usage in case of protons:
* @code
* G4InclCascadeInterface* inclModel = new G4InclCascadeInterface;
* inclModel -> SetMinEnergy(0.0 * MeV); // Set the energy limits
* inclModel -> SetMaxEnergy(3.0 * GeV);
*
* G4ProtonInelasticProcess* protonInelasticProcess = new G4ProtonInelasticProcess();
* G4ProtonInelasticCrossSection* protonInelasticCrossSection = new G4ProtonInelasticCrossSection();
*
* protonInelasticProcess -> RegisterMe(inclModel);
* protonInelasticProcess -> AddDataSet(protonInelasticCrossSection);
*
* particle = G4Proton::Proton();
* processManager = particle -> GetProcessManager();
* processManager -> AddDiscreteProcess(protonInelasticProcess);
* @endcode
* The same setup procedure is needed for neutron and pion inelastic processes
* as well.
*
* @see G4InclLightIonInterface
*/
class G4INCLXXInterface : public G4VIntraNuclearTransportModel {
public:
G4INCLXXInterface(const G4String& name = "INCL++ Cascade with G4ExcitationHandler");
G4int operator==(G4INCLXXInterface& right) {
return (this == &right);
}
G4int operator!=(G4INCLXXInterface& right) {
return (this != &right);
}
~G4INCLXXInterface(); // Destructor
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus); // Idle
/**
* Main method to apply the INCL physics model.
* @param aTrack the projectile particle
* @param theNucleus target nucleus
* @return the output of the INCL physics model
*/
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus);
private:
G4INCL::INCL *theINCLModel;
G4HadFinalState theResult;
G4ExcitationHandler *theExcitationHandler;
G4bool storeDebugOutput;
std::ofstream *debugOutputFile;
G4bool dumpInput;
};
#endif
@@ -0,0 +1,77 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4hadronic_hetcpp_utils
# Package: Geant4.src.G4processes.G4hadronic.G4hadronic_models.G4had_hetcpp.G4hadronic_hetcpp_utils
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake,v 1.1 2010-09-29 18:57:01 bmorgan Exp $
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/materials/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/bosons/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/hadrons/barions/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/hadrons/ions/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/hadrons/mesons/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/leptons/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/cross_sections/include)
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/util/include)
include_directories(${CMAKE_SOURCE_DIR}/source/processes/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4hadronic_inclxx_interface
HEADERS
G4INCLXXFactory.hh
G4INCLXXInterface.hh
SOURCES
G4INCLXXFactory.cc
G4INCLXXInterface.cc
GRANULAR_DEPENDENCIES
G4baryons
G4bosons
G4geometrymng
G4globman
G4hadronic_mgt
G4hadronic_util
G4hadronic_xsect
G4ions
G4leptons
G4materials
G4mesons
G4partman
G4procman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4materials
G4particles
G4track
LINK_LIBRARIES
)
# List any source specific properties here
@@ -0,0 +1,135 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// INCL++ intra-nuclear cascade model
// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
// Davide Mancusi, CEA
// Alain Boudard, CEA
// Sylvie Leray, CEA
// Joseph Cugnon, University of Liege
//
// INCL++ revision: v5.0_rc3
//
#define INCLXX_IN_GEANT4_MODE 1
#include "globals.hh"
#include "G4INCLXXFactory.hh"
#include "G4ParticleTable.hh"
G4INCL::ParticleType G4INCLXXFactory::toINCLParticleType(const G4ParticleDefinition *pdef) {
if( pdef == G4Proton::Proton()) return G4INCL::Proton;
else if(pdef == G4Neutron::Neutron()) return G4INCL::Neutron;
else if(pdef == G4PionPlus::PionPlus()) return G4INCL::PiPlus;
else if(pdef == G4PionMinus::PionMinus()) return G4INCL::PiMinus;
else if(pdef == G4PionZero::PionZero()) return G4INCL::PiZero;
else return G4INCL::UnknownParticle;
}
const G4ParticleDefinition* G4INCLXXFactory::fromINCLParticleType(G4INCL::ParticleType ptype) {
if( ptype == G4INCL::Proton) return G4Proton::Proton();
else if(ptype == G4INCL::Neutron) return G4Neutron::Neutron();
else if(ptype == G4INCL::PiPlus) return G4PionPlus::PionPlus();
else if(ptype == G4INCL::PiMinus) return G4PionMinus::PionMinus();
else if(ptype == G4INCL::PiZero) return G4PionZero::PionZero();
else if(ptype == G4INCL::UnknownParticle) return 0;
else return 0;
}
G4INCL::Particle* G4INCLXXFactory::createProjectile(const G4HadProjectile &aTrack) {
const G4ParticleDefinition *pdef = aTrack.GetDefinition();
G4INCL::ParticleType projectileType = G4INCLXXFactory::toINCLParticleType(pdef);
const G4double kineticEnergy = aTrack.GetKineticEnergy();
const G4double mass = G4INCL::ParticleTable::getMass(projectileType);
const G4double energy = kineticEnergy + mass;
const G4double pz = std::sqrt(energy*energy - mass*mass);
G4INCL::ThreeVector momentum(0.0, 0.0, pz);
G4INCL::ThreeVector position(0.0, 0.0, 0.0); // Projectile position
// doesn't actually
// matter.
G4INCL::Particle *projectile = new G4INCL::Particle(projectileType, energy,
momentum, position);
return projectile;
}
G4INCL::INCL* G4INCLXXFactory::createModel(const G4Nucleus &theNucleus) {
G4int A = theNucleus.GetA_asInt();
G4int Z = theNucleus.GetZ_asInt();
G4INCL::Config *theConfig = new G4INCL::Config(A, Z, G4INCL::Proton, 1200.0);
theConfig->setTargetA(A);
theConfig->setTargetZ(Z);
G4INCL::INCL *theINCLModel = new G4INCL::INCL(theConfig);
return theINCLModel;
}
G4ParticleDefinition* G4INCLXXFactory::toG4ParticleDefinition(G4int A,
G4int Z) {
if (A == 1 && Z == 1) return G4Proton::Proton();
else if(A == 1 && Z == 0) return G4Neutron::Neutron();
else if(A == 0 && Z == 1) return G4PionPlus::PionPlus();
else if(A == 0 && Z == -1) return G4PionMinus::PionMinus();
else if(A == 0 && Z == 0) return G4PionZero::PionZero();
else if(A == 2 && Z == 1) return G4Deuteron::Deuteron();
else if(A == 3 && Z == 1) return G4Triton::Triton();
else if(A == 3 && Z == 2) return G4He3::He3();
else if(A == 4 && Z == 2) return G4Alpha::Alpha();
else if(A > 0 && Z > 0 && A > Z) { // Returns ground state ion definition
return G4ParticleTable::GetParticleTable()->GetIon(Z, A, 0.0);
} else { // Error, unrecognized particle
return 0;
}
}
G4DynamicParticle* G4INCLXXFactory::toG4Particle(G4int A, G4int Z,
G4double kinE,
G4double px,
G4double py, G4double pz) {
const G4ParticleDefinition *def = toG4ParticleDefinition(A, Z);
if(def == 0) { // Check if we have a valid particle definition
return 0;
}
const G4double energy = kinE / MeV;
const G4ThreeVector momentum(px, py, pz);
const G4ThreeVector momentumDirection = momentum.unit();
G4DynamicParticle *p = new G4DynamicParticle(def, momentumDirection, energy);
return p;
}
G4double G4INCLXXFactory::remnant4MomentumScaling(G4double mass,
G4double kineticE,
G4double px, G4double py,
G4double pz) {
const G4double p2 = px*px + py*py + pz*pz;
if(p2 > 0.0) {
const G4double pnew2 = kineticE*kineticE + 2.0*kineticE*mass;
return std::sqrt(pnew2)/std::sqrt(p2);
} else {
return 1.0;
}
}
@@ -0,0 +1,261 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// INCL++ intra-nuclear cascade model
// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
// Davide Mancusi, CEA
// Alain Boudard, CEA
// Sylvie Leray, CEA
// Joseph Cugnon, University of Liege
//
// INCL++ revision: v5.0_rc3
//
#define INCLXX_IN_GEANT4_MODE 1
#include "globals.hh"
#include "G4INCLXXInterface.hh"
#include "G4INCLXXFactory.hh"
#include "math.h"
#include "G4GenericIon.hh"
#include "CLHEP/Random/Random.h"
#include "G4INCLConfig.hh"
#include "G4INCLCascade.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
G4INCLXXInterface::G4INCLXXInterface(const G4String& nam)
:G4VIntraNuclearTransportModel(nam)
{
// Use the environment variable G4INCLXX_NO_DE_EXCITATION to disable de-excitation
if(getenv("G4INCLXX_NO_DE_EXCITATION")) {
G4cout <<"INCL++ Interface: WARNING: De-excitation is completely disabled!" << G4endl;
theExcitationHandler = 0;
} else {
theExcitationHandler = new G4ExcitationHandler;
}
if(getenv("G4INCLXX_STORE_RAW_DEBUG_OUTPUT")) {
storeDebugOutput = true;
debugOutputFile = new std::ofstream("inclDebug.out");
} else {
storeDebugOutput = false;
}
dumpInput = false;
}
G4INCLXXInterface::~G4INCLXXInterface()
{
delete theExcitationHandler;
if(storeDebugOutput) {
debugOutputFile->close();
}
}
G4HadFinalState* G4INCLXXInterface::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus)
{
const G4int maxTries = 200;
// G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
// Create new INCL config object that contains the projectile and target information. This object also contains the model parameters (e.g.
// INCL assumes the projectile particle is going in the direction of
// the Z-axis. Here we construct proper rotation to convert the
// momentum vectors of the outcoming particles to the original
// coordinate system.
G4LorentzVector projectileMomentum = aTrack.Get4Momentum();
// INCL++ assumes that the projectile is going in the direction of
// the z-axis. In principle, if the coordinate system used by G4
// hadronic framework is defined differently we need a rotation to
// transform the INCL++ reaction products to the appropriate
// frame. Please note that it isn't necessary to apply this
// transform to the projectile because when creating the INCL++
// projectile particle G4INCLXXFactory::createProjectile needs to
// use only the projectile energy (direction is simply assumed to be
// along z-axis).
G4LorentzRotation toZ;
toZ.rotateZ(-projectileMomentum.phi());
toZ.rotateY(-projectileMomentum.theta());
G4LorentzRotation toLabFrame = toZ.inverse();
// However, it turns out that the projectile given to us by G4
// hadronic framework is already going in the direction of the
// z-axis so this rotation is actually unnecessary. Both toZ and
// toLabFrame turn out to be unit matrices as can be seen by
// uncommenting the folowing two lines:
// G4cout <<"toZ = " << toZ << G4endl;
// G4cout <<"toLabFrame = " << toLabFrame << G4endl;
theResult.Clear(); // Make sure the output data structure is clean.
theResult.SetStatusChange(stopAndKill);
std::list<G4Fragment> remnants;
G4int nTries = 0;
// INCL can generate transparent events. However, this is meaningful
// only in the standalone code. In Geant4 we must "force" INCL to
// produce a valid cascade.
G4bool eventIsOK = false;
do {
G4INCL::INCL *theINCLModel = G4INCLXXFactory::createModel(theNucleus);
G4INCL::Particle *theProjectile = G4INCLXXFactory::createProjectile(aTrack);
if(dumpInput) {
G4cout << theINCLModel->configToString() << G4endl;
}
const G4INCL::EventInfo eventInfo = theINCLModel->processEvent(theProjectile);
// eventIsOK = !eventInfo.transparent && nTries < maxTries;
eventIsOK = !eventInfo.transparent;
if(eventIsOK) {
for(G4int i = 0; i < eventInfo.nParticles; i++) {
G4int A = eventInfo.A[i];
G4int Z = eventInfo.Z[i];
// G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
G4double kinE = eventInfo.EKin[i];
G4double px = eventInfo.px[i];
G4double py = eventInfo.py[i];
G4double pz = eventInfo.pz[i];
G4DynamicParticle *p = G4INCLXXFactory::toG4Particle(A, Z , kinE, px, py, pz);
if(p != 0) {
const G4LorentzVector momentum = p->Get4Momentum();
// Set the four-momentum of the reaction products and apply the toLabFrame rotation
p->Set4Momentum(toLabFrame * momentum);
theResult.AddSecondary(p);
if(storeDebugOutput) {
(*debugOutputFile) << "p " << eventInfo.A[i] << '\t' << eventInfo.Z[i] <<
'\t' << eventInfo.emissionTime[i] << '\t' << eventInfo.EKin[i] << '\t' <<
eventInfo.px[i] << '\t' << eventInfo.py[i] << '\t' <<
eventInfo.pz[i] << '\t' << eventInfo.theta[i] << '\t' <<
eventInfo.phi[i] << '\t' << eventInfo.origin[i] << '\t' <<
eventInfo.history[i] << std::endl;
}
} else {
G4cout <<"Warning: INCL++ produced a particle that couldn't be converted to Geant4 particle." << G4endl;
}
}
for(G4int i = 0; i < eventInfo.nRemnants; i++) {
G4int A = eventInfo.ARem[i];
G4int Z = eventInfo.ZRem[i];
// G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
G4double kinE = eventInfo.EKinRem[i];
G4double px = eventInfo.pxRem[i];
G4double py = eventInfo.pyRem[i];
G4double pz = eventInfo.pzRem[i];
G4double excitationE = eventInfo.EStarRem[i];
G4double nuclearMass = G4NucleiProperties::GetNuclearMass(A, Z) + excitationE;
G4double scaling = G4INCLXXFactory::remnant4MomentumScaling(nuclearMass,
kinE,
px, py, pz);
G4LorentzVector fourMomentum(scaling * px, scaling * py, scaling * pz,
nuclearMass + kinE);
if(std::abs(scaling - 1.0) > 0.01) {
G4cout <<"WARNING: momentum scaling = " << scaling << G4endl;
G4cout <<"Lorentz vector = " << fourMomentum << G4endl;
}
G4Fragment remnant(A, Z, fourMomentum);
remnants.push_back(remnant);
if(storeDebugOutput) {
(*debugOutputFile) << "r " << eventInfo.ARem[i] << '\t' <<
eventInfo.ZRem[i] << '\t' << eventInfo.EStarRem[i] << '\t' <<
eventInfo.JRem[i] << '\t' << eventInfo.EKinRem[i] << '\t' <<
eventInfo.pxRem[i] << '\t' << eventInfo.pyRem[i] << '\t' <<
eventInfo.pzRem[i] << '\t' << eventInfo.thetaRem[i] << '\t' <<
eventInfo.phiRem[i] << std::endl;
}
}
}
delete theINCLModel;
nTries++;
} while(!eventIsOK && nTries < maxTries);
// De-excitation:
if(theExcitationHandler != 0) {
for(std::list<G4Fragment>::const_iterator i = remnants.begin();
i != remnants.end(); i++) {
const G4LorentzVector remnant4Momentum = (*i).GetMomentum();
G4LorentzRotation toRemnantZ;
toRemnantZ.rotateZ(-remnant4Momentum.theta());
toRemnantZ.rotateY(-remnant4Momentum.phi());
const G4LorentzRotation toRemnantLab = toRemnantZ.inverse();
G4LorentzVector remnant4MomentumCM = remnant4Momentum;
remnant4MomentumCM *= toRemnantZ;
remnant4MomentumCM.boost(-remnant4Momentum.boostVector());
G4ReactionProductVector *deExcitationResult = theExcitationHandler->BreakItUp((*i));
for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
fragment != deExcitationResult->end(); ++fragment) {
G4ParticleDefinition *def = (*fragment)->GetDefinition();
if(def != 0) {
G4DynamicParticle *theFragment = new G4DynamicParticle(def, (*fragment)->GetMomentum());
G4LorentzVector labMomentum = theFragment->Get4Momentum();
labMomentum.boost(remnant4Momentum.boostVector());
labMomentum *= toRemnantLab;
labMomentum *= toLabFrame;
theFragment->Set4Momentum(labMomentum);
theResult.AddSecondary(theFragment);
if(storeDebugOutput) {
G4int A = def->GetAtomicMass();
G4int Z = def->GetAtomicNumber();
G4double fragmentEkin = theFragment->GetKineticEnergy() / MeV;
G4ThreeVector mom = theFragment->GetMomentum();
(*debugOutputFile) << "de-excitation: p " << A << '\t' << Z << '\t' <<
"-1.0" << '\t' << fragmentEkin << '\t' <<
mom.x() << '\t' << mom.y() << '\t' << mom.z() << '\t' <<
mom.theta() << '\t' <<
mom.phi() << '\t' << "-2" << '\t' <<
"0" << std::endl;
}
}
}
for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
fragment != deExcitationResult->end(); ++fragment) {
delete (*fragment);
}
deExcitationResult->clear();
delete deExcitationResult;
}
}
remnants.clear();
return &theResult;
}
G4ReactionProductVector* G4INCLXXInterface::Propagate(G4KineticTrackVector* , G4V3DNucleus* ) {
return 0;
}