72 for(
G4int i=0; i<3; i++)
73 {
for(
G4int j=0; j<3; j++)
74 {
for(
G4int k=0; k<6; k++)
167 for(
G4int i=0; i<3; i++)
168 {
for(
G4int j=0; j<3; j++)
169 {
for(
G4int k=0; k<3; k++)
170 {
for(
G4int l=0; l<4; l++)
400 for (
G4int i=0 ; i<35 ; i++ ) {
418 G4int Number_of_quarks=0;
419 G4int Number_of_squarks=0;
421 G4double StringM=
string->Get4Momentum().mag();
425 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
436 G4int q2=(Qleft/100)%10;
449 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
456 G4int q1=Qright/1000;
460 G4int q2=(Qright/100)%10;
473 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
478 if(Number_of_quarks==2){EstimatedMass += 70.*
MeV;}
480 if(Number_of_quarks==3)
482 if(Number_of_squarks==0) {EstimatedMass += 740.*
MeV;}
483 if(Number_of_squarks==1) {EstimatedMass += 740.*
MeV;}
484 if(Number_of_squarks==2) {EstimatedMass += 400.*
MeV;}
485 if(Number_of_squarks==3) {EstimatedMass += 382.*
MeV;}
487 if(Number_of_quarks==4)
489 if((StringM > 1880.) && ( EstimatedMass < 2100)) {EstimatedMass = 2020.;}
491 else if((StringM > 2232.) && ( EstimatedMass < 2730)){EstimatedMass = 2570.;}
492 else if((StringM > 5130.) && ( EstimatedMass < 3450)){EstimatedMass = 5130.;}
496 if(EstimatedMass <= 1600.*
MeV){EstimatedMass-=200.*
MeV;}
497 else {EstimatedMass+=100.*
MeV;}
501 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
526 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
530 <<
"------------------------------------"<<
G4endl;
544 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
545 G4cout<<
"Non fragmentable - the string is converted to one hadron "<<
G4endl;
552 LeftVector->operator[](0)->SetPosition(theString.
GetPosition());
554 if(LeftVector->size() > 1)
558 LeftVector->operator[](1)->SetPosition(theString.
GetPosition());
563 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
572 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
577 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
580 G4cout<<G4endl<<
"LUND StringFragm: String Mass "
583 <<
"------------------------------------"<<
G4endl;
590 delete theStringInCMS;
602 while(!RightVector->empty())
604 LeftVector->push_back(RightVector->back());
605 RightVector->erase(RightVector->end()-1);
616 for(
size_t C1 = 0;
C1 < LeftVector->size();
C1++)
621 Momentum = toObserverFrame*Momentum;
625 Momentum = toObserverFrame*Coordinate;
628 Hadron->
SetPosition(PositionOftheStringCreation+aPosition);
664 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
665 G4cout<<
"Split last-----------------------------------------"<<
G4endl;
668 G4ThreeVector ClusterVel=
string->Get4Momentum().boostVector();
676 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
677 G4cout<<
"StrMass "<<StringMass<<
" q "
678 <<
string->GetLeftParton()->GetParticleName()<<
" "
679 <<
string->GetRightParton()->GetParticleName()<<
G4endl;
682 string->SetLeftPartonStable();
717 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
723 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
735 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
736 G4cout<<
"Selected LeftHad RightHad "<<sampledState<<
" "
749 LeftMom.boost(ClusterVel);
750 RightMom.boost(ClusterVel);
752 LeftVector->push_back(
new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
753 RightVector->push_back(
new G4KineticTrack(RightHadron, 0, Pos, RightMom));
769 #ifdef debug_LUNDfragmentation
770 G4cout<<
"Sampling of momenta of 2 last produced hadrons ----------------"<<
G4endl;
771 G4cout<<
"Masses "<<InitialMass<<
" "<<Mass<<
" "<<AntiMass<<
G4endl;
774 if((Mass > 930. || AntiMass > 930.) && (
G4UniformRand() < ProbIsotropy))
777 G4double r_val =
sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) -
778 sqr(2.*Mass*AntiMass);
779 G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
784 G4double st = std::sqrt(1. - pz * pz)*Pabs;
790 Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
791 Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
793 AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
794 AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
799 const G4int maxNumberOfLoops = 1000;
800 G4int loopCounter = 0;
805 G4double termD = InitialMass*InitialMass -Mass*Mass - AntiMass*AntiMass;
807 G4double termN = 2*termD + 4*Mass*Mass + 4*AntiMass*AntiMass;
808 G4double pt2max=(termD*termD - termab )/ termN ;
813 MassMt2 = Mass * Mass + Pt2;
814 AntiMassMt2= AntiMass * AntiMass + Pt2;
816 AvailablePz2=
sqr(InitialMass*InitialMass - MassMt2 - AntiMassMt2) -
817 4.*MassMt2*AntiMassMt2;
819 while( (AvailablePz2 < 0.) &&
820 ++loopCounter < maxNumberOfLoops );
822 if ( loopCounter >= maxNumberOfLoops ) {
826 AvailablePz2 /=(4.*InitialMass*InitialMass);
827 AvailablePz = std::sqrt(AvailablePz2);
832 Mom->setPx(Px); Mom->setPy(Py); Mom->setPz(AvailablePz);
833 Mom->setE(std::sqrt(MassMt2+AvailablePz2));
835 AntiMom->setPx(-Px); AntiMom->setPy(-Py); AntiMom->setPz(-AvailablePz);
836 AntiMom->setE (std::sqrt(AntiMassMt2+AvailablePz2));
846 G4double StringMT2=
string->MassT2();
847 G4double StringMT =std::sqrt(StringMT2);
853 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
855 G4cout<<
"String 4 mom, String M and Mt "<<String4Momentum<<
" "<<String4Momentum.mag()<<
" "<<std::sqrt(StringMT2)<<
G4endl;
863 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
864 G4cout<<
"Mass of the string is not sufficient to produce the hadron!"<<
G4endl;
869 String4Momentum.setPz(0.);
874 G4double HadronMassT2, ResidualMassT2;
884 RemSysPt = StringPt - HadronPt;
886 HadronMassT2 =
sqr(HadronMass) + HadronPt.mag2();
889 }
while(std::sqrt(HadronMassT2) + std::sqrt(ResidualMassT2) > StringMT);
894 G4double Pz2 = (
sqr(StringMT2 - HadronMassT2 - ResidualMassT2) -
895 4*HadronMassT2 * ResidualMassT2)/4./StringMT2;
897 if(Pz2 < 0 ) {
return 0;}
902 G4double zMin = (std::sqrt(HadronMassT2+Pz2) - Pz)/std::sqrt(StringMT2);
904 G4double zMax = (std::sqrt(HadronMassT2+Pz2) + Pz)/std::sqrt(StringMT2);
906 if (zMin >= zMax)
return 0;
910 HadronPt.x(), HadronPt.y());
916 (z *
string->LightConeDecay() -
917 HadronMassT2/(z *
string->LightConeDecay())));
918 G4double HadronE = 0.5* (z *
string->LightConeDecay() +
919 HadronMassT2/(z *
string->LightConeDecay()));
922 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
923 G4cout<<
"string->LightConeDecay() "<<
string->LightConeDecay()<<
G4endl;
924 G4cout<<
"HadronPt,HadronE "<<HadronPt<<
" "<<HadronE<<
G4endl;
935 G4int PDGEncodingOfDecayParton,
942 G4double Mt2 = Px*Px + Py*Py + Mass*Mass;
945 G4double zOfMaxyf(0.), maxYf(1.),
z(0.), yf(1.);
946 if(std::abs(PDGEncodingOfDecayParton) < 1000)
952 zOfMaxyf=alund*Mt2/(alund*Mt2 + 1.);
953 maxYf=(1-zOfMaxyf)/zOfMaxyf *
G4Exp(-alund*Mt2/zOfMaxyf);
955 const G4int maxNumberOfLoops = 1000;
956 G4int loopCounter = 0;
963 while ( (
G4UniformRand()*maxYf > yf) && ++loopCounter < maxNumberOfLoops );
964 if ( loopCounter >= maxNumberOfLoops ) {
965 z = 0.5*(zmin + zmax);
970 if(std::abs(PDGEncodingOfDecayParton) > 1000)
1014 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
1020 G4bool final_success=
false;
1021 G4bool inner_success=
true;
1030 LeftVector->clear();
1032 RightVector->clear();
1036 const G4int maxNumberOfLoops = 1000;
1037 G4int loopCounter = -1;
1038 while ( (!
StopFragmenting(currentString)) && ++loopCounter < maxNumberOfLoops )
1040 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
1048 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
1055 LeftVector->push_back(Hadron);
1058 RightVector->push_back(Hadron);
1060 delete currentString;
1061 currentString=newString;
1064 if ( loopCounter >= maxNumberOfLoops ) {
1065 inner_success=
false;
1068 #ifdef debug_LUNDfragmentation // Uzhi 20.06.2014
1069 G4cout<<
"Split remaining string into 2 final hadrons."<<
G4endl;
1072 if ( inner_success &&
SplitLast(currentString, LeftVector, RightVector) )
1078 delete currentString;
1080 return final_success;
1089 G4double StringMass =
string->Mass();
1090 G4int cClusterInterrupt = 0;
1099 G4int LeftQuark1=
string->GetLeftParton()->GetPDGEncoding()/1000;
1100 G4int LeftQuark2=(
string->GetLeftParton()->GetPDGEncoding()/100)%10;
1102 G4int RightQuark1=
string->GetRightParton()->GetPDGEncoding()/1000;
1103 G4int RightQuark2=(
string->GetRightParton()->GetPDGEncoding()/100)%10;
1122 while ((StringMass <= LeftHadron->GetPDGMass() + RightHadron->
GetPDGMass()));
1135 G4double StringMass =
string->Mass();
1142 Anti_Di_Quark =
string->GetLeftParton();
1143 Di_Quark=
string->GetRightParton();
1146 Anti_Di_Quark =
string->GetRightParton();
1147 Di_Quark=
string->GetLeftParton();
1151 G4int AbsIDAnti_di_quark =std::abs(IDAnti_di_quark);
1153 G4int AbsIDdi_quark =std::abs(IDdi_quark);
1155 G4int ADi_q1=AbsIDAnti_di_quark/1000;
1156 G4int ADi_q2=(AbsIDAnti_di_quark-ADi_q1*1000)/100;
1158 G4int Di_q1=AbsIDdi_quark/1000;
1159 G4int Di_q2=(AbsIDdi_quark-Di_q1*1000)/100;
1162 for(
G4int ProdQ=1; ProdQ < 4; ProdQ++)
1165 const G4int maxNumberOfLoops = 1000;
1166 G4int loopCounter = 0;
1170 -
Baryon[ADi_q1-1][ADi_q2-1][ProdQ-1][StateADiQ]);
1176 const G4int maxNumberOfInternalLoops = 1000;
1177 G4int internalLoopCounter = 0;
1181 +
Baryon[Di_q1-1][Di_q2-1][ProdQ-1][StateDiQ]);
1184 if(StringMass > LeftHadronMass + RightHadronMass)
1189 G4Exception(
"G4LundStringFragmentation::Diquark_AntiDiquark_aboveThreshold_lastSplitting ",
1195 sqr(RightHadronMass));
1210 }
while( (
Baryon[Di_q1-1][Di_q2-1][ProdQ-1][StateDiQ]!=0) &&
1211 ++internalLoopCounter < maxNumberOfInternalLoops );
1212 if ( internalLoopCounter >= maxNumberOfInternalLoops ) {
1217 }
while( (
Baryon[ADi_q1-1][ADi_q2-1][ProdQ-1][StateADiQ]!=0) &&
1218 ++loopCounter < maxNumberOfLoops );
1219 if ( loopCounter >= maxNumberOfLoops ) {
1233 G4double StringMass =
string->Mass();
1241 Quark =
string->GetLeftParton();
1242 Di_Quark=
string->GetRightParton();
1245 Quark =
string->GetRightParton();
1246 Di_Quark=
string->GetLeftParton();
1250 G4int AbsIDquark =std::abs(IDquark);
1252 G4int AbsIDdi_quark=std::abs(IDdi_quark);
1253 G4int Di_q1=AbsIDdi_quark/1000;
1254 G4int Di_q2=(AbsIDdi_quark-Di_q1*1000)/100;
1257 if(IDdi_quark < 0) SignDiQ=-1;
1260 for(
G4int ProdQ=1; ProdQ < 4; ProdQ++)
1265 if(IDquark == 2) SignQ= 1;
1266 if((IDquark == 1) && (ProdQ == 3)) SignQ= 1;
1267 if((IDquark == 3) && (ProdQ == 1)) SignQ=-1;
1271 if(IDquark == -2) SignQ=-1;
1272 if((IDquark ==-1) && (ProdQ == 3)) SignQ=-1;
1273 if((IDquark ==-3) && (ProdQ == 1)) SignQ= 1;
1276 if(AbsIDquark == ProdQ) SignQ= 1;
1282 const G4int maxNumberOfLoops = 1000;
1283 G4int loopCounter = 0;
1287 Meson[AbsIDquark-1][ProdQ-1][StateQ]);
1291 const G4int maxNumberOfInternalLoops = 1000;
1292 G4int internalLoopCounter = 0;
1296 Baryon[Di_q1-1][Di_q2-1][ProdQ-1][StateDiQ]);
1299 if(StringMass > LeftHadronMass + RightHadronMass)
1304 G4Exception(
"G4LundStringFragmentation::Quark_Diquark_lastSplitting ",
1310 sqr(RightHadronMass));
1324 }
while( (
Baryon[Di_q1-1][Di_q2-1][ProdQ-1][StateDiQ]!=0) &&
1325 ++internalLoopCounter < maxNumberOfInternalLoops );
1326 if ( internalLoopCounter >= maxNumberOfInternalLoops ) {
1331 }
while( (
Meson[AbsIDquark-1][ProdQ-1][StateQ]!=0) &&
1332 ++loopCounter < maxNumberOfLoops );
1333 if ( loopCounter >= maxNumberOfLoops ) {
1347 G4double StringMass =
string->Mass();
1355 Quark =
string->GetLeftParton();
1356 Anti_Quark=
string->GetRightParton();
1359 Quark =
string->GetRightParton();
1360 Anti_Quark=
string->GetLeftParton();
1364 G4int AbsIDquark =std::abs(IDquark);
1366 G4int AbsIDanti_quark=std::abs(IDanti_quark);
1369 for(
G4int ProdQ=1; ProdQ < 4; ProdQ++)
1372 if(IDquark == 2) SignQ= 1;
1373 if((IDquark == 1) && (ProdQ == 3)) SignQ= 1;
1374 if((IDquark == 3) && (ProdQ == 1)) SignQ=-1;
1375 if(IDquark == ProdQ) SignQ= 1;
1378 if(IDanti_quark == -2) SignAQ=-1;
1379 if((IDanti_quark ==-1) && (ProdQ == 3)) SignAQ=-1;
1380 if((IDanti_quark ==-3) && (ProdQ == 1)) SignAQ= 1;
1381 if(AbsIDanti_quark == ProdQ) SignAQ= 1;
1384 const G4int maxNumberOfLoops = 1000;
1385 G4int loopCounter = 0;
1389 Meson[AbsIDquark-1][ProdQ-1][StateQ]);
1393 const G4int maxNumberOfInternalLoops = 1000;
1394 G4int internalLoopCounter = 0;
1398 Meson[AbsIDanti_quark-1][ProdQ-1][StateAQ]);
1401 if(StringMass > LeftHadronMass + RightHadronMass)
1406 G4Exception(
"G4LundStringFragmentation::Quark_AntiQuark_lastSplitting ",
1412 sqr(RightHadronMass));
1433 }
while( (
Meson[AbsIDanti_quark-1][ProdQ-1][StateAQ]!=0) &&
1434 ++internalLoopCounter < maxNumberOfInternalLoops );
1435 if ( internalLoopCounter >= maxNumberOfInternalLoops ) {
1440 }
while( (
Meson[AbsIDquark-1][ProdQ-1][StateQ]!=0) &&
1441 ++loopCounter < maxNumberOfLoops );
1442 if ( loopCounter >= maxNumberOfLoops ) {
1466 G4int indexPosition = 0;
1472 if(Sum >= ksi)
break;
1474 return indexPosition;
1491 G4int Swap = stableQuarkEncoding;
1492 stableQuarkEncoding = decayQuarkEncoding;
1493 decayQuarkEncoding = Swap;
1496 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
1507 G4int QuarkEncoding=QuarkPair.second->GetPDGEncoding();
1508 G4int i10 =
std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
1509 G4int i20 =
std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
1511 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
1529 created = QuarkPair.second;
virtual G4KineticTrackVector * FragmentString(const G4ExcitedString &theString)
G4double Mass_of_heavy_quark
G4ParticleDefinition * GetRightParton(void) const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4bool Quark_AntiQuark_lastSplitting(G4FragmentingString *&string, G4ParticleDefinition *&LeftHadron, G4ParticleDefinition *&RightHadron)
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition *pHadron, G4FragmentingString *string, G4FragmentingString *newString)
CLHEP::HepLorentzRotation G4LorentzRotation
G4double Mass_of_string_junction
const G4ThreeVector & GetPosition() const
G4ExcitedString * CPExcited(const G4ExcitedString &string)
virtual G4bool IsFragmentable(const G4FragmentingString *const string)
void SetFormationTime(G4double aFormationTime)
void SetStrangenessSuppression(G4double aValue)
const G4LorentzVector & Get4Momentum() const
G4double MesonWeight[3][3][6]
G4ParticleDefinition * Build(G4ParticleDefinition *black, G4ParticleDefinition *white)
G4bool Quark_Diquark_lastSplitting(G4FragmentingString *&string, G4ParticleDefinition *&LeftHadron, G4ParticleDefinition *&RightHadron)
G4int StringLoopInterrupt
G4Parton * GetLeftParton(void) const
G4int ClusterLoopInterrupt
G4int GetPDGEncoding() const
G4ThreeVector SampleQuarkPt(G4double ptMax=-1.)
std::vector< G4double > vectorMesonMix
const G4String & GetParticleSubType() const
virtual void SetMassCut(G4double aValue)
const G4String & GetParticleName() const
G4ParticleDefinition * GetDecayParton() const
virtual G4double GetLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding, G4ParticleDefinition *pHadron, G4double Px, G4double Py)
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true)
void SetStringTensionParameter(G4double aValue)
const G4ThreeVector & GetPosition() const
virtual void Sample4Momentum(G4LorentzVector *Mom, G4double Mass, G4LorentzVector *AntiMom, G4double AntiMass, G4double InitialMass)
G4ParticleDefinition * GetLeftParton(void) const
void SetDiquarkBreakProbability(G4double aValue)
G4double GetStrangeSuppress()
void SetMinimalStringMass2(const G4double aValue)
G4GLOB_DLL std::ostream G4cout
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString *const theString)
G4LorentzVector Get4Momentum() const
G4bool Loop_toFragmentString(G4ExcitedString *&theStringInCMS, G4KineticTrackVector *&LeftVector, G4KineticTrackVector *&RightVector)
G4double GetFormationTime() const
std::pair< G4ParticleDefinition *, G4ParticleDefinition * > pDefPair
void SetMinimalStringMass(const G4FragmentingString *const string)
G4LorentzRotation TransformToAlignedCms()
G4ParticleDefinition * FindParticle(G4int Encoding)
void SetPosition(const G4ThreeVector aPosition)
virtual G4bool StopFragmenting(const G4FragmentingString *const string)
G4int GetDecayDirection() const
void Set4Momentum(const G4LorentzVector &a4Momentum)
G4LundStringFragmentation()
G4double lambda(G4double s, G4double m1_Sqr, G4double m2_Sqr)
G4bool FourQuarkString(void) const
std::vector< G4double > scalarMesonMix
virtual G4ParticleDefinition * DiQuarkSplitup(G4ParticleDefinition *decay, G4ParticleDefinition *&created)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4Parton * GetRightParton(void) const
virtual ~G4LundStringFragmentation()
G4HadronBuilder * hadronizer
G4double GetPDGMass() const
G4bool Diquark_AntiDiquark_aboveThreshold_lastSplitting(G4FragmentingString *&string, G4ParticleDefinition *&LeftHadron, G4ParticleDefinition *&RightHadron)
static G4ParticleTable * GetParticleTable()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double MinimalStringMass
G4double Mass_of_light_quark
G4double GetTimeOfCreation() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double DiquarkBreakProb
G4int GetDirection(void) const
G4ParticleDefinition * FS_LeftHadron[35]
G4bool Diquark_AntiDiquark_belowThreshold_lastSplitting(G4FragmentingString *&string, G4ParticleDefinition *&LeftHadron, G4ParticleDefinition *&RightHadron)
virtual G4bool SplitLast(G4FragmentingString *string, G4KineticTrackVector *LeftVector, G4KineticTrackVector *RightVector)
const G4LorentzVector & Get4Momentum() const
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *)
const G4ParticleDefinition * GetDefinition() const
G4double MinimalStringMass2
static const double fermi
G4double BaryonWeight[3][3][3][4]
G4KineticTrack * Splitup(G4FragmentingString *string, G4FragmentingString *&newString)
G4ParticleDefinition * FS_RightHadron[35]
void SetDiquarkSuppression(G4double aValue)
CLHEP::HepLorentzVector G4LorentzVector