Import Geant4 9.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:16:48 +02:00
parent 75c7fd177d
commit a8e9364cea
6592 changed files with 84274 additions and 69292 deletions
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
25 May 2007 Dennis Wright for Aatos Heikkinen (hadr-casc-V08-03-00)
-------------------------------------------------------------------
- implemented interfaces for pre-equilibrium and equilbrium evaporation
models
04 May 2007 Aatos Heikkinen (hadr-casc-V08-02-00)
-------------------------------------------------
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.8 2003/10/08 14:53:20 hpw Exp $
# $Id: GNUmakefile,v 1.9 2007/05/20 12:01:26 miheikki Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
@@ -25,6 +25,7 @@ CPPFLAGS += -I$(G4BASE)/global/management/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/de_excitation/evaporation/include/ \
-I$(G4BASE)/processes/hadronic/models/cascade/cascade/include \
-I$(G4BASE)/processes/hadronic/models/cascade/utils/include \
-I$(G4BASE)/particles/management/include \
@@ -47,6 +47,9 @@ class G4BertiniData //: public G4VIntraNuclearTransportModel
private:
static G4BertiniData* theInstance;
public:
static const G4int pair[6][2];
};
#endif
@@ -23,12 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// CLASS DESCRIPTION
// G4CascadeInterface defines an interface to HETC and INUCL
// models of an medium energy (~ 0.5 - 10 GeV) intra-nuclear transport.
// If you have any questions, please contact
// package writer aatos.heikkinen@cern.ch.
// --------------------------------------------------------------------
// $Id: G4CascadeInterface.hh,v 1.12 2007/05/23 12:25:54 miheikki Exp $
// Defines an interface to Bertini (BERT) cascade
// based on INUCL intra-nuclear transport.models
// with bullet hadron energy ~< 10 GeV
#ifndef G4CASCADEINTERFACE_H
#define G4CASCADEINTERFACE_H 1
@@ -44,7 +43,6 @@
class G4CascadeInterface : public G4VIntraNuclearTransportModel {
public:
G4CascadeInterface();
~G4CascadeInterface(){
@@ -52,11 +50,9 @@ public:
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus);
private:
G4int operator==(G4CascadeInterface& right) {
return (this == &right);
}
@@ -66,6 +62,7 @@ private:
}
G4int verboseLevel;
private:
G4HadFinalState theResult;
@@ -23,16 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// CLASS DESCRIPTION
// G4CascadeInterface defines an interface to HETC and INUCL
// models of an medium energy (~ 0.5 - 5 GeV) intra-nuclear transport.
// If you have any questions, please contact
// package writer aatos.heikkinen@cern.ch.
// --------------------------------------------------------------------
// This file is based on G4CascadeInterface.hh
// Modifications by: Pekka Kaitaniemi (kaitanie@cc.helsinki.fi)
// Helsinki Institute of Physics
// Pekka Kaitaniemi, HIP
// Aatos Heikkinen
#ifndef G4ELASTICCASCADEINTERFACE_H
#define G4ELASTICCASCADEINTERFACE_H 1
@@ -46,23 +38,15 @@
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
class G4ElasticCascadeInterface : public G4VIntraNuclearTransportModel {
public:
G4ElasticCascadeInterface();
~G4ElasticCascadeInterface(){
}
~G4ElasticCascadeInterface(){}
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus);
private:
G4int operator==(G4ElasticCascadeInterface& right) {
return (this == &right);
}
@@ -72,9 +56,7 @@ private:
}
G4int verboseLevel;
private:
G4HadFinalState theResult;
};
#endif //G4ELASTICCASCADEINTERFACE_H
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4EvaporationInuclCollider.hh,v 1.1 2007/05/24 17:41:20 miheikki Exp $
#ifndef G4EVAPORATIONINUCL_COLLIDER_HH
#define G4EVAPORATIONINUCL_COLLIDER_HH
#include "G4Collider.hh"
#include "G4EquilibriumEvaporator.hh"
#include "G4Fissioner.hh"
#include "G4BigBanger.hh"
#include "G4ElementaryParticleCollider.hh"
#include "G4InteractionCase.hh"
#include "G4InuclNuclei.hh"
#include "G4InuclSpecialFunctions.hh"
#include "G4Analyser.hh"
using namespace G4InuclSpecialFunctions;
class G4EvaporationInuclCollider : public G4Collider {
public:
G4EvaporationInuclCollider();
G4EvaporationInuclCollider(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) {
setEquilibriumEvaporator(eqevaporator, fissioner, bigbanger);
};
void setEquilibriumEvaporator(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) {
theEquilibriumEvaporator = eqevaporator;
theEquilibriumEvaporator->setFissioner(fissioner);
theEquilibriumEvaporator->setBigBanger(bigbanger);
};
void setBigBanger(G4BigBanger* bigbanger) {
theBigBanger = bigbanger;
};
virtual G4CollisionOutput collide(G4InuclParticle* bullet, G4InuclParticle* target);
private:
G4int verboseLevel;
G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
G4InuclParticle* target,
G4double ekin) const;
G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,
G4InuclParticle* target) const;
G4bool explosion(G4InuclNuclei* target) const;
G4EquilibriumEvaporator* theEquilibriumEvaporator;
G4BigBanger* theBigBanger;
};
#endif // G4EVAPORATIONINUCL_COLLIDER_HH
@@ -72,6 +72,20 @@ public:
valid_particle = true;
};
G4InuclElementaryParticle(const std::vector<G4double>& mom,
G4int type, G4int model)
: G4InuclParticle(mom),
particleType(type) {
G4InuclParticle::setModel(model);
particleMass = getParticleMass(type);
momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] +
momentum[3] * momentum[3] + particleMass * particleMass);
valid_particle = true;
};
G4InuclElementaryParticle(G4double ekin,
G4int type)
: particleType(type) {
@@ -450,7 +464,6 @@ private:
G4double particleMass;
G4bool valid_particle;
};
#endif // G4INUCL_ELEMENTARY_PARTICLE_HH
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4InuclEvaporation.hh,v 1.5 2007/05/24 23:27:01 miheikki Exp $
// Defines an interface to evaporation models of Bertini cascase (BERT)
// based on INUCL code.
//
#ifndef G4INUCLEVAPORATION_h
#define G4INUCLEVAPORATION_h 1
#include "globals.hh"
#include "G4VEvaporation.hh"
#include "G4Fragment.hh"
//#define DEBUG
class G4InuclEvaporation : public G4VEvaporation {
public:
G4InuclEvaporation();
~G4InuclEvaporation();
private:
G4InuclEvaporation(const G4InuclEvaporation &right);
const G4InuclEvaporation & operator=(const G4InuclEvaporation &right);
G4bool operator==(const G4InuclEvaporation &right) const;
G4bool operator!=(const G4InuclEvaporation &right) const;
void fillResult( std::vector< G4DynamicParticle * > secondaryParticleVector,
G4FragmentVector * aResult );
public:
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus);
void setVerboseLevel( const G4int verbose );
private:
G4int verboseLevel;
#ifdef DEBUG
#endif
};
#endif
@@ -33,50 +33,70 @@
#include <iostream>
#include <vector>
// Notice: no cc-file for G4InuclParticle
class G4InuclParticle {
public:
G4InuclParticle() {};
G4InuclParticle() {
setModel(0); // default model
};
virtual ~G4InuclParticle() { };
G4InuclParticle(const std::vector<G4double>& mom) {
setMomentum(mom);
setModel(0);
};
void setMomentum(const std::vector<G4double>& mom) {
momentum = mom;
};
std::vector<G4double> getMomentum() const {
std::vector<G4double> getMomentum() const {
return momentum;
};
G4double getMomModule() const {
return std::sqrt(momentum[1] * momentum[1] +
momentum[2] * momentum[2] +
momentum[3] * momentum[3]);
momentum[2] * momentum[2] +
momentum[3] * momentum[3]);
};
virtual void printParticle() const {
G4cout << " px " << momentum[1] << " py " << momentum[2] <<
" pz " << momentum[3] <<
" pmod " << std::sqrt(momentum[1] * momentum[1] +
momentum[2] * momentum[2] +
momentum[3] * momentum[3])
<< " E " << momentum[0] << G4endl;
momentum[2] * momentum[2] +
momentum[3] * momentum[3])
<< " E " << momentum[0]
<< " creator model " << modelId << G4endl;
};
void setModel(G4int model) {
modelId = model;
};
G4int getModel() {
return modelId;
};
protected:
std::vector<G4double> momentum;
private:
G4int modelId; // used to indicate model that created instance of G4InuclParticle
// 0 default
// 1 bullet
// 2 target
// 3 G4ElementaryParticleCollider
// 4 G4IntraNucleiCascader
// 5 G4NonEquilibriumEvaporator
// 6 G4EquilibriumEvaporator
// 7 G4Fissioner
// 8 G4BigBanger
};
#endif // G4INUCL_PARTICLE_HH
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4PreCompoundCascadeInterface.hh,v 1.1 2007/05/23 14:37:28 miheikki Exp $
// Defines an interface to Bertini (BERT) INC with exitons. Evaporation is NOT included
#ifndef G4PRECOMPOUNDCASCADEINTERFACE_H
#define G4PRECOMPOUNDCASCADEINTERFACE_H 1
#include "G4Nucleon.hh"
#include "G4Nucleus.hh"
#include "G4VIntraNuclearTransportModel.hh"
#include "G4KineticTrackVector.hh"
#include "G4FragmentVector.hh"
#include "G4ParticleChange.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
class G4PreCompoundCascadeInterface : public G4VIntraNuclearTransportModel {
public:
G4PreCompoundCascadeInterface();
~G4PreCompoundCascadeInterface(){
}
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus);
private:
G4int operator==(G4PreCompoundCascadeInterface& right) {
return (this == &right);
}
G4int operator!=(G4PreCompoundCascadeInterface& right) {
return (this != &right);
}
G4int verboseLevel;
private:
G4HadFinalState theResult;
};
#endif // G4PRECOMPOUNDCASCADEINTERFACE_H
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * 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 G4PRECOMPOUNDINUCL_COLLIDER_HH
#define G4PRECOMPOUNDINUCL_COLLIDER_HH
#include "G4Collider.hh"
#include "G4IntraNucleiCascader.hh"
#include "G4NonEquilibriumEvaporator.hh"
#include "G4BigBanger.hh"
#include "G4ElementaryParticleCollider.hh"
#include "G4InteractionCase.hh"
#include "G4InuclNuclei.hh"
#include "G4InuclSpecialFunctions.hh"
#include "G4Analyser.hh"
using namespace G4InuclSpecialFunctions;
class G4PreCompoundInuclCollider : public G4Collider {
public:
G4PreCompoundInuclCollider();
G4PreCompoundInuclCollider(G4ElementaryParticleCollider* ecollider,
G4IntraNucleiCascader* incascader,
G4NonEquilibriumEvaporator* noeqevaporator,
G4BigBanger* bigbanger) {
setElementaryParticleCollider(ecollider);
setIntraNucleiCascader(incascader,ecollider);
setNonEquilibriumEvaporator(noeqevaporator);
setBigBanger(bigbanger);
};
void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) {
theElementaryParticleCollider = ecollider;
};
void setIntraNucleiCascader(G4IntraNucleiCascader* incascader,
G4ElementaryParticleCollider* ecollider) {
theIntraNucleiCascader = incascader;
theIntraNucleiCascader->setElementaryParticleCollider(ecollider);
};
void setNonEquilibriumEvaporator(G4NonEquilibriumEvaporator* noeqevaporator) {
theNonEquilibriumEvaporator = noeqevaporator;
};
void setBigBanger(G4BigBanger* bigbanger) {
theBigBanger = bigbanger;
};
virtual G4CollisionOutput collide(G4InuclParticle* bullet,
G4InuclParticle* target);
private:
G4int verboseLevel;
G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
G4InuclParticle* target,
G4double ekin) const;
G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,
G4InuclParticle* target) const;
G4bool explosion(G4InuclNuclei* target) const;
G4ElementaryParticleCollider* theElementaryParticleCollider;
G4IntraNucleiCascader* theIntraNucleiCascader;
G4NonEquilibriumEvaporator* theNonEquilibriumEvaporator;
G4BigBanger* theBigBanger;
};
#endif // G4PRECOMPOUNDINUCL_COLLIDER_HH
@@ -25,6 +25,7 @@
//
#include "G4Analyser.hh"
#include <cmath>
#include <iomanip>
G4Analyser::G4Analyser()
:verboseLevel(1) {
@@ -341,13 +342,14 @@ void G4Analyser::printResultsNtuple() {
// Create one line of ACII data.
// Several runs should create ntuple for data-analysis
G4cout << int(eventNumber + 0.1) << " " <<
averageMultiplicity / eventNumber << " " <<
averageProtonNumber / eventNumber << " " <<
averageNeutronNumber / eventNumber << " " <<
averageNucleonKinEnergy / (averageProtonNumber + averageNeutronNumber) << " " <<
averageProtonKinEnergy / (averageProtonNumber + 1.0e-10) << " " <<
averageNeutronKinEnergy / (averageNeutronNumber + 1.0e-10) << " " <<
averagePionNumber / eventNumber << " " <<
averagePionKinEnergy / (averagePionNumber + 1.0e-10) << G4endl;
G4cout <<
std::setw(15) << int(eventNumber + 0.1) <<
std::setw(15) << averageMultiplicity / eventNumber <<
std::setw(15) << averageProtonNumber / eventNumber <<
std::setw(15) << averageNeutronNumber / eventNumber << " " <<
std::setw(15) << averageNucleonKinEnergy / (averageProtonNumber + averageNeutronNumber) << " " <<
std::setw(15) << averageProtonKinEnergy / (averageProtonNumber + 1.0e-10) << " " <<
std::setw(15) << averageNeutronKinEnergy / (averageNeutronNumber + 1.0e-10) << " " <<
std::setw(15) << averagePionNumber / eventNumber << " " <<
std::setw(15) << averagePionKinEnergy / (averagePionNumber + 1.0e-10) << G4endl;
}
@@ -31,3 +31,5 @@
// Initialize static pointer for singleton instance
G4BertiniData* G4BertiniData::theInstance = 0;
const G4int G4BertiniData::pair[6][2] =
{{0, 1}, {1, 7}, {7,27}, {27,69}, {69,94}, {94,111}};
@@ -395,7 +395,8 @@ G4InuclElementaryParticle G4BertiniNucleiModel::generateQuasiDeutron(G4int type1
dtype = 122;
};
return G4InuclElementaryParticle(dmom, dtype);
// return G4InuclElementaryParticle(dmom, dtype);
return G4InuclElementaryParticle(dmom, dtype, 3);
}
partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cparticle) const {
@@ -452,6 +453,8 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
G4InuclElementaryParticle particle;
particle.setModel(3);
thePartners.push_back(partner(particle, path));
} else { /// normal case
@@ -628,6 +631,8 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
if (thePartners[i].second > thePartners[j].second) {
G4InuclElementaryParticle particle = thePartners[i].first;
particle.setModel(3);
G4double pathi = thePartners[i].second;
thePartners[i] = partner(thePartners[j].first, thePartners[j].second);
thePartners[j] = partner(particle, pathi);
@@ -638,6 +643,8 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
G4InuclElementaryParticle particle;
particle.setModel(3);
thePartners.push_back(partner(particle, path));
};
@@ -163,7 +163,8 @@ G4BigBanger::generateBangInSCM(G4double etot,
G4int knd = iz > 0 ? 1 : 2;
particles.push_back(G4InuclElementaryParticle(mom, knd));
// particles.push_back(G4InuclElementaryParticle(mom, knd));
particles.push_back(G4InuclElementaryParticle(mom, knd, 8)); // modelId included
return particles;
};
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// This file is based on G4CascadeInterface.cc
// Modifications by Pekka Kaitaniemi (kaitanie@cc.helsinki.fi)
// Helsinki Institute of Physics
// Pekka Kaitaniemi, HIP
// Aatos Heikkinen
#include "G4ElasticCascadeInterface.hh"
#include "globals.hh"
@@ -69,7 +67,7 @@ G4ReactionProductVector* G4ElasticCascadeInterface::Propagate(G4KineticTrackVect
G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus) {
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
static G4int counter(0);
counter++;
G4cerr << "Reaction number "<< counter << " "<<aTrack.GetDynamicParticle()->GetDefinition()->GetParticleName()<<" "<< aTrack.GetDynamicParticle()->GetKineticEnergy()<<G4endl;
@@ -297,7 +295,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
switch(outgoingParticle) {
case proton:
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "proton " << counter << " " << aMom << " " << ekin << G4endl;
#endif
cascadeParticle =
@@ -306,7 +304,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
case neutron:
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "neutron "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
cascadeParticle =
@@ -317,7 +315,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
cascadeParticle =
new G4DynamicParticle(G4PionPlus::PionPlusDefinition(), aMom, ekin);
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "pionPlus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
@@ -326,7 +324,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
cascadeParticle =
new G4DynamicParticle(G4PionMinus::PionMinusDefinition(), aMom, ekin);
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "pionMinus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
@@ -335,7 +333,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
cascadeParticle =
new G4DynamicParticle(G4PionZero::PionZeroDefinition(), aMom, ekin);
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "pionZero "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
@@ -344,7 +342,7 @@ G4HadFinalState* G4ElasticCascadeInterface::ApplyYourself(const G4HadProjectile&
cascadeParticle =
new G4DynamicParticle(G4Gamma::Gamma(), aMom, ekin);
#ifdef debug_G4ElasticCascadeInterface
#ifdef DEBUG_ELASTIC
G4cerr << "photon "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
@@ -590,8 +590,11 @@ generateSCMfinalState(G4double ekin,
for (G4int i = 1; i < 4; i++) mom1[i] = -mom[i];
particles.push_back(G4InuclElementaryParticle(mom, particle_kinds[0]));
particles.push_back(G4InuclElementaryParticle(mom1, particle_kinds[1]));
//particles.push_back(G4InuclElementaryParticle(mom, particle_kinds[0]));
//particles.push_back(G4InuclElementaryParticle(mom1, particle_kinds[1]));
particles.push_back(G4InuclElementaryParticle(mom, particle_kinds[0], 3)); // register modelId
particles.push_back(G4InuclElementaryParticle(mom1, particle_kinds[1],3));
generate = false;
} else { // 2 -> many
@@ -143,6 +143,7 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
G4InuclNuclei nuclei(PEX, A, Z);
nuclei.setModel(6);
nuclei.setExitationEnergy(EEXS);
G4CollisionOutput explosion = theBigBanger->collide(0, &nuclei);
@@ -284,6 +285,8 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
if (itry < itry_max) {
// new photon escape
G4InuclElementaryParticle particle(10);
particle.setModel(6);
G4double pmod = 0.001 * S;
std::vector<G4double> mom(4);
std::pair<G4double, G4double> COS_SIN = randomCOS_SIN();
@@ -378,6 +381,8 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
if (icase < 2) { // particle escape
G4int ptype = 2 - icase;
G4InuclElementaryParticle particle(ptype);
particle.setModel(6);
G4double mass = particle.getMass();
// generate particle momentum
G4double pmod = std::sqrt((2.0 * mass + S) * S);
@@ -429,6 +434,7 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
} else {
G4InuclNuclei nuclei(AN[icase], Q[icase]);
nuclei.setModel(6);
G4double mass = nuclei.getMass();
// generate particle momentum
G4double pmod = std::sqrt((2.0 * mass + S) * S);
@@ -488,6 +494,7 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
} else { // fission
G4InuclNuclei nuclei(A, Z);
nuclei.setModel(6);
nuclei.setExitationEnergy(EEXS);
if (verboseLevel > 2){
@@ -546,6 +553,7 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
for (G4int i = 1; i < 4; i++) pnuc[i] = pin[i] - ppout[i];
G4InuclNuclei nuclei(pnuc, A, Z);
nuclei.setModel(6);
nuclei.setEnergy();
pnuc = nuclei.getMomentum();
G4double eout = pnuc[0] + ppout[0];
@@ -0,0 +1,217 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4EvaporationInuclCollider.hh"
#include "G4InuclElementaryParticle.hh"
#include "G4LorentzConvertor.hh"
#include "G4ParticleLargerEkin.hh"
#include <algorithm>
typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator;
typedef std::vector<G4InuclNuclei>::iterator nucleiIterator;
G4EvaporationInuclCollider::G4EvaporationInuclCollider()
: verboseLevel(0) {
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::G4EvaporationInuclCollider" << G4endl;
}
}
G4CollisionOutput G4EvaporationInuclCollider::collide(G4InuclParticle* /*bullet*/, G4InuclParticle* target) {
verboseLevel = 0;
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::evaporate" << G4endl;
}
G4CollisionOutput globalOutput;
G4LorentzConvertor convertToTargetRestFrame;
G4InuclNuclei* ntarget = dynamic_cast<G4InuclNuclei*>(target);
convertToTargetRestFrame.setTarget(ntarget->getMomentum(), ntarget->getMass());
G4double at = ntarget->getA();
G4double zt = ntarget->getZ();
G4double eEx = ntarget->getExitationEnergy();
std::vector<G4double> bmom(4, 0.0);
bmom[3] = convertToTargetRestFrame.getTRSMomentum();
G4InuclNuclei targ(at, zt);
std::vector<G4double> tmom(4, 0.0);
targ.setExitationEnergy(eEx);
targ.setMomentum(tmom);
targ.setEnergy();
targ.printParticle();
G4CollisionOutput output;
output = theEquilibriumEvaporator->collide(0, &targ);
G4CollisionOutput TRFoutput;
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
TRFoutput.addTargetFragments(output.getNucleiFragments());
if (verboseLevel > 3) {
G4cout << " After EquilibriumEvaporator " << G4endl;
output.printCollisionOutput();
};
std::vector<G4InuclElementaryParticle> particles = TRFoutput.getOutgoingParticles();
std::vector<G4InuclNuclei> nucleus = TRFoutput.getNucleiFragments();
globalOutput.addOutgoingParticles(particles);
globalOutput.addTargetFragments(nucleus);
if (verboseLevel > 3) G4cout << "G4EvaporationInuclCollider::collide end" << G4endl;
return globalOutput;
}
G4bool G4EvaporationInuclCollider::inelasticInteractionPossible(G4InuclParticle* bullet,
G4InuclParticle* target,
G4double ekin) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::inelasticInteractionPossible" << G4endl;
}
const G4double coeff = 0.001 * 1.2;
const G4double one_third = 1.0 / 3.0;
G4bool possible = true;
G4double at;
G4double zt;
G4double ab;
G4double zb;
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
at = nuclei_target->getA();
zt = nuclei_target->getZ();
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
} else {
G4InuclElementaryParticle* particle =
dynamic_cast<G4InuclElementaryParticle*>(bullet);
ab = 1;
zb = particle->getCharge();
};
} else {
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
G4InuclElementaryParticle* particle =
dynamic_cast<G4InuclElementaryParticle*>(target);
at = 1;
zt = particle->getCharge();
} else {
return possible;
};
};
// VCOL used for testing if elastic collision possible
G4double VCOL = coeff * zt * zb / (std::pow(at, one_third) + std::pow(ab, one_third));
// possible = VCOL < ekin; // NOTE: inelastic collision if not true
possible = true; // we force elastic
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::inelasticInteractionPossible" << G4endl;
G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: " << possible << G4endl;
}
return possible;
}
G4InteractionCase G4EvaporationInuclCollider::bulletTargetSetter(G4InuclParticle* bullet,
G4InuclParticle* target) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::bulletTargetSetter" << G4endl;
}
G4InteractionCase interCase;
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) { // A + A
interCase.setInterCase(2);
if (nuclei_target->getA() >= nuclei_bullet->getA()) {
interCase.setBulletTarget(bullet, target);
} else {
interCase.setBulletTarget(target, bullet);
};
} else {
interCase.setInterCase(1);
interCase.setBulletTarget(bullet, target);
};
} else {
G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
if (nuclei_bullet) {
G4InuclElementaryParticle* part =
dynamic_cast<G4InuclElementaryParticle*>(target);
if (part) {
interCase.setInterCase(1);
interCase.setBulletTarget(target, bullet);
};
};
};
return interCase;
}
G4bool G4EvaporationInuclCollider::explosion(G4InuclNuclei* target) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EvaporationInuclCollider::explosion" << G4endl;
}
const G4double a_cut = 20.0;
const G4double be_cut = 3.0;
G4double a = target->getA();
G4double z = target->getZ();
G4double eexs = target->getExitationEnergy();
G4bool explo = true;
if (a > a_cut) {
explo = false;
} else {
if (eexs < be_cut * bindingEnergy(a, z)) explo = false;
};
return explo;
}
@@ -138,7 +138,10 @@ G4CollisionOutput G4Fissioner::collide(G4InuclParticle* /*bullet*/,
G4double Z2 = Z - Z1;
G4InuclNuclei nuclei1(A1, Z1);
nuclei1.setModel(7); // sign in the modelId (=G4Fissioner)
G4InuclNuclei nuclei2(A2, Z2);
nuclei2.setModel(7);
G4double mass1 = nuclei1.getMass();
G4double mass2 = nuclei2.getMass();
G4double EK = config.ekin;
@@ -164,12 +167,14 @@ G4CollisionOutput G4Fissioner::collide(G4InuclParticle* /*bullet*/,
G4double EEXS2 = EV*A2;
G4InuclNuclei nuclei1(mom1, A1, Z1);
nuclei1.setModel(7);
nuclei1.setExitationEnergy(EEXS1);
nuclei1.setEnergy();
output.addTargetFragment(nuclei1);
G4InuclNuclei nuclei2(mom2, A2, Z2);
nuclei2.setModel(7);
nuclei2.setExitationEnergy(EEXS2);
nuclei2.setEnergy();
output.addTargetFragment(nuclei2);
@@ -69,6 +69,7 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
G4InuclNuclei* bnuclei = dynamic_cast<G4InuclNuclei*>(bullet);
G4InuclElementaryParticle* bparticle = dynamic_cast<G4InuclElementaryParticle*>(bullet);
G4NucleiModel model(tnuclei);
std::vector<G4double> momentum_in = bullet->getMomentum();
momentum_in[0] += tnuclei->getMass();
@@ -0,0 +1,251 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4InuclEvaporation.cc,v 1.6 2007/05/25 04:16:21 miheikki Exp $
//
#include <numeric>
#include "G4IonTable.hh"
#include "globals.hh"
#include "G4V3DNucleus.hh"
#include "G4DynamicParticleVector.hh"
#include "G4EvaporationInuclCollider.hh"
#include "G4InuclEvaporation.hh"
#include "G4InuclNuclei.hh"
#include "G4Track.hh"
#include "G4Nucleus.hh"
#include "G4Nucleon.hh"
#include "G4NucleiModel.hh"
#include "G4HadronicException.hh"
#include "G4LorentzVector.hh"
#include "G4EquilibriumEvaporator.hh"
#include "G4Fissioner.hh"
#include "G4BigBanger.hh"
#include "G4InuclElementaryParticle.hh"
#include "G4InuclParticle.hh"
#include "G4CollisionOutput.hh"
typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator;
typedef std::vector<G4InuclNuclei>::iterator nucleiIterator;
G4InuclEvaporation::G4InuclEvaporation() {
verboseLevel=0;
}
G4InuclEvaporation::G4InuclEvaporation(const G4InuclEvaporation &) : G4VEvaporation() {
throw G4HadronicException(__FILE__, __LINE__, "G4InuclEvaporation::copy_constructor meant to not be accessable.");
}
G4InuclEvaporation::~G4InuclEvaporation() {
}
const G4InuclEvaporation & G4InuclEvaporation::operator=(const G4InuclEvaporation &) {
throw G4HadronicException(__FILE__, __LINE__, "G4InuclEvaporation::operator= meant to not be accessable.");
return *this;
}
G4bool G4InuclEvaporation::operator==(const G4InuclEvaporation &) const {
return false;
}
G4bool G4InuclEvaporation::operator!=(const G4InuclEvaporation &) const {
return true;
}
void G4InuclEvaporation::setVerboseLevel( const G4int verbose ) {
verboseLevel = verbose;
}
G4FragmentVector * G4InuclEvaporation::BreakItUp(const G4Fragment &theNucleus) {
enum particleType { nuclei = 0, proton = 1, neutron = 2, pionPlus = 3,
pionMinus = 5, pionZero = 7, photon = 10,
kaonPlus = 11, kaonMinus = 13, kaonZero = 15,
kaonZeroBar = 17, lambda = 21, sigmaPlus = 23,
sigmaZero = 25, sigmaMinus = 27, xiZero = 29, xiMinus = 31 };
std::vector< G4DynamicParticle * > secondaryParticleVector;
G4FragmentVector * theResult = new G4FragmentVector;
if (theNucleus.GetExcitationEnergy() <= 0.0) { // Check that Excitation Energy > 0
theResult->push_back(new G4Fragment(theNucleus));
return theResult;
}
G4double A = theNucleus.GetA();
G4double Z = theNucleus.GetZ();
G4double mTar = G4NucleiProperties::GetAtomicMass(A, Z); // Mass of the target nucleus
G4LorentzVector tmp =theNucleus.GetMomentum();
G4ThreeVector momentum = tmp.vect();
// G4double energy = tmp.e();
G4double exitationE = theNucleus.GetExcitationEnergy();
// Move to CMS frame, save initial velocity of the nucleus to boostToLab vector.
// G4ThreeVector boostToLab( ( 1/G4NucleiProperties::GetAtomicMass( A, Z ) ) * momentum );
G4InuclNuclei* tempNuc = new G4InuclNuclei(A, Z);
G4double mass=tempNuc->getMass()*1000;
G4ThreeVector boostToLab( ( 1/mass) * momentum );
if ( verboseLevel > 2 )
G4cout << " G4InuclEvaporation : initial kinematics : boostToLab vector = " << boostToLab << G4endl
<< " excitation energy : " << exitationE << G4endl;
if (verboseLevel > 2) {
G4cout << "G4InuclEvaporation::BreakItUp >>> A: " << A << " Z: " << Z << " exitation E: " <<
exitationE << " mass: " << mTar << G4endl;
};
G4InuclNuclei* nucleus = new G4InuclNuclei(A, Z);
nucleus->setExitationEnergy(exitationE/1000);
std::vector<G4double> tmom(4, 0.0);
nucleus->setMomentum(tmom);
nucleus->setEnergy();
G4EquilibriumEvaporator* eqil = new G4EquilibriumEvaporator;
G4Fissioner* fiss = new G4Fissioner;
G4BigBanger* bigb = new G4BigBanger;
G4EvaporationInuclCollider* evaporator = new G4EvaporationInuclCollider(eqil, fiss, bigb);
G4CollisionOutput output;
output = evaporator->collide(0, nucleus);
std::vector<G4InuclNuclei> nucleiFragments = output.getNucleiFragments();
std::vector<G4InuclElementaryParticle> particles = output.getOutgoingParticles();
G4double ekin,emas;
G4double eTot=0.0;
G4DynamicParticle* cascadeParticle = 0;
G4int i=1;
//G4cout << "# particles: " << output.getOutgoingParticles().size() << G4endl;
if (!particles.empty()) {
particleIterator ipart;
G4int outgoingParticle;
for (ipart = particles.begin(); ipart != particles.end(); ipart++) {
outgoingParticle = ipart->type();
if (verboseLevel > 2) {
G4cout << "Evaporated particle: " << i << " of type: " << outgoingParticle << G4endl;
i++;
// ipart->printParticle();
}
std::vector<G4double> mom = ipart->getMomentum();
eTot += std::sqrt(mom[0]*1000 * mom[0]*1000);
ekin = ipart->getKineticEnergy()*1000;
emas = ipart->getMass()*1000;
G4ThreeVector aMom(mom[1]*1000, mom[2]*1000, mom[3]*1000);
G4LorentzVector v(aMom, (ekin+emas));
v.boost( boostToLab );
switch(outgoingParticle) {
case proton:
cascadeParticle = new G4DynamicParticle(G4Proton::ProtonDefinition(), v.vect(), v.e());
break;
case neutron:
cascadeParticle = new G4DynamicParticle(G4Neutron::NeutronDefinition(), v.vect(), v.e());
break;
case photon:
cascadeParticle = new G4DynamicParticle(G4Gamma::Gamma(), v.vect(), v.e());
break;
default:
G4cout << " ERROR: GInuclEvapration::Propagate undefined particle type" << G4endl;
};
secondaryParticleVector.push_back( cascadeParticle );
// theResult.AddSecondary(cascadeParticle);
}
}
fillResult( secondaryParticleVector, theResult);
// G4cout << "# fragments " << output.getNucleiFragments().size() << G4endl;
i=1;
if (!nucleiFragments.empty()) {
nucleiIterator ifrag;
for (ifrag = nucleiFragments.begin(); ifrag != nucleiFragments.end(); ifrag++) {
ekin = ifrag->getKineticEnergy()*1000;
emas = ifrag->getMass()*1000;
std::vector<G4double> mom = ifrag->getMomentum();
eTot += std::sqrt(mom[0]*1000 * mom[0]*1000);
G4ThreeVector aMom(mom[1]*1000, mom[2]*1000, mom[3]*1000);
// aMom = aMom.unit();
G4LorentzVector v(aMom, (ekin+emas));
v.boost( boostToLab );
if (verboseLevel > 2) {
G4cout << " Nuclei fragment: " << i << G4endl; i++;
// ifrag->printParticle();
}
G4int A = G4int(ifrag->getA());
G4int Z = G4int(ifrag->getZ());
// cascadeParticle = new G4DynamicParticle(G4Proton::ProtonDefinition(), v.vect(), v.e());
if (verboseLevel > 2) {
G4cout << "boosted v" << v << G4endl;
}
// theResult->push_back( new G4Fragment(A, Z, tmp) );
theResult->push_back( new G4Fragment(A, Z, v) );
}
}
//G4cout << ">>>> G4InuclEvaporation::BreakItUp end " << G4endl;
return theResult;
}
void G4InuclEvaporation::fillResult( std::vector<G4DynamicParticle *> secondaryParticleVector,
G4FragmentVector * aResult )
{
// Fill the vector pParticleChange with secondary particles stored in vector.
for ( size_t i = 0 ; i < secondaryParticleVector.size() ; i++ )
{
G4int aZ = static_cast<G4int> (secondaryParticleVector[i]->GetDefinition()->GetPDGCharge() );
G4int aA = static_cast<G4int> (secondaryParticleVector[i]->GetDefinition()->GetBaryonNumber());
G4LorentzVector aMomentum = secondaryParticleVector[i]->Get4Momentum();
if(aA>0) {
aResult->push_back( new G4Fragment(aA, aZ, aMomentum) );
} else {
aResult->push_back( new G4Fragment(aMomentum, secondaryParticleVector[i]->GetDefinition()) );
}
}
return;
}
@@ -286,6 +286,8 @@ G4CollisionOutput G4NonEquilibriumEvaporator::collide(G4InuclParticle* /*bullet*
} else { // real escape
G4InuclElementaryParticle particle(ptype);
particle.setModel(5);
G4double mass = particle.getMass();
EPART *= 0.001; // to the GeV
// generate particle momentum
@@ -425,6 +427,7 @@ G4CollisionOutput G4NonEquilibriumEvaporator::collide(G4InuclParticle* /*bullet*
for (G4int i = 1; i < 4; i++) pnuc[i] = pin[i] - ppout[i];
G4InuclNuclei nuclei(pnuc, A, Z);
nuclei.setModel(5);
nuclei.setEnergy();
pnuc = nuclei.getMomentum();
@@ -0,0 +1,479 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4PreCompoundCascadeInterface.hh"
#include "globals.hh"
#include "G4DynamicParticleVector.hh"
#include "G4IonTable.hh"
#include "G4PreCompoundInuclCollider.hh"
#include "G4IntraNucleiCascader.hh"
#include "G4ElementaryParticleCollider.hh"
#include "G4NonEquilibriumEvaporator.hh"
#include "G4BigBanger.hh"
#include "G4InuclElementaryParticle.hh"
#include "G4InuclNuclei.hh"
#include "G4InuclParticle.hh"
#include "G4CollisionOutput.hh"
#include "G4V3DNucleus.hh"
#include "G4Track.hh"
#include "G4Nucleus.hh"
#include "G4NucleiModel.hh"
#include "G4LorentzRotation.hh"
typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator;
typedef std::vector<G4InuclNuclei>::iterator nucleiIterator;
G4PreCompoundCascadeInterface::G4PreCompoundCascadeInterface()
:verboseLevel(0) {
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundCascadeInterface::G4PreCompoundCascadeInterface" << G4endl;
}
}
G4ReactionProductVector* G4PreCompoundCascadeInterface::Propagate(G4KineticTrackVector* ,
G4V3DNucleus* ) {
return 0;
}
// #define debug_G4PreCompoundCascadeInterface
G4HadFinalState* G4PreCompoundCascadeInterface::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus) {
#ifdef debug_G4PreCompoundCascadeInterface
static G4int counter(0);
counter++;
G4cerr << "Reaction number "<< counter << " "<<aTrack.GetDynamicParticle()->GetDefinition()->GetParticleName()<<" "<< aTrack.GetDynamicParticle()->GetKineticEnergy()<<G4endl;
#endif
theResult.Clear();
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundCascadeInterface::ApplyYourself" << G4endl;
};
G4double eInit = 0.0;
G4double eTot = 0.0;
G4double sumBaryon = 0.0;
G4double sumEnergy = 0.0;
// Make conversion between native Geant4 and Bertini cascade classes.
// NOTE: Geant4 units are MeV = 1 and GeV = 1000. Cascade code by default use GeV = 1.
enum particleType { nuclei = 0, proton = 1, neutron = 2, pionPlus = 3,
pionMinus = 5, pionZero = 7, photon = 10,
kaonPlus = 11, kaonMinus = 13, kaonZero = 15,
kaonZeroBar = 17, lambda = 21, sigmaPlus = 23,
sigmaZero = 25, sigmaMinus = 27, xiZero = 29, xiMinus = 31 };
G4int bulletType = 0;
// Coding particles
if (aTrack.GetDefinition() == G4Proton::Proton() ) bulletType = proton;
if (aTrack.GetDefinition() == G4Neutron::Neutron() ) bulletType = neutron;
if (aTrack.GetDefinition() == G4PionPlus::PionPlus() ) bulletType = pionPlus;
if (aTrack.GetDefinition() == G4PionMinus::PionMinus() ) bulletType = pionMinus;
if (aTrack.GetDefinition() == G4PionZero::PionZero() ) bulletType = pionZero;
if (aTrack.GetDefinition() == G4Gamma::Gamma() ) bulletType = photon;
if (aTrack.GetDefinition() == G4KaonPlus::KaonPlus() ) bulletType = kaonPlus;
if (aTrack.GetDefinition() == G4KaonMinus::KaonMinus() ) bulletType = kaonMinus;
if (aTrack.GetDefinition() == G4Lambda::Lambda() ) bulletType = lambda;
if (aTrack.GetDefinition() == G4SigmaPlus::SigmaPlus() ) bulletType = sigmaPlus;
if (aTrack.GetDefinition() == G4SigmaZero::SigmaZero() ) bulletType = sigmaZero;
if (aTrack.GetDefinition() == G4SigmaMinus::SigmaMinus() ) bulletType = sigmaMinus;
if (aTrack.GetDefinition() == G4XiZero::XiZero() ) bulletType = xiZero;
if (aTrack.GetDefinition() == G4XiMinus::XiMinus() ) bulletType = xiMinus;
if (aTrack.GetDefinition() == G4KaonZeroLong::KaonZeroLong() ||
aTrack.GetDefinition() == G4KaonZeroShort::KaonZeroShort() ) {
if (G4UniformRand() > 0.5) {
bulletType = kaonZero;
} else {
bulletType = kaonZeroBar;
}
}
// Code momentum and energy.
G4double px,py,pz;
px=aTrack.Get4Momentum().px() / GeV;
py=aTrack.Get4Momentum().py() / GeV;
pz=aTrack.Get4Momentum().pz() / GeV;
G4LorentzVector projectileMomentum = aTrack.Get4Momentum();
G4LorentzRotation toZ;
toZ.rotateZ(-projectileMomentum.phi());
toZ.rotateY(-projectileMomentum.theta());
G4LorentzRotation toLabFrame = toZ.inverse();
std::vector<G4double> momentumBullet(4);
momentumBullet[0] =0.;
momentumBullet[1] =0;
momentumBullet[2] =0;
momentumBullet[3] =std::sqrt(px*px+py*py+pz*pz);
G4InuclElementaryParticle * bullet = new G4InuclElementaryParticle(momentumBullet, bulletType);
sumEnergy = bullet->getKineticEnergy(); // In GeV
if (bulletType == proton || bulletType == neutron || bulletType == lambda ||
bulletType == sigmaPlus || bulletType == sigmaZero || bulletType == sigmaMinus ||
bulletType == xiZero || bulletType == xiMinus) {
sumBaryon += 1;
}
// Set target
G4InuclNuclei* target = 0;
G4InuclParticle* targetH = 0;
// and outcoming particles
G4DynamicParticle* cascadeParticle = 0;
std::vector<G4double> targetMomentum(4, 0.0);
G4double theNucleusA = theNucleus.GetN();
if ( !(G4int(theNucleusA) == 1) ) {
target = new G4InuclNuclei(targetMomentum,
theNucleusA,
theNucleus.GetZ());
target->setEnergy();
std::vector<G4double> bmom = bullet->getMomentum();
eInit = std::sqrt(bmom[0] * bmom[0]);
std::vector<G4double> tmom = target->getMomentum();
eInit += std::sqrt(tmom[0] * tmom[0]);
sumBaryon += theNucleusA;
if (verboseLevel > 2) {
G4cout << "Bullet: " << G4endl;
bullet->printParticle();
}
if (verboseLevel > 2) {
G4cout << "Target: " << G4endl;
target->printParticle();
}
}
G4CollisionOutput output;
// Colliders initialisation
G4ElementaryParticleCollider* colep = new G4ElementaryParticleCollider;
G4IntraNucleiCascader* inc = new G4IntraNucleiCascader; // the actual cascade
inc->setInteractionCase(1); // Interaction type is particle with nuclei.
G4NonEquilibriumEvaporator* noneq = new G4NonEquilibriumEvaporator;
G4BigBanger* bigb = new G4BigBanger;
G4PreCompoundInuclCollider* collider = new G4PreCompoundInuclCollider(colep, inc, noneq, bigb);
G4int maxTries = 10; // maximum tries for inelastic collision to avoid infinite loop
G4int nTries = 0; // try counter
if (G4int(theNucleusA) == 1) { // special treatment for target H(1,1) (proton)
targetH = new G4InuclElementaryParticle(targetMomentum, 1);
G4float cutElastic[32];
cutElastic[proton ] = 1.0; // 1 GeV
cutElastic[neutron ] = 1.0;
cutElastic[lambda] = 1.0;
cutElastic[sigmaPlus] = 1.0;
cutElastic[sigmaZero] = 1.0;
cutElastic[sigmaMinus] = 1.0;
cutElastic[xiZero] = 1.0;
cutElastic[xiMinus] = 1.0;
cutElastic[pionPlus ] = 0.6; // 0.6 GeV
cutElastic[kaonPlus ] = 0.5; // 0.5 GeV
cutElastic[kaonMinus] = 0.5;
cutElastic[kaonMinus] = 0.5;
cutElastic[kaonZero] = 0.5;
cutElastic[kaonZeroBar] = 0.5;
cutElastic[pionMinus] = 0.2; // 0.2 GeV
cutElastic[pionZero ] = 0.2;
if (momentumBullet[3] > cutElastic[bulletType]) { // inelastic collision possible
do { // we try to create inelastic interaction
output = collider->collide(bullet, targetH);
nTries++;
} while(
(nTries < maxTries) &&
(output.getOutgoingParticles().size() == 2 && // elastic: bullet + p = H(1,1) coming out
(output.getOutgoingParticles().begin()->type() == bulletType || output.getOutgoingParticles().begin()->type() == proton)
)
);
} else { // only elastic collision is energetically possible
output = collider->collide(bullet, targetH);
}
sumBaryon += 1;
std::vector<G4double> bmom = bullet->getMomentum();
eInit = std::sqrt(bmom[0] * bmom[0]);
std::vector<G4double> tmom = targetH->getMomentum();
eInit += std::sqrt(tmom[0] * tmom[0]);
if (verboseLevel > 2) {
G4cout << "Target: " << G4endl;
targetH->printParticle();
}
} else { // treat all other targets excepet H(1,1)
do // we try to create inelastic interaction
{
output = collider->collide(bullet, target );
nTries++;
} while (
// (nTries < maxTries) &&
//(output.getOutgoingParticles().size() + output.getNucleiFragments().size() < 2.5) &&
//(output.getOutgoingParticles().size()!=0) &&
//(output.getOutgoingParticles().begin()->type()==bullet->type())
//);
(nTries < maxTries) &&
output.getOutgoingParticles().size() == 1 && // we retry when elastic collision happened
output.getNucleiFragments().size() == 1 &&
output.getOutgoingParticles().begin()->type() == bullet->type() &&
output.getNucleiFragments().begin()->getA() == target->getA() &&
output.getNucleiFragments().begin()->getZ() == target->getZ()
);
}
if (verboseLevel > 1)
{
G4cout << " Cascade output: " << G4endl;
output.printCollisionOutput();
}
// Convert cascade data to use hadronics interface
std::vector<G4InuclNuclei> nucleiFragments = output.getNucleiFragments();
std::vector<G4InuclElementaryParticle> particles = output.getOutgoingParticles();
theResult.SetStatusChange(stopAndKill);
if (!particles.empty()) {
particleIterator ipart;
G4int outgoingParticle;
for (ipart = particles.begin(); ipart != particles.end(); ipart++) {
outgoingParticle = ipart->type();
std::vector<G4double> mom = ipart->getMomentum();
eTot += std::sqrt(mom[0] * mom[0]);
G4double ekin = ipart->getKineticEnergy() * GeV;
G4ThreeVector aMom(mom[1], mom[2], mom[3]);
aMom = aMom.unit();
if (ipart->baryon() ) {
sumBaryon -= 1;
}
sumEnergy -= ekin / GeV;
switch(outgoingParticle) {
case proton:
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "proton " << counter << " " << aMom << " " << ekin << G4endl;
#endif
cascadeParticle = new G4DynamicParticle(G4Proton::ProtonDefinition(), aMom, ekin);
break;
case neutron:
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "neutron "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
cascadeParticle = new G4DynamicParticle(G4Neutron::NeutronDefinition(), aMom, ekin);
break;
case pionPlus:
cascadeParticle = new G4DynamicParticle(G4PionPlus::PionPlusDefinition(), aMom, ekin);
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "pionPlus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
case pionMinus:
cascadeParticle = new G4DynamicParticle(G4PionMinus::PionMinusDefinition(), aMom, ekin);
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "pionMinus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
case pionZero:
cascadeParticle = new G4DynamicParticle(G4PionZero::PionZeroDefinition(), aMom, ekin);
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "pionZero "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
case photon:
cascadeParticle = new G4DynamicParticle(G4Gamma::Gamma(), aMom, ekin);
#ifdef debug_G4PreCompoundCascadeInterface
G4cerr << "photon "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
break;
case kaonPlus:
cascadeParticle = new G4DynamicParticle(G4KaonPlus::KaonPlusDefinition(), aMom, ekin);
break;
case kaonMinus:
cascadeParticle = new G4DynamicParticle(G4KaonMinus::KaonMinusDefinition(), aMom, ekin);
break;
case kaonZero:
if (G4UniformRand() > 0.5) {
cascadeParticle = new G4DynamicParticle(G4KaonZeroLong::KaonZeroLongDefinition(), aMom, ekin);
} else {
cascadeParticle = new G4DynamicParticle(G4KaonZeroShort::KaonZeroShortDefinition(), aMom, ekin);
}
break;
case kaonZeroBar:
if (G4UniformRand() > 0.5) {
cascadeParticle = new G4DynamicParticle(G4KaonZeroLong::KaonZeroLongDefinition(), aMom, ekin);
} else {
cascadeParticle = new G4DynamicParticle(G4KaonZeroShort::KaonZeroShortDefinition(), aMom, ekin);
}
break;
case lambda:
cascadeParticle = new G4DynamicParticle(G4Lambda::LambdaDefinition(), aMom, ekin);
break;
case sigmaPlus:
cascadeParticle = new G4DynamicParticle(G4SigmaPlus::SigmaPlusDefinition(), aMom, ekin);
break;
case sigmaZero:
cascadeParticle = new G4DynamicParticle(G4SigmaZero::SigmaZeroDefinition(), aMom, ekin);
break;
case sigmaMinus:
cascadeParticle = new G4DynamicParticle(G4SigmaMinus::SigmaMinusDefinition(), aMom, ekin);
break;
case xiZero:
cascadeParticle = new G4DynamicParticle(G4XiZero::XiZeroDefinition(), aMom, ekin);
break;
case xiMinus:
cascadeParticle = new G4DynamicParticle(G4XiMinus::XiMinusDefinition(), aMom, ekin);
break;
default:
G4cout << " ERROR: G4PreCompoundCascadeInterface::Propagate undefined particle type" << G4endl;
}
cascadeParticle->Set4Momentum(cascadeParticle->Get4Momentum()*=toLabFrame);
theResult.AddSecondary(cascadeParticle);
}
}
// get nuclei fragments
G4DynamicParticle * aFragment = 0;
G4ParticleDefinition * aIonDef = 0;
G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
if (!nucleiFragments.empty()) {
nucleiIterator ifrag;
for (ifrag = nucleiFragments.begin(); ifrag != nucleiFragments.end(); ifrag++)
{
G4double eKin = ifrag->getKineticEnergy() * GeV;
std::vector<G4double> mom = ifrag->getMomentum();
eTot += std::sqrt(mom[0] * mom[0]);
G4ThreeVector aMom(mom[1], mom[2], mom[3]);
aMom = aMom.unit();
// hpw @@@ ==> Should be zero: G4double fragmentExitation = ifrag->getExitationEnergyInGeV();
if (verboseLevel > 2) {
G4cout << " Nuclei fragment: " << G4endl;
ifrag->printParticle();
}
G4int A = G4int(ifrag->getA());
G4int Z = G4int(ifrag->getZ());
aIonDef = theTableOfParticles->FindIon(Z, A, 0, Z);
aFragment = new G4DynamicParticle(aIonDef, aMom, eKin);
sumBaryon -= A;
sumEnergy -= eKin / GeV;
aFragment->Set4Momentum(aFragment->Get4Momentum()*=toLabFrame);
theResult.AddSecondary(aFragment);
}
}
if (verboseLevel > 2) {
if (sumBaryon != 0) {
G4cout << "ERROR: no baryon number conservation, sum of baryons = " << sumBaryon << G4endl;
}
if (sumEnergy > 0.01 ) {
G4cout << "Kinetic energy conservation violated by " << sumEnergy << " GeV" << G4endl;
}
G4cout << "Total energy conservation at level ~" << (eInit - eTot) * GeV << " MeV" << G4endl;
if (sumEnergy < -5.0e-5 ) { // 0.05 MeV
G4cout << "FATAL ERROR: energy created " << sumEnergy * GeV << " MeV" << G4endl;
}
}
delete bullet;
delete colep;
delete inc;
delete noneq;
delete bigb;
delete collider;
if(target != 0) delete target;
if(targetH != 0) delete targetH;
// if(cascadeParticle != 0) delete cascadeParticle;
// if(aFragment != 0) delete aFragment;
return &theResult;
}
@@ -0,0 +1,381 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4PreCompoundInuclCollider.hh"
#include "G4InuclElementaryParticle.hh"
#include "G4LorentzConvertor.hh"
#include "G4ParticleLargerEkin.hh"
#include <algorithm>
typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator;
typedef std::vector<G4InuclNuclei>::iterator nucleiIterator;
G4PreCompoundInuclCollider::G4PreCompoundInuclCollider()
: verboseLevel(0) {
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::G4PreCompoundInuclCollider" << G4endl;
}
}
G4CollisionOutput G4PreCompoundInuclCollider::collide(G4InuclParticle* bullet,
G4InuclParticle* target) {
verboseLevel = 0;
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::collide" << G4endl;
}
const G4int itry_max = 1000;
G4CollisionOutput globalOutput;
G4InuclElementaryParticle* particle1 =
dynamic_cast<G4InuclElementaryParticle*>(bullet);
G4InuclElementaryParticle* particle2 =
dynamic_cast<G4InuclElementaryParticle*>(target);
if (particle1 && particle2) { // particle + particle (NOTE: also the h + H(1,1) treated here)
if (verboseLevel > 2) {
particle1->printParticle();
particle2->printParticle();
}
globalOutput = theElementaryParticleCollider->collide(bullet, target);
} else { // needs to call all machinery
G4LorentzConvertor convertToTargetRestFrame;
G4InteractionCase interCase = bulletTargetSetter(bullet, target);
G4int intcase = interCase.getInterCase();
if (intcase > 0) { // ok
G4InuclNuclei* ntarget =
dynamic_cast<G4InuclNuclei*>(interCase.getTarget());
convertToTargetRestFrame.setTarget(ntarget->getMomentum(),
ntarget->getMass());
G4int btype = 0;
G4double ab = 0.0;
G4double zb = 0.0;
G4double at = ntarget->getA();
G4double zt = ntarget->getZ();
if (intcase == 1) { // particle with nuclei
G4InuclElementaryParticle* pbullet =
dynamic_cast<G4InuclElementaryParticle*>(interCase.getBullet());
if (pbullet->photon()) {
G4cout << " InuclCollider -> can not collide with photon " << G4endl;
globalOutput.trivialise(bullet, target);
return globalOutput;
} else {
convertToTargetRestFrame.setBullet(pbullet->getMomentum(),
pbullet->getMass());
btype = pbullet->type();
};
} else { // nuclei with nuclei
G4InuclNuclei* nbullet =
dynamic_cast<G4InuclNuclei*>(interCase.getBullet());
convertToTargetRestFrame.setBullet(nbullet->getMomentum(),
nbullet->getMass());
ab = nbullet->getA();
zb = nbullet->getZ();
};
G4double ekin = convertToTargetRestFrame.getKinEnergyInTheTRS();
if (verboseLevel > 3) {
G4cout << " ekin in trs " << ekin << G4endl;
}
if (inelasticInteractionPossible(bullet, target, ekin)) {
convertToTargetRestFrame.toTheTargetRestFrame();
if (verboseLevel > 3) {
G4cout << " degenerated? " << convertToTargetRestFrame.trivial() << G4endl;
}
std::vector<G4double> bmom(4, 0.0);
bmom[3] = convertToTargetRestFrame.getTRSMomentum();
G4InuclNuclei ntarget(at, zt);
std::vector<G4double> tmom(4, 0.0);
ntarget.setMomentum(tmom);
ntarget.setEnergy();
theIntraNucleiCascader->setInteractionCase(intcase);
G4bool bad = true;
G4int itry = 0;
while (bad && itry < itry_max) {
G4CollisionOutput TRFoutput;
G4CollisionOutput output;
itry++;
if (intcase == 1) {
G4InuclElementaryParticle pbullet(bmom, btype);
output = theIntraNucleiCascader->collide(&pbullet, &ntarget);
} else {
G4InuclNuclei nbullet(ab, zb);
nbullet.setMomentum(bmom);
nbullet.setEnergy();
output = theIntraNucleiCascader->collide(&nbullet, &ntarget);
};
if (verboseLevel > 3) {
G4cout << " After Cascade " << G4endl;
output.printCollisionOutput();
}
// the rest, if any
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
if (output.numberOfNucleiFragments() == 1) { // there is smth. after
G4InuclNuclei cascad_rec_nuclei = output.getNucleiFragments()[0];
if (explosion(&cascad_rec_nuclei)) {
if (verboseLevel > 3) {
G4cout << " big bang after cascade " << G4endl;
};
output = theBigBanger->collide(0,&cascad_rec_nuclei);
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
} else {
output = theNonEquilibriumEvaporator->collide(0, &cascad_rec_nuclei);
if (verboseLevel > 3) {
G4cout << " After NonEquilibriumEvaporator " << G4endl;
output.printCollisionOutput();
};
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
TRFoutput.addTargetFragments(output.getNucleiFragments());
};
};
// convert to the LAB
G4bool withReflection = convertToTargetRestFrame.reflectionNeeded();
std::vector<G4InuclElementaryParticle> particles =
TRFoutput.getOutgoingParticles();
if (!particles.empty()) {
particleIterator ipart;
for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
std::vector<G4double> mom = ipart->getMomentum();
if (withReflection) mom[3] = -mom[3];
mom = convertToTargetRestFrame.rotate(mom);
ipart->setMomentum(mom);
mom = convertToTargetRestFrame.backToTheLab(ipart->getMomentum());
ipart->setMomentum(mom);
};
std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin());
};
std::vector<G4InuclNuclei> nucleus = TRFoutput.getNucleiFragments();
if (!nucleus.empty()) {
nucleiIterator inuc;
for (inuc = nucleus.begin(); inuc != nucleus.end(); inuc++) {
std::vector<G4double> mom = inuc->getMomentum();
if (withReflection) mom[3] = -mom[3];
mom = convertToTargetRestFrame.rotate(mom);
inuc->setMomentum(mom);
inuc->setEnergy();
mom = convertToTargetRestFrame.backToTheLab(inuc->getMomentum());
inuc->setMomentum(mom);
inuc->setEnergy();
};
};
globalOutput.addOutgoingParticles(particles);
globalOutput.addTargetFragments(nucleus);
globalOutput.setOnShell(bullet, target);
if(globalOutput.acceptable()) {
return globalOutput;
} else {
globalOutput.reset();
};
};
if (verboseLevel > 3) {
G4cout << " InuclCollider -> can not generate acceptable inter. after "
<< itry_max << " attempts " << G4endl;
}
globalOutput.trivialise(bullet, target);
return globalOutput;
} else {
if (verboseLevel > 3) {
G4cout << " InuclCollider -> inelastic interaction is impossible " << G4endl
<< " due to the coulomb barirer " << G4endl;
}
globalOutput.trivialise(bullet, target);
return globalOutput;
};
} else {
if (verboseLevel > 3) {
G4cout << " InuclCollider -> inter case " << intcase << G4endl;
};
};
};
return globalOutput;
}
G4bool G4PreCompoundInuclCollider::inelasticInteractionPossible(G4InuclParticle* bullet,
G4InuclParticle* target,
G4double ekin) const {
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::inelasticInteractionPossible" << G4endl;
}
const G4double coeff = 0.001 * 1.2;
const G4double one_third = 1.0 / 3.0;
G4bool possible = true;
G4double at;
G4double zt;
G4double ab;
G4double zb;
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
at = nuclei_target->getA();
zt = nuclei_target->getZ();
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
} else {
G4InuclElementaryParticle* particle =
dynamic_cast<G4InuclElementaryParticle*>(bullet);
ab = 1;
zb = particle->getCharge();
};
} else {
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
G4InuclElementaryParticle* particle =
dynamic_cast<G4InuclElementaryParticle*>(target);
at = 1;
zt = particle->getCharge();
} else {
return possible;
};
};
// VCOL used for testing if elastic collision possible
G4double VCOL = coeff * zt * zb / (std::pow(at, one_third) + std::pow(ab, one_third));
// possible = VCOL < ekin; // NOTE: inelastic collision if not true
possible = true; // we force elastic
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::inelasticInteractionPossible" << G4endl;
G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: " << possible << G4endl;
}
return possible;
}
G4InteractionCase G4PreCompoundInuclCollider::bulletTargetSetter(G4InuclParticle* bullet,
G4InuclParticle* target) const {
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::bulletTargetSetter" << G4endl;
}
G4InteractionCase interCase;
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) { // A + A
interCase.setInterCase(2);
if (nuclei_target->getA() >= nuclei_bullet->getA()) {
interCase.setBulletTarget(bullet, target);
} else {
interCase.setBulletTarget(target, bullet);
};
} else {
interCase.setInterCase(1);
interCase.setBulletTarget(bullet, target);
};
} else {
G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
if (nuclei_bullet) {
G4InuclElementaryParticle* part =
dynamic_cast<G4InuclElementaryParticle*>(target);
if (part) {
interCase.setInterCase(1);
interCase.setBulletTarget(target, bullet);
};
};
};
return interCase;
}
G4bool G4PreCompoundInuclCollider::explosion(G4InuclNuclei* target) const {
if (verboseLevel > 3) {
G4cout << " >>> G4PreCompoundInuclCollider::explosion" << G4endl;
}
const G4double a_cut = 20.0;
const G4double be_cut = 3.0;
G4double a = target->getA();
G4double z = target->getZ();
G4double eexs = target->getExitationEnergy();
G4bool explo = true;
if (a > a_cut) {
explo = false;
} else {
if (eexs < be_cut * bindingEnergy(a, z)) explo = false;
};
return explo;
}
@@ -314,8 +314,11 @@ G4double G4InuclSpecialFunctions::bindingEnergyExact(G4double A,
default:
G4cout << " DM(A, Z): wrong exact case: IN " << IN
<< " IZ " << IZ << G4endl;
if (verboseLevel > 3) {
G4cout << " >>> G4InuclSpecialFunctions::bindingEnergyExact" << G4endl;
G4cout << " DM(A, Z): wrong exact case: IN " << IN << " IZ " << IZ
<< " -> Using default bindingEnergyAsymptotic(A, Z)" << G4endl;
}
DM = bindingEnergyAsymptotic(A, Z);
};