Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::InteractionAvatar Class Referenceabstract

#include <G4INCLInteractionAvatar.hh>

Inheritance diagram for G4INCL::InteractionAvatar:

Public Member Functions

 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *)
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
virtual ~InteractionAvatar ()
void setSrcPartner (Particle *p)
void preInteractionLocalEnergy (Particle *const p)
 Apply local-energy transformation, if appropriate.
ThreeVector getboostVector ()
void setboostVector (ThreeVector &v)
Public Member Functions inherited from G4INCL::IAvatar
 IAvatar ()
 IAvatar (G4double time)
virtual ~IAvatar ()
FinalStategetFinalState ()
void fillFinalState (FinalState *fs)
G4double getTime () const
G4double setTime (G4double t) const
virtual ParticleList getParticles () const =0
virtual std::string dump () const =0
AvatarType getType () const
G4bool isACollision () const
G4bool isADecay () const
void setType (AvatarType t)
long getID () const
std::string toString ()

Static Public Member Functions

static void deleteBackupParticles ()
 Release the memory allocated for the backup particles.
static InteractionAvatarInstance ()

Static Public Attributes

static const G4double locEAccuracy = 1.E-4
 Target accuracy in the determination of the local-energy Q-value.
static const G4int maxIterLocE = 50
 Max number of iterations for the determination of the local-energy Q-value.

Protected Member Functions

virtual G4INCL::IChannelgetChannel ()=0
G4bool bringParticleInside (Particle *const p)
void preInteractionBlocking ()
 Store the state of the particles before the interaction.
void preInteraction ()
void postInteraction (FinalState *)
void restoreParticles () const
 Restore the state of both particles.
void restoreSrcPartner (FinalState *fs)
G4bool shouldUseLocalEnergy () const
 true if the given avatar should use local energy
G4bool enforceEnergyConservation (FinalState *const fs)
 Enforce energy conservation.

Protected Attributes

EventInfo theEventInfo
NucleustheNucleus
Particleparticle1
Particleparticle2
ThreeVector boostVector
G4double oldTotalEnergy
G4double oldXSec
G4bool isPiN
G4double weight
ParticleList modified
ParticleList created
ParticleList modifiedAndCreated
ParticleList Destroyed
ParticleList ModifiedAndDestroyed
Protected Attributes inherited from G4INCL::IAvatar
G4double theTime

Static Protected Attributes

static G4ThreadLocal ParticlebackupParticle1 = NULL
static G4ThreadLocal ParticlebackupParticle2 = NULL

Detailed Description

Definition at line 61 of file G4INCLInteractionAvatar.hh.

Constructor & Destructor Documentation

◆ InteractionAvatar() [1/2]

G4INCL::InteractionAvatar::InteractionAvatar ( G4double time,
G4INCL::Nucleus * n,
G4INCL::Particle * p1 )

◆ InteractionAvatar() [2/2]

G4INCL::InteractionAvatar::InteractionAvatar ( G4double time,
G4INCL::Nucleus * n,
G4INCL::Particle * p1,
G4INCL::Particle * p2 )

Definition at line 81 of file G4INCLInteractionAvatar.cc.

83 : IAvatar(time), theNucleus(n),
84 particle1(p1), particle2(p2),
85 isPiN((p1->isPion() && p2->isNucleon()) || (p2->isPion() && p1->isNucleon())),
86 weight(1.),
87 violationEFunctor(NULL)
88 {
89 interactionAvatar = this;
90 }
G4bool isPion() const
Is this a pion?
G4bool isNucleon() const

◆ ~InteractionAvatar()

G4INCL::InteractionAvatar::~InteractionAvatar ( )
virtual

Definition at line 94 of file G4INCLInteractionAvatar.cc.

94 {
95 }

Member Function Documentation

◆ bringParticleInside()

G4bool G4INCL::InteractionAvatar::bringParticleInside ( Particle *const p)
protected

Definition at line 162 of file G4INCLInteractionAvatar.cc.

