50 arho(0.5), aphi(0.),
an(-0.5), ala(-0.75), aksi(-1.), alft(0.5)
65 #ifdef debug_QGSMfragmentation
68 <<
"------------------------------------"<<
G4endl;
84 #ifdef debug_QGSMfragmentation
85 if ( LeftVector != 0 )
G4cout<<
"Non fragmentable - the string is converted to one hadron "<<
G4endl;
88 if ( LeftVector != 0 )
return LeftVector;
90 #ifdef debug_QGSMfragmentation
101 G4bool success=
false, inner_sucess=
true;
105 #ifdef debug_QGSMfragmentation
116 RightVector->clear();
119 const G4int maxNumberOfLoops = 1000;
120 G4int loopCounter = -1;
121 while (! StopFragmenting(currentString) && ++loopCounter < maxNumberOfLoops )
124 #ifdef debug_QGSMfragmentation
133 #ifdef debug_QGSMfragmentation
138 else RightVector->push_back(Hadron);
140 delete currentString;
141 currentString=newString;
145 #ifdef debug_QGSMfragmentation
146 G4cout<<
"abandon ... start from the beginning ---------------"<<
G4endl;
150 if (newString)
delete newString;
155 if ( loopCounter >= maxNumberOfLoops ) inner_sucess=
false;
158 #ifdef debug_QGSMfragmentation
159 G4cout<<
"Split remaining string into 2 final hadrons."<<
G4endl;
162 if ( inner_sucess && SplitLast(currentString,LeftVector, RightVector) )
166 delete currentString;
169 delete theStringInCMS;
181 while(!RightVector->empty())
183 LeftVector->push_back(RightVector->back());
184 RightVector->erase(RightVector->end()-1);
192 for(
size_t C1 = 0;
C1 < LeftVector->size();
C1++)
196 Momentum = toObserverFrame*Momentum;
199 Momentum = toObserverFrame*Coordinate;
212 #ifdef debug_QGSMfragmentation
218 G4double invD1(0.),invD2(0.), r1(0.),r2(0.),r12(0.);
220 G4int absCode = std::abs( PartonEncoding );
224 q1 = absHadronCode/1000; q2 = (absHadronCode % 1000)/100; q3 = (absHadronCode % 100)/10;
226 G4bool StrangeHadron = (q1 == 3) || (q2 == 3) || (q3 == 3);
230 if(absCode == 1 || absCode == 2)
232 if(absHadronCode < 1000)
234 if( !StrangeHadron ) {d1=2.0; d2 = -arho + alft;}
235 else {d1=1.0; d2 = -aphi + alft;}
238 if( !StrangeHadron ) {d1=0.0; d2 = arho - 2.0*an + alft;}
239 else {d1=0.0; d2 = 2.0*arho - 2.0*an - aphi + alft;}
242 else if(absCode == 3)
244 if(absHadronCode < 1000){d1=1.0 - aphi; d2 = -arho + alft;}
245 else {d1=1.0 - aphi; d2 = arho - 2.0*an + alft;}
247 }
else throw G4HadronicException(__FILE__, __LINE__,
"Unknown PDGencoding in G4QGSMFragmentation::G4LightConeZ");
249 #ifdef debug_QGSMfragmentation
255 invD1=1./
d1; invD2=1./
d2;
257 const G4int maxNumberOfLoops = 10000;
258 G4int loopCounter = 0;
265 }
while( ( (r12 > 1.0) || !((zmin <= z)&&(z <= zmax))) && ++loopCounter < maxNumberOfLoops );
266 if ( loopCounter >= maxNumberOfLoops ) {
267 z = 0.5*(zmin + zmax);
274 if(absCode == 1103 || absCode == 2101 ||
275 absCode == 2203 || absCode == 2103)
277 if(absHadronCode < 1000)
279 if( !StrangeHadron ) {d1=1.0; d2= arho - 2.0*an + alft;}
280 else {d1=1.0; d2 = 2.*arho - 2.0*an - aphi + alft;}
282 if( !StrangeHadron ) {d1=2.0*(arho - an); d2= -arho + alft;}
283 else {d1=2.0*(arho - an); d2 =-aphi + alft;}
286 #ifdef debug_QGSMfragmentation
291 invD1=1./
d1; invD2=1./
d2;
293 const G4int maxNumberOfLoops = 10000;
294 G4int loopCounter = 0;
301 }
while( ( (r12 > 1.0) || !((zmin <= z)&&(z <= zmax))) && ++loopCounter < maxNumberOfLoops );
302 if ( loopCounter >= maxNumberOfLoops ) {
303 z = 0.5*(zmin + zmax);
308 else if(absCode == 3101 || absCode == 3103 ||
309 absCode == 3201 || absCode == 3203)
311 d2 = (alft - (2.*ala - arho));
315 d2 = (alft - (2.*aksi - arho));
318 const G4int maxNumberOfLoops = 1000;
319 G4int loopCounter = 0;
326 while( (
G4UniformRand() > yf) && ++loopCounter < maxNumberOfLoops );
345 #ifdef debug_QGSMfragmentation
347 G4cout<<
"String 4 mom, String M "<<
string->Get4Momentum()<<
" "<<
string->Mass()<<
G4endl;
348 G4cout<<
"HadM MinimalStringMassLeft StringM hM+sM "<<HadronMass<<
" "<<MinimalStringMass<<
" "
349 <<
string->Mass()<<
" "<<HadronMass+MinimalStringMass<<
G4endl;
352 if(HadronMass + MinimalStringMass > string->
Mass())
354 #ifdef debug_QGSMfragmentation
355 G4cout<<
"Mass of the string is not sufficient to produce the hadron!"<<
G4endl;
361 G4double StringMT2 =
string->MassT2();
362 G4double StringMT = std::sqrt(StringMT2);
365 String4Momentum.
setPz(0.);
369 G4double HadronMassT2, ResidualMassT2;
379 RemSysPt = StringPt - HadronPt;
381 HadronMassT2 =
sqr(HadronMass) + HadronPt.mag2();
382 ResidualMassT2=
sqr(MinimalStringMass) + RemSysPt.
mag2();
384 }
while(std::sqrt(HadronMassT2) + std::sqrt(ResidualMassT2) > StringMT);
389 G4double Pz2 = (
sqr(StringMT2 - HadronMassT2 - ResidualMassT2) -
390 4*HadronMassT2 * ResidualMassT2)/4./StringMT2;
392 if(Pz2 < 0 ) {
return 0;}
397 G4double zMin = (std::sqrt(HadronMassT2+Pz2) - Pz)/std::sqrt(StringMT2);
398 G4double zMax = (std::sqrt(HadronMassT2+Pz2) + Pz)/std::sqrt(StringMT2);
410 if (zMin >= zMax)
return 0;
413 pHadron, HadronPt.x(), HadronPt.y());
419 HadronMassT2/(z *
string->LightConeDecay())));
420 G4double HadronE = 0.5* (z *
string->LightConeDecay() +
421 HadronMassT2/(z *
string->LightConeDecay()));
425 #ifdef debug_QGSMfragmentation
426 G4cout<<
"string->GetDecayDirection() string->LightConeDecay() "
427 <<
string->GetDecayDirection()<<
" "<<
string->LightConeDecay()<<
G4endl;
428 G4cout<<
"HadronPt,HadronE "<<HadronPt<<
" "<<HadronE<<
G4endl;
445 G4ThreeVector ClusterVel =
string->Get4Momentum().boostVector();
446 G4double ResidualMass =
string->Mass();
448 #ifdef debug_QGSMfragmentation
449 G4cout<<
"Split last-----------------------------------------"<<
G4endl;
450 G4cout<<
"StrMass "<<ResidualMass<<
" q's "
451 <<
string->GetLeftParton()->GetParticleName()<<
" "
452 <<
string->GetRightParton()->GetParticleName()<<
G4endl;
456 G4int cClusterInterrupt = 0;
458 const G4int maxNumberOfLoops = 1000;
459 G4int loopCounter = 0;
468 string->SetLeftPartonStable();
478 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
480 IsParticle=(
string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
484 quark = QuarkPair.second;
495 }
while ( (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->
GetPDGMass() + ClusterMassCut)
496 && ++loopCounter < maxNumberOfLoops );
498 if ( loopCounter >= maxNumberOfLoops ) {
505 Sample4Momentum(&LeftMom , LeftHadron->
GetPDGMass() ,
506 &RightMom, RightHadron->
GetPDGMass(), ResidualMass);
507 LeftMom.
boost(ClusterVel);
508 RightMom.
boost(ClusterVel);
510 #ifdef debug_QGSMfragmentation
516 LeftVector->push_back(
new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
517 RightVector->push_back(
new G4KineticTrack(RightHadron, 0, Pos, RightMom));
534 string->Get4Momentum().mag2();
542 G4double r_val =
sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) -
sqr(2.*Mass*AntiMass);
543 G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
547 G4double st = std::sqrt(1. - pz * pz)*Pabs;
554 Mom->
setE(std::sqrt(Pabs*Pabs + Mass*Mass));
557 AntiMom->
setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
576 G4int Swap = stableQuarkEncoding;
577 stableQuarkEncoding = decayQuarkEncoding;
578 decayQuarkEncoding = Swap;
581 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;
589 G4int QuarkEncoding=QuarkPair.second->GetPDGEncoding();
590 G4int i10 =
std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
591 G4int i20 =
std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding));
593 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin);
610 created = QuarkPair.second;
G4ParticleDefinition * BuildHighSpin(G4ParticleDefinition *black, G4ParticleDefinition *white)
static G4Pow * GetInstance()
G4ParticleDefinition * GetRightParton(void) const
G4double powA(G4double A, G4double y) const
G4ParticleDefinition * QuarkSplitup(G4ParticleDefinition *decay, G4ParticleDefinition *&created)
const G4ThreeVector & GetPosition() const
G4ExcitedString * CPExcited(const G4ExcitedString &string)
void SetFormationTime(G4double aFormationTime)
void SetStrangenessSuppression(G4double aValue)
const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * Build(G4ParticleDefinition *black, G4ParticleDefinition *white)
G4int StringLoopInterrupt
G4Parton * GetLeftParton(void) const
G4int ClusterLoopInterrupt
G4int GetPDGEncoding() const
G4ThreeVector SampleQuarkPt(G4double ptMax=-1.)
virtual G4KineticTrackVector * FragmentString(const G4ExcitedString &theString)
const G4String & GetParticleSubType() const
G4double FragmentationMass(const G4FragmentingString *const string, Pcreate build=0, pDefPair *pdefs=0)
const G4String & GetParticleName() const
G4ParticleDefinition * GetDecayParton() const
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true)
const G4ThreeVector & GetPosition() const
G4ParticleDefinition * GetLeftParton(void) const
void SetDiquarkBreakProbability(G4double aValue)
G4double GetStrangeSuppress()
G4GLOB_DLL std::ostream G4cout
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString *const theString)
G4LorentzVector Get4Momentum() const
G4double GetFormationTime() const
std::pair< G4ParticleDefinition *, G4ParticleDefinition * > pDefPair
G4LorentzRotation TransformToAlignedCms()
HepLorentzVector & boost(double, double, double)
G4ParticleDefinition * FindParticle(G4int Encoding)
void SetPosition(const G4ThreeVector aPosition)
G4int GetDecayDirection() const
void Set4Momentum(const G4LorentzVector &a4Momentum)
G4Parton * GetRightParton(void) const
G4HadronBuilder * hadronizer
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double DiquarkBreakProb
G4int GetDirection(void) const
static constexpr double pi
HepLorentzRotation inverse() const
const G4LorentzVector & Get4Momentum() const
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *)
const G4ParticleDefinition * GetDefinition() const
G4KineticTrack * Splitup(G4FragmentingString *string, G4FragmentingString *&newString)
void SetDiquarkSuppression(G4double aValue)
CLHEP::HepLorentzVector G4LorentzVector