Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCLXXInterface Class Reference

INCL++ intra-nuclear cascade. More...

#include <G4INCLXXInterface.hh>

Inheritance diagram for G4INCLXXInterface:
G4VIntraNuclearTransportModel G4HadronicInteraction

Public Member Functions

 G4INCLXXInterface (G4VPreCompoundModel *const aPreCompound=0)
 
 ~G4INCLXXInterface ()
 
G4int operator== (G4INCLXXInterface &right)
 
G4int operator!= (G4INCLXXInterface &right)
 
G4ReactionProductVectorPropagate (G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
 
void DeleteModel ()
 
- Public Member Functions inherited from G4VIntraNuclearTransportModel
 G4VIntraNuclearTransportModel (const G4String &modelName="CascadeModel", G4VPreCompoundModel *ptr=0)
 
virtual ~G4VIntraNuclearTransportModel ()
 
virtual G4ReactionProductVectorPropagateNuclNucl (G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4V3DNucleus *theProjectileNucleus)
 
void SetDeExcitation (G4VPreCompoundModel *ptr)
 
void Set3DNucleus (G4V3DNucleus *const value)
 
void SetPrimaryProjectile (const G4HadProjectile &aPrimary)
 
const G4StringGetModelName () const
 
virtual void ModelDescription (std::ostream &outFile) const
 
virtual void PropagateModelDescription (std::ostream &outFile) const
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &, G4Nucleus &)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
const G4HadronicInteractionGetMyPointer () const
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
G4bool operator== (const G4HadronicInteraction &right) const
 
G4bool operator!= (const G4HadronicInteraction &right) const
 
virtual const std::pair
< G4double, G4double
GetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double,
G4double
GetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 

Additional Inherited Members

- Protected Member Functions inherited from G4VIntraNuclearTransportModel
G4V3DNucleusGet3DNucleus () const
 
G4VPreCompoundModelGetDeExcitation () const
 
const G4HadProjectileGetPrimaryProjectile () const
 
- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4VIntraNuclearTransportModel
G4String theTransportModelName
 
G4V3DNucleusthe3DNucleus
 
G4VPreCompoundModeltheDeExcitation
 
const G4HadProjectilethePrimaryProjectile
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

INCL++ intra-nuclear cascade.

Interface for INCL++. This interface handles basic hadron bullet particles (protons, neutrons, pions), as well as light ions.

Example usage in case of protons:

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);

The same setup procedure is needed for neutron, pion and generic-ion inelastic processes as well.

Definition at line 99 of file G4INCLXXInterface.hh.

Constructor & Destructor Documentation

G4INCLXXInterface::G4INCLXXInterface ( G4VPreCompoundModel *const  aPreCompound = 0)

Definition at line 53 of file G4INCLXXInterface.cc.

References G4INCLXXInterfaceStore::EmitWarning(), G4HadronicInteractionRegistry::FindModel(), G4HadronicInteractionRegistry::Instance(), and G4VIntraNuclearTransportModel::theDeExcitation.

53  :
55  theINCLModel(NULL),
56  thePreCompoundModel(aPreCompound),
57  theInterfaceStore(G4INCLXXInterfaceStore::GetInstance()),
58  complainedAboutBackupModel(false),
59  complainedAboutPreCompound(false),
60  theIonTable(G4IonTable::GetIonTable())
61 {
62  if(!thePreCompoundModel) {
65  thePreCompoundModel = static_cast<G4VPreCompoundModel*>(p);
66  if(!thePreCompoundModel) { thePreCompoundModel = new G4PreCompoundModel; }
67  }
68 
69  // Use the environment variable G4INCLXX_NO_DE_EXCITATION to disable de-excitation
70  if(getenv("G4INCLXX_NO_DE_EXCITATION")) {
71  G4String message = "de-excitation is completely disabled!";
72  theInterfaceStore->EmitWarning(message);
73  theDeExcitation = 0;
74  } else {
77  theDeExcitation = static_cast<G4VPreCompoundModel*>(p);
79  }
80 
81  // use the envvar G4INCLXX_DUMP_REMNANT to dump information about the
82  // remnants on stdout
83  if(getenv("G4INCLXX_DUMP_REMNANT"))
84  dumpRemnantInfo = true;
85  else
86  dumpRemnantInfo = false;
87 
88  theBackupModel = new G4BinaryLightIonReaction;
89  theBackupModelNucleon = new G4BinaryCascade;
90 }
G4VIntraNuclearTransportModel(const G4String &modelName="CascadeModel", G4VPreCompoundModel *ptr=0)
const char * p
Definition: xmltok.h:285
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.
static G4IonTable * GetIonTable()
Definition: G4IonTable.hh:80
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
void EmitWarning(const G4String &message)
Emit a warning to G4cout.
G4INCLXXInterface::~G4INCLXXInterface ( )

