57 StrangeSuppress = (1.0-0.04)/2.0;
66 #ifdef debugQuarkExchange
78 #ifdef debugQuarkExchange
81 <<
"Targ. 4-Mom "<<Ptarget <<
" "<<Ptarget.
mag() <<
G4endl;
88 #ifdef debugQuarkExchange
89 G4cout<<
"SS Mpr Mtr SqrtS-Mprojectile-Mtarget "<<SqrtS<<
" "<<Mprojectile<<
" "<<Mtarget
90 <<
" "<<SqrtS-Mprojectile-Mtarget<<
G4endl;
92 if (SqrtS-Mprojectile-Mtarget <= 250.0*MeV) {
93 #ifdef debugQuarkExchange
94 G4cerr<<
"Energy is too small for quark exchange!"<<
G4endl;
96 <<Pprojectile<<
" "<<Pprojectile.
mag()<<
G4endl;
108 if ( Ptmp.
pz() <= 0. )
123 #ifdef debugQuarkExchange
124 G4cout <<
"Pprojectile in CMS " << Pprojectile <<
G4endl;
129 G4double ProjectileMinDiffrMass = Pprojectile.
mag()/GeV;
135 G4int absPDGcode=std::abs(PDGcode);
137 G4bool ProjectileDiffraction =
true;
140 if ( absPDGcode > 1000 ) { ProjectileDiffraction =
G4UniformRand() <= 0.5; }
141 if ( (absPDGcode == 211) || (absPDGcode == 111) ) { ProjectileDiffraction =
G4UniformRand() <= 0.66; }
142 if ( (absPDGcode == 321) || (absPDGcode == 311) ||
143 ( PDGcode == 130) || ( PDGcode == 310) ) { ProjectileDiffraction =
G4UniformRand() <= 0.5; }
144 if ( absPDGcode > 400 && absPDGcode < 600 ) { ProjectileDiffraction =
G4UniformRand() <= 0.5; }
148 if ( ProjectileDiffraction ) {
149 if ( absPDGcode > 1000 )
151 if ( absPDGcode > 4000 && absPDGcode < 6000 )
158 ProjectileMinDiffrMass = 1.16;
162 else if( absPDGcode == 211 || absPDGcode == 111)
164 ProjectileMinDiffrMass = 1.0;
167 else if( absPDGcode == 321 || absPDGcode == 130 || absPDGcode == 310)
169 ProjectileMinDiffrMass = 1.1;
172 else if( absPDGcode == 22)
174 ProjectileMinDiffrMass = 0.25;
177 else if( absPDGcode > 400 && absPDGcode < 600)
184 ProjectileMinDiffrMass = 1.1;
188 ProjectileMinDiffrMass = ProjectileMinDiffrMass * GeV;
189 Mprojectile2=
sqr(ProjectileMinDiffrMass);
192 TargetMinDiffrMass *= GeV;
193 Mtarget2 =
sqr( TargetMinDiffrMass) ;
198 ProjectileMinDiffrMass *=GeV;
199 Mprojectile2=
sqr(ProjectileMinDiffrMass);
201 TargetMinDiffrMass = 1.16*GeV;
202 Mtarget2 =
sqr( TargetMinDiffrMass) ;
206 AveragePt2 = AveragePt2 * GeV*GeV;
208 if ( SqrtS - (ProjectileMinDiffrMass+TargetMinDiffrMass) < 220.0*MeV )
return false;
214 G4double PMinusMin, PMinusMax, sqrtPMinusMin, sqrtPMinusMax;
215 G4double TPlusMin, TPlusMax, sqrtTPlusMin, sqrtTPlusMax;
216 G4double PMinusNew, PPlusNew, TPlusNew(0.), TMinusNew;
226 if (whilecount > 1000 )
236 ProjMassT2 = Mprojectile2 + Pt2;
237 ProjMassT = std::sqrt( ProjMassT2 );
238 TargMassT2 = Mtarget2 + Pt2;
239 TargMassT = std::sqrt( TargMassT2 );
241 #ifdef debugQuarkExchange
242 G4cout<<
"whilecount Pt2 ProjMassT TargMassT SqrtS S ProjectileDiffraction"<<
G4endl;
243 G4cout<<whilecount<<
" "<<Pt2<<
" "<<ProjMassT<<
" "<<TargMassT<<
" "<<SqrtS<<
" "<<
S<<
" "<<ProjectileDiffraction<<
G4endl;
246 if ( SqrtS < ProjMassT + TargMassT + 220.0*MeV )
continue;
248 PZcms2 = (
S*
S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
249 - 2.0*
S*ProjMassT2 - 2.0*
S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 /
S;
251 if ( PZcms2 < 0 )
continue;
253 PZcms = std::sqrt( PZcms2 );
255 if ( ProjectileDiffraction )
257 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
258 PMinusMax = SqrtS - TargMassT;
259 sqrtPMinusMin = std::sqrt(PMinusMin); sqrtPMinusMax = std::sqrt(PMinusMax);
261 if ( absPDGcode > 1000 )
263 PMinusNew = PMinusMax * (1.0 - (1.0 - PMinusMin/PMinusMax)
266 else if ( (absPDGcode == 211) || (absPDGcode == 111) )
270 x=sqrtPMinusMax-(sqrtPMinusMax-sqrtPMinusMin)*
G4UniformRand();
272 if ( y < 1.0-0.7 * x/sqrtPMinusMax )
break;
276 else if ( (absPDGcode == 321) || (absPDGcode == 311) ||
277 ( PDGcode == 130) || ( PDGcode == 310) )
281 x=sqrtPMinusMax-(sqrtPMinusMax-sqrtPMinusMin)*
G4UniformRand();
283 if ( y < 1.0-0.7 * x/sqrtPMinusMax )
break;
289 PMinusNew = PMinusMax * (1.0 - (1.0 - PMinusMin/PMinusMax)
293 TMinusNew = SqrtS - PMinusNew;
295 Qminus = Ptarget.
minus() - TMinusNew;
296 TPlusNew = TargMassT2 / TMinusNew;
297 Qplus = Ptarget.
plus() - TPlusNew;
302 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
303 TPlusMax = SqrtS - ProjMassT;
304 sqrtTPlusMin = std::sqrt(TPlusMin); sqrtTPlusMax = std::sqrt(TPlusMax);
306 if ( absPDGcode > 1000 )
308 TPlusNew = TPlusMax * (1.0 - (1.0 - TPlusMin/TPlusMax)
311 else if ( (absPDGcode == 211) || (absPDGcode == 111) )
317 if ( y < 1.0-0.7 * x/sqrtTPlusMax )
break;
321 else if ( (absPDGcode == 321) || (absPDGcode == 311) ||
322 ( PDGcode == 130) || ( PDGcode == 310) )
328 if ( y < 1.0-0.7 * x/sqrtTPlusMax )
break;
333 TPlusNew = TPlusMax * (1.0 - (1.0 - TPlusMin/TPlusMax)
337 PPlusNew = SqrtS - TPlusNew;
339 Qplus = PPlusNew - Pprojectile.
plus();
340 PMinusNew = ProjMassT2 / PPlusNew;
341 Qminus = PMinusNew - Pprojectile.
minus();
344 Qmomentum.
setPz( (Qplus - Qminus)/2 );
345 Qmomentum.
setE( (Qplus + Qminus)/2 );
347 #ifdef debugQuarkExchange
348 G4cout<<
"ProjectileDiffraction (Pprojectile + Qmomentum).mag2() Mprojectile2"<<
G4endl;
349 G4cout<<ProjectileDiffraction<<
" "<<( Pprojectile + Qmomentum ).mag2()<<
" "<< Mprojectile2<<
G4endl;
350 G4cout<<
"TargetDiffraction (Ptarget - Qmomentum).mag2() Mtarget2"<<
G4endl;
351 G4cout<<!ProjectileDiffraction<<
" "<<( Ptarget - Qmomentum ).mag2()<<
" "<< Mtarget2<<
G4endl;
354 }
while ( ( ProjectileDiffraction&&( Pprojectile + Qmomentum ).mag2() < Mprojectile2 ) ||
355 (!ProjectileDiffraction&&( Ptarget - Qmomentum ).mag2() < Mtarget2 ) );
358 Pprojectile += Qmomentum;
360 Ptarget -= Qmomentum;
366 #ifdef debugQuarkExchange
367 G4cout <<
"Pprojectile in Lab. " << Pprojectile <<
G4endl;
369 G4cout <<
"G4QuarkExchange: Projectile mass " << Pprojectile.
mag() <<
G4endl;
401 if( (AQpr !=
nullptr) && (Qtr !=
nullptr) ) {
418 const G4int maxNumberOfLoops = 1000;
419 G4int loopCounter = 0;
422 }
while ( ( pt2 > maxPtSquare) && ++loopCounter < maxNumberOfLoops );
423 if ( loopCounter >= maxNumberOfLoops ) {
424 pt2 = 0.99*maxPtSquare;
431 return G4ThreeVector (pt2*std::cos(phi), pt2*std::sin(phi), 0.);
G4double S(G4double temp)
G4double G4Log(G4double x)
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
Hep3Vector boostVector() const
HepLorentzVector & transform(const HepRotation &)
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4int GetBaryonNumber() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetDefinition()
void SetDefinition(G4ParticleDefinition *aDefinition)
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner) const
const G4ParticleDefinition * GetDefinition() const
void Set4Momentum(const G4LorentzVector &a4Momentum)
virtual G4Parton * GetNextParton()=0
virtual G4Parton * GetNextAntiParton()=0
const G4LorentzVector & Get4Momentum() const