59 G4bool ProjectileDiffraction )
const
61 #ifdef debugSingleDiffraction
73 #ifdef debugSingleDiffraction
75 G4cout<<
"Pr Tr 4-Mom "<<Pprojectile<<
" "<<Pprojectile.
mag()<<G4endl
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;
92 <<Ptarget<<
" "<<Ptarget.mag()<<
G4endl;
93 G4cerr<<
"sqrt(S) = "<<SqrtS<<
" Mp + Mt = "<<Pprojectile.
mag()+Ptarget.mag()<<
G4endl;
102 if ( Ptmp.pz() <= 0. )
110 toCms.
rotateY(-1*Ptmp.theta());
116 #ifdef debugSingleDiffraction
117 G4cout <<
"Pprojectile in CMS " << Pprojectile <<
G4endl;
122 G4double ProjectileMinDiffrMass(0.), TargetMinDiffrMass(0.);
126 if ( ProjectileDiffraction ) {
127 if ( absPDGcode > 1000 )
129 ProjectileMinDiffrMass = 1.16;
132 else if( absPDGcode == 211 || absPDGcode == 111)
134 ProjectileMinDiffrMass = 1.0;
137 else if( absPDGcode == 321 || absPDGcode == 130 || absPDGcode == 310)
139 ProjectileMinDiffrMass = 1.1;
142 else if( absPDGcode == 22)
144 ProjectileMinDiffrMass = 0.25;
149 ProjectileMinDiffrMass = 1.1;
153 ProjectileMinDiffrMass = ProjectileMinDiffrMass *
GeV;
154 Mprojectile2=
sqr(ProjectileMinDiffrMass);
158 TargetMinDiffrMass = 1.16*
GeV;
159 Mtarget2 =
sqr( TargetMinDiffrMass) ;
163 AveragePt2 = AveragePt2 *
GeV*
GeV;
170 G4double PMinusNew, PPlusNew, TPlusNew, TMinusNew;
179 if (whilecount > 1000 )
190 ProjMassT2 = Mprojectile2 + Pt2;
191 ProjMassT = std::sqrt( ProjMassT2 );
192 TargMassT2 = Mtarget2 + Pt2;
193 TargMassT = std::sqrt( TargMassT2 );
195 #ifdef debugSingleDiffraction
196 G4cout<<whilecount<<
" "<<Pt2<<
" "<<ProjMassT<<
" "<<TargMassT<<
" "<<SqrtS<<
" "<<S<<
" "<<ProjectileDiffraction<<
G4endl;
198 if ( SqrtS < ProjMassT + TargMassT )
continue;
200 PZcms2 = ( S*S + ProjMassT2*ProjMassT2 + TargMassT2*TargMassT2
201 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
203 if ( PZcms2 < 0 )
continue;
205 PZcms = std::sqrt( PZcms2 );
207 if ( ProjectileDiffraction )
209 PMinusMin = std::sqrt( ProjMassT2 + PZcms2 ) - PZcms;
210 PMinusMax = SqrtS - TargMassT;
212 PMinusNew =
ChooseX( PMinusMin, PMinusMax );
213 TMinusNew = SqrtS - PMinusNew;
215 Qminus = Ptarget.minus() - TMinusNew;
216 TPlusNew = TargMassT2 / TMinusNew;
217 Qplus = Ptarget.plus() - TPlusNew;
220 TPlusMin = std::sqrt( TargMassT2 + PZcms2 ) - PZcms;
221 TPlusMax = SqrtS - ProjMassT;
223 TPlusNew =
ChooseX( TPlusMin, TPlusMax );
224 PPlusNew = SqrtS - TPlusNew;
226 Qplus = PPlusNew - Pprojectile.plus();
227 PMinusNew = ProjMassT2 / PPlusNew;
228 Qminus = PMinusNew - Pprojectile.minus();
231 Qmomentum.
setPz( (Qplus - Qminus)/2 );
232 Qmomentum.
setE( (Qplus + Qminus)/2 );
234 #ifdef debugSingleDiffraction
235 G4cout<<ProjectileDiffraction<<
" "<<( Pprojectile + Qmomentum ).mag2()<<
" "<< Mprojectile2<<
G4endl;
236 G4cout<<!ProjectileDiffraction<<
" "<<( Ptarget - Qmomentum ).mag2()<<
" "<< Mtarget2<<
G4endl;
239 }
while ( ( ProjectileDiffraction&&( Pprojectile + Qmomentum ).mag2() < Mprojectile2 ) ||
240 (!ProjectileDiffraction&&( Ptarget - Qmomentum ).mag2() < Mtarget2 ) );
243 Pprojectile += Qmomentum;
245 Ptarget -= Qmomentum;
251 #ifdef debugSingleDiffraction
252 G4cout <<
"Pprojectile in Lab. " << Pprojectile <<
G4endl;
254 G4cout <<
"G4SingleDiffractiveExcitation- Projectile mass " << Pprojectile.mag() <<
G4endl;
255 G4cout <<
"G4SingleDiffractiveExcitation- Target mass " << Ptarget.mag() <<
G4endl;
271 if ( Xmin <= 0. || range <=0. )
273 G4cout <<
" Xmin, range : " << Xmin <<
" , " << range <<
G4endl;
274 throw G4HadronicException(__FILE__, __LINE__,
"G4SingleDiffractiveExcitation::ChooseX : Invalid arguments ");
288 const G4int maxNumberOfLoops = 1000;
289 G4int loopCounter = 0;
292 }
while ( ( pt2 > maxPtSquare) && ++loopCounter < maxNumberOfLoops );
293 if ( loopCounter >= maxNumberOfLoops ) {
294 pt2 = 0.99*maxPtSquare;
301 return G4ThreeVector (pt2*std::cos(phi), pt2*std::sin(phi), 0.);