#include <G4INCLBinaryCollisionAvatar.hh>
Inheritance diagram for G4INCL::BinaryCollisionAvatar:
Public Member Functions | |
BinaryCollisionAvatar (G4double, G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *) | |
virtual | ~BinaryCollisionAvatar () |
G4INCL::IChannel * | getChannel () const |
ParticleList | getParticles () const |
virtual void | preInteraction () |
virtual FinalState * | postInteraction (FinalState *) |
std::string | dump () const |
Static Public Attributes | |
static const G4double | cutNN = 1910 |
static const G4double | cutNNSquared = cutNN*cutNN |
Definition at line 54 of file G4INCLBinaryCollisionAvatar.hh.
G4INCL::BinaryCollisionAvatar::BinaryCollisionAvatar | ( | G4double | , | |
G4double | , | |||
G4INCL::Nucleus * | , | |||
G4INCL::Particle * | , | |||
G4INCL::Particle * | ||||
) |
Definition at line 66 of file G4INCLBinaryCollisionAvatar.cc.
References G4INCL::CollisionAvatarType, and G4INCL::IAvatar::setType().
00068 : InteractionAvatar(time, n, p1, p2), theCrossSection(crossSection) 00069 { 00070 setType(CollisionAvatarType); 00071 }
G4INCL::BinaryCollisionAvatar::~BinaryCollisionAvatar | ( | ) | [virtual] |
std::string G4INCL::BinaryCollisionAvatar::dump | ( | ) | const [virtual] |
Implements G4INCL::IAvatar.
Definition at line 209 of file G4INCLBinaryCollisionAvatar.cc.
References G4INCL::Particle::dump(), G4INCL::InteractionAvatar::particle1, G4INCL::InteractionAvatar::particle2, and G4INCL::IAvatar::theTime.
00209 { 00210 std::stringstream ss; 00211 ss << "(avatar " << theTime <<" 'nn-collision" << std::endl 00212 << "(list " << std::endl 00213 << particle1->dump() 00214 << particle2->dump() 00215 << "))" << std::endl; 00216 return ss.str(); 00217 }
G4INCL::IChannel * G4INCL::BinaryCollisionAvatar::getChannel | ( | ) | const [virtual] |
Implements G4INCL::InteractionAvatar.
Definition at line 76 of file G4INCLBinaryCollisionAvatar.cc.
References G4INCL::InteractionAvatar::boostVector, cutNNSquared, DEBUG, G4INCL::CrossSections::deltaProduction(), G4INCL::ThreeVector::dot(), G4INCL::CrossSections::elastic(), G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::Particle::getPosition(), G4INCL::Nucleus::getStore(), G4INCL::Particle::isDelta(), G4INCL::Particle::isNucleon(), G4INCL::Particle::isPion(), G4INCL::ThreeVector::mag2(), G4INCL::InteractionAvatar::particle1, G4INCL::InteractionAvatar::particle2, G4INCL::Particle::print(), G4INCL::CrossSections::recombination(), G4INCL::InteractionAvatar::restoreParticles(), G4INCL::Random::shoot(), G4INCL::InteractionAvatar::shouldUseLocalEnergy(), G4INCL::KinematicsUtils::squareTotalEnergyInCM(), G4INCL::Math::tenPi, and G4INCL::InteractionAvatar::theNucleus.
00076 { 00077 // We already check cutNN at avatar creation time, but we have to check it 00078 // again here. For composite projectiles, we might have created independent 00079 // avatars with no cutNN before any collision took place. 00080 if(particle1->isNucleon() 00081 && particle2->isNucleon() 00082 && theNucleus->getStore()->getBook()->getAcceptedCollisions()!=0) { 00083 const G4double energyCM2 = KinematicsUtils::squareTotalEnergyInCM(particle1, particle2); 00084 // Below a certain cut value we don't do anything: 00085 if(energyCM2 < cutNNSquared) { 00086 DEBUG("CM energy = sqrt(" << energyCM2 << ") MeV < sqrt(" << cutNNSquared 00087 << ") MeV = cutNN" << "; returning a NULL channel" << std::endl); 00088 InteractionAvatar::restoreParticles(); 00089 return NULL; 00090 } 00091 } 00092 00112 ThreeVector minimumDistance = particle1->getPosition(); 00113 minimumDistance -= particle2->getPosition(); 00114 const G4double betaDotX = boostVector.dot(minimumDistance); 00115 const G4double minDist = Math::tenPi*(minimumDistance.mag2() + betaDotX*betaDotX / (1.-boostVector.mag2())); 00116 if(minDist > theCrossSection) { 00117 DEBUG("CM distance of approach is too small: " << minDist << ">" << 00118 theCrossSection <<"; returning a NULL channel" << std::endl); 00119 InteractionAvatar::restoreParticles(); 00120 return NULL; 00121 } 00122 00123 if(particle1->isNucleon() && particle2->isNucleon()) { // NN->NN 00124 G4double elasticCX = CrossSections::elastic(particle1, 00125 particle2); 00126 G4double deltaProductionCX = CrossSections::deltaProduction(particle1, 00127 particle2); 00128 00129 G4bool isElastic = true; 00130 if(elasticCX/(elasticCX + deltaProductionCX) < Random::shoot()) { 00131 // NN -> N Delta channel is chosen 00132 isElastic = false; 00133 } 00134 00135 if(isElastic) { // Elastic NN channel 00136 DEBUG("NN interaction: elastic channel chosen" << std::endl); 00137 return new ElasticChannel(theNucleus, particle1, particle2); 00138 } else { // Delta production 00139 // Inelastic NN channel 00140 DEBUG("NN interaction: inelastic channel chosen" << std::endl); 00141 return new DeltaProductionChannel(particle1, particle2, theNucleus); 00142 } 00143 } else if((particle1->isNucleon() && particle2->isDelta()) || 00144 (particle1->isDelta() && particle2->isNucleon())) { 00145 G4double elasticCX = CrossSections::elastic(particle1, 00146 particle2); 00147 G4double recombinationCX = CrossSections::recombination(particle1, 00148 particle2); 00149 00150 G4bool isElastic = true; 00151 if(elasticCX/(elasticCX + recombinationCX) < Random::shoot()) { 00152 // N Delta -> NN channel is chosen 00153 isElastic = false; 00154 } 00155 00156 if(isElastic) { // Elastic N Delta channel 00157 DEBUG("NDelta interaction: elastic channel chosen" << std::endl); 00158 return new ElasticChannel(theNucleus, particle1, particle2); 00159 } else { // Recombination 00160 DEBUG("NDelta interaction: recombination channel chosen" << std::endl); 00161 return new RecombinationChannel(theNucleus, particle1, particle2); 00162 } 00163 } else if(particle1->isDelta() && particle2->isDelta()) { 00164 DEBUG("DeltaDelta interaction: elastic channel chosen" << std::endl); 00165 return new ElasticChannel(theNucleus, particle1, particle2); 00166 } else if((particle1->isNucleon() && particle2->isPion()) || 00167 (particle1->isPion() && particle2->isNucleon())) { 00168 return new PionNucleonChannel(particle1, particle2, theNucleus, shouldUseLocalEnergy()); 00169 } else { 00170 DEBUG("BinaryCollisionAvatar can only handle nucleons (for the moment)." 00171 << std::endl 00172 << particle1->print() 00173 << std::endl 00174 << particle2->print() 00175 << std::endl); 00176 InteractionAvatar::restoreParticles(); 00177 return NULL; 00178 } 00179 }
ParticleList G4INCL::BinaryCollisionAvatar::getParticles | ( | ) | const [inline, virtual] |
Implements G4INCL::IAvatar.
Definition at line 59 of file G4INCLBinaryCollisionAvatar.hh.
References G4INCL::InteractionAvatar::particle1, and G4INCL::InteractionAvatar::particle2.
00059 { 00060 ParticleList theParticleList; 00061 theParticleList.push_back(particle1); 00062 theParticleList.push_back(particle2); 00063 return theParticleList; 00064 };
FinalState * G4INCL::BinaryCollisionAvatar::postInteraction | ( | FinalState * | ) | [virtual] |
Reimplemented from G4INCL::InteractionAvatar.
Definition at line 185 of file G4INCLBinaryCollisionAvatar.cc.
References G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::Book::getCurrentTime(), G4INCL::Nucleus::getStore(), G4INCL::FinalState::getValidity(), G4INCL::Book::incrementAcceptedCollisions(), G4INCL::Book::incrementBlockedCollisions(), G4INCL::NoEnergyConservationFS, G4INCL::InteractionAvatar::oldXSec, G4INCL::ParticleBelowFermiFS, G4INCL::ParticleBelowZeroFS, G4INCL::PauliBlockedFS, G4INCL::InteractionAvatar::postInteraction(), G4INCL::Book::setFirstCollisionTime(), G4INCL::Book::setFirstCollisionXSec(), G4INCL::InteractionAvatar::theNucleus, and G4INCL::ValidFS.
00185 { 00186 // Call the postInteraction method of the parent class 00187 // (provides Pauli blocking and enforces energy conservation) 00188 fs = InteractionAvatar::postInteraction(fs); 00189 00190 switch(fs->getValidity()) { 00191 case PauliBlockedFS: 00192 theNucleus->getStore()->getBook()->incrementBlockedCollisions(); 00193 break; 00194 case NoEnergyConservationFS: 00195 case ParticleBelowFermiFS: 00196 case ParticleBelowZeroFS: 00197 break; 00198 case ValidFS: 00199 theNucleus->getStore()->getBook()->incrementAcceptedCollisions(); 00200 if(theNucleus->getStore()->getBook()->getAcceptedCollisions() == 1) { 00201 G4double t = theNucleus->getStore()->getBook()->getCurrentTime(); 00202 theNucleus->getStore()->getBook()->setFirstCollisionTime(t); 00203 theNucleus->getStore()->getBook()->setFirstCollisionXSec(oldXSec); 00204 } 00205 } 00206 return fs; 00207 }
void G4INCL::BinaryCollisionAvatar::preInteraction | ( | ) | [virtual] |
Reimplemented from G4INCL::InteractionAvatar.
Definition at line 181 of file G4INCLBinaryCollisionAvatar.cc.
References G4INCL::InteractionAvatar::preInteraction().
00181 { 00182 InteractionAvatar::preInteraction(); 00183 }
const G4double G4INCL::BinaryCollisionAvatar::cutNN = 1910 [static] |
Definition at line 71 of file G4INCLBinaryCollisionAvatar.hh.
const G4double G4INCL::BinaryCollisionAvatar::cutNNSquared = cutNN*cutNN [static] |
Definition at line 72 of file G4INCLBinaryCollisionAvatar.hh.
Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar(), and getChannel().