85 alaC = an - arho/2.0 + aJPs/2.0;
86 alaB = an - arho/2.0 + aUps/2.0;
99 G4int Index[5][5] = { { 0, 1, 2, 3, 4 },
102 { 3, 7, 10, 12, 13 },
103 { 4, 8, 11, 13, 14 } };
104 for (
G4int i = 0; i < 5; i++ ) {
105 for (
G4int j = 0; j < 5; j++ ) {
106 IndexDiQ[i][j] = Index[i][j];
122 #ifdef debug_QGSMfragmentation
126 <<
"------------------------------------"<<
G4endl;
141 if ( !IsItFragmentable(&aString) ) {
144 #ifdef debug_QGSMfragmentation
145 if ( LeftVector != 0 )
G4cout<<
"Non fragmentable - the string is converted to one hadron "<<
G4endl;
152 #ifdef debug_QGSMfragmentation
162 G4bool success=
false, inner_sucess=
true;
166 #ifdef debug_QGSMfragmentation
177 RightVector->clear();
180 const G4int maxNumberOfLoops = 1000;
181 G4int loopCounter = -1;
182 while (! StopFragmenting(currentString) && ++loopCounter < maxNumberOfLoops )
185 #ifdef debug_QGSMfragmentation
193 #ifdef debug_QGSMfragmentation
198 LeftVector->push_back(Hadron);
200 RightVector->push_back(Hadron);
202 delete currentString;
203 currentString=newString;
207 #ifdef debug_QGSMfragmentation
208 G4cout<<
"abandon ... start from the beginning ---------------"<<
G4endl;
212 if (newString)
delete newString;
217 if ( loopCounter >= maxNumberOfLoops ) {
222 #ifdef debug_QGSMfragmentation
224 G4cout<<
"Split remaining string into 2 final hadrons."<<
G4endl;
231 SplitLast(currentString,LeftVector, RightVector) )
235 delete currentString;
238 delete theStringInCMS;
250 while(!RightVector->empty())
252 LeftVector->push_back(RightVector->back());
253 RightVector->erase(RightVector->end()-1);
261 for (
size_t C1 = 0;
C1 < LeftVector->size();
C1++)
265 Momentum = toObserverFrame*Momentum;
268 Momentum = toObserverFrame*Coordinate;
306 #ifdef debug_QGSMfragmentation
308 G4cout<<
"Start SplitUP (G4VLongitudinalStringDecay) ========================="<<
G4endl;
309 G4cout<<
"String partons: " <<
string->GetLeftParton()->GetPDGEncoding()<<
" "
310 <<
string->GetRightParton()->GetPDGEncoding()<<
" "
311 <<
"Direction " <<
string->GetDecayDirection()<<
G4endl;
318 string->SetLeftPartonStable();
321 string->SetRightPartonStable();
326 if (string->DecayIsQuark())
330 G4int NumberOfpossibleBaryons = 2;
332 if (string->GetLeftParton()->GetParticleSubType() !=
"quark") NumberOfpossibleBaryons++;
333 if (string->GetRightParton()->GetParticleSubType() !=
"quark") NumberOfpossibleBaryons++;
336 ActualProb *= (1.0-
G4Exp(2.0*(1.0 - string->Mass()/(NumberOfpossibleBaryons*1400.0))));
340 HadronDefinition=
QuarkSplitup(string->GetDecayParton(), newStringEnd);
344 HadronDefinition= DiQuarkSplitup(string->GetDecayParton(), newStringEnd);
347 if ( HadronDefinition == NULL )
return NULL;
349 #ifdef debug_QGSMfragmentation
353 G4cout<<
"The side of the string decay Left/Right (1/-1) "<<SideOfDecay<<
G4endl;
360 #ifdef debug_QGSMfragmentation
361 G4cout<<
"An attempt to determine its energy (SplitEandP)"<<
G4endl;
363 G4LorentzVector* HadronMomentum=SplitEandP(HadronDefinition,
string, newString);
365 delete newString; newString=0;
368 if ( HadronMomentum != 0 ) {
370 #ifdef debug_QGSMfragmentation
378 delete HadronMomentum;
382 #ifdef debug_QGSMfragmentation
387 #ifdef debug_VStringDecay
388 G4cout<<
"End SplitUP (G4VLongitudinalStringDecay) ====================="<<
G4endl;
402 G4int stableQuarkEncoding =
decay->GetPDGEncoding()/1000;
403 G4int decayQuarkEncoding = (
decay->GetPDGEncoding()/100)%10;
407 G4int Swap = stableQuarkEncoding;
408 stableQuarkEncoding = decayQuarkEncoding;
409 decayQuarkEncoding = Swap;
412 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
420 G4int QuarkEncoding=QuarkPair.second->GetPDGEncoding();
421 G4int i10 = std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
422 G4int i20 = std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
424 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
437 G4int IsParticle=(
decay->GetPDGEncoding()>0) ? +1 : -1;
443 created = QuarkPair.second;
446 NewQuark = created->GetPDGEncoding();
465 #ifdef debug_QGSMfragmentation
467 G4cout<<
"String 4 mom, String M "<<
string->Get4Momentum()<<
" "<<
string->Mass()<<
G4endl;
474 #ifdef debug_QGSMfragmentation
475 G4cout<<
"Mass of the string is not sufficient to produce the hadron!"<<
G4endl;
481 G4double StringMT2 =
string->MassT2();
482 G4double StringMT = std::sqrt(StringMT2);
485 String4Momentum.
setPz(0.);
489 G4double HadronMassT2, ResidualMassT2;
501 Pt2 =
sqr(HadronMt)-
sqr(HadronMass); Pt=std::sqrt(Pt2);
504 HadronPt =SampleQuarkPtw +
string->DecayPt();
506 RemSysPt = StringPt - HadronPt;
508 HadronMassT2 =
sqr(HadronMass) + HadronPt.mag2();
511 }
while (std::sqrt(HadronMassT2) + std::sqrt(ResidualMassT2) > StringMT);
516 G4double Pz2 = (
sqr(StringMT2 - HadronMassT2 - ResidualMassT2) -
517 4*HadronMassT2 * ResidualMassT2)/4./StringMT2;
519 if ( Pz2 < 0 ) {
return 0;}
524 G4double zMin = (std::sqrt(HadronMassT2+Pz2) - Pz)/std::sqrt(StringMT2);
525 G4double zMax = (std::sqrt(HadronMassT2+Pz2) + Pz)/std::sqrt(StringMT2);
527 if (zMin >= zMax)
return 0;
529 G4double z = GetLightConeZ(zMin, zMax,
530 string->GetDecayParton()->GetPDGEncoding(), pHadron,
531 HadronPt.x(), HadronPt.y());
536 HadronPt.setZ( 0.5* string->GetDecayDirection() *
537 (z * string->LightConeDecay() -
538 HadronMassT2/(z * string->LightConeDecay())) );
539 G4double HadronE = 0.5* (z *
string->LightConeDecay() +
540 HadronMassT2/(z * string->LightConeDecay()) );
544 #ifdef debug_QGSMfragmentation
545 G4cout<<
"string->GetDecayDirection() string->LightConeDecay() "
546 <<
string->GetDecayDirection()<<
" "<<
string->LightConeDecay()<<
G4endl;
547 G4cout<<
"HadronPt,HadronE "<<HadronPt<<
" "<<HadronE<<
G4endl;
561 #ifdef debug_QGSMfragmentation
562 G4cout<<
"GetLightConeZ zmin zmax Parton pHadron "<<zmin<<
" "<<zmax<<
" "
567 G4int DiQold(0), DiQnew(0);
569 G4double invD1(0.),invD2(0.), r1(0.),r2(0.),r12(0.);
580 if ( (absDecayQuarkCode < 6) && (absNewQuarkCode < 6) ) {
581 d1 = FFq2q[absDecayQuarkCode-1][absNewQuarkCode-1][0]; d2 = FFq2q[absDecayQuarkCode-1][absNewQuarkCode-1][1];
584 if ( (absDecayQuarkCode < 6) && (absNewQuarkCode > 6) ) {
585 qA = absNewQuarkCode/1000; qB = (absNewQuarkCode % 1000)/100; DiQnew = IndexDiQ[qA-1][qB-1];
586 d1 = FFq2qq[absDecayQuarkCode-1][DiQnew][0]; d2 = FFq2q[absDecayQuarkCode-1][DiQnew][1];
589 if ( (absDecayQuarkCode > 6) && (absNewQuarkCode < 6) ) {
590 q1 = absDecayQuarkCode/1000; q2 = (absDecayQuarkCode % 1000)/100; DiQold = IndexDiQ[q1-1][q2-1];
591 d1 = FFqq2q[DiQold][absNewQuarkCode-1][0]; d2 = FFqq2q[DiQold][absNewQuarkCode-1][1];
595 q1 = absDecayQuarkCode/1000; q2 = (absDecayQuarkCode % 1000)/100; DiQold = IndexDiQ[q1-1][q2-1];
596 qA = absNewQuarkCode/1000; qB = (absNewQuarkCode % 1000)/100; DiQnew = IndexDiQ[qA-1][qB-1];
597 d1 = FFqq2qq[DiQold][DiQnew][0]; d2 = FFqq2qq[DiQold][DiQnew][1];
603 invD1=1./d1; invD2=1./d2;
605 const G4int maxNumberOfLoops = 10000;
606 G4int loopCounter = 0;
613 }
while ( ( (r12 > 1.0) || !((zmin <= z)&&(z <= zmax))) &&
614 ++loopCounter < maxNumberOfLoops );
616 if ( loopCounter >= maxNumberOfLoops ) {
617 z = 0.5*(zmin + zmax);
631 G4ThreeVector ClusterVel =
string->Get4Momentum().boostVector();
632 G4double ResidualMass =
string->Mass();
634 #ifdef debug_QGSMfragmentation
635 G4cout<<
"Split last-----------------------------------------"<<
G4endl;
636 G4cout<<
"StrMass "<<ResidualMass<<
" q's "
637 <<
string->GetLeftParton()->GetParticleName()<<
" "
638 <<
string->GetRightParton()->GetParticleName()<<
G4endl;
641 G4int cClusterInterrupt = 0;
644 const G4int maxNumberOfLoops = 1000;
645 G4int loopCounter = 0;
654 string->SetLeftPartonStable();
656 if (string->DecayIsQuark() && string->StableIsQuark() )
660 G4int IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
664 quark = QuarkPair.second;
666 LeftHadron=
hadronizer->
Build(QuarkPair.first, string->GetLeftParton());
667 if ( LeftHadron == NULL )
continue;
669 if ( RightHadron == NULL )
continue;
670 }
else if( (!string->DecayIsQuark() && string->StableIsQuark() ) ||
671 ( string->DecayIsQuark() && !string->StableIsQuark() ) ) {
674 if ( string->StableIsQuark() ) {
675 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
677 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
686 quark = QuarkPair.second;
687 LeftHadron=
hadronizer->
Build(QuarkPair.first, string->GetLeftParton());
688 if ( LeftHadron == NULL )
continue;
690 if ( RightHadron == NULL )
continue;
693 G4int LeftQuark1=
string->GetLeftParton()->GetPDGEncoding()/1000;
694 G4int LeftQuark2=(
string->GetLeftParton()->GetPDGEncoding()/100)%10;
695 G4int RightQuark1=
string->GetRightParton()->GetPDGEncoding()/1000;
696 G4int RightQuark2=(
string->GetRightParton()->GetPDGEncoding()/100)%10;
704 if ( (LeftHadron == NULL) || (RightHadron == NULL) )
continue;
709 }
while ( ( ResidualMass <= LeftHadronMass + RightHadronMass )
710 && ++loopCounter < maxNumberOfLoops );
712 if ( loopCounter >= maxNumberOfLoops ) {
719 Sample4Momentum(&LeftMom , LeftHadron->
GetPDGMass() ,
720 &RightMom, RightHadron->
GetPDGMass(), ResidualMass);
721 LeftMom.
boost(ClusterVel);
722 RightMom.
boost(ClusterVel);
724 #ifdef debug_QGSMfragmentation
741 #ifdef debug_QGSMfragmentation
742 G4cout<<
"Sample4Momentum Last-----------------------------------------"<<
G4endl;
743 G4cout<<
" StrMass "<<InitialMass<<
" Mass1 "<<Mass<<
" Mass2 "<<AntiMass<<
G4endl;
747 G4double r_val =
sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) -
sqr(2.*Mass*AntiMass);
748 G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
752 G4double st = std::sqrt(1. - pz * pz)*Pabs;
759 Mom->
setE(std::sqrt(Pabs*Pabs + Mass*Mass));
762 AntiMom->
setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
767void G4QGSMFragmentation::SetFFq2q()
769 for (
G4int i=0; i < 5; i++) {
770 FFq2q[i][0][0] = 2.0 ; FFq2q[i][0][1] = -arho + alft;
771 FFq2q[i][1][0] = 2.0 ; FFq2q[i][1][1] = -arho + alft;
772 FFq2q[i][2][0] = 1.0 ; FFq2q[i][2][1] = -aphi + alft;
773 FFq2q[i][3][0] = 1.0 ; FFq2q[i][3][1] = -aJPs + alft;
774 FFq2q[i][4][0] = 1.0 ; FFq2q[i][4][1] = -aUps + alft;
780void G4QGSMFragmentation::SetFFq2qq()
782 for (
G4int i=0; i < 5; i++) {
783 FFq2qq[i][ 0][0] = 0.0 ; FFq2qq[i][ 0][1] = arho - 2.0*an + alft;
784 FFq2qq[i][ 1][0] = 0.0 ; FFq2qq[i][ 1][1] = arho - 2.0*an + alft;
785 FFq2qq[i][ 2][0] = 0.0 ; FFq2qq[i][ 2][1] = arho - 2.0*ala + alft;
786 FFq2qq[i][ 3][0] = 0.0 ; FFq2qq[i][ 3][1] = arho - 2.0*alaC + alft;
787 FFq2qq[i][ 4][0] = 0.0 ; FFq2qq[i][ 4][1] = arho - 2.0*alaB + alft;
788 FFq2qq[i][ 5][0] = 0.0 ; FFq2qq[i][ 5][1] = arho - 2.0*an + alft;
789 FFq2qq[i][ 6][0] = 0.0 ; FFq2qq[i][ 6][1] = arho - 2.0*ala + alft;
790 FFq2qq[i][ 7][0] = 0.0 ; FFq2qq[i][ 7][1] = arho - 2.0*alaC + alft;
791 FFq2qq[i][ 8][0] = 0.0 ; FFq2qq[i][ 8][1] = arho - 2.0*alaB + alft;
792 FFq2qq[i][ 9][0] = 0.0 ; FFq2qq[i][ 9][1] = arho - 2.0*aXi + alft;
793 FFq2qq[i][10][0] = 0.0 ; FFq2qq[i][10][1] = arho - 2.0*aXiC + alft;
794 FFq2qq[i][11][0] = 0.0 ; FFq2qq[i][11][1] = arho - 2.0*aXiB + alft;
795 FFq2qq[i][12][0] = 0.0 ; FFq2qq[i][12][1] = arho - 2.0*aXiCC + alft;
796 FFq2qq[i][13][0] = 0.0 ; FFq2qq[i][13][1] = arho - 2.0*aXiCB + alft;
797 FFq2qq[i][14][0] = 0.0 ; FFq2qq[i][14][1] = arho - 2.0*aXiBB + alft;
803void G4QGSMFragmentation::SetFFqq2q()
805 for (
G4int i=0; i < 15; i++) {
806 FFqq2q[i][0][0] = 2.0*(arho - an); FFqq2q[i][0][1] = -arho + alft;
807 FFqq2q[i][1][0] = 2.0*(arho - an); FFqq2q[i][1][1] = -arho + alft;
808 FFqq2q[i][2][0] = 2.0*(arho - an); FFqq2q[i][2][1] = -aphi + alft;
809 FFqq2q[i][3][0] = 2.0*(arho - an); FFqq2q[i][3][1] = -aJPs + alft;
810 FFqq2q[i][4][0] = 2.0*(arho - an); FFqq2q[i][4][1] = -aUps + alft;
816void G4QGSMFragmentation::SetFFqq2qq()
818 for (
G4int i=0; i < 15; i++) {
819 FFqq2qq[i][0][0] = 0. ; FFqq2qq[i][0][1] = 2.0*arho - 2.0*an -arho + alft;
820 FFqq2qq[i][1][0] = 0. ; FFqq2qq[i][1][1] = 2.0*arho - 2.0*an -arho + alft;
821 FFqq2qq[i][2][0] = 0. ; FFqq2qq[i][2][1] = 2.0*arho - 2.0*an -aphi + alft;
822 FFqq2qq[i][3][0] = 0. ; FFqq2qq[i][3][1] = 2.0*arho - 2.0*an -aJPs + alft;
823 FFqq2qq[i][4][0] = 0. ; FFqq2qq[i][4][1] = 2.0*arho - 2.0*an -aUps + alft;
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation inverse() const
HepLorentzVector & boost(double, double, double)
const G4ThreeVector & GetPosition() const
G4int GetDirection(void) const
G4LorentzRotation TransformToAlignedCms()
G4Parton * GetRightParton(void) const
G4Parton * GetLeftParton(void) const
G4LorentzVector Get4Momentum() const
G4int GetDecayDirection() const
G4ParticleDefinition * Build(G4ParticleDefinition *black, G4ParticleDefinition *white)
static G4HadronicParameters * Instance()
G4double GetFormationTime() const
void SetPosition(const G4ThreeVector aPosition)
void Set4Momentum(const G4LorentzVector &a4Momentum)
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetDefinition() const
void SetFormationTime(G4double aFormationTime)
const G4LorentzVector & Get4Momentum() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
const G4LorentzVector & Get4Momentum() const
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
virtual G4KineticTrackVector * FragmentString(const G4ExcitedString &theString)
G4HadronBuilder * hadronizer
G4double MinimalStringMass
void SetProbBBbar(G4double aValue)
std::pair< G4ParticleDefinition *, G4ParticleDefinition * > pDefPair
G4ParticleDefinition * FindParticle(G4int Encoding)
G4double GetStrangeSuppress()
G4KineticTrackVector * ProduceOneHadron(const G4ExcitedString *const theString)
virtual G4ParticleDefinition * QuarkSplitup(G4ParticleDefinition *decay, G4ParticleDefinition *&created)
G4int ClusterLoopInterrupt
void SetDiquarkSuppression(G4double aValue)
void SetStrangenessSuppression(G4double aValue)
G4int StringLoopInterrupt
void SetProbCCbar(G4double aValue)
void SetDiquarkBreakProbability(G4double aValue)
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true)
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *)
void SetMinimalStringMass(const G4FragmentingString *const string)
G4double DiquarkBreakProb
G4double GetDiquarkSuppress()
G4ExcitedString * CopyExcited(const G4ExcitedString &string)
ParticleList decay(Cluster *const c)
Carries out a cluster decay.