139 nucleusA(0), nucleusZ(0) {;}
148 G4cout <<
" >>> G4ElementaryParticleCollider::collide" <<
G4endl;
151 G4cerr <<
" ElementaryParticleCollider -> can collide only particle with particle "
156#ifdef G4CASCADE_DEBUG_SAMPLER
157 static G4bool doPrintTables =
true;
160 doPrintTables =
false;
173 if (!particle1 || !particle2) {
174 G4cerr <<
" ElementaryParticleCollider -> can only collide hadrons"
184 G4cerr <<
" ElementaryParticleCollider -> cannot collide "
209 if (pionNucleonAbsorption(ekin)) {
210 generateSCMpionNAbsorption(etot_scm, particle1, particle2);
212 generateSCMfinalState(ekin, etot_scm, particle1, particle2);
220 G4cerr <<
" ElementaryParticleCollider -> can only collide pi,mu,gamma with"
221 <<
" dibaryons " <<
G4endl;
226 generateSCMmuonAbsorption(etot_scm, particle1, particle2);
228 generateSCMpionAbsorption(etot_scm, particle1, particle2);
232 if (particles.empty()) {
234 G4cerr <<
" ElementaryParticleCollider -> failed to collide "
245 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
247 ipart->setMomentum(mom);
260 G4int finalBaryonNumber = 0;
261 G4int finalCharge = 0;
262 G4int finalStrangeness = 0;
264 for (ipart = particles.begin(); ipart != particles.end(); ipart++) {
265 finalBaryonNumber += ipart->baryon();
266 finalCharge += ipart->getCharge();
267 finalStrangeness += ipart->getStrangeness();
270 G4int bnc = finalBaryonNumber - initBaryonNumber;
271 G4int cnc = finalCharge - initCharge;
272 G4int snc = finalStrangeness - initStrangeness;
274 if (bnc != 0 || cnc != 0 || snc != 0) {
275 G4cout <<
" G4ElementaryParticleCollider: quantum number non-conservation " <<
G4endl;
276 G4cout <<
" Baryon number: initial = " << initBaryonNumber <<
", final = "
277 << finalBaryonNumber <<
G4endl;
278 G4cout <<
" Charge: initial = " << initCharge <<
", final = "
280 G4cout <<
" Strangeness: initial = " << initStrangeness <<
", final = "
281 << finalStrangeness <<
G4endl;
285 G4cout <<
" secondaries = " ;
286 for (ipart = particles.begin(); ipart != particles.end(); ipart++) {
287 G4cout << ipart->getDefinition()->GetParticleName() <<
" " ;
294 G4cout <<
" incoming particles: \n" << *particle1 <<
G4endl
296 <<
" outgoing particles: " <<
G4endl;
297 for(ipart = particles.begin(); ipart != particles.end(); ipart++)
300 G4cout <<
" <<< Non-conservation in G4ElementaryParticleCollider"
310G4ElementaryParticleCollider::generateMultiplicity(
G4int is,
319 G4cerr <<
" G4ElementaryParticleCollider: Unknown interaction channel "
320 << is <<
" - multiplicity not generated " <<
G4endl;
324 G4cout <<
" G4ElementaryParticleCollider::generateMultiplicity: "
325 <<
" multiplicity = " << mul <<
G4endl;
333G4ElementaryParticleCollider::generateOutgoingPartTypes(
G4int is,
G4int mult,
336 particle_kinds.clear();
343 G4cerr <<
" G4ElementaryParticleCollider: Unknown interaction channel "
344 << is <<
" - outgoing kinds not generated " <<
G4endl;
352G4ElementaryParticleCollider::generateSCMfinalState(
G4double ekin,
357 G4cout <<
" >>> G4ElementaryParticleCollider::generateSCMfinalState"
363 const G4int itry_max = 10;
368 G4int is = type1 * type2;
372 G4int multiplicity = 0;
376 while (generate && itry++ < itry_max) {
378 particle_kinds.clear();
381 multiplicity = generateMultiplicity(is, ekin);
383 generateOutgoingPartTypes(is, multiplicity, ekin);
384 if (particle_kinds.empty()) {
386 G4cout <<
" generateOutgoingPartTypes failed mult " << multiplicity
392 fillOutgoingMasses();
395 fsGenerator.
Configure(particle1, particle2, particle_kinds);
399 if (itry >= itry_max) {
401 G4cout <<
" generateSCMfinalState failed " << itry <<
" attempts"
408 particles.resize(multiplicity);
409 for (
G4int i=0; i<multiplicity; i++) {
410 particles[i].fill(scm_momentums[i], particle_kinds[i],
415 G4cout <<
" <<< G4ElementaryParticleCollider::generateSCMfinalState"
425void G4ElementaryParticleCollider::fillOutgoingMasses() {
426 std::size_t mult = particle_kinds.size();
428 masses.resize(mult,0.);
429 masses2.resize(mult,0.);
431 for (std::size_t i = 0; i < mult; ++i) {
433 masses2[i] = masses[i] * masses[i];
442G4ElementaryParticleCollider::generateSCMpionAbsorption(
G4double etot_scm,
447 G4cout <<
" >>> G4ElementaryParticleCollider::generateSCMpionAbsorption"
453 particle_kinds.clear();
459 particle_kinds.push_back(
pro);
460 particle_kinds.push_back(
pro);
464 particle_kinds.push_back(
pro);
465 particle_kinds.push_back(
neu);
469 particle_kinds.push_back(
neu);
470 particle_kinds.push_back(
neu);
473 G4cerr <<
" Illegal absorption: "
480 fillOutgoingMasses();
482 G4double a = 0.5 * (etot_scm * etot_scm - masses2[0] - masses2[1]);
484 G4double pmod = std::sqrt((a*a - masses2[0]*masses2[1])
485 / (etot_scm*etot_scm) );
499G4ElementaryParticleCollider::generateSCMmuonAbsorption(
G4double etot_scm,
504 G4cout <<
" >>> G4ElementaryParticleCollider::generateSCMmuonAbsorption"
510 scm_momentums.clear();
511 scm_momentums.resize(3);
513 particle_kinds.clear();
518 particle_kinds.push_back(
pro);
519 particle_kinds.push_back(
neu);
521 particle_kinds.push_back(
neu);
522 particle_kinds.push_back(
neu);
524 G4cerr <<
" Illegal absorption: "
530 particle_kinds.push_back(
mnu);
532 fillOutgoingMasses();
535 G4GDecay3 breakup(etot_scm, masses[0], masses[1], masses[2]);
536 std::vector<G4ThreeVector> theMomenta = breakup.GetThreeBodyMomenta();
538 if (theMomenta.empty()) {
539 G4cerr <<
" generateSCMmuonAbsorption: GetThreeBodyMomenta() failed"
540 <<
" for " << particle2->
type() <<
" dibaryon" <<
G4endl;
541 particle_kinds.clear();
547 for (std::size_t i=0; i<3; ++i) {
548 scm_momentums[i].setVectM(theMomenta[i], masses[i]);
557G4ElementaryParticleCollider::generateSCMpionNAbsorption(
G4double ,
561 G4cout <<
" >>> G4ElementaryParticleCollider::generateSCMpionNAbsorption"
567 particle_kinds.clear();
573 if ((type1*type2 !=
pim*
pro && type1*type2 !=
pip*
neu)) {
574 G4cerr <<
" pion-nucleon absorption: "
584 G4int outType = 3 - ntype;
585 particle_kinds.push_back(outType);
587 fillOutgoingMasses();
592 G4double mRecoil2 = mRecoil*mRecoil;
601 G4double a = 0.5 * (esq_scm - masses2[0] - mRecoil2);
603 G4double pmod = std::sqrt((a*a - masses2[0]*mRecoil2) / esq_scm );
607 G4cout <<
" outgoing type " << outType <<
" recoiling on nuclear mass "
608 << mRecoil <<
"\n a " << a <<
" p " << pmod <<
" Ekin "
609 << mom1.
e()-masses[0] <<
G4endl;
615 G4cout <<
" in original pi-N frame p(SCM) " << mom1.
rho() <<
" Ekin "
616 << mom1.
e()-masses[0] <<
G4endl;
626G4ElementaryParticleCollider::pionNucleonAbsorption(
G4double ekin)
const {
628 G4cout <<
" >>> G4ElementaryParticleCollider::pionNucleonAbsorption ?"
std::vector< G4InuclElementaryParticle >::iterator particleIterator
std::vector< G4InuclElementaryParticle >::iterator particleIterator
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void setVectM(const Hep3Vector &spatial, double mass)
static void Print(std::ostream &os=G4cout)
static const G4CascadeChannel * GetTable(G4int initialState)
virtual G4int getMultiplicity(G4double ke) const =0
virtual void getOutgoingParticleTypes(std::vector< G4int > &kinds, G4int mult, G4double ke) const =0
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
G4InteractionCase interCase
virtual G4bool validateOutput(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void Configure(G4InuclElementaryParticle *bullet, G4InuclElementaryParticle *target, const std::vector< G4int > &particle_kinds)
static G4double piNAbsorption()
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4ElementaryParticleCollider()
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void SetVerboseLevel(G4int verbose)
G4bool Generate(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
void set(G4InuclParticle *part1, G4InuclParticle *part2)
G4bool quasi_deutron() const
static G4double getParticleMass(G4int type)
G4bool isNeutrino() const
G4double getNucleiMass() const
const G4ParticleDefinition * getDefinition() const
G4LorentzVector getMomentum() const
G4double getMomModule() const
G4double getCharge() const
G4double getTotalSCMEnergy() const
void setVerbose(G4int vb=0)
void setBullet(const G4InuclParticle *bullet)
G4LorentzVector backToTheLab(const G4LorentzVector &mom) const
G4double getKinEnergyInTheTRS() const
void setTarget(const G4InuclParticle *target)
static G4bool useQuasiDeuteron(G4int ptype, G4int qdtype=0)
G4int GetQuarkContent(G4int flavor) const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
G4int GetAntiQuarkContent(G4int flavor) const
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
G4LorentzVector generateWithRandomAngles(G4double p, G4double mass=0.)