34#define INCLXX_IN_GEANT4_MODE 1
49#ifndef G4INCLINTERACTIONAVATAR_HH_
50#define G4INCLINTERACTIONAVATAR_HH_
Singleton for recycling allocation of instances of a given class.
#define INCL_DECLARE_ALLOCATION_POOL(T)
Static root-finder algorithm.
static const G4double alpha
RootFunctor-derived object for enforcing energy conservation in delta production.
virtual ~ViolationEEnergyFunctor()
G4double energyThreshold
Threshold for the energy of the particle.
G4double operator()(const G4double x) const
Compute the energy-conservation violation.
G4double initialEnergy
Total energy before the interaction.
ThreeVector theMomentum
The initial momentum of the particle.
ViolationEEnergyFunctor(Nucleus *const nucleus, Particle *const aParticle, const G4double totalEnergyBeforeInteraction, const G4bool localE)
Prepare for calling the () operator and setParticleEnergy.
void cleanUp(const G4bool success) const
Clean up after root finding.
void setParticleEnergy(const G4double energy) const
Set the energy of the particle.
const G4bool shouldUseLocalEnergy
Whether we should use local energy.
G4double theEnergy
The initial energy of the particle.
Nucleus * theNucleus
Pointer to the nucleus.
Particle * theParticle
The final-state particle.
RootFunctor-derived object for enforcing energy conservation in N-N.
ThreeVector const & boostVector
Pointer to the boost vector.
ViolationEMomentumFunctor(Nucleus *const nucleus, ParticleList const &modAndCre, const G4double totalEnergyBeforeInteraction, ThreeVector const &boost, const G4bool localE)
Prepare for calling the () operator and scaleParticleMomenta.
void cleanUp(const G4bool success) const
Clean up after root finding.
ParticleList finalParticles
List of final-state particles.
void scaleParticleMomenta(const G4double alpha) const
Scale the momenta of the modified and created particles.
virtual ~ViolationEMomentumFunctor()
G4double operator()(const G4double x) const
Compute the energy-conservation violation.
std::vector< ThreeVector > particleMomenta
CM particle momenta, as determined by the channel.
const G4bool shouldUseLocalEnergy
True if we should use local energy.
Nucleus * theNucleus
Pointer to the nucleus.
G4double initialEnergy
Total energy before the interaction.
RootFunctor * violationEFunctor
static const G4int maxIterLocE
Max number of iterations for the determination of the local-energy Q-value.
void restoreParticles() const
Restore the state of both particles.
ParticleList modifiedAndCreated
ParticleList ModifiedAndDestroyed
virtual ~InteractionAvatar()
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
static void deleteBackupParticles()
Release the memory allocated for the backup particles.
void preInteractionBlocking()
Store the state of the particles before the interaction.
static const G4double locEAccuracy
Target accuracy in the determination of the local-energy Q-value.
virtual G4INCL::IChannel * getChannel()=0
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
static G4ThreadLocal Particle * backupParticle2
G4bool shouldUseLocalEnergy() const
true if the given avatar should use local energy
void postInteraction(FinalState *)
static G4ThreadLocal Particle * backupParticle1
G4bool bringParticleInside(Particle *const p)
void preInteractionLocalEnergy(Particle *const p)
Apply local-energy transformation, if appropriate.
G4double energy(const ThreeVector &p, const G4double m)