#include <G4ElementaryParticleCollider.hh>
Inheritance diagram for G4ElementaryParticleCollider:
Public Member Functions | |
G4ElementaryParticleCollider () | |
virtual | ~G4ElementaryParticleCollider () |
void | collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output) |
Definition at line 60 of file G4ElementaryParticleCollider.hh.
G4ElementaryParticleCollider::G4ElementaryParticleCollider | ( | ) |
Definition at line 110 of file G4ElementaryParticleCollider.cc.
00111 : G4CascadeColliderBase("G4ElementaryParticleCollider") {}
virtual G4ElementaryParticleCollider::~G4ElementaryParticleCollider | ( | ) | [inline, virtual] |
void G4ElementaryParticleCollider::collide | ( | G4InuclParticle * | bullet, | |
G4InuclParticle * | target, | |||
G4CollisionOutput & | output | |||
) | [virtual] |
Implements G4VCascadeCollider.
Definition at line 115 of file G4ElementaryParticleCollider.cc.
References G4CollisionOutput::addOutgoingParticles(), G4LorentzConvertor::backToTheLab(), G4cerr, G4cout, G4endl, G4InuclParticle::getDefinition(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4InuclParticle::getMomModule(), G4ParticleDefinition::GetParticleName(), G4LorentzConvertor::getSCMMomentum(), G4CascadeChannelTables::GetTable(), G4LorentzConvertor::getTotalSCMEnergy(), G4InteractionCase::hadrons(), G4CascadeColliderBase::interCase, G4InuclElementaryParticle::isPhoton(), G4InuclElementaryParticle::nucleon(), G4InuclElementaryParticle::pion(), G4InuclElementaryParticle::quasi_deutron(), G4InteractionCase::set(), G4LorentzConvertor::setBullet(), G4LorentzConvertor::setTarget(), G4LorentzConvertor::setVerbose(), G4LorentzConvertor::toTheCenterOfMass(), G4CascadeColliderBase::useEPCollider(), G4CascadeColliderBase::validateOutput(), and G4VCascadeCollider::verboseLevel.
Referenced by G4InuclCollider::collide(), and G4NucleiModel::generateParticleFate().
00118 { 00119 if (verboseLevel > 1) 00120 G4cout << " >>> G4ElementaryParticleCollider::collide" << G4endl; 00121 00122 if (!useEPCollider(bullet,target)) { // Sanity check 00123 G4cerr << " ElementaryParticleCollider -> can collide only particle with particle " 00124 << G4endl; 00125 return; 00126 } 00127 00128 #ifdef G4CASCADE_DEBUG_SAMPLER 00129 static G4bool doPrintTables = true; // Once and only once per job 00130 if (doPrintTables) { 00131 printFinalStateTables(); // For diagnostic reporting 00132 doPrintTables = false; 00133 } 00134 #endif 00135 00136 interCase.set(bullet, target); // To identify kind of collision 00137 00138 if (verboseLevel > 1) G4cout << *bullet << G4endl << *target << G4endl; 00139 00140 G4InuclElementaryParticle* particle1 = 00141 dynamic_cast<G4InuclElementaryParticle*>(bullet); 00142 G4InuclElementaryParticle* particle2 = 00143 dynamic_cast<G4InuclElementaryParticle*>(target); 00144 00145 if (!particle1 || !particle2) { // Redundant with useEPCollider() 00146 G4cerr << " ElementaryParticleCollider -> can only collide hadrons" 00147 << G4endl; 00148 return; 00149 } 00150 00151 // Check for available interaction, or pion+dibaryon special case 00152 if (!G4CascadeChannelTables::GetTable(interCase.hadrons()) && 00153 !particle1->quasi_deutron() && !particle2->quasi_deutron()) { 00154 G4cerr << " ElementaryParticleCollider -> cannot collide " 00155 << particle1->getDefinition()->GetParticleName() << " with " 00156 << particle2->getDefinition()->GetParticleName() << G4endl; 00157 return; 00158 } 00159 // Generate nucleon or pion collision with nucleon 00160 // or pion with quasi-deuteron 00161 00162 if (particle1->nucleon() || particle2->nucleon()) { // ok 00163 G4LorentzConvertor convertToSCM; 00164 if(particle2->nucleon()) { 00165 convertToSCM.setBullet(particle1); 00166 convertToSCM.setTarget(particle2); 00167 } else { 00168 convertToSCM.setBullet(particle2); 00169 convertToSCM.setTarget(particle1); 00170 }; 00171 00172 convertToSCM.setVerbose(verboseLevel); 00173 00174 convertToSCM.toTheCenterOfMass(); 00175 G4double ekin = convertToSCM.getKinEnergyInTheTRS(); 00176 G4double etot_scm = convertToSCM.getTotalSCMEnergy(); 00177 G4double pscm = convertToSCM.getSCMMomentum(); 00178 00179 generateSCMfinalState(ekin, etot_scm, pscm, particle1, particle2, 00180 &convertToSCM); 00181 00182 if (particles.empty()) { // No final state possible, pass bullet through 00183 if (verboseLevel) { 00184 G4cerr << " ElementaryParticleCollider -> failed to collide " 00185 << particle1->getMomModule() << " GeV/c " 00186 << particle1->getDefinition()->GetParticleName() << " with " 00187 << particle2->getDefinition()->GetParticleName() << G4endl; 00188 } 00189 } else { // convert back to Lab 00190 G4LorentzVector mom; // Buffer to avoid memory churn 00191 particleIterator ipart; 00192 for(ipart = particles.begin(); ipart != particles.end(); ipart++) { 00193 mom = convertToSCM.backToTheLab(ipart->getMomentum()); 00194 ipart->setMomentum(mom); 00195 }; 00196 00197 // Check conservation in multibody final state 00198 if (verboseLevel && !validateOutput(bullet, target, particles)) { 00199 G4cout << " incoming particles: \n" << *particle1 << G4endl 00200 << *particle2 << G4endl 00201 << " outgoing particles: " << G4endl; 00202 for(ipart = particles.begin(); ipart != particles.end(); ipart++) 00203 G4cout << *ipart << G4endl; 00204 00205 G4cout << " <<< Non-conservation in G4ElementaryParticleCollider" 00206 << G4endl; 00207 } 00208 00209 std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin()); 00210 output.addOutgoingParticles(particles); 00211 } 00212 } else { // neither particle is nucleon: pion on quasideuteron 00213 if (particle1->quasi_deutron() || particle2->quasi_deutron()) { 00214 if (particle1->pion() || particle2->pion() || 00215 particle1->isPhoton() || particle2->isPhoton()) { 00216 G4LorentzConvertor convertToSCM; 00217 if(particle2->quasi_deutron()) { // Quasideuteron is target 00218 convertToSCM.setBullet(particle1); 00219 convertToSCM.setTarget(particle2); 00220 } else { 00221 convertToSCM.setBullet(particle2); 00222 convertToSCM.setTarget(particle1); 00223 }; 00224 convertToSCM.toTheCenterOfMass(); 00225 G4double etot_scm = convertToSCM.getTotalSCMEnergy(); 00226 00227 generateSCMpionAbsorption(etot_scm, particle1, particle2); 00228 00229 if (particles.empty()) { // Failed to generate final state 00230 if (verboseLevel) { 00231 G4cerr << " ElementaryParticleCollider -> failed to collide " 00232 << particle1->getMomModule() << " GeV/c " 00233 << particle1->getDefinition()->GetParticleName() << " with " 00234 << particle2->getDefinition()->GetParticleName() << G4endl; 00235 } 00236 } else { // convert back to Lab 00237 G4LorentzVector mom; // Buffer to avoid memory churn 00238 particleIterator ipart; 00239 for(ipart = particles.begin(); ipart != particles.end(); ipart++) { 00240 mom = convertToSCM.backToTheLab(ipart->getMomentum()); 00241 ipart->setMomentum(mom); 00242 }; 00243 00244 validateOutput(bullet, target, particles); // Check conservation 00245 00246 std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin()); 00247 output.addOutgoingParticles(particles); 00248 }; 00249 } else { 00250 G4cerr << " ElementaryParticleCollider -> can only collide pions with dibaryons " 00251 << G4endl; 00252 }; 00253 } else { 00254 G4cerr << " ElementaryParticleCollider -> can only collide something with nucleon or dibaryon " 00255 << G4endl; 00256 }; 00257 }; 00258 }