162 {
163 if(!theNucleus)
164 return false;
165
166 ThreeVector pos = p->getPosition();
167 p->rpCorrelate();
168 G4double pos2 = pos.mag2();
169 const G4double r = theNucleus->getSurfaceRadius(p);
170 short iterations=0;
171 const short maxIterations=50;
172
173 if(pos2 < r*r) return true;
174
175 while( pos2 >= r*r && iterations<maxIterations ) /* Loop checking, 10.07.2015, D.Mancusi */
176 {
177 pos *= std::sqrt(r*r*0.9801/pos2); // 0.9801 == 0.99*0.99
178 pos2 = pos.mag2();
179 iterations++;
180 }
181 if( iterations < maxIterations)
182 {
183 INCL_DEBUG("Particle position vector length was : " << p->getPosition().mag() << ", rescaled to: " << pos.mag() << '\n');
184 p->setPosition(pos);
185 return true;
186 }
187 else
188 return false;
189 }
#define INCL_DEBUG(x)
double G4double
Definition G4Types.hh:83

Referenced by postInteraction().

◆ deleteBackupParticles()

void G4INCL::InteractionAvatar::deleteBackupParticles ( )
static

Release the memory allocated for the backup particles.

Definition at line 109 of file G4INCLInteractionAvatar.cc.

109 {
110 delete backupParticle1;
112 delete backupParticle2;
113 if (backupPartner)
114 delete backupPartner;
115 backupParticle1 = NULL;
116 backupParticle2 = NULL;
117 backupPartner = NULL;
118 }
static G4ThreadLocal Particle * backupParticle2
static G4ThreadLocal Particle * backupParticle1

Referenced by G4INCL::INCL::~INCL().

◆ enforceEnergyConservation()

G4bool G4INCL::InteractionAvatar::enforceEnergyConservation ( FinalState *const fs)
protected

Enforce energy conservation.

Final states generated by the channels might violate energy conservation because of different reasons (energy-dependent potentials, local energy...). This conservation law must therefore be enforced by hand. We do so by rescaling the momenta of the final-state particles in the CM frame. If this turns out to be impossible, this method returns false.

Returns
true if the algorithm succeeded

Definition at line 522 of file G4INCLInteractionAvatar.cc.

522 {
523 // Set up the violationE calculation
524 const G4bool manyBodyFinalState = (modifiedAndCreated.size() > 1);
525
526 if(manyBodyFinalState)
527 violationEFunctor = new ViolationEMomentumFunctor(theNucleus, modifiedAndCreated, fs->getTotalEnergyBeforeInteraction(), boostVector, shouldUseLocalEnergy());
528 else {
529 if (modified.empty()) {
530 Particle * const p1 = created.front(); //we destroy all nucleons during annihilation in NNbar case
531 // The following condition is necessary for the functor to work
532 // correctly. A similar condition exists in INCL4.6.
533 if(p1->getMass() < ParticleTable::minDeltaMass)
534 return false;
535 violationEFunctor = new ViolationEEnergyFunctor(theNucleus, p1, fs->getTotalEnergyBeforeInteraction(), shouldUseLocalEnergy());
536 }
537 else{
538 Particle * const p2 = modified.front(); // normal situation
539 // The following condition is necessary for the functor to work
540 // correctly. A similar condition exists in INCL4.6.
541 if(p2->getMass() < ParticleTable::minDeltaMass)
542 return false;
543 violationEFunctor = new ViolationEEnergyFunctor(theNucleus, p2, fs->getTotalEnergyBeforeInteraction(), shouldUseLocalEnergy());
544 }
545 }
546
547 // Apply the root-finding algorithm
548 const RootFinder::Solution theSolution = RootFinder::solve(violationEFunctor, 1.0);
549 if(theSolution.success) { // Apply the solution
550 (*violationEFunctor)(theSolution.x);
551 } else if(theNucleus){
552 INCL_DEBUG("Couldn't enforce energy conservation after an interaction, root-finding algorithm failed." << '\n');
553 theNucleus->getStore()->getBook().incrementEnergyViolationInteraction();
554 }
555 delete violationEFunctor;
556 violationEFunctor = NULL;
557 return theSolution.success;
558 }
bool G4bool
Definition G4Types.hh:86
G4bool shouldUseLocalEnergy() const
true if the given avatar should use local energy
G4ThreadLocal G4double minDeltaMass
Solution solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.

