Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLXXInterface Class Reference

INCL++ intra-nuclear cascade with G4ExcitationHandler for de-excitation. More...

#include <G4INCLXXInterface.hh>

+ Inheritance diagram for G4INCLXXInterface:

Public Member Functions

 G4INCLXXInterface (const G4String &name="INCL++ cascade with G4ExcitationHandler")
 
 ~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 G4ReactionProductVectorPropagate (G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)=0
 
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 G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
 
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
 
G4int GetVerboseLevel () const
 
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, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 

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 with G4ExcitationHandler for de-excitation.

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);
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
INCL++ intra-nuclear cascade with G4ExcitationHandler for de-excitation.
static G4Proton * Proton()
Definition: G4Proton.cc:93

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

Definition at line 93 of file G4INCLXXInterface.hh.

Constructor & Destructor Documentation

◆ G4INCLXXInterface()

G4INCLXXInterface::G4INCLXXInterface ( const G4String name = "INCL++ cascade with G4ExcitationHandler")

Definition at line 51 of file G4INCLXXInterface.cc.

51 :
53 theINCLModel(NULL),
54 theInterfaceStore(G4INCLXXInterfaceStore::GetInstance()),
55 complainedAboutBackupModel(false)
56{
57 // Use the environment variable G4INCLXX_NO_DE_EXCITATION to disable de-excitation
58 if(getenv("G4INCLXX_NO_DE_EXCITATION")) {
59 G4String message = "de-excitation is completely disabled!";
60 theInterfaceStore->EmitWarning(message);
61 theExcitationHandler = 0;
62 } else {
63 theExcitationHandler = new G4ExcitationHandler;
64 }
65
66 theBackupModel = new G4BinaryLightIonReaction;
67}
void EmitWarning(const G4String &message)
Emit a warning to G4cout.
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.

◆ ~G4INCLXXInterface()

G4INCLXXInterface::~G4INCLXXInterface ( )

Definition at line 69 of file G4INCLXXInterface.cc.

70{
71 delete theBackupModel;
72 delete theExcitationHandler;
73}

Member Function Documentation

◆ ApplyYourself()

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 120 of file G4INCLXXInterface.cc.