Definition at line 92 of file G4INCLXXInterface.cc.

93 {
94 }

Member Function Documentation

G4HadFinalState * G4INCLXXInterface::ApplyYourself ( const G4HadProjectile aTrack,
G4Nucleus theNucleus 
)
virtual

Main method to apply the INCL physics model.

Parameters
aTrackthe projectile particle
theNucleustarget nucleus
Returns
the output of the INCL physics model

Implements G4HadronicInteraction.

Definition at line 141 of file G4INCLXXInterface.cc.

References G4INCL::EventInfo::A, G4HadFinalState::AddSecondary(), G4HadronicInteraction::ApplyYourself(), G4VPreCompoundModel::ApplyYourself(), G4INCL::EventInfo::ARem, CLHEP::HepLorentzVector::boostVector(), G4HadFinalState::Clear(), G4VPreCompoundModel::DeExcite(), CLHEP::HepLorentzVector::e(), G4INCL::EventInfo::EKin, G4INCL::EventInfo::EKinRem, G4INCLXXInterfaceStore::EmitBigWarning(), G4INCLXXInterfaceStore::EmitWarning(), G4INCL::EventInfo::EStarRem, G4cerr, G4endl, G4HadProjectile::Get4Momentum(), G4DynamicParticle::Get4Momentum(), G4Nucleus::GetA_asInt(), G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4INCLXXInterfaceStore::GetCascadeMinEnergyPerNucleon(), G4HadProjectile::GetDefinition(), G4INCLXXInterfaceStore::GetINCLModel(), G4INCLXXInterfaceStore::GetInstance(), G4IonTable::GetIon(), G4IonTable::GetIonMass(), G4IonTable::GetIonName(), G4HadProjectile::GetKineticEnergy(), G4INCLXXInterfaceStore::GetMaxProjMassINCL(), G4HadronicInteraction::GetModelName(), G4NucleiProperties::GetNuclearMass(), G4HadFinalState::GetNumberOfSecondaries(), G4HadSecondary::GetParticle(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGMass(), G4HadFinalState::GetSecondary(), CLHEP::HepLorentzVector::getV(), G4Nucleus::GetZ_asInt(), python.hepunit::hbar_Planck, CLHEP::HepLorentzRotation::inverse(), CLHEP::HepRotation::inverse(), isAlive, G4INCL::EventInfo::jxRem, G4INCL::EventInfo::jyRem, G4INCL::EventInfo::jzRem, python.hepunit::MeV, G4Neutron::NeutronDefinition(), G4INCL::EventInfo::nParticles, G4INCL::EventInfo::nRemnants, CLHEP::HepLorentzVector::phi(), G4INCL::INCL::processEvent(), G4Proton::ProtonDefinition(), G4INCL::EventInfo::px, G4INCL::EventInfo::pxRem, G4INCL::EventInfo::py, G4INCL::EventInfo::pyRem, G4INCL::EventInfo::pz, G4INCL::EventInfo::pzRem, CLHEP::HepLorentzVector::rho(), CLHEP::HepRotation::rotateY(), CLHEP::HepRotation::rotateZ(), G4DynamicParticle::Set4Momentum(), G4Fragment::SetAngularMomentum(), CLHEP::HepLorentzVector::setE(), G4HadFinalState::SetEnergyChange(), G4HadFinalState::SetMomentumChange(), G4HadFinalState::SetStatusChange(), CLHEP::HepLorentzVector::setVect(), stopAndKill, G4VIntraNuclearTransportModel::theDeExcitation, CLHEP::HepLorentzVector::theta(), G4INCL::EventInfo::transparent, CLHEP::Hep3Vector::unit(), CLHEP::HepLorentzVector::vect(), G4INCL::EventInfo::Z, and G4INCL::EventInfo::ZRem.

142 {
143  // For reactions on nucleons, use the backup model (without complaining)
144  if(aTrack.GetDefinition()->GetAtomicMass()<=1 && theNucleus.GetA_asInt()<=1) {
145  return theBackupModelNucleon->ApplyYourself(aTrack, theNucleus);
146  }
147 
148  // For systems heavier than theMaxProjMassINCL, use another model (typically
149  // BIC)
150  const G4int theMaxProjMassINCL = theInterfaceStore->GetMaxProjMassINCL();
151  if(aTrack.GetDefinition()->GetAtomicMass() > theMaxProjMassINCL
152  && theNucleus.GetA_asInt() > theMaxProjMassINCL) {
153  if(!complainedAboutBackupModel) {
154  complainedAboutBackupModel = true;
155  std::stringstream ss;
156  ss << "INCL++ refuses to handle reactions between nuclei with A>"
157  << theMaxProjMassINCL
158  << ". A backup model ("
159  << theBackupModel->GetModelName()
160  << ") will be used instead.";
161  theInterfaceStore->EmitBigWarning(ss.str());
162  }
163  return theBackupModel->ApplyYourself(aTrack, theNucleus);
164  }
165 
166  // For energies lower than cascadeMinEnergyPerNucleon, use PreCompound
167  const G4double cascadeMinEnergyPerNucleon = theInterfaceStore->GetCascadeMinEnergyPerNucleon();
168  const G4double trackKinE = aTrack.GetKineticEnergy();
169  const G4ParticleDefinition *trackDefinition = aTrack.GetDefinition();
170  if((trackDefinition==G4Neutron::NeutronDefinition() || trackDefinition==G4Proton::ProtonDefinition())
171  && trackKinE < cascadeMinEnergyPerNucleon) {
172  if(!complainedAboutPreCompound) {
173  complainedAboutPreCompound = true;
174  std::stringstream ss;
175  ss << "INCL++ refuses to handle nucleon-induced reactions below "
176  << cascadeMinEnergyPerNucleon / MeV
177  << " MeV. A PreCoumpound model ("
178  << thePreCompoundModel->GetModelName()
179  << ") will be used instead.";
180  theInterfaceStore->EmitBigWarning(ss.str());
181  }
182  return thePreCompoundModel->ApplyYourself(aTrack, theNucleus);
183  }
184 
185  // Calculate the total four-momentum in the entrance channel
186  const G4int nucleusA = theNucleus.GetA_asInt();
187  const G4int nucleusZ = theNucleus.GetZ_asInt();
188  const G4double theNucleusMass = theIonTable->GetIonMass(nucleusZ, nucleusA);
189  const G4double theTrackMass = trackDefinition->GetPDGMass();
190  const G4double theTrackEnergy = trackKinE + theTrackMass;
191  const G4double theTrackMomentumAbs2 = theTrackEnergy*theTrackEnergy - theTrackMass*theTrackMass;
192  const G4double theTrackMomentumAbs = ((theTrackMomentumAbs2>0.0) ? std::sqrt(theTrackMomentumAbs2) : 0.0);
193  const G4ThreeVector theTrackMomentum = aTrack.Get4Momentum().getV().unit() * theTrackMomentumAbs;
194 
195  G4LorentzVector goodTrack4Momentum(theTrackMomentum, theTrackEnergy);
196  G4LorentzVector fourMomentumIn;
197  fourMomentumIn.setE(theTrackEnergy + theNucleusMass);
198  fourMomentumIn.setVect(theTrackMomentum);
199 
200  // Check if inverse kinematics should be used
201  const G4bool inverseKinematics = AccurateProjectile(aTrack, theNucleus);
202 
203  // If we are running in inverse kinematics, redefine aTrack and theNucleus
204  G4LorentzRotation *toInverseKinematics = NULL;
205  G4LorentzRotation *toDirectKinematics = NULL;
206  G4HadProjectile const *aProjectileTrack = &aTrack;
207  G4Nucleus *theTargetNucleus = &theNucleus;
208  if(inverseKinematics) {
209  G4ParticleDefinition *oldTargetDef = theIonTable->GetIon(nucleusZ, nucleusA, 0);
210  const G4ParticleDefinition *oldProjectileDef = aTrack.GetDefinition();
211 
212  if(oldProjectileDef != 0 && oldTargetDef != 0) {
213  const G4int newTargetA = oldProjectileDef->GetAtomicMass();
214  const G4int newTargetZ = oldProjectileDef->GetAtomicNumber();
215 
216  if(newTargetA > 0 && newTargetZ > 0) {
217  // This should give us the same energy per nucleon
218  theTargetNucleus = new G4Nucleus(newTargetA, newTargetZ);
219  toInverseKinematics = new G4LorentzRotation(goodTrack4Momentum.boostVector());
220  G4LorentzVector theProjectile4Momentum(0.0, 0.0, 0.0, theNucleusMass);
221  G4DynamicParticle swappedProjectileParticle(oldTargetDef, (*toInverseKinematics) * theProjectile4Momentum);
222  aProjectileTrack = new G4HadProjectile(swappedProjectileParticle);
223  } else {
224  G4String message = "badly defined target after swapping. Falling back to normal (non-swapped) mode.";
225  theInterfaceStore->EmitWarning(message);
226  toInverseKinematics = new G4LorentzRotation;
227  }
228  } else {
229  G4String message = "oldProjectileDef or oldTargetDef was null";
230  theInterfaceStore->EmitWarning(message);
231  toInverseKinematics = new G4LorentzRotation;
232  }
233  }
234 
235  // INCL assumes the projectile particle is going in the direction of
236  // the Z-axis. Here we construct proper rotation to convert the
237  // momentum vectors of the outcoming particles to the original
238  // coordinate system.
239  G4LorentzVector projectileMomentum = aProjectileTrack->Get4Momentum();
240 
241  // INCL++ assumes that the projectile is going in the direction of
242  // the z-axis. In principle, if the coordinate system used by G4
243  // hadronic framework is defined differently we need a rotation to
244  // transform the INCL++ reaction products to the appropriate
245  // frame. Please note that it isn't necessary to apply this
246  // transform to the projectile because when creating the INCL++
247  // projectile particle; \see{toINCLKineticEnergy} needs to use only the
248  // projectile energy (direction is simply assumed to be along z-axis).
249  G4RotationMatrix toZ;
250  toZ.rotateZ(-projectileMomentum.phi());
251  toZ.rotateY(-projectileMomentum.theta());
252  G4RotationMatrix toLabFrame3 = toZ.inverse();
253  G4LorentzRotation toLabFrame(toLabFrame3);
254  // However, it turns out that the projectile given to us by G4
255  // hadronic framework is already going in the direction of the
256  // z-axis so this rotation is actually unnecessary. Both toZ and
257  // toLabFrame turn out to be unit matrices as can be seen by
258  // uncommenting the folowing two lines:
259  // G4cout <<"toZ = " << toZ << G4endl;
260  // G4cout <<"toLabFrame = " << toLabFrame << G4endl;
261 
262  theResult.Clear(); // Make sure the output data structure is clean.
263  theResult.SetStatusChange(stopAndKill);
264 
265  std::list<G4Fragment> remnants;
266 
267  const G4int maxTries = 200;
268  G4int nTries = 0;
269  // INCL can generate transparent events. However, this is meaningful
270  // only in the standalone code. In Geant4 we must "force" INCL to
271  // produce a valid cascade.
272  G4bool eventIsOK = false;
273  do {
274  const G4INCL::ParticleSpecies theSpecies = toINCLParticleSpecies(*aProjectileTrack);
275  const G4double kineticEnergy = toINCLKineticEnergy(*aProjectileTrack);
276 
277  // The INCL model will be created at the first use
279 
280  const G4INCL::EventInfo eventInfo = theINCLModel->processEvent(theSpecies, kineticEnergy, theTargetNucleus->GetA_asInt(), theTargetNucleus->GetZ_asInt());
281  // eventIsOK = !eventInfo.transparent && nTries < maxTries;
282  eventIsOK = !eventInfo.transparent;
283  if(eventIsOK) {
284 
285  // If the collision was run in inverse kinematics, prepare to boost back
286  // all the reaction products
287  if(inverseKinematics) {
288  toDirectKinematics = new G4LorentzRotation(toInverseKinematics->inverse());
289  }
290 
291  G4LorentzVector fourMomentumOut;
292 
293  for(G4int i = 0; i < eventInfo.nParticles; i++) {
294  G4int A = eventInfo.A[i];
295  G4int Z = eventInfo.Z[i];
296  // G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
297  G4double kinE = eventInfo.EKin[i];
298  G4double px = eventInfo.px[i];
299  G4double py = eventInfo.py[i];
300  G4double pz = eventInfo.pz[i];
301  G4DynamicParticle *p = toG4Particle(A, Z , kinE, px, py, pz);
302  if(p != 0) {
303  G4LorentzVector momentum = p->Get4Momentum();
304 
305  // Apply the toLabFrame rotation
306  momentum *= toLabFrame;
307  // Apply the inverse-kinematics boost
308  if(inverseKinematics) {
309  momentum *= *toDirectKinematics;
310  momentum.setVect(-momentum.vect());
311  }
312 
313  // Set the four-momentum of the reaction products
314  p->Set4Momentum(momentum);
315  fourMomentumOut += momentum;
316  theResult.AddSecondary(p);
317 
318  } else {
319  G4String message = "the model produced a particle that couldn't be converted to Geant4 particle.";
320  theInterfaceStore->EmitWarning(message);
321  }
322  }
323 
324  for(G4int i = 0; i < eventInfo.nRemnants; i++) {
325  const G4int A = eventInfo.ARem[i];
326  const G4int Z = eventInfo.ZRem[i];
327  // G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
328  const G4double kinE = eventInfo.EKinRem[i];
329  const G4double px = eventInfo.pxRem[i];
330  const G4double py = eventInfo.pyRem[i];
331  const G4double pz = eventInfo.pzRem[i];
332  G4ThreeVector spin(
333  eventInfo.jxRem[i]*hbar_Planck,
334  eventInfo.jyRem[i]*hbar_Planck,
335  eventInfo.jzRem[i]*hbar_Planck
336  );
337  const G4double excitationE = eventInfo.EStarRem[i];
338  const G4double nuclearMass = G4NucleiProperties::GetNuclearMass(A, Z) + excitationE;
339  const G4double scaling = remnant4MomentumScaling(nuclearMass,
340  kinE,
341  px, py, pz);
342  G4LorentzVector fourMomentum(scaling * px, scaling * py, scaling * pz,
343  nuclearMass + kinE);
344  if(std::abs(scaling - 1.0) > 0.01) {
345  std::stringstream ss;
346  ss << "momentum scaling = " << scaling
347  << "\n Lorentz vector = " << fourMomentum
348  << ")\n A = " << A << ", Z = " << Z
349  << "\n E* = " << excitationE << ", nuclearMass = " << nuclearMass
350  << "\n remnant i=" << i << ", nRemnants=" << eventInfo.nRemnants
351  << "\n Reaction was: " << aTrack.GetKineticEnergy()/MeV
352  << "-MeV " << aTrack.GetDefinition()->GetParticleName() << " + "
353  << theIonTable->GetIonName(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0)
354  << ", in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
355  theInterfaceStore->EmitWarning(ss.str());
356  }
357 
358  // Apply the toLabFrame rotation
359  fourMomentum *= toLabFrame;
360  spin *= toLabFrame3;
361  // Apply the inverse-kinematics boost
362  if(inverseKinematics) {
363  fourMomentum *= *toDirectKinematics;
364  fourMomentum.setVect(-fourMomentum.vect());
365  }
366 
367  fourMomentumOut += fourMomentum;
368  G4Fragment remnant(A, Z, fourMomentum);
369  remnant.SetAngularMomentum(spin);
370  if(dumpRemnantInfo) {
371  G4cerr << "G4INCLXX_DUMP_REMNANT: " << remnant << " spin: " << spin << G4endl;
372  }
373  remnants.push_back(remnant);
374  }
375 
376  // Check four-momentum conservation
377  const G4LorentzVector violation4Momentum = fourMomentumOut - fourMomentumIn;
378  const G4double energyViolation = std::abs(violation4Momentum.e());
379  const G4double momentumViolation = violation4Momentum.rho();
380  if(energyViolation > G4INCLXXInterfaceStore::GetInstance()->GetConservationTolerance()) {
381  std::stringstream ss;
382  ss << "energy conservation violated by " << energyViolation/MeV << " MeV in "
383  << aTrack.GetKineticEnergy()/MeV << "-MeV " << aTrack.GetDefinition()->GetParticleName()
384  << " + " << theIonTable->GetIonName(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0)
385  << " inelastic reaction, in " << (inverseKinematics ? "inverse" : "direct") << " kinematics. Will resample.";
386  theInterfaceStore->EmitWarning(ss.str());
387  eventIsOK = false;
388  const G4int nSecondaries = theResult.GetNumberOfSecondaries();
389  for(G4int j=0; j<nSecondaries; ++j)
390  delete theResult.GetSecondary(j)->GetParticle();
391  theResult.Clear();
392  theResult.SetStatusChange(stopAndKill);
393  remnants.clear();
394  } else if(momentumViolation > G4INCLXXInterfaceStore::GetInstance()->GetConservationTolerance()) {
395  std::stringstream ss;
396  ss << "momentum conservation violated by " << momentumViolation/MeV << " MeV in "
397  << aTrack.GetKineticEnergy()/MeV << "-MeV " << aTrack.GetDefinition()->GetParticleName()
398  << " + " << theIonTable->GetIonName(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0)
399  << " inelastic reaction, in " << (inverseKinematics ? "inverse" : "direct") << " kinematics. Will resample.";
400  theInterfaceStore->EmitWarning(ss.str());
401  eventIsOK = false;
402  const G4int nSecondaries = theResult.GetNumberOfSecondaries();
403  for(G4int j=0; j<nSecondaries; ++j)
404  delete theResult.GetSecondary(j)->GetParticle();
405  theResult.Clear();
406  theResult.SetStatusChange(stopAndKill);
407  remnants.clear();
408  }
409  }
410  nTries++;
411  } while(!eventIsOK && nTries < maxTries);
412 
413  // Clean up the objects that we created for the inverse kinematics
414  if(inverseKinematics) {
415  delete aProjectileTrack;
416  delete theTargetNucleus;
417  delete toInverseKinematics;
418  delete toDirectKinematics;
419  }
420 
421  if(!eventIsOK) {
422  std::stringstream ss;
423  ss << "maximum number of tries exceeded for the proposed "
424  << aTrack.GetKineticEnergy()/MeV << "-MeV " << aTrack.GetDefinition()->GetParticleName()
425  << " + " << theIonTable->GetIonName(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0)
426  << " inelastic reaction, in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
427  theInterfaceStore->EmitWarning(ss.str());
428  theResult.SetStatusChange(isAlive);
429  theResult.SetEnergyChange(aTrack.GetKineticEnergy());
430  theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
431  return &theResult;
432  }
433 
434  // De-excitation:
435 
436  if(theDeExcitation != 0) {
437  for(std::list<G4Fragment>::iterator i = remnants.begin();
438  i != remnants.end(); i++) {
439  G4ReactionProductVector *deExcitationResult = theDeExcitation->DeExcite((*i));
440 
441  for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
442  fragment != deExcitationResult->end(); ++fragment) {
443  G4ParticleDefinition *def = (*fragment)->GetDefinition();
444  if(def != 0) {
445  G4DynamicParticle *theFragment = new G4DynamicParticle(def, (*fragment)->GetMomentum());
446  theResult.AddSecondary(theFragment);
447  }
448  }
449 
450  for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
451  fragment != deExcitationResult->end(); ++fragment) {
452  delete (*fragment);
453  }
454  deExcitationResult->clear();
455  delete deExcitationResult;
456  }
457  }
458 
459  remnants.clear();
460 
461  return &theResult;
462 }
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetMaxProjMassINCL() const
Getter for theMaxProjMassINCL.
G4double GetCascadeMinEnergyPerNucleon() const
Getter for cascadeMinEnergyPerNucleon.
G4HadSecondary * GetSecondary(size_t i)
CLHEP::HepLorentzRotation G4LorentzRotation
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].
const char * p
Definition: xmltok.h:285
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:449
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
Float_t jzRem[maxSizeRemnants]
Remnant angular momentum, z component [ ].
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
const G4String & GetModelName() const
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.
Float_t EKinRem[maxSizeRemnants]
Remnant kinetic energy [MeV].
int G4int
Definition: G4Types.hh:78
Float_t pyRem[maxSizeRemnants]
Remnant momentum, y component [MeV/c].
const G4String & GetParticleName() const
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
Definition: G4IonTable.cc:992
HepRotation inverse() const
G4int GetAtomicNumber() const
double phi() const
Short_t ZRem[maxSizeRemnants]
Remnant charge number.
void SetStatusChange(G4HadFinalStateStatus aS)
Short_t ARem[maxSizeRemnants]
Remnant mass number.
std::vector< G4ReactionProduct * > G4ReactionProductVector
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.
Hep3Vector vect() const
Short_t Z[maxSizeParticles]
Particle charge number.
const G4ParticleDefinition * GetDefinition() const
double theta() const
Short_t nParticles
Number of particles in the final state.
G4INCL::INCL * GetINCLModel()
Get the cached INCL model engine.
Float_t jxRem[maxSizeRemnants]
Remnant angular momentum, x component [ ].
bool G4bool
Definition: G4Types.hh:79
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
Definition: G4IonTable.cc:1232
const EventInfo & processEvent()
G4double GetKineticEnergy() const
Float_t pzRem[maxSizeRemnants]
Remnant momentum, z component [MeV/c].
double rho() const
Float_t EStarRem[maxSizeRemnants]
Remnant excitation energy [MeV].
const G4LorentzVector & Get4Momentum() const
G4int GetAtomicMass() const
Float_t jyRem[maxSizeRemnants]
Remnant angular momentum, y component [ ].
G4LorentzVector Get4Momentum() const
Int_t nRemnants
Number of remnants.
Float_t pxRem[maxSizeRemnants]
Remnant momentum, x component [MeV/c].
Short_t A[maxSizeParticles]
Particle mass number.
void Set4Momentum(const G4LorentzVector &momentum)
void SetEnergyChange(G4double anEnergy)
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &thePrimary, G4Nucleus &theNucleus)=0
G4double GetPDGMass() const
Hep3Vector unit() const
G4DynamicParticle * GetParticle()
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
#define G4endl
Definition: G4ios.hh:61
HepLorentzRotation inverse() const
void setVect(const Hep3Vector &)
Bool_t transparent
True if the event is transparent.
void EmitWarning(const G4String &message)
Emit a warning to G4cout.
double G4double
Definition: G4Types.hh:76
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
void SetMomentumChange(const G4ThreeVector &aV)
G4int GetNumberOfSecondaries() const
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
void AddSecondary(G4DynamicParticle *aP)
G4GLOB_DLL std::ostream G4cerr
Hep3Vector getV() const
void G4INCLXXInterface::DeleteModel ( )
inline

Definition at line 124 of file G4INCLXXInterface.hh.

124  {
125  delete theINCLModel;
126  theINCLModel = NULL;
127  }
G4int G4INCLXXInterface::operator!= ( G4INCLXXInterface right)
inline

Definition at line 108 of file G4INCLXXInterface.hh.

108  {
109  return (this != &right);
110  }
G4int G4INCLXXInterface::operator== ( G4INCLXXInterface right)
inline

Definition at line 104 of file G4INCLXXInterface.hh.

104  {
105  return (this == &right);
106  }
G4ReactionProductVector * G4INCLXXInterface::Propagate ( G4KineticTrackVector theSecondaries,
G4V3DNucleus theNucleus 
)
virtual

Implements G4VIntraNuclearTransportModel.

Definition at line 464 of file G4INCLXXInterface.cc.

464  {
465  return 0;
466 }

The documentation for this class was generated from the following files: