Geant4  10.02
G4QGSDiffractiveExcitation.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4QGSDiffractiveExcitation.cc 93563 2015-10-26 14:46:09Z gcosmo $
28 // ------------------------------------------------------------
29 // GEANT 4 class implemetation file
30 //
31 // ---------------- G4QGSDiffractiveExcitation --------------
32 // by Gunter Folger, October 1998.
33 // diffractive Excitation used by strings models
34 // Take a projectile and a target
35 // excite the projectile and target
36 // Essential changed by V. Uzhinsky in November - December 2006
37 // in order to put it in a correspondence with original FRITIOF
38 // model. Variant of FRITIOF with nucleon de-excitation is implemented.
39 // ---------------------------------------------------------------------
40 
41 // Modified:
42 // 25-05-07 : G.Folger
43 // move from management/G4DiffractiveExcitation to to qgsm/G4QGSDiffractiveExcitation
44 //
45 
46 #include "globals.hh"
47 #include "G4PhysicalConstants.hh"
48 #include "G4SystemOfUnits.hh"
49 #include "Randomize.hh"
50 
52 #include "G4LorentzRotation.hh"
53 #include "G4ThreeVector.hh"
54 #include "G4ParticleDefinition.hh"
55 #include "G4VSplitableHadron.hh"
56 #include "G4ExcitedString.hh"
57 //#include "G4ios.hh"
58 
59 #include "G4Exp.hh"
60 #include "G4Log.hh"
61 #include "G4Pow.hh"
62 
63 
65 {
66 }
67 
69 {
70 }
71 
72 
75 {
76 
77  G4LorentzVector Pprojectile=projectile->Get4Momentum();
78 
79  // -------------------- Projectile parameters -----------------------------------
80  G4bool PutOnMassShell=0;
81 
82  // G4double M0projectile=projectile->GetDefinition()->GetPDGMass(); // With de-excitation
83  G4double M0projectile = Pprojectile.mag(); // Without de-excitation
84 
85  if(M0projectile < projectile->GetDefinition()->GetPDGMass())
86  {
87  PutOnMassShell=1;
88  M0projectile=projectile->GetDefinition()->GetPDGMass();
89  }
90 
91  G4double Mprojectile2 = M0projectile * M0projectile;
92 
93  G4int PDGcode=projectile->GetDefinition()->GetPDGEncoding();
94  G4int absPDGcode=std::abs(PDGcode);
95  G4double ProjectileDiffCut;
96  G4double AveragePt2;
97 
98  if( absPDGcode > 1000 ) //------Projectile is baryon --------
99  {
100  ProjectileDiffCut = 1.1; // GeV
101  AveragePt2 = 0.3; // GeV^2
102  }
103  else if( absPDGcode == 211 || PDGcode == 111) //------Projectile is Pion -----------
104  {
105  ProjectileDiffCut = 1.0; // GeV
106  AveragePt2 = 0.3; // GeV^2
107  }
108  else if( absPDGcode == 321 || PDGcode == -311) //------Projectile is Kaon -----------
109  {
110  ProjectileDiffCut = 1.1; // GeV
111  AveragePt2 = 0.3; // GeV^2
112  }
113  else //------Projectile is undefined, Nucleon assumed
114  {
115  ProjectileDiffCut = 1.1; // GeV
116  AveragePt2 = 0.3; // GeV^2
117  };
118 
119  ProjectileDiffCut = ProjectileDiffCut * GeV;
120  AveragePt2 = AveragePt2 * GeV*GeV;
121 
122  // -------------------- Target parameters ----------------------------------------------
123  G4LorentzVector Ptarget=target->Get4Momentum();
124 
125  G4double M0target = Ptarget.mag();
126 
127  if(M0target < target->GetDefinition()->GetPDGMass())
128  {
129  PutOnMassShell=1;
130  M0target=target->GetDefinition()->GetPDGMass();
131  }
132 
133  G4double Mtarget2 = M0target * M0target; //Ptarget.mag2(); // for AA-inter.
134 
135  G4double NuclearNucleonDiffCut = 1.1*GeV;
136 
137  G4double ProjectileDiffCut2 = ProjectileDiffCut * ProjectileDiffCut;
138  G4double NuclearNucleonDiffCut2 = NuclearNucleonDiffCut * NuclearNucleonDiffCut;
139 
140  // Transform momenta to cms and then rotate parallel to z axis;
141 
142  G4LorentzVector Psum;
143  Psum=Pprojectile+Ptarget;
144 
145  G4LorentzRotation toCms(-1*Psum.boostVector());
146 
147  G4LorentzVector Ptmp=toCms*Pprojectile;
148 
149  if ( Ptmp.pz() <= 0. )
150  {
151  // "String" moving backwards in CMS, abort collision !!
152  //G4cout << " abort Collision!! " << G4endl;
153  return false;
154  }
155 
156  toCms.rotateZ(-1*Ptmp.phi());
157  toCms.rotateY(-1*Ptmp.theta());
158 
159  G4LorentzRotation toLab(toCms.inverse());
160 
161  Pprojectile.transform(toCms);
162  Ptarget.transform(toCms);
163 
164  G4double Pt2;
165  G4double ProjMassT2, ProjMassT;
166  G4double TargMassT2, TargMassT;
167  G4double PZcms2, PZcms;
168  G4double PMinusNew, TPlusNew;
169 
170  G4double S=Psum.mag2();
171  G4double SqrtS=std::sqrt(S);
172 
173  if(SqrtS < 2200*MeV) {return false;} // The model cannot work for pp-interactions
174  // at Plab < 1.3 GeV/c. Uzhi
175 
176  PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
177  2*S*Mprojectile2-2*S*Mtarget2-2*Mprojectile2*Mtarget2)/4./S;
178  if(PZcms2 < 0)
179  {return false;} // It can be in an interaction with off-shell nuclear nucleon
180 
181  PZcms = std::sqrt(PZcms2);
182 
183  if(PutOnMassShell)
184  {
185  if(Pprojectile.z() > 0.)
186  {
187  Pprojectile.setPz( PZcms);
188  Ptarget.setPz( -PZcms);
189  }
190  else
191  {
192  Pprojectile.setPz(-PZcms);
193  Ptarget.setPz( PZcms);
194  };
195 
196  Pprojectile.setE(std::sqrt(Mprojectile2+
197  Pprojectile.x()*Pprojectile.x()+
198  Pprojectile.y()*Pprojectile.y()+
199  PZcms2));
200  Ptarget.setE(std::sqrt( Mtarget2 +
201  Ptarget.x()*Ptarget.x()+
202  Ptarget.y()*Ptarget.y()+
203  PZcms2));
204  }
205 
206  G4double maxPtSquare = PZcms2;
207 
208  //G4cout << "Pprojectile aft boost : " << Pprojectile << G4endl;
209  //G4cout << "Ptarget aft boost : " << Ptarget << G4endl;
210  // G4cout << "cms aft boost : " << (Pprojectile+ Ptarget) << G4endl;
211 
212  // G4cout << " Projectile Xplus / Xminus : " <<
213  // Pprojectile.plus() << " / " << Pprojectile.minus() << G4endl;
214  // G4cout << " Target Xplus / Xminus : " <<
215  // Ptarget.plus() << " / " << Ptarget.minus() << G4endl;
216 
217  G4LorentzVector Qmomentum;
218  G4double Qminus, Qplus;
219 
220  // /* Vova
221  G4int whilecount=0;
222  do {
223  // Generate pt
224 
225  if (whilecount++ >= 500 && (whilecount%100)==0)
226  // G4cout << "G4QGSDiffractiveExcitation::ExciteParticipants possibly looping"
227  // << ", loop count/ maxPtSquare : "
228  // << whilecount << " / " << maxPtSquare << G4endl;
229  if (whilecount > 1000 )
230  {
231  Qmomentum=G4LorentzVector(0.,0.,0.,0.);
232  return false; // Ignore this interaction
233  }
234 
235  Qmomentum=G4LorentzVector(GaussianPt(AveragePt2,maxPtSquare),0);
236 
237  //G4cout << "generated Pt " << Qmomentum << G4endl;
238  //G4cout << "Pprojectile with pt : " << Pprojectile+Qmomentum << G4endl;
239  //G4cout << "Ptarget with pt : " << Ptarget-Qmomentum << G4endl;
240 
241  // Momentum transfer
242  /* // Uzhi
243  G4double Xmin = minmass / ( Pprojectile.e() + Ptarget.e() );
244  G4double Xmax=1.;
245  G4double Xplus =ChooseX(Xmin,Xmax);
246  G4double Xminus=ChooseX(Xmin,Xmax);
247 
248 // G4cout << " X-plus " << Xplus << G4endl;
249 // G4cout << " X-minus " << Xminus << G4endl;
250 
251  G4double pt2=G4ThreeVector(Qmomentum.vect()).mag2();
252  G4double Qplus =-1 * pt2 / Xminus/Ptarget.minus();
253  G4double Qminus= pt2 / Xplus /Pprojectile.plus();
254  */ // Uzhi *
255 
256  Pt2=G4ThreeVector(Qmomentum.vect()).mag2();
257  ProjMassT2=Mprojectile2+Pt2;
258  ProjMassT =std::sqrt(ProjMassT2);
259 
260  TargMassT2=Mtarget2+Pt2;
261  TargMassT =std::sqrt(TargMassT2);
262 
263  PZcms2=(S*S+ProjMassT2*ProjMassT2+
264  TargMassT2*TargMassT2-
265  2.*S*ProjMassT2-2.*S*TargMassT2-
266  2.*ProjMassT2*TargMassT2)/4./S;
267  if(PZcms2 < 0 ) {PZcms2=0;};
268  PZcms =std::sqrt(PZcms2);
269 
270  G4double PMinusMin=std::sqrt(ProjMassT2+PZcms2)-PZcms;
271  G4double PMinusMax=SqrtS-TargMassT;
272 
273  PMinusNew=ChooseP(PMinusMin,PMinusMax);
274  Qminus=PMinusNew-Pprojectile.minus();
275 
276  G4double TPlusMin=std::sqrt(TargMassT2+PZcms2)-PZcms;
277  G4double TPlusMax=SqrtS-ProjMassT;
278 
279  TPlusNew=ChooseP(TPlusMin, TPlusMax);
280  Qplus=-(TPlusNew-Ptarget.plus());
281 
282  Qmomentum.setPz( (Qplus-Qminus)/2 );
283  Qmomentum.setE( (Qplus+Qminus)/2 );
284 
285  //G4cout << "Qplus / Qminus " << Qplus << " / " << Qminus<<G4endl;
286  // G4cout << "pt2" << pt2 << G4endl;
287  // G4cout << "Qmomentum " << Qmomentum << G4endl;
288  // G4cout << " Masses (P/T) : " << (Pprojectile+Qmomentum).mag() <<
289  // " / " << (Ptarget-Qmomentum).mag() << G4endl;
290  /* // Uzhi
291  } while ( (Pprojectile+Qmomentum).mag2() <= Mprojectile2 ||
292  (Ptarget-Qmomentum).mag2() <= Mtarget2 );
293  */ // Uzhi *
294 
295 
296  } while ( /* Loop checking, 26.10.2015, A.Ribon */
297  ( (Pprojectile+Qmomentum).mag2() < Mprojectile2 || // Uzhi No without excitation
298  (Ptarget -Qmomentum).mag2() < Mtarget2 ) || // Uzhi
299  ( (Pprojectile+Qmomentum).mag2() < ProjectileDiffCut2 && // Uzhi No double Diffraction
300  (Ptarget -Qmomentum).mag2() < NuclearNucleonDiffCut2) );// Uzhi
301 
302  if((Ptarget-Qmomentum).mag2() < NuclearNucleonDiffCut2) // Uzhi Projectile diffraction
303  {
304  G4double TMinusNew=SqrtS-PMinusNew;
305  Qminus=Ptarget.minus()-TMinusNew;
306  TPlusNew=TargMassT2/TMinusNew;
307  Qplus=Ptarget.plus()-TPlusNew;
308 
309  Qmomentum.setPz( (Qplus-Qminus)/2 );
310  Qmomentum.setE( (Qplus+Qminus)/2 );
311  }
312  else if((Pprojectile+Qmomentum).mag2() < ProjectileDiffCut2) // Uzhi Target diffraction
313  {
314  G4double PPlusNew=SqrtS-TPlusNew;
315  Qplus=PPlusNew-Pprojectile.plus();
316  PMinusNew=ProjMassT2/PPlusNew;
317  Qminus=PMinusNew-Pprojectile.minus();
318 
319  Qmomentum.setPz( (Qplus-Qminus)/2 );
320  Qmomentum.setE( (Qplus+Qminus)/2 );
321  };
322 
323  Pprojectile += Qmomentum;
324  Ptarget -= Qmomentum;
325 
326  // Vova
327 
328  /*
329  Pprojectile.setPz(0.);
330  Pprojectile.setE(SqrtS-M0target);
331 
332  Ptarget.setPz(0.);
333  Ptarget.setE(M0target);
334  */
335 
336  //G4cout << "Pprojectile with Q : " << Pprojectile << G4endl;
337  //G4cout << "Ptarget with Q : " << Ptarget << G4endl;
338 
339  // G4cout << "Projectile back: " << toLab * Pprojectile << G4endl;
340  // G4cout << "Target back: " << toLab * Ptarget << G4endl;
341 
342  // Transform back and update SplitableHadron Participant.
343  Pprojectile.transform(toLab);
344  Ptarget.transform(toLab);
345 
346  //G4cout << "Pprojectile with Q M: " << Pprojectile<<" "<< Pprojectile.mag() << G4endl;
347  //G4cout << "Ptarget with Q M: " << Ptarget <<" "<< Ptarget.mag() << G4endl;
348 
349  //G4cout << "Target mass " << Ptarget.mag() << G4endl;
350 
351  target->Set4Momentum(Ptarget);
352 
353  //G4cout << "Projectile mass " << Pprojectile.mag() << G4endl;
354 
355  projectile->Set4Momentum(Pprojectile);
356 
357  return true;
358 }
359 
360 
362 String(G4VSplitableHadron * hadron, G4bool isProjectile) const
363 {
364  hadron->SplitUp();
365  G4Parton *start= hadron->GetNextParton();
366  if ( start==NULL)
367  { G4cout << " G4FTFModel::String() Error:No start parton found"<< G4endl;
368  return NULL;
369  }
370  G4Parton *end = hadron->GetNextParton();
371  if ( end==NULL)
372  { G4cout << " G4FTFModel::String() Error:No end parton found"<< G4endl;
373  return NULL;
374  }
375 
376  G4ExcitedString * string;
377  if ( isProjectile )
378  {
379  string= new G4ExcitedString(end,start, +1);
380  } else {
381  string= new G4ExcitedString(start,end, -1);
382  }
383 
384  string->SetPosition(hadron->GetPosition());
385 
386  // momenta of string ends
387  G4double ptSquared= hadron->Get4Momentum().perp2();
388  G4double transverseMassSquared= hadron->Get4Momentum().plus()
389  * hadron->Get4Momentum().minus();
390 
391 
392  G4double maxAvailMomentumSquared=
393  sqr( std::sqrt(transverseMassSquared) - std::sqrt(ptSquared) );
394 
395  G4double widthOfPtSquare = 0.25; // Uzhi <Pt^2>=0.25 ??????????????????
396  G4ThreeVector pt=GaussianPt(widthOfPtSquare,maxAvailMomentumSquared);
397 
398  G4LorentzVector Pstart(G4LorentzVector(pt,0.));
399  G4LorentzVector Pend;
400  Pend.setPx(hadron->Get4Momentum().px() - pt.x());
401  Pend.setPy(hadron->Get4Momentum().py() - pt.y());
402 
403  G4double tm1=hadron->Get4Momentum().minus() +
404  ( Pend.perp2()-Pstart.perp2() ) / hadron->Get4Momentum().plus();
405 
406  G4double tm2= std::sqrt( std::max(0., sqr(tm1) -
407  4. * Pend.perp2() * hadron->Get4Momentum().minus()
408  / hadron->Get4Momentum().plus() ));
409 
410  G4int Sign= isProjectile ? -1 : 1;
411 
412  G4double endMinus = 0.5 * (tm1 + Sign*tm2);
413  G4double startMinus= hadron->Get4Momentum().minus() - endMinus;
414 
415  G4double startPlus= Pstart.perp2() / startMinus;
416  G4double endPlus = hadron->Get4Momentum().plus() - startPlus;
417 
418  Pstart.setPz(0.5*(startPlus - startMinus));
419  Pstart.setE(0.5*(startPlus + startMinus));
420 
421  Pend.setPz(0.5*(endPlus - endMinus));
422  Pend.setE(0.5*(endPlus + endMinus));
423 
424  start->Set4Momentum(Pstart);
425  end->Set4Momentum(Pend);
426 
427  #ifdef G4_FTFDEBUG
428  G4cout << " generated string flavors " << start->GetPDGcode() << " / " << end->GetPDGcode() << G4endl;
429  G4cout << " generated string momenta: quark " << start->Get4Momentum() << "mass : " <<start->Get4Momentum().mag()<< G4endl;
430  G4cout << " generated string momenta: Diquark " << end ->Get4Momentum() << "mass : " <<end->Get4Momentum().mag()<< G4endl;
431  G4cout << " sum of ends " << Pstart+Pend << G4endl;
432  G4cout << " Original " << hadron->Get4Momentum() << G4endl;
433  #endif
434 
435  return string;
436 }
437 
438 
439 // --------- private methods ----------------------
440 
442 {
443  // choose an x between Xmin and Xmax with P(x) ~ 1/x
444 
445  // to be improved...
446 
447  G4double range=Pmax-Pmin; // Uzhi
448 
449  if ( Pmin <= 0. || range <=0. )
450  {
451  G4cout << " Pmin, range : " << Pmin << " , " << range << G4endl;
452  throw G4HadronicException(__FILE__, __LINE__, "G4QGSDiffractiveExcitation::ChooseP : Invalid arguments ");
453  }
454 
455  G4double P;
456  /* // Uzhi
457  do {
458  x=Xmin + G4UniformRand() * range;
459  } while ( Xmin/x < G4UniformRand() );
460  */ // Uzhi
461 
462  P=Pmin * G4Pow::GetInstance()->powA(Pmax/Pmin,G4UniformRand()); // Uzhi
463 
464  //debug-hpw cout << "DiffractiveX "<<x<<G4endl;
465  return P;
466 }
467 
469 { // @@ this method is used in FTFModel as well. Should go somewhere common!
470 
471  G4double Pt2;
472  /* // Uzhi
473  do {
474  pt2=widthSquare * G4Log( G4UniformRand() );
475  } while ( pt2 > maxPtSquare);
476  */ // Uzhi
477 
478  Pt2 = -AveragePt2 * G4Log(1. + G4UniformRand() * (G4Exp(-maxPtSquare/AveragePt2)-1.));// Uzhi
479 
480  G4double Pt=std::sqrt(Pt2);
481 
482  G4double phi=G4UniformRand() * twopi;
483 
484  return G4ThreeVector (Pt*std::cos(phi), Pt*std::sin(phi), 0.);
485 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
static const double MeV
Definition: G4SIunits.hh:211
G4int GetPDGcode() const
Definition: G4Parton.hh:124
virtual G4ExcitedString * String(G4VSplitableHadron *aHadron, G4bool isProjectile) const
double S(double temp)
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
const G4LorentzVector & Get4Momentum() const
Definition: G4Parton.hh:140
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4Parton.hh:145
G4double ChooseP(G4double Pmin, G4double Pmax) const
int G4int
Definition: G4Types.hh:78
static double P[]
virtual void SplitUp()=0
const G4ParticleDefinition * GetDefinition() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual G4Parton * GetNextParton()=0
static const double twopi
Definition: G4SIunits.hh:75
static const double GeV
Definition: G4SIunits.hh:214
virtual G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner) const
const G4LorentzVector & Get4Momentum() const
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const G4ThreeVector & GetPosition() const
#define G4endl
Definition: G4ios.hh:61
void Set4Momentum(const G4LorentzVector &a4Momentum)
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
CLHEP::HepLorentzVector G4LorentzVector