94 #ifdef debugFTFexictation
102 if (
common.Pprojectile.z() < 0.0 )
return false;
104 common.absProjectilePDGcode = std::abs(
common.ProjectilePDGcode );
111 common.absTargetPDGcode = std::abs(
common.TargetPDGcode );
121 G4bool toBePutOnMassShell =
true;
134 if (
common.M0projectile >
common.ProjectileDiffStateMinMass ) {
136 common.ProjectileNonDiffStateMinMass =
common.MminProjectile + 220.0*
MeV;
137 if (
common.absProjectilePDGcode > 3000 ) {
138 common.ProjectileDiffStateMinMass += 140.0*
MeV;
139 common.ProjectileNonDiffStateMinMass += 140.0*
MeV;
154 if (
common.M0target >
common.TargetDiffStateMinMass ) {
157 if (
common.absTargetPDGcode > 3000 ) {
158 common.TargetDiffStateMinMass += 140.0*
MeV;
159 common.TargetNonDiffStateMinMass += 140.0*
MeV;
162 #ifdef debugFTFexictation
164 <<
"Mprojectile Y " <<
common.Pprojectile.mag() <<
" " << ProjectileRapidity <<
G4endl
165 <<
"M0projectile Y " <<
common.M0projectile <<
" " << ProjectileRapidity <<
G4endl;
167 <<
"M0target Y " <<
common.M0target <<
" " << TargetRapidity <<
G4endl;
174 if ( Ptmp.
pz() <= 0.0 )
return false;
182 #ifdef debugFTFexictation
184 <<
" " <<
common.M0target <<
" " << SumMasses <<
G4endl;
186 if (
common.SqrtS < SumMasses )
return false;
191 #ifdef debugFTFexictation
194 if (
common.PZcms2 < 0.0 )
return false;
197 if ( toBePutOnMassShell ) {
198 if (
common.Pprojectile.z() > 0.0 ) {
205 common.Pprojectile.setE( std::sqrt(
common.M0projectile2
214 #ifdef debugFTFexictation
215 G4cout <<
"Start --------------------" <<
G4endl <<
"Proj M0 Mdif Mndif " <<
common.M0projectile
216 <<
" " <<
common.ProjectileDiffStateMinMass <<
" " <<
common.ProjectileNonDiffStateMinMass
218 <<
"Targ M0 Mdif Mndif " <<
common.M0target <<
" " <<
common.TargetDiffStateMinMass
224 ProjectileRapidity =
common.Pprojectile.rapidity();
225 TargetRapidity =
common.Ptarget.rapidity();
228 theParameters->
GetProcProb( 4, ProjectileRapidity - TargetRapidity );
229 common.ProbProjectileDiffraction =
230 theParameters->
GetProcProb( 2, ProjectileRapidity - TargetRapidity );
231 common.ProbTargetDiffraction =
232 theParameters->
GetProcProb( 3, ProjectileRapidity - TargetRapidity );
233 common.ProbOfDiffraction =
common.ProbProjectileDiffraction +
common.ProbTargetDiffraction;
234 #ifdef debugFTFexictation
235 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" "
237 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
240 if ( QeNoExc + QeExc +
common.ProbProjectileDiffraction +
common.ProbTargetDiffraction > 1.0 ) {
241 QeNoExc = 1.0 - QeExc -
common.ProbProjectileDiffraction -
common.ProbTargetDiffraction;
243 if ( QeExc + QeNoExc != 0.0 ) {
244 common.ProbExc = QeExc / ( QeExc + QeNoExc );
246 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
247 common.ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
248 common.ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
250 #ifdef debugFTFexictation
251 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" "
253 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
257 G4int returnCode = 1;
263 G4bool returnResult =
false;
264 if ( returnCode == 0 ) {
266 }
else if ( returnCode == 1 ) {
268 common.ProbOfDiffraction =
common.ProbProjectileDiffraction +
common.ProbTargetDiffraction;
269 #ifdef debugFTFexictation
271 <<
"Proj M0 MdMin MndMin " <<
common.M0projectile <<
" "
272 <<
common.ProjectileDiffStateMinMass <<
" " <<
common.ProjectileNonDiffStateMinMass
274 <<
"Targ M0 MdMin MndMin " <<
common.M0target <<
" " <<
common.TargetDiffStateMinMass
277 <<
"Prob: ProjDiff TargDiff + Sum " <<
common.ProbProjectileDiffraction <<
" "
280 if (
common.ProbOfDiffraction != 0.0 ) {
281 common.ProbProjectileDiffraction /=
common.ProbOfDiffraction;
283 common.ProbProjectileDiffraction = 0.0;
285 #ifdef debugFTFexictation
286 G4cout <<
"Prob: ProjDiff TargDiff + Sum " <<
common.ProbProjectileDiffraction <<
" "
289 common.ProjectileDiffStateMinMass2 =
sqr(
common.ProjectileDiffStateMinMass );
290 common.ProjectileNonDiffStateMinMass2 =
sqr(
common.ProjectileNonDiffStateMinMass );
292 common.TargetNonDiffStateMinMass2 =
sqr(
common.TargetNonDiffStateMinMass );
303 if ( returnResult ) {
309 #ifdef debugFTFexictation
337 G4int returnCode = 99;
341 G4double MtestPr = 0.0, MtestTr = 0.0;
343 #ifdef debugFTFexictation
344 G4cout <<
"Q exchange --------------------------" <<
G4endl;
357 G4int NewProjCode = 0, NewTargCode = 0, ProjQ1 = 0, ProjQ2 = 0, ProjQ3 = 0;
359 if (
common.absProjectilePDGcode < 1000 ) {
365 G4int TargQ1 = 0, TargQ2 = 0, TargQ3 = 0;
367 #ifdef debugFTFexictation
368 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 <<
G4endl
369 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
373 G4int ProjExchangeQ = 0, TargExchangeQ = 0;
374 if (
common.absProjectilePDGcode < 1000 ) {
376 G4bool isProjQ1Quark =
false;
377 ProjExchangeQ = ProjQ2;
379 isProjQ1Quark =
true;
380 ProjExchangeQ = ProjQ1;
383 G4int NpossibleStates = 0;
384 if ( ProjExchangeQ != TargQ1 ) NpossibleStates++;
385 if ( ProjExchangeQ != TargQ2 ) NpossibleStates++;
386 if ( ProjExchangeQ != TargQ3 ) NpossibleStates++;
387 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
389 if ( ProjExchangeQ != TargQ1 ) {
390 if ( ++NpossibleStates == Nsampled ) {
391 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ;
392 isProjQ1Quark ? ProjQ1 = TargExchangeQ : ProjQ2 = TargExchangeQ;
395 if ( ProjExchangeQ != TargQ2 ) {
396 if ( ++NpossibleStates == Nsampled ) {
397 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ;
398 isProjQ1Quark ? ProjQ1 = TargExchangeQ : ProjQ2 = TargExchangeQ;
401 if ( ProjExchangeQ != TargQ3 ) {
402 if ( ++NpossibleStates == Nsampled ) {
403 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ;
404 isProjQ1Quark ? ProjQ1 = TargExchangeQ : ProjQ2 = TargExchangeQ;
407 #ifdef debugFTFexictation
408 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
411 G4int aProjQ1 = std::abs( ProjQ1 ), aProjQ2 = std::abs( ProjQ2 );
412 G4bool ProjExcited =
false;
413 const G4int maxNumberOfAttempts = 50;
415 while ( attempts++ < maxNumberOfAttempts ) {
419 if ( aProjQ1 == aProjQ2 ) {
428 }
else if ( aProjQ1 == 3 ) {
433 }
else if ( aProjQ1 == 4 ) {
435 }
else if ( aProjQ1 == 5 ) {
439 if ( aProjQ1 > aProjQ2 ) {
440 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
442 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
445 #ifdef debugFTFexictation
452 if ( aProjQ1 <= 3 && aProjQ2 <= 3 &&
G4UniformRand() < 0.5 ) {
459 G4int value = ProjQ1, absValue = aProjQ1, Qquarks = 0;
460 for (
G4int iQ = 0; iQ < 2; ++iQ ) {
462 value = ProjQ2; absValue = aProjQ2;
464 if ( absValue == 2 || absValue == 4 ) {
465 Qquarks += 2*value/absValue;
467 Qquarks -= value/absValue;
486 if ( Qquarks < 0 || ( Qquarks == 0 && aProjQ1 != aProjQ2 && aProjQ1%2 == 0 ) ) {
489 #ifdef debugFTFexictation
490 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
491 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
493 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
498 if ( ! TestParticle )
continue;
499 common.MminProjectile =
common.BrW.GetMinimumMass( TestParticle );
503 #ifdef debugFTFexictation
506 <<
"MtestPart MtestPart0 "<<MtestPr<<
" "<<TestParticle->
GetPDGMass()<<
G4endl
507 <<
"M0projectile projectile PDGMass " <<
common.M0projectile <<
" "
513 #ifdef debugFTFexictation
514 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl
515 <<
"NewTargCode " << NewTargCode <<
G4endl;
520 if ( TargQ1 <= 3 && TargQ2 <= 3 && TargQ3 <= 3 ) {
521 if ( TargQ1 != TargQ2 && TargQ1 != TargQ3 && TargQ2 != TargQ3 ) {
527 }
else if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
528 NewTargCode += 2; ProjExcited =
true;
531 NewTargCode += 2; ProjExcited =
true;
533 }
else if ( ! ProjExcited &&
545 if ( NewTargCode == 3124 ||
546 NewTargCode == 3224 ||
547 NewTargCode == 3214 ||
548 NewTargCode == 3114 ||
549 NewTargCode == 3324 ||
550 NewTargCode == 3314 ) {
558 #ifdef debug_heavyHadrons
559 G4int initialNewTargCode = NewTargCode;
561 if ( NewTargCode == 4322 ) NewTargCode = 4232;
562 else if ( NewTargCode == 4312 ) NewTargCode = 4132;
563 else if ( NewTargCode == 5312 ) NewTargCode = 5132;
564 else if ( NewTargCode == 5322 ) NewTargCode = 5232;
565 #ifdef debug_heavyHadrons
566 if ( NewTargCode != initialNewTargCode ) {
567 G4cout <<
"G4DiffractiveExcitation::ExciteParticipants_doChargeExchange : forcing (inexisting in G4)" <<
G4endl
568 <<
"\t target heavy baryon with pdgCode=" << initialNewTargCode
569 <<
" into pdgCode=" << NewTargCode <<
G4endl;
574 if ( ! TestParticle )
continue;
575 #ifdef debugFTFexictation
578 common.MminTarget =
common.BrW.GetMinimumMass( TestParticle );
579 if (
common.SqrtS - MtestPr <
common.MminTarget )
continue;
582 if (
common.SqrtS > MtestPr + MtestTr )
break;
585 if ( attempts >= maxNumberOfAttempts )
return returnCode;
587 if ( MtestPr >=
common.Pprojectile.mag() || projectile->
GetStatus() != 0 ) {
588 common.M0projectile = MtestPr;
590 #ifdef debugFTFexictation
595 common.ProjectileNonDiffStateMinMass =
common.M0projectile + 220.0*
MeV;
597 common.M0target = MtestTr;
600 #ifdef debugFTFexictation
611 if (
common.ProjectilePDGcode < 0 )
return 1;
615 G4bool isProjectileExchangedQ =
false;
616 G4int firstQ = TargQ1, secondQ = TargQ2, thirdQ = TargQ3;
617 G4int otherFirstQ = ProjQ1, otherSecondQ = ProjQ2, otherThirdQ = ProjQ3;
619 isProjectileExchangedQ =
true;
620 firstQ = ProjQ1; secondQ = ProjQ2; thirdQ = ProjQ3;
621 otherFirstQ = TargQ1; otherSecondQ = TargQ2; otherThirdQ = TargQ3;
625 G4int exchangedQ = 0;
627 if ( Ksi < 0.333333 ) {
629 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
630 exchangedQ = secondQ;
634 #ifdef debugFTFexictation
635 G4cout <<
"Exchange Qs isProjectile Q " << isProjectileExchangedQ <<
" " << exchangedQ <<
" ";
641 const G4int MaxCount = 100;
642 G4int count = 0, otherExchangedQ = 0;
644 if ( exchangedQ != otherFirstQ ||
G4UniformRand() < probSame ) {
645 otherExchangedQ = otherFirstQ; otherFirstQ = exchangedQ; exchangedQ = otherExchangedQ;
647 if ( exchangedQ != otherSecondQ ||
G4UniformRand() < probSame ) {
648 otherExchangedQ = otherSecondQ; otherSecondQ = exchangedQ; exchangedQ = otherExchangedQ;
650 if ( exchangedQ != otherThirdQ ||
G4UniformRand() < probSame ) {
651 otherExchangedQ = otherThirdQ; otherThirdQ = exchangedQ; exchangedQ = otherExchangedQ;
655 }
while ( otherExchangedQ == 0 && ++count < MaxCount );
656 if ( count >= MaxCount )
return returnCode;
659 if ( Ksi < 0.333333 ) {
661 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
662 secondQ = exchangedQ;
666 if ( isProjectileExchangedQ ) {
667 ProjQ1 = firstQ; ProjQ2 = secondQ; ProjQ3 = thirdQ;
668 TargQ1 = otherFirstQ; TargQ2 = otherSecondQ; TargQ3 = otherThirdQ;
670 TargQ1 = firstQ; TargQ2 = secondQ; TargQ3 = thirdQ;
671 ProjQ1 = otherFirstQ; ProjQ2 = otherSecondQ; ProjQ3 = otherThirdQ;
673 #ifdef debugFTFexictation
674 G4cout <<
"Exchange Qs Pr Tr " << ( isProjectileExchangedQ ? exchangedQ : otherExchangedQ )
675 <<
" " << ( isProjectileExchangedQ ? otherExchangedQ : exchangedQ ) <<
G4endl;
687 for (
G4int iHadron = 0; iHadron < 2; iHadron++ ) {
689 G4int codeQ1 = ProjQ1, codeQ2 = ProjQ2, codeQ3 = ProjQ3, newHadCode = NewProjCode;
692 if ( iHadron == 1 ) {
693 codeQ1 = TargQ1, codeQ2 = TargQ2, codeQ3 = TargQ3, newHadCode = NewTargCode;
694 massConstraint =
common.M0projectile;
697 if ( codeQ1 > 3 || codeQ2 > 3 || codeQ3 > 3 )
continue;
698 if ( codeQ1 == codeQ2 && codeQ1 == codeQ3 ) {
700 }
else if ( isHadronADelta ) {
715 if ( iHadron == 0 ) {
716 NewProjCode = newHadCode;
718 NewTargCode = newHadCode;
721 #ifdef debugFTFexictation
722 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
729 if ( NewProjCode == 3124 ||
730 NewProjCode == 3224 ||
731 NewProjCode == 3214 ||
732 NewProjCode == 3114 ||
733 NewProjCode == 3324 ||
734 NewProjCode == 3314 ) {
739 if ( NewTargCode == 3124 ||
740 NewTargCode == 3224 ||
741 NewTargCode == 3214 ||
742 NewTargCode == 3114 ||
743 NewTargCode == 3324 ||
744 NewTargCode == 3314 ) {
752 #ifdef debug_heavyHadrons
753 G4int initialNewProjCode = NewProjCode, initialNewTargCode = NewTargCode;
755 if ( NewProjCode == 4322 ) NewProjCode = 4232;
756 else if ( NewProjCode == 4312 ) NewProjCode = 4132;
757 else if ( NewProjCode == 5312 ) NewProjCode = 5132;
758 else if ( NewProjCode == 5322 ) NewProjCode = 5232;
759 if ( NewTargCode == 4322 ) NewTargCode = 4232;
760 else if ( NewTargCode == 4312 ) NewTargCode = 4132;
761 else if ( NewTargCode == 5312 ) NewTargCode = 5132;
762 else if ( NewTargCode == 5322 ) NewTargCode = 5232;
763 #ifdef debug_heavyHadrons
764 if ( NewProjCode != initialNewProjCode || NewTargCode != initialNewTargCode ) {
765 G4cout <<
"G4DiffractiveExcitation::ExciteParticipants_doChargeExchange : forcing (inexisting in G4)" <<
G4endl
766 <<
"\t heavy baryon into an existing one:" <<
G4endl;
767 if ( NewProjCode != initialNewProjCode ) {
768 G4cout <<
"\t \t projectile baryon with pdgCode=" << initialNewProjCode
769 <<
" into pdgCode=" << NewProjCode <<
G4endl;
771 if ( NewTargCode != initialNewTargCode ) {
772 G4cout <<
"\t \t target baryon with pdgCode=" << initialNewTargCode
773 <<
" into pdgCode=" << NewTargCode <<
G4endl;
785 G4int firstHadronCode = NewTargCode, secondHadronCode = NewProjCode;
787 G4bool isFirstTarget =
true;
790 firstHadron = projectile; secondHadron = target;
791 firstHadronCode = NewProjCode; secondHadronCode = NewTargCode;
792 massConstraint =
common.M0target;
793 isFirstTarget =
false;
795 G4double Mtest1st = 0.0, Mtest2nd = 0.0, Mmin1st = 0.0, Mmin2nd = 0.0;
796 for (
int iSamplingCase = 0; iSamplingCase < 2; iSamplingCase++ ) {
798 G4int aHadronCode = firstHadronCode;
799 if ( iSamplingCase == 1 ) {
800 aHadron = secondHadron; aHadronCode = secondHadronCode; massConstraint = Mtest1st;
802 G4double MtestHadron = 0.0, MminHadron = 0.0;
805 if ( ! TestParticle )
return returnCode;
806 MminHadron =
common.BrW.GetMinimumMass( TestParticle );
807 if (
common.SqrtS - massConstraint < MminHadron )
return returnCode;
809 MtestHadron =
common.BrW.SampleMass( TestParticle, TestParticle->
GetPDGMass() );
811 const G4int maxNumberOfAttempts = 50;
813 while ( attempts < maxNumberOfAttempts ) {
815 MtestHadron =
common.BrW.SampleMass( TestParticle, TestParticle->
GetPDGMass()
817 if (
common.SqrtS < MtestHadron + massConstraint ) {
823 if ( attempts >= maxNumberOfAttempts )
return returnCode;
826 if ( iSamplingCase == 0 ) {
827 Mtest1st = MtestHadron; Mmin1st = MminHadron;
829 Mtest2nd = MtestHadron; Mmin2nd = MminHadron;
832 if ( isFirstTarget ) {
833 MtestTr = Mtest1st; MtestPr = Mtest2nd;
834 common.MminTarget = Mmin1st;
common.MminProjectile = Mmin2nd;
836 MtestTr = Mtest2nd; MtestPr = Mtest1st;
837 common.MminTarget = Mmin2nd;
common.MminProjectile = Mmin1st;
840 if ( MtestPr != 0.0 ) {
841 common.M0projectile = MtestPr;
844 common.ProjectileNonDiffStateMinMass =
common.M0projectile + 220.0*
MeV;
846 if ( MtestTr != 0.0 ) {
847 common.M0target = MtestTr;
862 #ifdef debugFTFexictation
863 G4cout <<
"At the end// NewProjCode " << NewProjCode <<
G4endl
864 <<
"At the end// NewTargCode " << NewTargCode <<
G4endl
865 <<
"M0pr M0tr SqS " <<
common.M0projectile <<
" " <<
common.M0target <<
" "
867 <<
"M0pr2 M0tr2 SqS " <<
common.M0projectile2 <<
" " <<
common.M0target2 <<
" "
871 if (
common.PZcms2 < 0.0 )
return returnCode;
880 #ifdef debugFTFexictation
894 #ifdef debugFTFexictation
895 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
902 #ifdef debugFTFexictation
903 G4cout <<
"Result of el. scatt " << Result <<
G4endl <<
"Proj Targ and Proj+Targ in Lab"
908 if ( Result ) returnCode = 0;
912 #ifdef debugFTFexictation
917 common.ProbOfDiffraction =
common.ProbProjectileDiffraction +
common.ProbTargetDiffraction;
918 if (
common.ProbOfDiffraction != 0.0 ) {
919 common.ProbProjectileDiffraction /=
common.ProbOfDiffraction;
920 common.ProbTargetDiffraction /=
common.ProbOfDiffraction;
923 return returnCode = 1;
935 G4bool isProjectileDiffraction =
false;
937 isProjectileDiffraction =
true;
938 #ifdef debugFTFexictation
946 #ifdef debugFTFexictation
961 if (
common.PZcms2 < 0.0 )
return false;
965 G4bool loopCondition =
true;
966 G4int whilecount = 0;
970 if ( whilecount > 1000 ) {
977 if ( isProjectileDiffraction ) {
991 if (
common.PZcms2 < 0.0 )
continue;
994 if ( isProjectileDiffraction ) {
1004 loopCondition = ( (
common.Pprojectile +
common.Qmomentum ).mag2() <
1005 common.ProjectileDiffStateMinMass2 );
1016 loopCondition = ( (
common.Ptarget -
common.Qmomentum ).mag2() <
1017 common.TargetDiffStateMinMass2 );
1020 }
while ( loopCondition );
1023 if ( isProjectileDiffraction ) {
1044 #ifdef debugFTFexictation
1049 common.ProjMassT2 =
common.ProjectileNonDiffStateMinMass2;
1050 common.ProjMassT =
common.ProjectileNonDiffStateMinMass;
1060 G4int whilecount = 0;
1064 if ( whilecount > 1000 ) {
1070 common.maxPtSquare ), 0 );
1081 if (
common.PZcms2 < 0.0 )
continue;
1117 #ifdef debugFTFexictation
1119 << (
common.Pprojectile +
common.Qmomentum ).mag() <<
" "
1125 }
while ( (
common.Pprojectile +
common.Qmomentum ).mag2() <
1126 common.ProjectileNonDiffStateMinMass2 ||
1128 common.TargetNonDiffStateMinMass2 );
1130 projectile->SetStatus( 0 );
1131 target->SetStatus( 0 );
1151 if ( start == NULL ) {
1152 G4cout <<
" G4FTFModel::String() Error: No start parton found" <<
G4endl;
1153 FirstString = 0; SecondString = 0;
1158 if ( end == NULL ) {
1159 G4cout <<
" G4FTFModel::String() Error: No end parton found" <<
G4endl;
1160 FirstString = 0; SecondString = 0;
1181 if ( isProjectile ) {
1189 G4double Pt( 0.0 ), x1( 0.0 ), x3( 0.0 );
1212 if ( Pt > 500.0*
MeV ) {
1213 G4double Ymax =
G4Log( W/2.0/Pt + std::sqrt( W2/4.0/Pt/Pt - 1.0 ) );
1215 x1 = 1.0 - Pt/W *
G4Exp(
Y );
1216 x3 = 1.0 - Pt/W *
G4Exp(-
Y );
1220 if ( PDGcode_startQ < 3 ) Mass_startQ = 325.0*
MeV;
1221 if ( PDGcode_startQ == 3 ) Mass_startQ = 500.0*
MeV;
1222 if ( PDGcode_startQ == 4 ) Mass_startQ = 1600.0*
MeV;
1223 if ( PDGcode_startQ == 5 ) Mass_startQ = 4500.0*
MeV;
1225 if ( PDGcode_endQ < 3 ) Mass_endQ = 325.0*
MeV;
1226 if ( PDGcode_endQ == 3 ) Mass_endQ = 500.0*
MeV;
1227 if ( PDGcode_endQ == 4 ) Mass_endQ = 1600.0*
MeV;
1228 if ( PDGcode_endQ == 5 ) Mass_endQ = 4500.0*
MeV;
1230 G4double P2_1 = W2*x1*x1/4.0 - Mass_endQ*Mass_endQ;
1231 G4double P2_3 = W2*x3*x3/4.0 - Mass_startQ*Mass_startQ;
1233 if ( P2_1 <= 0.0 || P2_3 <= 0.0 ) {
1239 G4double CosT12 = ( P2_3 - P2_1 - P2_2 ) / (2.0*P_1*P_2);
1240 G4double CosT13 = ( P2_2 - P2_1 - P2_3 ) / (2.0*P_1*P_3);
1242 if ( std::abs( CosT12 ) > 1.0 || std::abs( CosT13 ) > 1.0 ) {
1246 Pt = P_2 * std::sqrt( 1.0 - CosT12*CosT12 );
1250 Pstart.
setE( x3*W/2.0 );
1252 Pend.
setE( x1*W/2.0 );
1255 if ( Pkink.
getZ() > 0.0 ) {
1257 PkinkQ1 = XkQ*Pkink;
1259 PkinkQ1 = (1.0 - XkQ)*Pkink;
1263 PkinkQ1 = (1.0 - XkQ)*Pkink;
1265 PkinkQ1 = XkQ*Pkink;
1269 PkinkQ2 = Pkink - PkinkQ1;
1272 std::sqrt(
sqr(
sqr(x1) -
sqr(x3) ) +
sqr( 2.0*x1*x3*CosT13 ) );
1273 G4double Psi = std::acos( Cos2Psi );
1276 if ( isProjectile ) {
1296 std::vector< G4double > QuarkProbabilitiesAtGluonSplitUp =
1300 for (
unsigned int Iq = 0; Iq < 3; Iq++ ) {
1302 if ( Ksi > QuarkProbabilitiesAtGluonSplitUp[Iq] ) QuarkInGluon++;
1327 G4int absPDGcode = 1500;
1334 if ( absPDGcode < 1000 ) {
1335 if ( isProjectile ) {
1361 if ( isProjectile ) {
1397 if ( isProjectile ) {
1413 G4double Exp = std::sqrt(
sqr(Pz) + (
sqr(Mt2) - 4.0*
sqr(Eh)*Pt2/4.0 )/Mt2 )/2.0;
1420 Pstart = Pstart1; Pend = Pend1;
1432 <<
" generated string momenta: Diquark " << end->
Get4Momentum() <<
"mass : "
1434 << Pstart + Pend <<
G4endl <<
" Original "
1448 if (
Pmin <= 0.0 || range <= 0.0 ) {
1451 "G4DiffractiveExcitation::ChooseP : Invalid arguments " );
1464 if ( AveragePt2 <= 0.0 ) {
1468 (
G4Exp( -maxPtSquare/AveragePt2 ) - 1.0 ) );
1472 return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
1480 const G4int maxNumberOfLoops = 10000;
1481 G4int loopCounter = 0;
1484 yf = z*z +
sqr(1.0 - z);
1486 ++loopCounter < maxNumberOfLoops );
1487 if ( loopCounter >= maxNumberOfLoops ) {
1488 z = 0.5*(zmin + zmax);
1497 G4int absIdPDG = std::abs( IdPDG );
1498 if ( ! ( absIdPDG == 111 || absIdPDG == 221 || absIdPDG == 331 ||
1499 absIdPDG == 441 || absIdPDG == 443 || absIdPDG == 553 ) ) {
1501 Q1 = absIdPDG / 100;
1502 Q2 = (absIdPDG % 100) / 10;
1504 if ( IdPDG < 0 ) anti *= -1;
1508 if ( absIdPDG == 441 || absIdPDG == 443 ) {
1510 }
else if ( absIdPDG == 553 ) {
1529 Q2 = (IdPDG % 1000) / 100;
1530 Q3 = (IdPDG % 100) / 10;
1544 }
else if ( Q3 > Q1 ) {
1555 G4int NewCode = Q1*1000 + Q2*100 + Q3*10 + 2;
1564 "G4DiffractiveExcitation copy constructor not meant to be called" );
1572 "G4DiffractiveExcitation = operator not meant to be called" );
1581 "G4DiffractiveExcitation == operator not meant to be called" );
1589 "G4DiffractiveExcitation != operator not meant to be called" );
G4double Y(G4double density)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
CLHEP::HepLorentzRotation G4LorentzRotation
CLHEP::HepLorentzVector G4LorentzVector
static constexpr double twopi
static constexpr double MeV
static constexpr double pi
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
Hep3Vector boostVector() const
HepLorentzVector & transform(const HepRotation &)
G4int NewNucleonId(G4int Q1, G4int Q2, G4int Q3) const
void UnpackMeson(G4int IdPDG, G4int &Q1, G4int &Q2) const
G4double ChooseP(G4double Pmin, G4double Pmax) const
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4DiffractiveExcitation()
G4bool operator!=(const G4DiffractiveExcitation &right) const
G4double GetQuarkFractionOfKink(G4double zmin, G4double zmax) const
virtual G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters, G4ElasticHNScattering *theElastic) const
void UnpackBaryon(G4int IdPDG, G4int &Q1, G4int &Q2, G4int &Q3) const
G4bool ExciteParticipants_doDiffraction(G4VSplitableHadron *projectile, G4VSplitableHadron *target, G4FTFParameters *theParameters, CommonVariables &common) const
G4int ExciteParticipants_doChargeExchange(G4VSplitableHadron *projectile, G4VSplitableHadron *target, G4FTFParameters *theParameters, G4ElasticHNScattering *theElastic, CommonVariables &common) const
G4bool ExciteParticipants_doNonDiffraction(G4VSplitableHadron *projectile, G4VSplitableHadron *target, G4FTFParameters *theParameters, CommonVariables &common) const
virtual void CreateStrings(G4VSplitableHadron *aHadron, G4bool isProjectile, G4ExcitedString *&FirstString, G4ExcitedString *&SecondString, G4FTFParameters *theParameters) const
const G4DiffractiveExcitation & operator=(const G4DiffractiveExcitation &right)
virtual ~G4DiffractiveExcitation()
G4bool operator==(const G4DiffractiveExcitation &right) const
virtual G4bool ElasticScattering(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters) const
void SetPosition(const G4ThreeVector &aPosition)
void SetTimeOfCreation(G4double aTime)
G4double GetProbLogDistrPrD()
G4double GetProbLogDistr()
G4double GetProjMinNonDiffMass()
G4double GetAvaragePt2ofElasticScattering()
G4double GetTarMinDiffMass()
G4double GetTarMinNonDiffMass()
G4double GetProcProb(const G4int ProcN, const G4double y)
G4double GetDeltaProbAtQuarkExchange()
G4double GetProjMinDiffMass()
G4double GetProbOfSameQuarkExchange()
std::vector< G4double > GetQuarkProbabilitiesAtGluonSplitUp()
G4int GetPDGiIsospin() const
const G4String & GetParticleType() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGWidth() const
const G4String & GetParticleName() const
const G4String & GetParticleSubType() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetDefinition()
void Set4Momentum(const G4LorentzVector &aMomentum)
const G4LorentzVector & Get4Momentum() const
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
void SetStatus(const G4int aStatus)
const G4ParticleDefinition * GetDefinition() const
G4double GetTimeOfCreation()
void Set4Momentum(const G4LorentzVector &a4Momentum)
virtual G4Parton * GetNextParton()=0
void SetDefinition(const G4ParticleDefinition *aDefinition)
const G4LorentzVector & Get4Momentum() const
const G4ThreeVector & GetPosition() const
void IncrementCollisionCount(G4int aCount)
G4int GetSoftCollisionCount()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static int FASTCALL common(PROLOG_STATE *state, int tok)