93 #ifdef debugFTFexictation
99 if ( Pprojectile.z() < 0.0 )
return false;
101 G4double ProjectileRapidity = Pprojectile.rapidity();
103 G4int absProjectilePDGcode = std::abs( ProjectilePDGcode );
105 G4bool PutOnMassShell(
false );
107 G4double M0projectile = Pprojectile.mag();
108 if ( M0projectile < projectile->GetDefinition()->GetPDGMass() ) {
109 PutOnMassShell =
true;
112 G4double M0projectile2 = M0projectile * M0projectile;
113 G4double ProjectileDiffStateMinMass( 0.0 ), ProjectileNonDiffStateMinMass( 0.0 );
115 ProjectileDiffStateMinMass = M0projectile + 220.0*
MeV;
116 ProjectileNonDiffStateMinMass = M0projectile + 220.0*
MeV;
124 G4int absTargetPDGcode = std::abs( TargetPDGcode );
129 #ifdef debugFTFexictation
130 G4cout <<
"Proj Targ PDGcodes " << ProjectilePDGcode <<
" " << TargetPDGcode << G4endl
131 <<
"M0projectile Y " << M0projectile <<
" " << ProjectileRapidity <<
G4endl;
133 G4cout <<
"Pproj " << Pprojectile << G4endl <<
"Ptarget " << Ptarget <<
G4endl;
136 if ( M0target < target->GetDefinition()->GetPDGMass() ) {
137 PutOnMassShell =
true;
140 G4double M0target2 = M0target * M0target;
141 G4double TargetDiffStateMinMass( 0.0 ), TargetNonDiffStateMinMass( 0.0 );
143 TargetDiffStateMinMass = M0target + 220.0*
MeV;
144 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
152 G4double SumMasses = M0projectile + M0target + 220.0*
MeV;
163 if ( Ptmp.pz() <= 0.0 )
return false;
165 toCms.rotateZ( -1*Ptmp.phi() );
166 toCms.rotateY( -1*Ptmp.theta() );
168 Pprojectile.transform( toCms );
169 Ptarget.transform( toCms );
174 #ifdef debugFTFexictation
175 G4cout <<
"SqrtS " << SqrtS << G4endl <<
"M0pr M0tr SumM+220 " << M0projectile <<
" "
176 << M0target <<
" " << SumMasses <<
G4endl;
179 if ( SqrtS < M0projectile + M0target )
return false;
180 if ( SqrtS < SumMasses )
return false;
183 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
184 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
186 #ifdef debugFTFexictation
187 G4cout <<
"PZcms2 after PutOnMassShell " << PZcms2 <<
G4endl;
190 if ( PZcms2 < 0 )
return false;
193 PZcms = std::sqrt( PZcms2 );
194 if ( PutOnMassShell ) {
195 if ( Pprojectile.z() > 0.0 ) {
196 Pprojectile.setPz( PZcms );
197 Ptarget.setPz( -PZcms );
199 Pprojectile.setPz( -PZcms );
200 Ptarget.setPz( PZcms );
202 Pprojectile.setE( std::sqrt( M0projectile2 +
203 Pprojectile.x()*Pprojectile.x() +
204 Pprojectile.y()*Pprojectile.y() +
206 Ptarget.setE( std::sqrt( M0target2 +
207 Ptarget.x()*Ptarget.x() +
208 Ptarget.y()*Ptarget.y() +
221 #ifdef debugFTFexictation
222 G4cout <<
"Start --------------------" << G4endl <<
"Proj M0 Mdif Mndif " << M0projectile
223 <<
" " << ProjectileDiffStateMinMass <<
" " << ProjectileNonDiffStateMinMass << G4endl
224 <<
"Targ M0 Mdif Mndif " << M0target <<
" " << TargetDiffStateMinMass <<
" "
225 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
226 <<
"Proj CMS " << Pprojectile << G4endl <<
"Targ CMS " << Ptarget <<
G4endl;
237 if ( QeExc + QeNoExc != 0.0 ) ProbExc = QeExc/(QeExc + QeNoExc);
241 #ifdef debugFTFexictation
242 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" " << ProbProjectileDiffraction
243 <<
" " << ProbTargetDiffraction << G4endl
244 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
248 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
249 ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
250 ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
255 #ifdef debugFTFexictation
256 G4cout <<
"Q exchange --------------------------" <<
G4endl;
259 G4int NewProjCode( 0 ), NewTargCode( 0 );
260 G4int ProjQ1( 0 ), ProjQ2( 0 ), ProjQ3( 0 );
262 if ( absProjectilePDGcode < 1000 ) {
265 UnpackBaryon( ProjectilePDGcode, ProjQ1, ProjQ2, ProjQ3 );
268 G4int TargQ1( 0 ), TargQ2( 0 ), TargQ3( 0 );
271 #ifdef debugFTFexictation
272 G4cout <<
"Proj Quarks " << ProjQ1 <<
" " << ProjQ2 <<
" " << ProjQ3 << G4endl
273 <<
"Targ Quarks " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 <<
G4endl;
277 G4int ProjExchangeQ( 0 );
278 G4int TargExchangeQ( 0 );
280 if ( absProjectilePDGcode < 1000 ) {
283 ProjExchangeQ = ProjQ1;
284 G4int Nsampled = G4RandFlat::shootInt(
G4long( 3 ) ) + 1;
285 if ( Nsampled == 1 ) {
286 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
287 }
else if ( Nsampled == 2 ) {
288 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
290 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ1 = TargExchangeQ;
293 ProjExchangeQ = ProjQ2;
294 G4int Nsampled = G4RandFlat::shootInt(
G4long( 3 ) ) + 1;
295 if ( Nsampled == 1 ) {
296 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
297 }
else if ( Nsampled == 2 ) {
298 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
300 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjQ2 = TargExchangeQ;
304 #ifdef debugFTFexictation
305 G4cout <<
"Exchanged Qs in Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
308 G4int aProjQ1 = std::abs( ProjQ1 );
309 G4int aProjQ2 = std::abs( ProjQ2 );
310 if ( aProjQ1 == aProjQ2 ) {
313 if ( aProjQ1 > aProjQ2 ) {
314 NewProjCode = aProjQ1*100 + aProjQ2*10 + 1;
316 NewProjCode = aProjQ2*100 + aProjQ1*10 + 1;
320 #ifdef debugFTFexictation
324 G4bool ProjExcited =
false;
329 if ( aProjQ1 != aProjQ2 ) NewProjCode *= ( ProjectilePDGcode / absProjectilePDGcode );
331 #ifdef debugFTFexictation
332 G4cout <<
"NewProjCode +2 or 0 " << NewProjCode <<
G4endl;
338 if ( TestParticle ) {
342 #ifdef debugFTFexictation
344 << G4endl <<
"MtestPart M0projectile projectile->GetDefinition()->GetPDGMass() "
345 << MtestPart <<
" " << M0projectile <<
" "
349 if ( MtestPart > M0projectile ) {
350 M0projectile = MtestPart;
354 M0projectile = MtestPart;
358 #ifdef debugFTFexictation
359 G4cout <<
"M0projectile After check " << M0projectile <<
G4endl;
362 M0projectile2 = M0projectile * M0projectile;
363 ProjectileDiffStateMinMass = M0projectile + 210.0*
MeV;
364 ProjectileNonDiffStateMinMass = M0projectile + 210.0*
MeV;
371 #ifdef debugFTFexictation
372 G4cout <<
"New TrQ " << TargQ1 <<
" " << TargQ2 <<
" " << TargQ3 << G4endl
373 <<
"NewTargCode " << NewTargCode <<
G4endl;
383 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
384 NewTargCode += 2; ProjExcited =
true;
387 NewTargCode += 2; ProjExcited =
true;
390 }
else if ( ! ProjExcited &&
392 SqrtS > M0projectile + DeltaMass ) {
399 #ifdef debugFTFexictation
403 if ( TestParticle ) {
406 if ( MtestPart > M0target ) {
407 M0target = MtestPart; M0target2 =
sqr( M0target );
410 M0target = MtestPart;
414 #ifdef debugFTFexictation
415 G4cout <<
"New targ M0 M0^2 " << M0target <<
" " << M0target2 <<
G4endl;
418 TargetDiffStateMinMass = M0target + 220.0*
MeV;
419 TargetNonDiffStateMinMass = M0target + 220.0*
MeV;
422 ProbProjectileDiffraction = 1.0; ProbTargetDiffraction = 0.0;
424 ProbProjectileDiffraction = 0.0; ProbTargetDiffraction = 1.0;
433 G4bool ProjDeltaHasCreated(
false );
434 G4bool TargDeltaHasCreated(
false );
440 if ( Ksi < 0.333333 ) {
441 ProjExchangeQ = ProjQ1;
442 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
443 ProjExchangeQ = ProjQ2;
445 ProjExchangeQ = ProjQ3;
449 TargExchangeQ = TargQ1; TargQ1 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
452 TargExchangeQ = TargQ2; TargQ2 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
454 TargExchangeQ = TargQ3; TargQ3 = ProjExchangeQ; ProjExchangeQ = TargExchangeQ;
458 #ifdef debugFTFexictation
459 G4cout <<
"Exchange Qs Pr Tr " << ProjExchangeQ <<
" " << TargExchangeQ <<
G4endl;
462 if ( Ksi < 0.333333 ) {
463 ProjQ1 = ProjExchangeQ;
464 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
465 ProjQ2 = ProjExchangeQ;
467 ProjQ3 = ProjExchangeQ;
472 if ( Ksi < 0.333333 ) {
473 TargExchangeQ = TargQ1;
474 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
475 TargExchangeQ = TargQ2;
477 TargExchangeQ = TargQ3;
480 ProjExchangeQ = ProjQ1; ProjQ1 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
483 ProjExchangeQ = ProjQ2; ProjQ2 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
485 ProjExchangeQ = ProjQ3; ProjQ3 = TargExchangeQ; TargExchangeQ = ProjExchangeQ;
489 if ( Ksi < 0.333333 ) {
490 TargQ1 = TargExchangeQ;
491 }
else if ( 0.333333 <= Ksi && Ksi < 0.666667 ) {
492 TargQ2 = TargExchangeQ;
494 TargQ3 = TargExchangeQ;
501 if ( ProjQ1 == ProjQ2 && ProjQ1 == ProjQ3 ) {
502 NewProjCode += 2; ProjDeltaHasCreated =
true;
505 NewProjCode += 2; ProjDeltaHasCreated =
true;
507 NewProjCode += 0; ProjDeltaHasCreated =
false;
510 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > DeltaMass + M0target ) {
511 NewProjCode += 2; ProjDeltaHasCreated =
true;
513 NewProjCode += 0; ProjDeltaHasCreated =
false;
519 if ( TargQ1 == TargQ2 && TargQ1 == TargQ3 ) {
520 NewTargCode += 2; TargDeltaHasCreated =
true;
523 NewTargCode += 2; TargDeltaHasCreated =
true;
525 NewTargCode += 0; TargDeltaHasCreated =
false;
528 if (
G4UniformRand() < DeltaProbAtQuarkExchange && SqrtS > M0projectile + DeltaMass ) {
529 NewTargCode += 2; TargDeltaHasCreated =
true;
531 NewTargCode += 0; TargDeltaHasCreated =
false;
535 #ifdef debugFTFexictation
536 G4cout <<
"NewProjCode NewTargCode " << NewProjCode <<
" " << NewTargCode <<
G4endl;
540 if ( absProjectilePDGcode == NewProjCode && absTargetPDGcode == NewTargCode ) {
545 if ( ProjDeltaHasCreated ) {
547 ProbProjectileDiffraction = 0.0; ProbTargetDiffraction = 1.0;
549 ProbProjectileDiffraction = 1.0; ProbTargetDiffraction = 0.0;
553 if ( TargDeltaHasCreated ) {
555 ProbProjectileDiffraction = 1.0; ProbTargetDiffraction = 0.0;
557 ProbProjectileDiffraction = 0.0; ProbTargetDiffraction = 1.0;
561 if ( ProjDeltaHasCreated ) {
564 if ( MtestPart >= M0projectile ) {
565 M0projectile = MtestPart;
566 M0projectile2 = M0projectile * M0projectile;
568 ProjectileDiffStateMinMass = M0projectile + 210.0*
MeV;
569 ProjectileNonDiffStateMinMass = M0projectile + 210.0*
MeV;
572 if ( TargDeltaHasCreated ) {
575 if ( MtestPart >= M0target ) {
576 M0target = MtestPart;
577 M0target2 = M0target * M0target;
579 TargetDiffStateMinMass = M0target + 210.0*
MeV;
580 TargetNonDiffStateMinMass = M0target + 210.0*
MeV;
587 if ( SqrtS < M0projectile + M0target )
return false;
589 PZcms2 = ( S*S + M0projectile2*M0projectile2 + M0target2*M0target2
590 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
592 #ifdef debugFTFexictation
593 G4cout <<
"At the end// NewProjCode " << NewProjCode << G4endl
594 <<
"At the end// NewTargCode " << NewTargCode << G4endl
595 <<
"M0pr M0tr SqS " << M0projectile <<
" " << M0target <<
" " << SqrtS << G4endl
596 <<
"M0pr2 M0tr2 SqS " << M0projectile2 <<
" " << M0target2 <<
" " << SqrtS << G4endl
597 <<
"PZcms2 after the change " << PZcms2 << G4endl <<
G4endl;
600 if ( PZcms2 < 0 )
return false;
605 PZcms = std::sqrt( PZcms2 );
606 Pprojectile.setPz( PZcms );
607 Pprojectile.setE( std::sqrt( M0projectile2 + PZcms2 ) );
608 Ptarget.setPz( -PZcms );
609 Ptarget.setE( std::sqrt( M0target2 + PZcms2 ) );
611 #ifdef debugFTFexictation
612 G4cout <<
"Proj Targ and Proj+Targ in CMS" << G4endl << Pprojectile << G4endl << Ptarget
613 << G4endl << Pprojectile + Ptarget <<
G4endl;
616 if ( absProjectilePDGcode < 1000 ) {
619 #ifdef debugFTFexictation
620 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
623 Pprojectile.transform( toLab );
624 Ptarget.transform( toLab );
632 #ifdef debugFTFexictation
633 G4cout <<
"Result of el. scatt " << Result << G4endl <<
"Proj Targ and Proj+Targ in Lab"
634 << G4endl << Pprojectile << G4endl << Ptarget << G4endl
635 << Pprojectile + Ptarget <<
" " << (Pprojectile + Ptarget).mag() <<
G4endl;
645 #ifdef debugFTFexictation
646 G4cout <<
"Make elastic scattering of new hadrons" <<
G4endl;
649 Pprojectile.transform( toLab );
650 Ptarget.transform( toLab );
664 #ifdef debugFTFexictation
670 G4double ProbOfDiffraction = ProbProjectileDiffraction + ProbTargetDiffraction;
672 #ifdef debugFTFexictation
673 G4cout <<
"Excitation --------------------" << G4endl
674 <<
"Proj M0 MdMin MndMin " << M0projectile <<
" " << ProjectileDiffStateMinMass <<
" "
675 << ProjectileNonDiffStateMinMass << G4endl
676 <<
"Targ M0 MdMin MndMin " << M0target <<
" " << TargetDiffStateMinMass <<
" "
677 << TargetNonDiffStateMinMass << G4endl <<
"SqrtS " << SqrtS << G4endl
678 <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
679 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
682 if ( ProbOfDiffraction != 0.0 ) {
683 ProbProjectileDiffraction /= ProbOfDiffraction;
685 ProbProjectileDiffraction = 0.0;
688 #ifdef debugFTFexictation
689 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << ProbProjectileDiffraction <<
" "
690 << ProbTargetDiffraction <<
" " << ProbOfDiffraction <<
G4endl;
693 G4double ProjectileDiffStateMinMass2 =
sqr( ProjectileDiffStateMinMass );
694 G4double ProjectileNonDiffStateMinMass2 =
sqr( ProjectileNonDiffStateMinMass );
695 G4double TargetDiffStateMinMass2 =
sqr( TargetDiffStateMinMass );
696 G4double TargetNonDiffStateMinMass2 =
sqr( TargetNonDiffStateMinMass );
704 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
707 G4int whilecount = 0;
716 #ifdef debugFTFexictation
731 if ( whilecount > 1000 ) {
737 ProjMassT2 = ProjectileDiffStateMinMass2;
738 ProjMassT = ProjectileDiffStateMinMass;
739 TargMassT2 = M0target2;
740 TargMassT = M0target;
741 if ( SqrtS < ProjMassT + TargMassT )
return false;
743 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
744 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
746 if ( PZcms2 < 0 )
return false;
748 maxPtSquare = PZcms2;
753 ProjMassT2 = ProjectileDiffStateMinMass2 + Pt2;
754 ProjMassT = std::sqrt( ProjMassT2 );
755 TargMassT2 = M0target2 + Pt2;
756 TargMassT = std::sqrt( TargMassT2 );
757 if ( SqrtS < ProjMassT + TargMassT )
continue;
759 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
760 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
762 if ( PZcms2 < 0 )
continue;
764 PZcms = std::sqrt( PZcms2 );
765 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
766 PMinusMax = SqrtS - TargMassT;
768 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
776 TMinusNew = SqrtS - PMinusNew;
777 Qminus = Ptarget.minus() - TMinusNew;
778 TPlusNew = TargMassT2 / TMinusNew;
779 Qplus = Ptarget.plus() - TPlusNew;
780 Qmomentum.setPz( (Qplus - Qminus)/2 );
781 Qmomentum.setE( (Qplus + Qminus)/2 );
783 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileDiffStateMinMass2 );
790 #ifdef debugFTFexictation
805 if ( whilecount > 1000 ) {
811 ProjMassT2 = M0projectile2;
812 ProjMassT = M0projectile;
813 TargMassT2 = TargetDiffStateMinMass2;
814 TargMassT = TargetDiffStateMinMass;
815 if ( SqrtS < ProjMassT + TargMassT )
return false;
817 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
818 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
820 if ( PZcms2 < 0 )
return false;
822 maxPtSquare = PZcms2;
827 ProjMassT2 = M0projectile2 + Pt2;
828 ProjMassT = std::sqrt( ProjMassT2 );
829 TargMassT2 = TargetDiffStateMinMass2 + Pt2;
830 TargMassT = std::sqrt( TargMassT2 );
831 if ( SqrtS < ProjMassT + TargMassT )
continue;
833 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
834 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
836 if ( PZcms2 < 0 )
continue;
838 PZcms = std::sqrt( PZcms2 );
839 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
840 TPlusMax = SqrtS - ProjMassT;
842 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
849 PPlusNew = SqrtS - TPlusNew;
850 Qplus = PPlusNew - Pprojectile.plus();
851 PMinusNew = ProjMassT2 / PPlusNew;
852 Qminus = PMinusNew - Pprojectile.minus();
853 Qmomentum.setPz( (Qplus - Qminus)/2 );
854 Qmomentum.setE( (Qplus + Qminus)/2 );
856 }
while ( ( Ptarget - Qmomentum ).mag2() < TargetDiffStateMinMass2 );
865 #ifdef debugFTFexictation
880 if ( whilecount > 1000 ) {
886 ProjMassT2 = ProjectileNonDiffStateMinMass2;
887 ProjMassT = ProjectileNonDiffStateMinMass;
888 TargMassT2 = TargetNonDiffStateMinMass2;
889 TargMassT = TargetNonDiffStateMinMass;
890 if ( SqrtS < ProjMassT + TargMassT )
return false;
892 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
893 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
895 if ( PZcms2 < 0 )
return false;
897 maxPtSquare = PZcms2;
902 ProjMassT2 = ProjectileNonDiffStateMinMass2 + Pt2;
903 ProjMassT = std::sqrt( ProjMassT2 );
904 TargMassT2 = TargetNonDiffStateMinMass2 + Pt2;
905 TargMassT = std::sqrt( TargMassT2 );
906 if ( SqrtS < ProjMassT + TargMassT )
continue;
908 PZcms2 =( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
909 -2.0*S*ProjMassT2 - 2.0*S*TargMassT2 -2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
911 if ( PZcms2 < 0 )
continue;
913 PZcms = std::sqrt( PZcms2 );
914 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
915 PMinusMax = SqrtS - TargMassT;
917 PMinusNew =
ChooseP( PMinusMin, PMinusMax );
919 PMinusNew = ( PMinusMax - PMinusMin )*
G4UniformRand() + PMinusMin;
921 Qminus = PMinusNew - Pprojectile.minus();
922 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
923 TPlusMax = SqrtS - PMinusNew;
927 TPlusNew =
ChooseP( TPlusMin, TPlusMax );
929 TPlusNew = ( TPlusMax - TPlusMin )*
G4UniformRand() + TPlusMin;
931 Qplus = -( TPlusNew - Ptarget.plus() );
932 Qmomentum.setPz( (Qplus - Qminus)/2 );
933 Qmomentum.setE( (Qplus + Qminus)/2 );
935 #ifdef debugFTFexictation
936 G4cout << ( Pprojectile + Qmomentum ).mag2() <<
" " << ProjectileNonDiffStateMinMass2
937 << G4endl << ( Ptarget - Qmomentum ).mag2() <<
" "
938 << TargetNonDiffStateMinMass2 <<
G4endl;
942 }
while ( ( Pprojectile + Qmomentum ).mag2() < ProjectileNonDiffStateMinMass2 ||
943 ( Ptarget - Qmomentum ).mag2() < TargetNonDiffStateMinMass2 );
950 Pprojectile += Qmomentum;
951 Ptarget -= Qmomentum;
954 Pprojectile.transform( toLab );
955 Ptarget.transform( toLab );
975 #ifdef debugFTFexictation
976 G4cout <<
"Mproj " << Pprojectile.mag() << G4endl <<
"Mtarg " << Ptarget.mag() <<
G4endl;
1009 if ( start == NULL ) {
1010 G4cout <<
" G4FTFModel::String() Error: No start parton found" <<
G4endl;
1011 FirstString = 0; SecondString = 0;
1016 if ( end == NULL ) {
1017 G4cout <<
" G4FTFModel::String() Error: No end parton found" <<
G4endl;
1018 FirstString = 0; SecondString = 0;
1039 if ( isProjectile ) {
1049 G4double Pt( 0.0 ), x1( 0.0 ), x3( 0.0 );
1063 Pt = std::sqrt( Pt2kink * ( std::pow( W2/16.0/Pt2kink + 1.0,
G4UniformRand() ) - 1.0 ) );
1068 if ( Pt > 500.0*
MeV ) {
1069 G4double Ymax = std::log( W/2.0/Pt + std::sqrt( W2/4.0/Pt/Pt - 1.0 ) );
1071 x1 = 1.0 - Pt/W * std::exp( Y );
1072 x3 = 1.0 - Pt/W * std::exp(-Y );
1076 if ( PDGcode_startQ < 3 ) Mass_startQ = 325.0*
MeV;
1077 if ( PDGcode_startQ == 3 ) Mass_startQ = 500.0*
MeV;
1078 if ( PDGcode_startQ == 4 ) Mass_startQ = 1600.0*
MeV;
1080 if ( PDGcode_endQ < 3 ) Mass_endQ = 325.0*
MeV;
1081 if ( PDGcode_endQ == 3 ) Mass_endQ = 500.0*
MeV;
1082 if ( PDGcode_endQ == 4 ) Mass_endQ = 1600.0*
MeV;
1084 G4double P2_1 = W2*x1*x1/4.0 - Mass_endQ*Mass_endQ;
1085 G4double P2_3 = W2*x3*x3/4.0 - Mass_startQ*Mass_startQ;
1087 if ( P2_1 <= 0.0 || P2_3 <= 0.0 ) {
1093 G4double CosT12 = ( P2_3 - P2_1 - P2_2 ) / (2.0*P_1*P_2);
1094 G4double CosT13 = ( P2_2 - P2_1 - P2_3 ) / (2.0*P_1*P_3);
1097 if ( std::abs( CosT12 ) > 1.0 || std::abs( CosT13 ) > 1.0 ) {
1101 Pt = P_2 * std::sqrt( 1.0 - CosT12*CosT12 );
1102 Pstart.setPx( -Pt ); Pstart.setPy( 0.0 ); Pstart.setPz( P_3*CosT13 );
1103 Pend.setPx( 0.0 ); Pend.setPy( 0.0 ); Pend.setPz( P_1 );
1104 Pkink.setPx( Pt ); Pkink.setPy( 0.0 ); Pkink.setPz( P_2*CosT12 );
1105 Pstart.setE( x3*W/2.0 );
1106 Pkink.setE( Pkink.vect().mag() );
1107 Pend.setE( x1*W/2.0 );
1110 if ( Pkink.getZ() > 0.0 ) {
1112 PkinkQ1 = XkQ*Pkink;
1114 PkinkQ1 = (1.0 - XkQ)*Pkink;
1118 PkinkQ1 = (1.0 - XkQ)*Pkink;
1120 PkinkQ1 = XkQ*Pkink;
1124 PkinkQ2 = Pkink - PkinkQ1;
1127 std::sqrt(
sqr(
sqr(x1) -
sqr(x3) ) +
sqr( 2.0*x1*x3*CosT13 ) );
1128 G4double Psi = std::acos( Cos2Psi );
1131 if ( isProjectile ) {
1132 Rotate.rotateY( Psi );
1134 Rotate.rotateY(
pi - Psi );
1157 std::vector< G4double > QuarkProbabilitiesAtGluonSplitUp =
1161 for (
unsigned int Iq = 0; Iq < 3; Iq++ ) {
1163 if ( Ksi > QuarkProbabilitiesAtGluonSplitUp[Iq] ) QuarkInGluon++;
1174 Pstart.transform( toLab ); start->
Set4Momentum( Pstart );
1175 PkinkQ1.transform( toLab );
1176 PkinkQ2.transform( toLab );
1184 G4int absPDGcode = 1500;
1191 if ( absPDGcode < 1000 ) {
1192 if ( isProjectile ) {
1218 if ( isProjectile ) {
1256 if ( isProjectile ) {
1270 if ( Momentum > 0.0 ) {
1276 tmp.set( 0.0, 0.0, 1.0 );
1280 if ( isProjectile ) {
1281 Pstart1 *= (-1.0)*Minus/2.0;
1282 Pend1 *= (+1.0)*Plus /2.0;
1284 Pstart1 *= (+1.0)*Plus/ 2.0;
1285 Pend1 *= (-1.0)*Minus/2.0;
1287 Momentum = -Pstart1.mag();
1288 Pstart1.setT( Momentum );
1289 Momentum = -Pend1.mag();
1290 Pend1.setT( Momentum );
1305 <<
" generated string momenta: Diquark " << end->
Get4Momentum() <<
"mass : "
1307 << Pstart + Pend <<
G4endl <<
" Original "
1321 if ( Pmin <= 0.0 || range <= 0.0 ) {
1322 G4cout <<
" Pmin, range : " << Pmin <<
" , " << range <<
G4endl;
1324 "G4DiffractiveExcitation::ChooseP : Invalid arguments " );
1337 if ( AveragePt2 <= 0.0 ) {
1341 ( std::exp( -maxPtSquare/AveragePt2 ) - 1.0 ) );
1345 return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
1355 yf = z*z +
sqr(1.0 - z);
1364 G4int absIdPDG = std::abs( IdPDG );
1365 Q1 = absIdPDG / 100;
1366 Q2 = (absIdPDG % 100) / 10;
1368 if ( IdPDG < 0 ) anti *= -1;
1380 Q2 = (IdPDG % 1000) / 100;
1381 Q3 = (IdPDG % 100) / 10;
1394 }
else if ( Q3 > Q1 ) {
1404 G4int NewCode = Q1*1000 + Q2*100 + Q3*10 + 2;
1413 "G4DiffractiveExcitation copy contructor not meant to be called" );
1421 "G4DiffractiveExcitation = operator not meant to be called" );
1430 "G4DiffractiveExcitation == operator not meant to be called" );
1438 "G4DiffractiveExcitation != operator not meant to be called" );
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) 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
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 SetStatus(const G4int aStatus)
void SetDefinition(G4ParticleDefinition *aDefinition)
const G4String & GetParticleName() const
G4ParticleDefinition * GetDefinition() 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
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