Main method to apply the INCL physics model.
121{
122
123
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.";
136 }
138 }
139
140 const G4int maxTries = 200;
141
142
143 const G4bool inverseKinematics = AccurateProjectile(aTrack, theNucleus);
144
145
149 G4Nucleus *theTargetNucleus = &theNucleus;
150 if(inverseKinematics) {
156
157 if(oldProjectileDef != 0 && oldTargetDef != 0) {
160
161 if(newTargetA > 0 && newTargetZ > 0) {
162
163 theTargetNucleus =
new G4Nucleus(newTargetA, newTargetZ);
166 G4LorentzVector theProjectile4Momentum(0.0, 0.0, 0.0, theProjectileMass);
167 G4DynamicParticle swappedProjectileParticle(oldTargetDef, (*toInverseKinematics) * theProjectile4Momentum);
169 } else {
170 G4String message =
"badly defined target after swapping. Falling back to normal (non-swapped) mode.";
173 }
174 } else {
175 G4String message =
"oldProjectileDef or oldTargetDef was null";
178 }
179 }
180
181
182
183
184
186
187
188
189
190
191
192
193
194
200
201
202
203
204
205
206
207
210
211 std::list<G4Fragment> remnants;
212
214
215
216
218 do {
220 const G4double kineticEnergy = toINCLKineticEnergy(*aProjectileTrack);
221
222
224
227 }
229
231 if(eventIsOK) {
232
233
234
235 if(inverseKinematics) {
237 }
238
242
248 if(p != 0) {
250
251
252 momentum *= toLabFrame;
253
254 if(inverseKinematics) {
255 momentum *= *toDirectKinematics;
257 }
258
259
262
263 } else {
264 G4String message =
"the model produced a particle that couldn't be converted to Geant4 particle.";
266 }
267 }
268
272
278 eventInfo.
jxRem[i]*hbar_Planck,
279 eventInfo.
jyRem[i]*hbar_Planck,
280 eventInfo.
jzRem[i]*hbar_Planck
281 );
284 const G4double scaling = remnant4MomentumScaling(nuclearMass,
285 kinE,
286 px, py, 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
299 << ", in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
301 }
302
303
304 fourMomentum *= toLabFrame;
305 spin *= toLabFrame3;
306
307 if(inverseKinematics) {
308 fourMomentum *= *toDirectKinematics;
309 fourMomentum.setVect(-fourMomentum.vect());
310 }
311
313 remnant.SetAngularMomentum(spin);
314 remnants.push_back(remnant);
315 }
316 }
317 nTries++;
318 } while(!eventIsOK && nTries < maxTries);
319
320
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 "
333 << " inelastic reaction, in " << (inverseKinematics ? "inverse" : "direct") << " kinematics.";
338 return &theResult;
339 }
340
341
342
343 if(theExcitationHandler != 0) {
344 for(std::list<G4Fragment>::const_iterator i = remnants.begin();
345 i != remnants.end(); i++) {
347
348 for(G4ReactionProductVector::iterator fragment = deExcitationResult->begin();
349 fragment != deExcitationResult->end(); ++fragment) {
351 if(def != 0) {
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}
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)
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
static G4double GetNuclearMass(const G4double A, const G4double Z)
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.