Referenced by G4INCL::DecayAvatar::postInteraction(), and postInteraction().

◆ getboostVector()

ThreeVector G4INCL::InteractionAvatar::getboostVector ( )
inline

Definition at line 88 of file G4INCLInteractionAvatar.hh.

88{return boostVector;}

◆ getChannel()

virtual G4INCL::IChannel * G4INCL::InteractionAvatar::getChannel ( )
protectedpure virtual

◆ Instance()

InteractionAvatar * G4INCL::InteractionAvatar::Instance ( )
static

static instance

Definition at line 92 of file G4INCLInteractionAvatar.cc.

92{ return interactionAvatar; }

Referenced by G4INCL::SrcChannel::fillFinalState().

◆ postInteraction()

void G4INCL::InteractionAvatar::postInteraction ( FinalState * fs)
protectedvirtual

Implements G4INCL::IAvatar.

Definition at line 191 of file G4INCLInteractionAvatar.cc.

191 {
192 INCL_DEBUG("postInteraction: final state: " << '\n' << fs->print() << '\n');
193 modified = fs->getModifiedParticles();
194 created = fs->getCreatedParticles();
195 Destroyed = fs->getDestroyedParticles();
197 modifiedAndCreated.insert(modifiedAndCreated.end(), created.begin(), created.end());
199 ModifiedAndDestroyed.insert(ModifiedAndDestroyed.end(), Destroyed.begin(), Destroyed.end());
200
201 // Boost back to lab
202 //modifiedAndCreated.boost(-boostVector);
203
204 for (ParticleIter i = modifiedAndCreated.begin(),
205 e = modifiedAndCreated.end();
206 i != e; ++i)
207 if ((*i)->isSrcPartner() == false){
208 (*i)->boost(-boostVector);
209 }
210
211 // If there is no Nucleus, just return
212 if(!theNucleus) return;
213
214 // Mark pions and kaons that have been created outside their well (we will force them
215 // to be emitted later).
216 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
217 if(((*i)->isPion() || (*i)->isKaon() || (*i)->isAntiKaon()) && (*i)->getPosition().mag() > theNucleus->getSurfaceRadius(*i)) {
218 (*i)->makeParticipant();
219 (*i)->setOutOfWell();
220 fs->addOutgoingParticle(*i);
221 INCL_DEBUG("Pion was created outside its potential well." << '\n'
222 << (*i)->print());
223 }
224
225 // Try to enforce energy conservation
226 G4int check = 0;
227 G4double oldTotalEnergy2 = 0.;
228 if (modifiedAndCreated.size() == 3 &&
229 theNucleus->getStore()->getBook().getAcceptedSrcCollisions() == 1) {
230 for (ParticleIter i = modifiedAndCreated.begin(),
231 e = modifiedAndCreated.end();
232 i != e; ++i) {
233 if ((*i)->getSrcPair() > 0.) {
234 check++;
235 }
236 }
237 }
238
239 G4double ediff = 0., partnerE = 0.;
240 if (check == 2) {
241 G4double oldTotalEnergy3 = 0.;
242 partnerE = backupPartner->getEnergy() - backupPartner->getPotentialEnergy();
243 for (ParticleIter i = modifiedAndCreated.begin(),
244 e = modifiedAndCreated.end();
245 i != e; ++i) {
246 if ((*i)->isNucleon())
247 oldTotalEnergy3 += (*i)->getEnergy() - (*i)->getPotentialEnergy();
248 else if ((*i)->isResonance())
249 oldTotalEnergy3 += (*i)->getEnergy() - (*i)->getPotentialEnergy() -
251 }
252
253 INCL_DEBUG("check initial energies: "
254 << backupParticle1->getEnergy() << " , "
255 << backupParticle2->getEnergy() << " , "
256 << backupPartner->getEnergy() << '\n');
257
258 INCL_DEBUG("check initial energies total: "
259 << backupParticle1->getEnergy() -
260 backupParticle1->getPotentialEnergy() +
261 backupParticle2->getEnergy() -
262 backupParticle2->getPotentialEnergy() +
263 backupPartner->getEnergy() -
264 backupPartner->getPotentialEnergy()
265 << '\n');
266
267 ediff =
268 oldTotalEnergy3 -
269 (backupParticle1->getEnergy() - backupParticle1->getPotentialEnergy() +
270 backupParticle2->getEnergy() - backupParticle2->getPotentialEnergy() +
271 backupPartner->getEnergy() - backupPartner->getPotentialEnergy());
272
273 INCL_DEBUG("check diff. src energies: " << oldTotalEnergy3 << " , " << ediff
274 << '\n');
275 }
276
277 // Try to enforce energy conservation
278 fs->setTotalEnergyBeforeInteraction(oldTotalEnergy + ediff + partnerE);
279
280 INCL_DEBUG("postInteraction before enforceEnergyConservation final state: "
281 << oldTotalEnergy + oldTotalEnergy2 << " \n Einit= "
282 << oldTotalEnergy << " \n Ecor= " << oldTotalEnergy2 << '\n'
283 << fs->print() << '\n');
284 G4bool success = enforceEnergyConservation(fs);
285 INCL_DEBUG("enforceEnergyConservation finish " << success << '\n');
286
287 if(!success) {
288 INCL_DEBUG("Enforcing energy conservation: failed!" << '\n');
289
290 // Restore the state of the initial particles
292
293 if (check == 2) {
294 INCL_DEBUG("Enforcing energy conservation: failed for SRC"
295 << " , eventnb: " << theEventInfo.eventNumber << '\n');
297 }
298
299 // Delete newly created particles
300 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
301 delete *i;
302
303 fs->reset();
304 fs->makeNoEnergyConservation();
305 fs->setTotalEnergyBeforeInteraction(0.0);
306
307 return; // Interaction is blocked. Return an empty final state.
308 }
309 INCL_DEBUG("Enforcing energy conservation: success!" << '\n');
310
311 INCL_DEBUG("postInteraction after energy conservation: final state: " << '\n' << fs->print() << '\n');
312
313 // Check that outgoing delta resonances can decay to pi-N
314 for(ParticleIter i=modified.begin(), e=modified.end(); i!=e; ++i )
315 if((*i)->isDelta() &&
316 (*i)->getMass() < ParticleTable::minDeltaMass) {
317 INCL_DEBUG("Mass of the produced delta below decay threshold; forbidding collision. deltaMass=" <<
318 (*i)->getMass() << '\n');
319
320 // Restore the state of the initial particles
322
323 if (check == 2) {
324 INCL_DEBUG("Mass of the produced delta below decay threshold for SRC"
325 << " , eventnb: " << theEventInfo.eventNumber << '\n');
327 }
328
329 // Delete newly created particles
330 for(ParticleIter j=created.begin(), end=created.end(); j!=end; ++j )
331 delete *j;
332
333 fs->reset();
334 fs->makeNoEnergyConservation();
335 fs->setTotalEnergyBeforeInteraction(0.0);
336
337 return; // Interaction is blocked. Return an empty final state.
338 }
339
340 INCL_DEBUG("Random seeds before Pauli blocking: " << Random::getSeeds() << '\n');
341 // Test Pauli blocking
343
344 if (isBlocked && check < 2) {
345 INCL_DEBUG("Pauli: Blocked!" << '\n');
346
347 // Restore the state of the initial particles
349
350 if (check == 2) {
351 INCL_DEBUG("Pauli: Blocked SRC!"
352 << " , eventnb: " << theEventInfo.eventNumber << '\n');
354 }
355
356 // Delete newly created particles
357 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
358 delete *i;
359
360 fs->reset();
361 fs->makePauliBlocked();
362 fs->setTotalEnergyBeforeInteraction(0.0);
363
364 return; // Interaction is blocked. Return an empty final state.
365 }
366 INCL_DEBUG("Pauli: Allowed!" << '\n');
367
368 // Test CDPP blocking
370 G4int cntB = 0; //Do not pass through CDPP if Nbar annihilation
371 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i ){
372 if((*i)->isBaryon())
373 cntB++;
374 }
375 if(cntB==0)
376 isCDPPBlocked=false;
377
378 if(isCDPPBlocked) {
379 INCL_DEBUG("CDPP: Blocked!" << '\n');
380
381 // Restore the state of the initial particles
383
384 if (check == 2) {
385 INCL_DEBUG("CDPP: Blocked for SRC"
386 << " , eventnb: " << theEventInfo.eventNumber << '\n');
388 }
389
390 // Delete newly created particles
391 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
392 delete *i;
393
394 fs->reset();
395 fs->makePauliBlocked();
396 fs->setTotalEnergyBeforeInteraction(0.0);
397
398 return; // Interaction is blocked. Return an empty final state.
399 }
400 INCL_DEBUG("CDPP: Allowed!" << '\n');
401
402 // If all went well, try to bring particles inside the nucleus...
403 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i )
404 {
405 // ...except for pions beyond their surface radius.
406 if((*i)->isOutOfWell()) continue;
407
408 const G4bool successBringParticlesInside = bringParticleInside(*i);
409 if( !successBringParticlesInside ) {
410 INCL_ERROR("Failed to bring particle inside the nucleus!" << '\n');
411 }
412 }
413
414 // Collision accepted!
415 // Biasing of the final state
416 std::vector<G4int> newBiasCollisionVector;
417 newBiasCollisionVector = ModifiedAndDestroyed.getParticleListBiasVector();
418 if(std::fabs(weight-1.) > 1E-6){
419 newBiasCollisionVector.push_back(Particle::nextBiasedCollisionID);
421 weight = 1.; // useless?
422 }
423 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i ) {
424 (*i)->setBiasCollisionVector(newBiasCollisionVector);
425 if(!(*i)->isOutOfWell()) {
426 // Decide if the particle should be made into a spectator
427 // (Back to spectator)
428 G4bool goesBackToSpectator = false;
429 if((*i)->isNucleon() && theNucleus->getStore()->getConfig()->getBackToSpectator()) {
430 G4double threshold = (*i)->getPotentialEnergy();
431 if((*i)->getType()==Proton)
432 threshold += Math::twoThirds*theNucleus->getTransmissionBarrier(*i);
433 if((*i)->getKineticEnergy() < threshold)
434 goesBackToSpectator = true;
435 }
436 // Thaw the particle propagation
437 (*i)->thawPropagation();
438
439 // Increment or decrement the participant counters
440 if(goesBackToSpectator) {
441 INCL_DEBUG("The following particle goes back to spectator:" << '\n'
442 << (*i)->print() << '\n');
443 if(!(*i)->isTargetSpectator()) {
444 theNucleus->getStore()->getBook().decrementCascading();
445 }
446 (*i)->makeTargetSpectator();
447 } else {
448 if((*i)->isTargetSpectator()) {
449 theNucleus->getStore()->getBook().incrementCascading();
450 }
451 (*i)->makeParticipant();
452 }
453 }
454 (*i)->resetSrcPartner();
455 }
456 ParticleList destroyed = fs->getDestroyedParticles();
457 for(ParticleIter i=destroyed.begin(), e=destroyed.end(); i!=e; ++i )
458 if(!(*i)->isTargetSpectator())
459 theNucleus->getStore()->getBook().decrementCascading();
460
461 if (check == 2) {
462 theNucleus->setSrcInternalEnergy(ediff);
463 for (ParticleIter i = modifiedAndCreated.begin(),
464 e = modifiedAndCreated.end();
465 i != e; ++i) {
466 (*i)->resetSrcPartner();
467 }
468 INCL_DEBUG("postInteraction end, src energy: "
469 << ediff << " , eventnb: " << theEventInfo.eventNumber << '\n');
470 }
471 return;
472 }
#define INCL_ERROR(x)
int G4int
Definition G4Types.hh:85
void restoreParticles() const
Restore the state of both particles.
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
G4bool bringParticleInside(Particle *const p)
static void FillINCLBiasVector(G4double newBias)
static G4ThreadLocal G4int nextBiasedCollisionID
const G4double twoThirds
const G4double effectiveNucleonMass
G4bool isBlocked(ParticleList const &p, Nucleus const *const n)
Check Pauli blocking.
G4bool isCDPPBlocked(ParticleList const &p, Nucleus const *const n)
Check CDPP blocking.
SeedVector getSeeds()
ParticleList::const_iterator ParticleIter
std::vector< Base * > ParticleList
Definition PoPI.hpp:186

