34 #define INCLXX_IN_GEANT4_MODE 1
49 #include "G4String.hh"
62 thePreCompoundModel(aPreCompound),
65 complainedAboutBackupModel(false),
66 complainedAboutPreCompound(false),
68 theINCLXXLevelDensity(NULL),
69 theINCLXXFissionProbability(NULL)
79 if(getenv(
"G4INCLXX_NO_DE_EXCITATION")) {
93 if(theFissionChannelCast) {
107 if(getenv(
"G4INCLXX_DUMP_REMNANT"))
131 std::stringstream
ss;
132 ss <<
"the model does not know how to handle a collision between a "
154 if(pA > theMaxProjMassINCL)
156 else if(tA > theMaxProjMassINCL)
173 if((isIonTrack && (trackZ<=0 || trackA<=trackZ)) || (nucleusA>1 && (nucleusZ<=0 || nucleusA<=nucleusZ))) {
182 if(trackA<=1 && nucleusA<=1) {
189 if(trackA > theMaxProjMassINCL && nucleusA > theMaxProjMassINCL) {
192 std::stringstream
ss;
193 ss <<
"INCL++ refuses to handle reactions between nuclei with A>"
194 << theMaxProjMassINCL
195 <<
". A backup model ("
197 <<
") will be used instead.";
207 && trackKinE < cascadeMinEnergyPerNucleon) {
210 std::stringstream
ss;
211 ss <<
"INCL++ refuses to handle nucleon-induced reactions below "
212 << cascadeMinEnergyPerNucleon /
MeV
213 <<
" MeV. A PreCoumpound model ("
215 <<
") will be used instead.";
224 const G4double theTrackEnergy = trackKinE + theTrackMass;
225 const G4double theTrackMomentumAbs2 = theTrackEnergy*theTrackEnergy - theTrackMass*theTrackMass;
226 const G4double theTrackMomentumAbs = ((theTrackMomentumAbs2>0.0) ? std::sqrt(theTrackMomentumAbs2) : 0.0);
231 fourMomentumIn.
setE(theTrackEnergy + theNucleusMass);
232 fourMomentumIn.
setVect(theTrackMomentum);
241 G4Nucleus *theTargetNucleus = &theNucleus;
242 if(inverseKinematics) {
246 if(oldProjectileDef != 0 && oldTargetDef != 0) {
250 if(newTargetA > 0 && newTargetZ > 0) {
252 theTargetNucleus =
new G4Nucleus(newTargetA, newTargetZ);
255 G4DynamicParticle swappedProjectileParticle(oldTargetDef, (*toInverseKinematics) * theProjectile4Momentum);
258 G4String message =
"badly defined target after swapping. Falling back to normal (non-swapped) mode.";
299 std::list<G4Fragment> remnants;
301 const G4int maxTries = 200;
321 if(inverseKinematics) {
341 momentum *= toLabFrame;
343 if(inverseKinematics) {
344 momentum *= *toDirectKinematics;
350 fourMomentumOut += momentum;
354 G4String message =
"the model produced a particle that couldn't be converted to Geant4 particle.";
369 eventInfo.
jyRem[i]*hbar_Planck,
370 eventInfo.
jzRem[i]*hbar_Planck
379 if(std::abs(scaling - 1.0) > 0.01) {
380 std::stringstream
ss;
381 ss <<
"momentum scaling = " << scaling
382 <<
"\n Lorentz vector = " << fourMomentum
383 <<
")\n A = " << A <<
", Z = " << Z
384 <<
"\n E* = " << excitationE <<
", nuclearMass = " << nuclearMass
385 <<
"\n remnant i=" << i <<
", nRemnants=" << eventInfo.
nRemnants
389 <<
", in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics.";
394 fourMomentum *= toLabFrame;
397 if(inverseKinematics) {
398 fourMomentum *= *toDirectKinematics;
402 fourMomentumOut += fourMomentum;
406 G4cerr <<
"G4INCLXX_DUMP_REMNANT: " << remnant <<
" spin: " << spin <<
G4endl;
408 remnants.push_back(remnant);
412 const G4LorentzVector violation4Momentum = fourMomentumOut - fourMomentumIn;
413 const G4double energyViolation = std::abs(violation4Momentum.
e());
414 const G4double momentumViolation = violation4Momentum.
rho();
416 std::stringstream
ss;
417 ss <<
"energy conservation violated by " << energyViolation/
MeV <<
" MeV in "
420 <<
" inelastic reaction, in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics. Will resample.";
424 for(
G4int j=0; j<nSecondaries; ++j)
430 std::stringstream
ss;
431 ss <<
"momentum conservation violated by " << momentumViolation/
MeV <<
" MeV in "
434 <<
" inelastic reaction, in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics. Will resample.";
438 for(
G4int j=0; j<nSecondaries; ++j)
446 }
while(!eventIsOK && nTries < maxTries);
449 if(inverseKinematics) {
450 delete aProjectileTrack;
451 delete theTargetNucleus;
452 delete toInverseKinematics;
453 delete toDirectKinematics;
457 std::stringstream
ss;
458 ss <<
"maximum number of tries exceeded for the proposed "
461 <<
" inelastic reaction, in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics.";
472 for(std::list<G4Fragment>::iterator i = remnants.begin();
473 i != remnants.end(); ++i) {
476 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
477 fragment != deExcitationResult->end(); ++fragment) {
485 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
486 fragment != deExcitationResult->end(); ++fragment) {
489 deExcitationResult->clear();
490 delete deExcitationResult;
563 else if(A > 0 && Z > 0 && A > Z) {
589 const G4double p2 = px*px + py*py + pz*pz;
591 const G4double pnew2 = kineticE*kineticE + 2.0*kineticE*mass;
592 return std::sqrt(pnew2)/std::sqrt(p2);
600 <<
"The Li�ge Intranuclear Cascade (INCL++) is a model for reactions induced\n"
601 <<
"by nucleons, pions and light ion on any nucleus. The reaction is\n"
602 <<
"described as an avalanche of binary nucleon-nucleon collisions, which can\n"
603 <<
"lead to the emission of energetic particles and to the formation of an\n"
604 <<
"excited thermalised nucleus (remnant). The de-excitation of the remnant is\n"
605 <<
"outside the scope of INCL++ and is typically described by another model.\n\n"
606 <<
"INCL++ has been reasonably well tested for nucleon (~50 MeV to ~15 GeV),\n"
607 <<
"pion (idem) and light-ion projectiles (up to A=18, ~10A MeV to 1A GeV).\n"
608 <<
"Most tests involved target nuclei close to the stability valley, with\n"
609 <<
"numbers between 4 and 250.\n\n"
610 <<
"Reference: D. Mancusi et al., Phys. Rev. C90 (2014) 054602\n\n";
G4double remnant4MomentumScaling(G4double mass, G4double kineticE, G4double px, G4double py, G4double pz) const
Rescale remnant momentum if necessary.
static G4GenericIon * GenericIon()
static G4PionMinus * PionMinus()
static G4Lambda * Lambda()
void SetEmissionStrategy(G4VEmissionProbability *aFissionProb)
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].
G4double toINCLKineticEnergy(G4HadProjectile const &) const
Convert G4HadProjectile to corresponding INCL particle kinetic energy.
Header file for the G4INCLXXInterfaceStore class.
G4int GetAtomicNumber() const
static constexpr double hbar_Planck
static constexpr double MeV
Float_t pzRem[maxSizeRemnants]
Remnant momentum, z component [MeV/c].
Float_t EKinRem[maxSizeRemnants]
Remnant kinetic energy [MeV].
G4String const & GetDeExcitationModelName() const
void SetMomentumChange(const G4ThreeVector &aV)
G4ExcitationHandler * GetExcitationHandler() const
G4HadSecondary * GetSecondary(size_t i)
G4bool GetAccurateProjectile() const
Getter for accurateProjectile.
G4VPreCompoundModel * theDeExcitation
void message(RunManager *runmanager)
const G4String & GetParticleName() const
Short_t nParticles
Number of particles in the final state.
Short_t Z[maxSizeParticles]
Particle charge number.
void SetFissionLevelDensityParameter(G4VLevelDensityParameter *aLevelDensity)
static G4PionPlus * PionPlus()
virtual void Tally(G4HadProjectile const &aTrack, G4Nucleus const &theNucleus, G4HadFinalState const &result)=0
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
const G4String & GetParticleType() const
G4double GetPDGCharge() const
Short_t nRemnants
Number of remnants.
void setVect(const Hep3Vector &)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4bool complainedAboutPreCompound
static G4SigmaZero * SigmaZero()
Revised level-density parameter for fission after INCL++.
static G4Proton * Proton()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4VEvaporation * GetEvaporation()
G4INCLXXVInterfaceTally * GetTally() const
Getter for the interface tally.
static G4KaonMinus * KaonMinus()
G4double GetPDGMass() const
G4HadronicInteraction * theBackupModel
static G4KaonPlus * KaonPlus()
static G4SigmaMinus * SigmaMinus()
G4VLevelDensityParameter * theINCLXXLevelDensity
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
static G4Deuteron * Deuteron()
G4INCLXXVInterfaceTally * theTally
static G4SigmaPlus * SigmaPlus()
G4ParticleDefinition * toG4ParticleDefinition(G4int A, G4int Z, G4int PDGCode) const
Convert A and Z to a G4ParticleDefinition.
void SetEnergyChange(G4double anEnergy)
CLHEP::HepLorentzRotation G4LorentzRotation
G4HadFinalState theResult
void EmitWarning(const G4String &message)
Emit a warning to G4cout.
G4IonTable *const theIonTable
static G4KaonZeroLong * KaonZeroLong()
G4HadronicInteraction * theBackupModelNucleon
Float_t jzRem[maxSizeRemnants]
Remnant angular momentum, z component [ ].
static G4Proton * ProtonDefinition()
G4int GetBaryonNumber() const
G4VPreCompoundModel * thePreCompoundModel
static G4HadronicInteractionRegistry * Instance()
G4VEvaporationChannel * GetFissionChannel()
Short_t ZRem[maxSizeRemnants]
Remnant charge number.
Float_t jyRem[maxSizeRemnants]
Remnant angular momentum, y component [ ].
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.
Short_t ARem[maxSizeRemnants]
Remnant mass number.
void SetLevelDensityParameter(G4VLevelDensityParameter *aLevelDensity)
G4INCLXXInterface(G4VPreCompoundModel *const aPreCompound=0)
Float_t pyRem[maxSizeRemnants]
Remnant momentum, y component [MeV/c].
void Set4Momentum(const G4LorentzVector &momentum)
G4LorentzVector Get4Momentum() const
double A(double temperature)
HepLorentzRotation inverse() const
G4INCL::INCL * GetINCLModel()
Get the cached INCL model engine.
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetMaxProjMassINCL() const
Getter for theMaxProjMassINCL.
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cerr
const G4LorentzVector & Get4Momentum() const
G4int GetNumberOfSecondaries() const
Float_t jxRem[maxSizeRemnants]
Remnant angular momentum, x component [ ].
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.
G4DynamicParticle * toG4Particle(G4int A, G4int Z, G4int PDGCode, G4double kinE, G4double px, G4double py, G4double pz) const
Convert an INCL particle to a G4DynamicParticle.
G4double GetKineticEnergy() const
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
const EventInfo & processEvent()
G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)
virtual void ModelDescription(std::ostream &outFile) const
static G4KaonZeroShort * KaonZeroShort()
const G4ParticleDefinition * GetDefinition() const
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
HepRotation & rotateY(double delta)
static G4Triton * Triton()
Int_t PDGCode[maxSizeParticles]
PDG numbering of the particles.
static G4Neutron * Neutron()
Float_t EStarRem[maxSizeRemnants]
Remnant excitation energy [MeV].
G4DynamicParticle * GetParticle()
G4int GetAtomicMass() const
static G4Neutron * NeutronDefinition()
HepRotation & rotateZ(double delta)
G4bool complainedAboutBackupModel
static G4PionZero * PionZero()
G4INCL::ParticleType toINCLParticleType(G4ParticleDefinition const *const) const
Convert G4ParticleDefinition to corresponding INCL particle type.
Hep3Vector boostVector() const
Short_t A[maxSizeParticles]
Particle mass number.
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Float_t pxRem[maxSizeRemnants]
Remnant momentum, x component [MeV/c].
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
void SetAngularMomentum(const G4ThreeVector &)
G4FissionProbability * theINCLXXFissionProbability
G4HadronicInteraction * FindModel(const G4String &name)
Singleton class for configuring the INCL++ Geant4 interface.
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
HepRotation inverse() const
G4double GetCascadeMinEnergyPerNucleon() const
Getter for cascadeMinEnergyPerNucleon.
G4INCL::INCL * theINCLModel
G4INCL::ParticleSpecies toINCLParticleSpecies(G4HadProjectile const &) const
Convert G4HadProjectile to corresponding INCL particle species.
G4INCLXXInterfaceStore *const theInterfaceStore
G4bool AccurateProjectile(const G4HadProjectile &aTrack, const G4Nucleus &theTargetNucleus) const
void SetStatusChange(G4HadFinalStateStatus aS)
const G4String & GetModelName() const
Bool_t transparent
True if the event is transparent.