34 #define INCLXX_IN_GEANT4_MODE 1
75 isParticle1Spectator(false),
76 isParticle2Spectator(false),
96 <<
") MeV = cutNN" <<
"; returning a NULL channel" <<
'\n');
126 INCL_DEBUG(
"CM distance of approach is too small: " << minDist <<
">" <<
144 if(elasticCX > rChannel) {
147 INCL_DEBUG(
"NN interaction: elastic channel chosen" <<
'\n');
149 }
else if((elasticCX + deltaProductionCX) > rChannel) {
152 INCL_DEBUG(
"NN interaction: Delta channel chosen" <<
'\n');
154 }
else if(elasticCX + deltaProductionCX + onePiProductionCX > rChannel) {
157 INCL_DEBUG(
"NN interaction: one Pion channel chosen" <<
'\n');
159 }
else if(elasticCX + deltaProductionCX + onePiProductionCX + twoPiProductionCX > rChannel) {
162 INCL_DEBUG(
"NN interaction: two Pions channel chosen" <<
'\n');
164 }
else if(elasticCX + deltaProductionCX + onePiProductionCX + twoPiProductionCX + threePiProductionCX > rChannel) {
167 INCL_DEBUG(
"NN interaction: three Pions channel chosen" <<
'\n');
169 }
else if (elasticCX + deltaProductionCX + onePiProductionCX + twoPiProductionCX + threePiProductionCX + fourPiProductionCX > rChannel) {
172 INCL_DEBUG(
"NN interaction: four Pions channel chosen" <<
'\n');
175 INCL_WARN(
"inconsistency within the NN Cross Sections (sum!=inelastic)" <<
'\n');
176 if(fourPiProductionCX>0.) {
177 INCL_WARN(
"Returning a 4pi channel" <<
'\n');
180 }
else if(threePiProductionCX>0.) {
181 INCL_WARN(
"Returning a 3pi channel" <<
'\n');
184 }
else if(twoPiProductionCX>0.) {
185 INCL_WARN(
"Returning a 2pi channel" <<
'\n');
188 }
else if(onePiProductionCX>0.) {
189 INCL_WARN(
"Returning a 1pi channel" <<
'\n');
192 }
else if(deltaProductionCX>0.) {
193 INCL_WARN(
"Returning a delta-production channel" <<
'\n');
197 INCL_WARN(
"Returning an elastic channel" <<
'\n');
209 if(elasticCX/(elasticCX + recombinationCX) <
Random::shoot()) {
216 INCL_DEBUG(
"NDelta interaction: elastic channel chosen" <<
'\n');
220 INCL_DEBUG(
"NDelta interaction: recombination channel chosen" <<
'\n');
227 INCL_DEBUG(
"DeltaDelta interaction: elastic channel chosen" <<
'\n');
242 if(elasticCX > rChannel) {
245 INCL_DEBUG(
"PiN interaction: elastic channel chosen" <<
'\n');
247 }
else if(elasticCX + deltaProductionCX > rChannel) {
250 INCL_DEBUG(
"PiN interaction: Delta channel chosen" <<
'\n');
252 }
else if(elasticCX + deltaProductionCX + onePiProductionCX > rChannel) {
255 INCL_DEBUG(
"PiN interaction: one Pion channel chosen" <<
'\n');
257 }
else if(elasticCX + deltaProductionCX + onePiProductionCX + twoPiProductionCX > rChannel) {
260 INCL_DEBUG(
"PiN interaction: two Pions channel chosen" <<
'\n');
262 }
else if(elasticCX + deltaProductionCX + onePiProductionCX + twoPiProductionCX + threePiProductionCX > rChannel) {
265 INCL_DEBUG(
"PiN interaction: three Pions channel chosen" <<
'\n');
268 INCL_WARN(
"inconsistency within the PiN Cross Sections (sum!=inelastic)" <<
'\n');
269 if(threePiProductionCX>0.) {
270 INCL_WARN(
"Returning a 3pi channel" <<
'\n');
273 }
else if(twoPiProductionCX>0.) {
274 INCL_WARN(
"Returning a 2pi channel" <<
'\n');
277 }
else if(onePiProductionCX>0.) {
278 INCL_WARN(
"Returning a 1pi channel" <<
'\n');
281 }
else if(deltaProductionCX>0.) {
282 INCL_WARN(
"Returning a delta-production channel" <<
'\n');
286 INCL_WARN(
"Returning an elastic channel" <<
'\n');
292 INCL_DEBUG(
"BinaryCollisionAvatar can only handle nucleons (for the moment)."
334 INCL_ERROR(
"First collision must be within a target spectator and a non-target spectator");
352 std::stringstream ss;
353 ss <<
"(avatar " <<
theTime <<
" 'nn-collision" <<
'\n'
FinalStateValidity getValidity() const
void incrementBlockedCollisions()
G4double dot(const ThreeVector &v) const
Dot product.
Channel generates a final state of an avatar.
G4int getAcceptedCollisions() const
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
void postInteraction(FinalState *)
G4bool isTargetSpectator() const
const G4INCL::ThreeVector & getMomentum() const
Get the momentum vector.
G4bool isDelta() const
Is it a Delta?
std::string print() const
G4double NDeltaToNN(Particle const *const p1, Particle const *const p2)
virtual void postInteraction(FinalState *)
G4double mag2() const
Get the square of the length.
static G4ThreadLocal Particle * backupParticle2
G4bool isParticle2Spectator
void incrementAcceptedCollisions()
Final state of an interaction.
void setType(AvatarType t)
Book & getBook()
Return the pointer to the Book object which keeps track of various counters.
void setFirstCollisionXSec(const G4double x)
static G4ThreadLocal Particle * backupParticle1
G4double NNToNDelta(Particle const *const p1, Particle const *const p2)
void setFirstCollisionTime(const G4double t)
static G4ThreadLocal G4double cutNNSquared
static G4ThreadLocal G4double cutNN
Delta-nucleon recombination channel.
G4double total(Particle const *const p1, Particle const *const p2)
G4INCL::IChannel * getChannel()
const G4INCL::ThreeVector & getPosition() const
Set the position vector.
virtual void preInteraction()
G4double piNToDelta(Particle const *const p1, Particle const *const p2)
G4bool isNucleon() const
Is this a nucleon?
G4double shoot()
Generate flat distribution of random numbers.
virtual ~BinaryCollisionAvatar()
G4bool isParticle1Spectator
G4double piNToxPiN(const G4int xpi, Particle const *const p1, Particle const *const p2)
void restoreParticles() const
Restore the state of both particles.
G4double mag() const
Get the length of the vector.
BinaryCollisionAvatar(G4double, G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
G4double getCurrentTime() const
void setFirstCollisionIsElastic(const G4bool e)
G4double NNToxPiNN(const G4int xpi, Particle const *const p1, Particle const *const p2)
void setFirstCollisionSpectatorMomentum(const G4double x)
G4double elastic(Particle const *const p1, Particle const *const p2)
void setFirstCollisionSpectatorPosition(const G4double x)