324{
325 #ifdef debug_Hbuilder
326
328 if (std::abs(charge) > 2 || std::abs(3.*charge - 3*
G4int(charge*1.001)) >
perCent )
329 {
331 G4cerr <<
" Invalid total charge found for on input: "
333 G4cerr <<
" PGDcode input quark1/quark2 : " <<
337 }
338 #endif
339
342
343 if ( std::abs(id1) < std::abs(id2) )
344 {
346 id1 = id2;
347 id2 = xchg;
348 }
349
350 if (std::abs(id1) < 1000 || std::abs(id2) > 5 )
351 throw G4HadronicException(__FILE__, __LINE__,
"G4HadronBuilder::Barion: Illegal quark content as input");
352
353 G4int ifl1= std::abs(id1)/1000;
354 G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
355 G4int diquarkSpin = std::abs(id1)%10;
357 if (id1 < 0)
358 {
359 ifl1 = - ifl1;
360 ifl2 = - ifl2;
361 }
362
363 G4int kfla = std::abs(ifl1);
364 G4int kflb = std::abs(ifl2);
365 G4int kflc = std::abs(ifl3);
366
371
372 G4int kfle = kfla + kflb + kflc - kfld - kflf;
373
374
375 theSpin = (kfla == kflb && kflb == kflc)?
SpinThreeHalf : theSpin;
376
378 if (kfld < 6) {
379 if (theSpin ==
SpinHalf && kfld > kfle && kfle > kflf) {
380
381
382
383
384 if (diquarkSpin == 1 ) {
385 if ( kfla == kfld) {
386 kfll = 1;
387 } else {
389 }
390 }
391 if (diquarkSpin == 3 && kfla != kfld)
393 }
394 }
395
397 if (kfll == 1)
398 PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
399 else
400 PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
401
402 if (id1 < 0)
403 PDGEncoding = -PDGEncoding;
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419 #ifdef debug_heavyHadrons
420 G4int charmViolation = 0, bottomViolation = 0;
421 G4int initialPDGEncoding = PDGEncoding;
422 #endif
423 if ( std::abs( PDGEncoding ) == 4224 ) {
424 ( PDGEncoding > 0 ? PDGEncoding = 4222 : PDGEncoding = -4222 );
425 } else if ( std::abs( PDGEncoding ) == 4214 ) {
426 ( PDGEncoding > 0 ? PDGEncoding = 4212 : PDGEncoding = -4212 );
427 } else if ( std::abs( PDGEncoding ) == 4114 ) {
428 ( PDGEncoding > 0 ? PDGEncoding = 4112 : PDGEncoding = -4112 );
429 } else if ( std::abs( PDGEncoding ) == 4322 ) {
430 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
431 } else if ( std::abs( PDGEncoding ) == 4312 ) {
432 ( PDGEncoding > 0 ? PDGEncoding = 4132 : PDGEncoding = -4132 );
433 } else if ( std::abs( PDGEncoding ) == 4324 ) {
434 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
435 } else if ( std::abs( PDGEncoding ) == 4314 ) {
436 ( PDGEncoding > 0 ? PDGEncoding = 4132 : PDGEncoding = -4132 );
437 } else if ( std::abs( PDGEncoding ) == 4334 ) {
438 ( PDGEncoding > 0 ? PDGEncoding = 4332 : PDGEncoding = -4332 );
439 } else if ( std::abs( PDGEncoding ) == 4412 ) {
440 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
441 #ifdef debug_heavyHadrons
442 charmViolation = 1;
443 #endif
444 } else if ( std::abs( PDGEncoding ) == 4422 ) {
445 ( PDGEncoding > 0 ? PDGEncoding = 4222 : PDGEncoding = -4222 );
446 #ifdef debug_heavyHadrons
447 charmViolation = 1;
448 #endif
449 } else if ( std::abs( PDGEncoding ) == 4414 ) {
450 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
451 #ifdef debug_heavyHadrons
452 charmViolation = 1;
453 #endif
454 } else if ( std::abs( PDGEncoding ) == 4424 ) {
455 ( PDGEncoding > 0 ? PDGEncoding = 4222 : PDGEncoding = -4222 );
456 #ifdef debug_heavyHadrons
457 charmViolation = 1;
458 #endif
459 } else if ( std::abs( PDGEncoding ) == 4432 ) {
460 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
461 #ifdef debug_heavyHadrons
462 charmViolation = 1;
463 #endif
464 } else if ( std::abs( PDGEncoding ) == 4434 ) {
465 ( PDGEncoding > 0 ? PDGEncoding = 4232 : PDGEncoding = -4232 );
466 #ifdef debug_heavyHadrons
467 charmViolation = 1;
468 #endif
469 } else if ( std::abs( PDGEncoding ) == 4444 ) {
470 ( PDGEncoding > 0 ? PDGEncoding = 4222 : PDGEncoding = -4222 );
471 #ifdef debug_heavyHadrons
472 charmViolation = 2;
473 #endif
474
475 } else if ( std::abs( PDGEncoding ) == 5114 ) {
476 ( PDGEncoding > 0 ? PDGEncoding = 5112 : PDGEncoding = -5112 );
477 } else if ( std::abs( PDGEncoding ) == 5214 ) {
478 ( PDGEncoding > 0 ? PDGEncoding = 5212 : PDGEncoding = -5212 );
479 } else if ( std::abs( PDGEncoding ) == 5224 ) {
480 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
481 } else if ( std::abs( PDGEncoding ) == 5312 ) {
482 ( PDGEncoding > 0 ? PDGEncoding = 5132 : PDGEncoding = -5132 );
483 } else if ( std::abs( PDGEncoding ) == 5322 ) {
484 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
485 } else if ( std::abs( PDGEncoding ) == 5314 ) {
486 ( PDGEncoding > 0 ? PDGEncoding = 5132 : PDGEncoding = -5132 );
487 } else if ( std::abs( PDGEncoding ) == 5324 ) {
488 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
489 } else if ( std::abs( PDGEncoding ) == 5334 ) {
490 ( PDGEncoding > 0 ? PDGEncoding = 5332 : PDGEncoding = -5332 );
491 } else if ( std::abs( PDGEncoding ) == 5142 ) {
492 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
493 #ifdef debug_heavyHadrons
494 charmViolation = 1;
495 #endif
496 } else if ( std::abs( PDGEncoding ) == 5242 ) {
497 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
498 #ifdef debug_heavyHadrons
499 charmViolation = 1;
500 #endif
501 } else if ( std::abs( PDGEncoding ) == 5412 ) {
502 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
503 #ifdef debug_heavyHadrons
504 charmViolation = 1;
505 #endif
506 } else if ( std::abs( PDGEncoding ) == 5422 ) {
507 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
508 #ifdef debug_heavyHadrons
509 charmViolation = 1;
510 #endif
511 } else if ( std::abs( PDGEncoding ) == 5414 ) {
512 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
513 #ifdef debug_heavyHadrons
514 charmViolation = 1;
515 #endif
516 } else if ( std::abs( PDGEncoding ) == 5424 ) {
517 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
518 #ifdef debug_heavyHadrons
519 charmViolation = 1;
520 #endif
521 } else if ( std::abs( PDGEncoding ) == 5342 ) {
522 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
523 #ifdef debug_heavyHadrons
524 charmViolation = 1;
525 #endif
526 } else if ( std::abs( PDGEncoding ) == 5432 ) {
527 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
528 #ifdef debug_heavyHadrons
529 charmViolation = 1;
530 #endif
531 } else if ( std::abs( PDGEncoding ) == 5434 ) {
532 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
533 #ifdef debug_heavyHadrons
534 charmViolation = 1;
535 #endif
536 } else if ( std::abs( PDGEncoding ) == 5442 ) {
537 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
538 #ifdef debug_heavyHadrons
539 charmViolation = 2;
540 #endif
541 } else if ( std::abs( PDGEncoding ) == 5444 ) {
542 ( PDGEncoding > 0 ? PDGEncoding = 5222 : PDGEncoding = -5222 );
543 #ifdef debug_heavyHadrons
544 charmViolation = 2;
545 #endif
546 } else if ( std::abs( PDGEncoding ) == 5512 ) {
547 ( PDGEncoding > 0 ? PDGEncoding = 5132 : PDGEncoding = -5132 );
548 #ifdef debug_heavyHadrons
549 bottomViolation = 1;
550 #endif
551 } else if ( std::abs( PDGEncoding ) == 5522 ) {
552 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
553 #ifdef debug_heavyHadrons
554 bottomViolation = 1;
555 #endif
556 } else if ( std::abs( PDGEncoding ) == 5514 ) {
557 ( PDGEncoding > 0 ? PDGEncoding = 5132 : PDGEncoding = -5132 );
558 #ifdef debug_heavyHadrons
559 bottomViolation = 1;
560 #endif
561 } else if ( std::abs( PDGEncoding ) == 5524 ) {
562 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
563 #ifdef debug_heavyHadrons
564 bottomViolation = 1;
565 #endif
566 } else if ( std::abs( PDGEncoding ) == 5532 ) {
567 ( PDGEncoding > 0 ? PDGEncoding = 5332 : PDGEncoding = -5332 );
568 #ifdef debug_heavyHadrons
569 bottomViolation = 1;
570 #endif
571 } else if ( std::abs( PDGEncoding ) == 5534 ) {
572 ( PDGEncoding > 0 ? PDGEncoding = 5332 : PDGEncoding = -5332 );
573 #ifdef debug_heavyHadrons
574 bottomViolation = 1;
575 #endif
576 } else if ( std::abs( PDGEncoding ) == 5542 ) {
577 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
578 #ifdef debug_heavyHadrons
579 charmViolation = 1; bottomViolation = 1;
580 #endif
581 } else if ( std::abs( PDGEncoding ) == 5544 ) {
582 ( PDGEncoding > 0 ? PDGEncoding = 5232 : PDGEncoding = -5232 );
583 #ifdef debug_heavyHadrons
584 charmViolation = 1; bottomViolation = 1;
585 #endif
586 } else if ( std::abs( PDGEncoding ) == 5554 ) {
587 ( PDGEncoding > 0 ? PDGEncoding = 5332 : PDGEncoding = -5332 );
588 #ifdef debug_heavyHadrons
589 bottomViolation = 2;
590 #endif
591 }
592 #ifdef debug_heavyHadrons
593 if ( initialPDGEncoding != PDGEncoding ) {
594 G4cout <<
"G4HadronBuilder::Barion : forcing (inexisting in G4) heavy baryon with pdgCode="
595 << initialPDGEncoding <<
" into pdgCode=" << PDGEncoding <<
G4endl;
596 if ( charmViolation != 0 || bottomViolation != 0 ) {
597 G4cout <<
"\t --> VIOLATION of " << ( charmViolation != 0 ?
" CHARM " :
" " )
598 << ( charmViolation != 0 && bottomViolation != 0 ? " and " : " " )
599 << ( bottomViolation != 0 ?
" BOTTOM " :
" " ) <<
" quantum number ! " <<
G4endl;
600 }
601 }
602 #endif
603
604
607
608 #ifdef debug_Hbuilder
609 if (BarionDef == 0 ) {
610 G4cerr <<
" G4HadronBuilder - Warning: No particle for PDGcode= "
614 G4cerr <<
" G4HadronBuilder - Warning: Incorrect Charge : "
615 << " DiQuark/Quark = "
620 }
621 #endif
622
623 return BarionDef;
624}
static constexpr double perCent
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments