33 #define INCLXX_IN_GEANT4_MODE 1
48 #ifndef G4INCLINTERACTIONAVATAR_HH_
49 #define G4INCLINTERACTIONAVATAR_HH_
RootFunctor * violationEFunctor
virtual ~ViolationEMomentumFunctor()
G4double theEnergy
The initial energy of the particle.
static const G4double locEAccuracy
Target accuracy in the determination of the local-energy Q-value.
void cleanUp(const G4bool success) const
Clean up after root finding.
Channel generates a final state of an avatar.
G4int getAcceptedCollisions() const
void preInteractionLocalEnergy(Particle *const p)
Apply local-energy transformation, if appropriate.
const G4bool shouldUseLocalEnergy
True if we should use local energy.
G4bool shouldUseLocalEnergy() const
true if the given avatar should use local energy
static const G4int maxIterLocE
Max number of iterations for the determination of the local-energy Q-value.
ParticleList finalParticles
List of final-state particles.
Nucleus * theNucleus
Pointer to the nucleus.
G4double initialEnergy
Total energy before the interaction.
RootFunctor-derived object for enforcing energy conservation in pi-N.
Config const * getConfig()
Get the config object.
virtual G4INCL::IChannel * getChannel()=0
ViolationEEnergyFunctor(Nucleus *const nucleus, FinalState const *const finalState, const G4bool localE)
Prepare for calling the () operator and scaleParticleMomenta.
static G4ThreadLocal Particle * backupParticle2
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
G4double operator()(const G4double x) const
Compute the energy-conservation violation.
Final state of an interaction.
static void deleteBackupParticles()
Release the memory allocated for the backup particles.
Book & getBook()
Return the pointer to the Book object which keeps track of various counters.
G4double initialEnergy
Total energy before the interaction.
Nucleus * theNucleus
Pointer to the nucleus.
void setParticleEnergy(const G4double energy) const
Set the energy of the particle.
FinalState * postInteraction(FinalState *)
void preInteractionBlocking()
Store the state of the particles before the interaction.
static G4ThreadLocal Particle * backupParticle1
ThreeVector theMomentum
The initial momentum of the particle.
RootFunctor-derived object for enforcing energy conservation in N-N.
const G4bool shouldUseLocalEnergy
Whether we should use local energy.
Particle * theParticle
The final-state particle.
G4double energyThreshold
Threshold for the energy of the particle.
ViolationEMomentumFunctor(Nucleus *const nucleus, FinalState const *const finalState, ThreeVector const *const boost, const G4bool localE)
Prepare for calling the () operator and scaleParticleMomenta.
LocalEnergyType getLocalEnergyPiType() const
Get the type of local energy for pi-N and decay avatars.
G4double energy(const ThreeVector &p, const G4double m)
LocalEnergyType getLocalEnergyBBType() const
Get the type of local energy for N-N avatars.
std::list< ThreeVector > particleMomenta
CM particle momenta, as determined by the channel.
ThreeVector const * boostVector
Pointer to the boost vector.
virtual ~ViolationEEnergyFunctor()
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
void restoreParticles() const
Restore the state of both particles.
G4double operator()(const G4double x) const
Compute the energy-conservation violation.
G4bool bringParticleInside(Particle *const p)
void scaleParticleMomenta(const G4double alpha) const
Scale the momenta of the modified and created particles.
virtual ~InteractionAvatar()
static const G4double alpha
void cleanUp(const G4bool success) const
Clean up after root finding.
AvatarType getType() const
Static root-finder algorithm.