121{
122 // For systems heavier than theMaxProjMassINCL, use another model (typically
123 // BIC)
124 const G4int theMaxProjMassINCL = theInterfaceStore->GetMaxProjMassINCL();
125 if(aTrack.GetDefinition()->GetAtomicMass() > 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 ("
133 << theBackupModel->GetModelName()
134 << ") will be used instead.";
135 G4cout << "[INCL++] Warning: " << ss.str() << G4endl;
136 }
137 return theBackupModel->ApplyYourself(aTrack, theNucleus);
138 }
139
140 const G4int maxTries = 200;
141
142 // Check if inverse kinematics should be used
143 const G4bool inverseKinematics = AccurateProjectile(aTrack, theNucleus);
144
145 // If we are running in inverse kinematics, redefine aTrack and theNucleus
146 G4LorentzRotation *toInverseKinematics = NULL;
147 G4LorentzRotation *toDirectKinematics = NULL;
148 G4HadProjectile const *aProjectileTrack = &aTrack;
149 G4Nucleus *theTargetNucleus = &theNucleus;
150 if(inverseKinematics) {
151 G4ParticleTable * const theParticleTable = G4ParticleTable::GetParticleTable();
152 const G4int oldTargetA = theNucleus.GetA_asInt();
153 const G4int oldTargetZ = theNucleus.GetZ_asInt();
154 G4ParticleDefinition *oldTargetDef = theParticleTable->GetIon(oldTargetZ, oldTargetA, 0.0);
155 const G4ParticleDefinition *oldProjectileDef = aTrack.GetDefinition();
156
157 if(oldProjectileDef != 0 && oldTargetDef != 0) {
158 const G4int newTargetA = oldProjectileDef->GetAtomicMass();
159 const G4int newTargetZ = oldProjectileDef->GetAtomicNumber();
160
161 if(newTargetA > 0 && newTargetZ > 0) {
162 // This should give us the same energy per nucleon
163 theTargetNucleus = new G4Nucleus(newTargetA, newTargetZ);
164 const G4double theProjectileMass = theParticleTable->GetIonTable()->GetIonMass(oldTargetZ, oldTargetA);
165 toInverseKinematics = new G4LorentzRotation(aTrack.Get4Momentum().boostVector());
166 G4LorentzVector theProjectile4Momentum(0.0, 0.0, 0.0, theProjectileMass);
167 G4DynamicParticle swappedProjectileParticle(oldTargetDef, (*toInverseKinematics) * theProjectile4Momentum);
168 aProjectileTrack = new G4HadProjectile(swappedProjectileParticle);
169 } else {
170 G4String message = "badly defined target after swapping. Falling back to normal (non-swapped) mode.";
171 theInterfaceStore->EmitWarning(message);
172 toInverseKinematics = new G4LorentzRotation;
173 }
174 } else {
175 G4String message = "oldProjectileDef or oldTargetDef was null";
176 theInterfaceStore->EmitWarning(message);
177 toInverseKinematics = new G4LorentzRotation;
178 }
179 }
180
181 // INCL assumes the projectile particle is going in the direction of
182 // the Z-axis. Here we construct proper rotation to convert the
183 // momentum vectors of the outcoming particles to the original
184 // coordinate system.
185 G4LorentzVector projectileMomentum = aProjectileTrack->Get4Momentum();
186
187 // INCL++ assumes that the projectile is going in the direction of
188 // the z-axis. In principle, if the coordinate system used by G4
189 // hadronic framework is defined differently we need a rotation to
190 // transform the INCL++ reaction products to the appropriate
191 // frame. Please note that it isn't necessary to apply this
192 // transform to the projectile because when creating the INCL++
193 // projectile particle; \see{toINCLKineticEnergy} needs to use only the
194 // projectile energy (direction is simply assumed to be along z-axis).
196 toZ.rotateZ(-projectileMomentum.phi());
197 toZ.rotateY(-projectileMomentum.theta());
198 G4RotationMatrix toLabFrame3 = toZ.inverse();
199 G4LorentzRotation toLabFrame(toLabFrame3);
200 // However, it turns out that the projectile given to us by G4
201 // hadronic framework is already going in the direction of the
202 // z-axis so this rotation is actually unnecessary. Both toZ and
203 // toLabFrame turn out to be unit matrices as can be seen by
204 // uncommenting the folowing two lines:
205 // G4cout <<"toZ = " << toZ << G4endl;
206 // G4cout <<"toLabFrame = " << toLabFrame << G4endl;
207
208 theResult.Clear(); // Make sure the output data structure is clean.
209 theResult.SetStatusChange(stopAndKill);
210
211 std::list<G4Fragment> remnants;
212
213 G4int nTries = 0;
214 // INCL can generate transparent events. However, this is meaningful
215 // only in the standalone code. In Geant4 we must "force" INCL to
216 // produce a valid cascade.
217 G4bool eventIsOK = false;
218 do {
219 const G4INCL::ParticleSpecies theSpecies = toINCLParticleSpecies(*aProjectileTrack);
220 const G4double kineticEnergy = toINCLKineticEnergy(*aProjectileTrack);
221
222 // The INCL model will be created at the first use
224
225 if(theInterfaceStore->GetDumpInput()) {
226 G4cout << theINCLModel->configToString() << G4endl;
227 }
228 const G4INCL::EventInfo eventInfo = theINCLModel->processEvent(theSpecies, kineticEnergy, theTargetNucleus->GetA_asInt(), theTargetNucleus->GetZ_asInt());
229 // eventIsOK = !eventInfo.transparent && nTries < maxTries;
230 eventIsOK = !eventInfo.transparent;
231 if(eventIsOK) {
232
233 // If the collision was run in inverse kinematics, prepare to boost back
234 // all the reaction products
235 if(inverseKinematics) {
236 toDirectKinematics = new G4LorentzRotation(toInverseKinematics->inverse());
237 }
238
239 for(G4int i = 0; i < eventInfo.nParticles; i++) {
240 G4int A = eventInfo.A[i];
241 G4int Z = eventInfo.Z[i];
242 // G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
243 G4double kinE = eventInfo.EKin[i];
244 G4double px = eventInfo.px[i];
245 G4double py = eventInfo.py[i];
246 G4double pz = eventInfo.pz[i];
247 G4DynamicParticle *p = toG4Particle(A, Z , kinE, px, py, pz);
248 if(p != 0) {
249 G4LorentzVector momentum = p->Get4Momentum();
250
251 // Apply the toLabFrame rotation
252 momentum *= toLabFrame;
253 // Apply the inverse-kinematics boost
254 if(inverseKinematics) {
255 momentum *= *toDirectKinematics;
256 momentum.setVect(-momentum.vect());
257 }
258
259 // Set the four-momentum of the reaction products
260 p->Set4Momentum(momentum);
261 theResult.AddSecondary(p);
262
263 } else {
264 G4String message = "the model produced a particle that couldn't be converted to Geant4 particle.";
265 theInterfaceStore->EmitWarning(message);
266 }
267 }
268
269 for(G4int i = 0; i < eventInfo.nRemnants; i++) {
270 const G4int A = eventInfo.ARem[i];
271 const G4int Z = eventInfo.ZRem[i];
272 // G4cout <<"INCL particle A = " << A << " Z = " << Z << G4endl;
273 const G4double kinE = eventInfo.EKinRem[i];
274 const G4double px = eventInfo.pxRem[i];
275 const G4double py = eventInfo.pyRem[i];
276 const G4double pz = eventInfo.pzRem[i];
277 G4ThreeVector spin(
278 eventInfo.jxRem[i]*hbar_Planck,
279 eventInfo.jyRem[i]*hbar_Planck,
280 eventInfo.jzRem[i]*hbar_Planck
281 );
282 const G4double excitationE = eventInfo.EStarRem[i];
283 const G4double nuclearMass = G4NucleiProperties::GetNuclearMass(A, Z) + excitationE;
284 const G4double scaling = remnant4MomentumScaling(nuclearMass,
285 kinE,
286 px, py, pz);
287 G4LorentzVector fourMomentum(scaling * px, scaling * py, scaling * pz,
288 nuclearMass + kinE);
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
296 << "\n Reaction was: " << aTrack.GetKineticEnergy()/MeV
297 << "-MeV " << aTrack.GetDefinition()->GetParticleName() << " + "
298 << G4ParticleTable::GetParticleTable()->GetIon(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0.0)->GetParticleName()
299 << ", in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
300 theInterfaceStore->EmitWarning(ss.str());
301 }
302
303 // Apply the toLabFrame rotation
304 fourMomentum *= toLabFrame;
305 spin *= toLabFrame3;
306 // Apply the inverse-kinematics boost
307 if(inverseKinematics) {
308 fourMomentum *= *toDirectKinematics;
309 fourMomentum.setVect(-fourMomentum.vect());
310 }
311
312 G4Fragment remnant(A, Z, fourMomentum);
313 remnant.SetAngularMomentum(spin);
314 remnants.push_back(remnant);
315 }
316 }
317 nTries++;
318 } while(!eventIsOK && nTries < maxTries);
319
320 // Clean up the objects that we created for the inverse kinematics
321 if(inverseKinematics) {
322 delete aProjectileTrack;
323 delete theTargetNucleus;
324 delete toInverseKinematics;
325 delete toDirectKinematics;
326 }
327
328 if(!eventIsOK) {
329 std::stringstream ss;
330 ss << "maximum number of tries exceeded for the proposed "
331 << aTrack.GetKineticEnergy()/MeV << "-MeV " << aTrack.GetDefinition()->GetParticleName()
332 << " + " << G4ParticleTable::GetParticleTable()->GetIon(theNucleus.GetZ_asInt(), theNucleus.GetA_asInt(), 0.0)->GetParticleName()
333 << " inelastic reaction, in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
334 theInterfaceStore->EmitWarning(ss.str());
335 theResult.SetStatusChange(isAlive);
336 theResult.SetEnergyChange(aTrack.GetKineticEnergy());
337 theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
338 return &theResult;
339 }
340
341 // De-excitation:
342
343 if(theExcitationHandler != 0) {
344 for(std::list<G4Fragment>::const_iterator i = remnants.begin();
345 i != remnants.end(); i++) {
346 G4ReactionProductVector *deExcitationResult = theExcitationHandler->BreakItUp((*i));
347
348 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
349 fragment != deExcitationResult->end(); ++fragment) {
350 G4ParticleDefinition *def = (*fragment)->GetDefinition();
351 if(def != 0) {
352 G4DynamicParticle *theFragment = new G4DynamicParticle(def, (*fragment)->GetMomentum());
353 theResult.AddSecondary(theFragment);
354 }
355 }
356
357 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
358 fragment != deExcitationResult->end(); ++fragment) {
359 delete (*fragment);
360 }
361 deExcitationResult->clear();
362 delete deExcitationResult;
363 }
364 }
365
366 remnants.clear();
367
368 return &theResult;
369}
@ isAlive
@ stopAndKill
CLHEP::HepLorentzRotation G4LorentzRotation
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
Hep3Vector unit() const
HepLorentzRotation inverse() const
double theta() const
Hep3Vector boostVector() const
Hep3Vector vect() const
void setVect(const Hep3Vector &)
HepRotation inverse() const
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState) const
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
G4int GetMaxProjMassINCL() const
Getter for theMaxProjMassINCL.
G4INCL::INCL * GetINCLModel()
Get the cached INCL model engine.
G4bool GetDumpInput() const
Getter for dumpInput.
const EventInfo & processEvent()
std::string configToString()
G4double GetIonMass(G4int Z, G4int A, G4int L=0) const
!! Only ground states are supported now
Definition: G4IonTable.cc:774
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
G4int GetAtomicNumber() const
G4int GetAtomicMass() const
const G4String & GetParticleName() const
static G4ParticleTable * GetParticleTable()
G4IonTable * GetIonTable()
G4ParticleDefinition * GetIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
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.

◆ DeleteModel()

void G4INCLXXInterface::DeleteModel ( )
inline

Definition at line 116 of file G4INCLXXInterface.hh.

116 {
117 delete theINCLModel;
118 theINCLModel = NULL;
119 }

◆ operator!=()

G4int G4INCLXXInterface::operator!= ( G4INCLXXInterface right)
inline

Definition at line 102 of file G4INCLXXInterface.hh.

102 {
103 return (this != &right);
104 }

◆ operator==()

G4int G4INCLXXInterface::operator== ( G4INCLXXInterface right)
inline

Definition at line 98 of file G4INCLXXInterface.hh.

98 {
99 return (this == &right);
100 }

◆ Propagate()

G4ReactionProductVector * G4INCLXXInterface::Propagate ( G4KineticTrackVector theSecondaries,
G4V3DNucleus theNucleus 
)
virtual

Implements G4VIntraNuclearTransportModel.

Definition at line 371 of file G4INCLXXInterface.cc.

371 {
372 return 0;
373}

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