96 #ifdef debugFTFexictation
102 if ( Pprojectile.z() < 0.0 )
return false;
105 G4int absProjectilePDGcode = std::abs( ProjectilePDGcode );
106 G4double M0projectile = Pprojectile.mag();
107 G4double ProjectileRapidity = Pprojectile.rapidity();
112 G4int absTargetPDGcode = std::abs( TargetPDGcode );
125 G4bool PutOnMassShell(
false );
132 if ( M0projectile < MminProjectile )
134 PutOnMassShell =
true;
138 G4double M0projectile2 = M0projectile * M0projectile;
141 if ( M0projectile > ProjectileDiffStateMinMass ) {
142 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
143 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
144 if(absProjectilePDGcode > 3000) {
145 ProjectileDiffStateMinMass += 140.0*
MeV;
146 ProjectileNonDiffStateMinMass += 140.0*
MeV;
152 if ( M0target < MminTarget )
154 PutOnMassShell =
true;
158 G4double M0target2 = M0target * M0target;
161 if ( M0target > TargetDiffStateMinMass ) {
162 TargetDiffStateMinMass = M0target + 220.0*
MeV;
163 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
164 if(absTargetPDGcode > 3000) {
165 TargetDiffStateMinMass += 140.0*
MeV;
166 TargetNonDiffStateMinMass += 140.0*
MeV;
170 #ifdef debugFTFexictation
171 G4cout <<
"Proj Targ PDGcodes " << ProjectilePDGcode <<
" " << TargetPDGcode << G4endl
172 <<
"M0projectile Y " << M0projectile <<
" " << ProjectileRapidity <<
G4endl;
174 G4cout <<
"Pproj " << Pprojectile << G4endl <<
"Ptarget " << Ptarget <<
G4endl;
180 G4double SumMasses = M0projectile + M0target;
186 if ( Ptmp.pz() <= 0.0 )
return false;
188 toCms.rotateZ( -1*Ptmp.phi() );
189 toCms.rotateY( -1*Ptmp.theta() );
191 Pprojectile.transform( toCms );
192 Ptarget.transform( toCms );
196 #ifdef debugFTFexictation
197 G4cout <<
"SqrtS " << SqrtS << G4endl <<
"M0pr M0tr SumM+220 " << M0projectile <<
" "
198 << M0target <<
" " << SumMasses <<
G4endl;
201 if ( SqrtS < M0projectile + M0target )
return false;
202 if ( SqrtS < SumMasses )
return false;
205 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
206 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
208 #ifdef debugFTFexictation
209 G4cout <<
"PZcms2 after PutOnMassShell " << PZcms2 <<
G4endl;
212 if ( PZcms2 < 0 )
return false;
215 PZcms = std::sqrt( PZcms2 );
216 if ( PutOnMassShell ) {
217 if ( Pprojectile.z() > 0.0 ) {
218 Pprojectile.setPz( PZcms );
219 Ptarget.setPz( -PZcms );
221 Pprojectile.setPz( -PZcms );
222 Ptarget.setPz( PZcms );
224 Pprojectile.setE( std::sqrt( M0projectile2 +
225 Pprojectile.x()*Pprojectile.x() +
226 Pprojectile.y()*Pprojectile.y() +
228 Ptarget.setE( std::sqrt( M0target2 +
229 Ptarget.x()*Ptarget.x() +
230 Ptarget.y()*Ptarget.y() +
243 #ifdef debugFTFexictation
244 G4cout <<
"Start --------------------" << G4endl <<
"Proj M0 Mdif Mndif " << M0projectile
245 <<
" " << ProjectileDiffStateMinMass <<
" " << ProjectileNonDiffStateMinMass << G4endl
246 <<
"Targ M0 Mdif Mndif " << M0target <<
" " << TargetDiffStateMinMass <<
" "
247 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
248 <<
"Proj CMS " << Pprojectile << G4endl <<
"Targ CMS " << Ptarget <<
G4endl;
259 if(QeNoExc+QeExc+ProbProjectileDiffraction+ProbTargetDiffraction > 1.)
260 {QeNoExc=1.0-QeExc-ProbProjectileDiffraction-ProbTargetDiffraction;}
263 if ( QeExc + QeNoExc != 0.0 ) ProbExc = QeExc/(QeExc + QeNoExc);
267 G4double ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
269 #ifdef debugFTFexictation
270 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" " << ProbProjectileDiffraction
271 <<
" " << ProbTargetDiffraction << G4endl
272 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
279 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
280 ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
281 ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
286 #ifdef debugFTFexictation
287 G4cout <<
"Q exchange --------------------------" <<
G4endl;
290 G4int NewProjCode( 0 ), NewTargCode( 0 );
291 G4int ProjQ1( 0 ), ProjQ2( 0 ), ProjQ3( 0 );
294 if ( absProjectilePDGcode < 1000 ) {
297 UnpackBaryon( ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3 );
301 G4int TargQ1( 0 ), TargQ2( 0 ), TargQ3( 0 );
304 #ifdef debugFTFexictation
305 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 << G4endl
306 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
310 G4int ProjExchangeQ( 0 );
311 G4int TargExchangeQ( 0 );
313 if ( absProjectilePDGcode < 1000 )
318 ProjExchangeQ = ProjQ1;
320 G4int NpossibleStates=3;
323 if(ProjQ1 != TargQ1) NpossibleStates++;
324 if(ProjQ1 != TargQ2) NpossibleStates++;
325 if(ProjQ1 != TargQ3) NpossibleStates++;
327 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
334 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
339 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
344 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
354 ProjExchangeQ = ProjQ2;
356 G4int NpossibleStates=3;
359 if(ProjQ2 != TargQ1) NpossibleStates++;
360 if(ProjQ2 != TargQ2) NpossibleStates++;
361 if(ProjQ2 != TargQ3) NpossibleStates++;
363 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
369 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
374 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
379 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
388 #ifdef debugFTFexictation
389 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
392 G4int aProjQ1 = std::abs( ProjQ1 );
393 G4int aProjQ2 = std::abs( ProjQ2 );
395 G4bool ProjExcited =
false;
404 if ( aProjQ1 == aProjQ2 )
412 if ( Ksi < 0.25 ) {NewProjCode = 331;}
417 if( Ksi < 0.5 ) {NewProjCode = 331;}
421 if ( aProjQ1 > aProjQ2 )
423 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
426 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
430 #ifdef debugFTFexictation
443 if ( aProjQ1 == 1 ) {Qquarks -= ProjQ1;}
444 else if( aProjQ1 == 2 ) {Qquarks += ProjQ1;}
445 else {Qquarks -= ProjQ1/aProjQ1;}
447 if ( aProjQ2 == 1 ) {Qquarks -= ProjQ2;}
448 else if( aProjQ2 == 2 ) {Qquarks += ProjQ2;}
449 else {Qquarks -= ProjQ2/aProjQ2;}
451 if( Qquarks < 0 ) NewProjCode *=(-1);
454 #ifdef debugFTFexictation
455 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
456 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
458 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
463 if(!TestParticle)
continue;
468 if(SqrtS-M0target < MminProjectile)
continue;
473 #ifdef debugFTFexictation
476 G4cout <<
"M0projectile projectile PDGMass " << M0projectile <<
" "
483 #ifdef debugFTFexictation
484 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 << G4endl
485 <<
"NewTargCode " << NewTargCode <<
G4endl;
488 if( TargQ1 != TargQ2 && TargQ1 != TargQ3 && TargQ2 != TargQ3 )
493 else if( TargQ1 == TargQ2 && TargQ1 == TargQ3 )
495 NewTargCode += 2; ProjExcited =
true;
498 {NewTargCode += 2; ProjExcited =
true;}
500 }
else if ( ! ProjExcited &&
502 SqrtS > M0projectile + DeltaMass ) {
508 if(!TestParticle)
continue;
510 #ifdef debugFTFexictation
516 if(SqrtS-MtestPr < MminTarget)
continue;
520 if(SqrtS > MtestPr+MtestTr)
break;
523 if(attempts >= 50)
return false;
534 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
535 else if (projectile->
GetStatus() != 0 ) {M0projectile = MtestPr;}
538 #ifdef debugFTFexictation
539 G4cout <<
"M0projectile After check " << M0projectile <<
G4endl;
542 M0projectile2 = M0projectile * M0projectile;
543 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
544 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
546 if ( MtestTr >= Ptarget.mag() ) {M0target = MtestTr;}
547 else if (target->
GetStatus() != 0 ) {M0target = MtestTr;}
559 M0target2 = M0target * M0target;
561 #ifdef debugFTFexictation
562 G4cout <<
"New targ M0 M0^2 " << M0target <<
" " << M0target2 <<
G4endl;
565 TargetDiffStateMinMass = M0target + 220.0*
MeV;
566 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
579 if ( Ksi < 0.333333 ) {
580 ProjExchangeQ = ProjQ1;
581 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
582 ProjExchangeQ = ProjQ2;
584 ProjExchangeQ = ProjQ3;
588 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
591 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
593 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
597 #ifdef debugFTFexictation
598 G4cout <<
"Exchange Qs Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
601 if ( Ksi < 0.333333 ) {
602 ProjQ1 = ProjExchangeQ;
603 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
604 ProjQ2 = ProjExchangeQ;
606 ProjQ3 = ProjExchangeQ;
611 if ( Ksi < 0.333333 ) {
612 TargExchangeQ = TargQ1;
613 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
614 TargExchangeQ = TargQ2;
616 TargExchangeQ = TargQ3;
619 ProjExchangeQ = ProjQ1; ProjQ1 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
622 ProjExchangeQ = ProjQ2; ProjQ2 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
624 ProjExchangeQ = ProjQ3; ProjQ3 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
628 if ( Ksi < 0.333333 ) {
629 TargQ1 = TargExchangeQ;
630 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
631 TargQ2 = TargExchangeQ;
633 TargQ3 = TargExchangeQ;
646 if ( ProjQ1 == ProjQ2 && ProjQ1 == ProjQ3 ) {
655 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > DeltaMass + M0target ) {
662 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
671 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > M0projectile + DeltaMass ) {
678 #ifdef debugFTFexictation
679 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
683 if ( absProjectilePDGcode == NewProjCode && absTargetPDGcode == NewTargCode ) {
713 if(!TestParticle)
continue;
717 if(SqrtS-M0target < MminProjectile)
continue;
723 if(!TestParticle)
continue;
727 if(SqrtS-MtestPr < MminTarget)
continue;
731 if(SqrtS > MtestPr+MtestTr)
break;
734 if(attempts >= 50)
return false;
736 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
737 else if (projectile->
GetStatus() != 0 ) {M0projectile = MtestPr;}
738 M0projectile2 = M0projectile * M0projectile;
739 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
740 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
742 if ( MtestTr >= Ptarget.mag() ) {M0target = MtestTr;}
743 else if (target->
GetStatus() != 0 ) {M0target = MtestTr;}
744 M0target2 = M0target * M0target;
745 TargetDiffStateMinMass = M0target + 220.0*
MeV;
746 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
753 if ( SqrtS < M0projectile + M0target )
return false;
755 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
756 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
758 #ifdef debugFTFexictation
759 G4cout <<
"At the end// NewProjCode " << NewProjCode << G4endl
760 <<
"At the end// NewTargCode " << NewTargCode << G4endl
761 <<
"M0pr M0tr SqS " << M0projectile <<
" " << M0target <<
" " << SqrtS << G4endl
762 <<
"M0pr2 M0tr2 SqS " << M0projectile2 <<
" " << M0target2 <<
" " << SqrtS << G4endl
763 <<
"PZcms2 after the change " << PZcms2 << G4endl <<
G4endl;
766 if ( PZcms2 < 0 )
return false;
771 PZcms = std::sqrt( PZcms2 );
772 Pprojectile.setPz( PZcms );
773 Pprojectile.setE( std::sqrt( M0projectile2 + PZcms2 ) );
774 Ptarget.setPz( -PZcms );
775 Ptarget.setE( std::sqrt( M0target2 + PZcms2 ) );
780 #ifdef debugFTFexictation
781 G4cout <<
"Proj Targ and Proj+Targ in CMS" << G4endl << Pprojectile << G4endl << Ptarget
782 << G4endl << Pprojectile + Ptarget <<
G4endl;
786 if((SqrtS < M0projectile + TargetDiffStateMinMass) ||
787 (SqrtS < ProjectileDiffStateMinMass + M0target) ||
788 (ProbOfDiffraction == 0.) ) ProbExc=0.;
792 #ifdef debugFTFexictation
793 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
796 Pprojectile.transform( toLab );
797 Ptarget.transform( toLab );
804 #ifdef debugFTFexictation
805 G4cout <<
"Result of el. scatt " << Result << G4endl <<
"Proj Targ and Proj+Targ in Lab"
815 #ifdef debugFTFexictation
821 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
822 if ( ProbOfDiffraction != 0.0 ) {
823 ProbProjectileDiffraction /= ProbOfDiffraction;
824 ProbTargetDiffraction /= ProbOfDiffraction;
825 ProbOfDiffraction=1.0;
830 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
832 #ifdef debugFTFexictation
833 G4cout <<
"Excitation --------------------" << G4endl
834 <<
"Proj M0 MdMin MndMin " << M0projectile <<
" " << ProjectileDiffStateMinMass <<
" "
835 << ProjectileNonDiffStateMinMass << G4endl
836 <<
"Targ M0 MdMin MndMin " << M0target <<
" " << TargetDiffStateMinMass <<
" "
837 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
838 <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
839 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
842 if ( ProbOfDiffraction != 0.0 ) {
843 ProbProjectileDiffraction /= ProbOfDiffraction;
845 ProbProjectileDiffraction = 0.0;
848 #ifdef debugFTFexictation
849 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
850 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
853 G4double ProjectileDiffStateMinMass2 =
sqr( ProjectileDiffStateMinMass );
854 G4double ProjectileNonDiffStateMinMass2 =
sqr( ProjectileNonDiffStateMinMass );
855 G4double TargetDiffStateMinMass2 =
sqr( TargetDiffStateMinMass );
856 G4double TargetNonDiffStateMinMass2 =
sqr( TargetNonDiffStateMinMass );
864 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
867 G4int whilecount = 0;
874 #ifdef debugFTFexictation
889 if ( whilecount > 1000 ) {
895 ProjMassT2 = ProjectileDiffStateMinMass2;
896 ProjMassT = ProjectileDiffStateMinMass;
897 TargMassT2 = M0target2;
898 TargMassT = M0target;
899 if ( SqrtS < ProjMassT + TargMassT )
return false;
901 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
902 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
904 if ( PZcms2 < 0 )
return false;
906 maxPtSquare = PZcms2;
911 ProjMassT2 = ProjectileDiffStateMinMass2 + Pt2;
912 ProjMassT = std::sqrt( ProjMassT2 );
913 TargMassT2 = M0target2 + Pt2;
914 TargMassT = std::sqrt( TargMassT2 );
915 if ( SqrtS < ProjMassT + TargMassT )
continue;
917 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
918 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
920 if ( PZcms2 < 0 )
continue;
922 PZcms = std::sqrt( PZcms2 );
923 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
924 PMinusMax = SqrtS - TargMassT;
926 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
928 TMinusNew = SqrtS - PMinusNew;
929 Qminus = Ptarget.minus() - TMinusNew;
930 TPlusNew = TargMassT2 / TMinusNew;
931 Qplus = Ptarget.plus() - TPlusNew;
932 Qmomentum.setPz( (Qplus - Qminus)/2 );
933 Qmomentum.setE( (Qplus + Qminus)/2 );
935 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileDiffStateMinMass2 );
946 #ifdef debugFTFexictation
961 if ( whilecount > 1000 ) {
967 ProjMassT2 = M0projectile2;
968 ProjMassT = M0projectile;
970 TargMassT2 = TargetDiffStateMinMass2;
971 TargMassT = TargetDiffStateMinMass;
973 if ( SqrtS < ProjMassT + TargMassT )
return false;
975 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
976 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
978 if ( PZcms2 < 0 )
return false;
980 maxPtSquare = PZcms2;
985 ProjMassT2 = M0projectile2 + Pt2;
986 ProjMassT = std::sqrt( ProjMassT2 );
987 TargMassT2 = TargetDiffStateMinMass2 + Pt2;
988 TargMassT = std::sqrt( TargMassT2 );
989 if ( SqrtS < ProjMassT + TargMassT )
continue;
991 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
992 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
994 if ( PZcms2 < 0 )
continue;
996 PZcms = std::sqrt( PZcms2 );
997 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
999 TPlusMax = SqrtS - ProjMassT;
1001 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1004 PPlusNew = SqrtS - TPlusNew;
1005 Qplus = PPlusNew - Pprojectile.plus();
1006 PMinusNew = ProjMassT2 / PPlusNew;
1007 Qminus = PMinusNew - Pprojectile.minus();
1008 Qmomentum.setPz( (Qplus - Qminus)/2 );
1009 Qmomentum.setE( (Qplus + Qminus)/2 );
1011 }
while ( ( Ptarget - Qmomentum ).mag2() < TargetDiffStateMinMass2 );
1024 #ifdef debugFTFexictation
1039 if ( whilecount > 1000 ) {
1045 ProjMassT2 = ProjectileNonDiffStateMinMass2;
1046 ProjMassT = ProjectileNonDiffStateMinMass;
1047 TargMassT2 = TargetNonDiffStateMinMass2;
1048 TargMassT = TargetNonDiffStateMinMass;
1049 if ( SqrtS < ProjMassT + TargMassT )
return false;
1051 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1052 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1054 if ( PZcms2 < 0 )
return false;
1056 maxPtSquare = PZcms2;
1061 ProjMassT2 = ProjectileNonDiffStateMinMass2 + Pt2;
1062 ProjMassT = std::sqrt( ProjMassT2 );
1063 TargMassT2 = TargetNonDiffStateMinMass2 + Pt2;
1064 TargMassT = std::sqrt( TargMassT2 );
1065 if ( SqrtS < ProjMassT + TargMassT )
continue;
1067 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1068 -2.0*S*ProjMassT2 - 2.0*S*TargMassT2 -2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1070 if ( PZcms2 < 0 )
continue;
1072 PZcms = std::sqrt( PZcms2 );
1073 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
1075 PMinusMax = SqrtS - TargMassT;
1077 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1079 TPlusMax = SqrtS - ProjMassT;
1093 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
1094 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1096 PMinusNew = ( PMinusMax - PMinusMin )*
G4UniformRand() + PMinusMin;
1097 TPlusNew = ( TPlusMax - TPlusMin )*
G4UniformRand() + TPlusMin;
1100 Qminus = PMinusNew - Pprojectile.minus();
1102 Qplus = -( TPlusNew - Ptarget.plus() );
1103 Qmomentum.setPz( (Qplus - Qminus)/2 );
1104 Qmomentum.setE( (Qplus + Qminus)/2 );
1106 #ifdef debugFTFexictation
1107 G4cout << ( Pprojectile + Qmomentum ).mag2() <<
" " << ProjectileNonDiffStateMinMass2
1108 << G4endl << ( Ptarget - Qmomentum ).mag2() <<
" "
1109 << TargetNonDiffStateMinMass2 <<
G4endl;
1114 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileNonDiffStateMinMass2 ||
1115 ( Ptarget - Qmomentum ).mag2() < TargetNonDiffStateMinMass2 ||
1116 ( Pprojectile + Qmomentum ).pz() < 0.);
1123 Pprojectile += Qmomentum;
1124 Ptarget -= Qmomentum;
1127 Pprojectile.transform( toLab );
1128 Ptarget.transform( toLab );
1148 #ifdef debugFTFexictation
1149 G4cout <<
"Mproj " << Pprojectile.mag() << G4endl <<
"Mtarg " << Ptarget.mag() <<
G4endl;
1182 if ( start == NULL ) {
1183 G4cout <<
" G4FTFModel::String() Error: No start parton found" <<
G4endl;
1184 FirstString = 0; SecondString = 0;
1189 if ( end == NULL ) {
1190 G4cout <<
" G4FTFModel::String() Error: No end parton found" <<
G4endl;
1191 FirstString = 0; SecondString = 0;
1212 if ( isProjectile ) {
1222 G4double Pt( 0.0 ), x1( 0.0 ), x3( 0.0 );
1238 {Pt = std::sqrt( Pt2kink * ( std::pow( W2/16.0/Pt2kink + 1.0,
G4UniformRand() ) - 1.0 ) );}
1244 if ( Pt > 500.0*
MeV ) {
1245 G4double Ymax = std::log( W/2.0/Pt + std::sqrt( W2/4.0/Pt/Pt - 1.0 ) );
1247 x1 = 1.0 - Pt/W * std::exp( Y );
1248 x3 = 1.0 - Pt/W * std::exp(-Y );
1252 if ( PDGcode_startQ < 3 ) Mass_startQ = 325.0*
MeV;
1253 if ( PDGcode_startQ == 3 ) Mass_startQ = 500.0*
MeV;
1254 if ( PDGcode_startQ == 4 ) Mass_startQ = 1600.0*
MeV;
1256 if ( PDGcode_endQ < 3 ) Mass_endQ = 325.0*
MeV;
1257 if ( PDGcode_endQ == 3 ) Mass_endQ = 500.0*
MeV;
1258 if ( PDGcode_endQ == 4 ) Mass_endQ = 1600.0*
MeV;
1260 G4double P2_1 = W2*x1*x1/4.0 - Mass_endQ*Mass_endQ;
1261 G4double P2_3 = W2*x3*x3/4.0 - Mass_startQ*Mass_startQ;
1263 if ( P2_1 <= 0.0 || P2_3 <= 0.0 ) {
1269 G4double CosT12 = ( P2_3 - P2_1 - P2_2 ) / (2.0*P_1*P_2);
1270 G4double CosT13 = ( P2_2 - P2_1 - P2_3 ) / (2.0*P_1*P_3);
1273 if ( std::abs( CosT12 ) > 1.0 || std::abs( CosT13 ) > 1.0 ) {
1277 Pt = P_2 * std::sqrt( 1.0 - CosT12*CosT12 );
1278 Pstart.setPx( -Pt ); Pstart.setPy( 0.0 ); Pstart.setPz( P_3*CosT13 );
1279 Pend.setPx( 0.0 ); Pend.setPy( 0.0 ); Pend.setPz( P_1 );
1280 Pkink.setPx( Pt ); Pkink.setPy( 0.0 ); Pkink.setPz( P_2*CosT12 );
1281 Pstart.setE( x3*W/2.0 );
1282 Pkink.setE( Pkink.vect().mag() );
1283 Pend.setE( x1*W/2.0 );
1286 if ( Pkink.getZ() > 0.0 ) {
1288 PkinkQ1 = XkQ*Pkink;
1290 PkinkQ1 = (1.0 - XkQ)*Pkink;
1294 PkinkQ1 = (1.0 - XkQ)*Pkink;
1296 PkinkQ1 = XkQ*Pkink;
1300 PkinkQ2 = Pkink - PkinkQ1;
1303 std::sqrt(
sqr(
sqr(x1) -
sqr(x3) ) +
sqr( 2.0*x1*x3*CosT13 ) );
1304 G4double Psi = std::acos( Cos2Psi );
1307 if ( isProjectile ) {
1308 Rotate.rotateY( Psi );
1310 Rotate.rotateY(
pi + Psi );
1334 std::vector< G4double > QuarkProbabilitiesAtGluonSplitUp =
1338 for (
unsigned int Iq = 0; Iq < 3; Iq++ ) {
1340 if ( Ksi > QuarkProbabilitiesAtGluonSplitUp[Iq] ) QuarkInGluon++;
1355 Pstart.transform( toLab ); start->
Set4Momentum( Pstart );
1356 PkinkQ1.transform( toLab );
1357 PkinkQ2.transform( toLab );
1365 G4int absPDGcode = 1500;
1372 if ( absPDGcode < 1000 ) {
1373 if ( isProjectile ) {
1407 if ( isProjectile ) {
1472 if ( Momentum > 0.0 ) {
1478 tmp.set( 0.0, 0.0, 1.0 );
1482 if ( isProjectile ) {
1483 Pstart1 *= (-1.0)*Minus/2.0;
1484 Pend1 *= (+1.0)*Plus /2.0;
1486 Pstart1 *= (+1.0)*Plus/ 2.0;
1487 Pend1 *= (-1.0)*Minus/2.0;
1489 Momentum = -Pstart1.mag();
1490 Pstart1.setT( Momentum );
1491 Momentum = -Pend1.mag();
1492 Pend1.setT( Momentum );
1507 <<
" generated string momenta: Diquark " << end->
Get4Momentum() <<
"mass : "
1509 << Pstart + Pend <<
G4endl <<
" Original "
1523 if ( Pmin <= 0.0 || range <= 0.0 ) {
1524 G4cout <<
" Pmin, range : " << Pmin <<
" , " << range <<
G4endl;
1526 "G4DiffractiveExcitation::ChooseP : Invalid arguments " );
1539 if ( AveragePt2 <= 0.0 ) {
1543 ( std::exp( -maxPtSquare/AveragePt2 ) - 1.0 ) );
1547 return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
1557 yf = z*z +
sqr(1.0 - z);
1566 G4int absIdPDG = std::abs( IdPDG );
1567 if(!((absIdPDG == 111)||(absIdPDG == 221)||(absIdPDG == 331)))
1569 Q1 = absIdPDG / 100;
1570 Q2 = (absIdPDG % 100) / 10;
1572 if ( IdPDG < 0 ) anti *= -1;
1579 else {Q1 = 2; Q2 = -2;}
1590 Q2 = (IdPDG % 1000) / 100;
1591 Q3 = (IdPDG % 100) / 10;
1604 }
else if ( Q3 > Q1 ) {
1614 G4int NewCode = Q1*1000 + Q2*100 + Q3*10 + 2;
1623 "G4DiffractiveExcitation copy contructor not meant to be called" );
1631 "G4DiffractiveExcitation = operator not meant to be called" );
1640 "G4DiffractiveExcitation == operator not meant to be called" );
1648 "G4DiffractiveExcitation != operator not meant to be called" );
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4double SampleMass(const G4double poleMass, const G4double gamma, const G4double minMass, const G4double maxMass) const
virtual G4bool ElasticScattering(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters) const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4double GetProjMinDiffMass()
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
virtual G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters, G4ElasticHNScattering *theElastic) const
G4int NewNucleonId(G4int Q1, G4int Q2, G4int Q3) const
int operator==(const G4DiffractiveExcitation &right) const
G4int GetSoftCollisionCount()
G4double GetProbLogDistr()
const G4LorentzVector & Get4Momentum() const
G4double GetTarMinDiffMass()
void Set4Momentum(const G4LorentzVector &aMomentum)
G4ParticleDefinition * GetDefinition()
G4int GetPDGEncoding() const
virtual ~G4DiffractiveExcitation()
const G4String & GetParticleSubType() const
void SetDefinition(const G4ParticleDefinition *aDefinition)
void SetStatus(const G4int aStatus)
const G4String & GetParticleName() const
const G4ParticleDefinition * GetDefinition() const
G4double GetPDGWidth() const
void SetPosition(const G4ThreeVector &aPosition)
G4GLOB_DLL std::ostream G4cout
void SetTimeOfCreation(G4double aTime)
virtual G4Parton * GetNextParton()=0
G4double GetTimeOfCreation()
int operator!=(const G4DiffractiveExcitation &right) const
void UnpackMeson(G4int IdPDG, G4int &Q1, G4int &Q2) const
G4double GetQuarkFractionOfKink(G4double zmin, G4double zmax) const
void IncrementCollisionCount(G4int aCount)
const G4String & GetParticleType() const
G4double GetProcProb(const G4int ProcN, const G4double y)
const G4LorentzVector & Get4Momentum() const
G4double GetMinimumMass(const G4ParticleDefinition *p) const
virtual void CreateStrings(G4VSplitableHadron *aHadron, G4bool isProjectile, G4ExcitedString *&FirstString, G4ExcitedString *&SecondString, G4FTFParameters *theParameters) const
G4double ChooseP(G4double Pmin, G4double Pmax) const
G4double GetPDGMass() const
G4double GetTarMinNonDiffMass()
static G4ParticleTable * GetParticleTable()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4int GetPDGiIsospin() const
const G4ThreeVector & GetPosition() const
G4double GetDeltaProbAtQuarkExchange()
const G4DiffractiveExcitation & operator=(const G4DiffractiveExcitation &right)
G4double GetProbOfSameQuarkExchange()
G4double GetProjMinNonDiffMass()
void Set4Momentum(const G4LorentzVector &a4Momentum)
void UnpackBaryon(G4int IdPDG, G4int &Q1, G4int &Q2, G4int &Q3) const
G4DiffractiveExcitation()
std::vector< G4double > GetQuarkProbabilitiesAtGluonSplitUp()
CLHEP::HepLorentzVector G4LorentzVector