92 G4cout <<
"---------------------------- Annihilation----------------" <<
G4endl;
100 if ( ProjectilePDGcode > 0 ) {
112 G4cout <<
"PDG codes " << ProjectilePDGcode <<
" " << TargetPDGcode << G4endl
115 <<
"M0 proj target " << std::sqrt( M0projectile2 )
116 <<
" " << std::sqrt( M0target2 ) <<
G4endl;
121 common.
S = Psum.
mag2();
122 common.
SqrtS = std::sqrt( common.
S );
124 G4cout <<
"Psum SqrtS S " << Psum <<
" " << common.
SqrtS <<
" " << common.
S <<
G4endl;
130 toCms.rotateZ( -1*Ptmp.phi() );
131 toCms.rotateY( -1*Ptmp.theta() );
143 ( 2.0*140.0 + 16.0 )*
MeV;
145 - 2.0*( common.
S*(M0projectile2 + M0target2) + M0projectile2*M0target2 );
147 G4double X_a = 0.0, X_b = 0.0, X_c = 0.0, X_d = 0.0;
148 if ( Prel2 <= 0.0 ) {
155 G4cout <<
"Annih at Rest X a b c d " << X_a <<
" " << X_b <<
" " << X_c <<
" " << X_d
162 if ( common.
SqrtS < MesonProdThreshold ) {
177 G4cout <<
"Annih in Flight X a b c d " << X_a <<
" " << X_b <<
" " << X_c <<
" " << X_d
178 << G4endl <<
"SqrtS MesonProdThreshold " << common.
SqrtS <<
" " << MesonProdThreshold
184 if ( TargetPDGcode == 2212 || TargetPDGcode == 2214 ) {
185 if ( ProjectilePDGcode == -2212 || ProjectilePDGcode == -2214 ) {
186 X_b *= 5.0; X_c *= 5.0; X_d *= 6.0;
187 }
else if ( ProjectilePDGcode == -2112 || ProjectilePDGcode == -2114 ) {
188 X_b *= 4.0; X_c *= 4.0; X_d *= 4.0;
189 }
else if ( ProjectilePDGcode == -3122 || ProjectilePDGcode == -3124 ) {
190 X_b *= 3.0; X_c *= 3.0; X_d *= 2.0;
191 }
else if ( ProjectilePDGcode == -3112 || ProjectilePDGcode == -3114 ) {
192 X_b *= 2.0; X_c *= 2.0; X_d *= 0.0;
193 }
else if ( ProjectilePDGcode == -3212 || ProjectilePDGcode == -3214 ) {
194 X_b *= 3.0; X_c *= 3.0; X_d *= 2.0;
195 }
else if ( ProjectilePDGcode == -3222 || ProjectilePDGcode == -3224 ) {
196 X_b *= 4.0; X_c *= 4.0; X_d *= 2.0;
197 }
else if ( ProjectilePDGcode == -3312 || ProjectilePDGcode == -3314 ) {
198 X_b *= 1.0; X_c *= 1.0; X_d *= 0.0;
199 }
else if ( ProjectilePDGcode == -3322 || ProjectilePDGcode == -3324 ) {
200 X_b *= 2.0; X_c *= 2.0; X_d *= 0.0;
201 }
else if ( ProjectilePDGcode == -3334 ) {
202 X_b *= 0.0; X_c *= 0.0; X_d *= 0.0;
206 }
else if ( TargetPDGcode == 2112 || TargetPDGcode == 2114 ) {
207 if ( ProjectilePDGcode == -2212 || ProjectilePDGcode == -2214 ) {
208 X_b *= 4.0; X_c *= 4.0; X_d *= 4.0;
209 }
else if ( ProjectilePDGcode == -2112 || ProjectilePDGcode == -2114 ) {
210 X_b *= 5.0; X_c *= 5.0; X_d *= 6.0;
211 }
else if ( ProjectilePDGcode == -3122 || ProjectilePDGcode == -3124 ) {
212 X_b *= 3.0; X_c *= 3.0; X_d *= 2.0;
213 }
else if ( ProjectilePDGcode == -3112 || ProjectilePDGcode == -3114 ) {
214 X_b *= 4.0; X_c *= 4.0; X_d *= 2.0;
215 }
else if ( ProjectilePDGcode == -3212 || ProjectilePDGcode == -3214 ) {
216 X_b *= 3.0; X_c *= 3.0; X_d *= 2.0;
217 }
else if ( ProjectilePDGcode == -3222 || ProjectilePDGcode == -3224 ) {
218 X_b *= 2.0; X_c *= 2.0; X_d *= 0.0;
219 }
else if ( ProjectilePDGcode == -3312 || ProjectilePDGcode == -3314 ) {
220 X_b *= 2.0; X_c *= 2.0; X_d *= 0.0;
221 }
else if ( ProjectilePDGcode == -3322 || ProjectilePDGcode == -3324 ) {
222 X_b *= 1.0; X_c *= 1.0; X_d *= 0.0;
223 }
else if ( ProjectilePDGcode == -3334 ) {
224 X_b *= 0.0; X_c *= 0.0; X_d *= 0.0;
232 G4cout <<
"Unknown anti-baryon for FTF annihilation: PDGcodes - "
233 << ProjectilePDGcode <<
" " << TargetPDGcode <<
G4endl;
236 G4cout <<
"Annih Actual X a b c d " << X_a <<
" " << X_b <<
" " << X_c <<
" " << X_d <<
G4endl;
239 G4double Xannihilation = X_a + X_b + X_c + X_d;
249 if ( Ksi < X_a / Xannihilation ) {
253 G4int resultCode = 99;
254 if ( Ksi < (X_a + X_b) / Xannihilation ) {
256 if ( resultCode == 0 ) {
258 }
else if ( resultCode == 99 ) {
263 if ( Ksi < ( X_a + X_b + X_c ) / Xannihilation ) {
265 if ( resultCode == 0 ) {
267 }
else if ( resultCode == 99 ) {
272 if ( Ksi < ( X_a + X_b + X_c + X_d ) / Xannihilation ) {
294 G4int SampledCase = G4RandFlat::shootInt(
G4long( 6 ) );
295 G4int Tmp1 = 0, Tmp2 = 0;
296 switch ( SampledCase ) {
297 case 1 : Tmp1 = common.
AQ[1]; common.
AQ[1] = common.
AQ[2]; common.
AQ[2] = Tmp1;
break;
298 case 2 : Tmp1 = common.
AQ[0]; common.
AQ[0] = common.
AQ[1]; common.
AQ[1] = Tmp1;
break;
299 case 3 : Tmp1 = common.
AQ[0]; Tmp2 = common.
AQ[1]; common.
AQ[0] = common.
AQ[2];
300 common.
AQ[1] = Tmp1; common.
AQ[2] = Tmp2;
break;
301 case 4 : Tmp1 = common.
AQ[0]; Tmp2 = common.
AQ[1]; common.
AQ[0] = Tmp2;
302 common.
AQ[1] = common.
AQ[2]; common.
AQ[2] = Tmp1;
break;
303 case 5 : Tmp1 = common.
AQ[0]; Tmp2 = common.
AQ[1]; common.
AQ[0] = common.
AQ[2];
304 common.
AQ[1] = Tmp2; common.
AQ[2] = Tmp1;
break;
311 G4int NewCode = 0, antiQuark = 0, quark = 0;
313 for (
G4int iString = 0; iString < 3; iString++ ) {
314 if ( iString == 0 ) {
315 antiQuark = common.
AQ[0]; quark = common.
Q[0];
320 }
else if ( iString == 1 ) {
321 quark = common.
Q[1]; antiQuark = common.
AQ[1];
327 antiQuark = common.
AQ[2]; quark = common.
Q[2];
331 if ( absAntiQuark == absQuark ) {
332 if ( absAntiQuark != 3 ) {
347 if ( absAntiQuark > absQuark ) {
348 NewCode = absAntiQuark*100 + absQuark*10 + 1; NewCode *= absAntiQuark/antiQuark;
350 NewCode = absQuark*100 + absAntiQuark*10 + 1; NewCode *= absQuark/quark;
355 if ( ! TestParticle )
return false;
356 if ( iString == 0 ) {
360 }
else if ( iString == 1 ) {
378 G4double AveragePt2 = 200.0*200.0, maxPtSquare = common.
S, SumMt = 0.0, MassQ2 = 0.0,
380 G4int NumberOfTries = 0, loopCounter = 0;
381 const G4int maxNumberOfLoops = 1000;
384 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
387 AveragePt2 *= ScaleFactor;
390 for (
G4int i = 0; i < 6; i++ ) {
391 Quark_Mom [i] =
GaussianPt( AveragePt2, maxPtSquare );
392 PtSum += Quark_Mom[i];
396 for (
G4int i = 0; i < 6; i++ ) {
397 Quark_Mom[i] -= PtSum;
398 ModMom2[i] = Quark_Mom[i].
mag2();
399 SumMt += std::sqrt( ModMom2[i] + MassQ2 );
401 }
while ( ( SumMt > common.
SqrtS ) &&
402 ++loopCounter < maxNumberOfLoops );
403 if ( loopCounter >= maxNumberOfLoops ) {
408 G4double WminusTarget = 0.0, WplusProjectile = 0.0;
409 G4double Alfa_R = 0.5; ScaleFactor = 1.0;
411 NumberOfTries = 0; loopCounter = 0;
415 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
420 for (
G4int iCase = 0; iCase < 2; iCase++ ) {
423 if ( Alfa_R == 1.0 ) {
424 x1 = 1.0 - std::sqrt( r1 );
431 G4int index = iCase*3;
432 Quark_Mom[index].
setZ( x1 ); Quark_Mom[index+1].
setZ( x2 ); Quark_Mom[index+2].
setZ( x3 );
433 for (
G4int i = 0; i < 3; i++ ) {
434 if ( Quark_Mom[index+i].getZ() != 0.0 ) {
435 G4double val = ( ScaleFactor * ModMom2[index+i] + MassQ2 ) / Quark_Mom[index+i].getZ();
446 if ( ! Success )
continue;
447 if ( std::sqrt( Alfa ) + std::sqrt( Beta ) > common.
SqrtS ) {
452 - 2.0*( common.
S*(Alfa + Beta) + Alfa*Beta );
453 WminusTarget = ( common.
S - Alfa + Beta + std::sqrt( DecayMomentum2 ) ) / 2.0 / common.
SqrtS;
454 WplusProjectile = common.
SqrtS - Beta/WminusTarget;
455 }
while ( ( ! Success ) &&
456 ++loopCounter < maxNumberOfLoops );
457 if ( loopCounter >= maxNumberOfLoops ) {
461 G4double SqrtScaleF = std::sqrt( ScaleFactor );
462 for (
G4int iCase = 0; iCase < 2; iCase++ ) {
463 G4int index = iCase*3;
465 if ( iCase == 1 ) w = - WminusTarget;
466 for (
G4int i = 0; i < 3; i++ ) {
468 ( ScaleFactor * ModMom2[index+i] + MassQ2 ) /
469 ( 2.0 * w * Quark_Mom[index+i].getZ() );
470 Quark_Mom[index+i].
setZ( Pz );
471 if ( ScaleFactor != 1.0 ) {
472 Quark_Mom[index+i].
setX( SqrtScaleF * Quark_Mom[index+i].getX() );
473 Quark_Mom[index+i].
setY( SqrtScaleF * Quark_Mom[index+i].getY() );
478 G4double YstringMax = 0.0, YstringMin = 0.0;
479 for (
G4int i = 0; i < 3; i++ ) {
481 G4LorentzVector Pstring( tmp, std::sqrt( Quark_Mom[i].mag2() + MassQ2 ) +
482 std::sqrt( Quark_Mom[i+3].mag2() + MassQ2 ) );
486 if ( Pstring.
e() > 1.0e-30 ) {
487 if ( Pstring.
e() + Pstring.
pz() < 1.0e-30 ) {
489 if ( Pstring.
e() - Pstring.
pz() < 1.0e-30 ) {
498 Pstring1 = Pstring; YstringMax = Ystring;
499 }
else if ( i == 1 ) {
500 if ( Ystring > YstringMax ) {
501 Pstring2 = Pstring1; YstringMin = YstringMax;
502 Pstring1 = Pstring; YstringMax = Ystring;
504 Pstring2 = Pstring; YstringMin = Ystring;
507 if ( Ystring > YstringMax ) {
511 }
else if ( Ystring > YstringMin ) {
563 G4cout <<
"Process b, quark - anti-quark annihilation, di-q - anti-di-q string" <<
G4endl;
566 G4int CandidatsN = 0, CandAQ[9][2], CandQ[9][2];
567 for (
G4int iAQ = 0; iAQ < 3; iAQ++ ) {
568 for (
G4int iQ = 0; iQ < 3; iQ++ ) {
569 if ( -common.
AQ[iAQ] == common.
Q[iQ] ) {
572 if ( iAQ == 0 ) { CandAQ[CandidatsN][0] = 1; CandAQ[CandidatsN][1] = 2; }
573 if ( iAQ == 1 ) { CandAQ[CandidatsN][0] = 0; CandAQ[CandidatsN][1] = 2; }
574 if ( iAQ == 2 ) { CandAQ[CandidatsN][0] = 0; CandAQ[CandidatsN][1] = 1; }
575 if ( iQ == 0 ) { CandQ[CandidatsN][0] = 1; CandQ[CandidatsN][1] = 2; }
576 if ( iQ == 1 ) { CandQ[CandidatsN][0] = 0; CandQ[CandidatsN][1] = 2; }
577 if ( iQ == 2 ) { CandQ[CandidatsN][0] = 0; CandQ[CandidatsN][1] = 1; }
584 G4int LeftAQ1 = 0, LeftAQ2 = 0, LeftQ1 = 0, LeftQ2 = 0;
585 if ( CandidatsN != 0 ) {
586 G4int SampledCase = G4RandFlat::shootInt(
G4long( CandidatsN ) );
587 LeftAQ1 = common.
AQ[ CandAQ[SampledCase][0] ];
588 LeftAQ2 = common.
AQ[ CandAQ[SampledCase][1] ];
589 LeftQ1 = common.
Q[ CandQ[SampledCase][0] ];
590 LeftQ2 = common.
Q[ CandQ[SampledCase][1] ];
595 G4int Anti_DQ = 0, DQ = 0;
597 Anti_DQ = 1000*LeftAQ1 + 100*LeftAQ2 - 3;
599 Anti_DQ = 1000*LeftAQ2 + 100*LeftAQ1 - 3;
602 DQ = 1000*LeftQ1 + 100*LeftQ2 + 3;
604 DQ = 1000*LeftQ2 + 100*LeftQ1 + 3;
657 G4cout <<
"Process c, quark - anti-quark and string junctions annihilation, 2 strings left."
661 G4int CandidatsN = 0, CandAQ[9][2], CandQ[9][2];
662 G4int LeftAQ1 = 0, LeftAQ2 = 0, LeftQ1 = 0, LeftQ2 = 0;
663 for (
G4int iAQ = 0; iAQ < 3; iAQ++ ) {
664 for (
G4int iQ = 0; iQ < 3; iQ++ ) {
665 if ( -common.
AQ[iAQ] == common.
Q[iQ] ) {
668 if ( iAQ == 0 ) { CandAQ[CandidatsN][0] = 1; CandAQ[CandidatsN][1] = 2; }
669 if ( iAQ == 1 ) { CandAQ[CandidatsN][0] = 0; CandAQ[CandidatsN][1] = 2; }
670 if ( iAQ == 2 ) { CandAQ[CandidatsN][0] = 0; CandAQ[CandidatsN][1] = 1; }
671 if ( iQ == 0 ) { CandQ[CandidatsN][0] = 1; CandQ[CandidatsN][1] = 2; }
672 if ( iQ == 1 ) { CandQ[CandidatsN][0] = 0; CandQ[CandidatsN][1] = 2; }
673 if ( iQ == 2 ) { CandQ[CandidatsN][0] = 0; CandQ[CandidatsN][1] = 1; }
679 if ( CandidatsN != 0 ) {
680 G4int SampledCase = G4RandFlat::shootInt(
G4long( CandidatsN ) );
681 LeftAQ1 = common.
AQ[ CandAQ[SampledCase][0] ];
682 LeftAQ2 = common.
AQ[ CandAQ[SampledCase][1] ];
684 LeftQ1 = common.
Q[ CandQ[SampledCase][0] ];
685 LeftQ2 = common.
Q[ CandQ[SampledCase][1] ];
687 LeftQ2 = common.
Q[ CandQ[SampledCase][0] ];
688 LeftQ1 = common.
Q[ CandQ[SampledCase][1] ];
695 G4int NewCode = 0, antiQuark = 0, quark = 0;
697 for (
G4int iString = 0; iString < 2; iString++ ) {
698 if ( iString == 0 ) {
699 antiQuark = LeftAQ1; quark = LeftQ1;
705 quark = LeftQ2; antiQuark = LeftAQ2;
713 if ( absAntiQuark == absQuark ) {
714 if ( absAntiQuark != 3 ) {
729 if ( absAntiQuark > absQuark ) {
730 NewCode = absAntiQuark*100 + absQuark*10 + 1; NewCode *= absAntiQuark/antiQuark;
732 NewCode = absQuark*100 + absAntiQuark*10 + 1; NewCode *= absQuark/quark;
736 if ( ! TestParticle )
return 99;
737 if ( iString == 0 ) {
751 G4double AveragePt2 = 200.0*200.0, maxPtSquare = common.
S, SumMt = 0.0, MassQ2 = 0.0,
753 G4int NumberOfTries = 0, loopCounter = 0;
754 const G4int maxNumberOfLoops = 1000;
757 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
760 AveragePt2 *= ScaleFactor;
763 for(
G4int i = 0; i < 4; i++ ) {
764 Quark_Mom[i] =
GaussianPt( AveragePt2, maxPtSquare );
765 PtSum += Quark_Mom[i];
769 for (
G4int i = 0; i < 4; i++ ) {
770 Quark_Mom[i] -= PtSum;
771 ModMom2[i] = Quark_Mom[i].
mag2();
772 SumMt += std::sqrt( ModMom2[i] + MassQ2 );
774 }
while ( ( SumMt > common.
SqrtS ) &&
775 ++loopCounter < maxNumberOfLoops );
776 if ( loopCounter >= maxNumberOfLoops ) {
781 G4double WminusTarget = 0.0, WplusProjectile = 0.0, Alfa_R = 0.5; ScaleFactor = 1.0;
783 NumberOfTries = 0, loopCounter = 0;
787 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
792 for (
G4int iCase = 0; iCase < 2; iCase++ ) {
794 if ( Alfa_R == 1.0 ) {
798 x = 1.0 - std::sqrt(
r);
801 x =
sqr( std::sin(
pi/2.0*
r ) );
803 G4int index = iCase*2;
804 Quark_Mom[index].
setZ( x ); Quark_Mom[index+1].
setZ( 1.0 - x );
805 for (
G4int i = 0; i < 2; i++ ) {
806 if ( Quark_Mom[i].getZ() != 0.0 ) {
807 G4double val = ( ScaleFactor * ModMom2[index+i] + MassQ2 ) / Quark_Mom[index+i].getZ();
818 if ( ! Success )
continue;
819 if ( std::sqrt( Alfa ) + std::sqrt( Beta ) > common.
SqrtS ) {
824 - 2.0*( common.
S*(Alfa + Beta) + Alfa*Beta );
825 WminusTarget = ( common.
S - Alfa + Beta + std::sqrt( DecayMomentum2 ) ) / 2.0 / common.
SqrtS;
826 WplusProjectile = common.
SqrtS - Beta/WminusTarget;
827 }
while ( ( ! Success ) &&
828 ++loopCounter < maxNumberOfLoops );
829 if ( loopCounter >= maxNumberOfLoops ) {
833 G4double SqrtScaleF = std::sqrt( ScaleFactor );
835 G4double Ystring1 = 0.0, Ystring2 = 0.0;
836 for (
G4int iCase = 0; iCase < 2; iCase++ ) {
837 G4int index = iCase*2;
838 for (
G4int i = 0; i < 2; i++ ) {
840 if ( iCase == 1 ) w = - WminusTarget;
842 - ( ScaleFactor * ModMom2[index+i] + MassQ2 ) /
843 ( 2.0 * w * Quark_Mom[index+i].getZ() );
844 Quark_Mom[index+i].
setZ( Pz );
845 if ( ScaleFactor != 1.0 ) {
846 Quark_Mom[index+i].
setX( SqrtScaleF * Quark_Mom[index+i].getX() );
847 Quark_Mom[index+i].
setY( SqrtScaleF * Quark_Mom[index+i].getY() );
851 for (
G4int iCase = 0; iCase < 2; iCase++ ) {
853 G4LorentzVector Pstring( tmp, std::sqrt( Quark_Mom[iCase].mag2() + MassQ2 ) +
854 std::sqrt( Quark_Mom[iCase+2].mag2() + MassQ2 ) );
858 if ( Pstring.
e() > 1.0e-30 ) {
859 if ( Pstring.
e() + Pstring.
pz() < 1.0e-30 ) {
861 if ( Pstring.
e() - Pstring.
pz() < 1.0e-30 ) {
869 Pstring1 = Pstring; Ystring1 = Ystring;
871 Pstring2 = Pstring; Ystring2 = Ystring;
874 if ( Ystring1 > Ystring2 ) {
913 G4cout <<
"Process d, only 1 quark - anti-quark string" <<
G4endl;
919 G4int CandidatsN = 0, CandAQ[36], CandQ[36];
920 G4int LeftAQ = 0, LeftQ = 0;
921 for (
G4int iAQ1 = 0; iAQ1 < 3; iAQ1++ ) {
922 for (
G4int iAQ2 = 0; iAQ2 < 3; iAQ2++ ) {
923 if ( iAQ1 != iAQ2 ) {
924 for (
G4int iQ1 = 0; iQ1 < 3; iQ1++ ) {
925 for (
G4int iQ2 = 0; iQ2 < 3; iQ2++ ) {
927 if ( -common.
AQ[iAQ1] == common.
Q[iQ1] && -common.
AQ[iAQ2] == common.
Q[iQ2] ) {
928 if ( ( iAQ1 == 0 && iAQ2 == 1 ) || ( iAQ1 == 1 && iAQ2 == 0 ) ) {
929 CandAQ[CandidatsN] = 2;
930 }
else if ( ( iAQ1 == 0 && iAQ2 == 2 ) || ( iAQ1 == 2 && iAQ2 == 0 ) ) {
931 CandAQ[CandidatsN] = 1;
932 }
else if ( ( iAQ1 == 1 && iAQ2 == 2 ) || ( iAQ1 == 2 && iAQ2 == 1 ) ) {
933 CandAQ[CandidatsN] = 0;
935 if ( ( iQ1 == 0 && iQ2 == 1 ) || ( iQ1 == 1 && iQ2 == 0 ) ) {
936 CandQ[CandidatsN] = 2;
937 }
else if ( ( iQ1 == 0 && iQ2 == 2 ) || ( iQ1 == 2 && iQ2 == 0 ) ) {
938 CandQ[CandidatsN] = 1;
939 }
else if ( ( iQ1 == 1 && iQ2 == 2 ) || ( iQ1 == 2 && iQ2 == 1 ) ) {
940 CandQ[CandidatsN] = 0;
951 if ( CandidatsN != 0 ) {
952 G4int SampledCase = G4RandFlat::shootInt(
G4long( CandidatsN ) );
953 LeftAQ = common.
AQ[ CandAQ[SampledCase] ];
954 LeftQ = common.
Q[ CandQ[SampledCase] ];
983 NewCode = aAQ*100 + aQ*10 + 1; NewCode *= aAQ/LeftAQ;
985 NewCode = aQ*100 + aAQ*10 + 1; NewCode *= aQ/LeftQ;
990 if ( ! TestParticle )
return false;
1041 if ( AveragePt2 <= 0.0 ) {
1045 (
G4Exp( -maxPtSquare/AveragePt2 ) -1.0 ) );
1049 return G4ThreeVector ( Pt*std::cos( phi ), Pt*std::sin( phi ), 0.0 );
1058 Q2 = ( AbsId % 1000 ) / 100;
1059 Q3 = ( AbsId % 100 ) / 10;
1060 if ( IdPDG < 0 ) { Q1 = -Q1; Q2 = -Q2; Q3 = -Q3; }
1069 "G4FTFAnnihilation copy constructor not meant to be called" );
1077 "G4FTFAnnihilation = operator not meant to be called" );
1085 "G4FTFAnnihilation == operator not meant to be called" );
1093 "G4DiffractiveExcitation != operator not meant to be called" );