Referenced by G4INCL::BinaryCollisionAvatar::postInteraction(), and G4INCL::DecayAvatar::postInteraction().

◆ preInteraction()

void G4INCL::InteractionAvatar::preInteraction ( )
protectedvirtual

Implements G4INCL::IAvatar.

Definition at line 147 of file G4INCLInteractionAvatar.cc.

147 {
149
151
152 if(particle2) {
155 particle2->boost(boostVector);
156 } else {
157 boostVector = particle1->getMomentum()/particle1->getEnergy();
158 }
159 particle1->boost(boostVector);
160 }
void preInteractionBlocking()
Store the state of the particles before the interaction.
void preInteractionLocalEnergy(Particle *const p)
Apply local-energy transformation, if appropriate.
ThreeVector makeBoostVector(Particle const *const p1, Particle const *const p2)

Referenced by G4INCL::BinaryCollisionAvatar::preInteraction(), and G4INCL::DecayAvatar::preInteraction().

◆ preInteractionBlocking()

void G4INCL::InteractionAvatar::preInteractionBlocking ( )
protected

Store the state of the particles before the interaction.

If the interaction cannot be realised for any reason, we will need to restore the particle state as it was before. This is done by calling the restoreParticles() method.

Definition at line 120 of file G4INCLInteractionAvatar.cc.

120 {
122 (*backupParticle1) = (*particle1);
123 else
124 backupParticle1 = new Particle(*particle1);
125
126 if(particle2) {
128 (*backupParticle2) = (*particle2);
129 else
130 backupParticle2 = new Particle(*particle2);
131
132 oldTotalEnergy = particle1->getEnergy() + particle2->getEnergy()
133 - particle1->getPotentialEnergy() - particle2->getPotentialEnergy();
135 } else {
136 oldTotalEnergy = particle1->getEnergy() - particle1->getPotentialEnergy();
137 }
138 }
G4double total(Particle const *const p1, Particle const *const p2)

Referenced by preInteraction().

◆ preInteractionLocalEnergy()

void G4INCL::InteractionAvatar::preInteractionLocalEnergy ( Particle *const p)

Apply local-energy transformation, if appropriate.

Parameters
pparticle to apply the transformation to

Definition at line 140 of file G4INCLInteractionAvatar.cc.

140 {
141 if(!theNucleus || p->isMeson() || p->isPhoton() || p->isAntiNucleon()) return; // Local energy does not make any sense without a nucleus
142
145 }
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)

Referenced by preInteraction().

◆ restoreParticles()

void G4INCL::InteractionAvatar::restoreParticles ( ) const
protected

Restore the state of both particles.

