92 { 4, 8, 11, 13, 14 } };
93 for (
G4int i = 0; i < 5; i++ ) {
94 for (
G4int j = 0; j < 5; j++ ) {
111 #ifdef debug_QGSMfragmentation
115 <<
"------------------------------------"<<
G4endl;
133 #ifdef debug_QGSMfragmentation
134 if ( LeftVector != 0 )
G4cout<<
"Non fragmentable - the string is converted to one hadron "<<
G4endl;
141 #ifdef debug_QGSMfragmentation
151 G4bool success=
false, inner_sucess=
true;
155 #ifdef debug_QGSMfragmentation
166 RightVector->clear();
169 const G4int maxNumberOfLoops = 1000;
170 G4int loopCounter = -1;
171 while (!
StopFragmenting(currentString) && ++loopCounter < maxNumberOfLoops )
174 #ifdef debug_QGSMfragmentation
182 #ifdef debug_QGSMfragmentation
187 LeftVector->push_back(Hadron);
189 RightVector->push_back(Hadron);
191 delete currentString;
192 currentString=newString;
196 #ifdef debug_QGSMfragmentation
197 G4cout<<
"abandon ... start from the beginning ---------------"<<
G4endl;
201 if (newString)
delete newString;
206 if ( loopCounter >= maxNumberOfLoops ) {
211 #ifdef debug_QGSMfragmentation
212 G4cout<<
"Split remaining string into 2 final hadrons."<<
G4endl;
216 SplitLast(currentString,LeftVector, RightVector) )
220 delete currentString;
223 delete theStringInCMS;
235 while(!RightVector->empty())
237 LeftVector->push_back(RightVector->back());
238 RightVector->erase(RightVector->end()-1);
246 for (
size_t C1 = 0;
C1 < LeftVector->size();
C1++)
250 Momentum = toObserverFrame*Momentum;
253 Momentum = toObserverFrame*Coordinate;
283 #ifdef debug_QGSMfragmentation
296 #ifdef debug_QGSMfragmentation
298 G4cout<<
"Start SplitUP (G4VLongitudinalStringDecay) ========================="<<
G4endl;
299 G4cout<<
"String partons: " <<
string->GetLeftParton()->GetPDGEncoding()<<
" "
300 <<
string->GetRightParton()->GetPDGEncoding()<<
" "
301 <<
"Direction " <<
string->GetDecayDirection()<<
G4endl;
308 string->SetLeftPartonStable();
311 string->SetRightPartonStable();
320 G4int NumberOfpossibleBaryons = 2;
326 ActualProb *= (1.0-
G4Exp(2.0*(1.0 - string->
Mass()/(NumberOfpossibleBaryons*1400.0))));
337 if ( HadronDefinition == NULL )
return NULL;
339 #ifdef debug_QGSMfragmentation
340 G4cout<<
"The parton "<<
string->GetDecayParton()->GetPDGEncoding()<<
" "
343 G4cout<<
"The side of the string decay Left/Right (1/-1) "<<SideOfDecay<<
G4endl;
350 #ifdef debug_QGSMfragmentation
351 G4cout<<
"An attempt to determine its energy (SplitEandP)"<<
G4endl;
355 delete newString; newString=0;
358 if ( HadronMomentum != 0 ) {
360 #ifdef debug_QGSMfragmentation
364 Hadron =
new G4KineticTrack(HadronDefinition, 0,Pos, *HadronMomentum);
368 delete HadronMomentum;
372 #ifdef debug_QGSMfragmentation
377 #ifdef debug_VStringDecay
378 G4cout<<
"End SplitUP (G4VLongitudinalStringDecay) ====================="<<
G4endl;
397 G4int Swap = stableQuarkEncoding;
398 stableQuarkEncoding = decayQuarkEncoding;
399 decayQuarkEncoding = Swap;
402 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
410 G4int QuarkEncoding=QuarkPair.second->GetPDGEncoding();
414 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
420 NewQuark = QuarkPair.first->GetPDGEncoding();
432 created = QuarkPair.second;
454 #ifdef debug_QGSMfragmentation
456 G4cout<<
"String 4 mom, String M "<<
string->Get4Momentum()<<
" "<<
string->Mass()<<
G4endl;
463 #ifdef debug_QGSMfragmentation
464 G4cout<<
"Mass of the string is not sufficient to produce the hadron!"<<
G4endl;
470 G4double StringMT2 =
string->MassT2();
471 G4double StringMT = std::sqrt(StringMT2);
474 String4Momentum.
setPz(0.);
478 G4double HadronMassT2, ResidualMassT2;
488 RemSysPt = StringPt - HadronPt;
490 HadronMassT2 =
sqr(HadronMass) + HadronPt.mag2();
493 }
while (std::sqrt(HadronMassT2) + std::sqrt(ResidualMassT2) > StringMT);
498 G4double Pz2 = (
sqr(StringMT2 - HadronMassT2 - ResidualMassT2) -
499 4*HadronMassT2 * ResidualMassT2)/4./StringMT2;
501 if ( Pz2 < 0 ) {
return 0;}
506 G4double zMin = (std::sqrt(HadronMassT2+Pz2) - Pz)/std::sqrt(StringMT2);
507 G4double zMax = (std::sqrt(HadronMassT2+Pz2) + Pz)/std::sqrt(StringMT2);
509 if (zMin >= zMax)
return 0;
513 HadronPt.
x(), HadronPt.
y());
519 (z *
string->LightConeDecay() -
520 HadronMassT2/(z *
string->LightConeDecay())) );
521 G4double HadronE = 0.5* (z *
string->LightConeDecay() +
522 HadronMassT2/(z *
string->LightConeDecay()) );
526 #ifdef debug_QGSMfragmentation
527 G4cout<<
"string->GetDecayDirection() string->LightConeDecay() "
528 <<
string->GetDecayDirection()<<
" "<<
string->LightConeDecay()<<
G4endl;
529 G4cout<<
"HadronPt,HadronE "<<HadronPt<<
" "<<HadronE<<
G4endl;
541 #ifdef debug_QGSMfragmentation
542 G4cout<<
"GetLightConeZ zmin zmax Parton pHadron "<<zmin<<
" "<<zmax<<
" "<<
547 G4int DiQold(0), DiQnew(0);
560 if ( (absDecayQuarkCode < 6) && (absNewQuarkCode < 6) ) {
561 d1 =
FFq2q[absDecayQuarkCode-1][absNewQuarkCode-1][0]; d2 =
FFq2q[absDecayQuarkCode-1][absNewQuarkCode-1][1];
564 if ( (absDecayQuarkCode < 6) && (absNewQuarkCode > 6) ) {
565 qA = absNewQuarkCode/1000; qB = (absNewQuarkCode % 1000)/100; DiQnew =
IndexDiQ[qA-1][qB-1];
566 d1 =
FFq2qq[absDecayQuarkCode-1][DiQnew][0]; d2 =
FFq2q[absDecayQuarkCode-1][DiQnew][1];
569 if ( (absDecayQuarkCode > 6) && (absNewQuarkCode < 6) ) {
570 q1 = absDecayQuarkCode/1000; q2 = (absDecayQuarkCode % 1000)/100; DiQold =
IndexDiQ[q1-1][q2-1];
571 d1 =
FFqq2q[DiQold][absNewQuarkCode-1][0]; d2 =
FFqq2q[DiQold][absNewQuarkCode-1][1];
575 q1 = absDecayQuarkCode/1000; q2 = (absDecayQuarkCode % 1000)/100; DiQold =
IndexDiQ[q1-1][q2-1];
576 d1 =
FFqq2qq[DiQold][absNewQuarkCode-1][0]; d2 =
FFqq2qq[DiQold][absNewQuarkCode-1][1];
581 invD1=1./
d1; invD2=1./
d2;
583 const G4int maxNumberOfLoops = 10000;
584 G4int loopCounter = 0;
591 }
while ( ( (r12 > 1.0) || !((zmin <= z)&&(z <= zmax))) &&
592 ++loopCounter < maxNumberOfLoops );
594 if ( loopCounter >= maxNumberOfLoops ) {
595 z = 0.5*(zmin + zmax);
609 G4ThreeVector ClusterVel =
string->Get4Momentum().boostVector();
610 G4double ResidualMass =
string->Mass();
612 #ifdef debug_QGSMfragmentation
613 G4cout<<
"Split last-----------------------------------------"<<
G4endl;
614 G4cout<<
"StrMass "<<ResidualMass<<
" q's "
615 <<
string->GetLeftParton()->GetParticleName()<<
" "
616 <<
string->GetRightParton()->GetParticleName()<<
G4endl;
621 const G4int maxNumberOfLoops = 1000;
622 G4int loopCounter = 0;
631 string->SetLeftPartonStable();
637 G4int IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
641 quark = QuarkPair.second;
648 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
650 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
659 quark = QuarkPair.second;
663 if ( LeftHadron !=
nullptr ) {
666 if ( RightHadron !=
nullptr ) {
670 isOK = (ResidualMass > LeftHadronMass + RightHadronMass);
674 if ( loopCounter >= maxNumberOfLoops ) {
680 while (isOK ==
false);
687 &RightMom, RightHadron->
GetPDGMass(), ResidualMass);
688 LeftMom.
boost(ClusterVel);
689 RightMom.
boost(ClusterVel);
691 #ifdef debug_QGSMfragmentation
697 LeftVector->push_back(
new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
698 RightVector->push_back(
new G4KineticTrack(RightHadron, 0, Pos, RightMom));
708 G4double r_val =
sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) -
sqr(2.*Mass*AntiMass);
709 G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
713 G4double st = std::sqrt(1. - pz * pz)*Pabs;
720 Mom->
setE(std::sqrt(Pabs*Pabs + Mass*Mass));
723 AntiMom->
setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
730 for (
G4int i=0; i < 5; i++) {
743 for (
G4int i=0; i < 5; i++) {
766 for (
G4int i=0; i < 15; i++) {
779 for (
G4int i=0; i < 15; i++) {