55 void G4QGSMSplitableHadron::InitParameters()
67 StrangeSuppress = 0.48;
70 widthOfPtSquare = 0.01*
GeV*
GeV;
72 minTransverseMass = 1*
keV;
84 Direction = aDirection;
104 Direction = aDirection;
115 if (
Color.size()!=0)
return;
118 DiffractiveSplitUp();
124 void G4QGSMSplitableHadron::DiffractiveSplitUp()
139 G4double maxAvailMomentum2 =
sqr(std::sqrt(transverseMass2) - std::sqrt(pt2));
141 if(maxAvailMomentum2/widthOfPtSquare>0.01) pt = GaussianPt(widthOfPtSquare, maxAvailMomentum2);
146 RightMom.
setPx(HadronMom.
px() - pt.x());
147 RightMom.
setPy(HadronMom.
py() - pt.y());
153 if (Direction) Local2 = -Local2;
154 G4double RightMinus = 0.5*(Local1 + Local2);
158 G4double LeftPlus = LeftMom.perp2()/LeftMinus;
161 LeftMom.setPz(0.5*(LeftPlus - LeftMinus));
162 LeftMom.setE (0.5*(LeftPlus + LeftMinus));
163 RightMom.
setPz(0.5*(RightPlus - RightMinus));
164 RightMom.
setE (0.5*(RightPlus + RightMinus));
168 Color.push_back(Left);
169 AntiColor.push_back(Right);
173 void G4QGSMSplitableHadron::SoftSplitUp()
187 while(Xmin>=1-(2*nSeaPair+1)*Xmin) Xmin*=0.95;
190 for (aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++)
199 G4Parton * aParton = BuildSeaQuark(
false, aPDGCode, nSeaPair);
217 Color.push_back(aParton);
221 aParton = BuildSeaQuark(
true, aPDGCode, nSeaPair);
222 aParton->
SetSpinZ(-firstPartonSpinZ);
235 AntiColor.push_back(aParton);
241 GetValenceQuarkFlavors(
GetDefinition(), pColorParton, pAntiColorParton);
251 if (ColorEncoding < 0)
263 Color.push_back(pColorParton);
264 AntiColor.push_back(pAntiColorParton);
277 const G4int maxNumberOfAttempts = 1000;
282 G4int NumberOfUnsampledSeaQuarks = 2*nSeaPair;
283 ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta);
284 Color.back()->SetX(SumX = ColorX);
285 for(
G4int aPair = 0; aPair < nSeaPair; aPair++)
287 NumberOfUnsampledSeaQuarks--;
288 ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta);
289 Color[aPair]->SetX(ColorX);
291 NumberOfUnsampledSeaQuarks--;
292 AntiColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta);
293 AntiColor[aPair]->SetX(AntiColorX);
295 if (1. - SumX <= Xmin)
break;
297 }
while ( (1. - SumX <= Xmin) && nAttempt < maxNumberOfAttempts );
298 if ( nAttempt >= maxNumberOfAttempts )
return;
300 (*(AntiColor.end()-1))->SetX(1. - SumX);
303 for(aSeaPair = 0; aSeaPair < nSeaPair+1; aSeaPair++)
308 aParton = AntiColor[aSeaPair];
314 void G4QGSMSplitableHadron::
323 theMesonSplitter.
SplitMeson(HadronEncoding, &aEnd, &bEnd);
325 theBaryonSplitter.
SplitBarion(HadronEncoding, &aEnd, &bEnd);
378 const G4int maxNumberOfLoops = 1000;
379 G4int loopCounter = -1;
381 ++loopCounter < maxNumberOfLoops ) {;}
382 if ( loopCounter >= maxNumberOfLoops ) R = 0.0;
391 if (isAntiQuark) aPDGCode*=-1;
406 for(
G4int ii=1; ii<100; ii++)
414 G4double xMax=1-(totalSea+1)*anXmin;
417 G4cout <<
"anXmin = "<<anXmin<<
" nSea = "<<nSea<<
" totalSea = "<< totalSea<<
G4endl;
418 throw G4HadronicException(__FILE__, __LINE__,
"G4QGSMSplitableHadron - Fatal: Cannot sample parton densities under these constraints.");
420 const G4int maxNumberOfLoops = 10000;
421 G4int loopCounter = -1;
429 }
while ( (x2>y) && ++loopCounter < maxNumberOfLoops );
430 if ( loopCounter >= maxNumberOfLoops ) {
432 ed <<
" Failed sampling after maxNumberOfLoops attempts : forced exit! " <<
G4endl;
G4double G4ParticleHPJENDLHEData::G4double result
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
ThreeVector shoot(const G4int Ap, const G4int Af)
static G4KaonPlus * KaonPlusDefinition()
G4double powN(G4double x, G4int n) const
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
virtual ~G4QGSMSplitableHadron()
G4int GetSoftCollisionCount()
static G4KaonMinus * KaonMinusDefinition()
const G4LorentzVector & Get4Momentum() const
void Set4Momentum(const G4LorentzVector &aMomentum)
G4int GetPDGEncoding() const
static G4PionZero * PionZeroDefinition()
static constexpr double twopi
const G4ParticleDefinition * GetDefinition() const
void DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection)
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
static G4PionPlus * PionPlusDefinition()
void SetColour(G4int aColour)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const G4LorentzVector & Get4Momentum() const
G4double G4Log(G4double x)
void SetSpinZ(G4double aSpinZ)
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4PionMinus * PionMinus()
G4bool SplitMeson(G4int PDGcode, G4int *aEnd, G4int *bEnd)
static constexpr double GeV
const G4ThreeVector & GetPosition() const
G4double GetPDGSpin() const
static constexpr double pi
static constexpr double keV
G4int GetBaryonNumber() const
void SetPosition(const G4ThreeVector &aPosition)
static G4Gamma * GammaDefinition()
G4bool SplitBarion(G4int PDGCode, G4int *q_or_qqbar, G4int *qbar_or_qq)