The state must first be stored by calling preInteractionBlocking().

Definition at line 474 of file G4INCLInteractionAvatar.cc.

474 {
475 (*particle1) = (*backupParticle1);
476 particle1->resetSrcPartner();
477 if(particle2){
478 (*particle2) = (*backupParticle2);
479 particle2->resetSrcPartner();
480 }
481 }

Referenced by G4INCL::BinaryCollisionAvatar::getChannel(), G4INCL::DecayAvatar::postInteraction(), and postInteraction().

◆ restoreSrcPartner()

void G4INCL::InteractionAvatar::restoreSrcPartner ( FinalState * fs)
protected

Definition at line 483 of file G4INCLInteractionAvatar.cc.

483 {
484
485 theNucleus->getStore()->getBook().setAcceptedSrcCollisions(0);
486
487 auto m = fs->getSrcModifiedParticles();
488
489 if (backupPartner) {
490 for (ParticleIter i = m.begin(), e = m.end(); i != e; ++i) {
491 if ((*i)->getType() == backupPartner->getType() &&
492 (*i)->getSrcPair() == backupPartner->getSrcPair()) {
493 (*i)->setPosition(backupPartner->getPosition());
494 (*i)->setMomentum(backupPartner->getMomentum());
495 (*i)->adjustEnergyFromMomentum();
496 (*i)->resetSrcPartner();
497 theNucleus->updatePotentialEnergy(*i);
498 }
499 }
500 }
501 theNucleus->setSrcInternalEnergy(0.0);
502 }

