99 #ifdef debugFTFexictation
105 if ( Pprojectile.z() < 0.0 )
return false;
108 G4int absProjectilePDGcode = std::abs( ProjectilePDGcode );
109 G4double M0projectile = Pprojectile.mag();
110 G4double ProjectileRapidity = Pprojectile.rapidity();
115 G4int absTargetPDGcode = std::abs( TargetPDGcode );
128 G4bool PutOnMassShell(
false );
135 if ( M0projectile < MminProjectile )
137 PutOnMassShell =
true;
141 G4double M0projectile2 = M0projectile * M0projectile;
144 if ( M0projectile > ProjectileDiffStateMinMass ) {
145 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
146 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
147 if(absProjectilePDGcode > 3000) {
148 ProjectileDiffStateMinMass += 140.0*
MeV;
149 ProjectileNonDiffStateMinMass += 140.0*
MeV;
155 if ( M0target < MminTarget )
157 PutOnMassShell =
true;
161 G4double M0target2 = M0target * M0target;
164 if ( M0target > TargetDiffStateMinMass ) {
165 TargetDiffStateMinMass = M0target + 220.0*
MeV;
166 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
167 if(absTargetPDGcode > 3000) {
168 TargetDiffStateMinMass += 140.0*
MeV;
169 TargetNonDiffStateMinMass += 140.0*
MeV;
173 #ifdef debugFTFexictation
174 G4cout <<
"Proj Targ PDGcodes " << ProjectilePDGcode <<
" " << TargetPDGcode << G4endl
175 <<
"M0projectile Y " << M0projectile <<
" " << ProjectileRapidity <<
G4endl;
177 G4cout <<
"Pproj " << Pprojectile << G4endl <<
"Ptarget " << Ptarget <<
G4endl;
183 G4double SumMasses = M0projectile + M0target;
189 if ( Ptmp.pz() <= 0.0 )
return false;
191 toCms.rotateZ( -1*Ptmp.phi() );
192 toCms.rotateY( -1*Ptmp.theta() );
194 Pprojectile.transform( toCms );
195 Ptarget.transform( toCms );
199 #ifdef debugFTFexictation
200 G4cout <<
"SqrtS " << SqrtS << G4endl <<
"M0pr M0tr SumM+220 " << M0projectile <<
" "
201 << M0target <<
" " << SumMasses <<
G4endl;
204 if ( SqrtS < M0projectile + M0target )
return false;
205 if ( SqrtS < SumMasses )
return false;
208 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
209 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
211 #ifdef debugFTFexictation
212 G4cout <<
"PZcms2 after PutOnMassShell " << PZcms2 <<
G4endl;
215 if ( PZcms2 < 0 )
return false;
218 PZcms = std::sqrt( PZcms2 );
219 if ( PutOnMassShell ) {
220 if ( Pprojectile.z() > 0.0 ) {
221 Pprojectile.setPz( PZcms );
222 Ptarget.setPz( -PZcms );
224 Pprojectile.setPz( -PZcms );
225 Ptarget.setPz( PZcms );
227 Pprojectile.setE( std::sqrt( M0projectile2 +
228 Pprojectile.x()*Pprojectile.x() +
229 Pprojectile.y()*Pprojectile.y() +
231 Ptarget.setE( std::sqrt( M0target2 +
232 Ptarget.x()*Ptarget.x() +
233 Ptarget.y()*Ptarget.y() +
246 #ifdef debugFTFexictation
247 G4cout <<
"Start --------------------" << G4endl <<
"Proj M0 Mdif Mndif " << M0projectile
248 <<
" " << ProjectileDiffStateMinMass <<
" " << ProjectileNonDiffStateMinMass << G4endl
249 <<
"Targ M0 Mdif Mndif " << M0target <<
" " << TargetDiffStateMinMass <<
" "
250 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
251 <<
"Proj CMS " << Pprojectile << G4endl <<
"Targ CMS " << Ptarget <<
G4endl;
262 if(QeNoExc+QeExc+ProbProjectileDiffraction+ProbTargetDiffraction > 1.)
263 {QeNoExc=1.0-QeExc-ProbProjectileDiffraction-ProbTargetDiffraction;}
266 if ( QeExc + QeNoExc != 0.0 ) ProbExc = QeExc/(QeExc + QeNoExc);
270 G4double ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
272 #ifdef debugFTFexictation
273 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" " << ProbProjectileDiffraction
274 <<
" " << ProbTargetDiffraction << G4endl
275 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
282 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
283 ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
284 ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
289 #ifdef debugFTFexictation
290 G4cout <<
"Q exchange --------------------------" <<
G4endl;
293 G4int NewProjCode( 0 ), NewTargCode( 0 );
294 G4int ProjQ1( 0 ), ProjQ2( 0 ), ProjQ3( 0 );
297 if ( absProjectilePDGcode < 1000 ) {
300 UnpackBaryon( ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3 );
304 G4int TargQ1( 0 ), TargQ2( 0 ), TargQ3( 0 );
307 #ifdef debugFTFexictation
308 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 << G4endl
309 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
313 G4int ProjExchangeQ( 0 );
314 G4int TargExchangeQ( 0 );
316 if ( absProjectilePDGcode < 1000 )
321 ProjExchangeQ = ProjQ1;
323 G4int NpossibleStates=3;
326 if(ProjQ1 != TargQ1) NpossibleStates++;
327 if(ProjQ1 != TargQ2) NpossibleStates++;
328 if(ProjQ1 != TargQ3) NpossibleStates++;
330 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
337 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
342 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
347 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
357 ProjExchangeQ = ProjQ2;
359 G4int NpossibleStates=3;
362 if(ProjQ2 != TargQ1) NpossibleStates++;
363 if(ProjQ2 != TargQ2) NpossibleStates++;
364 if(ProjQ2 != TargQ3) NpossibleStates++;
366 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
372 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
377 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
382 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
391 #ifdef debugFTFexictation
392 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
395 G4int aProjQ1 = std::abs( ProjQ1 );
396 G4int aProjQ2 = std::abs( ProjQ2 );
398 G4bool ProjExcited =
false;
407 if ( aProjQ1 == aProjQ2 )
415 if ( Ksi < 0.25 ) {NewProjCode = 331;}
420 if( Ksi < 0.5 ) {NewProjCode = 331;}
424 if ( aProjQ1 > aProjQ2 )
426 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
429 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
433 #ifdef debugFTFexictation
446 if ( aProjQ1 == 1 ) {Qquarks -= ProjQ1;}
447 else if( aProjQ1 == 2 ) {Qquarks += ProjQ1;}
448 else {Qquarks -= ProjQ1/aProjQ1;}
450 if ( aProjQ2 == 1 ) {Qquarks -= ProjQ2;}
451 else if( aProjQ2 == 2 ) {Qquarks += ProjQ2;}
452 else {Qquarks -= ProjQ2/aProjQ2;}
454 if( Qquarks < 0 ) NewProjCode *=(-1);
457 #ifdef debugFTFexictation
458 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
459 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
461 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
466 if(!TestParticle)
continue;
471 if(SqrtS-M0target < MminProjectile)
continue;
476 #ifdef debugFTFexictation
479 G4cout <<
"M0projectile projectile PDGMass " << M0projectile <<
" "
486 #ifdef debugFTFexictation
487 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 << G4endl
488 <<
"NewTargCode " << NewTargCode <<
G4endl;
491 if( TargQ1 != TargQ2 && TargQ1 != TargQ3 && TargQ2 != TargQ3 )
496 else if( TargQ1 == TargQ2 && TargQ1 == TargQ3 )
498 NewTargCode += 2; ProjExcited =
true;
501 {NewTargCode += 2; ProjExcited =
true;}
503 }
else if ( ! ProjExcited &&
505 SqrtS > M0projectile + DeltaMass ) {
511 if(!TestParticle)
continue;
513 #ifdef debugFTFexictation
519 if(SqrtS-MtestPr < MminTarget)
continue;
523 if(SqrtS > MtestPr+MtestTr)
break;
526 if(attempts >= 50)
return false;
537 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
538 else if (projectile->
GetStatus() != 0 ) {M0projectile = MtestPr;}
541 #ifdef debugFTFexictation
542 G4cout <<
"M0projectile After check " << M0projectile <<
G4endl;
545 M0projectile2 = M0projectile * M0projectile;
546 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
547 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
549 if ( MtestTr >= Ptarget.mag() ) {M0target = MtestTr;}
550 else if (target->
GetStatus() != 0 ) {M0target = MtestTr;}
562 M0target2 = M0target * M0target;
564 #ifdef debugFTFexictation
565 G4cout <<
"New targ M0 M0^2 " << M0target <<
" " << M0target2 <<
G4endl;
568 TargetDiffStateMinMass = M0target + 220.0*
MeV;
569 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
582 if ( Ksi < 0.333333 ) {
583 ProjExchangeQ = ProjQ1;
584 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
585 ProjExchangeQ = ProjQ2;
587 ProjExchangeQ = ProjQ3;
591 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
594 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
596 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
600 #ifdef debugFTFexictation
601 G4cout <<
"Exchange Qs Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
604 if ( Ksi < 0.333333 ) {
605 ProjQ1 = ProjExchangeQ;
606 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
607 ProjQ2 = ProjExchangeQ;
609 ProjQ3 = ProjExchangeQ;
614 if ( Ksi < 0.333333 ) {
615 TargExchangeQ = TargQ1;
616 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
617 TargExchangeQ = TargQ2;
619 TargExchangeQ = TargQ3;
622 ProjExchangeQ = ProjQ1; ProjQ1 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
625 ProjExchangeQ = ProjQ2; ProjQ2 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
627 ProjExchangeQ = ProjQ3; ProjQ3 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
631 if ( Ksi < 0.333333 ) {
632 TargQ1 = TargExchangeQ;
633 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
634 TargQ2 = TargExchangeQ;
636 TargQ3 = TargExchangeQ;
649 if ( ProjQ1 == ProjQ2 && ProjQ1 == ProjQ3 ) {
658 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > DeltaMass + M0target ) {
665 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
674 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > M0projectile + DeltaMass ) {
681 #ifdef debugFTFexictation
682 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
686 if ( absProjectilePDGcode == NewProjCode && absTargetPDGcode == NewTargCode ) {
716 if(!TestParticle)
continue;
720 if(SqrtS-M0target < MminProjectile)
continue;
726 if(!TestParticle)
continue;
730 if(SqrtS-MtestPr < MminTarget)
continue;
734 if(SqrtS > MtestPr+MtestTr)
break;
737 if(attempts >= 50)
return false;
739 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
740 else if (projectile->
GetStatus() != 0 ) {M0projectile = MtestPr;}
741 M0projectile2 = M0projectile * M0projectile;
742 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
743 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
745 if ( MtestTr >= Ptarget.mag() ) {M0target = MtestTr;}
746 else if (target->
GetStatus() != 0 ) {M0target = MtestTr;}
747 M0target2 = M0target * M0target;
748 TargetDiffStateMinMass = M0target + 220.0*
MeV;
749 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
756 if ( SqrtS < M0projectile + M0target )
return false;
758 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
759 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
761 #ifdef debugFTFexictation
762 G4cout <<
"At the end// NewProjCode " << NewProjCode << G4endl
763 <<
"At the end// NewTargCode " << NewTargCode << G4endl
764 <<
"M0pr M0tr SqS " << M0projectile <<
" " << M0target <<
" " << SqrtS << G4endl
765 <<
"M0pr2 M0tr2 SqS " << M0projectile2 <<
" " << M0target2 <<
" " << SqrtS << G4endl
766 <<
"PZcms2 after the change " << PZcms2 << G4endl <<
G4endl;
769 if ( PZcms2 < 0 )
return false;
774 PZcms = std::sqrt( PZcms2 );
775 Pprojectile.setPz( PZcms );
776 Pprojectile.setE( std::sqrt( M0projectile2 + PZcms2 ) );
777 Ptarget.setPz( -PZcms );
778 Ptarget.setE( std::sqrt( M0target2 + PZcms2 ) );
783 #ifdef debugFTFexictation
784 G4cout <<
"Proj Targ and Proj+Targ in CMS" << G4endl << Pprojectile << G4endl << Ptarget
785 << G4endl << Pprojectile + Ptarget <<
G4endl;
789 if((SqrtS < M0projectile + TargetDiffStateMinMass) ||
790 (SqrtS < ProjectileDiffStateMinMass + M0target) ||
791 (ProbOfDiffraction == 0.) ) ProbExc=0.;
795 #ifdef debugFTFexictation
796 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
799 Pprojectile.transform( toLab );
800 Ptarget.transform( toLab );
807 #ifdef debugFTFexictation
808 G4cout <<
"Result of el. scatt " << Result << G4endl <<
"Proj Targ and Proj+Targ in Lab"
818 #ifdef debugFTFexictation
824 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
825 if ( ProbOfDiffraction != 0.0 ) {
826 ProbProjectileDiffraction /= ProbOfDiffraction;
827 ProbTargetDiffraction /= ProbOfDiffraction;
832 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
834 #ifdef debugFTFexictation
835 G4cout <<
"Excitation --------------------" << G4endl
836 <<
"Proj M0 MdMin MndMin " << M0projectile <<
" " << ProjectileDiffStateMinMass <<
" "
837 << ProjectileNonDiffStateMinMass << G4endl
838 <<
"Targ M0 MdMin MndMin " << M0target <<
" " << TargetDiffStateMinMass <<
" "
839 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
840 <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
841 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
844 if ( ProbOfDiffraction != 0.0 ) {
845 ProbProjectileDiffraction /= ProbOfDiffraction;
847 ProbProjectileDiffraction = 0.0;
850 #ifdef debugFTFexictation
851 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
852 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
855 G4double ProjectileDiffStateMinMass2 =
sqr( ProjectileDiffStateMinMass );
856 G4double ProjectileNonDiffStateMinMass2 =
sqr( ProjectileNonDiffStateMinMass );
857 G4double TargetDiffStateMinMass2 =
sqr( TargetDiffStateMinMass );
858 G4double TargetNonDiffStateMinMass2 =
sqr( TargetNonDiffStateMinMass );
866 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
869 G4int whilecount = 0;
876 #ifdef debugFTFexictation
891 if ( whilecount > 1000 ) {
897 ProjMassT2 = ProjectileDiffStateMinMass2;
898 ProjMassT = ProjectileDiffStateMinMass;
899 TargMassT2 = M0target2;
900 TargMassT = M0target;
901 if ( SqrtS < ProjMassT + TargMassT )
return false;
903 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
904 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
906 if ( PZcms2 < 0 )
return false;
908 maxPtSquare = PZcms2;
913 ProjMassT2 = ProjectileDiffStateMinMass2 + Pt2;
914 ProjMassT = std::sqrt( ProjMassT2 );
915 TargMassT2 = M0target2 + Pt2;
916 TargMassT = std::sqrt( TargMassT2 );
917 if ( SqrtS < ProjMassT + TargMassT )
continue;
919 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
920 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
922 if ( PZcms2 < 0 )
continue;
924 PZcms = std::sqrt( PZcms2 );
925 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
926 PMinusMax = SqrtS - TargMassT;
928 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
930 TMinusNew = SqrtS - PMinusNew;
931 Qminus = Ptarget.minus() - TMinusNew;
932 TPlusNew = TargMassT2 / TMinusNew;
933 Qplus = Ptarget.plus() - TPlusNew;
934 Qmomentum.setPz( (Qplus - Qminus)/2 );
935 Qmomentum.setE( (Qplus + Qminus)/2 );
937 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileDiffStateMinMass2 );
948 #ifdef debugFTFexictation
963 if ( whilecount > 1000 ) {
969 ProjMassT2 = M0projectile2;
970 ProjMassT = M0projectile;
972 TargMassT2 = TargetDiffStateMinMass2;
973 TargMassT = TargetDiffStateMinMass;
975 if ( SqrtS < ProjMassT + TargMassT )
return false;
977 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
978 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
980 if ( PZcms2 < 0 )
return false;
982 maxPtSquare = PZcms2;
987 ProjMassT2 = M0projectile2 + Pt2;
988 ProjMassT = std::sqrt( ProjMassT2 );
989 TargMassT2 = TargetDiffStateMinMass2 + Pt2;
990 TargMassT = std::sqrt( TargMassT2 );
991 if ( SqrtS < ProjMassT + TargMassT )
continue;
993 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
994 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
996 if ( PZcms2 < 0 )
continue;
998 PZcms = std::sqrt( PZcms2 );
999 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1001 TPlusMax = SqrtS - ProjMassT;
1003 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1006 PPlusNew = SqrtS - TPlusNew;
1007 Qplus = PPlusNew - Pprojectile.plus();
1008 PMinusNew = ProjMassT2 / PPlusNew;
1009 Qminus = PMinusNew - Pprojectile.minus();
1010 Qmomentum.setPz( (Qplus - Qminus)/2 );
1011 Qmomentum.setE( (Qplus + Qminus)/2 );
1013 }
while ( ( Ptarget - Qmomentum ).mag2() < TargetDiffStateMinMass2 );
1026 #ifdef debugFTFexictation
1041 if ( whilecount > 1000 ) {
1047 ProjMassT2 = ProjectileNonDiffStateMinMass2;
1048 ProjMassT = ProjectileNonDiffStateMinMass;
1049 TargMassT2 = TargetNonDiffStateMinMass2;
1050 TargMassT = TargetNonDiffStateMinMass;
1051 if ( SqrtS < ProjMassT + TargMassT )
return false;
1053 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1054 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1056 if ( PZcms2 < 0 )
return false;
1058 maxPtSquare = PZcms2;
1063 ProjMassT2 = ProjectileNonDiffStateMinMass2 + Pt2;
1064 ProjMassT = std::sqrt( ProjMassT2 );
1065 TargMassT2 = TargetNonDiffStateMinMass2 + Pt2;
1066 TargMassT = std::sqrt( TargMassT2 );
1067 if ( SqrtS < ProjMassT + TargMassT )
continue;
1069 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1070 -2.0*S*ProjMassT2 - 2.0*S*TargMassT2 -2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1072 if ( PZcms2 < 0 )
continue;
1074 PZcms = std::sqrt( PZcms2 );
1075 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
1077 PMinusMax = SqrtS - TargMassT;
1079 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1081 TPlusMax = SqrtS - ProjMassT;
1095 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
1096 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1098 PMinusNew = ( PMinusMax - PMinusMin )*
G4UniformRand() + PMinusMin;
1099 TPlusNew = ( TPlusMax - TPlusMin )*
G4UniformRand() + TPlusMin;
1102 Qminus = PMinusNew - Pprojectile.minus();
1104 Qplus = -( TPlusNew - Ptarget.plus() );
1105 Qmomentum.setPz( (Qplus - Qminus)/2 );
1106 Qmomentum.setE( (Qplus + Qminus)/2 );
1108 #ifdef debugFTFexictation
1109 G4cout << ( Pprojectile + Qmomentum ).mag2() <<
" " << ProjectileNonDiffStateMinMass2
1110 << G4endl << ( Ptarget - Qmomentum ).mag2() <<
" "
1111 << TargetNonDiffStateMinMass2 <<
G4endl;
1116 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileNonDiffStateMinMass2 ||
1117 ( Ptarget - Qmomentum ).mag2() < TargetNonDiffStateMinMass2 ||
1118 ( Pprojectile + Qmomentum ).pz() < 0.);
1125 Pprojectile += Qmomentum;
1126 Ptarget -= Qmomentum;
1129 Pprojectile.transform( toLab );
1130 Ptarget.transform( toLab );
1150 #ifdef debugFTFexictation
1151 G4cout <<
"Mproj " << Pprojectile.mag() << G4endl <<
"Mtarg " << Ptarget.mag() <<
G4endl;
1184 if ( start == NULL ) {
1185 G4cout <<
" G4FTFModel::String() Error: No start parton found" <<
G4endl;
1186 FirstString = 0; SecondString = 0;
1191 if ( end == NULL ) {
1192 G4cout <<
" G4FTFModel::String() Error: No end parton found" <<
G4endl;
1193 FirstString = 0; SecondString = 0;
1214 if ( isProjectile ) {
1224 G4double Pt( 0.0 ), x1( 0.0 ), x3( 0.0 );
1246 if ( Pt > 500.0*
MeV ) {
1247 G4double Ymax =
G4Log( W/2.0/Pt + std::sqrt( W2/4.0/Pt/Pt - 1.0 ) );
1249 x1 = 1.0 - Pt/W *
G4Exp( Y );
1250 x3 = 1.0 - Pt/W *
G4Exp(-Y );
1254 if ( PDGcode_startQ < 3 ) Mass_startQ = 325.0*
MeV;
1255 if ( PDGcode_startQ == 3 ) Mass_startQ = 500.0*
MeV;
1256 if ( PDGcode_startQ == 4 ) Mass_startQ = 1600.0*
MeV;
1258 if ( PDGcode_endQ < 3 ) Mass_endQ = 325.0*
MeV;
1259 if ( PDGcode_endQ == 3 ) Mass_endQ = 500.0*
MeV;
1260 if ( PDGcode_endQ == 4 ) Mass_endQ = 1600.0*
MeV;
1262 G4double P2_1 = W2*x1*x1/4.0 - Mass_endQ*Mass_endQ;
1263 G4double P2_3 = W2*x3*x3/4.0 - Mass_startQ*Mass_startQ;
1265 if ( P2_1 <= 0.0 || P2_3 <= 0.0 ) {
1271 G4double CosT12 = ( P2_3 - P2_1 - P2_2 ) / (2.0*P_1*P_2);
1272 G4double CosT13 = ( P2_2 - P2_1 - P2_3 ) / (2.0*P_1*P_3);
1275 if ( std::abs( CosT12 ) > 1.0 || std::abs( CosT13 ) > 1.0 ) {
1279 Pt = P_2 * std::sqrt( 1.0 - CosT12*CosT12 );
1280 Pstart.setPx( -Pt ); Pstart.setPy( 0.0 ); Pstart.setPz( P_3*CosT13 );
1281 Pend.setPx( 0.0 ); Pend.setPy( 0.0 ); Pend.setPz( P_1 );
1282 Pkink.setPx( Pt ); Pkink.setPy( 0.0 ); Pkink.setPz( P_2*CosT12 );
1283 Pstart.setE( x3*W/2.0 );
1284 Pkink.setE( Pkink.vect().mag() );
1285 Pend.setE( x1*W/2.0 );
1288 if ( Pkink.getZ() > 0.0 ) {
1290 PkinkQ1 = XkQ*Pkink;
1292 PkinkQ1 = (1.0 - XkQ)*Pkink;
1296 PkinkQ1 = (1.0 - XkQ)*Pkink;
1298 PkinkQ1 = XkQ*Pkink;
1302 PkinkQ2 = Pkink - PkinkQ1;
1305 std::sqrt(
sqr(
sqr(x1) -
sqr(x3) ) +
sqr( 2.0*x1*x3*CosT13 ) );
1306 G4double Psi = std::acos( Cos2Psi );
1309 if ( isProjectile ) {
1310 Rotate.rotateY( Psi );
1312 Rotate.rotateY(
pi + Psi );
1336 std::vector< G4double > QuarkProbabilitiesAtGluonSplitUp =
1340 for (
unsigned int Iq = 0; Iq < 3; Iq++ ) {
1342 if ( Ksi > QuarkProbabilitiesAtGluonSplitUp[Iq] ) QuarkInGluon++;
1357 Pstart.transform( toLab ); start->
Set4Momentum( Pstart );
1358 PkinkQ1.transform( toLab );
1359 PkinkQ2.transform( toLab );
1367 G4int absPDGcode = 1500;
1374 if ( absPDGcode < 1000 ) {
1375 if ( isProjectile ) {
1409 if ( isProjectile ) {
1474 if ( Momentum > 0.0 ) {
1480 tmp.set( 0.0, 0.0, 1.0 );
1484 if ( isProjectile ) {
1485 Pstart1 *= (-1.0)*Minus/2.0;
1486 Pend1 *= (+1.0)*Plus /2.0;
1488 Pstart1 *= (+1.0)*Plus/ 2.0;
1489 Pend1 *= (-1.0)*Minus/2.0;
1491 Momentum = -Pstart1.mag();
1492 Pstart1.setT( Momentum );
1493 Momentum = -Pend1.mag();
1494 Pend1.setT( Momentum );
1509 <<
" generated string momenta: Diquark " << end->
Get4Momentum() <<
"mass : "
1511 << Pstart + Pend <<
G4endl <<
" Original "
1525 if ( Pmin <= 0.0 || range <= 0.0 ) {
1526 G4cout <<
" Pmin, range : " << Pmin <<
" , " << range <<
G4endl;
1528 "G4DiffractiveExcitation::ChooseP : Invalid arguments " );
1541 if ( AveragePt2 <= 0.0 ) {
1545 (
G4Exp( -maxPtSquare/AveragePt2 ) - 1.0 ) );
1549 return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
1557 const G4int maxNumberOfLoops = 10000;
1558 G4int loopCounter = 0;
1561 yf = z*z +
sqr(1.0 - z);
1563 ++loopCounter < maxNumberOfLoops );
1564 if ( loopCounter >= maxNumberOfLoops ) {
1565 z = 0.5*(zmin + zmax);
1574 G4int absIdPDG = std::abs( IdPDG );
1575 if(!((absIdPDG == 111)||(absIdPDG == 221)||(absIdPDG == 331)))
1577 Q1 = absIdPDG / 100;
1578 Q2 = (absIdPDG % 100) / 10;
1580 if ( IdPDG < 0 ) anti *= -1;
1587 else {Q1 = 2; Q2 = -2;}
1598 Q2 = (IdPDG % 1000) / 100;
1599 Q3 = (IdPDG % 100) / 10;
1612 }
else if ( Q3 > Q1 ) {
1622 G4int NewCode = Q1*1000 + Q2*100 + Q3*10 + 2;
1631 "G4DiffractiveExcitation copy contructor not meant to be called" );
1639 "G4DiffractiveExcitation = operator not meant to be called" );
1648 "G4DiffractiveExcitation == operator not meant to be called" );
1656 "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
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) 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
static const double twopi
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
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
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