99 #ifdef debugFTFexictation
105 if ( Pprojectile.
z() < 0.0 )
return false;
107 G4int ProjectilePDGcode = projectile->GetDefinition()->GetPDGEncoding();
108 G4int absProjectilePDGcode = std::abs( ProjectilePDGcode );
114 G4int TargetPDGcode =
target->GetDefinition()->GetPDGEncoding();
115 G4int absTargetPDGcode = std::abs( TargetPDGcode );
128 G4bool PutOnMassShell(
false );
135 if ( M0projectile < MminProjectile ) {
136 PutOnMassShell =
true;
137 M0projectile = BrW.
SampleMass( projectile->GetDefinition(),
138 projectile->GetDefinition()->GetPDGMass() + 5.0*projectile->GetDefinition()->GetPDGWidth() );
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 ) {
156 PutOnMassShell =
true;
158 target->GetDefinition()->GetPDGMass() + 5.0*
target->GetDefinition()->GetPDGWidth() );
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() );
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;
268 if ( QeNoExc + QeExc + ProbProjectileDiffraction + ProbTargetDiffraction > 1.0 ) {
269 QeNoExc = 1.0 - QeExc - ProbProjectileDiffraction - ProbTargetDiffraction;
273 if ( QeExc + QeNoExc != 0.0 ) ProbExc = QeExc/(QeExc + QeNoExc);
279 G4double ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
281 #ifdef debugFTFexictation
282 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" " << ProbProjectileDiffraction
283 <<
" " << ProbTargetDiffraction << G4endl
284 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
289 G4double MtestPr( 0.0 ), MtestTr( 0.0 );
291 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
292 ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
293 ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
298 #ifdef debugFTFexictation
299 G4cout <<
"Q exchange --------------------------" <<
G4endl;
302 G4int NewProjCode( 0 ), NewTargCode( 0 );
303 G4int ProjQ1( 0 ), ProjQ2( 0 ), ProjQ3( 0 );
306 if ( absProjectilePDGcode < 1000 ) {
307 UnpackMeson( ProjectilePDGcode, ProjQ1, ProjQ2 );
309 UnpackBaryon( ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3 );
313 G4int TargQ1( 0 ), TargQ2( 0 ), TargQ3( 0 );
314 UnpackBaryon( TargetPDGcode, TargQ1, TargQ2, TargQ3 );
316 #ifdef debugFTFexictation
317 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 << G4endl
318 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
322 G4int ProjExchangeQ( 0 );
323 G4int TargExchangeQ( 0 );
325 if ( absProjectilePDGcode < 1000 ) {
328 ProjExchangeQ = ProjQ1;
330 G4int NpossibleStates = 3;
332 if ( ProjQ1 != TargQ1 ) NpossibleStates++;
333 if ( ProjQ1 != TargQ2 ) NpossibleStates++;
334 if ( ProjQ1 != TargQ3 ) NpossibleStates++;
336 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
340 if ( ProjQ1 != TargQ1 ) {
342 if ( NpossibleStates == Nsampled ) {
343 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
346 if ( ProjQ1 != TargQ2 ) {
348 if ( NpossibleStates == Nsampled ) {
349 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
352 if ( ProjQ1 != TargQ3 ) {
354 if ( NpossibleStates == Nsampled ) {
355 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
364 ProjExchangeQ = ProjQ2;
366 G4int NpossibleStates = 3;
368 if ( ProjQ2 != TargQ1 ) NpossibleStates++;
369 if ( ProjQ2 != TargQ2 ) NpossibleStates++;
370 if ( ProjQ2 != TargQ3 ) NpossibleStates++;
372 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
375 if ( ProjQ2 != TargQ1 ) {
377 if ( NpossibleStates == Nsampled ) {
378 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
381 if ( ProjQ2 != TargQ2 ) {
383 if ( NpossibleStates == Nsampled ) {
384 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
387 if ( ProjQ2 != TargQ3 ) {
389 if ( NpossibleStates == Nsampled ) {
390 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
400 #ifdef debugFTFexictation
401 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
404 G4int aProjQ1 = std::abs( ProjQ1 );
405 G4int aProjQ2 = std::abs( ProjQ2 );
407 G4bool ProjExcited =
false;
410 while ( attempts < 50 ) {
414 if ( aProjQ1 == aProjQ2 ) {
415 if ( aProjQ1 != 3 ) {
430 if ( aProjQ1 > aProjQ2 ) {
431 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
433 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
437 #ifdef debugFTFexictation
448 if ( aProjQ1 == 1 ) { Qquarks -= ProjQ1; }
449 else if ( aProjQ1 == 2 ) { Qquarks += ProjQ1; }
450 else { Qquarks -= ProjQ1/aProjQ1; }
452 if ( aProjQ2 == 1 ) { Qquarks -= ProjQ2; }
453 else if ( aProjQ2 == 2 ) { Qquarks += ProjQ2; }
454 else { Qquarks -= ProjQ2/aProjQ2; }
456 if ( Qquarks < 0 ) NewProjCode *= -1;
458 #ifdef debugFTFexictation
459 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
460 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
462 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
467 if ( ! TestParticle )
continue;
472 if ( SqrtS - M0target < MminProjectile )
continue;
475 TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth() );
478 #ifdef debugFTFexictation
479 G4cout <<
"TestParticle Name " << NewProjCode <<
" " << TestParticle->GetParticleName()<<
G4endl;
480 G4cout <<
"MtestPart MtestPart0 "<<MtestPr<<
" "<<TestParticle->GetPDGMass()<<
G4endl;
481 G4cout <<
"M0projectile projectile PDGMass " << M0projectile <<
" "
482 << projectile->GetDefinition()->GetPDGMass() <<
G4endl;
486 NewTargCode = NewNucleonId( TargQ1, TargQ2, TargQ3 );
488 #ifdef debugFTFexictation
489 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 << G4endl
490 <<
"NewTargCode " << NewTargCode <<
G4endl;
493 if ( TargQ1 != TargQ2 && TargQ1 != TargQ3 && TargQ2 != TargQ3 ) {
499 }
else if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
500 NewTargCode += 2; ProjExcited =
true;
501 }
else if (
target->GetDefinition()->GetPDGiIsospin() == 3 ) {
503 NewTargCode += 2; ProjExcited =
true;
506 }
else if ( ! ProjExcited &&
508 SqrtS > M0projectile + DeltaMass ) {
515 if ( ! TestParticle )
continue;
517 #ifdef debugFTFexictation
518 G4cout <<
"New targ " << NewTargCode <<
" " << TestParticle->GetParticleName() <<
G4endl;
523 if ( SqrtS - MtestPr < MminTarget )
continue;
526 TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth() );
528 if ( SqrtS > MtestPr + MtestTr )
break;
532 if ( attempts >= 50 )
return false;
545 if ( MtestPr >= Pprojectile.mag() ) {
546 M0projectile = MtestPr;
547 }
else if ( projectile->GetStatus() != 0 ) {
548 M0projectile = MtestPr;
551 #ifdef debugFTFexictation
552 G4cout <<
"M0projectile After check " << M0projectile <<
G4endl;
555 M0projectile2 = M0projectile * M0projectile;
556 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
557 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
559 if ( MtestTr >= Ptarget.mag() ) {
561 }
else if (
target->GetStatus() != 0 ) {
577 M0target2 = M0target * M0target;
579 #ifdef debugFTFexictation
580 G4cout <<
"New targ M0 M0^2 " << M0target <<
" " << M0target2 <<
G4endl;
583 TargetDiffStateMinMass = M0target + 220.0*
MeV;
584 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
597 if ( Ksi < 0.333333 ) {
598 ProjExchangeQ = ProjQ1;
599 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
600 ProjExchangeQ = ProjQ2;
602 ProjExchangeQ = ProjQ3;
606 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
609 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
611 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
615 #ifdef debugFTFexictation
616 G4cout <<
"Exchange Qs Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
619 if ( Ksi < 0.333333 ) {
620 ProjQ1 = ProjExchangeQ;
621 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
622 ProjQ2 = ProjExchangeQ;
624 ProjQ3 = ProjExchangeQ;
629 if ( Ksi < 0.333333 ) {
630 TargExchangeQ = TargQ1;
631 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
632 TargExchangeQ = TargQ2;
634 TargExchangeQ = TargQ3;
637 ProjExchangeQ = ProjQ1; ProjQ1 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
640 ProjExchangeQ = ProjQ2; ProjQ2 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
642 ProjExchangeQ = ProjQ3; ProjQ3 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
646 if ( Ksi < 0.333333 ) {
647 TargQ1 = TargExchangeQ;
648 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
649 TargQ2 = TargExchangeQ;
651 TargQ3 = TargExchangeQ;
656 NewProjCode = NewNucleonId( ProjQ1, ProjQ2, ProjQ3 );
657 NewTargCode = NewNucleonId( TargQ1, TargQ2, TargQ3 );
660 while ( attempts < 50 ) {
664 if ( ProjQ1 == ProjQ2 && ProjQ1 == ProjQ3 ) {
666 }
else if ( projectile->GetDefinition()->GetPDGiIsospin() == 3 ) {
673 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > DeltaMass + M0target ) {
680 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
682 }
else if (
target->GetDefinition()->GetPDGiIsospin() == 3 ) {
689 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > M0projectile + DeltaMass ) {
696 #ifdef debugFTFexictation
697 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
701 if ( absProjectilePDGcode == NewProjCode && absTargetPDGcode == NewTargCode ) {
731 if ( ! TestParticle )
continue;
735 if ( SqrtS - M0target < MminProjectile )
continue;
738 TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth() );
742 if ( ! TestParticle )
continue;
746 if ( SqrtS - MtestPr < MminTarget )
continue;
749 TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth() );
751 if ( SqrtS > MtestPr + MtestTr )
break;
754 if ( attempts >= 50 )
return false;
756 if ( MtestPr >= Pprojectile.mag() ) {
757 M0projectile = MtestPr;
758 }
else if ( projectile->GetStatus() != 0 ) {
759 M0projectile = MtestPr;
761 M0projectile2 = M0projectile * M0projectile;
762 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
763 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
765 if ( MtestTr >= Ptarget.mag() ) {
767 }
else if (
target->GetStatus() != 0 ) {
770 M0target2 = M0target * M0target;
771 TargetDiffStateMinMass = M0target + 220.0*
MeV;
772 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
778 if ( SqrtS < M0projectile + M0target )
return false;
780 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
781 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
783 #ifdef debugFTFexictation
784 G4cout <<
"At the end// NewProjCode " << NewProjCode << G4endl
785 <<
"At the end// NewTargCode " << NewTargCode << G4endl
786 <<
"M0pr M0tr SqS " << M0projectile <<
" " << M0target <<
" " << SqrtS << G4endl
787 <<
"M0pr2 M0tr2 SqS " << M0projectile2 <<
" " << M0target2 <<
" " << SqrtS << G4endl
788 <<
"PZcms2 after the change " << PZcms2 << G4endl <<
G4endl;
791 if ( PZcms2 < 0 )
return false;
796 PZcms = std::sqrt( PZcms2 );
797 Pprojectile.setPz( PZcms );
798 Pprojectile.setE( std::sqrt( M0projectile2 + PZcms2 ) );
799 Ptarget.setPz( -PZcms );
800 Ptarget.setE( std::sqrt( M0target2 + PZcms2 ) );
802 if ( projectile->GetStatus() != 0 ) projectile->SetStatus( 2 );
805 #ifdef debugFTFexictation
806 G4cout <<
"Proj Targ and Proj+Targ in CMS" << G4endl << Pprojectile << G4endl << Ptarget
807 << G4endl << Pprojectile + Ptarget <<
G4endl;
811 if ( SqrtS < M0projectile + TargetDiffStateMinMass ||
812 SqrtS < ProjectileDiffStateMinMass + M0target ||
813 ProbOfDiffraction == 0.0 ) ProbExc = 0.0;
817 #ifdef debugFTFexictation
818 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
821 Pprojectile.transform( toLab );
822 Ptarget.transform( toLab );
824 projectile->Set4Momentum( Pprojectile );
825 target->Set4Momentum( Ptarget );
829 #ifdef debugFTFexictation
830 G4cout <<
"Result of el. scatt " << Result << G4endl <<
"Proj Targ and Proj+Targ in Lab"
831 << G4endl << projectile->Get4Momentum() << G4endl <<
target->Get4Momentum() << G4endl
832 << projectile->Get4Momentum() +
target->Get4Momentum() <<
" " << (projectile->Get4Momentum() +
target->Get4Momentum()).mag() <<
G4endl;
840 #ifdef debugFTFexictation
846 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
847 if ( ProbOfDiffraction != 0.0 ) {
848 ProbProjectileDiffraction /= ProbOfDiffraction;
849 ProbTargetDiffraction /= ProbOfDiffraction;
855 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
857 #ifdef debugFTFexictation
858 G4cout <<
"Excitation --------------------" << G4endl
859 <<
"Proj M0 MdMin MndMin " << M0projectile <<
" " << ProjectileDiffStateMinMass <<
" "
860 << ProjectileNonDiffStateMinMass << G4endl
861 <<
"Targ M0 MdMin MndMin " << M0target <<
" " << TargetDiffStateMinMass <<
" "
862 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
863 <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
864 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
867 if ( ProbOfDiffraction != 0.0 ) {
868 ProbProjectileDiffraction /= ProbOfDiffraction;
870 ProbProjectileDiffraction = 0.0;
873 #ifdef debugFTFexictation
874 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
875 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
878 G4double ProjectileDiffStateMinMass2 =
sqr( ProjectileDiffStateMinMass );
879 G4double ProjectileNonDiffStateMinMass2 =
sqr( ProjectileNonDiffStateMinMass );
880 G4double TargetDiffStateMinMass2 =
sqr( TargetDiffStateMinMass );
881 G4double TargetNonDiffStateMinMass2 =
sqr( TargetNonDiffStateMinMass );
889 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
892 G4int whilecount = 0;
899 #ifdef debugFTFexictation
914 if ( whilecount > 1000 ) {
920 ProjMassT2 = ProjectileDiffStateMinMass2;
921 ProjMassT = ProjectileDiffStateMinMass;
922 TargMassT2 = M0target2;
923 TargMassT = M0target;
924 if ( SqrtS < ProjMassT + TargMassT )
return false;
926 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
927 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
929 if ( PZcms2 < 0 )
return false;
931 maxPtSquare = PZcms2;
933 Qmomentum =
G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0 );
936 ProjMassT2 = ProjectileDiffStateMinMass2 + Pt2;
937 ProjMassT = std::sqrt( ProjMassT2 );
938 TargMassT2 = M0target2 + Pt2;
939 TargMassT = std::sqrt( TargMassT2 );
940 if ( SqrtS < ProjMassT + TargMassT )
continue;
942 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
943 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
945 if ( PZcms2 < 0 )
continue;
947 PZcms = std::sqrt( PZcms2 );
948 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
949 PMinusMax = SqrtS - TargMassT;
952 PMinusNew = ChooseP( PMinusMin, PMinusMax );
954 TMinusNew = SqrtS - PMinusNew;
955 Qminus = Ptarget.minus() - TMinusNew;
956 TPlusNew = TargMassT2 / TMinusNew;
957 Qplus = Ptarget.plus() - TPlusNew;
958 Qmomentum.
setPz( (Qplus - Qminus)/2 );
959 Qmomentum.
setE( (Qplus + Qminus)/2 );
961 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileDiffStateMinMass2 );
966 if ( projectile->GetStatus() == 2 ) projectile->SetStatus( 1 );
967 if (
target->GetStatus() == 1 &&
target->GetSoftCollisionCount() == 0 )
target->SetStatus( 2 );
971 #ifdef debugFTFexictation
986 if ( whilecount > 1000 ) {
992 ProjMassT2 = M0projectile2;
993 ProjMassT = M0projectile;
995 TargMassT2 = TargetDiffStateMinMass2;
996 TargMassT = TargetDiffStateMinMass;
998 if ( SqrtS < ProjMassT + TargMassT )
return false;
1000 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1001 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1003 if ( PZcms2 < 0 )
return false;
1005 maxPtSquare = PZcms2;
1007 Qmomentum =
G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0 );
1010 ProjMassT2 = M0projectile2 + Pt2;
1011 ProjMassT = std::sqrt( ProjMassT2 );
1012 TargMassT2 = TargetDiffStateMinMass2 + Pt2;
1013 TargMassT = std::sqrt( TargMassT2 );
1014 if ( SqrtS < ProjMassT + TargMassT )
continue;
1016 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1017 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1019 if ( PZcms2 < 0 )
continue;
1021 PZcms = std::sqrt( PZcms2 );
1022 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1024 TPlusMax = SqrtS - ProjMassT;
1026 TPlusNew = ChooseP( TPlusMin, TPlusMax );
1029 PPlusNew = SqrtS - TPlusNew;
1030 Qplus = PPlusNew - Pprojectile.plus();
1031 PMinusNew = ProjMassT2 / PPlusNew;
1032 Qminus = PMinusNew - Pprojectile.minus();
1033 Qmomentum.
setPz( (Qplus - Qminus)/2 );
1034 Qmomentum.
setE( (Qplus + Qminus)/2 );
1036 }
while ( ( Ptarget - Qmomentum ).mag2() < TargetDiffStateMinMass2 );
1041 if ( projectile->GetStatus() == 1 && projectile->GetSoftCollisionCount() == 0 ) projectile->SetStatus( 2 );
1042 if (
target->GetStatus() == 2 )
target->SetStatus( 1 );
1048 #ifdef debugFTFexictation
1063 if ( whilecount > 1000 ) {
1069 ProjMassT2 = ProjectileNonDiffStateMinMass2;
1070 ProjMassT = ProjectileNonDiffStateMinMass;
1071 TargMassT2 = TargetNonDiffStateMinMass2;
1072 TargMassT = TargetNonDiffStateMinMass;
1073 if ( SqrtS < ProjMassT + TargMassT )
return false;
1075 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1076 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1078 if ( PZcms2 < 0 )
return false;
1080 maxPtSquare = PZcms2;
1082 Qmomentum =
G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0 );
1085 ProjMassT2 = ProjectileNonDiffStateMinMass2 + Pt2;
1086 ProjMassT = std::sqrt( ProjMassT2 );
1087 TargMassT2 = TargetNonDiffStateMinMass2 + Pt2;
1088 TargMassT = std::sqrt( TargMassT2 );
1089 if ( SqrtS < ProjMassT + TargMassT )
continue;
1091 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1092 -2.0*S*ProjMassT2 - 2.0*S*TargMassT2 -2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1094 if ( PZcms2 < 0 )
continue;
1096 PZcms = std::sqrt( PZcms2 );
1097 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
1099 PMinusMax = SqrtS - TargMassT;
1101 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1103 TPlusMax = SqrtS - ProjMassT;
1117 PMinusNew = ChooseP( PMinusMin, PMinusMax );
1118 TPlusNew = ChooseP( TPlusMin, TPlusMax );
1120 PMinusNew = ( PMinusMax - PMinusMin )*
G4UniformRand() + PMinusMin;
1121 TPlusNew = ( TPlusMax - TPlusMin )*
G4UniformRand() + TPlusMin;
1124 Qminus = PMinusNew - Pprojectile.minus();
1126 Qplus = -( TPlusNew - Ptarget.plus() );
1127 Qmomentum.
setPz( (Qplus - Qminus)/2 );
1128 Qmomentum.
setE( (Qplus + Qminus)/2 );
1130 #ifdef debugFTFexictation
1131 G4cout << ( Pprojectile + Qmomentum ).mag2() <<
" " << ProjectileNonDiffStateMinMass2
1132 << G4endl << ( Ptarget - Qmomentum ).mag2() <<
" "
1133 << TargetNonDiffStateMinMass2 <<
G4endl;
1138 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileNonDiffStateMinMass2 ||
1139 ( Ptarget - Qmomentum ).mag2() < TargetNonDiffStateMinMass2 ||
1140 ( Pprojectile + Qmomentum ).pz() < 0.);
1142 projectile->SetStatus( 0*projectile->GetStatus() );
1147 Pprojectile += Qmomentum;
1148 Ptarget -= Qmomentum;
1172 #ifdef debugFTFexictation
1173 G4cout <<
"Mproj " << Pprojectile.mag() << G4endl <<
"Mtarg " << Ptarget.mag() <<
G4endl;
1176 projectile->Set4Momentum( Pprojectile );
1177 target->Set4Momentum( Ptarget );
1178 projectile->IncrementCollisionCount( 1 );
1179 target->IncrementCollisionCount( 1 );
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
Hep3Vector boostVector() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4double GetProjMinDiffMass()
CLHEP::Hep3Vector G4ThreeVector
G4double GetProbLogDistr()
G4double GetTarMinDiffMass()
HepLorentzVector & rotateZ(double)
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & transform(const HepBoost &b)
G4double GetProcProb(const G4int ProcN, const G4double y)
G4double GetMinimumMass(const G4ParticleDefinition *p) const
G4double GetPDGMass() const
G4double GetTarMinNonDiffMass()
static G4ParticleTable * GetParticleTable()
HepLorentzVector & rotateY(double)
G4double GetDeltaProbAtQuarkExchange()
G4double GetProbOfSameQuarkExchange()
static constexpr double MeV
HepLorentzVector & transform(const HepRotation &)
G4double GetProjMinNonDiffMass()
CLHEP::HepLorentzVector G4LorentzVector