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 )
137 PutOnMassShell =
true;
138 M0projectile = BrW.
SampleMass(projectile->GetDefinition(),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 )
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() );
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;
270 if(QeNoExc+QeExc+ProbProjectileDiffraction+ProbTargetDiffraction > 1.)
271 {QeNoExc=1.0-QeExc-ProbProjectileDiffraction-ProbTargetDiffraction;}
274 if ( QeExc + QeNoExc != 0.0 ) ProbExc = QeExc/(QeExc + QeNoExc);
280 G4double ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
282 #ifdef debugFTFexictation 283 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" " << ProbProjectileDiffraction
284 <<
" " << ProbTargetDiffraction << G4endl
285 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
292 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
293 ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
294 ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
299 #ifdef debugFTFexictation 300 G4cout <<
"Q exchange --------------------------" <<
G4endl;
303 G4int NewProjCode( 0 ), NewTargCode( 0 );
304 G4int ProjQ1( 0 ), ProjQ2( 0 ), ProjQ3( 0 );
307 if ( absProjectilePDGcode < 1000 ) {
310 UnpackBaryon( ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3 );
314 G4int TargQ1( 0 ), TargQ2( 0 ), TargQ3( 0 );
317 #ifdef debugFTFexictation 318 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 << G4endl
319 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
323 G4int ProjExchangeQ( 0 );
324 G4int TargExchangeQ( 0 );
326 if ( absProjectilePDGcode < 1000 )
331 ProjExchangeQ = ProjQ1;
333 G4int NpossibleStates=3;
336 if(ProjQ1 != TargQ1) NpossibleStates++;
337 if(ProjQ1 != TargQ2) NpossibleStates++;
338 if(ProjQ1 != TargQ3) NpossibleStates++;
340 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
347 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
352 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
357 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ1 = TargExchangeQ;}
367 ProjExchangeQ = ProjQ2;
369 G4int NpossibleStates=3;
372 if(ProjQ2 != TargQ1) NpossibleStates++;
373 if(ProjQ2 != TargQ2) NpossibleStates++;
374 if(ProjQ2 != TargQ3) NpossibleStates++;
376 G4int Nsampled = G4RandFlat::shootInt(
G4long( NpossibleStates ) ) + 1;
382 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
387 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
392 if(NpossibleStates == Nsampled) {TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ2 = TargExchangeQ;}
401 #ifdef debugFTFexictation 402 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
405 G4int aProjQ1 = std::abs( ProjQ1 );
406 G4int aProjQ2 = std::abs( ProjQ2 );
408 G4bool ProjExcited =
false;
417 if ( aProjQ1 == aProjQ2 )
425 if ( Ksi < 0.25 ) {NewProjCode = 331;}
430 if( Ksi < 0.5 ) {NewProjCode = 331;}
434 if ( aProjQ1 > aProjQ2 )
436 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
439 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
443 #ifdef debugFTFexictation 456 if ( aProjQ1 == 1 ) {Qquarks -= ProjQ1;}
457 else if( aProjQ1 == 2 ) {Qquarks += ProjQ1;}
458 else {Qquarks -= ProjQ1/aProjQ1;}
460 if ( aProjQ2 == 1 ) {Qquarks -= ProjQ2;}
461 else if( aProjQ2 == 2 ) {Qquarks += ProjQ2;}
462 else {Qquarks -= ProjQ2/aProjQ2;}
464 if( Qquarks < 0 ) NewProjCode *=(-1);
467 #ifdef debugFTFexictation 468 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
469 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
471 G4cout<<
"+++++++++++++++++++++++++++++++++++++++"<<
G4endl;
476 if(!TestParticle)
continue;
481 if(SqrtS-M0target < MminProjectile)
continue;
483 MtestPr = BrW.
SampleMass(TestParticle, TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth());
486 #ifdef debugFTFexictation 487 G4cout <<
"TestParticle Name " << NewProjCode <<
" " << TestParticle->GetParticleName()<<
G4endl;
488 G4cout <<
"MtestPart MtestPart0 "<<MtestPr<<
" "<<TestParticle->GetPDGMass()<<
G4endl;
489 G4cout <<
"M0projectile projectile PDGMass " << M0projectile <<
" " 490 << projectile->GetDefinition()->GetPDGMass() <<
G4endl;
496 #ifdef debugFTFexictation 497 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 << G4endl
498 <<
"NewTargCode " << NewTargCode <<
G4endl;
501 if( TargQ1 != TargQ2 && TargQ1 != TargQ3 && TargQ2 != TargQ3 )
506 else if( TargQ1 == TargQ2 && TargQ1 == TargQ3 )
508 NewTargCode += 2; ProjExcited =
true;
509 }
else if (
target->GetDefinition()->GetPDGiIsospin() == 3 ) {
511 {NewTargCode += 2; ProjExcited =
true;}
513 }
else if ( ! ProjExcited &&
515 SqrtS > M0projectile + DeltaMass ) {
521 if(!TestParticle)
continue;
523 #ifdef debugFTFexictation 524 G4cout <<
"New targ " << NewTargCode <<
" " << TestParticle->GetParticleName() <<
G4endl;
529 if(SqrtS-MtestPr < MminTarget)
continue;
531 MtestTr = BrW.
SampleMass(TestParticle,TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth());
533 if(SqrtS > MtestPr+MtestTr)
break;
536 if(attempts >= 50)
return false;
547 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
548 else if (projectile->GetStatus() != 0 ) {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() ) {M0target = MtestTr;}
560 else if (
target->GetStatus() != 0 ) {M0target = MtestTr;}
572 M0target2 = M0target * M0target;
574 #ifdef debugFTFexictation 575 G4cout <<
"New targ M0 M0^2 " << M0target <<
" " << M0target2 <<
G4endl;
578 TargetDiffStateMinMass = M0target + 220.0*
MeV;
579 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
592 if ( Ksi < 0.333333 ) {
593 ProjExchangeQ = ProjQ1;
594 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
595 ProjExchangeQ = ProjQ2;
597 ProjExchangeQ = ProjQ3;
601 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
604 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
606 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
610 #ifdef debugFTFexictation 611 G4cout <<
"Exchange Qs Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
614 if ( Ksi < 0.333333 ) {
615 ProjQ1 = ProjExchangeQ;
616 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
617 ProjQ2 = ProjExchangeQ;
619 ProjQ3 = ProjExchangeQ;
624 if ( Ksi < 0.333333 ) {
625 TargExchangeQ = TargQ1;
626 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
627 TargExchangeQ = TargQ2;
629 TargExchangeQ = TargQ3;
632 ProjExchangeQ = ProjQ1; ProjQ1 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
635 ProjExchangeQ = ProjQ2; ProjQ2 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
637 ProjExchangeQ = ProjQ3; ProjQ3 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
641 if ( Ksi < 0.333333 ) {
642 TargQ1 = TargExchangeQ;
643 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
644 TargQ2 = TargExchangeQ;
646 TargQ3 = TargExchangeQ;
659 if ( ProjQ1 == ProjQ2 && ProjQ1 == ProjQ3 ) {
661 }
else if ( projectile->GetDefinition()->GetPDGiIsospin() == 3 ) {
668 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > DeltaMass + M0target ) {
675 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
677 }
else if (
target->GetDefinition()->GetPDGiIsospin() == 3 ) {
684 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > M0projectile + DeltaMass ) {
691 #ifdef debugFTFexictation 692 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
696 if ( absProjectilePDGcode == NewProjCode && absTargetPDGcode == NewTargCode ) {
726 if(!TestParticle)
continue;
730 if(SqrtS-M0target < MminProjectile)
continue;
732 MtestPr = BrW.
SampleMass(TestParticle,TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth());
736 if(!TestParticle)
continue;
740 if(SqrtS-MtestPr < MminTarget)
continue;
742 MtestTr = BrW.
SampleMass(TestParticle,TestParticle->GetPDGMass() + 5.0*TestParticle->GetPDGWidth());
744 if(SqrtS > MtestPr+MtestTr)
break;
747 if(attempts >= 50)
return false;
749 if ( MtestPr >= Pprojectile.mag() ) {M0projectile = MtestPr;}
750 else if (projectile->GetStatus() != 0 ) {M0projectile = MtestPr;}
751 M0projectile2 = M0projectile * M0projectile;
752 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
753 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
755 if ( MtestTr >= Ptarget.mag() ) {M0target = MtestTr;}
756 else if (
target->GetStatus() != 0 ) {M0target = MtestTr;}
757 M0target2 = M0target * M0target;
758 TargetDiffStateMinMass = M0target + 220.0*
MeV;
759 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
766 if ( SqrtS < M0projectile + M0target )
return false;
768 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
769 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
771 #ifdef debugFTFexictation 772 G4cout <<
"At the end// NewProjCode " << NewProjCode << G4endl
773 <<
"At the end// NewTargCode " << NewTargCode << G4endl
774 <<
"M0pr M0tr SqS " << M0projectile <<
" " << M0target <<
" " << SqrtS << G4endl
775 <<
"M0pr2 M0tr2 SqS " << M0projectile2 <<
" " << M0target2 <<
" " << SqrtS << G4endl
776 <<
"PZcms2 after the change " << PZcms2 << G4endl <<
G4endl;
779 if ( PZcms2 < 0 )
return false;
784 PZcms = std::sqrt( PZcms2 );
785 Pprojectile.setPz( PZcms );
786 Pprojectile.setE( std::sqrt( M0projectile2 + PZcms2 ) );
787 Ptarget.setPz( -PZcms );
788 Ptarget.setE( std::sqrt( M0target2 + PZcms2 ) );
790 if(projectile->GetStatus() != 0 ) projectile->SetStatus(2);
793 #ifdef debugFTFexictation 794 G4cout <<
"Proj Targ and Proj+Targ in CMS" << G4endl << Pprojectile << G4endl << Ptarget
795 << G4endl << Pprojectile + Ptarget <<
G4endl;
799 if((SqrtS < M0projectile + TargetDiffStateMinMass) ||
800 (SqrtS < ProjectileDiffStateMinMass + M0target) ||
801 (ProbOfDiffraction == 0.) ) ProbExc=0.;
805 #ifdef debugFTFexictation 806 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
809 Pprojectile.transform( toLab );
810 Ptarget.transform( toLab );
812 projectile->Set4Momentum( Pprojectile );
813 target->Set4Momentum( Ptarget );
817 #ifdef debugFTFexictation 818 G4cout <<
"Result of el. scatt " << Result << G4endl <<
"Proj Targ and Proj+Targ in Lab" 819 << G4endl << projectile->Get4Momentum() << G4endl <<
target->Get4Momentum() << G4endl
820 << projectile->Get4Momentum() +
target->Get4Momentum() <<
" " << (projectile->Get4Momentum() +
target->Get4Momentum()).mag() <<
G4endl;
828 #ifdef debugFTFexictation 834 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
835 if ( ProbOfDiffraction != 0.0 ) {
836 ProbProjectileDiffraction /= ProbOfDiffraction;
837 ProbTargetDiffraction /= ProbOfDiffraction;
842 ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
844 #ifdef debugFTFexictation 845 G4cout <<
"Excitation --------------------" << G4endl
846 <<
"Proj M0 MdMin MndMin " << M0projectile <<
" " << ProjectileDiffStateMinMass <<
" " 847 << ProjectileNonDiffStateMinMass << G4endl
848 <<
"Targ M0 MdMin MndMin " << M0target <<
" " << TargetDiffStateMinMass <<
" " 849 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
850 <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" " 851 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
854 if ( ProbOfDiffraction != 0.0 ) {
855 ProbProjectileDiffraction /= ProbOfDiffraction;
857 ProbProjectileDiffraction = 0.0;
860 #ifdef debugFTFexictation 861 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" " 862 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
865 G4double ProjectileDiffStateMinMass2 =
sqr( ProjectileDiffStateMinMass );
866 G4double ProjectileNonDiffStateMinMass2 =
sqr( ProjectileNonDiffStateMinMass );
867 G4double TargetDiffStateMinMass2 =
sqr( TargetDiffStateMinMass );
868 G4double TargetNonDiffStateMinMass2 =
sqr( TargetNonDiffStateMinMass );
876 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
879 G4int whilecount = 0;
886 #ifdef debugFTFexictation 901 if ( whilecount > 1000 ) {
907 ProjMassT2 = ProjectileDiffStateMinMass2;
908 ProjMassT = ProjectileDiffStateMinMass;
909 TargMassT2 = M0target2;
910 TargMassT = M0target;
911 if ( SqrtS < ProjMassT + TargMassT )
return false;
913 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
914 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
916 if ( PZcms2 < 0 )
return false;
918 maxPtSquare = PZcms2;
923 ProjMassT2 = ProjectileDiffStateMinMass2 + Pt2;
924 ProjMassT = std::sqrt( ProjMassT2 );
925 TargMassT2 = M0target2 + Pt2;
926 TargMassT = std::sqrt( TargMassT2 );
927 if ( SqrtS < ProjMassT + TargMassT )
continue;
929 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
930 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
932 if ( PZcms2 < 0 )
continue;
934 PZcms = std::sqrt( PZcms2 );
935 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
936 PMinusMax = SqrtS - TargMassT;
939 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
941 TMinusNew = SqrtS - PMinusNew;
942 Qminus = Ptarget.minus() - TMinusNew;
943 TPlusNew = TargMassT2 / TMinusNew;
944 Qplus = Ptarget.plus() - TPlusNew;
945 Qmomentum.
setPz( (Qplus - Qminus)/2 );
946 Qmomentum.
setE( (Qplus + Qminus)/2 );
948 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileDiffStateMinMass2 );
953 if(projectile->GetStatus() == 2) projectile->SetStatus(1);
954 if((
target->GetStatus() == 1) && (
target->GetSoftCollisionCount() == 0))
959 #ifdef debugFTFexictation 974 if ( whilecount > 1000 ) {
980 ProjMassT2 = M0projectile2;
981 ProjMassT = M0projectile;
983 TargMassT2 = TargetDiffStateMinMass2;
984 TargMassT = TargetDiffStateMinMass;
986 if ( SqrtS < ProjMassT + TargMassT )
return false;
988 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
989 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
991 if ( PZcms2 < 0 )
return false;
993 maxPtSquare = PZcms2;
998 ProjMassT2 = M0projectile2 + Pt2;
999 ProjMassT = std::sqrt( ProjMassT2 );
1000 TargMassT2 = TargetDiffStateMinMass2 + Pt2;
1001 TargMassT = std::sqrt( TargMassT2 );
1002 if ( SqrtS < ProjMassT + TargMassT )
continue;
1004 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1005 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1007 if ( PZcms2 < 0 )
continue;
1009 PZcms = std::sqrt( PZcms2 );
1010 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1012 TPlusMax = SqrtS - ProjMassT;
1014 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1017 PPlusNew = SqrtS - TPlusNew;
1018 Qplus = PPlusNew - Pprojectile.plus();
1019 PMinusNew = ProjMassT2 / PPlusNew;
1020 Qminus = PMinusNew - Pprojectile.minus();
1021 Qmomentum.
setPz( (Qplus - Qminus)/2 );
1022 Qmomentum.
setE( (Qplus + Qminus)/2 );
1024 }
while ( ( Ptarget - Qmomentum ).mag2() < TargetDiffStateMinMass2 );
1029 if((projectile->GetStatus() == 1) && (projectile->GetSoftCollisionCount() == 0))
1030 projectile->SetStatus(2);
1037 #ifdef debugFTFexictation 1052 if ( whilecount > 1000 ) {
1058 ProjMassT2 = ProjectileNonDiffStateMinMass2;
1059 ProjMassT = ProjectileNonDiffStateMinMass;
1060 TargMassT2 = TargetNonDiffStateMinMass2;
1061 TargMassT = TargetNonDiffStateMinMass;
1062 if ( SqrtS < ProjMassT + TargMassT )
return false;
1064 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1065 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1067 if ( PZcms2 < 0 )
return false;
1069 maxPtSquare = PZcms2;
1074 ProjMassT2 = ProjectileNonDiffStateMinMass2 + Pt2;
1075 ProjMassT = std::sqrt( ProjMassT2 );
1076 TargMassT2 = TargetNonDiffStateMinMass2 + Pt2;
1077 TargMassT = std::sqrt( TargMassT2 );
1078 if ( SqrtS < ProjMassT + TargMassT )
continue;
1080 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
1081 -2.0*S*ProjMassT2 - 2.0*S*TargMassT2 -2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
1083 if ( PZcms2 < 0 )
continue;
1085 PZcms = std::sqrt( PZcms2 );
1086 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
1088 PMinusMax = SqrtS - TargMassT;
1090 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
1092 TPlusMax = SqrtS - ProjMassT;
1106 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
1107 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
1109 PMinusNew = ( PMinusMax - PMinusMin )*
G4UniformRand() + PMinusMin;
1110 TPlusNew = ( TPlusMax - TPlusMin )*
G4UniformRand() + TPlusMin;
1113 Qminus = PMinusNew - Pprojectile.minus();
1115 Qplus = -( TPlusNew - Ptarget.plus() );
1116 Qmomentum.
setPz( (Qplus - Qminus)/2 );
1117 Qmomentum.
setE( (Qplus + Qminus)/2 );
1119 #ifdef debugFTFexictation 1120 G4cout << ( Pprojectile + Qmomentum ).mag2() <<
" " << ProjectileNonDiffStateMinMass2
1121 << G4endl << ( Ptarget - Qmomentum ).mag2() <<
" " 1122 << TargetNonDiffStateMinMass2 <<
G4endl;
1127 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileNonDiffStateMinMass2 ||
1128 ( Ptarget - Qmomentum ).mag2() < TargetNonDiffStateMinMass2 ||
1129 ( Pprojectile + Qmomentum ).pz() < 0.);
1131 projectile->SetStatus( 0*projectile->GetStatus() );
1136 Pprojectile += Qmomentum;
1137 Ptarget -= Qmomentum;
1161 #ifdef debugFTFexictation 1162 G4cout <<
"Mproj " << Pprojectile.mag() << G4endl <<
"Mtarg " << Ptarget.mag() <<
G4endl;
1165 projectile->Set4Momentum( Pprojectile );
1166 target->Set4Momentum( Ptarget );
1167 projectile->IncrementCollisionCount( 1 );
1168 target->IncrementCollisionCount( 1 );
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4double ChooseP(G4double Pmin, G4double Pmax) const
G4double GetProjMinDiffMass()
CLHEP::Hep3Vector G4ThreeVector
void UnpackBaryon(G4int IdPDG, G4int &Q1, G4int &Q2, G4int &Q3) const
G4double GetProbLogDistr()
G4double GetTarMinDiffMass()
HepLorentzVector & rotateZ(double)
G4double SampleMass(const G4double poleMass, const G4double gamma, const G4double minMass, const G4double maxMass) const
G4GLOB_DLL std::ostream G4cout
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4double GetMinimumMass(const G4ParticleDefinition *p) const
HepLorentzRotation & transform(const HepBoost &b)
G4double GetProcProb(const G4int ProcN, const G4double y)
G4double GetTarMinNonDiffMass()
static G4ParticleTable * GetParticleTable()
G4double GetPDGMass() const
Hep3Vector boostVector() const
cout<< "-> Edep in the target
HepLorentzVector & rotateY(double)
G4double GetDeltaProbAtQuarkExchange()
G4double GetProbOfSameQuarkExchange()
HepLorentzVector & transform(const HepRotation &)
G4int NewNucleonId(G4int Q1, G4int Q2, G4int Q3) const
G4double GetProjMinNonDiffMass()
virtual G4bool ElasticScattering(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters) const
void UnpackMeson(G4int IdPDG, G4int &Q1, G4int &Q2) const
CLHEP::HepLorentzVector G4LorentzVector