35#define INCLXX_IN_GEANT4_MODE 1
55 complainedAboutBackupModel(false)
58 if(getenv(
"G4INCLXX_NO_DE_EXCITATION")) {
59 G4String message =
"de-excitation is completely disabled!";
61 theExcitationHandler = 0;
71 delete theBackupModel;
72 delete theExcitationHandler;
89 ss <<
"the model does not know how to handle a collision between a "
111 if(pA > theMaxProjMassINCL)
113 else if(tA > theMaxProjMassINCL)
126 && theNucleus.
GetA_asInt() > theMaxProjMassINCL) {
127 if(!complainedAboutBackupModel) {
128 complainedAboutBackupModel =
true;
129 std::stringstream ss;
130 ss <<
"INCL++ refuses to handle reactions between nuclei with A>"
131 << theMaxProjMassINCL
132 <<
". A backup model ("
134 <<
") will be used instead.";
140 const G4int maxTries = 200;
143 const G4bool inverseKinematics = AccurateProjectile(aTrack, theNucleus);
149 G4Nucleus *theTargetNucleus = &theNucleus;
150 if(inverseKinematics) {
157 if(oldProjectileDef != 0 && oldTargetDef != 0) {
161 if(newTargetA > 0 && newTargetZ > 0) {
163 theTargetNucleus =
new G4Nucleus(newTargetA, newTargetZ);
166 G4LorentzVector theProjectile4Momentum(0.0, 0.0, 0.0, theProjectileMass);
167 G4DynamicParticle swappedProjectileParticle(oldTargetDef, (*toInverseKinematics) * theProjectile4Momentum);
170 G4String message =
"badly defined target after swapping. Falling back to normal (non-swapped) mode.";
175 G4String message =
"oldProjectileDef or oldTargetDef was null";
211 std::list<G4Fragment> remnants;
220 const G4double kineticEnergy = toINCLKineticEnergy(*aProjectileTrack);
235 if(inverseKinematics) {
252 momentum *= toLabFrame;
254 if(inverseKinematics) {
255 momentum *= *toDirectKinematics;
264 G4String message =
"the model produced a particle that couldn't be converted to Geant4 particle.";
278 eventInfo.
jxRem[i]*hbar_Planck,
279 eventInfo.
jyRem[i]*hbar_Planck,
280 eventInfo.
jzRem[i]*hbar_Planck
284 const G4double scaling = remnant4MomentumScaling(nuclearMass,
289 if(std::abs(scaling - 1.0) > 0.01) {
290 std::stringstream ss;
291 ss <<
"momentum scaling = " << scaling
292 <<
"\n Lorentz vector = " << fourMomentum
293 <<
")\n A = " << A <<
", Z = " << Z
294 <<
"\n E* = " << excitationE <<
", nuclearMass = " << nuclearMass
295 <<
"\n remnant i=" << i <<
", nRemnants=" << eventInfo.
nRemnants
299 <<
", in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics.";
304 fourMomentum *= toLabFrame;
307 if(inverseKinematics) {
308 fourMomentum *= *toDirectKinematics;
314 remnants.push_back(remnant);
318 }
while(!eventIsOK && nTries < maxTries);
321 if(inverseKinematics) {
322 delete aProjectileTrack;
323 delete theTargetNucleus;
324 delete toInverseKinematics;
325 delete toDirectKinematics;
329 std::stringstream ss;
330 ss <<
"maximum number of tries exceeded for the proposed "
333 <<
" inelastic reaction, in " << (inverseKinematics ?
"inverse" :
"direct") <<
" kinematics.";
343 if(theExcitationHandler != 0) {
344 for(std::list<G4Fragment>::const_iterator i = remnants.begin();
345 i != remnants.end(); i++) {
348 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
349 fragment != deExcitationResult->end(); ++fragment) {
357 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
358 fragment != deExcitationResult->end(); ++fragment) {
361 deExcitationResult->clear();
362 delete deExcitationResult;
415 else if(A == 3 && Z == 2)
return G4He3::He3();
417 else if(A > 0 && Z > 0 && A > Z) {
443 const G4double p2 = px*px + py*py + pz*pz;
445 const G4double pnew2 = kineticE*kineticE + 2.0*kineticE*mass;
446 return std::sqrt(pnew2)/std::sqrt(p2);
Header file for the G4INCLXXInterfaceStore class.
CLHEP::HepLorentzRotation G4LorentzRotation
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4DLLIMPORT std::ostream G4cout
HepLorentzRotation inverse() const
Hep3Vector boostVector() const
void setVect(const Hep3Vector &)
HepRotation inverse() const
HepRotation & rotateZ(double delta)
HepRotation & rotateY(double delta)
static G4Deuteron * Deuteron()
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState) const
void SetAngularMomentum(const G4ThreeVector &value)
static G4GenericIon * GenericIon()
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
const G4String & GetModelName() const
Singleton class for configuring the INCL++ Geant4 interface.
void EmitWarning(const G4String &message)
Emit a warning to G4cout.
G4int GetMaxProjMassINCL() const
Getter for theMaxProjMassINCL.
G4INCL::INCL * GetINCLModel()
Get the cached INCL model engine.
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.
G4bool GetDumpInput() const
Getter for dumpInput.
G4bool GetAccurateProjectile() const
Getter for accurateProjectile.
G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4INCLXXInterface(const G4String &name="INCL++ cascade with G4ExcitationHandler")
const EventInfo & processEvent()
std::string configToString()
G4double GetIonMass(G4int Z, G4int A, G4int L=0) const
!! Only ground states are supported now
static G4Neutron * Neutron()
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetAtomicNumber() const
const G4String & GetParticleType() const
G4int GetAtomicMass() const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
static G4ParticleTable * GetParticleTable()
G4IonTable * GetIonTable()
G4ParticleDefinition * GetIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
static G4PionZero * PionZero()
static G4Proton * Proton()
static G4Triton * Triton()
Bool_t transparent
True if the event is transparent.
Short_t A[maxSizeParticles]
Particle mass number.
Float_t EKinRem[maxSizeRemnants]
Remnant kinetic energy [MeV].
Float_t jzRem[maxSizeRemnants]
Remnant angular momentum, z component [hbar].
Float_t EStarRem[maxSizeRemnants]
Remnant excitation energy [MeV].
Short_t Z[maxSizeParticles]
Particle charge number.
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
Float_t jxRem[maxSizeRemnants]
Remnant angular momentum, x component [hbar].
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
Float_t pxRem[maxSizeRemnants]
Remnant momentum, x component [MeV/c].
Float_t pyRem[maxSizeRemnants]
Remnant momentum, y component [MeV/c].
Int_t nParticles
Total number of emitted particles.
Float_t pzRem[maxSizeRemnants]
Remnant momentum, z component [MeV/c].
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
Int_t nRemnants
Number of remnants.
Float_t jyRem[maxSizeRemnants]
Remnant angular momentum, y component [hbar].
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].
Short_t ARem[maxSizeRemnants]
Remnant mass number.
Short_t ZRem[maxSizeRemnants]
Remnant charge number.