Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QDiffractionRatio.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$
28//
29//
30// G4 Physics class: G4QDiffractionRatio for N+A Diffraction Interactions
31// Created: M.V. Kossov, CERN/ITEP(Moscow), 25-OCT-01
32// The last update: M.V. Kossov, CERN/ITEP(Moscow) 10-Nov-09
33//
34// --------------------------------------------------------------------
35// Short description: Difraction excitation is a part of the incoherent
36// (inelastic) interaction. This part is calculated in the class.
37// --------------------------------------------------------------------
38
39//#define debug
40//#define pdebug
41//#define fdebug
42//#define nandebug
43
45#include "G4SystemOfUnits.hh"
46
47// Returns Pointer to the G4VQCrossSection class
49{
50 static G4QDiffractionRatio theRatios; // *** Static body of the Diffraction Ratio ***
51 return &theRatios;
52}
53
54// Calculation of pair(QuasiFree/Inelastic,QuasiElastic/QuasiFree)
56{
57 static const G4double mNeut= G4QPDGCode(2112).GetMass()/GeV; // in GeV
58 static const G4double mProt= G4QPDGCode(2212).GetMass()/GeV; // in GeV
59 static const G4double mN=.5*(mNeut+mProt); // mean nucleon mass in GeV
60 static const G4double dmN=mN+mN; // doubled nuc. mass in GeV
61 static const G4double mN2=mN*mN; // squared nuc. mass in GeV^2
62 // Table parameters
63 static const G4int nps=100; // Number of steps in the R(s) LinTable
64 static const G4int mps=nps+1; // Number of elements in the R(s) LinTable
65 static const G4double sma=6.; // The first LinTabEl(sqs=0)=1., sqs>sma -> logTab
66 static const G4double ds=sma/nps; // Step of the linear Table
67 static const G4int nls=150; // Number of steps in the R(lns) logTable
68 static const G4int mls=nls+1; // Number of elements in the R(lns) logTable
69 static const G4double lsi=1.79; // The min ln(sqs) logTabEl(sqs=5.99 < sma=6.)
70 static const G4double lsa=8.; // The max ln(sqs) logTabEl(sqs=5.99 - 2981 GeV)
71 static const G4double mi=std::exp(lsi);// The min s of logTabEl(~ 5.99 GeV)
72 static const G4double max_s=std::exp(lsa);// The max s of logTabEl(~ 2981 GeV)
73 static const G4double dl=(lsa-lsi)/nls;// Step of the logarithmic Table
74 static const G4double edl=std::exp(dl);// Multiplication step of the logarithmic Table
75 static const G4double toler=.0001; // Tolarence (GeV) defining the same sqs
76 static G4double lastS=0.; // Last sqs value for which R was calculated
77 static G4double lastR=0.; // Last ratio R which was calculated
78 // Local Associative Data Base:
79 static std::vector<G4int> vA; // Vector of calculated A
80 //static std::vector<G4double> vH; // Vector of max sqs initialized in the LinTable
81 //static std::vector<G4int> vN; // Vector of topBin number initialized in LinTab
82 //static std::vector<G4double> vM; // Vector of relMax ln(sqs) initialized in LogTab
83 //static std::vector<G4int> vK; // Vector of topBin number initialized in LogTab
84 static std::vector<G4double*> vT; // Vector of pointers to LinTable in C++ heap
85 static std::vector<G4double*> vL; // Vector of pointers to LogTable in C++ heap
86 // Last values of the Associative Data Base:
87 //static G4int lastPDG=0; // Last PDG for which R was calculated (now fake)
88 static G4int lastA=0; // theLast of calculated A
89 //static G4double lastH=0.; // theLast max sqs initialized in the LinTable
90 //static G4int lastN=0; // theLast of topBin number initialized in LinTab
91 //static G4double lastM=0.; // theLast relMax ln(sqs) initialized in LogTab
92 //static G4int lastK=0; // theLast of topBin number initialized in LogTab
93 static G4double* lastT=0; // theLast of pointer to LinTable in the C++ heap
94 static G4double* lastL=0; // theLast of pointer to LogTable in the C++ heap
95 // LogTable is created only if necessary. R(sqs>2981GeV) calcul by formula for any nuclei
96 G4int A=tgN+tgZ;
97 if(pIU<toler || A<1) return 1.; // Fake use of toler as non zero number
98 if(A>238)
99 {
100 G4cout<<"-*-Warning-*-G4QuasiFreeRatio::GetRatio: A="<<A<<">238, return zero"<<G4endl;
101 return 0.;
102 }
103 //lastPDG=pPDG; // @@ at present ratio is PDG independent @@
104 // Calculate sqs
105 G4double pM=G4QPDGCode(pPDG).GetMass()/GeV; // Projectile mass in GeV
106 G4double pM2=pM*pM;
107 G4double mom=pIU/GeV; // Projectile momentum in GeV
108 G4double s_value=std::sqrt(mN2+pM2+dmN*std::sqrt(pM2+mom*mom)); // in GeV
109 G4int nDB=vA.size(); // A number of nuclei already initialized in AMDB
110 if(nDB && lastA==A && std::fabs(s_value-lastS)<toler) return lastR;
111 if(s_value>max_s)
112 {
113 lastR=CalcDiff2Prod_Ratio(s_value,A); // @@ Probably user ought to be notified about bigS
114 return lastR;
115 }
116 G4bool found=false;
117 G4int i=-1;
118 if(nDB) for (i=0; i<nDB; i++) if(A==vA[i]) // Sirch for this A in AMDB
119 {
120 found=true; // The A value is found
121 break;
122 }
123 if(!nDB || !found) // Create new line in the AMDB
124 {
125 lastA = A;
126 lastT = new G4double[mps]; // Create the linear Table
127 //lastN = static_cast<int>(s_value/ds)+1; // MaxBin to be initialized
128 //if(lastN>nps) // ===> Now initialize all lin table
129 //{
130 // lastN=nps;
131 // lastH=sma;
132 //}
133 //else lastH = lastN*ds; // Calculate max initialized s for LinTab
134 G4double sv=0;
135 lastT[0]=1.;
136 //for(G4int j=1; j<=lastN; j++) // Calculate LinTab values
137 for(G4int j=1; j<=nps; j++) // Calculate LinTab values
138 {
139 sv+=ds;
140 lastT[j]=CalcDiff2Prod_Ratio(sv,A);
141 }
142 lastL = new G4double[mls]; // Create the logarithmic Table
143 //G4double ls=std::log(s_value);
144 //lastK = static_cast<int>((ls-lsi)/dl)+1; // MaxBin to be initialized in LogTaB
145 //if(lastK>nls) // ===> Now initialize all lin table
146 //{
147 // lastK=nls;
148 // lastM=lsa-lsi;
149 //}
150 //else lastM = lastK*dl; // Calculate max initialized ln(s)-lsi for LogTab
151 sv=mi;
152 //for(G4int j=0; j<=lastK; j++) // Calculate LogTab values
153 for(G4int j=0; j<=nls; j++) // Calculate LogTab values
154 {
155 lastL[j]=CalcDiff2Prod_Ratio(sv,A);
156 //if(j!=lastK) sv*=edl;
157 sv*=edl;
158 }
159 i++; // Make a new record to AMDB and position on it
160 vA.push_back(lastA);
161 //vH.push_back(lastH);
162 //vN.push_back(lastN);
163 //vM.push_back(lastM);
164 //vK.push_back(lastK);
165 vT.push_back(lastT);
166 vL.push_back(lastL);
167 }
168 else // The A value was found in AMDB
169 {
170 lastA=vA[i];
171 //lastH=vH[i];
172 //lastN=vN[i];
173 //lastM=vM[i];
174 //lastK=vK[i];
175 lastT=vT[i];
176 lastL=vL[i];
177 // ==> Now all bins of the tables are initialized immediately for the A
178 //if(s_value>lastH) // At least LinTab must be updated
179 //{
180 // G4int nextN=lastN+1; // The next bin to be initialized
181 // if(lastN<nps)
182 // {
183 // lastN = static_cast<int>(s_value/ds)+1;// MaxBin to be initialized
184 // G4double sv=lastH;
185 // if(lastN>nps)
186 // {
187 // lastN=nps;
188 // lastH=sma;
189 // }
190 // else lastH = lastN*ds; // Calculate max initialized s for LinTab
191 // for(G4int j=nextN; j<=lastN; j++)// Calculate LogTab values
192 // {
193 // sv+=ds;
194 // lastT[j]=CalcDiff2Prod_Ratio(sv,A);
195 // }
196 // } // End of LinTab update
197 // if(lastN>=nextN)
198 // {
199 // vH[i]=lastH;
200 // vN[i]=lastN;
201 // }
202 // G4int nextK=lastK+1;
203 // if(s_value>sma && lastK<nls) // LogTab must be updated
204 // {
205 // G4double sv=std::exp(lastM+lsi); // Define starting poit (lastM will be changed)
206 // G4double ls=std::log(s_value);
207 // lastK = static_cast<int>((ls-lsi)/dl)+1; // MaxBin to be initialized in LogTaB
208 // if(lastK>nls)
209 // {
210 // lastK=nls;
211 // lastM=lsa-lsi;
212 // }
213 // else lastM = lastK*dl; // Calcul. max initialized ln(s)-lsi for LogTab
214 // for(G4int j=nextK; j<=lastK; j++)// Calculate LogTab values
215 // {
216 // sv*=edl;
217 // lastL[j]=CalcDiff2Prod_Ratio(sv,A);
218 // }
219 // } // End of LogTab update
220 // if(lastK>=nextK)
221 // {
222 // vM[i]=lastM;
223 // vK[i]=lastK;
224 // }
225 //}
226 }
227 // Now one can use tabeles to calculate the value
228 if(s_value<sma) // Use linear table
229 {
230 G4int n=static_cast<int>(s_value/ds); // Low edge number of the bin
231 G4double d=s_value-n*ds; // Linear shift
232 G4double v=lastT[n]; // Base
233 lastR=v+d*(lastT[n+1]-v)/ds; // Result
234 }
235 else // Use log table
236 {
237 G4double ls=std::log(s_value)-lsi; // ln(s)-l_min
238 G4int n=static_cast<int>(ls/dl); // Low edge number of the bin
239 G4double d=ls-n*dl; // Log shift
240 G4double v=lastL[n]; // Base
241 lastR=v+d*(lastL[n+1]-v)/dl; // Result
242 }
243 if(lastR<0.) lastR=0.;
244 if(lastR>1.) lastR=1.;
245 return lastR;
246} // End of GetRatio
247
248// Calculate Diffraction/Production Ratio as a function of total sq(s)(hN) (in GeV), A=Z+N
249G4double G4QDiffractionRatio::CalcDiff2Prod_Ratio(G4double s_value, G4int A)
250{
251 static G4int mA=0;
252 static G4double S=.1; // s=SQRT(M_N^2+M_h^2+2*E_h*M_N)
253 static G4double R=0.; // Prototype of the result
254 static G4double p1=0.;
255 static G4double p2=0.;
256 static G4double p4=0.;
257 static G4double p5=0.;
258 static G4double p6=0.;
259 static G4double p7=0.;
260 if(s_value<=0. || A<=1) return 0.;
261 if(A!=mA && A!=1)
262 {
263 S=s_value;
264 mA=A;
265 G4double a=mA;
266 G4double sa=std::sqrt(a);
267 G4double a2=a*a;
268 G4double a3=a2*a;
269 G4double a4=a3*a;
270 G4double a5=a4*a;
271 G4double a6=a5*a;
272 G4double a7=a6*a;
273 G4double a8=a7*a;
274 G4double a11=a8*a3;
275 G4double a12=a8*a4;
276 p1=(.023*std::pow(a,0.37)+3.5/a3+2.1e6/a12+4.e-14*a5)/(1.+7.6e-4*a*sa+2.15e7/a11);
277 p2=(1.42*std::pow(a,0.61)+1.6e5/a8+4.5e-8*a4)/(1.+4.e-8*a4+1.2e4/a6);
278 G4double q=std::pow(a,0.7);
279 p4=(.036/q+.0009*q)/(1.+6./a3+1.e-7*a3);
280 p5=1.3*std::pow(a,0.1168)/(1.+1.2e-8*a3);
281 p6=.00046*(a+11830./a2);
282 p7=1./(1.+6.17/a2+.00406*a);
283 }
284 else if(A==1 && mA!=1)
285 {
286 S=s_value;
287 p1=.0315;
288 p2=.73417;
289 p4=.01109;
290 p5=1.0972;
291 p6=.065787;
292 p7=.62976;
293 }
294 else if(std::fabs(s_value-S)/S<.0001) return R;
295 G4double s2=s_value*s_value;
296 G4double s4=s2*s2;
297 G4double dl=std::log(s_value)-p5;
298 R=1./(1.+1./(p1+p2/s4+p4*dl*dl/(1.+p6*std::pow(s_value,p7))));
299 return R;
300} // End of CalcQF2IN_Ratio
301
302
304 G4int tgZ, G4int tgN)
305{
306 static const G4double pFm= 0.; // Fermi momentum in MeV (delta function)
307 //static const G4double pFm= 250.; // Fermi momentum in MeV (delta function)
308 static const G4double pFm2= pFm*pFm; // Squared Fermi momentum in MeV^2 (delta function)
309 static const G4double mPi0= G4QPDGCode(111).GetMass(); // pi0 mass (MeV =min diffraction)
310 //static const G4double mPi= G4QPDGCode(211).GetMass(); // pi+- mass (MeV)
311 static const G4double mNeut= G4QPDGCode(2112).GetMass();
312 static const G4double mNeut2=mNeut*mNeut;
313 static const G4double dmNeut=mNeut+mNeut;
314 static const G4double mProt= G4QPDGCode(2212).GetMass();
315 static const G4double mProt2=mProt*mProt;
316 static const G4double dmProt=mProt+mProt;
317 static const G4double maxDM=mProt*12.;
318 //static const G4double mLamb= G4QPDGCode(3122).GetMass();
319 //static const G4double mSigZ= G4QPDGCode(3212).GetMass();
320 //static const G4double mSigM= G4QPDGCode(3112).GetMass();
321 //static const G4double mSigP= G4QPDGCode(3222).GetMass();
322 //static const G4double eps=.003;
323 static const G4double third=1./3.;
324 //
325 G4LorentzVector pr4M=p4M/megaelectronvolt; // Convert 4-momenta in MeV (keep p4M)
326 // prepare the DONOTHING answer
327 G4QHadronVector* ResHV = new G4QHadronVector;// !! MUST BE DESTROYE/DDELETER by CALLER !!
328 G4QHadron* hadron = new G4QHadron(pPDG,p4M); // Hadron for not scattered projectile
329 ResHV->push_back(hadron); // It must be cleaned up for real scattering sec
330 // @@ diffraction is simulated as noncoherent (coherent is small)
331 G4int tgA=tgZ+tgN; // A of the target
332 G4int tPDG=90000000+tgZ*1000+tgN; // PDG code of the targetNucleus/recoilNucleus
333 G4double tgM=G4QPDGCode(tPDG).GetMass(); // Mass of the target nucleus
334 G4int rPDG=2112; // prototype of PDG code of the recoiled nucleon
335 if(tgA*G4UniformRand()>tgN) // Substitute by a proton
336 {
337 rPDG=2212; // PDG code of the recoiled QF nucleon
338 tPDG-=1000; // PDG code of the recoiled nucleus
339 }
340 else tPDG-=1; // PDG code of the recoiled nucleus
341 G4double tM=G4QPDGCode(tPDG).GetMass(); // Mass of the recoiled nucleus
342 G4double tE=std::sqrt(tM*tM+pFm2); // Free energy of the recoil nucleus
343 G4ThreeVector tP=pFm*G4RandomDirection();// 3-mom of the recoiled nucleus
344 G4LorentzVector t4M(tP,tE); // 4M of the recoil nucleus
345 G4LorentzVector tg4M(0.,0.,0.,tgM); // Full target 4-momentum
346 G4LorentzVector N4M=tg4M-t4M; // 4-mom of Quasi-free target nucleon
347 G4LorentzVector tot4M=N4M+p4M; // total momentum of quasi-free diffraction
348 G4double mT=mNeut; // Prototype of mass of QF nucleon
349 G4double mT2=mNeut2; // Squared mass of a free nucleon to be excited
350 G4double dmT=dmNeut; // Doubled mass
351 //G4int Z=0; // Prototype of the isotope Z
352 //G4int N=1; // Prototype of the Isotope N
353 if(rPDG==2212) // Correct it, if this is a proton
354 {
355 mT=mProt; // Prototype of mass of QF nucleon to be excited
356 mT2=mProt2; // Squared mass of the free nucleon
357 dmT=dmProt; // Doubled mass
358 //Z=1; // Z of the isotope
359 //N=0; // N of the Isotope
360 }
361 G4double mP2=pr4M.m2(); // Squared mass of the projectile
362 if(mP2<0.) mP2=0.; // Can be a problem for photon (m_min = 2*m_pi0)
363 G4double s_value=tot4M.m2(); // @@ Check <0 ...
364 G4double E=(s_value-mT2-mP2)/dmT; // Effective interactionEnergy (virtNucl target)
365 G4double E2=E*E;
366 if(E<0. || E2<mP2) // Impossible to fragment: return projectile
367 {
368#ifdef pdebug
369 G4cerr<<"-Warning-G4DifR::TFra:<NegativeEnergy>E="<<E<<",E2="<<E2<<"<M2="<<mP2<<G4endl;
370#endif
371 return ResHV; // *** Do Nothing Action ***
372 }
373 G4double mP=std::sqrt(mP2); // Calculate mass of the projectile (to be exc.)
374 if(mP<.1) mP=mPi0; // For photons minDiffraction is gam+P->P+Pi0
375 //G4double dmP=mP+mP; // Doubled mass of the projectile
376 G4double mMin=mP+mPi0; // Minimum diffractive mass
377 G4double tA=tgA; // Real A of the target
378 G4double sA=5./std::pow(tA,third); // Mass-screaning
379 //mMin+=mPi0+G4UniformRand()*(mP*sA+mPi0); // *Experimental*
380 mMin+=G4UniformRand()*(mP*sA+mPi0); // *Experimental*
381 G4double ss=std::sqrt(s_value); // CM compound mass (sqrt(s))
382 G4double mMax=ss-mP; // Maximum diffraction mass of the projectile
383 if(mMax>maxDM) mMax=maxDM; // Restriction to avoid too big masses
384 if(mMin>=mMax)
385 {
386#ifdef pdebug
387 G4cerr<<"-Warning-G4DifR::TFra:ZeroDiffractionMRange, mi="<<mMin<<",ma="<<mMax<<G4endl;
388#endif
389 return ResHV; // Do Nothing Action
390 }
392 G4double mDif=std::exp(R*std::log(mMax)+(1.-R)*std::log(mMin)); // Low Mass Approximation
393 G4double mDif2=mDif*mDif;
394 G4double ds=s_value-mP2-mDif2;
395 //G4double e=ds/dmP;
396 //G4double P=std::sqrt(e*e-mDif2); // Momentum in pseudo laboratory system
397#ifdef debug
398 G4cout<<"G4QDiffR::TargFrag:Before XS, P="<<P<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
399#endif
400 // @@ Temporary NN t-dependence for all hadrons
401 if(pPDG>3400 || pPDG<-3400) G4cout<<"-Warning-G4QDifR::Fragment: pPDG="<<pPDG<<G4endl;
402 G4double maxt=(ds*ds-4*mP2*mDif2)/s_value; // maximum possible -t
403 G4double tsl=140000.; // slope in MeV^2
404 G4double t=-std::log(G4UniformRand())*tsl;
405#ifdef pdebug
406 G4cout<<"G4QDifR::TFra:ph="<<pPDG<<",P="<<P<<",t="<<t<<"<"<<maxt<<G4endl;
407#endif
408#ifdef nandebug
409 if(mint>-.0000001); // To make the Warning for NAN
410 else G4cout<<"******G4QDiffractionRatio::TargFragment: -t="<<mint<<G4endl;
411#endif
412 G4double rt=t/maxt;
413 G4double cost=1.-rt-rt; // cos(theta) in CMS
414#ifdef ppdebug
415 G4cout<<"G4QDiffraRatio::TargFragment: -t="<<t<<", maxt="<<maxt<<", cost="<<cost<<G4endl;
416#endif
417 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
418 {
419 if (cost>1.) cost=1.;
420 else if(cost<-1.) cost=-1.;
421 else
422 {
423 G4cerr<<"G4QDiffRat::TargFragm: *NAN* cost="<<cost<<",t="<<t<<",tmax="<<maxt<<G4endl;
424 return ResHV; // Do Nothing Action
425 }
426 }
427 G4LorentzVector r4M=G4LorentzVector(0.,0.,0.,mP); // 4mom of the leading nucleon
428 G4LorentzVector d4M=G4LorentzVector(0.,0.,0.,mDif); // 4mom of the diffract. Quasmon
429 G4LorentzVector dir4M=tot4M-G4LorentzVector(0.,0.,0.,(tot4M.e()-mT)*.01);
430 if(!G4QHadron(tot4M).RelDecayIn2(r4M, d4M, dir4M, cost, cost))
431 {
432 G4cerr<<"G4QDifR::TFr:M="<<tot4M.m()<<",T="<<mT<<",D="<<mDif<<",T+D="<<mT+mDif<<G4endl;
433 //G4Exception("G4QDifR::Fragm:","009",FatalException,"Decay of ElasticComp");
434 return ResHV; // Do Nothing Action
435 }
436#ifdef debug
437 G4cout<<"G4QDifRat::TargFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
438#endif
439 // Now everything is ready for fragmentation and DoNothing projHadron must be wiped out
440 delete hadron; // Delete the fake (doNothing) projectile hadron
441 ResHV->pop_back(); // Clean up pointer to the fake (doNothing) projectile
442 hadron = new G4QHadron(pPDG,r4M); // Hadron for the recoil nucleon
443 ResHV->push_back(hadron); // Fill the recoil nucleon
444#ifdef debug
445 G4cout<<"G4QDiffractionRatio::TargFragm: *Filled* LeadingNuc="<<r4M<<pPDG<<G4endl;
446#endif
447 G4QHadronVector* leadhs = 0; // Prototype of Quasmon Output G4QHadronVector ---->---*
448 G4QContent dQC=G4QPDGCode(rPDG).GetQuarkContent(); // QuarkContent of quasiFreeNucleon |
449 G4Quasmon* quasm = new G4Quasmon(dQC,d4M); // Quasmon=DiffractionExcitationQuasmon-* |
450#ifdef debug
451 G4cout<<"G4QDiffRatio::TgFrag:tPDG="<<tPDG<<",rPDG="<<rPDG<<",d4M="<<d4M<<G4endl;//| |
452#endif
453 G4QEnvironment* pan= new G4QEnvironment(G4QNucleus(tPDG));// --> DELETED --->---* | |
454 pan->AddQuasmon(quasm); // Add diffractiveQuasmon to Environ.| | |
455#ifdef debug
456 G4cout<<"G4QDiffractionRatio::TargFragment: EnvPDG="<<tPDG<<G4endl; // | | |
457#endif
458 try // | | |
459 { // | | |
460 leadhs = pan->Fragment();// DESTROYED in the end of the LOOP work space | | <-|
461 } // | | |
462 catch (G4QException& error)// | | |
463 { // | | |
464 //#ifdef pdebug
465 G4cerr<<"***G4QDiffractionRatio::TargFrag: G4QException is catched"<<G4endl;//| | |
466 //#endif
467 // G4Exception("G4QDiffractionRatio::TargFragm:","27",FatalException,"*Nucl");// | | |
468 G4Exception("G4QDiffractionRatio::TargFragment()","HAD_CHPS_0027",
469 FatalException, "Nucl");
470 } // | | |
471 delete pan; // Delete the Nuclear Environment <-<--*--* |
472 G4int qNH=leadhs->size(); // A#of collected hadrons from diff.frag. |
473 if(qNH) for(G4int iq=0; iq<qNH; iq++) // Loop over hadrons to fill the result |
474 { // |
475 G4QHadron* loh=(*leadhs)[iq]; // Pointer to the output hadron |
476 ResHV->push_back(loh); // Fill in the result |
477 } // |
478 leadhs->clear();// |
479 delete leadhs; // <----<----<----<----<----<----<----<----<----<----<----<----<----<---*
480 return ResHV; // Result
481} // End of TargFragment
482
483
485 G4int tgZ, G4int tgN)
486{
487 static const G4double pFm= 250.; // Fermi momentum in MeV (delta function)
488 static const G4double pFm2= pFm*pFm; // Squared Fermi momentum in MeV^2 (delta function)
489 static const G4double mPi0= G4QPDGCode(111).GetMass(); // pi0 mass (MeV =min diffraction)
490 static const G4double mPi= G4QPDGCode(211).GetMass(); // pi+- mass (MeV)
491 static const G4double mNeut= G4QPDGCode(2112).GetMass();
492 static const G4double mNeut2=mNeut*mNeut;
493 static const G4double dmNeut=mNeut+mNeut;
494 static const G4double mProt= G4QPDGCode(2212).GetMass();
495 static const G4double mProt2=mProt*mProt;
496 static const G4double dmProt=mProt+mProt;
497 static const G4double maxDM=mProt*12.;
498 static const G4double mLamb= G4QPDGCode(3122).GetMass();
499 static const G4double mSigZ= G4QPDGCode(3212).GetMass();
500 static const G4double mSigM= G4QPDGCode(3112).GetMass();
501 static const G4double mSigP= G4QPDGCode(3222).GetMass();
502 static const G4double eps=.003;
503 //
504 G4LorentzVector pr4M=p4M/megaelectronvolt; // Convert 4-momenta in MeV (keep p4M)
505 // prepare the DONOTHING answer
506 G4QHadronVector* ResHV = new G4QHadronVector;// !! MUST BE DESTROYE/DDELETER by CALLER !!
507 G4QHadron* hadron = new G4QHadron(pPDG,p4M); // Hadron for not scattered projectile
508 ResHV->push_back(hadron); // It must be cleaned up for real scattering sec
509 // @@ diffraction is simulated as noncoherent (coherent is small)
510 G4int tgA=tgZ+tgN; // A of the target
511 G4int tPDG=90000000+tgZ*1000+tgN; // PDG code of the targetNucleus/recoilNucleus
512 G4double tgM=G4QPDGCode(tPDG).GetMass(); // Mass of the target nucleus
513 G4int rPDG=2112; // prototype of PDG code of the recoiled nucleon
514 if(tgA*G4UniformRand()>tgN) // Substitute by a proton
515 {
516 rPDG=2212; // PDG code of the recoiled QF nucleon
517 tPDG-=1000; // PDG code of the recoiled nucleus
518 }
519 else tPDG-=1; // PDG code of the recoiled nucleus
520 G4double tM=G4QPDGCode(tPDG).GetMass(); // Mass of the recoiled nucleus
521 G4double tE=std::sqrt(tM*tM+pFm2);
523 G4LorentzVector t4M(tP,tE); // 4M of the recoil nucleus
524 G4LorentzVector tg4M(0.,0.,0.,tgM);
525 G4LorentzVector N4M=tg4M-t4M; // Quasi-free target nucleon
526 G4LorentzVector tot4M=N4M+p4M; // total momentum of quasi-free diffraction
527 G4double mT=mNeut;
528 G4double mT2=mNeut2; // Squared mass of the free nucleon spectator
529 G4double dmT=dmNeut;
530 //G4int Z=0;
531 //G4int N=1;
532 if(rPDG==2212)
533 {
534 mT=mProt;
535 mT2=mProt2;
536 dmT=dmProt;
537 //Z=1;
538 //N=0;
539 }
540 G4double mP2=pr4M.m2(); // Squared mass of the projectile
541 if(mP2<0.) mP2=0.; // A possible problem for photon (m_min = 2*m_pi0)
542 G4double s_value=tot4M.m2(); // @@ Check <0 ...
543 G4double E=(s_value-mT2-mP2)/dmT; // Effective interactin energy (virt. nucl. target)
544 G4double E2=E*E;
545 if(E<0. || E2<mP2)
546 {
547#ifdef pdebug
548 G4cerr<<"-Warning-G4DifR::PFra:<NegativeEnergy>E="<<E<<",E2="<<E2<<"<M2="<<mP2<<G4endl;
549#endif
550 return ResHV; // Do Nothing Action
551 }
552 G4double mP=std::sqrt(mP2);
553 if(mP<.1)mP=mPi0; // For photons min diffraction is gamma+P->Pi0+Pi0
554 G4double mMin=mP+mPi0; // Minimum diffractive mass
555 G4double ss=std::sqrt(s_value); // CM compound mass (sqrt(s))
556 G4double mMax=ss-mT; // Maximum diffraction mass
557 if(mMax>maxDM) mMax=maxDM; // Restriction to avoid too big masses
558 if(mMin>=mMax)
559 {
560#ifdef pdebug
561 G4cerr<<"-Warning-G4DifR::PFra:ZeroDiffractionMRange, mi="<<mMin<<",ma="<<mMax<<G4endl;
562#endif
563 return ResHV; // Do Nothing Action
564 }
566 G4double mDif=std::exp(R*std::log(mMax)+(1.-R)*std::log(mMin)); // LowMassApproximation
567 G4double mDif2=mDif*mDif;
568 G4double ds=s_value-mT2-mDif2;
569 //G4double e=ds/dmT;
570 //G4double P=std::sqrt(e*e-mDif2); // Momentum in pseudo laboratory system
571#ifdef debug
572 G4cout<<"G4QDiffR::PFra: Before XS, P="<<P<<", Z="<<Z<<", N="<<N<<", PDG="<<pPDG<<G4endl;
573#endif
574 // @@ Temporary NN t-dependence for all hadrons
575 if(pPDG>3400 || pPDG<-3400) G4cout<<"-Warning-G4QDifR::Fragment: pPDG="<<pPDG<<G4endl;
576 G4double tsl=140000.; // slope in MeV^2
577 G4double t=-std::log(G4UniformRand())*tsl;
578 G4double maxt=(ds*ds-4*mT2*mDif2)/s_value; // maximum possible -t
579#ifdef pdebug
580 G4cout<<"G4QDifR::PFra:ph="<<pPDG<<",P="<<P<<",t="<<mint<<"<"<<maxt<<G4endl;
581#endif
582#ifdef nandebug
583 if(mint>-.0000001); // To make the Warning for NAN
584 else G4cout<<"******G4QDiffractionRatio::ProjFragment: -t="<<mint<<G4endl;
585#endif
586 G4double rt=t/maxt;
587 G4double cost=1.-rt-rt; // cos(theta) in CMS
588#ifdef ppdebug
589 G4cout<<"G4QDiffRatio::ProjFragment: -t="<<t<<", maxt="<<maxt<<", cost="<<cost<<G4endl;
590#endif
591 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
592 {
593 if (cost>1.) cost=1.;
594 else if(cost<-1.) cost=-1.;
595 else
596 {
597 G4cerr<<"G4QDiffRat::ProjFragm: *NAN* cost="<<cost<<",t="<<t<<",tmax="<<maxt<<G4endl;
598 return ResHV; // Do Nothing Action
599 }
600 }
601 G4LorentzVector r4M=G4LorentzVector(0.,0.,0.,mT); // 4mom of the recoil nucleon
602 G4LorentzVector d4M=G4LorentzVector(0.,0.,0.,mDif); // 4mom of the diffract. Quasmon
603 G4LorentzVector dir4M=tot4M-G4LorentzVector(0.,0.,0.,(tot4M.e()-mT)*.01);
604 if(!G4QHadron(tot4M).RelDecayIn2(d4M, r4M, dir4M, cost, cost))
605 {
606 G4cerr<<"G4QDifR::PFr:M="<<tot4M.m()<<",T="<<mT<<",D="<<mDif<<",T+D="<<mT+mDif<<G4endl;
607 //G4Exception("G4QDifR::Fragm:","009",FatalException,"Decay of ElasticComp");
608 return ResHV; // Do Nothing Action
609 }
610#ifdef debug
611 G4cout<<"G4QDiffR::ProjFragm:d4M="<<d4M<<"+r4M="<<r4M<<"="<<d4M+r4M<<"="<<tot4M<<G4endl;
612#endif
613 // Now everything is ready for fragmentation and DoNothing projHadron must be wiped out
614 delete hadron; // Delete the fake (doNothing) projectile hadron
615 ResHV->pop_back(); // Clean up pointer to the fake (doNothing) projectile
616 hadron = new G4QHadron(tPDG,t4M); // Hadron for the recoil neucleus
617 ResHV->push_back(hadron); // Fill the recoil nucleus
618#ifdef debug
619 G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleus="<<t4M<<tPDG<<G4endl;
620#endif
621 hadron = new G4QHadron(rPDG,r4M); // Hadron for the recoil nucleon
622 ResHV->push_back(hadron); // Fill the recoil nucleon
623#ifdef debug
624 G4cout<<"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleon="<<r4M<<rPDG<<G4endl;
625#endif
626 G4LorentzVector sum4M(0.,0.,0.,0.);
627 // Now the (pPdg,d4M) Quasmon must be fragmented
628 G4QHadronVector* leadhs = 0; // Prototype of QuasmOutput G4QHadronVector
629 G4QContent dQC=G4QPDGCode(pPDG).GetQuarkContent(); // Quark Content of the projectile
630 G4Quasmon* pan= new G4Quasmon(dQC,d4M); // --->---->---->----->-----> DELETED -->---*
631 try // |
632 { // |
633 G4QNucleus vac(90000000); // |
634 leadhs=pan->Fragment(vac,1); // DELETED after it is copied to ResHV vector -->---+-*
635 } // | |
636 catch (G4QException& error) // | |
637 { // | |
638 G4cerr<<"***G4QDiffractionRatio::ProjFragment: G4Quasmon Exception"<<G4endl; //| |
639 // G4Exception("G4QDiffractionRatio::ProjFragment","72",FatalException,"*Quasmon");//| |
640 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0072",
641 FatalException, "*Quasmon");
642 } // | |
643 delete pan; // Delete the Nuclear Environment <----<---* |
644 G4int qNH=leadhs->size(); // A#of collected hadrons from diff.frag. |
645 if(qNH) for(G4int iq=0; iq<qNH; iq++) // Loop over hadrons to fill the result |
646 { // |
647 G4QHadron* loh=(*leadhs)[iq]; // Pointer to the output hadron |
648 G4int nL=loh->GetStrangeness(); // A number of Lambdas in the Hypernucleus |
649 G4int nB=loh->GetBaryonNumber(); // Total Baryon Number of the Hypernucleus |
650 G4int nC = loh->GetCharge(); // Charge of the Hypernucleus |
651 G4int oPDG = loh->GetPDGCode(); // Original CHIPS PDG Code of the hadron |
652 //if((nC>nB || nC<0) && nB>0 && nL>=0 && nL<=nB && oPDG>80000000) // Iso-nucleus |
653 if(2>3) // Closed because "G4QDR::F:90002999,M=-7.768507e-04,B=2,S=0,C=3" is found |
654 {
655 G4LorentzVector q4M = loh->Get4Momentum(); // Get 4-momentum of the Isonucleus |
656 G4double qM=q4M.m(); // Real mass of the Isonucleus
657#ifdef fdebug
658 G4cout<<"G4QDR::PF:"<<oPDG<<",M="<<qM<<",B="<<nB<<",S="<<nL<<",C="<<nC<<G4endl;// |
659#endif
660 G4int qPN=nC-nB; // Number of pions in the Isonucleus |
661 G4int fPDG = 2212; // Prototype for nP+(Pi+) case |
662 G4int sPDG = 211;
663 tPDG = 3122; // @@ Sigma0 (?) |
664 G4double fMass= mProt;
665 G4double sMass= mPi;
666 G4double tMass= mLamb; // @@ Sigma0 (?) |
667 G4bool cont=true; // Continue flag |
668 // =--------= Negative state =---------=
669 if(nC<0) // =----= Only Pi- can help |
670 {
671 if(nL&&nB==nL) // --- n*Lamb + k*(Pi-) State --- |
672 {
673 sPDG = -211;
674 if(-nC==nL && nL==1) // Only one Sigma- like (nB=1) |
675 {
676 if(std::fabs(qM-mSigM)<eps)
677 {
678 loh->SetQPDG(G4QPDGCode(3112)); // This is Sigma- |
679 cont=false; // Skip decay |
680 }
681 else if(qM>mLamb+mPi) //(2) Sigma- => Lambda + Pi- decay |
682 {
683 fPDG = 3122;
684 fMass= mLamb;
685 }
686 else if(qM>mSigM) //(2) Sigma+=>Sigma++gamma decay |
687 {
688 fPDG = 3112;
689 fMass= mSigM;
690 sPDG = 22;
691 sMass= 0.;
692 }
693 else //(2) Sigma-=>Neutron+Pi- decay |
694 {
695 fPDG = 2112;
696 fMass= mNeut;
697 }
698 qPN = 1; // #of (Pi+ or gamma)'s = 1 |
699 }
700 else if(-nC==nL) //(2) a few Sigma- like |
701 {
702 qPN = 1; // One separated Sigma- |
703 fPDG = 3112;
704 sPDG = 3112;
705 sMass= mSigM;
706 nB--;
707 fMass= mSigM;
708 }
709 else if(-nC>nL) //(2) n*(Sigma-)+m*(Pi-) |
710 {
711 qPN = -nC-nL; // #of Pi-'s |
712 fPDG = 3112;
713 fMass= mSigM;
714 }
715 else //(2) n*(Sigma-)+m*Lambda(-nC<nL) |
716 {
717 nB += nC; // #of Lambda's |
718 fPDG = 3122;
719 fMass= mLamb;
720 qPN = -nC; // #of Sigma+'s |
721 sPDG = 3112;
722 sMass= mSigM;
723 }
724 nL = 0; // Only decays in two are above |
725 }
726 else if(nL) // ->n*Lamb+m*Neut+k*(Pi-) State (nL<nB) |
727 {
728 nB -= nL; // #of neutrons |
729 fPDG = 2112;
730 fMass= mNeut;
731 G4int nPin = -nC; // #of Pi-'s
732 if(nL==nPin) //(2) m*Neut+n*Sigma- |
733 {
734 qPN = nL; // #of Sigma- |
735 sPDG = 3112;
736 sMass= mSigM;
737 nL = 0;
738 }
739 else if(nL>nPin) //(3) m*P+n*(Sigma+)+k*Lambda |
740 {
741 nL-=nPin; // #of Lambdas |
742 qPN = nPin; // #of Sigma+ |
743 sPDG = 3112;
744 sMass= mSigM;
745 }
746 else //(3) m*N+n*(Sigma-)+k*(Pi-) (nL<nPin) |
747 {
748 qPN = nPin-nL; // #of Pi- |
749 sPDG = -211;
750 tPDG = 3112;
751 tMass= mSigM;
752 }
753 }
754 else //(2) n*N+m*(Pi-) (nL=0) |
755 {
756 sPDG = -211;
757 qPN = -nC;
758 fPDG = 2112;
759 fMass= mNeut;
760 }
761 }
762 else if(!nC) // *** Should not be here *** |
763 {
764 if(nL && nL<nB) //(2) n*Lamb+m*N ***Should not be here*** |
765 {
766 qPN = nL;
767 fPDG = 2112; // mN+nL case |
768 sPDG = 3122;
769 sMass= mLamb;
770 nB -= nL;
771 fMass= mNeut;
772 nL = 0;
773 }
774 else if(nL>1 && nB==nL) //(2) m*Lamb(m>1) ***Should not be here*** |
775 {
776 qPN = 1;
777 fPDG = 3122;
778 sPDG = 3122;
779 sMass= mLamb;
780 nB--;
781 fMass= mLamb;
782 }
783 else if(!nL && nB>1) //(2) n*Neut(n>1) ***Should not be here*** |
784 {
785 qPN = 1;
786 fPDG = 2112;
787 sPDG = 2112;
788 sMass= mNeut;
789 nB--;
790 fMass= mNeut;
791 }
792 else G4cout<<"*?*G4QDiffractionRatio::ProjFragment: (1) oPDG="<<oPDG<<G4endl;// |
793 }
794 else if(nC>0) // n*Lamb+(m*P)+(k*Pi+) |
795 {
796 if(nL && nL+nC==nB) //(2) n*Lamb+m*P ***Should not be here*** |
797 {
798 qPN = nL;
799 nL = 0;
800 fPDG = 2212;
801 sPDG = 3122;
802 sMass= mLamb;
803 nB = nC;
804 fMass= mProt;
805 }
806 else if(nL && nC<nB-nL) //(3)n*L+m*P+k*N ***Should not be here*** |
807 {
808 qPN = nC; // #of protons |
809 fPDG = 2112; // mP+nL case |
810 sPDG = 2212;
811 sMass= mProt;
812 nB -= nL+nC; // #of neutrons |
813 fMass= mNeut;
814 }
815 else if(nL && nB==nL) // ---> n*L+m*Pi+ State |
816 {
817 if(nC==nL && nL==1) // Only one Sigma+ like State |
818 {
819 if(std::fabs(qM-mSigP)<eps)
820 {
821 loh->SetQPDG(G4QPDGCode(3222)); // This is GS Sigma+ |
822 cont=false; // Skip decay |
823 }
824 else if(qM>mLamb+mPi) //(2) Sigma+=>Lambda+Pi+ decay |
825 {
826 fPDG = 3122;
827 fMass= mLamb;
828 }
829 else if(qM>mNeut+mPi) //(2) Sigma+=>Neutron+Pi+ decay |
830 {
831 fPDG = 2112;
832 fMass= mNeut;
833 }
834 else if(qM>mSigP) //(2) Sigma+=>Sigma++gamma decay |
835 {
836 fPDG = 3222;
837 fMass= mSigP;
838 sPDG = 22;
839 sMass= 0.;
840 }
841 else //(2) Sigma+=>Proton+gamma decay |
842 {
843 fPDG = 2212;
844 fMass= mProt;
845 sPDG = 22;
846 sMass= 0.;
847 }
848 qPN = 1; // #of (Pi+ or gamma)'s = 1 |
849 }
850 else if(nC==nL) //(2) a few Sigma+ like hyperons |
851 {
852 qPN = 1;
853 fPDG = 3222;
854 sPDG = 3222;
855 sMass= mSigP;
856 nB--;
857 fMass= mSigP;
858 }
859 else if(nC>nL) //(2) n*(Sigma+)+m*(Pi+) |
860 {
861 qPN = nC-nL; // #of Pi+'s |
862 fPDG = 3222;
863 nB = nL; // #of Sigma+'s |
864 fMass= mSigP;
865 }
866 else //(2) n*(Sigma+)+m*Lambda |
867 {
868 nB -= nC; // #of Lambda's |
869 fPDG = 3122;
870 fMass= mLamb;
871 qPN = nC; // #of Sigma+'s |
872 sPDG = 3222;
873 sMass= mSigP;
874 }
875 nL = 0; // All above are decays in 2 |
876 }
877 else if(nL && nC>nB-nL) // n*Lamb+m*P+k*Pi+ |
878 {
879 nB -= nL; // #of protons |
880 G4int nPip = nC-nB; // #of Pi+'s |
881 if(nL==nPip) //(2) m*P+n*Sigma+ |
882 {
883 qPN = nL; // #of Sigma+ |
884 sPDG = 3222;
885 sMass= mSigP;
886 nL = 0;
887 }
888 else if(nL>nPip) //(3) m*P+n*(Sigma+)+k*Lambda |
889 {
890 nL -= nPip; // #of Lambdas |
891 qPN = nPip; // #of Sigma+ |
892 sPDG = 3222;
893 sMass= mSigP;
894 }
895 else //(3) m*P+n*(Sigma+)+k*(Pi+) |
896 {
897 qPN = nPip-nL; // #of Pi+ |
898 tPDG = 3222;
899 tMass= mSigP;
900 }
901 }
902 if(nC<nB) //(2) n*P+m*N ***Should not be here*** |
903 {
904 fPDG = 2112;
905 fMass= mNeut;
906 qPN = nC;
907 sPDG = 2212;
908 sMass= mProt;
909 }
910 else if(nB==nC && nC>1) //(2) m*Prot(m>1) ***Should not be here*** |
911 {
912 qPN = 1;
913 fPDG = 2212;
914 sPDG = 2212;
915 sMass= mProt;
916 nB--;
917 fMass= mProt;
918 }
919 else if(nC<=nB||!nB) G4cout<<"*?*G4QDR::ProjFragm: (2) oPDG="<<oPDG<<G4endl; // |
920 // !nL && nC>nB //(2) Default condition n*P+m*(Pi+) |
921 }
922 if(cont) // Make a decay |
923 {
924 G4double tfM=nB*fMass;
925 G4double tsM=qPN*sMass;
926 G4double ttM=0.;
927 if(nL) ttM=nL*tMass;
928 G4LorentzVector f4Mom(0.,0.,0.,tfM);
929 G4LorentzVector s4Mom(0.,0.,0.,tsM);
930 G4LorentzVector t4Mom(0.,0.,0.,ttM);
931 G4double sum=tfM+tsM+ttM;
932 if(std::fabs(qM-sum)<eps)
933 {
934 f4Mom=q4M*(tfM/sum);
935 s4Mom=q4M*(tsM/sum);
936 if(nL) t4Mom=q4M*(ttM/sum);
937 }
938 else if(!nL && (qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))) // Error |
939 {
940 //#ifdef fdebug
941 G4cout<<"***G4QDR::PrFragm:fPDG="<<fPDG<<"*"<<nB<<"(fM="<<fMass<<")+sPDG="<<sPDG
942 <<"*"<<qPN<<"(sM="<<sMass<<")"<<"="<<sum<<" > TM="<<qM<<q4M<<oPDG<<G4endl;
943 //#endif
944 // throw G4QException("*G4QDiffractionRatio::ProjFragment: Bad decay in 2"); // |
946 ed << "***G4QDR::PrFragm:fPDG=" << fPDG << "*" << nB << "(fM="
947 << fMass << ")+sPDG=" << sPDG << "*" << qPN << "(sM=" << sMass
948 << ")" << "=" << sum << " > TM=" << qM << q4M << oPDG << G4endl;
949 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0002",
950 FatalException, ed);
951 }
952 else if(nL && (qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom)))// Error|
953 {
954 //#ifdef fdebug
955 G4cout<<"***G4DF::PrFrag: "<<fPDG<<"*"<<nB<<"("<<fMass<<")+"<<sPDG<<"*"<<qPN<<"("
956 <<sMass<<")+Lamb*"<<nL<<"="<<sum<<" > TotM="<<qM<<q4M<<oPDG<<G4endl;
957 //#endif
958 // throw G4QException("*G4QDiffractionRatio::ProjFragment: Bad decay in 3"); // |
960 ed << "***G4DF::PrFrag: " << fPDG << "*" << nB << "(" << fMass << ")+"
961 << sPDG << "*" << qPN << "(" << sMass << ")+Lamb*" << nL << "="
962 << sum << " > TotM=" << qM << q4M << oPDG << G4endl;
963 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0003",
964 FatalException, ed);
965 }
966#ifdef fdebug
967 G4cout<<"G4QDF::ProjFragm: *DONE* n="<<nB<<f4Mom<<fPDG<<", m="<<qPN<<s4Mom<<sPDG
968 <<", l="<<nL<<t4Mom<<G4endl;
969#endif
970 G4bool notused=true;
971 if(nB) // There are baryons |
972 {
973 f4Mom/=nB;
974 loh->Set4Momentum(f4Mom); // ! Update the Hadron ! |
975 loh->SetQPDG(G4QPDGCode(fPDG)); // Baryons |
976 notused=false; // Loh was used |
977 if(nB>1) for(G4int ih=1; ih<nB; ih++) // Loop over the rest of baryons |
978 {
979 G4QHadron* Hi = new G4QHadron(fPDG,f4Mom); // Create a Hadron for Baryon |
980 ResHV->push_back(Hi); // Fill in the additional nucleon |
981#ifdef fdebug
982 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
983 G4cout<<"G4QDR::ProjFrag: *additional Nucleon*="<<f4Mom<<fPDG<<G4endl; // |
984#endif
985 }
986 }
987 if(qPN) // There are pions |
988 {
989 s4Mom/=qPN;
990 G4int min=0;
991 if(notused)
992 {
993 loh->Set4Momentum(s4Mom); // ! Update the Hadron 4M ! |
994 loh->SetQPDG(G4QPDGCode(sPDG)); // Update PDG |
995 notused=false; // loh was used |
996 min=1; // start value |
997 }
998 if(qPN>min) for(G4int ip=min; ip<qPN; ip++) // Loop over pions |
999 {
1000 G4QHadron* Hj = new G4QHadron(sPDG,s4Mom); // Create a Hadron for the meson |
1001 ResHV->push_back(Hj); // Fill in the additional pion |
1002#ifdef fdebug
1003 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1004 G4cout<<"G4QDR::ProjFragm: *additional Pion*="<<f4Mom<<fPDG<<G4endl; // |
1005#endif
1006 }
1007 }
1008 if(nL) // There are Hyperons |
1009 {
1010 t4Mom/=nL;
1011 G4int min=0;
1012 if(notused)
1013 {
1014 loh->Set4Momentum(t4Mom); // ! Update the Hadron 4M ! |
1015 loh->SetQPDG(G4QPDGCode(tPDG));// Update PDG |
1016 notused=false; // loh was used |
1017 min=1; //
1018 }
1019 if(nL>min) for(G4int il=min; il<nL; il++) // Loop over Hyperons |
1020 {
1021 G4QHadron* Hk = new G4QHadron(tPDG,t4Mom); // Create a Hadron for Lambda |
1022 ResHV->push_back(Hk); // Fill in the additional pion |
1023#ifdef fdebug
1024 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1025 G4cout<<"G4QDR::ProjFragm: *additional Hyperon*="<<f4Mom<<fPDG<<G4endl; // |
1026#endif
1027 }
1028 }
1029 } // --> End of decay |
1030 } // -> End of Iso-nuclear treatment |
1031 else if( (nL > 0 && nB > 1) || (nL < 0 && nB < -1) )
1032 { // Hypernucleus is found |
1033 G4bool anti=false; // Default=Nucleus (true=antinucleus |
1034 if(nB<0) // Anti-nucleus |
1035 {
1036 anti=true; // Flag of anti-hypernucleus |
1037 nB=-nB; // Reverse the baryon number |
1038 nC=-nC; // Reverse the charge |
1039 nL=-nL; // Reverse the strangeness |
1040 }
1041 G4int hPDG = 90000000+nL*999999+nC*999+nB; // CHIPS PDG Code for Hypernucleus |
1042 G4int nSM=0; // A#0f unavoidable Sigma- |
1043 G4int nSP=0; // A#0f unavoidable Sigma+ |
1044 if(nC<0) // Negative hypernucleus |
1045 {
1046 if(-nC<=nL) // Partial compensation by Sigma- |
1047 {
1048 nSM=-nC; // Can be compensated by Sigma- |
1049 nL+=nC; // Reduce the residual strangeness |
1050 }
1051 else // All Charge is compensated by Sigma- |
1052 {
1053 nSM=nL; // The maximum number of Sigma- |
1054 nL=0; // Kill the residual strangeness |
1055 }
1056 }
1057 else if(nC>nB-nL) // Extra positive hypernucleus |
1058 {
1059 if(nC<=nB) // Partial compensation by Sigma+ |
1060 {
1061 G4int dH=nB-nC; // Isotopic shift |
1062 nSP=nL-dH; // Can be compensated by Sigma+ |
1063 nL=dH; // Reduce the residual strangeness |
1064 }
1065 else // All Charge is compensated by Sigma+ |
1066 {
1067 nSP=nL; // The maximum number of Sigma+ |
1068 nL=0; // Kill the residual strangeness |
1069 }
1070 }
1071 r4M=loh->Get4Momentum(); // Real 4-momentum of the hypernucleus !
1072 G4double reM=r4M.m(); // Real mass of the hypernucleus |
1073#ifdef fdebug
1074 G4cout<<"G4QDiffRatio::PrFrag:oPDG=="<<oPDG<<",hPDG="<<hPDG<<",M="<<reM<<G4endl;//|
1075#endif
1076 G4int rlPDG=hPDG-nL*1000000-nSP*1000999-nSM*999001;// Subtract Lamb/Sig from Nucl.|
1077 G4int sPDG=3122; // Prototype for the Hyperon PDG (Lambda)|
1078 G4double MLa=mLamb; // Prototype for one Hyperon decay |
1079#ifdef fdebug
1080 G4cout<<"G4QDiffRatio::PrFrag:*G4*nS+="<<nSP<<",nS-="<<nSM<<",nL="<<nL<<G4endl;// |
1081#endif
1082 if(nSP||nSM) // Sigma+/- improvement |
1083 {
1084 if(nL) // By mistake Lambda improvement is found |
1085 {
1086 G4cout<<"***G4QDR::PFr:HypN="<<hPDG<<": bothSigm&Lamb -> ImproveIt"<<G4endl;//|
1087 //throw G4QException("*G4QDiffractionRatio::Fragment:BothLambda&SigmaInHN");//|
1088 // @@ Correction, which does not conserv the charge !! (-> add decay in 3) |
1089 if(nSP) nL+=nSP; // Convert Sigma+ to Lambda |
1090 else nL+=nSM; // Convert Sigma- to Lambda |
1091 }
1092 if(nSP) // Sibma+ should be decayed |
1093 {
1094 nL=nSP; // #of decaying hyperons |
1095 sPDG=3222; // PDG code of decaying hyperons |
1096 MLa=mSigP; // Mass of decaying hyperons |
1097 }
1098 else // Sibma+ should be decayed |
1099 {
1100 nL=nSM; // #of decaying hyperons |
1101 sPDG=3112; // PDG code of decaying hyperons |
1102 MLa=mSigM; // Mass of decaying hyperons |
1103 }
1104 }
1105#ifdef fdebug
1106 G4cout<<"G4QDiffRat::ProjFrag:*G4*mS="<<MLa<<",sPDG="<<sPDG<<",nL="<<nL<<G4endl;//|
1107#endif
1108 if(nL>1) MLa*=nL; // Total mass of the decaying hyperons |
1109 G4double rlM=G4QNucleus(rlPDG).GetMZNS();// Mass of the NonstrangeNucleus |
1110 if(!nSP&&!nSM&&nL==1&&reM>rlM+mSigZ&&G4UniformRand()>.5) // Conv Lambda->Sigma0 |
1111 {
1112 sPDG=3212; // PDG code of a decaying hyperon |
1113 MLa=mSigZ; // Mass of the decaying hyperon |
1114 }
1115 G4int rnPDG = hPDG-nL*999999; // Convert Lambdas to neutrons (for convInN) |
1116 G4QNucleus rnN(rnPDG); // New nonstrange nucleus |
1117 G4double rnM=rnN.GetMZNS(); // Mass of the new nonstrange nucleus |
1118 // @@ In future take into account Iso-Hypernucleus (Add PI+,R & Pi-,R decays) |
1119 if(rlPDG==90000000) // Multy Hyperon (HyperNuc of only hyperons) |
1120 {
1121 if(nL>1) r4M=r4M/nL; // split the 4-mom for the MultyLambda |
1122 for(G4int il=0; il<nL; il++) // loop over Lambdas |
1123 {
1124 if(anti) sPDG=-sPDG; // For anti-nucleus case |
1125 G4QHadron* theLam = new G4QHadron(sPDG,r4M); // Make NewHadr for the Hyperon |
1126 ResHV->push_back(theLam); // Fill in the Lambda |
1127#ifdef fdebug
1128 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1129 G4cout<<"G4QDR::ProjFrag: *additional Lambda*="<<r4M<<sPDG<<G4endl; // |
1130#endif
1131 }
1132 }
1133 else if(reM>rlM+MLa-eps) // Lambda (or Sigma) can be split |
1134 {
1135 G4LorentzVector n4M(0.,0.,0.,rlM); // 4-mom of the residual nucleus |
1136 G4LorentzVector h4M(0.,0.,0.,MLa); // 4-mom of the Hyperon |
1137 G4double sum=rlM+MLa; // Safety sum |
1138 if(std::fabs(reM-sum)<eps) // At rest in CMS |
1139 {
1140 n4M=r4M*(rlM/sum); // Split tot 4-mom for resNuc |
1141 h4M=r4M*(MLa/sum); // Split tot 4-mom for Hyperon |
1142 }
1143 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) // Error in decay |
1144 {
1145 G4cerr<<"***G4QDF::PF:HypN,M="<<reM<<"<A+n*L="<<sum<<",d="<<sum-reM<<G4endl;//|
1146 // throw G4QException("***G4QDiffractionRatio::ProjFragment:HypernuclusDecay");//|
1147 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0100",
1148 FatalException, "Error in hypernuclus decay");
1149 }
1150#ifdef fdebug
1151 G4cout<<"*G4QDR::PF:HypN="<<r4M<<"->A="<<rlPDG<<n4M<<",n*L="<<nL<<h4M<<G4endl;//|
1152#endif
1153 loh->Set4Momentum(n4M); // ! Update the Hadron ! |
1154 if(anti && rlPDG==90000001) rlPDG=-2112; // Convert to anti-neutron |
1155 if(anti && rlPDG==90001000) rlPDG=-2212; // Convert to anti-proton |
1156 loh->SetQPDG(G4QPDGCode(rlPDG)); // ConvertedHypernucleus to nonstrange(@anti)|
1157 if(rlPDG==90000002) // Additional action with loH changed to 2n |
1158 {
1159 G4LorentzVector newLV=n4M/2.; // Split 4-momentum |
1160 loh->Set4Momentum(newLV); // Reupdate the hadron |
1161 if(anti) loh->SetQPDG(G4QPDGCode(-2112)); // Make anti-neutron PDG |
1162 else loh->SetQPDG(G4QPDGCode(2112)); // Make neutron PDG |
1163 G4QHadron* secHadr = new G4QHadron(loh); // Duplicate the neutron |
1164 ResHV->push_back(secHadr); // Fill in the additional neutron |
1165#ifdef fdebug
1166 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1167 G4cout<<"G4QDR::ProgFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; // |
1168#endif
1169 }
1170 else if(rlPDG==90002000) // Additional action with loH change to 2p |
1171 {
1172 G4LorentzVector newLV=n4M/2.; // Split 4-momentum |
1173 loh->Set4Momentum(newLV); // Reupdate the hadron |
1174 if(anti) loh->SetQPDG(G4QPDGCode(-2212)); // Make anti-neutron PDG |
1175 else loh->SetQPDG(G4QPDGCode(2112)); // Make neutron PDG |
1176 G4QHadron* secHadr = new G4QHadron(loh); // Duplicate the proton |
1177 ResHV->push_back(secHadr); // Fill in the additional neutron |
1178#ifdef fdebug
1179 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1180 G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; // |
1181#endif
1182 }
1183 // @@(?) Add multybaryon decays if necessary (Now it anyhow is made later) |
1184#ifdef fdebug
1185 G4cout<<"*G4QDiffractionRatio::PrFrag:resNucPDG="<<loh->GetPDGCode()<<G4endl;// |
1186#endif
1187 if(nL>1) h4M=h4M/nL; // split the lambda's 4-mom if necessary |
1188 for(G4int il=0; il<nL; il++) // A loop over excessive hyperons |
1189 {
1190 if(anti) sPDG=-sPDG; // For anti-nucleus case |
1191 G4QHadron* theLamb = new G4QHadron(sPDG,h4M); // Make NewHadr for the Hyperon |
1192 ResHV->push_back(theLamb); // Fill in the additional neutron |
1193#ifdef fdebug
1194 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1195 G4cout<<"G4QDR::ProjFrag: *additional Hyperon*="<<r4M<<sPDG<<G4endl; // |
1196#endif
1197 }
1198 }
1199 else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)// Lambda->N only if Sigmas are absent |
1200 {
1201 G4int nPi=static_cast<G4int>((reM-rnM)/mPi0); // Calc. pion multiplicity |
1202 if (nPi>nL) nPi=nL; // Cut the pion multiplicity |
1203 G4double npiM=nPi*mPi0; // Total pion mass |
1204 G4LorentzVector n4M(0.,0.,0.,rnM); // Residual nucleus 4-momentum |
1205 G4LorentzVector h4M(0.,0.,0.,npiM);// 4-momentum of pions |
1206 G4double sum=rnM+npiM; // Safety sum |
1207 if(std::fabs(reM-sum)<eps) // At rest |
1208 {
1209 n4M=r4M*(rnM/sum); // The residual nucleus part |
1210 h4M=r4M*(npiM/sum); // The pion part |
1211 }
1212 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) // Error in decay |
1213 {
1214 G4cerr<<"*G4QDR::PF:HypN,M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl;//|
1215 // throw G4QException("***G4QDiffractionRatio::ProjFragment:HypernuclDecay"); // |
1216 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0101",
1217 FatalException, "Error in HypernuclDecay");
1218 }
1219 loh->Set4Momentum(n4M); // ! Update the Hadron ! |
1220 if(anti && rnPDG==90000001) rnPDG=-2112; // Convert to anti-neutron |
1221 if(anti && rnPDG==90001000) rnPDG=-2212; // Convert to anti-proton |
1222 loh->SetQPDG(G4QPDGCode(rnPDG)); // convert hyperNuc to nonstrangeNuc(@@anti) |
1223#ifdef fdebug
1224 G4cout<<"*G4QDR::PF:R="<<r4M<<"->A="<<rnPDG<<n4M<<",n*Pi0="<<nPi<<h4M<<G4endl;//|
1225#endif
1226 if(nPi>1) h4M=h4M/nPi; // Split the 4-mom if necessary |
1227 for(G4int ihn=0; ihn<nPi; ihn++) // A loop over additional pions |
1228 {
1229 G4QHadron* thePion = new G4QHadron(111,h4M); // Make a New Hadr for the pi0 |
1230 ResHV->push_back(thePion); // Fill in the Pion |
1231#ifdef fdebug
1232 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1233 G4cout<<"G4QDR::ProjFrag: *additional Pion*="<<r4M<<sPDG<<G4endl; // |
1234#endif
1235 }
1236 if(rnPDG==90000002) // Additional action with loH change to 2n |
1237 {
1238 G4LorentzVector newLV=n4M/2.; // Split 4-momentum |
1239 loh->Set4Momentum(newLV); // Reupdate the hadron |
1240 if(anti) loh->SetQPDG(G4QPDGCode(-2112)); // Make anti-neutron PDG |
1241 else loh->SetQPDG(G4QPDGCode(2112)); // Make neutron PDG |
1242 G4QHadron* secHadr = new G4QHadron(loh); // Duplicate the neutron |
1243 ResHV->push_back(secHadr); // Fill in the additional neutron |
1244#ifdef fdebug
1245 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1246 G4cout<<"G4QDR::ProjFrag: *additional Neutron*="<<r4M<<sPDG<<G4endl; // |
1247#endif
1248 }
1249 else if(rnPDG==90002000) // Additional action with loH change to 2p |
1250 {
1251 G4LorentzVector newLV=n4M/2.; // Split 4-momentum |
1252 loh->Set4Momentum(newLV); // Reupdate the hadron |
1253 if(anti) loh->SetQPDG(G4QPDGCode(-2212)); // Make anti-neutron PDG |
1254 else loh->SetQPDG(G4QPDGCode(2112)); // Make neutron PDG |
1255 G4QHadron* secHadr = new G4QHadron(loh); // Duplicate the proton |
1256 ResHV->push_back(secHadr); // Fill in the additional neutron |
1257#ifdef fdebug
1258 sum4M+=r4M; // Sum 4-momenta for the EnMom check |
1259 G4cout<<"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<G4endl; // |
1260#endif
1261 }
1262 // @@ Add multybaryon decays if necessary |
1263 }
1264 else // If this Excepton shows up (lowProbable appearance) => include gamma decay |
1265 {
1266 G4double d=rlM+MLa-reM; // Hyperon Excessive energy |
1267 G4cerr<<"G4QDR::PF:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl;
1268 d=rnM+mPi0-reM; // Pion Excessive energy |
1269 G4cerr<<"G4QDR::PF:"<<oPDG<<","<<hPDG<<",M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl;
1270 // throw G4QException("G4QDiffractionRatio::ProjFragment: Hypernuclear conver");// |
1271 G4Exception("G4QDiffractionRatio::ProjFragment()", "HAD_CHPS_0102",
1272 FatalException, "Excessive hypernuclear energy");
1273 }
1274 } // => End of G4 Hypernuclear decay |
1275 ResHV->push_back(loh); // Fill in the result |
1276#ifdef debug
1277 sum4M+=loh->Get4Momentum(); // Sum 4-momenta for the EnMom check |
1278 G4cout<<"G4QDR::PrFra:#"<<iq<<","<<loh->Get4Momentum()<<loh->GetPDGCode()<<G4endl;//|
1279#endif
1280 } // |
1281 leadhs->clear();// |
1282 delete leadhs; // <----<----<----<----<----<----<----<----<----<----<----<----<----<--*
1283#ifdef debug
1284 G4cout<<"G4QDiffractionRatio::ProjFragment: *End* Sum="<<sum4M<<" =?= d4M="<<d4M<<G4endl;
1285#endif
1286 return ResHV; // Result
1287} // End of ProjFragment
1288
1289// Calculates Single Diffraction Taarget Excitation Cross-Section (independent Units)
1291{
1292 G4double mom=pIU/gigaelectronvolt; // Projectile momentum in GeV
1293 if ( mom < 1. || (pPDG != 2212 && pPDG != 2112) )
1294 G4cerr<<"G4QDiffractionRatio::GetTargSingDiffXS isn't applicable p="<<mom<<" GeV, PDG="
1295 <<pPDG<<G4endl;
1296 G4double A=Z+N; // A of the target
1297 //return 4.5*std::pow(A,.364)*millibarn; // Result
1298 return 3.7*std::pow(A,.364)*millibarn; // Result after mpi0 correction
1299
1300} // End of ProjFragment
@ FatalException
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
G4ThreeVector G4RandomDirection()
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
G4QHadronVector * ProjFragment(G4int pPDG, G4LorentzVector p4M, G4int tgZ, G4int tgN)
static G4QDiffractionRatio * GetPointer()
G4QHadronVector * TargFragment(G4int pPDG, G4LorentzVector p4M, G4int tgZ, G4int tgN)
G4double GetTargSingDiffXS(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
G4double GetRatio(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
void AddQuasmon(G4Quasmon *Q)
G4QHadronVector * Fragment()
G4LorentzVector Get4Momentum() const
Definition: G4QHadron.hh:79
G4int GetBaryonNumber() const
Definition: G4QHadron.hh:181
G4int GetCharge() const
Definition: G4QHadron.hh:179
G4int GetPDGCode() const
Definition: G4QHadron.hh:170
G4bool DecayIn2(G4LorentzVector &f4Mom, G4LorentzVector &s4Mom)
Definition: G4QHadron.cc:544
void SetQPDG(const G4QPDGCode &QPDG)
Definition: G4QHadron.cc:275
void Set4Momentum(const G4LorentzVector &aMom)
Definition: G4QHadron.hh:187
G4int GetStrangeness() const
Definition: G4QHadron.hh:180
G4double GetMZNS() const
Definition: G4QNucleus.hh:80
G4QContent GetQuarkContent() const
Definition: G4QPDGCode.cc:2057
G4double GetMass()
Definition: G4QPDGCode.cc:693
G4QHadronVector * Fragment(G4QNucleus &nucEnviron, G4int nQ=1)
Definition: G4Quasmon.cc:6178
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76