34#define INCLXX_IN_GEANT4_MODE 1
49#ifndef G4INCLINTERACTIONAVATAR_HH_
50#define G4INCLINTERACTIONAVATAR_HH_
116 class ViolationEMomentumFunctor :
public RootFunctor {
123 virtual ~ViolationEMomentumFunctor();
133 void cleanUp(
const G4bool success)
const;
139 std::vector<ThreeVector> particleMomenta;
148 const G4bool shouldUseLocalEnergy;
158 void scaleParticleMomenta(
const G4double alpha)
const;
163 class ViolationEEnergyFunctor :
public RootFunctor {
169 ViolationEEnergyFunctor(
Nucleus *
const nucleus,
Particle *
const aParticle,
const G4double totalEnergyBeforeInteraction,
const G4bool localE);
170 virtual ~ViolationEEnergyFunctor() {}
180 void cleanUp(
const G4bool success)
const;
186 void setParticleEnergy(
const G4double energy)
const;
194 Particle *theParticle;
198 ThreeVector theMomentum;
205 const G4bool shouldUseLocalEnergy;
208 RootFunctor *violationEFunctor;
Singleton for recycling allocation of instances of a given class.
#define INCL_DECLARE_ALLOCATION_POOL(T)
Static root-finder algorithm.
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
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.