Referenced by postInteraction().

◆ setboostVector()

void G4INCL::InteractionAvatar::setboostVector ( ThreeVector & v)
inline

Definition at line 90 of file G4INCLInteractionAvatar.hh.

90{boostVector = v;}

◆ setSrcPartner()

void G4INCL::InteractionAvatar::setSrcPartner ( Particle * p)

Definition at line 97 of file G4INCLInteractionAvatar.cc.

97 {
98
99 if (backupPartner) {
100 (*backupPartner) = (*p);
101 } else {
102 backupPartner = new Particle(*p);
103 }
104 INCL_DEBUG("setSrcPartner:" << backupPartner->print());
105
106 return;
107 }

◆ shouldUseLocalEnergy()

G4bool G4INCL::InteractionAvatar::shouldUseLocalEnergy ( ) const
protected

true if the given avatar should use local energy

Definition at line 504 of file G4INCLInteractionAvatar.cc.

504 {
505 if(!theNucleus) return false;
506 LocalEnergyType theLocalEnergyType;
507 if(theNucleus->getStore()->getConfig()->getProjectileType()==antiProton ||
508 theNucleus->getStore()->getConfig()->getProjectileType()==antiNeutron||
509 theNucleus->getStore()->getConfig()->getProjectileType()==antiComposite){
510 return false;
511 }
513 theLocalEnergyType = theNucleus->getStore()->getConfig()->getLocalEnergyPiType();
514 else
515 theLocalEnergyType = theNucleus->getStore()->getConfig()->getLocalEnergyBBType();
516
517 const G4bool firstAvatar = (theNucleus->getStore()->getBook().getAcceptedCollisions() == 0);
518 return ((theLocalEnergyType == FirstCollisionLocalEnergy && firstAvatar) ||
519 theLocalEnergyType == AlwaysLocalEnergy);
520 }
AvatarType getType() const
@ DecayAvatarType
@ FirstCollisionLocalEnergy

Referenced by enforceEnergyConservation(), and preInteractionLocalEnergy().

Member Data Documentation

◆ backupParticle1

G4ThreadLocal Particle * G4INCL::InteractionAvatar::backupParticle1 = NULL
staticprotected

◆ backupParticle2

G4ThreadLocal Particle * G4INCL::InteractionAvatar::backupParticle2 = NULL
staticprotected

◆ boostVector

◆ created

ParticleList G4INCL::InteractionAvatar::created
protected

◆ Destroyed

ParticleList G4INCL::InteractionAvatar::Destroyed
protected

◆ isPiN

G4bool G4INCL::InteractionAvatar::isPiN
protected

◆ locEAccuracy

const G4double G4INCL::InteractionAvatar::locEAccuracy = 1.E-4
static

Target accuracy in the determination of the local-energy Q-value.

Definition at line 68 of file G4INCLInteractionAvatar.hh.

◆ maxIterLocE

const G4int G4INCL::InteractionAvatar::maxIterLocE = 50
static

Max number of iterations for the determination of the local-energy Q-value.

Definition at line 70 of file G4INCLInteractionAvatar.hh.

◆ modified

ParticleList G4INCL::InteractionAvatar::modified
protected

◆ modifiedAndCreated

ParticleList G4INCL::InteractionAvatar::modifiedAndCreated
protected

◆ ModifiedAndDestroyed

ParticleList G4INCL::InteractionAvatar::ModifiedAndDestroyed
protected

◆ oldTotalEnergy

G4double G4INCL::InteractionAvatar::oldTotalEnergy
protected

◆ oldXSec

G4double G4INCL::InteractionAvatar::oldXSec
protected

◆ particle1

◆ particle2

◆ theEventInfo

EventInfo G4INCL::InteractionAvatar::theEventInfo
protected

Definition at line 97 of file G4INCLInteractionAvatar.hh.

Referenced by postInteraction().

◆ theNucleus

◆ weight

G4double G4INCL::InteractionAvatar::weight
protected

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