63 G4double G4QString::DiquarkSuppress=0.1;
64 G4double G4QString::DiquarkBreakProb=0.1;
66 G4double G4QString::StrangeSuppress=0.435;
70 theStableParton(0), theDecayParton(0){}
76 G4cout<<
"G4QString::PPD-Constructor: Direction="<<Direction<<
G4endl;
80 G4cout<<
"G4QString::PPD-Constructor: ------>> String is excited"<<
G4endl;
87 G4cout<<
"G4QString::PartonPair-Constructor: Is CALLED"<<
G4endl;
91 G4cout<<
"G4QString::PartonPair-Constructor: ------>> String is excited"<<
G4endl;
96 : theDirection(Direction), thePosition(QCol->GetPosition()), SideOfDecay(0)
98 thePartons.push_back(QCol);
100 thePartons.push_back(Gluon);
102 thePartons.push_back(QAntiCol);
104 Pplus =sum.
e() + sum.
pz();
105 Pminus=sum.
e() - sum.
pz();
110 thePosition(right.GetPosition()), SideOfDecay(0)
115 Ptright=right.Ptright;
118 decaying=right.decaying;
122 {
if(thePartons.size()) std::for_each(thePartons.begin(),thePartons.end(),
DeleteQParton());}
127 for(
unsigned i=0; i<thePartons.size(); i++) momentum += thePartons[i]->
Get4Momentum();
133 for(
unsigned i=0; i<thePartons.size(); i++)
134 thePartons[i]->Set4Momentum(rotation*thePartons[i]->
Get4Momentum());
154 for(
unsigned cParton=0; cParton<thePartons.size(); cParton++)
158 thePartons[cParton]->Set4Momentum(Mom);
186 DiquarkSuppress = DQSup;
187 DiquarkBreakProb= DQBU;
189 StrangeSuppress = SSup;
190 widthOfPtSquare = -2*SigPt*SigPt;
199 return G4ThreeVector(pt2*std::cos(phi),pt2*std::sin(phi),0.);
257 G4cout<<
"G4QString::ExciteString: **Called**, direction="<<Direction<<
G4endl;
259 if(thePartons.size()) std::for_each(thePartons.begin(),thePartons.end(),
DeleteQParton());
261 theDirection = Direction;
264 G4cout<<
"G4QString::ExciteString: ColourPosition = "<<thePosition<<
", beg="<<Color->
GetPDGCode()
267 thePartons.push_back(Color);
269 thePartons.push_back(AntiColor);
271 Pplus =sum.
e() + sum.
pz();
272 Pminus=sum.
e() - sum.
pz();
275 G4cout<<
"G4QString::ExciteString: ***Done***, beg="<<(*thePartons.begin())->GetPDGCode()
276 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
289 G4double zOfMaxyf=alund*Mt2/(alund*Mt2+1.);
290 G4double maxYf=(1.-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
295 yf = (1-
z)/z * std::exp(-alund*Mt2/z);
313 G4int absCode = std::abs(PartonEncoding);
317 if(absCode == 1 || absCode == 2) theA = arho;
318 else if(absCode == 3) theA = aphi;
321 G4cerr<<
"***G4QString::GetQGSMLightConeZ: CHIPS is SU(3), quakCode="<<absCode<<
G4endl;
328 yf = std::pow( 1.-z, d2);
334 if (absCode==3101||absCode==3103||absCode==3201||absCode==3203) d2=alft-ala-ala+arho;
335 else if(absCode==1103||absCode==2101||absCode==2203||absCode==2103) d2=alft-an-an+arho;
336 else d2=alft-aksi-aksi+arho;
340 yf = std::pow(1.-z, d2);
364 for(
unsigned L = 0; L < LeftVector->size(); L++)
371 G4cout<<
"-EMC-G4QString::FragmentString:---LightFragmentation---> Res4M="<<sL<<
G4endl;
376 G4cout<<
"G4QString::FragmentString:OUTPUT is not yet defined, define Left/Right"<<
G4endl;
384 G4cout<<
"G4QString::FragmString: ***Remember*** L4M="<<left4M<<
", R4M="<<right4M<<
G4endl;
391 momentum= toCms * thePartons[0]->Get4Momentum();
396 momentum = toCms * thePartons[
index]->Get4Momentum();
397 thePartons[
index]->Set4Momentum(momentum);
404 G4cout<<
"G4QString::FragmentString: Copy with nP="<<theStringInCMS->thePartons.size()
405 <<
", beg="<<(*(theStringInCMS->thePartons.begin()))->GetPDGCode()
406 <<
", end="<<(*(theStringInCMS->thePartons.end()-1))->GetPDGCode()<<
G4endl;
411 G4int StringLoopInterrupt=27;
413 G4cout<<
"G4QString::FragmentString: BeforeWhileLOOP, max = "<<StringLoopInterrupt
414 <<
", nP="<<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
415 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
419 G4cout<<
"-EMC-G4QString::FragmString: c4M="<<cmS4M<<
",Max="<<StringLoopInterrupt<<
G4endl;
421 while (!success && attempt++ < StringLoopInterrupt)
432 G4cout<<
"G4QString::FragmentString:===>LOOP, attempt = "<<attempt<<
", nP="
433 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
434 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
437 if(LeftVector->size())
439 std::for_each(LeftVector->begin(), LeftVector->end(),
DeleteQHadron());
443 if(RightVector->size())
445 std::for_each(RightVector->begin(), RightVector->end(),
DeleteQHadron());
446 RightVector->clear();
453 G4cout<<
"G4QString::FragmentString:-->Begin LOOP/LOOP, decaying="<<decaying<<
G4endl;
462 G4cout<<
"G4QString::FragmentString: LOOP/LOOP, canBeFrag="<<canBeFrag<<
", decay="
465 if(Hadron && canBeFrag)
468 G4cout<<
">>G4QString::FragmentString: LOOP/LOOP-NO FRAGM-, dec="<<decaying<<
G4endl;
471 else RightVector->push_back(Hadron);
478 G4cout<<
"G4QString::FragmentString: LOOP/LOOP, Start from scratch"<<
G4endl;
480 if (Hadron)
delete Hadron;
485 G4cout<<
"G4QString::FragmentString: LOOP/LOOP End, nP="
486 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
487 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
492 for(
unsigned L = 0; L < LeftVector->size(); L++)
499 for(
unsigned R = 0; R < RightVector->size(); R++)
506 G4cout<<
"-EMC-G4QString::FragmentString:L/R_BeforLast->r4M/M2="<<fLR<<fLR.
m2()<<
G4endl;
510 G4cout<<
"G4QString::FragmentString: inner_success = "<<inner_sucess<<
G4endl;
519 G4cout<<
"G4QString::FragmString: string4M="<<tot4M<<totM<<
G4endl;
528 G4cout<<
"G4QString::FragmentString: LOOP Quark Algorithm"<<
G4endl;
535 G4cout<<
"G4QString::FragmentString: LOOP Di-Quark Algorithm"<<
G4endl;
554 <<
",ML="<<LhM<<
",MR="<<RhM<<
",SumM="<<LhM+RhM<<
",tM="<<totM<<
G4endl;
556 if(totM < LhM + RhM) success=
false;
565 LeftVector->push_back(
new G4QHadron(LeftHadron, 0, Pos, Lh4M));
567 RightVector->push_back(
new G4QHadron(RightHadron, 0, Pos, Rh4M));
571 G4cout<<
"->>G4QStr::FragString:HFilled (L) PDG="<<LeftHadron->
GetPDGCode()<<
", 4M="
575 G4cout<<
"-EMC-G4QString::FragmentString: Residual4M="<<tot4M-Lh4M-Rh4M<<
G4endl;
580 if(LeftHadron)
delete LeftHadron;
581 if(RightHadron)
delete RightHadron;
585 delete theStringInCMS;
587 G4cout<<
"G4QString::FragmentString: LOOP/LOOP, success="<<success<<
G4endl;
591 if(RightVector->size())
593 std::for_each(RightVector->begin(), RightVector->end(),
DeleteQHadron());
594 RightVector->clear();
597 if(LeftVector->size())
599 std::for_each(LeftVector->begin(), LeftVector->end(),
DeleteQHadron());
604 G4cout<<
"G4QString::FragmString:StringNotFragm,L4M="<<left4M<<
",R4M="<<right4M<<
G4endl;
616 for(
unsigned L = 0; L < LeftVector->size(); L++)
623 for(
unsigned R = 0; R < RightVector->size(); R++)
630 G4cout<<
"-EMC-G4QString::FragmentString:---L/R_BeforeMerge---> Res4M="<<sLR<<
G4endl;
633 while(!RightVector->empty())
635 LeftVector->push_back(RightVector->back());
636 RightVector->erase(RightVector->end()-1);
640 G4QHadronVector::iterator ilv;
641 for(ilv = LeftVector->begin(); ilv < LeftVector->end(); ilv++)
644 if(CV.
x()==0. && CV.
y()==0. && CV.
z()==0.) LeftVector->erase(ilv);
649 for(
unsigned c1 = 0;
c1 < LeftVector->size();
c1++)
653 for(
unsigned c2 = 0; c2 <
c1; c2++)
668 G4cout<<
"G4QString::FragmentString: beforeLoop LVsize = "<<LeftVector->size()<<
G4endl;
670 for(
unsigned C1 = 0;
C1 < LeftVector->size();
C1++)
674 Momentum = toObserverFrame*Momentum;
677 Momentum = toObserverFrame*Coordinate;
683 for(
unsigned L = 0; L < LeftVector->size(); L++)
690 G4cout<<
"-EMC-G4QString::FragmentString:---LSAfterMerge&Conv---> Res4M="<<sLA<<
G4endl;
693 G4cout<<
"G4QString::FragmentString: *** Done *** "<<
G4endl;
707 G4cout<<
"G4QString::LightFragmentationTest: ***Called***, string4M="<<tot4M<<
G4endl;
714 G4cout<<
"G4QString::LightFragTest: before check nP="<<thePartons.size()<<
", MS2="
715 <<
Mass2()<<
", MCut="<<MassCut<<
", beg="<<(*thePartons.begin())->GetPDGCode()
716 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
", fM="<<fragMass<<
G4endl;
720 if(hadrons.first)
delete hadrons.first;
721 if(hadrons.second)
delete hadrons.second;
735 G4cout<<
"G4QString::LightFragTest:tM="<<totM<<
","<<h1M<<
"+"<<h2M<<
"+"<<h1M+h2M<<
G4endl;
737 if(h1M + h2M <= totM)
749 G4int L=result->size();
if(L)
for(
G4int i=0; i<L; i++)
751 tot4M-=(*result)[i]->Get4Momentum();
752 G4cout<<
"-EMC-G4QString::LightFragTest: i="<<i<<
", residual4M="<<tot4M<<
G4endl;
757 else G4cout<<
"-Warning-G4QString::LightFragTest: TooBigHadronMasses to decay"<<
G4endl;
761 else G4cout<<
"-Warning-G4QString::LightFragTest: No Hadrons have been proposed"<<
G4endl;
763 delete hadrons.first;
764 delete hadrons.second;
779 G4cout<<
"G4QString::FragmentationMass: Create spin-0 or spin-1/2 hadron: nP="
780 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
781 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
786 if ( (LPDG > 0 && LT == 1) || (LPDG < 0 && LT == 2) ) iflc = -iflc;
810 pdefs->first = Hadron1;
811 pdefs->second = Hadron2;
815 if(Hadron1)
delete Hadron1;
816 if(Hadron2)
delete Hadron2;
821 G4cout<<
"G4QString::FragmentationMass: ***Done*** mass="<<mass<<
G4endl;
842 if (decaying == Left )
return +1;
843 else if (decaying == Right)
return -1;
846 G4cerr<<
"***G4QString::GetDecayDirection: wrong DecayDirection="<<decaying<<
G4endl;
866 if (decaying == Left )
return Ptleft;
867 else if (decaying == Right )
return Ptright;
870 G4cerr<<
"***G4QString::DecayPt: wrong DecayDirection="<<decaying<<
G4endl;
890 G4cout<<
"G4QString::Splitup: newStringEndPDG="<<newStringEnd->
GetPDGCode()<<
", nP="
891 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
892 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
897 G4cout<<
"G4QString::Splitup: HM="<<HadronMomentum<<
", nP="
898 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
899 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
904 G4cout<<
"---->>G4QString::Splitup: HFilled 4M="<<*HadronMomentum<<
",PDG="
914 thePartons[0] = newStringEnd;
918 Ptleft -= HadronMomentum->
vect();
921 else if (decaying == Right)
923 G4QParton* theLast = thePartons[thePartons.size()-1];
925 thePartons[thePartons.size()-1] = newStringEnd;
928 <<thePartons.size()<<
", beg="<<thePartons[0]->GetPDGCode()<<
",end="
929 <<thePartons[thePartons.size()-1]->GetPDGCode()<<
",P="<<theLast
930 <<
"="<<thePartons[thePartons.size()-1]<<
G4endl;
932 Ptright -= HadronMomentum->
vect();
937 G4cerr<<
"***G4QString::Splitup: wrong oldDecay="<<decaying<<
G4endl;
940 Pplus -= HadronMomentum->
e() + HadronMomentum->
pz();
941 Pminus -= HadronMomentum->
e() - HadronMomentum->
pz();
943 G4cout<<
"G4QString::Splitup: P+="<<Pplus<<
",P-="<<Pminus<<
", nP="
944 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
945 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
948 delete HadronMomentum;
952 <<thePartons.size()<<
", beg="<<(*thePartons.begin())->GetPDGCode()
953 <<
",end="<<(*(thePartons.end()-1))->GetPDGCode()<<
G4endl;
963 G4cout<<
"G4QString::SplitEandP: ***Called*** HMass="<<HadronMass<<
G4endl;
970 G4double HadronMass2T = HadronMass*HadronMass + HadronPt.
mag2();
971 if (HadronMass2T >= SmoothParam*
Mass2() )
return 0;
976 G4cout<<
"G4QString::SplitEandP: zMin="<<zMin<<
", zMax"<<zMax<<
G4endl;
978 if (zMin >= zMax)
return 0;
980 if(QL) z = GetQGSMLightConeZ(zMin, zMax, theDecayParton->
GetPDGCode(), pHadron,
981 HadronPt.
x(), HadronPt.
y());
982 else z = GetLundLightConeZ(zMin, zMax, theDecayParton->
GetPDGCode(), pHadron,
983 HadronPt.
x(), HadronPt.
y());
987 if (decaying == Left ) zl*=Pplus;
988 else if (decaying == Right ) zl*=Pminus;
991 G4cerr<<
"***G4QString::SplitEandP: wrong DecayDirection="<<decaying<<
G4endl;
994 G4double HadronE = (zl + HadronMass2T/zl)/2;
1004 return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
1032 G4int Swap = stableQuarkEncoding;
1033 stableQuarkEncoding = decayQuarkEncoding;
1034 decayQuarkEncoding = Swap;
1036 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
1041 G4int i10 = std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
1042 G4int i20 = std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
1044 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
1045 created =
new G4QParton(NewDecayEncoding);
1047 G4cout<<
"G4QString::DiQuarkSplitup: inside, crP="<<created->GetPDGCode()<<
G4endl;
1075 G4cout<<
"G4QString::CreatePartonPair: ***Called***, P="<<NeedParticle<<
", ALLOWdQ="
1086 G4int PDGcode = (std::max(q1,q2) * 1000 + std::min(q1,q2) * 100 + spin) * NeedParticle;
1088 G4cout<<
"G4QString::CreatePartonPair: Created dQ-AdQ, PDG="<<PDGcode<<
G4endl;
1097 G4cout<<
"G4QString::CreatePartonPair: Created Q-aQ, PDG="<<PDGcode<<
G4endl;
1106 static G4double scalarMesonMixings[6]={0.5, 0.25, 0.5, 0.25, 1.0, 0.5};
1107 static G4double vectorMesonMixings[6]={0.5, 0.0, 0.5, 0.0, 1.0, 1.0};
1111 G4cout<<
"G4QString::CreateMeson: bT="<<black->
GetType()<<
"("<<id1<<
"), wT="
1114 if (std::abs(id1) < std::abs(id2))
1122 G4cerr<<
"***G4QString::CreateMeson: q1="<<id1<<
", q2="<<id2
1123 <<
" while CHIPS is only SU(3)"<<
G4endl;
1126 G4int PDGEncoding=0;
1130 G4int imix = 2*std::abs(id1) - 1;
1131 if(theSpin == SpinZero)
1132 PDGEncoding = 110*(1 +
G4int(rmix + scalarMesonMixings[imix - 1])
1133 +
G4int(rmix + scalarMesonMixings[imix] ) ) + theSpin;
1135 PDGEncoding = 110*(1 +
G4int(rmix + vectorMesonMixings[imix - 1])
1136 +
G4int(rmix + vectorMesonMixings[imix] ) ) + theSpin;
1140 PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) + theSpin;
1141 G4bool IsUp = (std::abs(id1)&1) == 0;
1143 if( (IsUp && IsAnti) || (!IsUp && !IsAnti) ) PDGEncoding = - PDGEncoding;
1145 if( PDGEncoding == -111 || PDGEncoding == -113 || PDGEncoding == -223 ||
1146 PDGEncoding == -221 || PDGEncoding == -331 || PDGEncoding == -333 )
1147 PDGEncoding = - PDGEncoding;
1151 G4cout<<
"G4QString::CreateBaryon: Meson is created with PDG="<<PDGEncoding<<
G4endl;
1164 G4cout<<
"G4QString::CreateBaryon: bT="<<black->
GetType()<<
"("<<id1<<
"), wT="
1167 if(std::abs(id1) < std::abs(id2))
1173 if(std::abs(id1)<1000 || std::abs(id2)> 3)
1175 G4cerr<<
"***G4QString::CreateBaryon: q1="<<id1<<
", q2="<<id2
1176 <<
" can't create a Baryon"<<
G4endl;
1179 G4int ifl1= std::abs(id1)/1000;
1180 G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
1181 G4int diquarkSpin = std::abs(id1)%10;
1183 if (id1 < 0) {ifl1 = - ifl1; ifl2 = - ifl2;}
1185 G4int kfla = std::abs(ifl1);
1186 G4int kflb = std::abs(ifl2);
1187 G4int kflc = std::abs(ifl3);
1188 G4int kfld = std::max(kfla,kflb);
1189 kfld = std::max(kfld,kflc);
1190 G4int kflf = std::min(kfla,kflb);
1191 kflf = std::min(kflf,kflc);
1192 G4int kfle = kfla + kflb + kflc - kfld - kflf;
1194 if(kfla==kflb && kflb==kflc) theSpin=SpinThreeHalf;
1197 if(theSpin == SpinHalf && kfld > kfle && kfle > kflf)
1203 if(diquarkSpin == 1 )
1205 if ( kfla == kfld) kfll = 1;
1210 G4int PDGEncoding=0;
1211 if (kfll == 1) PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
1212 else PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
1213 if (id1 < 0) PDGEncoding = -PDGEncoding;
1216 G4cout<<
"G4QString::CreateBaryon: Baryon is created with PDG="<<PDGEncoding<<
G4endl;
1227 static G4double mesonLowSpin = 0.5;
1228 static G4double baryonLowSpin= 0.5;
1232 G4cout<<
"G4QString::CreateHadron: bT="<<bT<<
"("<<black->
GetPDGCode()<<
"), wT="<<wT<<
"("
1238 Spin spin = (
G4UniformRand() < baryonLowSpin) ? SpinHalf : SpinThreeHalf;
1240 G4cout<<
"G4QString::CreateHadron: ----> Baryon is under creation"<<
G4endl;
1242 return CreateBaryon(black, white, spin);
1247 Spin spin = (
G4UniformRand() < mesonLowSpin) ? SpinZero : SpinOne;
1249 G4cout<<
"G4QString::CreateHadron: ----> Meson is under creation"<<
G4endl;
1251 return CreateMeson(black, white, spin);
1261 G4cout<<
"G4QString::CreateLowSpinHadron: ***Called***, bT="<<bT<<
"("<<black->
GetPDGCode()
1264 if(bT == 1 && wT == 1)
1267 G4cout<<
"G4QString::CreateLowSpinHadron: ----> Meson is under creation"<<
G4endl;
1269 return CreateMeson(black, white, SpinZero);
1274 G4cout<<
"G4QString::CreateLowSpinHadron: ----> Baryon is under creation"<<
G4endl;
1276 return CreateBaryon(black, white, SpinHalf);
1286 G4cout<<
"G4QString::CreateHighSpinHadron:***Called***, bT="<<bT<<
"("<<black->
GetPDGCode()
1289 if(bT == 1 && wT == 1)
1292 G4cout<<
"G4QString::CreateHighSpinHadron: ----> Meson is created"<<
G4endl;
1294 return CreateMeson(black,white, SpinOne);
1299 G4cout<<
"G4QString::CreateHighSpinHadron: ----> Baryon is created"<<
G4endl;
1301 return CreateBaryon(black,white,SpinThreeHalf);