59 G4bool ProjectileDiffraction )
const
61 #ifdef debugSingleDiffraction
73 #ifdef debugSingleDiffraction
76 <<
" "<<Ptarget <<
" "<<Ptarget.
mag() <<
G4endl;
83 #ifdef debugSingleDiffraction
84 G4cout<<
"SqrtS-Mprojectile-Mtarget "<<SqrtS<<
" "<<Mprojectile<<
" "<<Mtarget
85 <<
" "<<SqrtS-Mprojectile-Mtarget<<
G4endl;
87 if (SqrtS-Mprojectile-Mtarget <= 250.0*
MeV) {
88 #ifdef debugSingleDiffraction
90 <<Pprojectile<<
" "<<Pprojectile.
mag()<<
G4endl;
102 if ( Ptmp.
pz() <= 0. )
116 #ifdef debugSingleDiffraction
117 G4cout <<
"Pprojectile in CMS " << Pprojectile <<
G4endl;
122 G4double ProjectileMinDiffrMass(0.), TargetMinDiffrMass(0.);
126 if ( ProjectileDiffraction ) {
127 if ( absPDGcode > 1000 )
129 if ( absPDGcode > 4000 && absPDGcode < 6000 )
136 ProjectileMinDiffrMass = 1.16;
140 else if( absPDGcode == 211 || absPDGcode == 111)
142 ProjectileMinDiffrMass = 1.0;
145 else if( absPDGcode == 321 || absPDGcode == 130 || absPDGcode == 310)
147 ProjectileMinDiffrMass = 1.1;
150 else if( absPDGcode == 22)
152 ProjectileMinDiffrMass = 0.25;
155 else if( absPDGcode > 400 && absPDGcode < 600)
162 ProjectileMinDiffrMass = 1.1;
166 ProjectileMinDiffrMass = ProjectileMinDiffrMass *
GeV;
167 Mprojectile2=
sqr(ProjectileMinDiffrMass);
171 TargetMinDiffrMass = 1.16*
GeV;
172 Mtarget2 =
sqr( TargetMinDiffrMass) ;
176 AveragePt2 = AveragePt2 *
GeV*
GeV;
183 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
192 if (whilecount > 1000 )
203 ProjMassT2 = Mprojectile2 + Pt2;
204 ProjMassT = std::sqrt( ProjMassT2 );
205 TargMassT2 = Mtarget2 + Pt2;
206 TargMassT = std::sqrt( TargMassT2 );
208 #ifdef debugSingleDiffraction
209 G4cout<<whilecount<<
" "<<Pt2<<
" "<<ProjMassT<<
" "<<TargMassT<<
" "<<SqrtS<<
" "<<
S<<
" "<<ProjectileDiffraction<<
G4endl;
211 if ( SqrtS < ProjMassT + TargMassT )
continue;
213 PZcms2 = (
S*
S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
214 - 2.0*
S*ProjMassT2 - 2.0*
S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 /
S;
216 if ( PZcms2 < 0 )
continue;
218 PZcms = std::sqrt( PZcms2 );
220 if ( ProjectileDiffraction )
222 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
223 PMinusMax = SqrtS - TargMassT;
225 PMinusNew =
ChooseX( PMinusMin, PMinusMax );
226 TMinusNew = SqrtS - PMinusNew;
228 Qminus = Ptarget.
minus() - TMinusNew;
229 TPlusNew = TargMassT2 / TMinusNew;
230 Qplus = Ptarget.
plus() - TPlusNew;
233 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
234 TPlusMax = SqrtS - ProjMassT;
236 TPlusNew =
ChooseX( TPlusMin, TPlusMax );
237 PPlusNew = SqrtS - TPlusNew;
239 Qplus = PPlusNew - Pprojectile.
plus();
240 PMinusNew = ProjMassT2 / PPlusNew;
241 Qminus = PMinusNew - Pprojectile.
minus();
244 Qmomentum.
setPz( (Qplus - Qminus)/2 );
245 Qmomentum.
setE( (Qplus + Qminus)/2 );
247 #ifdef debugSingleDiffraction
248 G4cout<<ProjectileDiffraction<<
" "<<( Pprojectile + Qmomentum ).mag2()<<
" "<< Mprojectile2<<
G4endl;
249 G4cout<<!ProjectileDiffraction<<
" "<<( Ptarget - Qmomentum ).mag2()<<
" "<< Mtarget2<<
G4endl;
252 }
while ( ( ProjectileDiffraction&&( Pprojectile + Qmomentum ).mag2() < Mprojectile2 ) ||
253 (!ProjectileDiffraction&&( Ptarget - Qmomentum ).mag2() < Mtarget2 ) );
256 Pprojectile += Qmomentum;
258 Ptarget -= Qmomentum;
264 #ifdef debugSingleDiffraction
265 G4cout <<
"Pprojectile in Lab. " << Pprojectile <<
G4endl;
267 G4cout <<
"G4SingleDiffractiveExcitation- Projectile mass " << Pprojectile.
mag() <<
G4endl;
268 G4cout <<
"G4SingleDiffractiveExcitation- Target mass " << Ptarget.
mag() <<
G4endl;
284 if ( Xmin <= 0. || range <=0. )
286 G4cout <<
" Xmin, range : " << Xmin <<
" , " << range <<
G4endl;
287 throw G4HadronicException(__FILE__, __LINE__,
"G4SingleDiffractiveExcitation::ChooseX : Invalid arguments ");
301 const G4int maxNumberOfLoops = 1000;
302 G4int loopCounter = 0;
305 }
while ( ( pt2 > maxPtSquare) && ++loopCounter < maxNumberOfLoops );
306 if ( loopCounter >= maxNumberOfLoops ) {
307 pt2 = 0.99*maxPtSquare;
314 return G4ThreeVector (pt2*std::cos(phi), pt2*std::sin(phi), 0.);
G4double S(G4double temp)
G4double G4Log(G4double x)
CLHEP::HepLorentzVector G4LorentzVector
static constexpr double twopi
static constexpr double GeV
static constexpr double MeV
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
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4bool ProjectileDiffraction) const
~G4SingleDiffractiveExcitation()
G4SingleDiffractiveExcitation()
G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare) const
G4double ChooseX(G4double Xmin, G4double Xmax) const
const G4ParticleDefinition * GetDefinition() const
void Set4Momentum(const G4LorentzVector &a4Momentum)
const G4LorentzVector & Get4Momentum() const
static constexpr double GeV