83 if(Pprojectile.
z() < 0.)
92 G4int absProjectilePDGcode=std::abs(ProjectilePDGcode);
94 G4bool PutOnMassShell(
false);
99 if(M0projectile < projectile->GetDefinition()->GetPDGMass())
105 G4double M0projectile2 = M0projectile * M0projectile;
113 G4int absTargetPDGcode=std::abs(TargetPDGcode);
123 if(M0target < target->GetDefinition()->GetPDGMass())
129 G4double M0target2 = M0target * M0target;
146 Psum=Pprojectile+Ptarget;
156 if ( Ptmp.pz() <= 0. )
163 toCms.rotateZ(-1*Ptmp.phi());
164 toCms.rotateY(-1*Ptmp.theta());
183 if(absProjectilePDGcode > 1000 && (SqrtS < SumMasses))
192 if(( absProjectilePDGcode == 211 || ProjectilePDGcode == 111) &&
199 if(( (absProjectilePDGcode == 321) || (ProjectilePDGcode == -311) ||
200 (absProjectilePDGcode == 311) || (absProjectilePDGcode == 130) ||
201 (absProjectilePDGcode == 310)) && (SqrtS < SumMasses))
207 PZcms2=(S*S+M0projectile2*M0projectile2+M0target2*M0target2-
208 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2)
215 PZcms = std::sqrt(PZcms2);
219 if(Pprojectile.z() > 0.)
221 Pprojectile.setPz( PZcms);
222 Ptarget.setPz( -PZcms);
226 Pprojectile.setPz(-PZcms);
227 Ptarget.setPz( PZcms);
230 Pprojectile.setE(std::sqrt(M0projectile2 +
231 Pprojectile.x()*Pprojectile.x()+
232 Pprojectile.y()*Pprojectile.y()+
234 Ptarget.setE(std::sqrt(M0target2 +
235 Ptarget.x()*Ptarget.x()+
236 Ptarget.y()*Ptarget.y()+
281 std::exp(-SlopeQuarkExchange*ProjectileRapidity))
286 G4int NewProjCode(0), NewTargCode(0);
288 G4int ProjQ1(0), ProjQ2(0), ProjQ3(0);
291 if(absProjectilePDGcode < 1000 )
293 UnpackMeson(ProjectilePDGcode, ProjQ1, ProjQ2);
296 UnpackBaryon(ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3);
300 G4int TargQ1(0), TargQ2(0), TargQ3(0);
301 UnpackBaryon(TargetPDGcode, TargQ1, TargQ2, TargQ3);
306 G4int ProjExchangeQ(0);
307 G4int TargExchangeQ(0);
309 if(absProjectilePDGcode < 1000 )
315 ProjExchangeQ = ProjQ1;
316 if(ProjExchangeQ != TargQ1) Navailable++;
317 if(ProjExchangeQ != TargQ2) Navailable++;
318 if(ProjExchangeQ != TargQ3) Navailable++;
323 if(ProjExchangeQ != TargQ1)
326 if(Navailable == Nsampled)
327 {TargExchangeQ = TargQ1; TargQ1=ProjExchangeQ; ProjQ1=TargExchangeQ;}
330 if(ProjExchangeQ != TargQ2)
333 if(Navailable == Nsampled)
334 {TargExchangeQ = TargQ2; TargQ2=ProjExchangeQ; ProjQ1=TargExchangeQ;}
337 if(ProjExchangeQ != TargQ3)
340 if(Navailable == Nsampled)
341 {TargExchangeQ = TargQ3; TargQ3=ProjExchangeQ; ProjQ1=TargExchangeQ;}
346 ProjExchangeQ = ProjQ2;
347 if(ProjExchangeQ != TargQ1) Navailable++;
348 if(ProjExchangeQ != TargQ2) Navailable++;
349 if(ProjExchangeQ != TargQ3) Navailable++;
354 if(ProjExchangeQ != TargQ1)
357 if(Navailable == Nsampled)
358 {TargExchangeQ = TargQ1; TargQ1=ProjExchangeQ; ProjQ2=TargExchangeQ;}
361 if(ProjExchangeQ != TargQ2)
364 if(Navailable == Nsampled)
365 {TargExchangeQ = TargQ2; TargQ2=ProjExchangeQ; ProjQ2=TargExchangeQ;}
368 if(ProjExchangeQ != TargQ3)
371 if(Navailable == Nsampled)
372 {TargExchangeQ = TargQ3; TargQ3=ProjExchangeQ; ProjQ2=TargExchangeQ;}
380 G4int aProjQ1=std::abs(ProjQ1);
381 G4int aProjQ2=std::abs(ProjQ2);
382 if(aProjQ1 == aProjQ2) {NewProjCode = 111;}
385 if(aProjQ1 > aProjQ2) {NewProjCode = aProjQ1*100+aProjQ2*10+1;}
386 else {NewProjCode = aProjQ2*100+aProjQ1*10+1;}
397 if(aProjQ1 != aProjQ2) NewProjCode *=(ProjectilePDGcode/absProjectilePDGcode);
415 if(MtestPart > M0projectile)
416 {M0projectile = MtestPart;}
420 {M0projectile = MtestPart;}
423 M0projectile2 = M0projectile * M0projectile;
425 ProjectileDiffStateMinMass =M0projectile+210.*
MeV;
426 ProjectileNonDiffStateMinMass=M0projectile+210.*
MeV;
431 NewTargCode = NewNucleonId(TargQ1, TargQ2, TargQ3);
438 if( (TargQ1 == TargQ2) && (TargQ1 == TargQ3) &&
439 (SqrtS > M0projectile+DeltaMass)) {NewTargCode +=2;
442 {
if(
G4UniformRand() > DeltaProbAtQuarkExchange){NewTargCode +=2;
448 else if((!ProjExcited) &&
450 (SqrtS > M0projectile+DeltaMass)) {NewTargCode +=2;}
464 if(MtestPart > M0target)
465 {M0target=MtestPart;}
469 {M0target=MtestPart;}
472 TargetDiffStateMinMass =M0target+220.*
MeV;
473 TargetNonDiffStateMinMass=M0target+220.*
MeV;
480 G4bool ProjDeltaHasCreated(
false);
481 G4bool TargDeltaHasCreated(
false);
487 {ProjExchangeQ = ProjQ1;}
488 else if( (0.333333 <= Ksi) && (Ksi < 0.666667))
489 {ProjExchangeQ = ProjQ2;}
491 {ProjExchangeQ = ProjQ3;}
496 TargExchangeQ = TargQ1; TargQ1=ProjExchangeQ; ProjExchangeQ=TargExchangeQ;
500 TargExchangeQ = TargQ2; TargQ2=ProjExchangeQ; ProjExchangeQ=TargExchangeQ;
503 TargExchangeQ = TargQ3; TargQ3=ProjExchangeQ; ProjExchangeQ=TargExchangeQ;
509 {ProjQ1=ProjExchangeQ;}
510 else if( (0.333333 <= Ksi) && (Ksi < 0.666667))
511 {ProjQ2=ProjExchangeQ;}
513 {ProjQ3=ProjExchangeQ;}
518 {TargExchangeQ = TargQ1;}
519 else if( (0.333333 <= Ksi) && (Ksi < 0.666667))
520 {TargExchangeQ = TargQ2;}
522 {TargExchangeQ = TargQ3;}
526 ProjExchangeQ = ProjQ1; ProjQ1=TargExchangeQ; TargExchangeQ=ProjExchangeQ;
530 ProjExchangeQ = ProjQ2; ProjQ2=TargExchangeQ; TargExchangeQ=ProjExchangeQ;
533 ProjExchangeQ = ProjQ3; ProjQ3=TargExchangeQ; TargExchangeQ=ProjExchangeQ;
537 {TargQ1=TargExchangeQ;}
538 else if( (0.333333 <= Ksi) && (Ksi < 0.666667))
539 {TargQ2=TargExchangeQ;}
541 {TargQ3=TargExchangeQ;}
545 NewProjCode = NewNucleonId(ProjQ1, ProjQ2, ProjQ3);
547 if((ProjQ1==ProjQ2) && (ProjQ1==ProjQ3)) {NewProjCode +=2; ProjDeltaHasCreated=
true;}
550 {NewProjCode +=2; ProjDeltaHasCreated=
true;}
551 else {NewProjCode +=0; ProjDeltaHasCreated=
false;}
555 if((
G4UniformRand() < DeltaProbAtQuarkExchange) && (SqrtS > DeltaMass+M0target))
556 {NewProjCode +=2; ProjDeltaHasCreated=
true;}
557 else {NewProjCode +=0; ProjDeltaHasCreated=
false;}
567 NewTargCode = NewNucleonId(TargQ1, TargQ2, TargQ3);
577 if((TargQ1==TargQ2) && (TargQ1==TargQ3)) {NewTargCode +=2; TargDeltaHasCreated=
true;}
580 {NewTargCode +=2; TargDeltaHasCreated=
true;}
581 else {NewTargCode +=0; TargDeltaHasCreated=
false;}
585 if((
G4UniformRand() < DeltaProbAtQuarkExchange) && (SqrtS > M0projectile+DeltaMass))
586 {NewTargCode +=2; TargDeltaHasCreated=
true;}
587 else {NewTargCode +=0; TargDeltaHasCreated=
false;}
597 if((absProjectilePDGcode == NewProjCode) && (absTargetPDGcode == NewTargCode))
601 if(ProjDeltaHasCreated) {ProbProjectileDiffraction=1.; ProbTargetDiffraction=0.;}
602 if(TargDeltaHasCreated) {ProbProjectileDiffraction=0.; ProbTargetDiffraction=1.;}
603 if(ProjDeltaHasCreated)
608 if(MtestPart >= M0projectile)
610 M0projectile = MtestPart;
611 M0projectile2 = M0projectile * M0projectile;
614 ProjectileDiffStateMinMass =M0projectile+210.*
MeV;
615 ProjectileNonDiffStateMinMass=M0projectile+210.*
MeV;
620 if(TargDeltaHasCreated)
625 if(MtestPart >=M0target)
628 M0target2 = M0target * M0target;
631 TargetDiffStateMinMass =M0target+210.*
MeV;
632 TargetNonDiffStateMinMass=M0target+210.*
MeV;
643 PZcms2=(S*S+M0projectile2*M0projectile2+M0target2*M0target2-
644 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2)
647 if(PZcms2 < 0) {
return false;}
655 PZcms = std::sqrt(PZcms2);
657 Pprojectile.setPz( PZcms);
658 Pprojectile.setE(std::sqrt(M0projectile2+PZcms2));
660 Ptarget.setPz( -PZcms);
661 Ptarget.setE(std::sqrt(M0target2+PZcms2));
665 if(absProjectilePDGcode < 1000)
667 G4double Wexcit=1.-2.256*std::exp(-0.6*ProjectileRapidity);
672 Pprojectile.transform(toLab);
673 Ptarget.transform(toLab);
687 G4double Wexcit=1.-2.256*std::exp(-0.6*ProjectileRapidity);
692 Pprojectile.transform(toLab);
693 Ptarget.transform(toLab);
709 G4double ProbOfDiffraction=ProbProjectileDiffraction + ProbTargetDiffraction;
732 if(ProbOfDiffraction!=0.)
734 ProbProjectileDiffraction/=ProbOfDiffraction;
738 ProbProjectileDiffraction=0.;
743 G4double ProjectileDiffStateMinMass2 = ProjectileDiffStateMinMass *
744 ProjectileDiffStateMinMass;
745 G4double ProjectileNonDiffStateMinMass2 = ProjectileNonDiffStateMinMass *
746 ProjectileNonDiffStateMinMass;
748 G4double TargetDiffStateMinMass2 = TargetDiffStateMinMass *
749 TargetDiffStateMinMass;
750 G4double TargetNonDiffStateMinMass2 = TargetNonDiffStateMinMass *
751 TargetNonDiffStateMinMass;
759 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
788 if (whilecount > 1000 )
795 ProjMassT2=ProjectileDiffStateMinMass2;
796 ProjMassT =ProjectileDiffStateMinMass;
798 TargMassT2=M0target2;
801 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
802 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
816 ProjMassT2=ProjectileDiffStateMinMass2+Pt2;
817 ProjMassT =std::sqrt(ProjMassT2);
819 TargMassT2=M0target2+Pt2;
820 TargMassT =std::sqrt(TargMassT2);
824 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
825 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
828 if(PZcms2 < 0 )
continue;
829 PZcms =std::sqrt(PZcms2);
831 PMinusMin=std::sqrt(ProjMassT2+PZcms2)-PZcms;
832 PMinusMax=SqrtS-TargMassT;
834 PMinusNew=ChooseP(PMinusMin, PMinusMax);
838 TMinusNew=SqrtS-PMinusNew;
839 Qminus=Ptarget.minus()-TMinusNew;
840 TPlusNew=TargMassT2/TMinusNew;
841 Qplus=Ptarget.plus()-TPlusNew;
843 Qmomentum.
setPz( (Qplus-Qminus)/2 );
844 Qmomentum.
setE( (Qplus+Qminus)/2 );
846 }
while ((Pprojectile+Qmomentum).mag2() < ProjectileDiffStateMinMass2);
868 if (whilecount > 1000 )
875 ProjMassT2=M0projectile2;
876 ProjMassT =M0projectile;
878 TargMassT2=TargetDiffStateMinMass2;
879 TargMassT =TargetDiffStateMinMass;
881 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
882 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
898 ProjMassT2=M0projectile2+Pt2;
899 ProjMassT =std::sqrt(ProjMassT2);
901 TargMassT2=TargetDiffStateMinMass2+Pt2;
902 TargMassT =std::sqrt(TargMassT2);
904 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
905 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
909 if(PZcms2 < 0 )
continue;
910 PZcms =std::sqrt(PZcms2);
912 TPlusMin=std::sqrt(TargMassT2+PZcms2)-PZcms;
913 TPlusMax=SqrtS-ProjMassT;
915 TPlusNew=ChooseP(TPlusMin, TPlusMax);
920 PPlusNew=SqrtS-TPlusNew;
921 Qplus=PPlusNew-Pprojectile.plus();
922 PMinusNew=ProjMassT2/PPlusNew;
923 Qminus=PMinusNew-Pprojectile.minus();
925 Qmomentum.
setPz( (Qplus-Qminus)/2 );
926 Qmomentum.
setE( (Qplus+Qminus)/2 );
938 }
while ((Ptarget -Qmomentum).mag2() < TargetDiffStateMinMass2);
963 if (whilecount > 1000 )
969 ProjMassT2=ProjectileNonDiffStateMinMass2;
970 ProjMassT =ProjectileNonDiffStateMinMass;
972 TargMassT2=TargetNonDiffStateMinMass2;
973 TargMassT =TargetNonDiffStateMinMass;
975 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
976 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
988 ProjMassT2=ProjectileNonDiffStateMinMass2+Pt2;
989 ProjMassT =std::sqrt(ProjMassT2);
991 TargMassT2=TargetNonDiffStateMinMass2+Pt2;
992 TargMassT =std::sqrt(TargMassT2);
994 PZcms2=(S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2-
995 2.*S*ProjMassT2-2.*S*TargMassT2-2.*ProjMassT2*TargMassT2)
999 if(PZcms2 < 0 )
continue;
1000 PZcms =std::sqrt(PZcms2);
1002 PMinusMin=std::sqrt(ProjMassT2+PZcms2)-PZcms;
1003 PMinusMax=SqrtS-TargMassT;
1006 { PMinusNew=ChooseP(PMinusMin, PMinusMax);}
1007 else {PMinusNew=(PMinusMax-PMinusMin)*
G4UniformRand() + PMinusMin;}
1008 Qminus=PMinusNew-Pprojectile.minus();
1010 TPlusMin=std::sqrt(TargMassT2+PZcms2)-PZcms;
1011 TPlusMax=SqrtS-PMinusNew;
1015 { TPlusNew=ChooseP(TPlusMin, TPlusMax);}
1016 else {TPlusNew=(TPlusMax-TPlusMin)*
G4UniformRand() +TPlusMin;}
1018 Qplus=-(TPlusNew-Ptarget.plus());
1020 Qmomentum.
setPz( (Qplus-Qminus)/2 );
1021 Qmomentum.
setE( (Qplus+Qminus)/2 );
1028 ((Pprojectile+Qmomentum).mag2() < ProjectileNonDiffStateMinMass2) ||
1029 ((Ptarget -Qmomentum).mag2() < TargetNonDiffStateMinMass2 ));
1035 Pprojectile += Qmomentum;
1036 Ptarget -= Qmomentum;
1091 {
G4cout <<
" G4FTFModel::String() Error:No start parton found"<<
G4endl;
1092 FirstString=0; SecondString=0;
1097 {
G4cout <<
" G4FTFModel::String() Error:No end parton found"<<
G4endl;
1098 FirstString=0; SecondString=0;
1145 Pt = std::sqrt(Pt2kink*(std::pow(W2/16./Pt2kink+1.,
G4UniformRand()) - 1.));
1152 G4double Ymax = std::log(W/2./Pt + std::sqrt(W2/4./Pt/Pt - 1.));
1155 x1=1.-Pt/W*std::exp( Y);
1156 x3=1.-Pt/W*std::exp(-Y);
1160 if(PDGcode_startQ < 3) Mass_startQ = 325.*
MeV;
1161 if(PDGcode_startQ == 3) Mass_startQ = 500.*
MeV;
1162 if(PDGcode_startQ == 4) Mass_startQ = 1600.*
MeV;
1165 if(PDGcode_endQ < 3) Mass_endQ = 325.*
MeV;
1166 if(PDGcode_endQ == 3) Mass_endQ = 500.*
MeV;
1167 if(PDGcode_endQ == 4) Mass_endQ = 1600.*
MeV;
1169 G4double P2_1=W2*x1*x1/4.-Mass_endQ *Mass_endQ;
1170 G4double P2_3=W2*x3*x3/4.-Mass_startQ*Mass_startQ;
1174 if((P2_1 <= 0.) || (P2_3 <= 0.))
1182 G4double CosT12=(P2_3-P2_1-P2_2)/(2.*P_1*P_2);
1183 G4double CosT13=(P2_2-P2_1-P2_3)/(2.*P_1*P_3);
1186 if((std::abs(CosT12) >1.) || (std::abs(CosT13) > 1.))
1191 Pt=P_2*std::sqrt(1.-CosT12*CosT12);
1195 Pstart.
setE(x3*W/2.);
1199 G4double XkQ=GetQuarkFractionOfKink(0.,1.);
1200 if(Pkink.
getZ() > 0.)
1202 if(XkQ > 0.5) {PkinkQ1=XkQ*Pkink;}
else {PkinkQ1=(1.-XkQ)*Pkink;}
1204 if(XkQ > 0.5) {PkinkQ1=(1.-XkQ)*Pkink;}
else {PkinkQ1=XkQ*Pkink;}
1207 PkinkQ2=Pkink - PkinkQ1;
1211 std::sqrt(
sqr(
sqr(x1)-
sqr(x3)) +
sqr(2.*x1*x3*CosT13));
1215 if(isProjectile) {Rotate.
rotateY(Psi);}
1245 std::vector<G4double> QuarkProbabilitiesAtGluonSplitUp =
1249 for(
unsigned int Iq=0; Iq <3; Iq++)
1253 if(Ksi > QuarkProbabilitiesAtGluonSplitUp[Iq]) QuarkInGluon++;}
1276 G4int absPDGcode=1500;
1283 if(absPDGcode < 1000)
1407 Pstart1*=(-1.)*Minus/2.;
1408 Pend1 *=(+1.)*Plus /2.;
1412 Pstart1*=(+1.)*Plus/2.;
1413 Pend1 *=(-1.)*Minus/2.;
1416 Momentum=-Pstart1.
mag();
1417 Pstart1.
setT(Momentum);
1419 Momentum=-Pend1.
mag();
1420 Pend1.
setT(Momentum);
1431 G4cout <<
" generated string flavors "
1434 G4cout <<
" generated string momenta: quark "
1437 G4cout <<
" generated string momenta: Diquark "
1459 if ( Pmin <= 0. || range <=0. )
1461 G4cout <<
" Pmin, range : " << Pmin <<
" , " << range <<
G4endl;
1462 throw G4HadronicException(__FILE__, __LINE__,
"G4DiffractiveExcitation::ChooseP : Invalid arguments ");
1476 if(AveragePt2 <= 0.) {Pt2=0.;}
1480 (std::exp(-maxPtSquare/AveragePt2)-1.));
1484 return G4ThreeVector (Pt*std::cos(phi), Pt*std::sin(phi), 0.);
1493 yf = z*z +
sqr(1 - z);
1499 void G4DiffractiveExcitation::UnpackMeson(
const G4int IdPDG,
G4int &Q1,
G4int &Q2)
const
1501 G4int absIdPDG = std::abs(IdPDG);
1503 Q2= (absIdPDG %100)/10;
1505 G4int anti= 1 -2 * ( std::max( Q1, Q2 ) % 2 );
1507 if (IdPDG < 0 ) anti *=-1;
1513 void G4DiffractiveExcitation::UnpackBaryon(
G4int IdPDG,
1517 Q2 = (IdPDG % 1000) / 100;
1518 Q3 = (IdPDG % 100) / 10;
1530 }
else if( Q3 > Q1 )
1544 G4int NewCode = Q1*1000 + Q2* 100 + Q3* 10 + 2;
1550 throw G4HadronicException(__FILE__, __LINE__,
"G4DiffractiveExcitation copy contructor not meant to be called");
1561 throw G4HadronicException(__FILE__, __LINE__,
"G4DiffractiveExcitation = operator meant to be called");
1568 throw G4HadronicException(__FILE__, __LINE__,
"G4DiffractiveExcitation == operator meant to be called");
1574 throw G4HadronicException(__FILE__, __LINE__,
"G4DiffractiveExcitation != operator meant to be called");