00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #include <algorithm>
00047 #include <cmath>
00048 #include <vector>
00049
00050 #include "G4QNucleus.hh"
00051 #include "Randomize.hh"
00052 #include "G4PhysicalConstants.hh"
00053 #include "G4SystemOfUnits.hh"
00054
00055 using namespace std;
00056
00057
00058 G4double G4QNucleus::freeNuc=0.1;
00059 G4double G4QNucleus::freeDib=.05;
00060 G4double G4QNucleus::clustProb=4.;
00061 G4double G4QNucleus::mediRatio=1.;
00062 G4double G4QNucleus::nucleonDistance=.8*fermi;
00063 G4double G4QNucleus::WoodSaxonSurf=.545*fermi;
00064
00065 G4QNucleus::G4QNucleus(): G4QHadron(), Z(0), N(0), S(0), dZ(0), dN(0), dS(0), maxClust(0),
00066 theNucleons(),currentNucleon(-1),
00067 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false)
00068 {
00069 probVect[0]=mediRatio;
00070 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00071 #ifdef pardeb
00072 G4cout<<"G4QNucleus::Constructor:(1) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00073 <<", R="<<mediRatio<<G4endl;
00074 #endif
00075 }
00076
00077 G4QNucleus::G4QNucleus(G4int z, G4int n, G4int s_value) :
00078 G4QHadron(90000000+s_value*1000000+z*1000+n), Z(z),N(n),S(s_value), dZ(0),dN(0),dS(0), maxClust(0),
00079 theNucleons(), currentNucleon(-1), rho0(1.), radius(1.),
00080 Tb(), TbActive(false), RhoActive(false)
00081 {
00082 probVect[0]=mediRatio;
00083 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00084 #ifdef debug
00085 G4cout<<"G4QNucleus::Construction By Z="<<z<<",N="<<n<<",S="<<s_value<<G4endl;
00086 #endif
00087 SetZNSQC(z,n,s_value);
00088 G4QPDGCode nQPDG(90000000+S*1000000+Z*1000+N);
00089 #ifdef debug
00090 G4cout<<"G4QNucleus::ConstructionByZNS: nQPDG="<<nQPDG<<G4endl;
00091 #endif
00092 G4double mass=nQPDG.GetNuclMass(Z,N,S);
00093 #ifdef debug
00094 G4cout<<"G4QNucleus::ConstructionByZNS: mass="<<mass<<G4endl;
00095 #endif
00096 SetQPDG(nQPDG);
00097 #ifdef debug
00098 G4cout<<"G4QNucleus::ConstructionByZNS: nQPDG set"<<G4endl;
00099 #endif
00100 G4LorentzVector p(0.,0.,0.,mass);
00101 Set4Momentum(p);
00102 SetNFragments(0);
00103 #ifdef debug
00104 G4cout<<"G4QNucleus::Constructor:(2) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00105 <<", R="<<mediRatio<<G4endl;
00106 #endif
00107 }
00108
00109 G4QNucleus::G4QNucleus(G4int nucPDG):
00110 G4QHadron(nucPDG), maxClust(0), theNucleons(),
00111 currentNucleon(-1), rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false)
00112 {
00113 if(nucPDG==22) nucPDG=90000000;
00114 InitByPDG(nucPDG);
00115 G4LorentzVector p(0.,0.,0.,GetGSMass());
00116 Set4Momentum(p);
00117 #ifdef pardeb
00118 G4cout<<"G4QNucleus::Constructor:(3) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00119 <<", R="<<mediRatio<<", 4M="<<p<<G4endl;
00120 #endif
00121 }
00122
00123 G4QNucleus::G4QNucleus(G4LorentzVector p, G4int nucPDG):
00124 G4QHadron(nucPDG, p), maxClust(0), theNucleons(),
00125 currentNucleon(-1), rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false)
00126 {
00127 InitByPDG(nucPDG);
00128 Set4Momentum(p);
00129 #ifdef pardeb
00130 G4cout<<"G4QNucleus::Constructor:(4) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00131 <<", R="<<mediRatio<<", 4M="<<p<<G4endl;
00132 #endif
00133 }
00134
00135 G4QNucleus::G4QNucleus(G4int z, G4int n, G4int s_value, G4LorentzVector p) :
00136 G4QHadron(90000000+s_value*1000000+z*1000+n,p), Z(z),N(n),S(s_value), dZ(0),dN(0),dS(0), maxClust(0),
00137 theNucleons(), currentNucleon(-1), rho0(1.),radius(1.),
00138 Tb(), TbActive(false), RhoActive(false)
00139 {
00140 probVect[0]=mediRatio;
00141 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00142 Set4Momentum(p);
00143 SetNFragments(0);
00144 G4int ZNS=Z+N+S;
00145 G4QPDGCode nPDG(90000000+S*1000000+Z*1000+N);
00146 SetQPDG(nPDG);
00147 G4QContent nQC(N+ZNS,Z+ZNS,S,0,0,0);
00148 SetZNSQC(z,n,s_value);
00149 #ifdef pardeb
00150 G4cout<<"G4QNucleus::Constructor:(5) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00151 <<", R="<<mediRatio<<G4endl;
00152 #endif
00153 }
00154
00155 G4QNucleus::G4QNucleus(G4QContent nucQC):
00156 G4QHadron(nucQC), dZ(0), dN(0), dS(0), maxClust(0), theNucleons(), currentNucleon(-1),
00157 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false)
00158 {
00159 static const G4double mPi0 = G4QPDGCode(111).GetMass();
00160 #ifdef debug
00161 G4cout<<"G4QNucleus::Construction By QC="<<nucQC<<G4endl;
00162 #endif
00163 probVect[0]=mediRatio;
00164 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00165 G4int u=nucQC.GetU()-nucQC.GetAU();
00166 G4int d=nucQC.GetD()-nucQC.GetAD();
00167 S = nucQC.GetS()-nucQC.GetAS();
00168 G4int du= d-u;
00169 G4int b =(d+u+S)/3;
00170 Z = (b-S-du)/2;
00171 N = Z+du;
00172 SetQC(nucQC);
00173 #ifdef debug
00174 G4cout<<"G4QNucleus::ConstructionByQC: N="<<N<<",Z="<<Z<<",S="<<S<<G4endl;
00175 #endif
00176 G4int nucPDG=90000000+S*1000000+Z*1000+N;
00177 G4QPDGCode nQPDG(nucPDG);
00178 #ifdef debug
00179 G4cout<<"G4QNucleus::ConstructionByQC: nQPDG="<<nQPDG<<G4endl;
00180 #endif
00181 G4double mass=nQPDG.GetNuclMass(Z,N,S);
00182 if(nucPDG==90000000)
00183 {
00184 if(nucQC.GetTot()) mass=mPi0;
00185 else mass=0.;
00186 }
00187 #ifdef debug
00188 G4cout<<"G4QNucleus::ConstructionByQC: mass="<<mass<<G4endl;
00189 #endif
00190 SetQPDG(nQPDG);
00191 #ifdef debug
00192 G4cout<<"G4QNucleus::ConstructionByQC: nQPDG set"<<G4endl;
00193 #endif
00194 G4LorentzVector p(0.,0.,0.,mass);
00195 Set4Momentum(p);
00196 SetNFragments(0);
00197 #ifdef pardeb
00198 G4cout<<"G4QNucleus::Constructor:(6) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00199 <<", R="<<mediRatio<<G4endl;
00200 #endif
00201 }
00202
00203 G4QNucleus::G4QNucleus(G4QContent nucQC, G4LorentzVector p):
00204 G4QHadron(nucQC,p), dZ(0), dN(0), dS(0), maxClust(0), theNucleons(), currentNucleon(-1),
00205 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false)
00206 {
00207 #ifdef debug
00208 G4cout<<"G4QNucleus::(LV)Construction By QC="<<nucQC<<G4endl;
00209 #endif
00210 probVect[0]=mediRatio;
00211 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00212 Set4Momentum(p);
00213 G4int u=nucQC.GetU()-nucQC.GetAU();
00214 G4int d=nucQC.GetD()-nucQC.GetAD();
00215 S = nucQC.GetS()-nucQC.GetAS();
00216 G4int du= d-u;
00217 G4int b =(d+u+S)/3;
00218 Z = (b-S-du)/2;
00219 N = Z+du;
00220 SetQC(nucQC);
00221 #ifdef debug
00222 G4cout<<"G4QNucleus::(LV)ConstructionByQC: N="<<N<<",Z="<<Z<<",S="<<S<<G4endl;
00223 #endif
00224 G4QPDGCode nPDG(90000000+S*1000000+Z*1000+N);
00225 SetQPDG(nPDG);
00226 SetNFragments(0);
00227 #ifdef pardeb
00228 G4cout<<"G4QNucleus::Constructor:(7) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00229 <<", R="<<mediRatio<<G4endl;
00230 #endif
00231 }
00232
00233 G4QNucleus::G4QNucleus(G4QNucleus* right, G4bool cop3D) : currentNucleon(-1)
00234 {
00235 Z = right->Z;
00236 N = right->N;
00237 S = right->S;
00238 dZ = right->dZ;
00239 dN = right->dN;
00240 dS = right->dS;
00241 maxClust = right->maxClust;
00242 for(G4int i=0; i<=maxClust; i++) probVect[i] = right->probVect[i];
00243 probVect[254] = right->probVect[254];
00244 probVect[255] = right->probVect[255];
00245 Tb = right->Tb;
00246 TbActive = right->TbActive;
00247 RhoActive = right->RhoActive;
00248 Set4Momentum (right->Get4Momentum());
00249 SetQPDG (right->GetQPDG());
00250 SetQC (right->GetQC());
00251 SetNFragments (right->GetNFragments());
00252 rho0 = right->rho0;
00253 radius = right->radius;
00254 if(cop3D)
00255 {
00256 G4int nn=right->theNucleons.size();
00257 for(G4int i=0; i<nn; ++i)
00258 {
00259 G4QHadron* nucleon = new G4QHadron(right->theNucleons[i]);
00260 theNucleons.push_back(nucleon);
00261 }
00262 }
00263 #ifdef pardeb
00264 G4cout<<"G4QNucleus::Constructor:(8) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00265 <<", R="<<mediRatio<<G4endl;
00266 #endif
00267 }
00268
00269 G4QNucleus::G4QNucleus(const G4QNucleus &right, G4bool cop3D):
00270 G4QHadron(), currentNucleon(-1)
00271 {
00272 Z = right.Z;
00273 N = right.N;
00274 S = right.S;
00275 dZ = right.dZ;
00276 dN = right.dN;
00277 dS = right.dS;
00278 maxClust = right.maxClust;
00279 for(G4int i=0; i<=maxClust; i++) probVect[i] = right.probVect[i];
00280 probVect[254] = right.probVect[254];
00281 probVect[255] = right.probVect[255];
00282 Tb = right.Tb;
00283 TbActive = right.TbActive;
00284 RhoActive = right.RhoActive;
00285 Set4Momentum (right.Get4Momentum());
00286 SetQPDG (right.GetQPDG());
00287 SetQC (right.GetQC());
00288 SetNFragments (right.GetNFragments());
00289 rho0 = right.rho0;
00290 radius = right.radius;
00291 if(cop3D)
00292 {
00293 G4int nn=right.theNucleons.size();
00294 for(G4int i=0; i<nn; ++i)
00295 {
00296 G4QHadron* nucleon = new G4QHadron(right.theNucleons[i]);
00297 theNucleons.push_back(nucleon);
00298 }
00299 }
00300 #ifdef pardeb
00301 G4cout<<"G4QNucleus::Constructor:(9) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb
00302 <<", R="<<mediRatio<<G4endl;
00303 #endif
00304 }
00305
00306
00307 const G4QNucleus& G4QNucleus::operator=(const G4QNucleus& right)
00308 {
00309 if(this != &right)
00310 {
00311 currentNucleon= -1;
00312 TbActive = right.TbActive;
00313 Tb = right.Tb;
00314 RhoActive = right.RhoActive;
00315 rho0 = right.rho0;
00316 radius = right.radius;
00317 G4int nn = right.theNucleons.size();
00318 for(G4int i=0; i < nn; ++i)
00319 {
00320 G4QHadron* nucleon = new G4QHadron(right.theNucleons[i]);
00321 theNucleons.push_back(nucleon);
00322 }
00323 Set4Momentum (right.Get4Momentum());
00324 SetQPDG (right.GetQPDG());
00325 SetQC (right.GetQC());
00326 SetNFragments (right.GetNFragments());
00327 Z = right.Z;
00328 N = right.N;
00329 S = right.S;
00330 dZ = right.dZ;
00331 dN = right.dN;
00332 dS = right.dS;
00333 maxClust = right.maxClust;
00334 for(G4int i=0; i<=maxClust; i++) probVect[i] = right.probVect[i];
00335 probVect[254] = right.probVect[254];
00336 probVect[255] = right.probVect[255];
00337 }
00338 return *this;
00339 }
00340
00341 G4QNucleus::~G4QNucleus()
00342 {
00343 for_each(theNucleons.begin(),theNucleons.end(),DeleteQHadron());
00344 }
00345
00346
00347 void G4QNucleus::SetParameters(G4double a,G4double b, G4double c, G4double d, G4double e)
00348 {
00349 freeNuc=a;
00350 freeDib=b;
00351 clustProb=c;
00352 mediRatio=d;
00353 nucleonDistance=e;
00354 }
00355
00356
00357 ostream& operator<<(ostream& lhs, G4QNucleus& rhs)
00358 {
00359 lhs<<"{Z="<<rhs.GetZ()<<",N="<<rhs.GetN()<<",S="<<rhs.GetS()<<",M="<<rhs.GetGSMass()<<"}";
00360 return lhs;
00361 }
00362
00363
00364 ostream& operator<<(ostream& lhs, const G4QNucleus& rhs)
00365 {
00366 lhs<<"{Z="<<rhs.GetZ()<<",N="<<rhs.GetN()<<",S="<<rhs.GetS()<< "}";
00367 return lhs;
00368 }
00369
00370
00371 void G4QNucleus::InitByPDG(G4int nucPDG)
00372 {
00373 static const G4int NUCPDG = 90000000;
00374 #ifdef debug
00375 G4cout<<"G4QNucleus::InitByPDG: >Called< PDG="<<nucPDG<<G4endl;
00376 #endif
00377 dZ=0;
00378 dN=0;
00379 dS=0;
00380 probVect[0]=mediRatio;
00381 for(G4int i=1; i<256; i++) {probVect[i] = 0.;}
00382
00383 if(nucPDG<80000000) nucPDG=HadrToNucPDG(nucPDG);
00384 G4int s_value=0;
00385 G4int z=0;
00386 G4int n=0;
00387 if(nucPDG>80000000 && nucPDG<100000000)
00388 {
00389 G4QPDGCode(22).ConvertPDGToZNS(nucPDG, z, n, s_value);
00390 Z =z;
00391 N =n;
00392 S =s_value;
00393 #ifdef debug
00394 G4cout<<"G4QNucleus::InitByPDG:Z="<<Z<<",N="<<N<<",S="<<S<<G4endl;
00395 #endif
00396 SetZNSQC(Z,N,S);
00397 G4QPDGCode nPDG(nucPDG);
00398 G4double PDGMass=0.;
00399 if(nucPDG!=NUCPDG) PDGMass=nPDG.GetMass();
00400 SetQPDG(nPDG);
00401 G4LorentzVector p(0.,0.,0.,PDGMass);
00402 Set4Momentum(p);
00403 SetNFragments(0);
00404 #ifdef debug
00405 G4cout<<"G4QNucleus::InitByPDG:->QPDG="<<nPDG<<": 4M="<<p<<G4endl;
00406 #endif
00407 }
00408 else
00409 {
00410 G4cerr<<"***G4QNucleus::InitByPDG:Initialized by not nuclear PDGCode="<<nucPDG<<G4endl;
00411
00412 }
00413 }
00414
00415
00416
00417 G4int G4QNucleus::UpdateClusters(G4bool din)
00418 {
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428 probVect[0]=mediRatio;
00429 for (G4int in=1; in<256; in++) probVect[in]=0.;
00430
00431 dZ=0;
00432 dN=0;
00433 dS=0;
00434 G4int a = Z + N + S;
00435 #ifdef debug
00436 G4cout<<"G4QN::UpdateCl:A="<<a<<"(Z="<<Z<<",N="<<N<<",S="<<S<<"),mR="<<mediRatio<<G4endl;
00437 #endif
00438 G4double A=a;
00439 if(A<=0.)
00440 {
00441 #ifdef debug
00442 G4cout<<"***G4QNucleus::UpdateClusters:No clusters can be calculated as A="<<A<<G4endl;
00443 #endif
00444 return 0;
00445 }
00446 G4double surf=freeNuc+freeDib;
00447 G4double surA=A*surf;
00448 G4int sA=static_cast<G4int>(surA);
00449 if(surf>0.||surf<1.)sA=RandomizeBinom(surf,a);
00450 #ifdef debug
00451 G4cout<<"G4QN::UpdateCl:surf="<<surf<<"= N="<<freeNuc<<"+D="<<freeDib<<",A="<<sA<<G4endl;
00452 #endif
00453 G4int dA=a-sA;
00454 if (din && dA<2 && a>2)
00455 {
00456 dA=2;
00457 sA=a-2;
00458 }
00459 #ifdef debug
00460 G4cout<<"G4QN::UpdtC:dA="<<dA<<",A="<<A<<",s="<<surf<<",S="<<sA<<",C="<<maxClust<<G4endl;
00461 #endif
00462 G4int maxi=1;
00463 G4double pA=0.;
00464 G4double uA=0.;
00465 if(surf>0.)
00466 {
00467 pA=0.5*freeDib*sA/surf;
00468 uA=sA-pA-pA;
00469 }
00470 uA=uA/A;
00471 pA=pA/A;
00472 G4double sum =0.;
00473 if(dA<2)
00474 {
00475
00476
00477 probVect[1]= uA+dA/A;
00478 sum = probVect[1];
00479
00480 maxi=2;
00481 probVect[254]= 0;
00482 if(A>1 && pA>0.)
00483 {
00484
00485 probVect[2]= pA;
00486
00487 sum+= probVect[2]+probVect[2];
00488
00489 maxi=3;
00490 probVect[255]= 0;
00491 }
00492 #ifdef debug
00493 G4cout<<"G4QNucleus::UpdateClust:Only quasi-free nucleons pV[1]="<<probVect[1]<<G4endl;
00494 #endif
00495 }
00496 else
00497 {
00498 G4double wrd=clustProb/dA;
00499 G4double sud=pow(1.+wrd,dA-1);
00500
00501
00502 G4double rd= dA/sud/A;
00503
00504
00505 G4double prb=rd+uA;
00506 sum =prb;
00507 #ifdef debug
00508 G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[1]=s="<<sum<<",dA="<<dA<<",uA="<<uA<<G4endl;
00509 #endif
00510
00511
00512 probVect[1]= prb;
00513 probVect[254]= rd;
00514
00515
00516 rd*=wrd*(dA-1.)/2;
00517
00518
00519 prb=rd+pA;
00520 sum+=prb+prb;
00521 #ifdef debug
00522 G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[2]="<<prb<<",s="<<sum<<",pA="<<pA<<G4endl;
00523 #endif
00524
00525
00526 probVect[2]= prb;
00527 probVect[255]= rd;
00528
00529
00530 maxi=3;
00531 #ifdef debug
00532 G4cout<<"G4QNucleus::UpdateClusters:p1="<<probVect[1]<<", p2="<<probVect[2]<<",sA="<<sA
00533 <<",uA="<<uA<<",pA="<<pA<<",wrd="<<wrd<<",sud="<<sud<<G4endl;
00534 #endif
00535 if(dA>2)
00536 {
00538 G4double idA=dA+1.;
00539 G4int dLim=dA;
00540 if(maxClust<dA) dLim=maxClust;
00541 for (int i=3; i<=dLim; i++)
00542 {
00543 rd*=wrd*(idA-i)/i;
00544 sum+=rd*i;
00545 #ifdef debug
00546 G4cout<<"G4QNucleus::UpdateCl:sud="<<sud<<", v["<<i<<"]="<<rd<<", s="<<sum<<G4endl;
00547 #endif
00548
00549
00550 probVect[i]=rd;
00551
00552 maxi=i+1;
00553 #ifdef debug
00554 G4cout<<"G4QNucleus::UpdateCl:Cluster of "<<i<<" baryons,pV="<<probVect[i]<<G4endl;
00555 #endif
00556 }
00557 }
00558 dS = S;
00559 dZ = static_cast<int>(static_cast<double>((dA-dS)*Z)/(Z+N) + 0.5);
00560 dN = dA - dZ;
00561 }
00562 #ifdef debug
00563 G4cout<<"G4QNucleus::UpdateClusters: Sum of weighted probabilities s="<<sum<<G4endl;
00564 #endif
00565 maxClust=maxi-1;
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 return maxClust;
00608 }
00609
00610
00611
00612 void G4QNucleus::SubtractNucleon(G4QHadron* uNuc)
00613 {
00614 G4int NotFound=true;
00615 G4QHadronVector::iterator u;
00616 for(u=theNucleons.begin(); u!=theNucleons.end(); u++)
00617 {
00618 #ifdef debug
00619 G4cout<<"G4QNucleus::SubtractNucleon: LOOP 4M="<<(*u)->Get4Momentum()<<G4endl;
00620 #endif
00621 if (uNuc==*u)
00622 {
00623 NotFound=false;
00624 break;
00625 }
00626 }
00627
00628 if (NotFound) G4Exception("G4QNucleus::SubtractNucleon()", "HAD_CHPS_0000",
00629 FatalException, "The nucleon isn't found");
00630 else
00631 {
00632 G4int tPDG=GetPDGCode();
00633 G4LorentzVector t4M=Get4Momentum();
00634 #ifdef debug
00635 G4cout<<"G4QNucleus::SubtractNucleon: InitialNucleus 4M="<<t4M<<", PDG="<<tPDG<<", nN="
00636 <<theNucleons.size()<<G4endl;
00637 #endif
00638 G4int uPDG=(*u)->GetPDGCode();
00639 G4LorentzVector u4M=(*u)->Get4Momentum();
00640 #ifdef debug
00641 G4cout<<"G4QNucleus::SubtractNucleon: subtractNucleon 4M="<<u4M<<",PDG="<<uPDG<<G4endl;
00642 #endif
00643 delete *u;
00644 theNucleons.erase(u);
00645 --currentNucleon;
00646 t4M-=u4M;
00647 if (uPDG==2212) tPDG-=1000;
00648 else if(uPDG==2112) tPDG--;
00649 else
00650 {
00651
00652
00653 G4ExceptionDescription ed;
00654 ed << "Impossible nucleon PDG Code: Unexpected Nucleon PDGCode ="
00655 << uPDG << G4endl;
00656 G4Exception("G4QNucleus::SubtractNucleon()", "HAD_CHPS_0001",
00657 FatalException, ed);
00658 }
00659 #ifdef debug
00660 G4cout<<"G4QNucleus::SubtractNucleon: theResidualNucleus PDG="<<tPDG<<", 4M="<<t4M
00661 <<", nN="<<theNucleons.size()<<G4endl;
00662 #endif
00663 InitByPDG(tPDG);
00664 theMomentum=t4M;
00665
00666 G4double mR2=sqr(GetGSMass());
00667 G4double tM2=t4M.m2();
00668 #ifdef debug
00669 G4cout<<"G4QNucleus::SubtractNucleon: rAm2="<<mR2<<" =? 4Mm2="<<tM2<<G4endl;
00670 G4int cnt=0;
00671 #endif
00672 if(std::fabs(mR2-tM2)>.01)G4cout<<"*G4QNucleus::SubNucleon:rM="<<mR2<<"#"<<tM2<<G4endl;
00673
00674 G4double tE=t4M.e();
00675 G4double m2p=sqr(G4QNucleus(tPDG-1000).GetGSMass());
00676 G4double m2n=sqr(G4QNucleus(tPDG-1).GetGSMass());
00677 for(u=theNucleons.begin(); u!=theNucleons.end(); u++)
00678 {
00679 G4LorentzVector n4M=(*u)->Get4Momentum();
00680 G4double srP2=(t4M-n4M).vect().mag2();
00681 G4double m2_value=m2n;
00682 if((*u)->GetPDGCode()==2212) m2_value=m2p;
00683 G4double srE=std::sqrt(srP2+m2_value);
00684 #ifdef debug
00685 G4cout<<"G4QNucleus::SubtractNucleon:#"<<cnt++<<", correctedEnergy="<<tE-srE<<G4endl;
00686 #endif
00687 n4M.setE(tE-srE);
00688 (*u)->Set4Momentum(n4M);
00689 }
00690 }
00691 #ifdef debug
00692 G4cout<<"G4QNucleus::SubtractNucleon:ResNuc4M="<<theMomentum<<",Z="<<Z<<",N="<<N<<G4endl;
00693 #endif
00694 }
00695
00696
00697 void G4QNucleus::DeleteNucleons()
00698 {
00699 G4QHadronVector::iterator u;
00700 for(u=theNucleons.begin(); u!=theNucleons.end(); u++) delete *u;
00701 theMomentum=G4LorentzVector(0.,0.,0.,0.);
00702 }
00703
00704
00705 void G4QNucleus::Reduce(G4int cPDG)
00706 {
00707 static const G4int NUCPDG=90000000;
00708 if(cPDG>80000000&&cPDG!=NUCPDG)
00709 {
00710 G4int curPDG=GetPDG();
00711 G4int newPDG=curPDG-cPDG+NUCPDG;
00712 if(newPDG==NUCPDG) InitByPDG(NUCPDG);
00713 else
00714 {
00715
00716
00717
00718
00719
00720
00721 InitByPDG(newPDG);
00722 }
00723 }
00724 else if(cPDG!=NUCPDG) G4cerr<<"***G4QN::Reduce:Subtract not nuclear PDGC="<<cPDG<<G4endl;
00725
00726 }
00727
00728
00729 void G4QNucleus::Increase(G4int cPDG, G4LorentzVector c4M)
00730 {
00731 static const G4int NUCPDG=90000000;
00732 if(cPDG>80000000&&cPDG!=NUCPDG)
00733 {
00734 G4int newPDG=GetPDG()+cPDG-NUCPDG;
00735 InitByPDG(newPDG);
00736 if (c4M!=G4LorentzVector(0.,0.,0.,0.))
00737 {
00738 G4LorentzVector t4M = Get4Momentum();
00739 t4M +=c4M;
00740 Set4Momentum(t4M);
00741 }
00742 }
00743 else G4cerr<<"***G4QNucleus::Increase: PDGCode="<<cPDG<<",4M="<<c4M<<G4endl;
00744 }
00745
00746
00747 void G4QNucleus::Increase(G4QContent qQC, G4LorentzVector q4M)
00748 {
00749 G4LorentzVector t4M = Get4Momentum();
00750 G4QContent newQC = GetQC()+qQC;
00751 InitByQC(newQC);
00752 t4M +=q4M;
00753 Set4Momentum(t4M);
00754 }
00755
00756
00757 void G4QNucleus::SetZNSQC(G4int z, G4int n, G4int s_value)
00758 {
00759 G4int zns=z+n+s_value;
00760 G4int Dq=n+zns;
00761 G4int Uq=z+zns;
00762 G4int Sq=s_value;
00763 if (Dq<0&&Uq<0&&Sq<0)SetQC(G4QContent( 0, 0, 0,-Dq,-Uq,-Sq));
00764 else if (Uq<0&&Sq<0) SetQC(G4QContent(Dq, 0, 0, 0,-Uq,-Sq));
00765 else if (Dq<0&&Sq<0) SetQC(G4QContent( 0,Uq, 0,-Dq, 0,-Sq));
00766 else if (Dq<0&&Uq<0) SetQC(G4QContent( 0, 0,Sq,-Dq,-Uq, 0));
00767 else if (Uq<0) SetQC(G4QContent(Dq, 0,Sq, 0,-Uq, 0));
00768 else if (Sq<0) SetQC(G4QContent(Dq,Uq, 0, 0, 0,-Sq));
00769 else if (Dq<0) SetQC(G4QContent(0 ,Uq,Sq,-Dq, 0, 0));
00770 else SetQC(G4QContent(Dq,Uq,Sq, 0, 0, 0));
00771 }
00772
00773
00774 G4int G4QNucleus::SplitBaryon()
00775 {
00776 static const G4QContent neutQC(2,1,0,0,0,0);
00777 static const G4QContent protQC(1,2,0,0,0,0);
00778 static const G4QContent lambQC(1,1,1,0,0,0);
00779 static const G4QContent deutQC(3,3,0,0,0,0);
00780 static const G4QContent alphQC(6,6,0,0,0,0);
00781 static const G4double mNeut= G4QPDGCode(2112).GetMass();
00782 static const G4double mProt= G4QPDGCode(2212).GetMass();
00783 static const G4double mLamb= G4QPDGCode(3122).GetMass();
00784 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
00785 static const G4double mAlph= G4QPDGCode(2112).GetNuclMass(2,2,0);
00786 G4int baryn=GetA();
00787 if(baryn<2) return 0;
00788
00789 G4double totM=Get4Momentum().m();
00790 G4QContent valQC=GetQCZNS();
00791 #ifdef debug
00792 G4cout<<"G4QNucleus::SplitBaryon: B="<<baryn<<", M="<<totM<<valQC<<G4endl;
00793 #endif
00794 G4int NQ=valQC.GetN();
00795 if(NQ)
00796 {
00797 G4QContent resQC=valQC-neutQC;
00798 G4int resPDG=resQC.GetSPDGCode();
00799 G4double resMas=G4QPDGCode(resPDG).GetMass();
00800 G4double sM=resMas+mNeut;
00801 #ifdef debug
00802 G4cout<<"G4QNucleus::SplitBaryon: (neutron),sM="<<sM<<",d="<<totM-sM<<G4endl;
00803 #endif
00804 if(sM<totM+.001) return 2112;
00805 }
00806 G4int PQ=valQC.GetP();
00807 if(PQ)
00808 {
00809 G4QContent resQC=valQC-protQC;
00810 G4int resPDG=resQC.GetSPDGCode();
00811 G4double resMas=G4QPDGCode(resPDG).GetMass();
00812 G4double CB=CoulombBarrier(1,1);
00813 G4double sM=resMas+mProt+CB;
00815 #ifdef debug
00816 G4cout<<"G4QNucleus::SplitBaryon: (proton),sM="<<sM<<",d="<<totM-sM<<G4endl;
00817 #endif
00818 if(sM<totM+.001) return 2212;
00819 }
00820 G4int LQ=valQC.GetL();
00821 if(LQ)
00822 {
00823 G4QContent resQC=valQC-lambQC;
00824 G4int resPDG=resQC.GetSPDGCode();
00825 G4double resMas=G4QPDGCode(resPDG).GetMass();
00826 G4double sM=resMas+mLamb;
00827 #ifdef debug
00828 G4cout<<"G4QNucleus::SplitBaryon: (lambda),sM="<<sM<<",d="<<totM-sM<<G4endl;
00829 #endif
00830 if(sM<totM+.001) return 3122;
00831 }
00832 G4int AQ=NQ+PQ+LQ;
00833 if(NQ>0&&PQ>0&&AQ>2)
00834 {
00835 G4QContent resQC=valQC-deutQC;
00836 G4int resPDG=resQC.GetSPDGCode();
00837 G4double resMas=G4QPDGCode(resPDG).GetMass();
00838 G4double CB=CoulombBarrier(1,2);
00839 G4double sM=resMas+mDeut+CB;
00840
00841 #ifdef debug
00842 G4cout<<"G4QNucleus::SplitBaryon: (deuteron),sM="<<sM<<",d="<<totM-sM<<G4endl;
00843 #endif
00844 if(sM<totM+.001) return 90001001;
00845 }
00846 if(NQ>1&&PQ>1&&AQ>4)
00847 {
00848 G4QContent resQC=valQC-alphQC;
00849 G4int resPDG=resQC.GetSPDGCode();
00850 G4double resMas=G4QPDGCode(resPDG).GetMass();
00851 G4double CB=CoulombBarrier(2,4);
00852 G4double sM=resMas+mAlph;
00853 if(NQ!=4||PQ!=4) sM+=CB;
00854 #ifdef debug
00855 G4cout<<"G4QNucleus::SplitBaryon: (alpha),sM="<<sM<<",d="<<totM-sM<<G4endl;
00856 #endif
00857 if(sM<totM+.001) return 90002002;
00858 }
00859 return 0;
00860 }
00861
00862
00863 G4bool G4QNucleus::Split2Baryons()
00864 {
00865 static const G4QContent neutQC(2,1,0,0,0,0);
00866 static const G4QContent protQC(1,2,0,0,0,0);
00867 static const G4QContent lambQC(1,1,1,0,0,0);
00868 static const G4double mNeut= G4QPDGCode(2112).GetMass();
00869 static const G4double mProt= G4QPDGCode(2212).GetMass();
00870 static const G4double mLamb= G4QPDGCode(3122).GetMass();
00871 G4int baryn=GetA();
00872 if(baryn<3) return false;
00873 G4double totM=theMomentum.m();
00874 G4QContent valQC=GetQCZNS();
00875 #ifdef debug
00876 G4cout<<"G4QNucleus::Split2Baryons: B="<<baryn<<", M="<<totM<<valQC<<G4endl;
00877 #endif
00878 G4int NQ=valQC.GetN();
00879 if(NQ>1)
00880 {
00881 G4QContent resQC=valQC-neutQC-neutQC;
00882 G4int resPDG=resQC.GetSPDGCode();
00883 G4double resMas=G4QPDGCode(resPDG).GetMass();
00884 G4double sM=resMas+mNeut+mNeut;
00885 #ifdef debug
00886 G4cout<<"G4QNucleus::Split2Baryons: (2 neutrons), sM="<<sM<<", d="<<totM-sM<<G4endl;
00887 #endif
00888 if(sM<totM) return true;
00889 }
00890 G4int PQ=valQC.GetP();
00891 if(PQ>1)
00892 {
00893 G4QContent resQC=valQC-protQC-protQC;
00894 G4int resPDG=resQC.GetSPDGCode();
00895 G4double resMas=G4QPDGCode(resPDG).GetMass();
00896 G4double sM=resMas+mProt+mProt;
00897 #ifdef debug
00898 G4cout<<"G4QNucleus::Split2Baryons: (2 protons), sM="<<sM<<", d="<<totM-sM<<G4endl;
00899 #endif
00900 if(sM<totM) return true;
00901 }
00902 if(PQ&&NQ)
00903 {
00904 G4QContent resQC=valQC-protQC-neutQC;
00905 G4int resPDG=resQC.GetSPDGCode();
00906 G4double resMas=G4QPDGCode(resPDG).GetMass();
00907 G4double sM=resMas+mProt+mNeut;
00908 #ifdef debug
00909 G4cout<<"G4QNucleus::Split2Baryons:(proton+neutron), sM="<<sM<<", d="<<totM-sM<<G4endl;
00910 #endif
00911 if(sM<totM) return true;
00912 }
00913 G4int LQ=valQC.GetL();
00914 if(LQ&&NQ)
00915 {
00916 G4QContent resQC=valQC-lambQC-neutQC;
00917 G4int resPDG=resQC.GetSPDGCode();
00918 G4double resMas=G4QPDGCode(resPDG).GetMass();
00919 G4double sM=resMas+mLamb+mNeut;
00920 #ifdef debug
00921 G4cout<<"G4QNucleus::Split2Baryons:(lambda+neutron), sM="<<sM<<", d="<<totM-sM<<G4endl;
00922 #endif
00923 if(sM<totM) return true;
00924 }
00925 if(LQ&&PQ)
00926 {
00927 G4QContent resQC=valQC-protQC-lambQC;
00928 G4int resPDG=resQC.GetSPDGCode();
00929 G4double resMas=G4QPDGCode(resPDG).GetMass();
00930 G4double sM=resMas+mProt+mLamb;
00931 #ifdef debug
00932 G4cout<<"G4QNucleus::Split2Baryons: (proton+lambda), sM="<<sM<<", d="<<totM-sM<<G4endl;
00933 #endif
00934 if(sM<totM) return true;
00935 }
00936 if(LQ>1)
00937 {
00938 G4QContent resQC=valQC-lambQC-lambQC;
00939 G4int resPDG=resQC.GetSPDGCode();
00940 G4double resMas=G4QPDGCode(resPDG).GetMass();
00941 G4double sM=resMas+mLamb+mLamb;
00942 #ifdef debug
00943 G4cout<<"G4QNucleus::Split2Baryons: (two lambdas), sM="<<sM<<", d="<<totM-sM<<G4endl;
00944 #endif
00945 if(sM<totM) return true;
00946 }
00947 return false;
00948 }
00949
00950
00951 G4bool G4QNucleus::EvaporateBaryon(G4QHadron* h1, G4QHadron* h2)
00952 {
00953
00954
00955 static const G4double uWell=1.7;
00956
00958
00964 static const G4int gPDG = 22;
00965 static const G4QPDGCode gQPDG(gPDG);
00966 static const G4int nPDG = 2112;
00967 static const G4QPDGCode nQPDG(nPDG);
00968 static const G4QPDGCode anQPDG(-nPDG);
00969 static const G4int pPDG = 2212;
00970 static const G4QPDGCode pQPDG(pPDG);
00971 static const G4QPDGCode apQPDG(-pPDG);
00972 static const G4int lPDG = 3122;
00973 static const G4QPDGCode lQPDG(lPDG);
00974 static const G4QPDGCode aDppQPDG(-2224);
00975 static const G4QPDGCode aDmQPDG(-1114);
00976 static const G4QPDGCode alQPDG(-lPDG);
00977 static const G4int dPDG = 90001001;
00978 static const G4int aPDG = 90002002;
00979 static const G4QPDGCode aQPDG(aPDG);
00980 static const G4QPDGCode NPQPDG(dPDG);
00981 static const G4QPDGCode NNQPDG(90000002);
00982 static const G4QPDGCode PPQPDG(90002000);
00983 static const G4QPDGCode NLQPDG(91000001);
00984 static const G4QPDGCode PLQPDG(91001000);
00985 static const G4QPDGCode LLQPDG(92000000);
00986 static const G4QPDGCode NAQPDG(90002003);
00987 static const G4QPDGCode PAQPDG(90003002);
00988 static const G4QPDGCode LAQPDG(91002002);
00989 static const G4QPDGCode AAQPDG(90004004);
00990 static const G4QPDGCode PIPQPDG(211);
00991 static const G4QPDGCode PIMQPDG(-211);
00992 static const G4double mNeut= G4QPDGCode(nPDG).GetMass();
00993 static const G4double mProt= G4QPDGCode(pPDG).GetMass();
00994 static const G4double mLamb= G4QPDGCode(lPDG).GetMass();
00995 static const G4double mDeut= G4QPDGCode(nPDG).GetNuclMass(1,1,0);
00996 static const G4double mAlph= G4QPDGCode(nPDG).GetNuclMass(2,2,0);
00997 static const G4double mPi = G4QPDGCode(211).GetMass();
00998 static const G4double mN2 = mNeut*mNeut;
00999 static const G4double mP2 = mProt*mProt;
01000 static const G4double mL2 = mLamb*mLamb;
01001 static const G4double mA2 = mAlph*mAlph;
01002 static const G4double mNP = mNeut+mProt;
01003
01004
01005
01006
01007
01008 G4bool barf=true;
01009 G4double uW=uWell;
01010 G4int a = GetA();
01011 G4double evalph=0.1;
01012
01013
01014 #ifdef debug
01015 G4cout<<"G4QNucleus::EvaporBaryon: *Called*, a="<<a<<GetThis()<<",alph="<<evalph<<G4endl;
01016 #endif
01017 G4double a1= a-1;
01020 G4double PBarr= CoulombBarrier(1,1);
01021 G4double PPBarr= CoulombBarrier(1,1,1,1);
01022 G4double PABarr= CoulombBarrier(1,1,2,4);
01023 G4double APBarr= CoulombBarrier(2,4,1,1);
01024 G4double ABarr= CoulombBarrier(2,4);
01025 G4double AABarr= CoulombBarrier(2,4,2,4);
01026
01027
01029
01030 G4double SPPBarr=PBarr+PPBarr;
01031 G4double SAABarr=ABarr+AABarr;
01032
01033
01034 G4double SAPBarr=PABarr+ABarr;
01035 G4double DAPBarr=APBarr+PBarr;
01036 if(DAPBarr>SAPBarr)SAPBarr=DAPBarr;
01038
01039 G4LorentzVector h1mom;
01040 G4LorentzVector h2mom;
01041 G4LorentzVector h3mom;
01042 G4double totMass= GetMass();
01043 #ifdef debug
01044 G4cout<<"G4QN::EB:pB="<<PBarr<<",aB="<<ABarr<<",ppB="<<PPBarr<<",paB="<<PABarr<<G4endl;
01045 #endif
01046 if(a==-2)
01047 {
01048 if(Z==1 || N==1)
01049 {
01050 G4int nucPDG = -2112;
01051 G4int piPDG = 211;
01052 G4double nucM = mNeut;
01053 G4QPDGCode del = aDmQPDG;
01054 G4QPDGCode nuc = anQPDG;
01055 if(N>0)
01056 {
01057 nucPDG = -2212;
01058 piPDG = -211;
01059 nucM = mProt;
01060 del = aDppQPDG;
01061 nuc = apQPDG;
01062 }
01063 if(totMass > mPi+nucM+nucM)
01064 {
01065 G4LorentzVector n14M(0.,0.,0.,nucM);
01066 G4LorentzVector n24M(0.,0.,0.,nucM);
01067 G4LorentzVector pi4M(0.,0.,0.,mPi);
01068 if(!DecayIn3(n14M, n24M, pi4M))
01069 {
01070 G4cerr<<"***G4QNucl::EvapBary: (anti) tM="<<totMass<<"-> 2N="<<nucPDG<<"(M="
01071 <<nucM<<") + pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
01072
01073 return false;
01074 }
01075 n14M+=pi4M;
01076 h1->SetQPDG(del);
01077 h2->SetQPDG(nuc);
01078 h1->Set4Momentum(n14M);
01079 h2->Set4Momentum(n24M);
01080 return true;
01081 }
01082 else
01083 {
01084 G4cerr<<"***G4QNucleus::EvaporateBaryon: M="<<totMass
01085 <<", M="<<totMass<<" < M_2N+Pi, d="<<totMass-2*nucM-mPi<<G4endl;
01086
01087 return false;
01088 }
01089 }
01090 else if(Z==2 || N==2)
01091 {
01092 G4int nucPDG = -2112;
01093 G4int piPDG = 211;
01094 G4double nucM = mNeut;
01095 G4QPDGCode del = aDmQPDG;
01096 if(N==2)
01097 {
01098 nucPDG = -2212;
01099 piPDG = -211;
01100 nucM = mProt;
01101 del = aDppQPDG;
01102 }
01103 if(totMass > mPi+mPi+nucM+nucM)
01104 {
01105 G4LorentzVector n14M(0.,0.,0.,nucM);
01106 G4LorentzVector n24M(0.,0.,0.,nucM);
01107 G4LorentzVector pi4M(0.,0.,0.,mPi+mPi);
01108 if(!DecayIn3(n14M, n24M, pi4M))
01109 {
01110 G4cerr<<"***G4QNucl::EvapBary: (anti) tM="<<totMass<<"-> 2N="<<nucPDG<<"(M="
01111 <<nucM<<") + 2pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
01112
01113 return false;
01114 }
01115 G4LorentzVector hpi4M=pi4M/2.;
01116 n14M+=hpi4M;
01117 n24M+=hpi4M;
01118 h1->SetQPDG(del);
01119 h2->SetQPDG(del);
01120 h1->Set4Momentum(n14M);
01121 h2->Set4Momentum(n24M);
01122 return true;
01123 }
01124 else
01125 {
01126 G4cerr<<"***G4QNucleus::EvaporateBaryon: M="<<totMass
01127 <<", M="<<totMass<<" < M_2N+Pi, d="<<totMass-2*nucM-mPi<<G4endl;
01128
01129 return false;
01130 }
01131 }
01132 else if(Z==-2)
01133 {
01134 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01135 h2mom=h1mom;
01136 h1->SetQPDG(apQPDG);
01137 h2->SetQPDG(apQPDG);
01138 if(!DecayIn2(h1mom,h2mom)) return false;
01139 }
01140 else if(N==-2)
01141 {
01142 h1mom=G4LorentzVector(0.,0.,0.,mNeut);
01143 h2mom=h1mom;
01144 h1->SetQPDG(anQPDG);
01145 h2->SetQPDG(anQPDG);
01146 if(!DecayIn2(h1mom,h2mom)) return false;
01147 }
01148 else if(N==-1 && Z==-1)
01149 {
01150 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01151 h2mom=G4LorentzVector(0.,0.,0.,mNeut);
01152 h1->SetQPDG(apQPDG);
01153 h2->SetQPDG(anQPDG);
01154 if(!DecayIn2(h1mom,h2mom)) return false;
01155 }
01156 else if(Z==-1 && S==-1)
01157 {
01158 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01159 h2mom=G4LorentzVector(0.,0.,0.,mLamb);
01160 h1->SetQPDG(apQPDG);
01161 h2->SetQPDG(alQPDG);
01162 if(!DecayIn2(h1mom,h2mom)) return false;
01163 }
01164 else
01165 {
01166 h1mom=G4LorentzVector(0.,0.,0.,mNeut);
01167 h2mom=G4LorentzVector(0.,0.,0.,mLamb);
01168 h1->SetQPDG(anQPDG);
01169 h2->SetQPDG(alQPDG);
01170 if(!DecayIn2(h1mom,h2mom)) return false;
01171 }
01172 h1->Set4Momentum(h1mom);
01173 h2->Set4Momentum(h2mom);
01174 return true;
01175 }
01176 else if(a==2)
01177 {
01178 if(Z<0||N<0)
01179 {
01180 G4int nucPDG = 2112;
01181 G4double nucM = mNeut;
01182 G4int piPDG = -211;
01183 G4QPDGCode db = NNQPDG;
01184 G4QPDGCode pi_value = PIMQPDG;
01185 if(N<0)
01186 {
01187 nucPDG = 2212;
01188 nucM = mProt;
01189 piPDG = 211;
01190 db = PPQPDG;
01191 pi_value = PIPQPDG;
01192 }
01193 if(totMass>mPi+nucM+nucM)
01194 {
01195 G4LorentzVector n14M(0.,0.,0.,nucM);
01196 G4LorentzVector n24M(0.,0.,0.,nucM);
01197 G4LorentzVector pi4M(0.,0.,0.,mPi);
01198 if(!DecayIn3(n14M,n24M,pi4M))
01199 {
01200 G4cerr<<"***G4QNucl::EvapBary: tM="<<totMass<<"-> 2N="<<nucPDG<<"(M="
01201 <<nucM<<") + pi="<<piPDG<<"(M="<<mPi<<")"<<G4endl;
01202
01203 return false;
01204 }
01205 n14M+=n24M;
01206 h1->SetQPDG(db);
01207 h2->SetQPDG(pi_value);
01208 h1->Set4Momentum(n14M);
01209 h2->Set4Momentum(pi4M);
01210 return true;
01211 }
01212 else
01213 {
01214 G4cerr<<"***G4QNucleus::EvaporateBaryon: M="<<totMass
01215 <<", M="<<totMass<<" < M_2N+Pi, d="<<totMass-2*nucM-mPi<<G4endl;
01216
01217 return false;
01218 }
01219 }
01220 else if(Z==2)
01221 {
01222 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01223 h2mom=h1mom;
01224 h1->SetQPDG(pQPDG);
01225 h2->SetQPDG(pQPDG);
01226 if(!DecayIn2(h1mom,h2mom)) return false;
01227 }
01228 else if(N==2)
01229 {
01230 h1mom=G4LorentzVector(0.,0.,0.,mNeut);
01231 h2mom=h1mom;
01232 h1->SetQPDG(nQPDG);
01233 h2->SetQPDG(nQPDG);
01234 if(!DecayIn2(h1mom,h2mom)) return false;
01235 }
01236 else if(N==1&&Z==1)
01237 {
01238 if(totMass<=mNP)
01239 {
01240 #ifdef debug
01241 G4cout<<"G4QNucl::EvaporateBaryon: Photon ### d+g ###, dM="<<totMass-mNP<<G4endl;
01242 #endif
01243 h1mom=G4LorentzVector(0.,0.,0.,0.);
01244 h2mom=G4LorentzVector(0.,0.,0.,mDeut);
01245 h1->SetQPDG(gQPDG);
01246 h2->SetQPDG(NPQPDG);
01247 }
01248 else
01249 {
01250 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01251 h2mom=G4LorentzVector(0.,0.,0.,mNeut);
01252 h1->SetQPDG(pQPDG);
01253 h2->SetQPDG(nQPDG);
01254 }
01255 if(!DecayIn2(h1mom,h2mom)) return false;
01256 }
01257 else if(Z==1&&S==1)
01258 {
01259 h1mom=G4LorentzVector(0.,0.,0.,mProt);
01260 h2mom=G4LorentzVector(0.,0.,0.,mLamb);
01261 h1->SetQPDG(pQPDG);
01262 h2->SetQPDG(lQPDG);
01263 if(!DecayIn2(h1mom,h2mom)) return false;
01264 }
01265 else
01266 {
01267 h1mom=G4LorentzVector(0.,0.,0.,mNeut);
01268 h2mom=G4LorentzVector(0.,0.,0.,mLamb);
01269 h1->SetQPDG(nQPDG);
01270 h2->SetQPDG(lQPDG);
01271 if(!DecayIn2(h1mom,h2mom)) return false;
01272 }
01273 h1->Set4Momentum(h1mom);
01274 h2->Set4Momentum(h2mom);
01275 return true;
01276 }
01277 else if(a>2)
01278 {
01279 G4bool nFlag = false;
01280 G4bool pFlag = false;
01281 G4bool lFlag = false;
01282 G4bool aFlag = false;
01283 G4bool nnFlag = false;
01284 G4bool npFlag = false;
01285 G4bool nlFlag = false;
01286 G4bool ppFlag = false;
01287 G4bool plFlag = false;
01288 G4bool llFlag = false;
01289 G4bool paFlag = false;
01290 G4bool naFlag = false;
01291 G4bool laFlag = false;
01292 G4bool aaFlag = false;
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313 G4double GSMass = GetGSMass();
01314 G4double GSResNN= GSMass;
01315 G4double GSResNP= GSMass;
01316 G4double GSResNL= GSMass;
01317 G4double GSResPP= GSMass;
01318 G4double GSResPL= GSMass;
01319 G4double GSResLL= GSMass;
01320 G4double GSResNA= GSMass;
01321 G4double GSResPA= GSMass;
01322 G4double GSResLA= GSMass;
01323 G4double GSResAA= GSMass;
01324 G4double GSResNa= GSMass;
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349 G4QPDGCode PQPDG(22);
01350 G4QPDGCode NQPDG(22);
01351 G4QPDGCode LQPDG(22);
01352 G4QPDGCode AQPDG(22);
01353 G4QPDGCode nnQPDG(22);
01354 G4QPDGCode npQPDG(22);
01355 G4QPDGCode nlQPDG(22);
01356 G4QPDGCode ppQPDG(22);
01357 G4QPDGCode plQPDG(22);
01358 G4QPDGCode llQPDG(22);
01359 G4QPDGCode naQPDG(22);
01360 G4QPDGCode paQPDG(22);
01361 G4QPDGCode laQPDG(22);
01362 G4QPDGCode aaQPDG(22);
01363 G4QPDGCode dbQPDG(22);
01364 G4QPDGCode fQPDG(22);
01365 G4double rMass = 0.;
01366 G4double eMass = 0.;
01367 G4double fMass = 0.;
01368 #ifdef debug
01369 G4cout<<"G4QNuc::EvaB:a>2, totM="<<totMass<<" > GSMass="<<GSMass<<",d="<<totMass-GSMass
01370 <<G4endl;
01371 #endif
01372 G4double tM2 = totMass*totMass;
01373 G4double qtM2 = 4*tM2;
01374 G4double GSResNp= GSMass;
01375 G4double pExcess= 0.;
01376 G4double aExcess= 0.;
01377 G4double pp2m = 0.;
01378 G4double ap2m = 0.;
01379 G4double pBnd = 0.;
01380 G4double aBnd = 0.;
01381 G4bool three=false;
01382 if(Z>0)
01383 {
01384 PQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-1)+N);
01385 GSResNp=PQPDG.GetMass();
01386 G4double mpls=GSResNp+mProt;
01387 G4double mmin=GSResNp-mProt;
01388 pp2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
01389 if(pp2m>=0.000001)
01390 {
01391 pFlag=true;
01392 pBnd=mProt-GSMass+GSResNp;
01393 G4double eMax=sqrt(mP2+pp2m);
01394 #ifdef debug
01395 G4cout<<"G4QNuc::EvapBaryon:pm="<<eMax+sqrt(pp2m+GSResNp*GSResNp)<<" = M="<<totMass
01396 <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl;
01397 #endif
01398 pExcess=eMax-mProt+pBnd;
01399 }
01400 else pExcess=pBnd;
01401 if(Z>1)
01402 {
01403 ppQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-2)+N);
01404 GSResPP=ppQPDG.GetMass();
01405 #ifdef debug
01406 G4double sm=GSResPP+mProt+mProt+SPPBarr;
01407 G4cout<<"G4QNucl::EvapBaryon: ppM="<<GSResPP<<",T="<<sm-GSMass<<",E="<<totMass-sm
01408 <<",C="<<PBarr<<G4endl;
01409 #endif
01410 if(GSResPP+mProt+mProt+SPPBarr<totMass) ppFlag=true;
01411 if(Z>2&&a>3)
01412 {
01413
01414
01415
01416
01417
01418 if(N>1&&a>5)
01419 {
01420 paQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-3)+N-2);
01421 GSResPA=paQPDG.GetMass();
01422 #ifdef debug
01423 G4double s_value=GSResPA+mAlph+mProt+SAPBarr;
01424 G4cout<<"G4QN::EB:paM="<<GSResPA<<",T="<<s_value-GSMass<<",E="<<totMass-s_value<<G4endl;
01425 #endif
01426 if(GSResPA+mProt+SAPBarr+mAlph<totMass) paFlag=true;
01427 }
01428 }
01429 if(N>0&&a>3)
01430 {
01431
01432
01433
01434
01435
01436 }
01437 if(S>0&&a>3)
01438 {
01439
01440
01441
01442
01443
01444 }
01445 if(N>1&&a>4)
01446 {
01447 if(a>6)
01448 {
01449 if(S>1)
01450 {
01451
01452
01453
01454
01455
01456 }
01457 if(N>2&&S>0)
01458 {
01459
01460
01461
01462
01463
01464 }
01465 if(Z>2&&S>0)
01466 {
01467
01468
01469
01470
01471
01472 }
01473 if(N>3)
01474 {
01475
01476
01477
01478
01479
01480 }
01481 if(Z>2&&N>2)
01482 {
01483
01484
01485
01486
01487
01488 }
01489 if(N>3)
01490 {
01491
01492
01493
01494
01495
01496 }
01497 if(a>9)
01498 {
01499 if(Z>3&&N>3&&S>0)
01500 {
01501
01502
01503
01504
01505
01506 }
01507 if(Z>3&&N>4)
01508 {
01509
01510
01511
01512
01513
01514 }
01515 if(Z>4&&N>3)
01516 {
01517
01518
01519
01520
01521
01522 }
01523 if(a>12&&N>5&&Z>5)
01524 {
01525
01526
01527
01528
01529
01530 }
01531 }
01532 }
01533 if(N>3&&Z>3&&a>8)
01534 {
01535 aaQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-4)+N-4);
01536 GSResAA=aaQPDG.GetMass();
01537 #ifdef debug
01538 G4double s_value=GSResAA+mAlph+mAlph+SAABarr;
01539 G4cout<<"G4QNucl::EvapBaryon: a="<<GSResNP<<",T="<<s_value-GSMass<<",E="<<totMass-s_value
01540 <<",A="<<SAABarr<<G4endl;
01541 #endif
01542 if(GSResAA+mAlph+mAlph+SAABarr<totMass) aaFlag=true;
01543 }
01544 if(N>2&&a>5)
01545 {
01546 naQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-2)+N-3);
01547 GSResNA=naQPDG.GetMass();
01548 #ifdef debug
01549 G4double s_value=GSResNA+mAlph+mNeut;
01550 G4cout<<"G4QNucl::EvapBary: M="<<GSResNA<<",T="<<s_value-GSMass<<",E="<<totMass-s_value
01551 <<",C="<<ABarr<<G4endl;
01552 #endif
01553 if(GSResNA+mNeut+mAlph+ABarr<totMass) naFlag=true;
01554 }
01555 if(S>0&&a>5)
01556 {
01557 laQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-1002)+N-2);
01558 GSResLA=laQPDG.GetMass();
01559 if(GSResLA+mLamb+mAlph+ABarr<totMass) laFlag=true;
01560 }
01561 AQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-2)+N-2);
01562 GSResNa=AQPDG.GetMass();
01563 mpls=GSResNa+mAlph;
01564 mmin=GSResNa-mAlph;
01565 ap2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
01566 if(ap2m>=0.000001)
01567 {
01568 aFlag=true;
01569 aBnd=mAlph-GSMass+GSResNa;
01570 G4double eMax=sqrt(mA2+ap2m);
01571 #ifdef debug
01572 G4cout<<"G4QNuc::EvapBar:m="<<eMax+sqrt(ap2m+GSResNa*GSResNa)<<" = M="<<totMass
01573 <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl;
01574 #endif
01575 aExcess=eMax-mAlph+aBnd;
01576 }
01577 else aExcess=pBnd;
01578 }
01579 }
01580 if(N>0)
01581 {
01582 if(Z>0)
01583 {
01584 npQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-1)+N-1);
01585 GSResNP=npQPDG.GetMass();
01586 #ifdef debug
01587 G4double s_value=GSResNP+mNeut+mProt;
01588 G4cout<<"G4QNucl::EvapBaryon: npM="<<GSResNP<<",T="<<s_value-GSMass<<",E="<<totMass-s_value
01589 <<",C="<<PBarr<<G4endl;
01590 #endif
01591 if(GSResNP+mNeut+mProt+PBarr<totMass) npFlag=true;
01592 }
01593 if(N>1)
01594 {
01595
01596
01597
01598
01599
01600 }
01601 if(S>0)
01602 {
01603
01604
01605
01606
01607
01608 }
01609 }
01610 if(S>0)
01611 {
01612 if(Z>0)
01613 {
01614 plQPDG=G4QPDGCode(90000000+1000*(1000*(S-1)+Z-1)+N);
01615 GSResPL=plQPDG.GetMass();
01616 if(GSResPL+mProt+PBarr+mLamb<totMass) plFlag=true;
01617 }
01618 if(S>1)
01619 {
01620
01621
01622
01623
01624
01625 }
01626 }
01627 }
01628 G4double GSResNn= GSMass;
01629 G4double nExcess= 0.;
01630 G4double np2m = 0.;
01631 G4double nBnd = 0.;
01632 if(N>0)
01633 {
01634 NQPDG=G4QPDGCode(90000000+1000*(1000*S+Z)+N-1);
01635 GSResNn=NQPDG.GetMass();
01636 #ifdef debug
01637 G4cout<<"G4QNucleus::EvapBaryon: M(A-N)="<<GSResNn<<",Z="<<Z
01638 <<",N="<<N<<",S="<<S<<G4endl;
01639 #endif
01640 G4double mpls=GSResNn+mNeut;
01641 G4double mmin=GSResNn-mNeut;
01642 np2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
01643 if(np2m>=0.000001)
01644 {
01645 nFlag=true;
01646 nBnd=mNeut-GSMass+GSResNn;
01647 G4double eMax=sqrt(mN2+np2m);
01648 #ifdef debug
01649 G4cout<<"G4QNuc::EvapBaryon:nm="<<eMax+sqrt(np2m+GSResNn*GSResNn)<<" = M="<<totMass
01650 <<", sm="<<GSResNn+mNeut<<",np2="<<np2m<<",nB="<<nBnd<<G4endl;
01651 #endif
01652 nExcess=eMax-mNeut+nBnd;
01653 }
01654 else nExcess=nBnd;
01655 if(N>1)
01656 {
01657 nnQPDG=G4QPDGCode(90000000+1000*(1000*S+Z)+N-2);
01658 GSResNN=nnQPDG.GetMass();
01659 if(GSResNN+mNeut+mNeut<totMass) nnFlag=true;
01660 if(N>2)
01661 {
01662
01663
01664
01665
01666
01667 }
01668 if(S>0)
01669 {
01670
01671
01672
01673
01674
01675 }
01676 }
01677 if(S>0)
01678 {
01679 nlQPDG=G4QPDGCode(90000000+1000*(1000*(S-1)+Z)+N-1);
01680 GSResNL=nlQPDG.GetMass();
01681 if(GSResNL+mNeut+mLamb<totMass) nlFlag=true;
01682 if(S>1)
01683 {
01684
01685
01686
01687
01688
01689 }
01690 }
01691 }
01692 G4double GSResNl= GSMass;
01693 G4double lExcess= 0.;
01694 G4double lp2m = 0.;
01695 G4double lBnd = 0.;
01696 if(S>0)
01697 {
01698 LQPDG=G4QPDGCode(90000000+1000*(1000*(S-1)+Z)+N);
01699 GSResNl=LQPDG.GetMass();
01700 G4double mpls=GSResNl+mLamb;
01701 G4double mmin=GSResNl-mLamb;
01702 lp2m=(tM2-mpls*mpls)*(tM2-mmin*mmin)/qtM2;
01703 if(lp2m>=0.000001)
01704 {
01705 lFlag=true;
01706 lBnd=mLamb-GSMass+GSResNl;
01707 G4double eMax=sqrt(mL2+lp2m);
01708 #ifdef debug
01709 G4cout<<"G4QNuc::EvapBaryon:lm="<<eMax+sqrt(lp2m+GSResNl*GSResNl)<<" = M="<<totMass
01710 <<", sm="<<GSResNl+mLamb<<",lp2="<<lp2m<<",lB="<<lBnd<<G4endl;
01711 #endif
01712 lExcess=eMax-mLamb+lBnd;
01713 }
01714 else lExcess=lBnd;
01715 if(S>1)
01716 {
01717 llQPDG=G4QPDGCode(90000000+1000*(1000*(S-2)+Z)+N);
01718 GSResLL=llQPDG.GetMass();
01719 if(GSResLL+mLamb+mLamb<totMass) llFlag=true;
01720 if(S>2)
01721 {
01722
01723
01724
01725
01726
01727 }
01728 }
01729 }
01730 G4bool nSecF = nnFlag||npFlag||nlFlag||naFlag;
01731 G4bool pSecF = npFlag||ppFlag||plFlag||paFlag;
01732 G4bool lSecF = nlFlag||plFlag||llFlag||laFlag;
01733 G4bool aSecF = naFlag||paFlag||laFlag||aaFlag;
01734
01735
01736
01737
01738 G4bool secB = nSecF||pSecF||lSecF||aSecF;
01739
01740 #ifdef debug
01741 G4cout<<"G4QNucl::EvapBary:n="<<nSecF<<",p="<<pSecF<<",l="<<lSecF<<",a="<<aSecF<<",nn="
01742 <<nnFlag<<", np="<<npFlag<<",pp="<<ppFlag<<",pa="<<paFlag<<",na="<<naFlag<<",aa="
01743 <<aaFlag<<G4endl;
01744 #endif
01745 G4QPDGCode bQPDG;
01746 G4QPDGCode rQPDG;
01747 if(secB)
01748
01749 {
01750 if(!nSecF) nFlag=false;
01751 if(!pSecF) pFlag=false;
01752 if(!lSecF) lFlag=false;
01753 if(!aSecF) aFlag=false;
01754 #ifdef debug
01755 G4cout<<"G4QNuc::EB:nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl;
01756 #endif
01757 G4double maxE=0.;
01758 if(nFlag&&nExcess>maxE) maxE=nExcess;
01759 if(pFlag&&pExcess>maxE) maxE=pExcess;
01760 if(lFlag&&lExcess>maxE) maxE=lExcess;
01761 if(lFlag&&aExcess>maxE) maxE=aExcess;
01762 G4double pMin=pBnd;
01763 if(pFlag)pMin+= PBarr;
01764 G4double nMin=nBnd;
01765 G4double lMin=lBnd;
01766 G4double aMin=aBnd;
01767 if(aFlag)aMin+= ABarr;
01768 G4double minE=GSMass;
01769 if(nFlag&&nMin<minE) minE=nMin;
01770 if(pFlag&&pMin<minE) minE=pMin;
01771 if(lFlag&&lMin<minE) minE=lMin;
01772 if(evalph&&aFlag&&aMin<minE) minE=aMin;
01773
01774 #ifdef debug
01775 G4cout<<"G4QNucleus::EvapBaryon: nE="<<nExcess<<">"<<nMin<<",pE="<<pExcess<<">"<<pMin
01776 <<",sE="<<lExcess<<">"<<lMin<<",E="<<aExcess<<">"<<aMin<<",miE="<<minE<<"<maE="
01777 <<maxE<<G4endl;
01778 #endif
01779
01780 G4int cntr= 0;
01781
01782
01783
01784
01785 G4int cntm= 53;
01786 if( ( (pFlag && pExcess > pMin) ||
01787 (nFlag && nExcess > nMin) ||
01788 (lFlag && lExcess > lMin) ||
01789 (aFlag && aExcess > aMin) ) && minE<maxE )
01790 {
01791 G4double mi=uWell+minE;
01792 G4double mm_value=uWell+maxE;
01793 G4double ma=uWell*a+maxE;
01794 if(mi<0.)
01795 {
01796 uW-=mi;
01797 mm_value-=mi;
01798 mi=0.;
01799 }
01800
01801 if(ma<mm_value)
01802 {
01803 ma=mm_value;
01804
01805 }
01806 #ifdef debug
01807 G4cout<<"G4QNuc::EvapBary:iE="<<minE<<",aE="<<maxE<<",mi="<<mi<<",mm="<<mm_value<<",ma="
01808 <<ma<<G4endl;
01809 #endif
01810 G4double xMi=mi/ma;
01811 G4double xMm=mm_value/ma;
01812
01813
01814
01815 G4double xMa=xMm;
01816 if(xMa>1.)xMa=1.;
01817 if(xMi<0.)xMi=0.;
01818 if(xMi>xMa)
01819 {
01820 G4cerr<<"***G4QNucleus::EvapBaryon: M="<<mm_value/ma<<",xi="<<xMi<<",xa="<<xMa<<G4endl;
01821 return false;
01822 }
01823 xMi=sqrt(xMi);
01824 xMa=sqrt(xMa);
01825 #ifdef debug
01826 G4cout<<"G4QNuc:EvapBaryon:mi="<<mi<<",ma="<<ma<<", xi="<<xMi<<",xa="<<xMa<<G4endl;
01827 #endif
01828 G4double powr=1.5*a1;
01829 G4double revP=1./powr;
01830 #ifdef debug
01831 G4cout<<"G4QNucleus::EvaporateBaryon: Power="<<powr<<",RevPower="<<revP<<G4endl;
01832 #endif
01833 G4double minR=pow(1.-xMa*xMa,powr);
01834 G4double maxR=pow(1.-xMi*xMi,powr);
01835 #ifdef debug
01836 G4cout<<"G4QNucleus::EvaporateBaryon: miR="<<minR<<", maR="<<maxR<<G4endl;
01837 #endif
01838 G4bool cond=true;
01839 G4int PDG = 0;
01840 G4double tk = 0.;
01841 while(cond&&cntr<cntm)
01842 {
01843 G4double R = minR+(maxR-minR)*G4UniformRand();
01844
01845 G4double x2= 1.-pow(R,revP);
01846 G4double x = sqrt(x2);
01847 if(x<xMi||x>xMa)
01848 {
01849 #ifdef debug
01850 G4cerr<<"**G4QNucl::EvapB:R="<<R<<",xi="<<xMi<<" < "<<x<<" < xa="<<xMa<<G4endl;
01851 #endif
01852 if(x<xMi) x=xMi;
01853 else x=xMa;
01854 x2 = x*x;
01855 }
01856 G4double rn=G4UniformRand();
01857
01858 if(rn<x/xMa)
01859 {
01860 tk= ma*x2-uW;
01861 G4double psum =0.;
01862 G4double zCBPP=0.;
01863 #ifdef debug
01864 G4cout<<"G4QNuc::EvapB:t="<<tk<<",pM="<<pMin<<",pB="<<pBnd<<",n="<<nMin<<",a="
01865 <<aMin<<G4endl;
01866 #endif
01867 if(pFlag&&tk>pMin)
01868 {
01869 G4double kin=tk-pBnd;
01870
01871 #ifdef debug
01872 G4cout<<"G4QN::EB:Proton="<<kin<<",CB="<<PBarr<<",B="<<pBnd<<",M="<<pMin
01873 <<",p="<<CoulBarPenProb(PBarr,kin,1,1)<<G4endl;
01874 #endif
01875 zCBPP=Z*CoulBarPenProb(PBarr,kin,1,1)*sqrt(kin);
01876 }
01877 psum+=zCBPP;
01878 G4double nCBPP=0.;
01879 if(nFlag&&tk>nMin)
01880 {
01881 G4double kin=tk-nBnd;
01882 #ifdef debug
01883 G4cout<<"G4QN::EB:Neutron="<<kin<<",p="<<CoulBarPenProb(0.,kin,0,1)<<G4endl;
01884 #endif
01885 nCBPP=N*CoulBarPenProb(0.,kin,0,1)*sqrt(kin);
01886 }
01887 psum+=nCBPP;
01888 nCBPP+=zCBPP;
01889 G4double lCBPP=0.;
01890 if(lFlag&&tk>lMin)
01891 {
01892 G4double kin=tk-lBnd;
01893 #ifdef debug
01894 G4cout<<"G4QN::EB:Lambda="<<kin<<",p="<<CoulBarPenProb(0,kin,0,1)<<G4endl;
01895 #endif
01896 lCBPP=S*CoulBarPenProb(0.,kin,0,1)*sqrt(kin);
01897 }
01898 psum+=lCBPP;
01899 lCBPP+=nCBPP;
01900 if(evalph&&aFlag&&tk>aMin)
01901 {
01902 G4double kin=tk-aBnd;
01903
01904 #ifdef debug
01905 G4cout<<"G4QN::EB:Alpha="<<kin<<",CB="<<ABarr<<",p="
01906 <<CoulBarPenProb(ABarr,kin,2,4)<<G4endl;
01907 #endif
01908 psum+=CoulBarPenProb(ABarr,kin,2,4)*sqrt(kin)*evalph*Z*(Z-1)*N*(N-1)
01909 *6/a1/(a-2)/(a-3);
01910 }
01911 G4double r = psum*G4UniformRand();
01912 #ifdef debug
01913 G4cout<<"G4QNuc::EvapB:"<<r<<",p="<<zCBPP<<",pn="<<nCBPP<<",pnl="<<lCBPP<<",t="
01914 <<psum<<G4endl;
01915 #endif
01916 cond = false;
01917 if (r&&r>lCBPP)
01918 {
01919 #ifdef debug
01920 G4cout<<"G4QNuc::EvaB:ALPHA is selected for evap, r="<<r<<">"<<lCBPP<<G4endl;
01921 #endif
01922 PDG=aPDG;
01923 }
01924 else if(r&&r>nCBPP&&r<=lCBPP)
01925 {
01926 #ifdef debug
01927 G4cout<<"G4QNuc::EvaB:LAMBDA is selected for evap,r="<<r<<"<"<<lCBPP<<G4endl;
01928 #endif
01929 PDG=lPDG;
01930 }
01931 else if(r&&r>zCBPP&&r<=nCBPP)
01932 {
01933 #ifdef debug
01934 G4cout<<"G4QNuc::EvaBar: N is selected for evapor,r="<<r<<"<"<<nCBPP<<G4endl;
01935 #endif
01936 PDG=nPDG;
01937 }
01938 else if(r&&r<=zCBPP)
01939 {
01940 #ifdef debug
01941 G4cout<<"G4QNuc::EvaBar: P is selected for evapor,r="<<r<<"<"<<zCBPP<<G4endl;
01942 #endif
01943 PDG=pPDG;
01944 }
01945 else cond=true;
01946 }
01947 #ifdef debug
01948 G4cout<<"G4QNuc::EvapBar:c="<<cond<<",x="<<x<<",cnt="<<cntr<<",R="<<R<<",ma="<<ma
01949 <<",rn="<<rn<<"<r="<<x/xMa<<",tk="<<tk<<",ni="<<nMin<<",pi="<<pMin<<G4endl;
01950 #endif
01951 cntr++;
01952 }
01953 if(cntr<cntm)
01954 {
01955 G4double p2=0.;
01956 if (PDG==aPDG)
01957 {
01958 tk-=aBnd-mAlph;
01959 p2=tk*tk-mA2;
01960 if(p2>ap2m)
01961 {
01962 p2=ap2m;
01963 tk=sqrt(p2+mA2);
01964 }
01965 eMass=mAlph;
01966 bQPDG=aQPDG;
01967 rQPDG=AQPDG;
01968 }
01969 else if(PDG==pPDG)
01970 {
01971 tk-=pBnd-mProt;
01972 p2=tk*tk-mP2;
01973 if(p2>pp2m)
01974 {
01975 p2=pp2m;
01976 tk=sqrt(p2+mP2);
01977 }
01978 eMass=mProt;
01979 bQPDG=pQPDG;
01980 rQPDG=PQPDG;
01981 }
01982 else if(PDG==nPDG)
01983 {
01984 tk-=nBnd-mNeut;
01985 p2=tk*tk-mN2;
01986 #ifdef debug
01987 G4cout<<"G4QNucleus::EvaporateBaryon:np2="<<p2<<",np2m="<<np2m<<G4endl;
01988 #endif
01989 if(p2>np2m)
01990 {
01991 p2=np2m;
01992 tk=sqrt(p2+mN2);
01993 }
01994 eMass=mNeut;
01995 bQPDG=nQPDG;
01996 rQPDG=NQPDG;
01997 }
01998 else if(PDG==lPDG)
01999 {
02000 tk-=lBnd-mLamb;
02001 p2=tk*tk-mL2;
02002 if(p2>lp2m)
02003 {
02004 p2=lp2m;
02005 tk=sqrt(p2+mL2);
02006 }
02007 eMass=mLamb;
02008 bQPDG=lQPDG;
02009 rQPDG=LQPDG;
02010 }
02011 else G4cerr<<"***G4QNucleus::EvaporateBaryon: PDG="<<PDG<<G4endl;
02012 G4double rEn=totMass-tk;
02013 G4double rEn2=rEn*rEn;
02014 if (rEn2 > p2) rMass=sqrt(rEn2-p2);
02015 else rMass=0.0;
02016
02017
02018 G4bool nnCond = !nnFlag || (nnFlag && GSResNN+mNeut > rMass);
02019 G4bool npCond = !npFlag || (npFlag && GSResNP+mProt+PBarr > rMass);
02020 G4bool nlCond = !nlFlag || (nlFlag && GSResNL+mLamb > rMass);
02021 G4bool naCond = !naFlag || (naFlag && GSResNA+mAlph+ABarr > rMass);
02022 G4bool pnCond = !npFlag || (npFlag && GSResNP+mNeut > rMass);
02023 if(barf) pnCond = !npFlag || (npFlag && GSResNP+mNeut+PBarr > rMass);
02024 G4bool ppCond = !ppFlag || (ppFlag && GSResPP+mProt+PPBarr > rMass);
02025 if(barf) ppCond = !ppFlag || (ppFlag && GSResPP+mProt+SPPBarr > rMass);
02026 G4bool plCond = !plFlag || (plFlag && GSResPL+mLamb > rMass);
02027 if(barf) plCond = !plFlag || (plFlag && GSResPL+mLamb+PBarr > rMass);
02028 G4bool paCond = !paFlag || (paFlag && GSResPA+mAlph+APBarr > rMass);
02029 if(barf) paCond = !paFlag || (paFlag && GSResPA+mAlph+SAPBarr > rMass);
02030 G4bool lnCond = !nlFlag || (nlFlag && GSResNL+mNeut > rMass);
02031 G4bool lpCond = !plFlag || (plFlag && GSResPL+mProt+PBarr > rMass);
02032 G4bool llCond = !llFlag || (llFlag && GSResLL+mLamb > rMass);
02033 G4bool laCond = !laFlag || (laFlag && GSResLA+mAlph+ABarr > rMass);
02034 G4bool anCond = !naFlag || (naFlag && GSResNA+mNeut > rMass);
02035 if(barf) anCond = !naFlag || (naFlag && GSResNA+mNeut+ABarr > rMass);
02036 G4bool apCond = !paFlag || (paFlag && GSResPA+mProt+PABarr > rMass);
02037 if(barf) apCond = !paFlag || (paFlag && GSResPA+mProt+SAPBarr > rMass);
02038 G4bool alCond = !laFlag || (laFlag && GSResLA+mLamb > rMass);
02039 if(barf) alCond = !laFlag || (laFlag && GSResLA+mLamb+ABarr > rMass);
02040 G4bool aaCond = !aaFlag || (aaFlag && GSResAA+mAlph+AABarr > rMass);
02041 if(barf) aaCond = !aaFlag || (aaFlag && GSResAA+mAlph+SAABarr > rMass);
02042 #ifdef debug
02043 G4cout<<"G4QNucl::EvaB:"<<PDG<<", E="<<tk<<", rM="<<rMass<<", ";
02044 if(PDG==pPDG) G4cout<<"PN="<<GSResNP+mNeut<<"("<<pnCond<<"),PP="
02045 <<GSResPP+mProt+PPBarr<<"("<<ppCond<<"),PL="
02046 <<GSResPL+mLamb<<"("<<plCond<<"),PA="
02047 <<GSResPA+mAlph+APBarr<<"("<<paCond;
02048 else if(PDG==nPDG) G4cout<<"NN="<<GSResNN+mNeut<<"("<<nnCond<<"),NP="
02049 <<GSResNP+mProt+PBarr<<"("<<npCond<<"),NL="
02050 <<GSResNL+mLamb<<"("<<nlCond<<"),NA="
02051 <<GSResNA+mAlph+ABarr<<"("<<naCond;
02052 else if(PDG==lPDG) G4cout<<"LN="<<GSResNL+mNeut<<"("<<lnCond<<"),LP="
02053 <<GSResPL+mProt+PBarr<<"("<<lpCond<<"),LL="
02054 <<GSResLL+mLamb<<"("<<llCond<<"),LA="
02055 <<GSResLA+mAlph+ABarr<<"("<<laCond;
02056 else if(PDG==aPDG) G4cout<<"AN="<<GSResNA+mNeut<<"("<<anCond<<"),AP="
02057 <<GSResPA+mProt+PABarr<<"("<<apCond<<"),AL="
02058 <<GSResLA+mLamb<<"("<<alCond<<"),AA="
02059 <<GSResAA+mAlph+AABarr<<"("<<aaCond;
02060 G4cout<<")"<<G4endl;
02061 #endif
02062 three=false;
02063
02064
02065 if(PDG==pPDG&&(pnCond&&ppCond&&plCond&&paCond))
02066 {
02067 #ifdef debug
02068 G4cout<<"G4QN::EB:*p*: n="<<pnCond<<",p="<<ppCond<<",l="<<plCond<<",a="<<paCond
02069 <<G4endl;
02070 #endif
02071 fMass=mProt;
02072 fQPDG=pQPDG;
02073 G4double nLim=0.;
02074 if(N&&GSResNP!=GSMass&&fMass+PBarr+mNeut+GSResNP<totMass)
02075 {
02076 if(barf) nLim+=(N+N)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
02077 else nLim+=(N+N)*pow(totMass-mNeut-mProt-GSResNP,2);
02078 }
02079 G4double zLim=nLim;
02080 if(Z>1&&GSResPP!=GSMass&&fMass+mProt+SPPBarr+GSResPP<totMass)
02081 {
02082 if(barf) zLim+=(Z-1)*pow(totMass-mProt-mProt-SPPBarr-GSResPP,2);
02083 else zLim+=(Z-1)*pow(totMass-mProt-mProt-GSResPP,2);
02084 }
02085 G4double sLim=zLim;
02086 if(S&&GSResPL!=GSMass&&fMass+PBarr+mLamb+GSResPL<totMass)
02087 {
02088 if(barf) sLim+=(S+S)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
02089 else sLim+=(S+S)*pow(totMass-mProt-mLamb-GSResPL,2);
02090 }
02091 G4double aLim=sLim;
02092 if(evalph&&Z>2&&N>1&&a>4&&GSResPL!=GSMass&&fMass+SAPBarr+mAlph+GSResPA<totMass)
02093 {
02094 if(barf) aLim+=pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2)*evalph*
02095 (Z-1)*(Z-2)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
02096 else aLim+=pow(totMass-mProt-mAlph-GSResPA,2)*evalph*(Z-1)*(Z-2)*N*(N-1)
02097 *12/(a-2)/(a-3)/(a-4);
02098 }
02099 G4double r = aLim*G4UniformRand();
02100 #ifdef debug
02101 G4cout<<"G4QNuc::EvaB:p, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="
02102 <<aLim<<G4endl;
02103 #endif
02104 three=true;
02105 if(!aLim) three=false;
02106 else if(r>sLim)
02107 {
02108 eMass = mAlph;
02109 dbQPDG= PAQPDG;
02110 rMass = GSResPA;
02111 rQPDG = paQPDG;
02112 #ifdef debug
02113 G4cout<<"G4QNucleus::EvaporateBary: P+A"<<G4endl;
02114 #endif
02115 }
02116 else if(zLim<sLim&&r>zLim&&r<=sLim)
02117 {
02118 eMass = mLamb;
02119 dbQPDG= PLQPDG;
02120 rMass = GSResPL;
02121 rQPDG = plQPDG;
02122 #ifdef debug
02123 G4cout<<"G4QNucleus::EvaporateBary: P+L"<<G4endl;
02124 #endif
02125 }
02126 else if(nLim<zLim&&r>nLim&&r<=zLim)
02127 {
02128 eMass = mProt;
02129 dbQPDG= PPQPDG;
02130 rMass = GSResPP;
02131 rQPDG = ppQPDG;
02132 #ifdef debug
02133 G4cout<<"G4QNucleus::EvaporateBary: P+P"<<G4endl;
02134 #endif
02135 }
02136 else if(r<=nLim)
02137 {
02138 eMass = mNeut;
02139 dbQPDG= NPQPDG;
02140 rMass = GSResNP;
02141 rQPDG = npQPDG;
02142 #ifdef debug
02143 G4cout<<"G4QNucleus::EvaporateBary: P+N"<<G4endl;
02144 #endif
02145 }
02146 else three=false;
02147 }
02148 else if(PDG==nPDG&&(nnCond&&npCond&&nlCond&&naCond))
02149 {
02150 #ifdef debug
02151 G4cout<<"G4QN::EB:*n*: n="<<nnCond<<",p="<<npCond<<",l="<<nlCond<<",a="<<naCond
02152 <<G4endl;
02153 #endif
02154 fMass=mNeut;
02155 fQPDG=nQPDG;
02156 G4double nLim=0.;
02157 if(N>1&&GSResNN!=GSMass&&fMass+mNeut+GSResNN<totMass)
02158 nLim+=(N-1)*pow(totMass-mNeut-mNeut-GSResNN,2);
02159 G4double zLim=nLim;
02160 if(Z&&GSResNP!=GSMass&&fMass+mProt+PBarr+GSResNP<totMass)
02161 {
02162 if(barf) zLim+=(Z+Z)*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
02163 else zLim+=(Z+Z)*pow(totMass-mNeut-mProt-GSResNP,2);
02164 }
02165 G4double sLim=zLim;
02166 if(S&&GSResNL!=GSMass&&fMass+mLamb+GSResNL<totMass)
02167 sLim+=(S+S)*pow(totMass-mNeut-mLamb-GSResNL,2);
02168 G4double aLim=sLim;
02169 if(evalph&&Z>1&&N>2&&a>4&&GSResNA!=GSMass&&fMass+mAlph+ABarr+GSResNA<totMass)
02170 {
02171 if(barf) aLim+=pow(totMass-mNeut-mAlph-ABarr-GSResNA,2)*
02172 evalph*Z*(Z-1)*(N-1)*(N-2)*12/(a-2)/(a-3)/(a-4);
02173 else aLim+=pow(totMass-mNeut-mAlph-GSResNA,2)*
02174 evalph*Z*(Z-1)*(N-1)*(N-2)*12/(a-2)/(a-3)/(a-4);
02175 }
02176 G4double r = aLim*G4UniformRand();
02177 #ifdef debug
02178 G4cout<<"G4QN::EB:n, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
02179 <<G4endl;
02180 #endif
02181 three=true;
02182 if(!aLim) three=false;
02183 else if(r>sLim)
02184 {
02185 eMass = mAlph;
02186 dbQPDG= NAQPDG;
02187 rMass = GSResNA;
02188 rQPDG = naQPDG;
02189 #ifdef debug
02190 G4cout<<"G4QNucleus::EvaporateBary: N+A"<<G4endl;
02191 #endif
02192 }
02193 else if(zLim<sLim&&r>zLim&&r<=sLim)
02194 {
02195 eMass = mLamb;
02196 dbQPDG= NLQPDG;
02197 rMass = GSResNL;
02198 rQPDG = nlQPDG;
02199 #ifdef debug
02200 G4cout<<"G4QNucleus::EvaporateBary: N+L"<<G4endl;
02201 #endif
02202 }
02203 else if(nLim<zLim&&r>nLim&&r<=zLim)
02204 {
02205 eMass = mProt;
02206 dbQPDG= NPQPDG;
02207 rMass = GSResNP;
02208 rQPDG = npQPDG;
02209 #ifdef debug
02210 G4cout<<"G4QNucleus::EvaporateBary: N+P"<<G4endl;
02211 #endif
02212 }
02213 else if(r<=nLim)
02214 {
02215 eMass = mNeut;
02216 dbQPDG= NNQPDG;
02217 rMass = GSResNN;
02218 rQPDG = nnQPDG;
02219 #ifdef debug
02220 G4cout<<"G4QNucleus::EvaporateBary: N+N"<<G4endl;
02221 #endif
02222 }
02223 else three=false;
02224 }
02225 else if(PDG==lPDG&&(lnCond&&lpCond&&llCond&&laCond))
02226 {
02227 #ifdef debug
02228 G4cout<<"G4QN::EB:*l*: n="<<lnCond<<",p="<<lpCond<<",l="<<llCond<<",a="<<laCond
02229 <<G4endl;
02230 #endif
02231 fMass=mLamb;
02232 fQPDG=lQPDG;
02233 G4double nLim=0.;
02234 if(N&&GSResNL!=GSMass&&fMass+mNeut+GSResNL<totMass)
02235 nLim+=(N+N)*pow(totMass-mNeut-mLamb-GSResNL,2);
02236 G4double zLim=nLim;
02237 if(Z&&GSResPL!=GSMass&&fMass+mProt+PBarr+GSResPL<totMass)
02238 {
02239 if(barf) zLim+=(Z+Z)*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
02240 else zLim+=(Z+Z)*pow(totMass-mProt-mLamb-GSResPL,2);
02241 }
02242 G4double sLim=zLim;
02243 if(S>1&&GSResLL!=GSMass&&fMass+mLamb+GSResLL<totMass)
02244 sLim+=(S-1)*pow(totMass-mLamb-mLamb-GSResLL,2);
02245 G4double aLim=sLim;
02246 if(evalph&&Z>1&&N>1&&a>4&&GSResLA!=GSMass&&fMass+mAlph+ABarr+GSResLA<totMass)
02247 {
02248 if(barf) aLim+=pow(totMass-mLamb-mAlph-ABarr-GSResLA,2)*
02249 evalph*Z*(Z-1)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
02250 else aLim+=pow(totMass-mLamb-mAlph-GSResLA,2)*
02251 evalph*Z*(Z-1)*N*(N-1)*12/(a-2)/(a-3)/(a-4);
02252 }
02253 G4double r = aLim*G4UniformRand();
02254 #ifdef debug
02255 G4cout<<"G4QN::EB:l, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
02256 <<G4endl;
02257 #endif
02258 three=true;
02259 if(!aLim) three=false;
02260 else if(r>sLim)
02261 {
02262 eMass = mAlph;
02263 dbQPDG= LAQPDG;
02264 rMass = GSResLA;
02265 rQPDG = laQPDG;
02266 #ifdef debug
02267 G4cout<<"G4QNucleus::EvaporateBary: L+A"<<G4endl;
02268 #endif
02269 }
02270 else if(zLim<sLim&&r>zLim&&r<=sLim)
02271 {
02272 eMass = mLamb;
02273 dbQPDG= LLQPDG;
02274 rMass = GSResLL;
02275 rQPDG = llQPDG;
02276 #ifdef debug
02277 G4cout<<"G4QNucleus::EvaporateBary: L+L"<<G4endl;
02278 #endif
02279 }
02280 else if(nLim<zLim&&r>nLim&&r<=zLim)
02281 {
02282 eMass = mProt;
02283 dbQPDG= PLQPDG;
02284 rMass = GSResPL;
02285 rQPDG = plQPDG;
02286 #ifdef debug
02287 G4cout<<"G4QNucleus::EvaporateBary: L+P"<<G4endl;
02288 #endif
02289 }
02290 else if(r<=nLim)
02291 {
02292 eMass = mNeut;
02293 dbQPDG= NLQPDG;
02294 rMass = GSResNL;
02295 rQPDG = nlQPDG;
02296 #ifdef debug
02297 G4cout<<"G4QNucleus::EvaporateBary: L+N"<<G4endl;
02298 #endif
02299 }
02300 else three=false;
02301 }
02302 else if(PDG==aPDG&&(anCond&&apCond&&alCond&&aaCond))
02303 {
02304 #ifdef debug
02305 G4cout<<"G4QN::EB:*a*: n="<<anCond<<",p="<<apCond<<",l="<<alCond<<",a="<<aaCond
02306 <<G4endl;
02307 #endif
02308 fMass=mAlph;
02309 fQPDG=aQPDG;
02310 G4double nLim=0.;
02311 if(N>2&&GSResNA!=GSMass&&fMass+mNeut+ABarr+GSResNA<totMass)
02312 {
02313 if(barf) nLim+=(N-2)*pow(totMass-mNeut-mAlph-ABarr-GSResNA,2);
02314 else nLim+=(N-2)*pow(totMass-mNeut-mAlph-GSResNA,2);
02315 }
02316 G4double zLim=nLim;
02317 if(Z>2&&GSResPA!=GSMass&&fMass+mProt+SAPBarr+GSResPA<totMass)
02318 {
02319 if(barf) zLim+=(Z-2)*pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2);
02320 else zLim+=(Z-2)*pow(totMass-mProt-mAlph-GSResPA,2);
02321 }
02322 G4double sLim=zLim;
02323 if(S&&GSResLA!=GSMass&&fMass+mLamb+ABarr+GSResLA<totMass)
02324 {
02325 if(barf) sLim+=S*pow(totMass-mLamb-mAlph-ABarr-GSResLA,2);
02326 else sLim+=S*pow(totMass-mLamb-mAlph-GSResLA,2);
02327 }
02328 G4double aLim=sLim;
02329 if(evalph&&Z>3&&N>3&&a>7&&GSResAA!=GSMass&&fMass+mAlph+SAABarr+GSResAA<totMass)
02330 {
02331 if(barf) aLim+=pow(totMass-mAlph-mAlph-SAABarr-GSResAA,2)*
02332 evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*12/(a-5)/(a-6)/(a-7);
02333 else aLim+=pow(totMass-mAlph-mAlph-GSResAA,2)*
02334 evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*12/(a-5)/(a-6)/(a-7);
02335 }
02336 G4double r = aLim*G4UniformRand();
02337 #ifdef debug
02338 G4cout<<"G4QN::EB:a, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim
02339 <<G4endl;
02340 #endif
02341 three=true;
02342 if(!aLim) three=false;
02343 else if(r>sLim)
02344 {
02345 eMass = mAlph;
02346 dbQPDG= AAQPDG;
02347 rMass = GSResAA;
02348 rQPDG = aaQPDG;
02349 #ifdef debug
02350 G4cout<<"G4QNucleus::EvaporateBary: A+A"<<G4endl;
02351 #endif
02352 }
02353 else if(zLim<sLim&&r>zLim&&r<=sLim)
02354 {
02355 eMass = mLamb;
02356 dbQPDG= LAQPDG;
02357 rMass = GSResLA;
02358 rQPDG = laQPDG;
02359 #ifdef debug
02360 G4cout<<"G4QNucleus::EvaporateBary: A+L"<<G4endl;
02361 #endif
02362 }
02363 else if(nLim<zLim&&r>nLim&&r<=zLim)
02364 {
02365 eMass = mProt;
02366 dbQPDG= PAQPDG;
02367 rMass = GSResPA;
02368 rQPDG = paQPDG;
02369 #ifdef debug
02370 G4cout<<"G4QNucleus::EvaporateBary: A+P"<<G4endl;
02371 #endif
02372 }
02373 else if(r<=nLim)
02374 {
02375 eMass = mNeut;
02376 dbQPDG= NAQPDG;
02377 rMass = GSResNA;
02378 rQPDG = naQPDG;
02379 #ifdef debug
02380 G4cout<<"G4QNucleus::EvaporateBary: A+N"<<G4endl;
02381 #endif
02382 }
02383 else three=false;
02384 }
02385 else three=false;
02386 if(rMass<1600.)
02387 {
02388 if (rQPDG==pQPDG)rMass=mProt;
02389 else if(rQPDG==nQPDG)rMass=mNeut;
02390 else if(rQPDG==lQPDG)rMass=mLamb;
02391 }
02392 #ifdef debug
02393 G4cout<<"G4QNucleus::EvaporateBary:evaBar="<<eMass<<bQPDG<<",resN="<<rMass<<rQPDG
02394 <<",secB="<<fMass<<",three="<<three<<G4endl;
02395 #endif
02396 }
02397 }
02398 else
02399 {
02400 G4double nLim=0.;
02401 if(nFlag&&mNeut+GSResNn<totMass)
02402 {
02403 G4double ken=totMass-mNeut-GSResNn;
02404 nLim+=N*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
02405 }
02406 G4double zLim=nLim;
02407 if(pFlag&&mProt+PBarr+GSResNp<totMass)
02408 {
02409 G4double ken=totMass-mProt-GSResNp;
02410 if(barf) ken-=PBarr;
02411 zLim+=Z*CoulBarPenProb(PBarr,ken,1,1)*sqrt(ken);
02412 }
02413 G4double sLim=zLim;
02414 if(lFlag&&mLamb+GSResNl<totMass)
02415 {
02416 G4double ken=totMass-mLamb-GSResNl;
02417 sLim+=S*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
02418 }
02419 G4double aLim=sLim;
02420 if(evalph&&aFlag&&mAlph+GSResNa+ABarr<totMass)
02421 {
02422 G4double ken=totMass-mAlph-GSResNa;
02423 if(barf) ken-=ABarr;
02424 aLim+=CoulBarPenProb(ABarr,ken,2,4)*sqrt(ken)*evalph*Z*(Z-1)*N*(N-1)
02425 *6/a1/(a-2)/(a-3);
02426 }
02427 G4double r = aLim*G4UniformRand();
02428 #ifdef debug
02429 G4cout<<"G4QNucl::EvapBar:2Decay r="<<r<<",nLim="<<nLim<<",zLim="<<zLim<<",sLim="
02430 <<sLim<<",nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl;
02431 #endif
02432 if (aFlag&&r>sLim)
02433 {
02434 bQPDG=aQPDG;
02435 eMass=mAlph;
02436 rQPDG=AQPDG;
02437 rMass=GSResNa;
02438 }
02439 else if(lFlag&&r>=zLim&&r<=sLim&&zLim<sLim)
02440 {
02441 bQPDG=lQPDG;
02442 eMass=mLamb;
02443 rQPDG=LQPDG;
02444 rMass=GSResNl;
02445 }
02446 else if(nFlag&&r>=nLim&&r<=zLim&&nLim<zLim)
02447 {
02448 bQPDG=pQPDG;
02449 eMass=mProt;
02450 rQPDG=PQPDG;
02451 rMass=GSResNp;
02452 }
02453 else if(pFlag&&r<nLim)
02454 {
02455 bQPDG=nQPDG;
02456 eMass=mNeut;
02457 rQPDG=NQPDG;
02458 rMass=GSResNn;
02459 }
02460 else
02461 {
02462 #ifdef debug
02463 G4cout<<"G4QNucleus::EvaporateBaryon: Photon #2-B#, dM="<<totMass-GSMass<<G4endl;
02464 #endif
02465 bQPDG=gQPDG;
02466 rQPDG=GetQPDG();
02467 eMass=0.;
02468 rMass=GSMass;
02469 }
02470 #ifdef debug
02471 G4cout<<"G4QNucl::EvaporateBaryon: b="<<eMass<<bQPDG<<",r="<<rMass<<rQPDG<<G4endl;
02472 #endif
02473 }
02474 if(three)
02475 {
02476 #ifdef debug
02477 G4cout<<"G4QNucl::EvaporateBaryon:Decay in 3 particles"<<G4endl;
02478 #endif
02479 h1mom=G4LorentzVector(0.,0.,0.,eMass);
02480 h2mom=G4LorentzVector(0.,0.,0.,rMass);
02481 h3mom=G4LorentzVector(0.,0.,0.,fMass);
02482 if(!DecayIn3(h1mom,h2mom,h3mom))
02483 {
02484 #ifdef debug
02485 G4cout<<"*G4QNucl::EvaporateBaryon:Decay M="<<totMass<<",b="<<eMass<<bQPDG
02486 <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
02487 #endif
02488 return false;
02489 }
02490 h1mom+=h3mom;
02491 bQPDG=dbQPDG;
02492 }
02493 else
02494 {
02495 if(eMass+rMass<totMass&&cntr<cntm)
02496 {
02497 #ifdef debug
02498 G4cout<<"G4QN::EvaB:eM="<<eMass<<"+rM="<<rMass<<" ="<<eMass+rMass<<" < "<<totMass
02499 <<",c="<<cntr<<" < cm="<<cntm<<", bPDG="<<bQPDG<<", rPDG="<<rQPDG<<G4endl;
02500 #endif
02501 if(rMass<1600.)
02502 {
02503 if (rQPDG==pQPDG)rMass=mProt;
02504 else if(rQPDG==nQPDG)rMass=mNeut;
02505 else if(rQPDG==lQPDG)rMass=mLamb;
02506 }
02507 h1mom=G4LorentzVector(0.,0.,0.,eMass);
02508 h2mom=G4LorentzVector(0.,0.,0.,rMass);
02509 }
02510 else if(totMass>mNeut+GSResNn)
02511 {
02512 #ifdef debug
02513 G4cout<<"G4QNucl::EvaporateBaryon: Neutron , dM="<<totMass-GSResNn-mNeut<<G4endl;
02514 #endif
02515 bQPDG=nQPDG;
02516 rQPDG=NQPDG;
02517 h1mom=G4LorentzVector(0.,0.,0.,mNeut);
02518 h2mom=G4LorentzVector(0.,0.,0.,GSResNn);
02519 }
02520 else if(totMass>mProt+PBarr+GSResNp)
02521 {
02522 #ifdef debug
02523 G4cout<<"G4QNucl::EvaporateBaryon: Proton , dM="<<totMass-GSResNp-mProt<<G4endl;
02524 #endif
02525 bQPDG=pQPDG;
02526 rQPDG=PQPDG;
02527 h1mom=G4LorentzVector(0.,0.,0.,mProt);
02528 h2mom=G4LorentzVector(0.,0.,0.,GSResNp);
02529 }
02530 else if(totMass>mAlph+ABarr+GSResNa)
02531 {
02532 #ifdef debug
02533 G4cout<<"G4QNucl::EvaporateBaryon: Alpha , dM="<<totMass-GSResNa-mAlph<<G4endl;
02534 #endif
02535 bQPDG=aQPDG;
02536 rQPDG=AQPDG;
02537 h1mom=G4LorentzVector(0.,0.,0.,mAlph);
02538 h2mom=G4LorentzVector(0.,0.,0.,GSResNa);
02539 }
02540 else if(totMass>GSMass)
02541 {
02542 #ifdef debug
02543 G4cout<<"G4QNucl::EvaporateBaryon:Photon ### 2 ###, dM="<<totMass-GSMass<<G4endl;
02544 #endif
02545 bQPDG=gQPDG;
02546 rQPDG=GetQPDG();
02547 h1mom=G4LorentzVector(0.,0.,0.,0.);
02548 h2mom=G4LorentzVector(0.,0.,0.,GSMass);
02549 }
02550 else
02551 {
02552 G4cerr<<"***G4QNucl::EvaporateBaryon: Cann't evaporate even gamma (1)"<<G4endl;
02553 return false;
02554 }
02555 }
02556 }
02557 else
02558 {
02559 if(secB)
02560
02561 {
02562 #ifdef debug
02563 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in 2 baryons"<<G4endl;
02564 #endif
02565 G4bool tpd=true;
02566
02567 G4double alp=0.;
02568 if(aSecF)alp=evalph*Z*(Z-1)*N*(N-1)*10/(a-2)/(a-3)/(a-4);
02569 G4double nnLim=0.;
02570 if(nnFlag&&totMass>mNeut+mNeut+GSResNN)
02571 nnLim+=N*(N-1)*pow(totMass-mNeut-mNeut-GSResNN,2);
02572 G4double nzLim=nnLim;
02573 if(npFlag&&totMass>mNeut+mProt+PBarr+GSResNP)
02574 {
02575 if(barf) nzLim+=2*N*Z*pow(totMass-mNeut-mProt-PBarr-GSResNP,2);
02576 else nzLim+=2*N*Z*pow(totMass-mNeut-mProt-GSResNP,2);
02577 }
02578 G4double zzLim=nzLim;
02579 if(ppFlag&&totMass>mProt+mProt+SPPBarr+GSResPP)
02580 {
02581 if(barf) zzLim+=Z*(Z-1)*pow(totMass-mProt-mProt-SPPBarr-GSResPP,2);
02582 else zzLim+=Z*(Z-1)*pow(totMass-mProt-mProt-GSResPP,2);
02583 }
02584 G4double nlLim=zzLim;
02585 if(nlFlag&&totMass>mNeut+mLamb+GSResNL)
02586 nlLim+=2*N*S*pow(totMass-mNeut-mLamb-GSResNL,2);
02587 G4double zlLim=nlLim;
02588 if(plFlag&&totMass>mProt+PBarr+mLamb+GSResPL)
02589 {
02590 if(barf) zlLim+=2*Z*S*pow(totMass-mProt-mLamb-PBarr-GSResPL,2);
02591 else zlLim+=2*Z*S*pow(totMass-mProt-mLamb-GSResPL,2);
02592 }
02593 G4double llLim=zlLim;
02594 if(llFlag&&totMass>mLamb+mLamb+GSResLL)
02595 llLim+=S*(S-1)*pow(totMass-mLamb-mLamb-GSResLL,2);
02596 G4double naLim=llLim;
02597 if(naFlag&&totMass>mNeut+mAlph+ABarr+GSResNA)
02598 {
02599 if(barf) naLim+=(N-3)*alp*pow(totMass-mNeut-mAlph-ABarr-GSResNA,2);
02600 else naLim+=(N-3)*alp*pow(totMass-mNeut-mAlph-GSResNA,2);
02601 }
02602 G4double zaLim=naLim;
02603 if(paFlag&&totMass>mProt+SAPBarr+mAlph+GSResPA)
02604 {
02605 if(barf) zaLim+=(Z-3)*alp*pow(totMass-mProt-mAlph-SAPBarr-GSResPA,2);
02606 else zaLim+=(Z-3)*alp*pow(totMass-mProt-mAlph-GSResPA,2);
02607 }
02608 G4double laLim=zaLim;
02609 if(laFlag&&totMass>mLamb+mAlph+ABarr+GSResLA)
02610 {
02611 if(barf) laLim+=S*alp*pow(totMass-mLamb-mAlph-ABarr-GSResLA,2);
02612 else laLim+=S*alp*pow(totMass-mLamb-mAlph-GSResLA,2);
02613 }
02614 G4double aaLim=laLim;
02615 if(evalph&&aaFlag&&totMass>mAlph+mAlph+SAABarr+GSResAA)
02616 {
02617 if(barf) aaLim+=alp*pow(totMass-mAlph-mAlph-SAABarr-GSResAA,2)*
02618 evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*7/(a-5)/(a-6)/(a-7);
02619 else aaLim+=alp*pow(totMass-mAlph-mAlph-GSResAA,2)*
02620 evalph*(Z-2)*(Z-3)*(N-2)*(N-3)*7/(a-5)/(a-6)/(a-7);
02621 }
02622 G4double r = aaLim*G4UniformRand();
02623 if (aaLim&&laLim<r)
02624 {
02625 dbQPDG= AAQPDG;
02626 eMass=mAlph;
02627 fMass=mAlph;
02628 rQPDG=aaQPDG;
02629 rMass=GSResAA;
02630 #ifdef debug
02631 G4cout<<"G4QNuc::EvapBaryon: A+A, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02632 #endif
02633 }
02634 else if(aaLim&&zaLim<r&&r<laLim)
02635 {
02636 dbQPDG= LAQPDG;
02637 eMass=mAlph;
02638 fMass=mLamb;
02639 rQPDG=laQPDG;
02640 rMass=GSResLA;
02641 #ifdef debug
02642 G4cout<<"G4QNuc::EvapBaryon: A+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02643 #endif
02644 }
02645 else if(aaLim&&naLim<r&&r<zaLim)
02646 {
02647 dbQPDG= PAQPDG;
02648 eMass=mAlph;
02649 fMass=mProt;
02650 rQPDG=paQPDG;
02651 rMass=GSResPA;
02652 #ifdef debug
02653 G4cout<<"G4QNuc::EvapBaryon: A+P, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02654 #endif
02655 }
02656 else if(aaLim&&llLim<r&&r<naLim)
02657 {
02658 dbQPDG= NAQPDG;
02659 eMass=mAlph;
02660 fMass=mNeut;
02661 rQPDG=naQPDG;
02662 rMass=GSResNA;
02663 #ifdef debug
02664 G4cout<<"G4QNuc::EvapBaryon: A+N, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02665 #endif
02666 }
02667 else if(aaLim&&zlLim<r&&r<llLim)
02668 {
02669 dbQPDG= LLQPDG;
02670 eMass=mLamb;
02671 fMass=mLamb;
02672 rQPDG=llQPDG;
02673 rMass=GSResLL;
02674 #ifdef debug
02675 G4cout<<"G4QNuc::EvapBaryon: L+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02676 #endif
02677 }
02678 else if(aaLim&&nlLim<r&&r<zlLim)
02679 {
02680 dbQPDG= PLQPDG;
02681 eMass=mLamb;
02682 fMass=mProt;
02683 rQPDG=plQPDG;
02684 rMass=GSResPL;
02685 #ifdef debug
02686 G4cout<<"G4QNuc::EvapBaryon: L+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02687 #endif
02688 }
02689 else if(aaLim&&zzLim<r&&r<nlLim)
02690 {
02691 dbQPDG= NLQPDG;
02692 eMass=mLamb;
02693 fMass=mNeut;
02694 rQPDG=nlQPDG;
02695 rMass=GSResNL;
02696 #ifdef debug
02697 G4cout<<"G4QNuc::EvapBaryon: L+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02698 #endif
02699
02700 }
02701 else if(aaLim&&nzLim<r&&r<zzLim)
02702 {
02703 dbQPDG= PPQPDG;
02704 eMass=mProt;
02705 fMass=mProt;
02706 rQPDG=ppQPDG;
02707 rMass=GSResPP;
02708 #ifdef debug
02709 G4cout<<"G4QNuc::EvapBaryon: p+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02710 #endif
02711 }
02712 else if(aaLim&&nnLim<r&&r<nzLim)
02713 {
02714 dbQPDG= NPQPDG;
02715 eMass=mNeut;
02716 fMass=mProt;
02717 rQPDG=npQPDG;
02718 rMass=GSResNP;
02719 #ifdef debug
02720 G4cout<<"G4QNuc::EvapBaryon: n+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02721 #endif
02722 }
02723 else if(aaLim&&r<nnLim)
02724 {
02725 dbQPDG= NNQPDG;
02726 eMass=mNeut;
02727 fMass=mNeut;
02728 rQPDG=nnQPDG;
02729 rMass=GSResNN;
02730 #ifdef debug
02731 G4cout<<"G4QNuc::EvapBaryon: n+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl;
02732 #endif
02733 }
02734
02735 else if(nFlag)
02736 {
02737 #ifdef debug
02738 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in neutron ###"<<G4endl;
02739 #endif
02740 tpd=false;
02741 bQPDG=nQPDG;
02742 rQPDG=NQPDG;
02743 eMass=mNeut;
02744 rMass=GSResNn;
02745 }
02746 else if(pFlag)
02747 {
02748 #ifdef debug
02749 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in proton ###"<<G4endl;
02750 #endif
02751 tpd=false;
02752 bQPDG=pQPDG;
02753 rQPDG=PQPDG;
02754 eMass=mProt;
02755 rMass=GSResNp;
02756 }
02757 else if(aFlag)
02758 {
02759 #ifdef debug
02760 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in alpha ###"<<G4endl;
02761 #endif
02762 tpd=false;
02763 bQPDG=aQPDG;
02764 rQPDG=AQPDG;
02765 eMass=mAlph;
02766 rMass=GSResNa;
02767 }
02768 else if(lFlag)
02769 {
02770 #ifdef debug
02771 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in Lambda ###"<<G4endl;
02772 #endif
02773 tpd=false;
02774 bQPDG=lQPDG;
02775 rQPDG=LQPDG;
02776 eMass=mLamb;
02777 rMass=GSResNl;
02778 }
02779 else
02780 {
02781 #ifdef debug
02782 G4cout<<"G4QNuc::EvaporBaryon: Photon ### 3-Big ###,dM="<<totMass-GSMass<<G4endl;
02783 #endif
02784 tpd=false;
02785 bQPDG=gQPDG;
02786 rQPDG=GetQPDG();
02787 eMass=0.;
02788 rMass=GSMass;
02789 }
02790 if(tpd)
02791 {
02792 h1mom=G4LorentzVector(0.,0.,0.,eMass);
02793 h2mom=G4LorentzVector(0.,0.,0.,rMass);
02794 h3mom=G4LorentzVector(0.,0.,0.,fMass);
02795 if(!DecayIn3(h1mom,h2mom,h3mom))
02796 {
02797 #ifdef debug
02798 G4cout<<"*G4QNucl::EvaporateBaryon:Decay M="<<totMass<<",b="<<eMass<<bQPDG
02799 <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl;
02800 #endif
02801 return false;
02802 }
02803 h1mom+=h3mom;
02804 bQPDG=dbQPDG;
02805 #ifdef debug
02806 G4double sma=h1mom.m();
02807 G4double dma=sma-eMass-fMass;
02808 G4cout<<"G4QNuc::EvapBar:s="<<sma<<",e="<<eMass<<",f="<<fMass<<",d="<<dma<<",rM="
02809 <<rMass<<G4endl;
02810 #endif
02811 }
02812 else
02813 {
02814 if(rMass<1600.)
02815 {
02816 if (rQPDG==pQPDG)rMass=mProt;
02817 else if(rQPDG==nQPDG)rMass=mNeut;
02818 else if(rQPDG==lQPDG)rMass=mLamb;
02819 }
02820 h1mom=G4LorentzVector(0.,0.,0.,eMass);
02821 h2mom=G4LorentzVector(0.,0.,0.,rMass);
02822 if(!DecayIn2(h1mom,h2mom))
02823 {
02824 #ifdef debug
02825 G4cout<<"***G4QNucleus::EvaporateBaryon: Emergency Decay M="<<totMass<<",b="
02826 <<bQPDG<<h1->GetQC()<<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl;
02827 #endif
02828 return false;
02829 }
02830 h1->SetQPDG(bQPDG);
02831 h2->SetQPDG(rQPDG);
02832 h1->Set4Momentum(h1mom);
02833 h2->Set4Momentum(h2mom);
02834 #ifdef debug
02835 G4cout<<"G4QNuc::EvapBaryon: Emergency decay is done for b="<<bQPDG<<h1->GetQC()
02836 <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
02837 #endif
02838 return true;
02839 }
02840 }
02841 else
02842 {
02843 #ifdef debug
02844 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in Baryon+Resid"<<G4endl;
02845 #endif
02846
02847 G4double nLim=0.;
02848 if(nFlag&&mNeut+GSResNn<totMass)
02849 {
02850 G4double ken=totMass-mNeut-GSResNn;
02851 nLim+=N*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
02852 }
02853 G4double zLim=nLim;
02854 if(pFlag&&mProt+PBarr+GSResNp<totMass)
02855 {
02856 G4double ken=totMass-mProt-GSResNp;
02857 if(barf) ken-=PBarr;
02858 zLim+=Z*CoulBarPenProb(PBarr,ken,1,1)*sqrt(ken);
02859 }
02860 G4double sLim=zLim;
02861 if(lFlag&&mLamb+GSResNl<totMass)
02862 {
02863 G4double ken=totMass-mLamb-GSResNl;
02864 sLim+=S*CoulBarPenProb(0.,ken,0,1)*sqrt(ken);
02865 }
02866 G4double aLim=sLim;
02867 if(aFlag&&mAlph+GSResNa+ABarr<totMass)
02868 {
02869 G4double ken=totMass-mAlph-GSResNa;
02870 if(barf) ken-=ABarr;
02871 aLim+=CoulBarPenProb(ABarr,ken,2,4)*sqrt(ken)*evalph*Z*(Z-1)*N*(N-1)
02872 *6/a1/(a-2)/(a-3);
02873 #ifdef debug
02874 G4cout<<"G4QNucleus::EvaporateBaryon:al="<<evalph<<",k="<<ken<<",P="
02875 <<CoulBarPenProb(ABarr,ken,2,4)<<G4endl;
02876 #endif
02877 }
02878 G4double r = aLim*G4UniformRand();
02879 #ifdef debug
02880 G4cout<<"G4QN::EB:DecIn2#2#r="<<r<<",nL="<<nLim<<",zL="<<zLim<<",sL="<<sLim<<",aL="
02881 <<aLim<<",nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl;
02882 #endif
02883 if (aFlag&&r>sLim)
02884 {
02885 bQPDG=aQPDG;
02886 eMass=mAlph;
02887 rQPDG=AQPDG;
02888 rMass=GSResNa;
02889 #ifdef debug
02890 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in A + rA="<<GSResNa+mAlph<<G4endl;
02891 #endif
02892 }
02893 else if(lFlag&&r>zLim&&r<sLim)
02894 {
02895 bQPDG=lQPDG;
02896 eMass=mLamb;
02897 rQPDG=LQPDG;
02898 rMass=GSResNl;
02899 #ifdef debug
02900 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in L + rA="<<GSResNl+mLamb<<G4endl;
02901 #endif
02902 }
02903 else if(pFlag&&r>nLim&&r<zLim)
02904 {
02905 bQPDG=pQPDG;
02906 eMass=mProt;
02907 rQPDG=PQPDG;
02908 rMass=GSResNp;
02909 #ifdef debug
02910 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in P + rA="<<GSResNp+mProt<<G4endl;
02911 #endif
02912 }
02913 else if(nFlag&&r<nLim)
02914 {
02915 bQPDG=nQPDG;
02916 eMass=mNeut;
02917 rQPDG=NQPDG;
02918 rMass=GSResNn;
02919 #ifdef debug
02920 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in N + rA="<<GSResNn+mNeut<<G4endl;
02921 #endif
02922 }
02923 else if(mProt+GSResNp<totMass)
02924 {
02925 #ifdef debug
02926 G4cout<<"G4QNucl::EvapBar: Emergency Proton, dM="<<totMass-GSResNp-mProt<<G4endl;
02927 #endif
02928 bQPDG=pQPDG;
02929 rQPDG=PQPDG;
02930 eMass=mProt;
02931 rMass=GSResNp;
02932 }
02933 else if(mAlph+GSResNa<totMass)
02934 {
02935 #ifdef debug
02936 G4cout<<"G4QNucl::EvapBar: Emergency Alpha, dM="<<totMass-GSResNa-mAlph<<G4endl;
02937 #endif
02938 bQPDG=aQPDG;
02939 rQPDG=AQPDG;
02940 eMass=mAlph;
02941 rMass=GSResNa;
02942 }
02943 else
02944 {
02945 #ifdef debug
02946 G4cout<<"G4QNuc::EvapBaryon: Photon ### 4-Big ###, dM="<<totMass-GSMass<<G4endl;
02947 #endif
02948 bQPDG=gQPDG;
02949 rQPDG=GetQPDG();
02950 eMass=0.;
02951 rMass=GSMass;
02952 }
02953 if(rMass<1600.)
02954 {
02955 if (rQPDG==pQPDG)rMass=mProt;
02956 else if(rQPDG==nQPDG)rMass=mNeut;
02957 else if(rQPDG==lQPDG)rMass=mLamb;
02958 }
02959 h1mom=G4LorentzVector(0.,0.,0.,eMass);
02960 h2mom=G4LorentzVector(0.,0.,0.,rMass);
02961 }
02962 }
02963 if(!DecayIn2(h1mom,h2mom))
02964 {
02965 #ifdef debug
02966 G4cout<<"*G4QNucleus::EvaporateBaryon: Decay M="<<totMass<<",b="<<bQPDG<<h1->GetQC()
02967 <<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl;
02968 #endif
02969 return false;
02970 }
02971 #ifdef debug
02972 G4cout<<"G4QN::EvaB: **RESULT** b="<<bQPDG<<h1mom<<", r="<<rQPDG<<h2mom<<G4endl;
02973 #endif
02974 h1->SetQPDG(bQPDG);
02975 h2->SetQPDG(rQPDG);
02976 h1->Set4Momentum(h1mom);
02977 h2->Set4Momentum(h2mom);
02978 #ifdef debug
02979 G4cout<<"G4QNucleus::EvaporateBaryon: Evaporation is done for b="<<bQPDG<<h1->GetQC()
02980 <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl;
02981 #endif
02982 return true;
02983 }
02984 else if(a==1)
02985 {
02986 #ifdef debug
02987 G4cerr<<"***G4QNucleus::EvaporateBaryon: ??? A=1"<<G4endl;
02988 #endif
02989 h1->SetQPDG(gQPDG);
02990 h1->Set4Momentum(G4LorentzVector(0.,0.,0.,0.));
02991 if (Z>0)
02992 {
02993 h2->SetQPDG(pQPDG);
02994 h2->Set4Momentum(G4LorentzVector(0.,0.,0.,mProt));
02995 }
02996 else if(N>0)
02997 {
02998 h2->SetQPDG(nQPDG);
02999 h2->Set4Momentum(G4LorentzVector(0.,0.,0.,mNeut));
03000 }
03001 else if(S>0)
03002 {
03003 h2->SetQPDG(lQPDG);
03004 h2->Set4Momentum(G4LorentzVector(0.,0.,0.,mLamb));
03005 }
03006 else return false;
03007 return true;
03008 }
03009 if(a<-2) G4cerr<<"***G4QNucleus::EvaporateBaryon: A="<<a<<G4endl;
03010 return false;
03011 }
03012
03013
03014
03015 G4int G4QNucleus::RandomizeBinom(G4double p,G4int aN)
03016 {
03017 G4double r = G4UniformRand();
03018 G4double d = 1.-p;
03019 if(d<=0.) return 0;
03020 G4double v = pow(d,aN);
03021 G4double s_value = v;
03022 if(r<s_value) return 0;
03023 G4int i=0;
03024 G4int j=aN+1;
03025 G4double f=p/d;
03026 while(r>s_value && i<aN)
03027 {
03028 j--;
03029 i++;
03030 v*=j*f/i;
03031 s_value+=v;
03032 }
03033 return i;
03034 }
03035
03036
03037 void G4QNucleus::InitCandidateVector(G4QCandidateVector& theQCandidates,
03038 G4int maxMes, G4int maxBar, G4int maxClst)
03039 {
03040 static const G4int nOfMesons =45;
03041 static const G4int nOfBaryons=72;
03042
03043 static G4int mesonPDG[nOfMesons] = {221,111,211,-211,311,321,-311,-321,331,
03044
03045 223,113,213,-213,313,323,-313,-323,333,
03046
03047 225,115,215,-215,315,325,-315,-325,335,
03048
03049 227,117,217,-217,317,327,-317,-327,337,
03050
03051 229,119,219,-219,319,329,-319,-329,339};
03052
03053 static G4int baryonPDG[nOfBaryons]={2112,-2112,2212,-2212,3122,-3122,3112,-3112,
03054
03055 3212,-3212,3222,-3222,3312,-3312,3322,-3322,
03056
03057 1114,-1114,2114,-2114,2214,-2214,2224,-2224,3114,-3114,
03058
03059 3214,-3214,3224,-3224,3314,-3314,3324,-3324,3334,-3334,
03060
03061 2116,-2116,2216,-2216,3126,-3126,3116,-3116,
03062
03063 3216,-3216,3226,-3226,3316,-3316,3326,-3326,
03064
03065 1118,-1118,2118,-2118,2218,-2218,2228,-2228,3118,-3118,
03066
03067 3218,-3218,3228,-3228,3318,-3318,3328,-3328,3338,-3338};
03068 G4int i=0;
03069 #ifdef debug
03070 G4int ind=0;
03071 #endif
03072 G4int iQC = theQCandidates.size();
03073 if(iQC) for(G4int jq=0; jq<iQC; jq++) delete theQCandidates[jq];
03074 theQCandidates.clear();
03075 if(maxMes>nOfMesons) maxMes=nOfMesons;
03076 if(maxMes>=0) for (i=0; i<maxMes; i++)
03077 {
03078 theQCandidates.push_back(new G4QCandidate(mesonPDG[i]));
03079 #ifdef debug
03080 G4cout<<"G4QNucleus::InitCandidateVector: "<<ind++<<", Meson # "<<i<<" with code = "
03081 <<mesonPDG[i]<<", QC="<<theQCandidates[i]->GetQC()<<" is initialized"<<G4endl;
03082 #endif
03083 }
03084 if(maxBar>nOfBaryons) maxBar=nOfBaryons;
03085 if(maxBar>=0) for (i=0; i<maxBar; i++)
03086 {
03087 #ifdef debug
03088 G4cout<<"G4QNucleus::InitCandidateVector: define PDG="<<baryonPDG[i]<<G4endl;
03089 #endif
03090 G4QCandidate* curBar=new G4QCandidate(baryonPDG[i]);
03091 #ifdef debug
03092 G4cout<<"G4QNucleus::InitCandidateVector: current baryon is defined"<<G4endl;
03093 #endif
03094 theQCandidates.push_back(curBar);
03095 #ifdef debug
03096 G4cout<<"G4Nucleus::InitCandidateVector: "<<ind++<<", Baryon # "<<i<<" with code = "
03097 <<baryonPDG[i]<< ", QC="<<theQCandidates[i]->GetQC()<<" is initialized"<<G4endl;
03098 #endif
03099 }
03100 if(maxClst>=0) for (i=0; i<maxClst; i++)
03101 {
03102 G4int clustQCode = i+G4QPDGCode().GetNQHadr();
03103 G4QPDGCode clustQPDG;
03104 clustQPDG.InitByQCode(clustQCode);
03105 G4int clusterPDG=clustQPDG.GetPDGCode();
03106 theQCandidates.push_back(new G4QCandidate(clusterPDG));
03107 #ifdef debug
03108 G4cout<<"G4QNucleus::InitCandidateVector:"<<ind++<<", Cluster # "<<i<<" with code = "
03109 <<clusterPDG<<", QC="<<clustQPDG.GetQuarkContent()<<" is initialized"<<G4endl;
03110 #endif
03111 }
03112 }
03113
03114
03115 void G4QNucleus::PrepareCandidates(G4QCandidateVector& theQCandidates, G4bool piF,
03116 G4bool gaF, G4LorentzVector pLV)
03117 {
03118 static const G4LorentzVector zeroLV(0.,0.,0.,0.);
03119 G4double ze = Z;
03120 G4double ne = N;
03121 G4double se = S;
03122 G4double ae = Z+N+S;
03123 G4double aea = ae*(ae-1);
03124 G4double ae2 = aea/2.;
03125 G4double ze1 = dZ + 1;
03126 G4double ne1 = dN + 1;
03127 G4double se1 = dS + 1;
03128 G4double ae0 = dZ + dN + dS;
03129 G4double ae1 = ae0 + 1;
03130 G4double pos = probVect[0];
03131 #ifdef cldebug
03132 G4int mac=6;
03133 #endif
03134 G4int cca=0;
03135 G4int acm=0;
03136 G4int mCand=theQCandidates.size();
03137 G4double s_value=0.;
03138 G4double comb=ae0*(ae0-1)/2;
03139 if(comb<=0.) comb=1.;
03140 #ifdef cldebug
03141 G4double sZ=0.;
03142 G4double sN=0.;
03143 G4cout<<"G4QN::PC:C#"<<mCand<<",dZ="<<dZ<<",dN="<<dN<<",ZNS="<<Z<<","<<N<<","<<S<<G4endl;
03144 #endif
03145 for (G4int index=0; index<mCand; index++)
03146 {
03147 G4QCandidate* curCand=theQCandidates[index];
03148 G4int cPDG = curCand->GetPDGCode();
03149 G4int cBN = curCand->GetBaryonNumber();
03150 G4int cST = curCand->GetStrangeness();
03151
03152
03153
03154
03155
03156
03157
03158
03159
03160
03161
03162
03163
03164
03165
03166
03167
03168
03169
03170
03171
03172
03173
03174
03175
03176
03177
03178
03179
03180
03181
03182
03183
03185
03186
03187
03188
03189
03190
03191
03192
03193
03194
03195
03196
03197
03198 if(piF&&gaF&&cBN!=1)
03199
03200 {
03201 curCand->SetPreProbability(0.);
03202 curCand->SetDenseProbability(0.);
03203 curCand->SetPossibility(false);
03204 #ifdef cldebug
03205 if(cPDG==90001001) G4cout<<"G4QNuc::PrepCand: piF/gaF fragments are blocked"<<G4endl;
03206 #endif
03207 }
03208
03209 else if(cPDG<80000000&&(abs(cPDG)%10>4||cST>2))
03210 {
03211 curCand->SetPreProbability(0.);
03212 curCand->SetDenseProbability(0.);
03213 curCand->SetPossibility(false);
03214 }
03215 else
03216 {
03217 G4double tnM=GetQPDG().GetMass();
03218 if(cPDG>80000000&&cPDG!=90000000)
03219 {
03220 G4int sc = cST;
03221 G4int zc = curCand->GetCharge();
03222 G4int ac = cBN;
03223 G4int nc = ac-zc-sc;
03224 G4double cM=tnM-G4QNucleus(Z-zc,N-nc,S-sc).GetGSMass();
03225 G4LorentzVector intLV=pLV+G4LorentzVector(0.,0.,0.,cM);
03226 pos = probVect[ac];
03227 if(ac<=maxClust&&pos>0.&&(pLV==zeroLV||intLV.m()>.00001+cM))
03228 {
03229
03230 #ifdef cldebug
03231 G4cout<<"G4QNucleus::PrepareCand: ac="<<ac<<", pV="<<pos<<G4endl;
03232 #endif
03233 G4int dac=ac+ac;
03234 if(ac && (piF || gaF))
03235 {
03236 if (piF&&!gaF&&zc+ac) pos*=(zc+ac)/ac;
03237 else if(gaF&&!piF&&zc+dac) pos*=(zc+dac)/ac;
03238 }
03239 G4double dense=1.;
03240 if (ac==1&&pos>0.)dense=probVect[254]/pos;
03241 else if(ac==2&&pos>0.)dense=probVect[255]/pos;
03242 #ifdef cldebug
03243 G4cout<<"G4QNucleus::PrepC: cPDG="<<cPDG<<",norm="<<pos<<",zc="<<zc<<",nc="<<nc
03244 <<",sc="<<sc<<",ac="<<ac<<",ze1="<<ze1<<",ne1="<<ne1<<",se1="<<se1<<G4endl;
03245 G4double mp=pos;
03246 #endif
03247 if (ac==1 && ae)
03248 {
03249 if (zc) pos*=ze/ae;
03250 else if(nc) pos*=ne/ae;
03251 else if(sc) pos*=se/ae;
03252
03253
03254
03255 acm=1;
03256 #ifdef cldebug
03257 if(pos)
03258 G4cout<<"G4QN::PrC:mp="<<mp<<",pos="<<pos<<",ae="<<ae
03259 <<",Z="<<zc<<",N="<<nc<<",mac="<<mac<<G4endl;
03260 sZ+=pos*zc;
03261 sN+=pos*nc;
03262 #endif
03263 }
03264 else if(ac==2)
03265 {
03266 if(ze<zc||ne<nc||se<sc) pos=0.;
03267 else if(aea)
03268 {
03269 if (zc==2) pos*=ze*(ze-1)/aea;
03270 else if(nc==2) pos*=ne*(ne-1)/aea;
03271 else if(sc==2) pos*=se*(se-1)/aea;
03272 else if(zc==1&&nc==1) pos*=ze*ne/ae2;
03273 else if(zc==1&&sc==1) pos*=ze*se/ae2;
03274 else if(sc==1&&nc==1) pos*=se*ne/ae2;
03275
03276
03277
03278
03279
03280
03281 else G4cout<<"***G4QNucl::PrepCand: z="<<zc<<", n="<<nc<<", s="<<sc<<G4endl;
03282
03283 }
03284 acm=2;
03285 #ifdef cldebug
03286 if(pos)
03287 G4cout<<"G4QN::PrC:mp="<<mp<<",p="<<pos<<",A=2,(Z="<<zc<<",N="<<nc<<"),m="
03288 <<mac<<G4endl;
03289 sZ+=pos*zc;
03290 sN+=pos*nc;
03291 #endif
03292 }
03293 else
03294 {
03295 if(acm<ac)
03296 {
03297 if(ac<ae1 && ac>0) comb*=(ae1-ac)/ac;
03298 acm=ac;
03299 s_value=0.;
03300 cca=0;
03301 #ifdef cldebug
03302 if(ac%2) mac=7;
03303 else mac=8;
03304 G4cout<<"G4QNuc::PrepCl:c="<<comb<<",ac="<<ac<<"("<<index<<"),m="<<mac<<",a="
03305 <<ae0<<G4endl;
03306 #endif
03307 }
03308 G4double prod=1.;
03309 if(ze1<=zc||ne1<=nc||se1<=sc) prod=0.;
03310 else
03311 {
03312 if(zc>0) for(int iz=1; iz<=zc; iz++) prod*=(ze1-iz)/iz;
03313 if(nc>0) for(int in=1; in<=nc; in++) prod*=(ne1-in)/in;
03314 if(sc>0) for(int is=1; is<=sc; is++) prod*=(se1-is)/is;
03315 }
03316 s_value+=prod;
03317 pos*=prod;
03318 pos/=comb;
03319 #ifdef cldebug
03320 if(pos) G4cout<<"G4QN::PreC:c="<<cPDG<<",p="<<pos<<",i="<<index<<",m="<<mac
03321 <<",pr="<<prod<<",c="<<cca<<G4endl;
03322 sZ+=pos*zc;
03323 sN+=pos*nc;
03324 #endif
03325 cca++;
03326 }
03327 curCand->SetPreProbability(pos);
03328 curCand->SetDenseProbability(pos*dense);
03329 #ifdef cldebug
03330 G4cout<<"G4QN::PrepC: ClusterPDG="<<cPDG<<",preProb="<<pos<<",d="<<dense<<G4endl;
03331 #endif
03332 }
03333 else
03334 {
03335 curCand->SetPreProbability(0.);
03336 curCand->SetDenseProbability(0.);
03337 curCand->SetPossibility(false);
03338 }
03339 }
03340 else
03341 {
03342 #ifdef cldebug
03343 G4cout<<"G4QNucl::PrepCand:cPDG="<<cPDG<<",pos="<<pos<<G4endl;
03344 #endif
03345 curCand->SetPreProbability(pos);
03346 curCand->SetDenseProbability(0.);
03347 }
03348 curCand->SetPossibility(true);
03349 }
03350 }
03351 #ifdef cldebug
03352 G4cout<<"G4QNucl::PrepCand:covP="<<ae*sZ/ze<<",covN="<<ae*sN/ne<<",totP="<<sZ+sN<<G4endl;
03353
03354 #endif
03355 }
03356
03357
03358 G4double G4QNucleus::CoulombBarGen(const G4double& rZ, const G4double& rA,
03359 const G4double& cZ, const G4double& cA)
03360 {
03361 static const G4double third=1./3.;
03362 G4double ca=cA;
03363 if(cA < 0.) ca=-cA;
03364 #ifdef debug
03365 if(rA < 0.) G4cout<<"-Warning-G4QNucl::CoulombBarGen: NucleusA="<<rA<<", Z="<<rZ<<G4endl;
03366 #endif
03367 G4double ra=rA;
03368 if(rA < 0.) ra=-rA;
03369 G4double zz=rZ*cZ;
03370
03371
03372
03373 G4double cb=1.29*zz/(pow(ra,third)+pow(ca,third)+.1);
03374
03375
03376
03377
03378
03379 #ifdef debug
03380 G4cout<<"G4QNucl::CoulBG:rA="<<cA<<",rZ="<<cZ<<",cA="<<cA<<",cZ="<<cZ<<",C="<<cb<<G4endl;
03381 #endif
03382 return cb;
03383 }
03384
03385
03386 G4double G4QNucleus::CoulombBarrier(const G4double& cZ, const G4double& cA, G4double delZ,
03387 G4double dA)
03388 {
03389 G4double rA=GetA()-cA;
03390 if (dA != 0.) rA-=dA;
03391 #ifdef debug
03392 if(rA<0.) G4cout<<"-Warning-G4QNucl::CoulombBarrier: NucleusA="<<rA<<", rZ="<<cZ<<G4endl;
03393 #endif
03394 G4double rZ=Z-cZ;
03395 if(delZ != 0.) rZ-=delZ;
03396 #ifdef debug
03397 if(rA<0.) G4cout<<"-Warning-G4QNucl::CoulombBarrier: NucleusA="<<rA<<", rZ="<<cZ<<G4endl;
03398 #endif
03399 return CoulombBarGen(rZ, rA, cZ, cA);
03400 }
03401
03402
03403 G4double G4QNucleus::FissionCoulombBarrier(const G4double& cZ, const G4double& cA,
03404 G4double delZ, G4double dA)
03405 {
03406 static const G4double third=1./3.;
03407 if(cZ<=0.) return 0.;
03408 G4double rA=GetA()-cA;
03409 if(dA) rA-=dA;
03410 G4double rZ=Z-cZ;
03411 if(delZ) rZ-=delZ;
03412 G4double zz=rZ*cZ;
03413 G4double r=(pow(rA,third)+pow(cA,third))*(1.51+.00921*zz)/(1.+.009443*zz);
03414 return 1.44*zz/r;
03415 }
03416
03417
03418 G4double G4QNucleus::BindingEnergy(const G4double& cZ, const G4double& cA, G4double delZ,
03419 G4double dA)
03420 {
03421 static const G4double mNeut= G4QPDGCode(2112).GetMass();
03422 static const G4double mProt= G4QPDGCode(2212).GetMass();
03423 if(!cZ && !cA) return Z*mProt+N*mNeut-GetGSMass();
03424 G4double GSM=GetGSMass();
03425 G4int iZ=static_cast<int>(cZ);
03426 G4int cN=static_cast<int>(cA-cZ);
03427 G4int sZ=iZ;
03428 G4int sN=cN;
03429 if(delZ||dA)
03430 {
03431 G4int dz=static_cast<int>(delZ);
03432 G4int dn=static_cast<int>(dA-delZ);
03433 GSM=G4QNucleus(Z-dz,N-dn,S).GetGSMass();
03434 sZ-=dz;
03435 sN-=dn;
03436 }
03437 return G4QNucleus(Z-sZ,N-sN,S).GetGSMass()+G4QNucleus(iZ,cN,0).GetGSMass()-GSM;
03438 }
03439
03440
03441 G4double G4QNucleus::CoulBarPenProb(const G4double& CB, const G4double& E,
03442 const G4int& C, const G4int& B)
03443 {
03444 static const G4double mNeut= G4QPDGCode(2112).GetMass();
03445 static const G4double dNeut= mNeut+mNeut;
03446 static const G4double mProt= G4QPDGCode(2212).GetMass();
03447 static const G4double dProt= mProt+mProt;
03448 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
03449
03450
03451
03452 static const G4double wellDebth=40.;
03453
03454
03455
03456
03457
03458
03459 if(B<1 || B>2) return 1.;
03460 if(C>B+1)
03461 {
03462 #ifdef debug
03463 G4cout<<"-Warning-G4QN::CBPP:SubtractedChrg="<<C<<" >SubtractedBaryonNmbr="<<B<<G4endl;
03464 #endif
03465 return 1.;
03466 }
03467
03468
03469
03470
03471
03472
03473
03474
03475
03476
03477
03478
03479
03480 G4double wD=wellDebth;
03481
03482
03483
03484
03485 G4double GSM=GetGSMass();
03486 #ifdef debug
03487 G4cout<<"G4QNucl::CBPenProb:GSM="<<GSM<<",Z="<<Z<<",N="<<N<<",C="<<C<<",B="<<B<<G4endl;
03488 #endif
03489 if(2>3);
03490
03491
03492
03499 else if(B==1&&C==1) wD=G4QNucleus(Z-1,N,S).GetGSMass()+mProt-GSM;
03500 else if(B==1&&C==0) wD=G4QNucleus(Z,N-1,S).GetGSMass()+mNeut-GSM;
03505 else if(B==2)
03506 {
03507 if (!C) wD=G4QNucleus(Z,N-2,S).GetGSMass()+dNeut-GSM;
03508 else if(C==1) wD=G4QNucleus(Z-1,N-1,S).GetGSMass()+mDeut-GSM;
03509 else if(C==2) wD=G4QNucleus(Z-2,N,S).GetGSMass()+dProt-GSM;
03510
03511 wD=80.;
03512
03513
03514 }
03518
03520
03523
03526
03527 if(wD<0.) wD=0.;
03528 #ifdef debug
03529 G4cout<<"G4QNucl::CBPenProb: wD="<<wD<<",E="<<E<<",CB="<<CB<<G4endl;
03530 #endif
03531
03532 wD=wD+wD;
03533
03534 G4double sR=0.;
03535 G4double CBD=CB+wD;
03536 G4double ED=E+wD;
03537 if(CBD<0.) return 1.;
03538 if(ED<=0.) return 0.;
03539
03540
03541 sR=sqrt(CBD/ED);
03542
03543 #ifdef debug
03544 G4cout<<"G4QN::CBPP:s="<<sR<<",E="<<E<<",w="<<wD<<",CB="<<CB<<",B="<<B<<",C="<<C<<G4endl;
03545 #endif
03546 if(sR>=1.) return 0.;
03547 return 1.-sR*sR*sR;
03548 }
03549
03550
03551 pair<G4double, G4double> G4QNucleus::ChooseImpactXandY(G4double maxImpact)
03552 {
03553 G4double x=1.;
03554 G4double y=1.;
03555 do
03556 {
03557 x = G4UniformRand();
03558 x = x+x-1.;
03559 y = G4UniformRand();
03560 y = y+y-1.;
03561 }
03562 while(x*x+y*y > 1.);
03563 std::pair<G4double, G4double> theImpactParameter;
03564 theImpactParameter.first = x*maxImpact;
03565 theImpactParameter.second = y*maxImpact;
03566 return theImpactParameter;
03567 }
03568
03569
03570 void G4QNucleus::ChooseNucleons()
03571 {
03572 #ifdef debug
03573 G4cout<<"G4QNucleus::ChooseNucleons: Nucleons search is started"<<rho0<<G4endl;
03574 #endif
03575 G4int protons =0;
03576 G4int nucleons=0;
03577 G4int theA=GetA();
03578 while (nucleons < theA)
03579 {
03580 if(protons<Z && G4UniformRand() < G4double(Z-protons)/G4double(theA-nucleons) )
03581 {
03582 protons++;
03583 nucleons++;
03584 G4QHadron* proton = new G4QHadron(2212);
03585 theNucleons.push_back(proton);
03586 }
03587 else if ( (nucleons-protons) < N )
03588 {
03589 nucleons++;
03590 G4QHadron* neutron = new G4QHadron(2112);
03591 theNucleons.push_back(neutron);
03592 }
03593 else G4cout<<"G4QNucleus::ChooseNucleons not efficient"<<G4endl;
03594 }
03595 return;
03596 }
03597
03598
03599 void G4QNucleus::ChoosePositions()
03600 {
03601 static const G4double mProt= G4QPDGCode(2212).GetMass();
03602 static const G4double mProt2= mProt*mProt;
03603 static const G4double third= 1./3.;
03604 #ifdef debug
03605 G4cout<<"G4QNucl::ChoosePositions: is called"<<G4endl;
03606 #endif
03607 G4int i=0;
03608 G4int theA=GetA();
03609 G4int lastN=theA-1;
03610 G4ThreeVector aPos(0.,0.,0.);
03611 G4double rPos=0.;
03612 G4ThreeVector delta(0.,0.,0.);
03613 G4ThreeVector* places= new G4ThreeVector[theA];
03614 G4bool freeplace= false;
03615 G4double nucDist2= nucleonDistance*nucleonDistance;
03616 G4double maxR= GetRadius(0.01);
03617 G4ThreeVector sumPos(0.,0.,0.);
03618 G4ThreeVector minPos(0.,0.,0.);
03619 G4double mirPos=maxR;
03620 G4int failCNT=0;
03621 G4int maxCNT=27;
03622 while( i < theA && maxR > 0.)
03623 {
03624 rPos = maxR*pow(G4UniformRand(),third);
03625 G4double density=rPos*rPos;
03626 if(theA<17) density=GetRelOMDensity(density);
03627 else density=GetRelWSDensity(rPos);
03628 #ifdef debug
03629 G4cout<<"G4QNucl::ChoosePositions: i="<<i<<", pos="<<aPos<<", dens="<<density<<G4endl;
03630 #endif
03631 if(G4UniformRand()<density)
03632 {
03633
03634
03635 if(i==lastN) aPos=-rPos*sumPos.unit();
03636 else aPos=rPos*G4RandomDirection();
03637 freeplace = true;
03638 for(G4int j=0; j<i && freeplace; j++)
03639 {
03640 delta = places[j] - aPos;
03641 freeplace= delta.mag2()>nucDist2;
03642 }
03643
03644
03645
03646
03647 G4int nucPDG= theNucleons[i]->GetPDGCode();
03648 #ifdef debug
03649 G4cout<<"G4QNucl::ChoosePositions: frpl="<<freeplace<<", nucPDG="<<nucPDG<<G4endl;
03650 #endif
03651 if(freeplace && nucPDG == 2212)
03652 {
03653 G4double pFermi=GetFermiMomentum(GetDensity(aPos));
03654 G4double eFermi= sqrt(pFermi*pFermi+mProt2)-mProt;
03655 if (eFermi <= CoulombBarrier()) freeplace=false;
03656 }
03657 if(rPos<mirPos)
03658 {
03659 mirPos=rPos;
03660 minPos=aPos;
03661 }
03662 if( freeplace || failCNT > maxCNT )
03663 {
03664 if( failCNT > maxCNT ) aPos=minPos;
03665 #ifdef debug
03666 G4cout<<"G4QNuc::ChoosePos:->> fill N["<<i<<"], R="<<aPos<<", f="<<failCNT<<G4endl;
03667 #endif
03668 places[i]=aPos;
03669 sumPos+=aPos;
03670 ++i;
03671 failCNT=0;
03672 mirPos=maxR;
03673 }
03674 else ++failCNT;
03675 }
03676 }
03677 #ifdef debug
03678 G4cout<<"G4QNucl::ChoosePositions: Out of the positioning LOOP"<<G4endl;
03679 #endif
03680 if(theA > 2) ReduceSum(places,sumPos);
03681 #ifdef debug
03682 G4cout<<"G4QNucl::ChoosePositions: The reduced summ is made"<<G4endl;
03683 #endif
03684 for(i=0; i<theA; i++) theNucleons[i]->SetPosition(places[i]);
03685 delete [] places;
03686 #ifdef debug
03687 G4cout << "G4QNucleus::ChoosePositions: The positions are defined for A="<<theA<<G4endl;
03688 #endif
03689 }
03690
03691
03692 void G4QNucleus::InitDensity()
03693 {
03694 static const G4double r0sq=0.8133*fermi*fermi;
03695 static const G4double third=1./3.;
03696 G4int iA = GetA();
03697 G4double rA = iA;
03698 G4double At = pow(rA,third);
03699 G4double At2= At*At;
03700 #ifdef debug
03701 G4cout<<"G4QNucleus::InitDensity: rA=iA=A="<<iA<<", A^1/3="<<At<<", A^2/3="<<At2<<G4endl;
03702 #endif
03703 if(iA<17)
03704 {
03705 radius = r0sq*At2;
03706 if(radius<=0.)
03707 {
03708 G4cout<<"-Warning-G4QNucl::ChoosePositions:L,iA="<<iA<<",Radius(?)="<<radius<<G4endl;
03709 radius=1.;
03710 }
03711 rho0 = pow(2*pi*radius, -1.5);
03712
03713 }
03714 else
03715 {
03716 G4double r0=1.16*(1.-1.16/At2)*fermi;
03717 radius = r0*At;
03718 if(radius<=0.)
03719 {
03720 G4cout<<"-Warning-G4QNucl::ChoosePositions:H,iA="<<iA<<",Radius(?)="<<radius<<G4endl;
03721 radius=1.;
03722 }
03723 G4double rd=WoodSaxonSurf/radius;
03724 if(!(rd<=0.1) && !(rd>-0.1))
03725 {
03726 G4cout<<"-Warning-G4QNucl::ChoosePositions:H,NAN,iA="<<iA<<", rd="<<rd<<G4endl;
03727 rd=1.;
03728 }
03729 rho0=0.75/(pi*pow(radius,3)*(1.+rd*rd*pi2));
03730 }
03731 RhoActive=true;
03732 }
03733
03734
03735 G4double G4QNucleus::GetDeriv(const G4ThreeVector& aPosition)
03736 {
03737 if(radius==0.) InitDensity();
03738 G4double rPos=aPosition.mag();
03739 if(GetA()<17) return -GetDensity(aPosition)*(rPos+rPos)/radius;
03740
03741 G4double dens=GetRelativeDensity(aPosition);
03742 return -exp((rPos-radius)/WoodSaxonSurf)*dens*dens*rho0/WoodSaxonSurf;
03743 }
03744
03745
03746 G4double G4QNucleus::GetRadius(const G4double maxRelDens)
03747 {
03748 if(radius==0.) InitDensity();
03749 if(GetA()<17)
03750 return (maxRelDens>0 && maxRelDens <= 1. ) ? sqrt(-radius*log(maxRelDens) ) : DBL_MAX;
03751
03752 return (maxRelDens>0 && maxRelDens <= 1. ) ? (radius + WoodSaxonSurf*
03753 log((1.-maxRelDens+exp(-radius/WoodSaxonSurf))/maxRelDens) ) : DBL_MAX;
03754 }
03755
03756
03757 G4double G4QNucleus::GetRelativeDensity(const G4ThreeVector& aPosition)
03758 {
03759 if(radius==0.) InitDensity();
03760 if(GetA()<17) return GetRelOMDensity(aPosition.mag2());
03761 return GetRelWSDensity(aPosition.mag());
03762 }
03763
03764
03765 G4double G4QNucleus::GetFermiMomentum(G4double density)
03766 {
03767 static const G4double third=1./3.;
03768 static const G4double constofpmax=hbarc*pow(3.*pi2,third);
03769 return constofpmax * pow(density*GetA(),third);
03770 }
03771
03772
03773 void G4QNucleus::ChooseFermiMomenta()
03774 {
03775 static const G4double mProt= G4QPDGCode(2212).GetMass();
03776 static const G4double mProt2= mProt*mProt;
03777
03778 static const G4double third= 1./3.;
03779 G4int i=0;
03780 G4double density=0.;
03781 G4int theA=GetA();
03782 G4int am1=theA-1;
03783 G4ThreeVector* momentum = new G4ThreeVector[theA];
03784 G4ThreeVector sumMom(0.,0.,0.);
03785 #ifdef debug
03786 G4cout<<"G4QNucleus::ChooseFermiMomentum is called for Z="<<Z<<", N="<<N<<G4endl;
03787 #endif
03788 for(i=0; i<theA; i++)
03789 {
03790 density=GetDensity(theNucleons[i]->GetPosition());
03791 G4double ferm = GetFermiMomentum(density);
03792 G4ThreeVector mom(0.,0.,0.);
03793 G4double rn3=pow(G4UniformRand(),third);
03794 G4ThreeVector dir(0.,0.,0.);
03795 if( i == am1) dir=-sumMom.unit();
03796 else dir=G4RandomDirection();
03797 if(theNucleons[i]->GetPDGCode() == 2212)
03798 {
03799 G4double eMax = sqrt(ferm*ferm+mProt2)-CoulombBarrier();
03800 if(eMax>mProt) mom=sqrt(eMax*eMax - mProt2)*rn3*dir;
03801 #ifdef debug
03802 else G4cerr<<"-Warning-G4QNucleus::ChooseFermM: FailToGetProtonMomentum,p=0"<<G4endl;
03803 #endif
03804 }
03805 else mom=ferm*rn3*dir;
03806 momentum[i]= mom;
03807 sumMom+= mom;
03808 #ifdef debug
03809 G4cout<<"G4QNucleus::ChooseFermiMomentum: for i="<<i<<", candidate mom="<<mom<<G4endl;
03810 #endif
03811 }
03812 if(theA > 2) SimpleSumReduction(momentum, sumMom);
03813
03814 G4int thisPDG=GetPDG();
03815 G4double rMp=G4QPDGCode(thisPDG-1000).GetMass();
03816 G4double rMn=G4QPDGCode(thisPDG-1).GetMass();
03817 G4double rMp2=rMp*rMp;
03818 G4double rMn2=rMn*rMn;
03819
03820 G4double rM2=rMn2;
03821 G4double thisM=GetGSMass();
03822 #ifdef debug
03823 G4LorentzVector sum(0.,0.,0.,0.);
03824 #endif
03825 for(i=0; i< theA ; i++ )
03826 {
03827 if(theNucleons[i]->GetPDGCode() == 2212)
03828 {
03829
03830 rM2=rMp2;
03831 }
03832 else
03833 {
03834
03835 rM2=rMn2;
03836 }
03837 G4ThreeVector curMom = momentum[i];
03838 G4double energy = thisM-std::sqrt(rM2+curMom.mag2());
03839 G4LorentzVector tempV(curMom,energy);
03840 #ifdef debug
03841 G4cout<<"G4QNucleus::ChooseFermiMomentum: FINALLY for i="<<i<<", 4mom="<<tempV<<G4endl;
03842 sum+=tempV;
03843 #endif
03844 theNucleons[i]->Set4Momentum(tempV);
03845 }
03846 #ifdef debug
03847 G4cout<<"G4QNucleus::ChooseFermiMomentum: FINALLY sum4M="<<sum<<G4endl;
03848 #endif
03849 delete [] momentum;
03850 }
03851
03852
03853 void G4QNucleus::SimpleSumReduction(G4ThreeVector* vect, G4ThreeVector sum)
03854 {
03855 G4int theA=GetA();
03856 sum/=theA;
03857 for(G4int i=0; i<theA; i++) vect[i]-=sum;
03858 }
03859
03860
03861 G4bool G4QNucleus::ReduceSum(G4ThreeVector* vect, G4ThreeVector sum)
03862 {
03863 G4int theA=GetA();
03864 if(theA<3)
03865 {
03866 G4cout<<"-Warning-G4QNucleus::ReduceSum: *Failed* A="<<theA<<" < 3"<<G4endl;
03867 return false;
03868 }
03869
03870 G4int am1=theA-1;
03871 G4double sum2=sum.mag2();
03872 G4double hsum2=sum2/2;
03873 G4double* dp= new G4double[am1];
03874 G4int m_value=am1;
03875 G4double minS=DBL_MAX;
03876 G4int minI=0;
03877 for(G4int i=0; i<am1; i++) dp[i]=sum.dot(vect[i]);
03878 while(m_value)
03879 {
03880 m_value=0;
03881 for(G4int i=0; i<am1; i++) if(dp[i]>0 && dp[i]<sum2)
03882 {
03883 m_value++;
03884 G4double shift=fabs(dp[i]-hsum2);
03885 if(shift < minS)
03886 {
03887 minS=shift;
03888 minI=i;
03889 }
03890 }
03891 if(m_value)
03892 {
03893 G4ThreeVector x=(dp[minI]/hsum2)*sum;
03894 vect[minI]-=x;
03895 sum-=x;
03896 sum2=sum.mag2();
03897 hsum2=sum2/2;
03898 }
03899 }
03900 if(sum2 > 0.)
03901 {
03902 sum/=theA;
03903 for(G4int i=0; i<theA; i++) vect[i]-=sum;
03904 }
03905 delete[] dp;
03906 return true;
03907 }
03908
03909
03910 void G4QNucleus::Init3D()
03911 {
03912 #ifdef debug
03913 G4cout<<"G4QNucleus::Init3D: is called currentNucleon="<<currentNucleon<<G4endl;
03914 #endif
03915 for_each(theNucleons.begin(),theNucleons.end(),DeleteQHadron());
03916 theNucleons.clear();
03917 G4int theA = GetA();
03918 ChooseNucleons();
03919 #ifdef debug
03920 G4cout<<"G4QNucleus::Init3D: Nucleons are initialized, nN="<<theNucleons.size()<<G4endl;
03921 #endif
03922 InitDensity();
03923 #ifdef debug
03924 G4cout<<"G4QNucl::Init3D: DensityPars for A="<<theA<<":R="<<radius <<",r0="<<rho0<<G4endl;
03925 #endif
03926 ChoosePositions();
03927 #ifdef debug
03928 G4cout<<"G4QNucleus::Init3D: Nucleons are positioned in the coordinate space"<<G4endl;
03929 #endif
03930 ChooseFermiMomenta();
03931 G4ThreeVector n3M=Get3Momentum();
03932 if(n3M.x() || n3M.y() || n3M.z())
03933 {
03934 n3M/=GetEnergy();
03935 DoLorentzBoost(n3M);
03936 }
03937 #ifdef debug
03938 G4cout<<"G4QNucleus::Init3D: Nucleons are positioned in the momentum space"<<G4endl;
03939 #endif
03940 G4double Ebind= BindingEnergy()/theA;
03941 for (G4int i=0; i<theA; i++) theNucleons[i]->SetBindingEnergy(Ebind);
03942 currentNucleon=0;
03943 return;
03944 }
03945
03946
03947 G4double G4QNucleus::GetOuterRadius()
03948 {
03949 G4double maxradius2=0;
03950 G4int theA=theNucleons.size();
03951 if(theA) for(G4int i=0; i<theA; i++)
03952 {
03953 G4double nucr2=theNucleons[i]->GetPosition().mag2();
03954 if(nucr2 > maxradius2) maxradius2=nucr2;
03955 }
03956 return sqrt(maxradius2)+nucleonDistance;
03957 }
03958
03959
03960 void G4QNucleus::DoLorentzContraction(const G4ThreeVector& theBeta)
03961 {
03962 G4double bet2=theBeta.mag2();
03963 G4double factor=(1.-sqrt(1.-bet2))/bet2;
03964 G4int theA=theNucleons.size();
03965 if(theA) for (G4int i=0; i< theA; i++)
03966 {
03967 G4ThreeVector pos=theNucleons[i]->GetPosition();
03968 pos -= factor*(theBeta*pos)*theBeta;
03969 theNucleons[i]->SetPosition(pos);
03970 }
03971 }
03972
03973
03974 void G4QNucleus::DoTranslation(const G4ThreeVector& theShift)
03975 {
03976 G4int theA=theNucleons.size();
03977 if(theA) for(G4int i=0; i<theA; i++)
03978 theNucleons[i]->SetPosition(theNucleons[i]->GetPosition() + theShift);
03979 }
03980
03981
03982 G4bool G4QNucleus::StartLoop()
03983 {
03984 G4int theA=theNucleons.size();
03985 if(theA) currentNucleon=0;
03986 else G4cout<<"-Warning-G4QNucleus::StartLoop: LOOP starts for uninited nucleons"<<G4endl;
03987 return theA;
03988 }
03989
03990
03991 void G4QNucleus::ActivateBThickness()
03992 {
03993 static const G4double aT= .0008;
03994 static const G4double sT= .42;
03995 static const G4double pT=-.26;
03996 static const G4double db= .1;
03997
03998 G4double A = GetA();
03999 G4double B = aT*A*A;
04000 G4double D = sT*std::pow(A,pT);
04001 G4double C = A*D/pi/std::log(1.+B);
04002 G4double mT= C*B/(1+B);
04003 G4double T = mT;
04004 mT/=1000.;
04005 G4double b = 0.;
04006 while(T>mT)
04007 {
04008
04009 Tb.push_back(T);
04010 b+=db;
04011 G4double E=B*std::exp(-D*b*b);
04012 T=C*E/(1.+E);
04013 }
04014 TbActive=true;
04015 }
04016
04017
04018 G4double G4QNucleus::GetTbIntegral()
04019 {
04020 if(!TbActive) ActivateBThickness();
04021 G4int nt = Tb.size();
04022 G4double sum=0.;
04023 for(G4int i=0; i<nt; ++i) sum+=i*Tb[i];
04024 sum*=.02*pi;
04025 #ifdef debug
04026 G4cout<<"G4QNucleus::GetTbIntegral:TI="<<sum<<", RI="<<4*pi*rho0*pow(radius,3)/3<<G4endl;
04027 #endif
04028 return sum;
04029 }
04030
04031
04032 G4double G4QNucleus::GetBThickness(G4double b)
04033 {
04034 static const G4double dfermi=fermi/10.;
04035 static const G4double sfermi=fermi*fermi;
04036 if(!TbActive) ActivateBThickness();
04037 G4double bf = b/dfermi;
04038 G4int nb = static_cast<int>(bf);
04039 G4int eb = nb+1;
04040 G4int nt = Tb.size();
04041 if(eb>=nt) return 0.;
04042 G4double nT=Tb[nb];
04043 G4double eT=Tb[eb];
04044 return (nT-(bf-nb)*(nT-eT))/sfermi;
04045 }
04046
04047
04048 G4double G4QNucleus::GetThickness(G4double b)
04049 {
04050 G4int tA=GetA();
04051 if(tA<1)
04052 {
04053 G4cout<<"-Warning-G4QNucleus::GetThickness: for A="<<tA<<", => return 0"<<G4endl;
04054 return 0.;
04055 }
04056 else if(tA==1) return 0.;
04057 if(!TbActive) ActivateBThickness();
04058 if(!RhoActive) InitDensity();
04059 return GetBThickness(b)/rho0/tA;
04060 }
04061
04062
04063 G4QNucleus G4QNucleus::operator+=(const G4QNucleus& rhs)
04064 {
04065 Z+=rhs.Z;
04066 N+=rhs.N;
04067 S+=rhs.S;
04068 dZ+=rhs.dZ;
04069 dN+=rhs.dN;
04070 dS+=rhs.dS;
04071
04072 G4int newPDG= GetPDGCode() + rhs.GetPDGCode() - 90000000;
04073 SetQPDG (newPDG);
04074 G4QContent newQC = GetQC() + rhs.GetQC();
04075 SetQC (newQC);
04076 theMomentum += rhs.Get4Momentum();
04077 return *this;
04078 }
04079
04080
04081 G4QNucleus G4QNucleus::operator-=(const G4QNucleus& rhs)
04082 {
04083 Z-=rhs.Z;
04084 N-=rhs.N;
04085 S-=rhs.S;
04086 dZ-=rhs.dZ;
04087 dN-=rhs.dN;
04088 dS-=rhs.dS;
04089
04090 G4int newPDG= GetPDGCode() - rhs.GetPDGCode() + 90000000;
04091 SetQPDG (newPDG);
04092 G4QContent newQC = GetQC() - rhs.GetQC();
04093 SetQC (newQC);
04094 theMomentum -= rhs.Get4Momentum();
04095 return *this;
04096 }
04097
04098
04099 G4QNucleus G4QNucleus::operator*=(const G4int& rhs)
04100 {
04101 Z*=rhs;
04102 N*=rhs;
04103 S*=rhs;
04104 dZ*=rhs;
04105 dN*=rhs;
04106 dS*=rhs;
04107
04108 G4int newPDG= rhs*(GetPDGCode() - 90000000) + 90000000;
04109 SetQPDG (newPDG);
04110 G4QContent newQC = rhs*GetQC();
04111 SetQC (newQC);
04112 theMomentum *= rhs;
04113 return *this;
04114 }
04115
04116
04117 G4int G4QNucleus::HadrToNucPDG(G4int hPDG)
04118 {
04119 G4int nPDG=hPDG;
04120 if (hPDG==2212) nPDG=90001000;
04121 else if(hPDG==2112) nPDG=90000001;
04122 else if(hPDG==3122||hPDG==3212) nPDG=91000000;
04123 else if(hPDG== 211) nPDG=90000999;
04124 else if(hPDG==-211) nPDG=89999001;
04125 else if(hPDG== 311) nPDG=89000001;
04126 else if(hPDG== 321) nPDG=89001000;
04127 else if(hPDG==-311) nPDG=90999999;
04128 else if(hPDG==-321) nPDG=90999000;
04129 else if(hPDG==1114) nPDG=89999002;
04130 else if(hPDG==2224) nPDG=90001999;
04131 else if(hPDG==3112) nPDG=90999000;
04132 else if(hPDG==3222) nPDG=91000999;
04133 else if(hPDG==3312) nPDG=91999000;
04134 else if(hPDG==3322) nPDG=91999999;
04135 else if(hPDG==3334) nPDG=92998999;
04136 else if(hPDG==-2212) nPDG=8999000;
04137 else if(hPDG==-2112) nPDG=8999999;
04138 else if(hPDG==-3122||hPDG==3212) nPDG=89000000;
04139 else if(hPDG==-3112) nPDG=89000999;
04140 else if(hPDG==-3222) nPDG=88999001;
04141 else if(hPDG==-3312) nPDG=88001000;
04142 else if(hPDG==-3322) nPDG=88000001;
04143 else if(hPDG==-3334) nPDG=87001001;
04144 return nPDG;
04145 }
04146
04147
04148 G4int G4QNucleus::NucToHadrPDG(G4int nPDG)
04149 {
04150 G4int hPDG=nPDG;
04151 if (nPDG==90001000) hPDG=2212;
04152 else if(nPDG==90000001) hPDG=2112;
04153 else if(nPDG==91000000) hPDG=3122;
04154 else if(nPDG==90000999) hPDG= 211;
04155 else if(nPDG==89999001) hPDG=-211;
04156 else if(nPDG==89001000) hPDG= 213;
04157 else if(nPDG==89000001) hPDG= 213;
04158 else if(nPDG==90999000) hPDG=-213;
04159 else if(nPDG==90999999) hPDG=-213;
04160 else if(nPDG==90001999) hPDG=1114;
04161 else if(nPDG==89999002) hPDG=2224;
04162 else if(nPDG==91000999) hPDG=3112;
04163 else if(nPDG==90999001) hPDG=3222;
04164 else if(nPDG==91999999) hPDG=3312;
04165 else if(nPDG==91999000) hPDG=3322;
04166 else if(nPDG==92998999) hPDG=3334;
04167 return hPDG;
04168 }
04169
04170
04171 void G4QNucleus::EvaporateNucleus(G4QHadron* qH, G4QHadronVector* evaHV)
04172 {
04173 static const G4double mHel6 = G4QPDGCode(2112).GetNuclMass(2,4,0);
04174 static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0);
04175 static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0);
04176 static const G4double mNeut = G4QPDGCode(2112).GetMass();
04177 static const G4double mProt = G4QPDGCode(2212).GetMass();
04178 static const G4double mLamb = G4QPDGCode(3122).GetMass();
04179 static const G4double mPi = G4QPDGCode(211).GetMass();
04180 static const G4double mPi0 = G4QPDGCode(111).GetMass();
04181 static const G4double mK = G4QPDGCode(321).GetMass();
04182 static const G4double mK0 = G4QPDGCode(311).GetMass();
04183 static const G4QContent neutQC(2,1,0,0,0,0);
04184 static const G4QContent protQC(1,2,0,0,0,0);
04185 static const G4QContent lambQC(1,1,1,0,0,0);
04186 static const G4QContent deutQC(3,3,0,0,0,0);
04187 static const G4QContent alphQC(6,6,0,0,0,0);
04188 G4int thePDG = qH->GetPDGCode();
04189 G4QContent theQC = qH->GetQC();
04190 #ifdef pdebug
04191 G4cout<<"G4QNucleus::EvaporateNucleus:-Called-PDG="<<thePDG<<",QC="<<theQC<<G4endl;
04192 #endif
04193 G4int theBN = qH->GetBaryonNumber();
04194 #ifdef pdebug
04195 G4cout<<"G4QNucleus::EvaporateNucleus: theBN="<<theBN<<G4endl;
04196 #endif
04197 if((thePDG || thePDG==10) && theQC.GetBaryonNumber()>0) thePDG=theQC.GetZNSPDGCode();
04198 G4LorentzVector q4M = qH->Get4Momentum();
04199 if(!theBN || thePDG<80000000 || thePDG==90000000)
04200 {
04201 #ifdef debug
04202 G4cout<<"G4QNucleus::EvaporateNucleus: Nucleus="<<thePDG<<qH->Get4Momentum()<<G4endl;
04203 #endif
04204 if(thePDG==90000000)
04205 {
04206 #ifdef qdebug
04207 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (1) qH=0"<<G4endl;
04208 #endif
04209 delete qH;
04210 G4cout<<"-Warning-G4QNucleus::EvapNuc:vacuum,4Mom="<<q4M<<G4endl;
04211 }
04212 else
04213 {
04214 G4cout<<"-Warning-G4QNucleus::EvapNuc:vacuum, Called for Meson PDG="<<thePDG<<G4endl;
04215 evaHV->push_back(qH);
04216 }
04217 return;
04218 }
04220 if(thePDG>91000000)
04221 {
04222 G4int SSS=(thePDG-90000000)/1000000;
04223 thePDG-=SSS*999999;
04224 qH->SetQPDG(G4QPDGCode(thePDG));
04225 theQC = qH->GetQC();
04226 #ifdef debug
04227 G4cout<<"=>Hyper Change=>G4QNucleus::EvaporateNuceus: NewNucPDG="<<thePDG<<G4endl;
04228 #endif
04229 }
04231 if(thePDG<80000000)
04232 {
04233 #ifdef debug
04234 G4cout<<"G4QN::EvaporateNuc: FundamentalParticle="<<thePDG<<qH->Get4Momentum()<<G4endl;
04235 #endif
04236 evaHV->push_back(qH);
04237 return;
04238 }
04239 G4int theC=theQC.GetCharge();
04240 G4int theS=theQC.GetStrangeness();
04241 G4int theN=theBN-theC-theS;
04242 G4double totGSM = G4QNucleus(thePDG).GetGSMass();
04243 G4double totMass = q4M.m();
04244 #ifdef debug
04245 G4cout<<"G4QNucleus::EvaporateNucleus(EVA):===IN==> PDG="<<thePDG<<",4Mom="<<q4M<<", B="
04246 <<theBN<<", Z="<<theC<<", N="<<theN<<", S="<<theS<<G4endl;
04247 #endif
04248 if(theBN<-2)
04249 {
04250 G4cout<<"-Warning-G4QNuc::EvapNuc: Evapor of anti-nuclei is not implemented yet PDG="
04251 <<thePDG<<G4endl;
04252 evaHV->push_back(qH);
04253 return;
04254 }
04255 else if(thePDG==91000000||thePDG==90001000||thePDG==90000001)
04256
04257 {
04258 G4double gsM=mNeut;
04259 if(thePDG==90001000) gsM=mProt;
04260 else if(thePDG==91000000) gsM=mLamb;
04261 if(fabs(totMass-gsM)<.001)
04262 {
04263 #ifdef debug
04264 G4cout<<"G4QNu::EvaporateNucl:GSM="<<gsM<<", H="<<thePDG<<qH->Get4Momentum()<<G4endl;
04265 #endif
04266 evaHV->push_back(qH);
04267 return;
04268 }
04269 else if(totMass<gsM)
04270 {
04271 #ifdef qdebug
04272 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (2) qH=0"<<G4endl;
04273 #endif
04274 delete qH;
04275
04276
04277 G4ExceptionDescription ed;
04278 ed << "Baryon is below Mass Shell: Baryon " << thePDG
04279 << " is belowMassShell, M=" << totMass << G4endl;
04280 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0000",
04281 FatalException, ed);
04282 }
04283 else
04284 {
04285 G4double d=totMass-gsM;
04286 #ifdef debug
04287 G4cout<<"G4QN::EvaporNucl: PDG="<<thePDG<<",M="<<totMass<<">"<<gsM<<",d="<<d<<G4endl;
04288 #endif
04289 G4int decPDG=22;
04290 G4double decM=0.;
04291 if(d>142.)
04292 {
04293 if(thePDG==90001000)
04294 {
04295 gsM=mNeut;
04296 thePDG=90000001;
04297 decPDG=211;
04298 decM=mPi;
04299 }
04300 else if(thePDG==90000001)
04301 {
04302 gsM=mProt;
04303 thePDG=90001000;
04304 decPDG=-211;
04305 decM=mPi;
04306 }
04307 else
04308 {
04309 decPDG=111;
04310 decM=mPi0;
04311 }
04312 }
04313 G4LorentzVector h4Mom(0.,0.,0.,gsM);
04314 G4LorentzVector g4Mom(0.,0.,0.,decM);
04315 if(!G4QHadron(q4M).DecayIn2(h4Mom, g4Mom))
04316 {
04317 #ifdef qdebug
04318 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (3) qH=0"<<G4endl;
04319 #endif
04320 delete qH;
04321
04322
04323 G4ExceptionDescription ed;
04324 ed << "BaryonDecay In Baryon+Gam Error: h=" << thePDG << "(GSM="
04325 << gsM << ")+gam>tM=" << totMass << G4endl;
04326 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0001",
04327 FatalException, ed);
04328 }
04329 #ifdef debug
04330 G4cout<<"G4QNucl::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+g="<<g4Mom<<",n="
04331 <<evaHV->size()<<G4endl;
04332 #endif
04333 G4QHadron* curH = new G4QHadron(thePDG,h4Mom);
04334 #ifdef debug
04335 G4cout<<"G4QNucleus::EvaporateNucleus: Hadr="<<thePDG<<h4Mom<<G4endl;
04336 #endif
04337 evaHV->push_back(curH);
04338 G4QHadron* curG = new G4QHadron(decPDG,g4Mom);
04339 #ifdef debug
04340 G4cout<<"G4QNucleus::EvaporateNucleus: Gamma(pion)4M="<<g4Mom<<G4endl;
04341 #endif
04342 evaHV->push_back(curG);
04343 #ifdef qdebug
04344 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (4) qH=0"<<G4endl;
04345 #endif
04346 delete qH;
04347 }
04348 }
04349 else if(thePDG==89000000||thePDG==89999000||thePDG==89999999)
04350
04351 {
04352 G4double gsM=mNeut;
04353 if(thePDG==89999000) gsM=mProt;
04354 else if(thePDG==89000000) gsM=mLamb;
04355 if(fabs(totMass-gsM)<.001)
04356 {
04357 #ifdef debug
04358 G4cout<<"G4QNu::EvaNucl:(aB*),GSM="<<gsM<<", H="<<thePDG<<qH->Get4Momentum()<<G4endl;
04359 #endif
04360 evaHV->push_back(qH);
04361 return;
04362 }
04363 else if(totMass<gsM)
04364 {
04365 #ifdef qdebug
04366 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (2a) qH=0"<<G4endl;
04367 #endif
04368 delete qH;
04369
04370
04371 G4ExceptionDescription ed;
04372 ed << "anti-Baryon is below Mass Shell: antiBaryon=" << thePDG
04373 << " below MassShell, M=" << totMass << G4endl;
04374 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0002",
04375 FatalException, ed);
04376 }
04377 else
04378 {
04379 G4double d=totMass-gsM;
04380 #ifdef debug
04381 G4cout<<"G4QN::EvaporNucl: PDG="<<thePDG<<",M="<<totMass<<">"<<gsM<<",d="<<d<<G4endl;
04382 #endif
04383 G4int decPDG=22;
04384 G4double decM=0.;
04385 if(d>142.)
04386 {
04387 if(thePDG==89999000)
04388 {
04389 gsM=mNeut;
04390 thePDG=89999999;
04391 decPDG=-211;
04392 decM=mPi;
04393 }
04394 else if(thePDG==89999999)
04395 {
04396 gsM=mProt;
04397 thePDG=89999000;
04398 decPDG=211;
04399 decM=mPi;
04400 }
04401 else
04402 {
04403 decPDG=111;
04404 decM=mPi0;
04405 }
04406 }
04407 G4LorentzVector h4Mom(0.,0.,0.,gsM);
04408 G4LorentzVector g4Mom(0.,0.,0.,decM);
04409 if(!G4QHadron(q4M).DecayIn2(h4Mom, g4Mom))
04410 {
04411 #ifdef qdebug
04412 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (3a) qH=0"<<G4endl;
04413 #endif
04414 delete qH;
04415
04416
04417 G4ExceptionDescription ed;
04418 ed << "BaryonDecay In Baryon+Gam Error: ah=" << thePDG << "(GSM="
04419 << gsM << ")+gam>tM=" << totMass << G4endl;
04420 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0003",
04421 FatalException, ed);
04422 }
04423 #ifdef debug
04424 G4cout<<"G4QNucl::EvaNuc:aM="<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+g="<<g4Mom<<",n="
04425 <<evaHV->size()<<G4endl;
04426 #endif
04427 G4QHadron* curH = new G4QHadron(thePDG, h4Mom);
04428 #ifdef debug
04429 G4cout<<"G4QNucleus::EvaporateNucleus: antiHadr="<<thePDG<<h4Mom<<G4endl;
04430 #endif
04431 evaHV->push_back(curH);
04432 G4QHadron* curMes = new G4QHadron(decPDG, g4Mom);
04433 #ifdef debug
04434 G4cout<<"G4QNucleus::EvaporateNucleus: (anti) Gamma(pion)4M="<<g4Mom<<G4endl;
04435 #endif
04436 evaHV->push_back(curMes);
04437 #ifdef qdebug
04438 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (4a) qH=0"<<G4endl;
04439 #endif
04440 delete qH;
04441 }
04442 }
04443 else if((thePDG==90001999||thePDG==89999002) && totMass>1080.)
04444
04445 {
04446 G4double gsM=mNeut;
04447 G4int barPDG=2112;
04448 G4int mesPDG=-211;
04449 if(thePDG==90001999)
04450 {
04451 gsM=mProt;
04452 barPDG=2212;
04453 mesPDG=211;
04454 }
04455 if(fabs(totMass-gsM-mPi)<.001)
04456 {
04457 #ifdef debug
04458 G4cout<<"G4QN::EvaporateNuc:(D)GSM="<<gsM<<",H="<<thePDG<<qH->Get4Momentum()<<G4endl;
04459 #endif
04460 G4LorentzVector h4Mom=q4M*(gsM/totMass);
04461 G4QHadron* curB = new G4QHadron(barPDG,h4Mom);
04462 evaHV->push_back(curB);
04463 G4LorentzVector g4Mom=q4M*(mPi/totMass);
04464 G4QHadron* curM = new G4QHadron(mesPDG,g4Mom);
04465 evaHV->push_back(curM);
04466 #ifdef qdebug
04467 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (5) qH=0"<<G4endl;
04468 #endif
04469 delete qH;
04470 return;
04471 }
04472 else if(totMass<gsM+mPi)
04473 {
04474 #ifdef qdebug
04475 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (6) qH=0"<<G4endl;
04476 #endif
04477 delete qH;
04478
04479
04480 G4ExceptionDescription ed;
04481 ed << "Delta is below Mass Shell: Delta " << thePDG
04482 << " is belowMassShell, M=" << totMass << G4endl;
04483 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0004",
04484 FatalException, ed);
04485 }
04486 else
04487 {
04488 G4LorentzVector h4Mom(0.,0.,0.,gsM);
04489 G4LorentzVector g4Mom(0.,0.,0.,mPi);
04490 if(!G4QHadron(q4M).DecayIn2(h4Mom, g4Mom))
04491 {
04492 #ifdef qdebug
04493 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (7) qH=0"<<G4endl;
04494 #endif
04495 delete qH;
04496
04497
04498 G4ExceptionDescription ed;
04499 ed << "DeltaDecInBaryon+Pi Error: Dh=" << thePDG << "N+pi=" << gsM+mPi
04500 << ">tM=" << totMass << G4endl;
04501 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0005",
04502 FatalException, ed);
04503 }
04504 #ifdef debug
04505 G4cout<<"G4QNuc::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+pi="<<g4Mom<<", nH="
04506 <<evaHV->size()<<G4endl;
04507 #endif
04508 G4QHadron* curH = new G4QHadron(barPDG,h4Mom);
04509 #ifdef debug
04510 G4cout<<"G4QNucleus::EvaporateNucl: Nucleon="<<thePDG<<h4Mom<<G4endl;
04511 #endif
04512 evaHV->push_back(curH);
04513 G4QHadron* curG = new G4QHadron(mesPDG,g4Mom);
04514 #ifdef debug
04515 G4cout<<"G4QE::EvaporateR: Pion="<<g4Mom<<G4endl;
04516 #endif
04517 evaHV->push_back(curG);
04518 #ifdef qdebug
04519 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (8) qH=0"<<G4endl;
04520 #endif
04521 delete qH;
04522 }
04523 }
04524 else if((thePDG==89998001||thePDG==90000998) && totMass>1080.)
04525
04526 {
04527 G4double gsM=mNeut;
04528 G4int barPDG=-2112;
04529 G4int mesPDG=211;
04530 if(thePDG==89998001)
04531 {
04532 gsM=mProt;
04533 barPDG=-2212;
04534 mesPDG=-211;
04535 }
04536 if(fabs(totMass-gsM-mPi)<.001)
04537 {
04538 #ifdef debug
04539 G4cout<<"G4QN::EvaporateNuc:(A)GSM="<<gsM<<",H="<<thePDG<<qH->Get4Momentum()<<G4endl;
04540 #endif
04541 G4LorentzVector h4Mom=q4M*(gsM/totMass);
04542 G4QHadron* curB = new G4QHadron(barPDG,h4Mom);
04543 evaHV->push_back(curB);
04544 G4LorentzVector g4Mom=q4M*(mPi/totMass);
04545 G4QHadron* curM = new G4QHadron(mesPDG,g4Mom);
04546 evaHV->push_back(curM);
04547 #ifdef qdebug
04548 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (5a) qH=0"<<G4endl;
04549 #endif
04550 delete qH;
04551 return;
04552 }
04553 else if(totMass<gsM+mPi)
04554 {
04555 #ifdef qdebug
04556 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (6a) qH=0"<<G4endl;
04557 #endif
04558 delete qH;
04559
04560
04561 G4ExceptionDescription ed;
04562 ed << "anti-Delta is below Mass Shell: aDelta " << thePDG
04563 << " is belowMassShell, M=" << totMass << G4endl;
04564 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0006",
04565 FatalException, ed);
04566 }
04567 else
04568 {
04569 G4LorentzVector h4Mom(0.,0.,0.,gsM);
04570 G4LorentzVector g4Mom(0.,0.,0.,mPi);
04571 if(!G4QHadron(q4M).DecayIn2(h4Mom, g4Mom))
04572 {
04573 #ifdef qdebug
04574 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (7a) qH=0"<<G4endl;
04575 #endif
04576 delete qH;
04577
04578
04579 G4ExceptionDescription ed;
04580 ed << "AntiDeltaDecayInBaryon+Pi Error: aD=" << thePDG << "N+pi="
04581 << gsM+mPi << ">tM=" << totMass << G4endl;
04582 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0007",
04583 FatalException, ed);
04584 }
04585 #ifdef debug
04586 G4cout<<"G4QNuc::EvaNuc:(aD) "<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<" + pi="<<g4Mom
04587 <<", nH="<<evaHV->size()<<G4endl;
04588 #endif
04589 G4QHadron* curH = new G4QHadron(barPDG,h4Mom);
04590 #ifdef debug
04591 G4cout<<"G4QNucleus::EvaporateNucl: Nucleon="<<thePDG<<h4Mom<<G4endl;
04592 #endif
04593 evaHV->push_back(curH);
04594 G4QHadron* curMes = new G4QHadron(mesPDG,g4Mom);
04595 #ifdef debug
04596 G4cout<<"G4QE::EvaporateR: Pion="<<g4Mom<<G4endl;
04597 #endif
04598 evaHV->push_back(curMes);
04599 #ifdef qdebug
04600 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (8a) qH=0"<<G4endl;
04601 #endif
04602 delete qH;
04603 }
04604 }
04605 else if(theBN>0&&theS<0) DecayAntiStrange(qH,evaHV);
04606 else if(theBN>0&&(theC<0||theC>theBN-theS))DecayIsonucleus(qH,evaHV);
04607 else if((thePDG==89999003 || thePDG==90002999) && totMass>2020.)
04608 {
04609
04610 G4int nucPDG = 2112;
04611 G4double nucM = mNeut;
04612 G4int piPDG = -211;
04613 if(thePDG==90002999)
04614 {
04615 nucPDG = 2212;
04616 nucM = mProt;
04617 piPDG = 211;
04618 }
04619 if(totMass>mPi+nucM+nucM)
04620 {
04621 G4LorentzVector n14M(0.,0.,0.,nucM);
04622 G4LorentzVector n24M(0.,0.,0.,nucM);
04623 G4LorentzVector pi4M(0.,0.,0.,mPi);
04624 if(!G4QHadron(q4M).DecayIn3(n14M,n24M,pi4M))
04625 {
04626 #ifdef qdebug
04627 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (9) qH=0"<<G4endl;
04628 #endif
04629 delete qH;
04630
04631
04632
04633 G4ExceptionDescription ed;
04634 ed << " ISO-Dibaryon DecayIn3 error: tM=" << totMass << "-> 2N="
04635 << nucPDG << "(M=" << nucM << ") + pi=" << piPDG << "(M="
04636 << mPi << ")" << G4endl;
04637 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0008",
04638 FatalException, ed);
04639 }
04640 #ifdef qdebug
04641 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (10) qH=0"<<G4endl;
04642 #endif
04643 delete qH;
04644 G4QHadron* h1H = new G4QHadron(nucPDG,n14M);
04645 #ifdef debug
04646 G4cout<<"G4QNucleus::EvaporateNucleus: Bar1="<<nucPDG<<n14M<<G4endl;
04647 #endif
04648 evaHV->push_back(h1H);
04649 G4QHadron* h2H = new G4QHadron(nucPDG,n24M);
04650 #ifdef debug
04651 G4cout<<"G4QNucleus::EvaporateNucleus: Bar2="<<nucPDG<<n24M<<G4endl;
04652 #endif
04653 evaHV->push_back(h2H);
04654 G4QHadron* piH = new G4QHadron(piPDG,pi4M);
04655 #ifdef debug
04656 G4cout<<"G4QNucleus::EvaporateNucleus: Pi="<<piPDG<<pi4M<<G4endl;
04657 #endif
04658 evaHV->push_back(piH);
04659 }
04660 else
04661 {
04662 #ifdef qdebug
04663 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (11) qH=0"<<G4endl;
04664 #endif
04665 delete qH;
04666
04667
04668
04669 G4ExceptionDescription ed;
04670 ed << "ISO-DiBaryon is under MassShell: IdPDG=" << thePDG << ", q4M="
04671 << q4M << ", M=" << totMass << " < M_2N+Pi, d=" << totMass-2*nucM-mPi
04672 << G4endl;
04673 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0009",
04674 FatalException, ed);
04675 }
04676 }
04677 else if((thePDG==90000002||thePDG==90001001||thePDG==90002000)&&totMass>2020.)
04678 {
04679
04680 G4int n1PDG = 2212;
04681 G4int n2PDG = 2112;
04682 G4int piPDG = -211;
04683 G4double n1M = mProt;
04684 G4double n2M = mNeut;
04685 if (thePDG==90002000) piPDG = 211;
04686 else if(thePDG==90000002) piPDG = -211;
04687 else
04688 {
04689 if(G4UniformRand()>.5)
04690 {
04691 n1PDG=2112;
04692 n1M=mNeut;
04693 piPDG = 211;
04694 }
04695 else
04696 {
04697 n2PDG=2212;
04698 n2M=mProt;
04699 piPDG = -211;
04700 }
04701 }
04702 if(totMass>mPi+n1M+n2M)
04703 {
04704 G4LorentzVector n14M(0.,0.,0.,n1M);
04705 G4LorentzVector n24M(0.,0.,0.,n2M);
04706 G4LorentzVector pi4M(0.,0.,0.,mPi);
04707 if(!G4QHadron(q4M).DecayIn3(n14M,n24M,pi4M))
04708 {
04709
04710
04711
04712 G4ExceptionDescription ed;
04713 ed << "ISO-dibaryon excit. DecayIn3 error: IsoDN, tM=" << totMass
04714 << "-> N1=" << n1PDG << "(M=" << n1M << ") + N2=" << n2PDG
04715 << "(M=" << n2M << ") + pi=" << piPDG << " (Mpi=" << mPi << ")"
04716 << G4endl;
04717 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0010",
04718 FatalException, ed);
04719 }
04720 #ifdef qdebug
04721 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (12) qH=0"<<G4endl;
04722 #endif
04723 delete qH;
04724 G4QHadron* h1H = new G4QHadron(n1PDG,n14M);
04725 #ifdef debug
04726 G4cout<<"G4QNucleus::EvaporateNucleus: Bar1="<<n1PDG<<n14M<<G4endl;
04727 #endif
04728 evaHV->push_back(h1H);
04729 G4QHadron* h2H = new G4QHadron(n2PDG,n24M);
04730 #ifdef debug
04731 G4cout<<"G4QNucleus::EvaporateNucleus: Bar2="<<n2PDG<<n24M<<G4endl;
04732 #endif
04733 evaHV->push_back(h2H);
04734 G4QHadron* piH = new G4QHadron(piPDG,pi4M);
04735 #ifdef debug
04736 G4cout<<"G4QNucleus::EvaporateNucleus: Pi="<<piPDG<<pi4M<<G4endl;
04737 #endif
04738 evaHV->push_back(piH);
04739 }
04740 else
04741 {
04742 #ifdef qdebug
04743 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (13) qH=0"<<G4endl;
04744 #endif
04745 delete qH;
04746
04747
04748
04749 G4ExceptionDescription ed;
04750 ed << "IsoDiBarState is under MassShell: IdPDG=" << thePDG << ", q4M="
04751 << q4M << ", M=" << totMass << " < M1+M2+Pi, d="
04752 << totMass-n1M-n2M-mPi << G4endl;
04753 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0011",
04754 FatalException, ed);
04755 }
04756 }
04757 else if(theBN==2) DecayDibaryon(qH, evaHV);
04758 else if((thePDG==90000997 || thePDG==89997001) && totMass>2020.)
04759 {
04760
04761 G4int nucPDG = -2112;
04762 G4double nucM = mNeut;
04763 G4int piPDG = 211;
04764 if(thePDG==90002999)
04765 {
04766 nucPDG = -2212;
04767 nucM = mProt;
04768 piPDG = -211;
04769 }
04770 if(totMass>mPi+nucM+nucM)
04771 {
04772 G4LorentzVector n14M(0.,0.,0.,nucM);
04773 G4LorentzVector n24M(0.,0.,0.,nucM);
04774 G4LorentzVector pi4M(0.,0.,0.,mPi);
04775 if(!G4QHadron(q4M).DecayIn3(n14M,n24M,pi4M))
04776 {
04777 #ifdef qdebug
04778 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (9a) qH=0"<<G4endl;
04779 #endif
04780 delete qH;
04781
04782
04783
04784 G4ExceptionDescription ed;
04785 ed << "Anti-ISO-DibaryonDecayIn3 error: antiM=" << totMass
04786 << "-> 2aN=" << nucPDG << "(M=" << nucM << ") + pi=" << piPDG
04787 << "(M=" << mPi << ")" << G4endl;
04788 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0012",
04789 FatalException, ed);
04790 }
04791 #ifdef qdebug
04792 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (10a) qH=0"<<G4endl;
04793 #endif
04794 delete qH;
04795 G4QHadron* h1H = new G4QHadron(nucPDG,n14M);
04796 #ifdef debug
04797 G4cout<<"G4QNucleus::EvaporateNucleus:(I) antiBar1="<<nucPDG<<n14M<<G4endl;
04798 #endif
04799 evaHV->push_back(h1H);
04800 G4QHadron* h2H = new G4QHadron(nucPDG,n24M);
04801 #ifdef debug
04802 G4cout<<"G4QNucleus::EvaporateNucleus:(I) antiBar2="<<nucPDG<<n24M<<G4endl;
04803 #endif
04804 evaHV->push_back(h2H);
04805 G4QHadron* piH = new G4QHadron(piPDG,pi4M);
04806 #ifdef debug
04807 G4cout<<"G4QNucleus::EvaporateNucleus:(I) (anti) Pi="<<piPDG<<pi4M<<G4endl;
04808 #endif
04809 evaHV->push_back(piH);
04810 }
04811 else
04812 {
04813 #ifdef qdebug
04814 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (11a) qH=0"<<G4endl;
04815 #endif
04816 delete qH;
04817
04818
04819
04820 G4ExceptionDescription ed;
04821 ed << "AntiISODiBaryon is underMassShell: aIdPDG=" << thePDG << ", q4M="
04822 << q4M << ", M=" << totMass << " < M_2N+Pi, d=" << totMass-2*nucM-mPi
04823 << G4endl;
04824 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0013",
04825 FatalException, ed);
04826 }
04827 }
04828 else if((thePDG==89999998||thePDG==89998999||thePDG==89998000)&&totMass>2020.)
04829 {
04830
04831 G4int n1PDG = -2212;
04832 G4int n2PDG = -2112;
04833 G4int piPDG = 211;
04834 G4double n1M = mProt;
04835 G4double n2M = mNeut;
04836 if (thePDG==89998000) piPDG = -211;
04837 else if(thePDG==89999998) piPDG = 211;
04838 else
04839 {
04840 if(G4UniformRand()>.5)
04841 {
04842 n1PDG=-2112;
04843 n1M=mNeut;
04844 piPDG = -211;
04845 }
04846 else
04847 {
04848 n2PDG=-2212;
04849 n2M=mProt;
04850 piPDG = 211;
04851 }
04852 }
04853 if(totMass>mPi+n1M+n2M)
04854 {
04855 G4LorentzVector n14M(0.,0.,0.,n1M);
04856 G4LorentzVector n24M(0.,0.,0.,n2M);
04857 G4LorentzVector pi4M(0.,0.,0.,mPi);
04858 if(!G4QHadron(q4M).DecayIn3(n14M,n24M,pi4M))
04859 {
04860
04861
04862
04863 G4ExceptionDescription ed;
04864 ed << "AntiExcitedDibaryon DecayIn3 error: IsoDN,antiM=" << totMass
04865 << "-> N1=" << n1PDG << "(M=" << n1M << ") + N2=" << n2PDG << "(M="
04866 << n2M << ") + pi=" << piPDG << " (Mpi=" << mPi << ")" << G4endl;
04867 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0014",
04868 FatalException, ed);
04869 }
04870 #ifdef qdebug
04871 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (12a) qH=0"<<G4endl;
04872 #endif
04873 delete qH;
04874 G4QHadron* h1H = new G4QHadron(n1PDG,n14M);
04875 #ifdef debug
04876 G4cout<<"G4QNucleus::EvaporateNucleus: antiBar1="<<n1PDG<<n14M<<G4endl;
04877 #endif
04878 evaHV->push_back(h1H);
04879 G4QHadron* h2H = new G4QHadron(n2PDG,n24M);
04880 #ifdef debug
04881 G4cout<<"G4QNucleus::EvaporateNucleus: antiBar2="<<n2PDG<<n24M<<G4endl;
04882 #endif
04883 evaHV->push_back(h2H);
04884 G4QHadron* piH = new G4QHadron(piPDG,pi4M);
04885 #ifdef debug
04886 G4cout<<"G4QNucleus::EvaporateNucleus: (anti)Pi="<<piPDG<<pi4M<<G4endl;
04887 #endif
04888 evaHV->push_back(piH);
04889 }
04890 else
04891 {
04892 #ifdef qdebug
04893 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (13a) qH=0"<<G4endl;
04894 #endif
04895 delete qH;
04896
04897
04898
04899 G4ExceptionDescription ed;
04900 ed << "AntiDiBarState is under MassShell: andPDG=" << thePDG << ", q4M="
04901 << q4M << ", M=" << totMass << " < M1+M2+Pi, d="
04902 << totMass-n1M-n2M-mPi << G4endl;
04903 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0015",
04904 FatalException, ed);
04905 }
04906 }
04907 else if(theBN==-2) DecayAntiDibaryon(qH,evaHV);
04908 else if(fabs(totMass-totGSM)<.001)
04909 {
04910 #ifdef debug
04911 G4cout<<"G4QNucleus::EvaNuc:GS "<<qH->GetQC()<<qH->Get4Momentum()<<" FillAsIs"<<G4endl;
04912 #endif
04913 if(thePDG==90004004)
04914 {
04915 DecayAlphaAlpha(qH,evaHV);
04916 }
04917 else if(thePDG==90004002)
04918 {
04919 DecayAlphaDiN(qH,evaHV);
04920 }
04921 else if((theC==theBN||theN==theBN||theS==theBN)&&theBN>1)
04922 {
04923 DecayMultyBaryon(qH,evaHV);
04924 }
04925 else if(theBN==5)
04926 {
04927 DecayAlphaBar(qH,evaHV);
04928 }
04929 else
04930 {
04931 evaHV->push_back(qH);
04932 }
04933 }
04934 else if(theBN>1 && thePDG>88000000 && thePDG<89000000)
04935 {
04936 G4cout<<"---Warning---G4QNucl::EvaNuc:MustNotBeHere.PDG="<<thePDG<<",S="<<theS<<G4endl;
04937 G4int bZ=theQC.GetCharge();
04938 G4int bN=theBN-bZ;
04939 G4int k1PDG = 321;
04940 G4double mK1= mK;
04941 G4int k2PDG = 321;
04942 G4double mK2= mK;
04943 G4int nucPDG = thePDG;
04944 if(bZ>=bN) nucPDG+=999000;
04945 else
04946 {
04947 nucPDG+=999999;
04948 k1PDG = 311;
04949 mK1= mK0;
04950 }
04951 if(bZ>bN) nucPDG+=999000;
04952 else
04953 {
04954 nucPDG+=999999;
04955 k2PDG = 311;
04956 mK2= mK0;
04957 }
04958 G4double nucM = G4QNucleus(nucPDG).GetGSMass();
04959 G4cout<<"-Warning-G4QN::EvN:M="<<nucM<<","<<nucPDG<<",1="<<k1PDG<<",2="<<k2PDG<<G4endl;
04960 G4LorentzVector n4M(0.,0.,0.,nucM);
04961 G4LorentzVector k14M(0.,0.,0.,mK1);
04962 G4LorentzVector k24M(0.,0.,0.,mK2);
04963 if(!G4QHadron(q4M).DecayIn3(n4M,k14M,k24M))
04964 {
04965 #ifdef qdebug
04966 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (14) qH=0"<<G4endl;
04967 #endif
04968 delete qH;
04969
04970
04971
04972 G4ExceptionDescription ed;
04973 ed << " Nucleus+2antiK DecayIn3 error: tM=" << totMass << "-> N="
04974 << nucPDG << "(M=" << nucM << ") + k1=" << k1PDG << "(M=" << mK1
04975 << ") + k2=" << k2PDG << "(M=" << mK2 << ")" << G4endl;
04976 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0016",
04977 FatalException, ed);
04978 }
04979 #ifdef qdebug
04980 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (15) qH=0"<<G4endl;
04981 #endif
04982 delete qH;
04983 G4QHadron* k1H = new G4QHadron(k1PDG,k14M);
04984 #ifdef debug
04985 G4cout<<"G4QNucleus::EvaporateNucleus: k1="<<k1PDG<<k14M<<G4endl;
04986 #endif
04987 evaHV->push_back(k1H);
04988 G4QHadron* k2H = new G4QHadron(k2PDG,k24M);
04989 #ifdef debug
04990 G4cout<<"G4QNucleus::EvaporateNucleus: k2="<<k2PDG<<k24M<<G4endl;
04991 #endif
04992 evaHV->push_back(k2H);
04993 G4QHadron* nH = new G4QHadron(nucPDG,n4M);
04994 #ifdef debug
04995 G4cout<<"G4QNucleus::EvaporateNucleus: Nuc="<<nucPDG<<n4M<<G4endl;
04996 #endif
04997 evaHV->push_back(nH);
04998 }
04999
05000 else if ( (thePDG > 80000000 && thePDG != 90000000) ||
05001 thePDG == 2112 || thePDG == 2212 || thePDG == 3122)
05002 {
05003 if(thePDG<80000000)
05004 {
05005 if (thePDG==2112) thePDG=90000001;
05006 else if(thePDG==2212) thePDG=90001000;
05007 else if(thePDG==3122) thePDG=91000000;
05008 }
05009 G4QNucleus qNuc(q4M,thePDG);
05010 G4double GSMass =qNuc.GetGSMass();
05011 G4QContent totQC=qNuc.GetQCZNS();
05012 G4int bA =qNuc.GetA();
05013 G4int bZ =qNuc.GetZ();
05014 G4int bN =qNuc.GetN();
05015 #ifdef ppdebug
05016 G4cout<<"G4QN::EvaNuc: theBN="<<theBN<<", bA="<<bA<<", bZ="<<bZ<<", bN="<<bN<<G4endl;
05017 #endif
05018 G4int bS =qNuc.GetS();
05019 #ifdef debug
05020 if(bZ==2&&bN==5)G4cout<<"G4QNucleus::EvaNucl: (2,5) GSM="<<GSMass<<" > "
05021 <<G4QPDGCode(2112).GetNuclMass(2,4,0)+mNeut<<G4endl;
05022 if(bZ==1&&bN==3)G4cout<<"G4QNucl::EvaNucl: (1,3) GSM="<<GSMass<<" > "
05023 <<G4QPDGCode(2112).GetNuclMass(1,2,0)+mNeut<<G4endl;
05024 G4double dM=totMass-GSMass;
05025 G4cout<<"G4QNucl::EvaNuc:"<<qNuc<<",PDG="<<thePDG<<",M="<<totMass<<",dM="<<dM<<G4endl;
05027 #endif
05028 G4int bsCond =qNuc.SplitBaryon();
05029 G4bool dbsCond=qNuc.Split2Baryons();
05030 #ifdef debug
05031 G4cout<<"G4QNucleus::EvaporateNuc: bs="<<bsCond<<", dbs="<<dbsCond<<", A="<<bA<<G4endl;
05032 #endif
05033 if(fabs(totMass-GSMass)<.003&&!bsCond&&!dbsCond)
05034 {
05035 #ifdef debug
05036 G4cout<<"G4QN::EvaNuc: GS direct "<<qH->GetQC()<<qH->Get4Momentum()<<" AsIs"<<G4endl;
05037 #endif
05038 evaHV->push_back(qH);
05039 return;
05040 }
05041 else if ( ( bA == 1 || (!bsCond && !dbsCond) ) && totMass > GSMass+.003 )
05042
05043 {
05044 #ifdef debug
05045 G4cout<<"G4QN::EvaN:SplitBar, s="<<bsCond<<",M="<<totMass<<" > GSM="<<GSMass<<G4endl;
05046 #endif
05047 G4int nOfOUT = evaHV->size();
05048 G4bool bnfound=true;
05049 while(nOfOUT)
05050 {
05051 G4QHadron* theLast = (*evaHV)[nOfOUT-1];
05052 G4int lastBN = theLast->GetBaryonNumber();
05053 G4int nFrag = theLast->GetNFragments();
05055 #ifdef debug
05056 G4cout<<"G4QN::EvaNuc:*BackFus*,BN="<<lastBN<<",nF="<<nFrag<<",n="<<nOfOUT<<G4endl;
05057 #endif
05058 while(nFrag)
05059 {
05060 G4QHadron* thePrev = (*evaHV)[nOfOUT-2];
05061 nFrag = thePrev->GetNFragments();
05062 G4int prevBN = thePrev->GetBaryonNumber();
05063 #ifdef debug
05064 G4int prevPDG = thePrev->GetPDGCode();
05065 G4cout<<"G4QNucl::EvaNucl: DelTheLast, nFr="<<nFrag<<", pPDG="<<prevPDG<<G4endl;
05066 #endif
05067 evaHV->pop_back();
05068 delete theLast;
05069 theLast = thePrev;
05070 lastBN=prevBN;
05071 nOfOUT--;
05072 }
05073 if(nOfOUT)
05074 {
05075 if(lastBN<1&&nOfOUT>1)
05076 {
05077 G4QHadron* thePrev = (*evaHV)[nOfOUT-2];
05078 evaHV->pop_back();
05079 evaHV->pop_back();
05080 evaHV->push_back(theLast);
05081 evaHV->push_back(thePrev);
05082 theLast = thePrev;
05083 }
05084 G4LorentzVector last4M = theLast->Get4Momentum();
05085 G4QContent lastQC = theLast->GetQC();
05086 G4double lastM = last4M.m();
05087 totQC+=lastQC;
05088 q4M+=last4M;
05089 totMass=q4M.m();
05090 G4int totPDG=totQC.GetSPDGCode();
05091 if(totPDG==10&&totQC.GetBaryonNumber()>0) totPDG=totQC.GetZNSPDGCode();
05092 G4int totBN=totQC.GetBaryonNumber();
05093 G4double dM=totMass-GSMass-lastM;
05094 #ifdef debug
05095 G4cout<<"G4QN::EvaNuc: tM="<<totMass<<"-LM="<<lastM<<lastQC<<"-GSM="<<GSMass<<"="
05096 <<dM<<G4endl;
05097 #endif
05098 if(dM>-0.001)
05099 {
05100 G4QHadron* evH = new G4QHadron(totPDG,q4M);
05101 if(dM<=0.)
05102 {
05103 evaHV->pop_back();
05104 delete theLast;
05105 #ifdef qdebug
05106 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (16) qH=0"<<G4endl;
05107 #endif
05108 delete qH;
05109 #ifdef debug
05110 G4cout<<"G4QNucleus::EvaporateNucl: EVH "<<totPDG<<q4M<<" fill AsIs"<<G4endl;
05111 #endif
05112 if(totBN==2)DecayDibaryon(evH,evaHV);
05113 else evaHV->push_back(evH);
05114 }
05115 else
05116 {
05117 G4LorentzVector r4Mom(0.,0.,0.,GSMass);
05118 if(!G4QHadron(q4M).DecayIn2(last4M,r4Mom))
05119 {
05120 evaHV->pop_back();
05121 delete theLast;
05122 #ifdef qdebug
05123 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (17) qH=0"<<G4endl;
05124 #endif
05125 delete qH;
05126 #ifdef debug
05127 G4cout<<"***G4QNucleus::EvaNucl: EVH "<<totPDG<<q4M<<" fill AsIs"<<G4endl;
05128 #endif
05129 evaHV->push_back(evH);
05130 #ifdef debug
05131 G4cout<<"***G4QN::EvaN:DecayIn L"<<lastQC<<"+RN"<<totQC<<" failed"<<G4endl;
05132 #endif
05133 }
05134 else
05135 {
05136 delete evH;
05137 #ifdef qdebug
05138 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (18) qH=0"<<G4endl;
05139 #endif
05140 delete qH;
05141 theLast->Set4Momentum(last4M);
05142 G4QHadron* nucH = new G4QHadron(thePDG,r4Mom);
05143 #ifdef debug
05144 G4cout<<"G4QNucleus::EvaNuc:fill NH "<<totPDG<<r4Mom<<G4endl;
05145 #endif
05146
05147 if(thePDG==92000000||thePDG==90002000||thePDG==90000002)
05148 DecayDibaryon(nucH,evaHV);
05149 else evaHV->push_back(nucH);
05150 }
05151 }
05152 bnfound=false;
05153 break;
05154 }
05155 thePDG=totPDG;
05156 GSMass=G4QPDGCode(thePDG).GetMass();
05157 evaHV->pop_back();
05158 delete theLast;
05159 nOfOUT--;
05160 }
05161 }
05162 if(bnfound)
05163 {
05164 G4LorentzVector h4Mom(0.,0.,0.,GSMass);
05165 G4LorentzVector g4Mom(0.,0.,0.,0.);
05166 if(!G4QHadron(q4M).DecayIn2(h4Mom, g4Mom))
05167 {
05168 #ifdef qdebug
05169 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (19) qH=0"<<G4endl;
05170 #endif
05171 delete qH;
05172
05173
05174 G4ExceptionDescription ed;
05175 ed << " Decay in Gamma failed: h=" << thePDG << "(GSM=" << GSMass
05176 << ")+g>tM=" << totMass << G4endl;
05177 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0017",
05178 FatalException, ed);
05179 }
05180 #ifdef debug
05181 G4cout<<"G4QNuc::EvaNuc: "<<q4M<<"->totResN="<<thePDG<<h4Mom<<"+g="<<g4Mom<<G4endl;
05182 #endif
05183 G4QHadron* curH = new G4QHadron(thePDG,h4Mom);
05184 #ifdef debug
05185 G4cout<<"G4QNucleus::EvaporateNucleus: Fill a Fragment="<<thePDG<<h4Mom<<G4endl;
05186 #endif
05187 if(thePDG==92000000||thePDG==90002000||thePDG==90000002) DecayDibaryon(curH,evaHV);
05188 else evaHV->push_back(curH);
05189 G4QHadron* curG = new G4QHadron(22,g4Mom);
05190 #ifdef debug
05191 G4cout<<"G4QNucleus::EvaporateNucleus: Fill a Gamma="<<g4Mom<<G4endl;
05192 #endif
05193 evaHV->push_back(curG);
05194 #ifdef qdebug
05195 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (20) qH=0"<<G4endl;
05196 #endif
05197 delete qH;
05198 }
05199 }
05200 else if(bA>0&&bS<0) DecayAntiStrange(qH,evaHV);
05201 else if(bA==2) DecayDibaryon(qH,evaHV);
05202 else if(bA==-2) DecayAntiDibaryon(qH,evaHV);
05203 else if(totMass<GSMass+.003&&(bsCond||dbsCond))
05204 {
05205 #ifdef pdebug
05206 G4cout<<"G4QN::EvN:2B="<<dbsCond<<",B="<<bsCond<<",M="<<totMass<<"<"<<GSMass<<G4endl;
05207 #endif
05208
05209 G4int gResPDG=0;
05210 if(bN==4&&bZ==2&&!bS)
05211 {
05212 gResPDG= thePDG;
05213
05214 }
05215 G4double nResM =1000000.;
05216 G4int nResPDG=0;
05217 if(bsCond==2112&&bN>0&&bA>1)
05218 {
05219 G4QContent resQC=totQC-neutQC;
05220 G4QNucleus resN(resQC);
05221 nResPDG=resN.GetPDG();
05222 if (nResPDG==90000001) nResM=mNeut;
05223 else if(nResPDG==90001000) nResM=mProt;
05224 else if(nResPDG==91000000) nResM=mLamb;
05225 else nResM=resN.GetMZNS();
05226 }
05227 G4double pResM =1000000.;
05228 G4int pResPDG=0;
05229 if(bsCond==2212&&bZ>0&&bA>1)
05230 {
05231 G4QContent resQC=totQC-protQC;
05232 G4QNucleus resN(resQC);
05233 pResPDG=resN.GetPDG();
05234 if (pResPDG==90000001) pResM=mNeut;
05235 else if(pResPDG==90001000) pResM=mProt;
05236 else if(pResPDG==91000000) pResM=mLamb;
05237 else pResM =resN.GetMZNS();
05238 }
05239 G4double lResM =1000000.;
05240 G4int lResPDG=0;
05241 if(bsCond==3122&&bS>0&&bA>1)
05242 {
05243 G4QContent resQC=totQC-lambQC;
05244 G4QNucleus resN(resQC);
05245 lResPDG=resN.GetPDG();
05246 if (lResPDG==90000001) lResM=mNeut;
05247 else if(lResPDG==90001000) lResM=mProt;
05248 else if(lResPDG==91000000) lResM=mLamb;
05249 else lResM =resN.GetMZNS();
05250 }
05251 G4double dResM =1000000.;
05252 G4int dResPDG=0;
05253 if(bsCond==90001001&&bN>0&&bZ>0&&bA>2)
05254 {
05255 G4QContent resQC=totQC-deutQC;
05256 G4QNucleus resN(resQC);
05257 dResPDG=resN.GetPDG();
05258 if (dResPDG==90000001) dResM=mNeut;
05259 else if(dResPDG==90001000) dResM=mProt;
05260 else if(dResPDG==91000000) dResM=mLamb;
05261 else dResM =resN.GetMZNS();
05262 }
05263 G4double aResM =1000000.;
05264 G4int aResPDG=0;
05265 if(bsCond==90002002&&bN>1&&bZ>1&&bA>4)
05266 {
05267 G4QContent resQC=totQC-alphQC;
05268 G4QNucleus resN(resQC);
05269 aResPDG=resN.GetPDG();
05270 if (aResPDG==90000001) aResM=mNeut;
05271 else if(aResPDG==90001000) aResM=mProt;
05272 else if(aResPDG==91000000) aResM=mLamb;
05273 else aResM =resN.GetMZNS();
05274 }
05275 G4double nnResM =1000000.;
05276 G4int nnResPDG=0;
05277 if(dbsCond&&bN>1&&bA>2)
05278 {
05279 G4QContent resQC=totQC-neutQC-neutQC;
05280 G4QNucleus resN(resQC);
05281 nnResPDG=resN.GetPDG();
05282 if (nnResPDG==90000001) nnResM=mNeut;
05283 else if(nnResPDG==90001000) nnResM=mProt;
05284 else if(nnResPDG==91000000) nnResM=mLamb;
05285 else nnResM =resN.GetMZNS();
05286 }
05287 G4double ppResM =1000000.;
05288 G4int ppResPDG=0;
05289 if(dbsCond&&bZ>1&&bA>2)
05290 {
05291 G4QContent resQC=totQC-protQC-protQC;
05292 G4QNucleus resN(resQC);
05293 ppResPDG=resN.GetPDG();
05294 if (ppResPDG==90000001) ppResM=mNeut;
05295 else if(ppResPDG==90001000) ppResM=mProt;
05296 else if(ppResPDG==91000000) ppResM=mLamb;
05297 else ppResM =resN.GetMZNS();
05298 }
05299 G4double npResM =1000000.;
05300 G4int npResPDG=0;
05301 if(dbsCond&&bN>0&&bZ>0&&bA>2)
05302 {
05303 G4QContent resQC=totQC-neutQC-protQC;
05304 G4QNucleus resN(resQC);
05305 npResPDG=resN.GetPDG();
05306 if (npResPDG==90000001) npResM=mNeut;
05307 else if(npResPDG==90001000) npResM=mProt;
05308 else if(npResPDG==91000000) npResM=mLamb;
05309 else npResM =resN.GetMZNS();
05310 }
05311 G4double lnResM =1000000.;
05312 G4int lnResPDG=0;
05313 if(dbsCond&&bN>0&&bS>0&&bA>2)
05314 {
05315 G4QContent resQC=totQC-lambQC-protQC;
05316 G4QNucleus resN(resQC);
05317 lnResPDG=resN.GetPDG();
05318 if (lnResPDG==90000001) lnResM=mNeut;
05319 else if(lnResPDG==90001000) lnResM=mProt;
05320 else if(lnResPDG==91000000) lnResM=mLamb;
05321 else lnResM =resN.GetMZNS();
05322 }
05323 G4double lpResM =1000000.;
05324 G4int lpResPDG=0;
05325 if(dbsCond&&bS>0&&bZ>0&&bA>2)
05326 {
05327 G4QContent resQC=totQC-neutQC-protQC;
05328 G4QNucleus resN(resQC);
05329 lpResPDG=resN.GetPDG();
05330 if (lpResPDG==90000001) lpResM=mNeut;
05331 else if(lpResPDG==90001000) lpResM=mProt;
05332 else if(lpResPDG==91000000) lpResM=mLamb;
05333 else lpResM =resN.GetMZNS();
05334 }
05335 G4double llResM =1000000.;
05336 G4int llResPDG=0;
05337 if(dbsCond&&bS>1&&bA>2)
05338 {
05339 G4QContent resQC=totQC-neutQC-protQC;
05340 G4QNucleus resN(resQC);
05341 llResPDG=resN.GetPDG();
05342 if (llResPDG==90000001) llResM=mNeut;
05343 else if(llResPDG==90001000) llResM=mProt;
05344 else if(llResPDG==91000000) llResM=mLamb;
05345 else llResM =resN.GetMZNS();
05346 }
05347 #ifdef debug
05348 G4cout<<"G4QNucleus::EvaNucl: rP="<<pResPDG<<",rN="<<nResPDG<<",rL="<<lResPDG<<",N="
05349 <<bN<<",Z="<<bZ<<",nL="<<bS<<",totM="<<totMass<<",n="<<totMass-nResM-mNeut
05350 <<",p="<<totMass-pResM-mProt<<",l="<<totMass-lResM-mLamb<<G4endl;
05351 #endif
05352 if ( thePDG == 90004004 ||
05353 (thePDG == 90002004 && totMass > mHel6+.003) ||
05354 (bA > 4 && bsCond && bN > 1 && bZ > 1 && totMass > aResM+mAlph) ||
05355 (bA > 1 && bsCond && ( (bN > 0 && totMass > nResM+mNeut) ||
05356 (bZ > 0 && totMass > pResM+mProt) ||
05357 (bS > 0 && totMass > lResM+mLamb) ) ) ||
05358 (bA > 2 &&
05359 (( bN > 0 && bZ > 0 &&
05360 ( (bsCond && totMass > dResM+mDeut) || (dbsCond && totMass > dResM+mDeut) )
05361 ) || ( dbsCond && ( (bN > 1 && totMass > nnResM+mNeut+mNeut) ||
05362 (bZ > 1 && totMass > ppResM+mProt+mProt) ||
05363 (bS > 1 && totMass > llResM+mLamb+mLamb) ||
05364 (bN && bS && totMass > lnResM+mLamb+mNeut) ||
05365 (bZ && bS && totMass > lpResM+mLamb+mProt)
05366 )
05367 )
05368 )
05369 )
05370 )
05371 {
05372 G4int barPDG = 90002002;
05373 G4int resPDG = 90002002;
05374 G4int thdPDG = 0;
05375 G4double barM= mAlph;
05376 G4double resM= mAlph;
05377 G4double thdM= mNeut;
05378 G4double tMC=totMass+.0002;
05379 if(gResPDG&&tMC>mHel6+.003)
05380 {
05381 barPDG=90002004;
05382 resPDG=22;
05383 barM =mHel6;
05384 resM =0.;
05385 }
05386 else if(nResPDG&&tMC>nResM+mNeut)
05387 {
05388 barPDG=90000001;
05389 resPDG=nResPDG;
05390 barM =mNeut;
05391 resM =nResM;
05392 }
05393 else if(pResPDG&&totMass+.001>pResM+mProt)
05394 {
05395 barPDG=90001000;
05396 resPDG=pResPDG;
05397 barM =mProt;
05398 resM =pResM;
05399 }
05400 else if(lResPDG&&tMC>lResM+mLamb)
05401 {
05402 barPDG=91000000;
05403 resPDG=lResPDG;
05404 barM =mLamb;
05405 resM =lResM;
05406 }
05407 else if(thePDG!=90004004&&bN>1&&bZ>1&&bA>4&&tMC>aResM+mAlph)
05408 {
05409 barPDG=90002002;
05410 resPDG=aResPDG;
05411 barM =mAlph;
05412 resM =aResM;
05413 }
05414 else if(dResPDG&&tMC>dResM+mDeut)
05415 {
05416 barPDG=90001001;
05417 resPDG=dResPDG;
05418 barM =mDeut;
05419 resM =dResM;
05420 }
05421 else if(ppResPDG&&tMC>ppResM+mProt+mProt)
05422 {
05423 barPDG=90001000;
05424 resPDG=ppResPDG;
05425 thdPDG=90001000;
05426 barM =mProt;
05427 resM =ppResM;
05428 thdM =mProt;
05429 }
05430 else if(nnResPDG&&tMC>nnResM+mNeut+mNeut)
05431 {
05432 barPDG=90000001;
05433 resPDG=nnResPDG;
05434 thdPDG=90000001;
05435 barM =mNeut;
05436 resM =nnResM;
05437 }
05438 else if(npResPDG&&tMC>npResM+mProt+mNeut)
05439 {
05440 barPDG=90001000;
05441 resPDG=npResPDG;
05442 thdPDG=90000001;
05443 barM =mProt;
05444 resM =npResM;
05445 }
05446 else if(lnResPDG&&tMC>lnResM+mLamb+mNeut)
05447 {
05448 barPDG=91000000;
05449 resPDG=lnResPDG;
05450 thdPDG=90000001;
05451 barM =mLamb;
05452 resM =lnResM;
05453 }
05454 else if(lpResPDG&&tMC>lpResM+mLamb+mProt)
05455 {
05456 barPDG=91000000;
05457 resPDG=lpResPDG;
05458 thdPDG=90001000;
05459 barM =mLamb;
05460 resM =lpResM;
05461 thdM =mProt;
05462 }
05463 else if(llResPDG&&tMC>llResM+mLamb+mLamb)
05464 {
05465 barPDG=91000000;
05466 resPDG=llResPDG;
05467 thdPDG=91000000;
05468 barM =mLamb;
05469 resM =llResM;
05470 thdM =mLamb;
05471 }
05472 else if(thePDG!=90004004&&tMC>GSMass)
05473 {
05474 barPDG=thePDG;
05475 resPDG=22;
05476 barM =GSMass;
05477 resM =0.;
05478 }
05479 else if(thePDG!=90004004)
05480 {
05481
05482
05483 G4ExceptionDescription ed;
05484 ed << "M<GSM & can't decayInPNL: PDG=" << thePDG << ",M=" << totMass
05485 << "< GSM=" << GSMass << G4endl;
05486 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0018",
05487 FatalException, ed);
05488 }
05489 G4LorentzVector a4Mom(0.,0.,0.,barM);
05490 G4LorentzVector b4Mom(0.,0.,0.,resM);
05491 if(!thdPDG)
05492 {
05493 if(!qH->DecayIn2(a4Mom,b4Mom))
05494 {
05495 evaHV->push_back(qH);
05496 G4cout<<"---Warning---G4QNucleus::EvaNuc:rP="<<pResPDG<<",rN="<<nResPDG<<",rL="
05497 <<lResPDG<<",N="<<bN<<",Z="<<bZ<<",L="<<bS<<",totM="<<totMass<<",n="
05498 <<totMass-nResM-mNeut<<",p="<<totMass-pResM-mProt<<",l="
05499 <<totMass-lResM-mLamb<<G4endl;
05500 G4cout<<"---Warning---G4QN::EvN:DecIn2Error b="<<barPDG<<",r="<<resPDG<<G4endl;
05501 return;
05502 }
05503 else
05504 {
05505 #ifdef qdebug
05506 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (21) qH=0"<<G4endl;
05507 #endif
05508 delete qH;
05509 G4QHadron* HadrB = new G4QHadron(barPDG,a4Mom);
05510 #ifdef debug
05511 G4cout<<"G4QNucleus::EvaNucleus:(1) Baryon="<<barPDG<<a4Mom<<G4endl;
05512 #endif
05513 evaHV->push_back(HadrB);
05514 G4QHadron* HadrR = new G4QHadron(resPDG,b4Mom);
05515 #ifdef debug
05516 G4cout<<"G4QNucleus::EvaNucleus:(1) Residual="<<resPDG<<b4Mom<<G4endl;
05517 #endif
05518
05519 if(HadrR->GetBaryonNumber()>1) EvaporateNucleus(HadrR,evaHV);
05520 else evaHV->push_back(HadrR);
05521 }
05522 }
05523 else
05524 {
05525 G4LorentzVector c4Mom(0.,0.,0.,thdM);
05526 if(!qH->DecayIn3(a4Mom,b4Mom,c4Mom))
05527 {
05528 evaHV->push_back(qH);
05529 G4cout<<"---Warning---G4QN::EvN:rNN="<<nnResPDG<<",rNP="<<npResPDG<<",rPP="
05530 <<ppResPDG<<",N="<<bN<<",Z="<<bZ<<",L="<<bS<<",tM="<<totMass<<",nn="
05531 <<totMass-nnResM-mNeut-mNeut<<",np="<<totMass-npResM-mProt-mNeut<<",pp="
05532 <<totMass-ppResM-mProt-mProt<<G4endl;
05533 G4cout<<"---Warning---G4QN::EvN:DecIn2Error,b="<<barPDG<<",r="<<resPDG<<G4endl;
05534 return;
05535 }
05536 else
05537 {
05538 #ifdef qdebug
05539 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (22) qH=0"<<G4endl;
05540 #endif
05541 delete qH;
05542 G4QHadron* HadrB = new G4QHadron(barPDG,a4Mom);
05543 #ifdef debug
05544 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Baryon1="<<barPDG<<a4Mom<<G4endl;
05545 #endif
05546 evaHV->push_back(HadrB);
05547 G4QHadron* HadrC = new G4QHadron(thdPDG,c4Mom);
05548 #ifdef debug
05549 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Baryon2="<<thdPDG<<c4Mom<<G4endl;
05550 #endif
05551 evaHV->push_back(HadrC);
05552 G4QHadron* HadrR = new G4QHadron(resPDG,b4Mom);
05553 #ifdef debug
05554 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Residual="<<resPDG<<b4Mom<<G4endl;
05555 #endif
05556
05557 if(HadrR->GetBaryonNumber()>1) EvaporateNucleus(HadrR,evaHV);
05558 else evaHV->push_back(HadrR);
05559 }
05560 }
05561 }
05562 else if (fabs(totMass-GSMass)<.003)
05563 {
05564 #ifdef debug
05565 G4cout<<"*|*|*|*G4QNucleus::EvaporateNuc: fill AsIs. Should never be here"<<G4endl;
05566 #endif
05567 evaHV->push_back(qH);
05568 return;
05569 }
05570 else
05571 {
05572 #ifdef debug
05573 G4cout<<"***G4QNucl::EvaNuc: tM="<<totMass<<"("<<thePDG<<") < GSM="<<GSMass<<", d="
05574 <<totMass-GSMass<<", QC="<<qH->GetQC()<<qH->Get4Momentum()<<"*AsIs*"<<G4endl;
05575 #endif
05576 evaHV->push_back(qH);
05577 return;
05578 }
05579 }
05580 else
05581 {
05582 #ifdef pdebug
05583 G4cout<<"G4QN::EvaNuc:***EVA***tPDG="<<thePDG<<",M="<<totMass<<">GSM="<<GSMass<<",d="
05584 <<totMass-GSMass<<", N="<<qNuc.Get4Momentum()<<qNuc.Get4Momentum().m()<<G4endl;
05585 #endif
05586 G4LorentzVector b4M;
05587 G4LorentzVector r4M;
05588 G4bool evC=true;
05589 G4int bPDG=0;
05590 G4int rPDG=0;
05591
05592 G4double rM = 0.;
05593 G4int bB=0;
05594 G4int rB=0;
05595 G4QHadron* bHadron = new G4QHadron;
05596 G4QHadron* rHadron = new G4QHadron;
05597 G4int evcn=0;
05598
05599 G4int evcm=9;
05600
05601 while(evC&&evcn<evcm)
05602 {
05603 evC=true;
05604 evcn++;
05605 if(!qNuc.EvaporateBaryon(bHadron,rHadron))
05606 {
05607 #ifdef debug
05608 G4cout<<"***G4QNuc::EvaNuc:***EVA Failed***PDG="<<thePDG<<",M="<<totMass<<G4endl;
05609 #endif
05610 delete bHadron;
05611 delete rHadron;
05612 #ifdef debug
05613 G4cout<<"***G4QNucl::EvaNuc: Residual="<<qH->GetQC()<<qH->Get4Momentum()<<G4endl;
05614 #endif
05615 evaHV->push_back(qH);
05616 return;
05617 }
05618 evC=false;
05619 b4M=bHadron->Get4Momentum();
05620 r4M=rHadron->Get4Momentum();
05621
05622 rM = r4M.m();
05623 bB=bHadron->GetBaryonNumber();
05624 rB=rHadron->GetBaryonNumber();
05625 bPDG=bHadron->GetPDGCode();
05626 rPDG=rHadron->GetPDGCode();
05627 #ifdef debug
05628 G4int bC=bHadron->GetCharge();
05629
05630 G4double bCB=qNuc.CoulombBarrier(bC,bB);
05631
05632 G4cout<<"G4QNucl::EvaNuc:Attempt #"<<evcn<<" > "<<evcm<<", rPDG="<<rPDG<<", bPDG="
05633 <<bPDG<<", bE="<<b4M.e()-b4M.m()<<" > bCB="<<bCB<<G4endl;
05634 #endif
05635
05636 }
05637 #ifdef debug
05638 G4cout<<"G4QNucl::EvaNuc:*** EVA IS DONE *** F="<<bPDG<<b4M<<",bB="<<bB<<", ResNuc="
05639 <<rPDG<<r4M<<",rB="<<rB<<G4endl;
05640 #endif
05641 #ifdef qdebug
05642 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (23) qH=0"<<G4endl;
05643 #endif
05644 delete qH;
05645 if(bB<2) evaHV->push_back(bHadron);
05646 else if(bB==2) DecayDibaryon(bHadron,evaHV);
05647 else if(bB==4) evaHV->push_back(bHadron);
05648 else if(bB==5) DecayAlphaBar(bHadron,evaHV);
05649 else if(bPDG==90004002) DecayAlphaDiN(bHadron,evaHV);
05650 else if(bPDG==90004004) DecayAlphaAlpha(bHadron,evaHV);
05651 else
05652 {
05653 delete bHadron;
05654
05655
05656 G4ExceptionDescription ed;
05657 ed << "Wrong evaporation act: EvaNuc:bB=" << bB
05658 << ">2 - unexpected evaporated fragment" << G4endl;
05659 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0019",
05660 FatalException, ed);
05661 }
05662 if(rB>2) EvaporateNucleus(rHadron,evaHV);
05663 else if(rB==2)
05664 {
05665 G4double rGSM = rHadron->GetQPDG().GetMass();
05666 #ifdef debug
05667 G4cout<<"G4QNuc::EvaNuc:ResidDibM="<<rM<<",GSM="<<rGSM<<",M-GSM="<<rM-rGSM<<G4endl;
05668 #endif
05669 if(rM<=rGSM-0.01)
05670 {
05671 delete rHadron;
05672
05673
05674 G4ExceptionDescription ed;
05675 ed << "Evaporation below MassShell: <residual> M=" << rM << " < GSM="
05676 << rGSM << G4endl;
05677 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0020",
05678 FatalException, ed);
05679 }
05680 else if(fabs(rM-rGSM)<0.01&&rPDG==90001001) evaHV->push_back(rHadron);
05681 else DecayDibaryon(rHadron,evaHV);
05682 }
05683 else if(rB==5) DecayAlphaBar(rHadron,evaHV);
05684 else if(rPDG==90004002) DecayAlphaDiN(rHadron,evaHV);
05685 else if(rPDG==90004004) DecayAlphaAlpha(rHadron,evaHV);
05686 else evaHV->push_back(rHadron);
05687 }
05688 #ifdef debug
05689 G4cout<<"G4QNucleus::EvaporateNucleus: === End of the evaporation attempt"<<G4endl;
05690 #endif
05691 }
05692 else
05693 {
05694 #ifdef debug
05695 G4cout<<"*G4QNucleus::EvaporateNucleus: InputHadron4M="<<q4M<<", PDG="<<thePDG<<G4endl;
05696 #endif
05697 if(thePDG)
05698 {
05699 if(thePDG==10)
05700 {
05701 G4QContent totQC = qH->GetQC();
05702 G4QChipolino resChip(totQC);
05703 G4QPDGCode h1=resChip.GetQPDG1();
05704 G4double m1 =h1.GetMass();
05705 G4QPDGCode h2=resChip.GetQPDG2();
05706 G4double m2_value =h2.GetMass();
05707 if(totMass+.0001>m1+m2_value)
05708 {
05709 #ifdef qdebug
05710 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (24) qH=0"<<G4endl;
05711 #endif
05712 delete qH;
05713 G4LorentzVector fq4M(0.,0.,0.,m1);
05714 G4LorentzVector qe4M(0.,0.,0.,m2_value);
05715 if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
05716 {
05717
05718
05719 G4ExceptionDescription ed;
05720 ed << "Chipol->h1+h2 DecIn2 error: tM=" << totMass << "-> h1M="
05721 << m1 <<" + h2M=" << m2_value << G4endl;
05722 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0021",
05723 FatalException, ed);
05724 }
05725 G4QHadron* H2 = new G4QHadron(h2.GetPDGCode(),qe4M);
05726 #ifdef debug
05727 G4cout<<"G4QNucleus::EvaporateNucleus:(2) h2="<<h2.GetPDGCode()<<qe4M<<G4endl;
05728 #endif
05729 evaHV->push_back(H2);
05730 G4QHadron* H1 = new G4QHadron(h1.GetPDGCode(),fq4M);
05731 #ifdef debug
05732 G4cout<<"G4QNucleus::EvaporateNucleus:(2) h1="<<h1.GetPDGCode()<<fq4M<<G4endl;
05733 #endif
05734 evaHV->push_back(H1);
05735 }
05736 else
05737 {
05738 #ifdef qdebug
05739 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (25) qH=0"<<G4endl;
05740 #endif
05741 delete qH;
05742
05743
05744 G4ExceptionDescription ed;
05745 ed << "Chipolino is under MassShell: M=" << totMass << "<" << m1
05746 << "+" << m2_value << ",d=" << m1+m2_value-totMass << G4endl;
05747 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0022",
05748 FatalException, ed);
05749 }
05750 }
05751 else
05752 {
05753 G4double totM=G4QPDGCode(thePDG).GetMass();
05754 if(fabs(totMass-totM)<0.001||abs(thePDG)-10*(abs(thePDG)/10)>2)
05755 {
05756 #ifdef debug
05757 G4cout<<"**G4QNuc::EvaNuc:EmerFill(2) "<<qH->GetQC()<<qH->Get4Momentum()<<G4endl;
05758 #endif
05759 evaHV->push_back(qH);
05760 }
05761 else if ((thePDG==221||thePDG==331)&&totMass>mPi+mPi)
05762 {
05763 #ifdef qdebug
05764 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (26) qH=0"<<G4endl;
05765 #endif
05766 delete qH;
05767 G4LorentzVector fq4M(0.,0.,0.,mPi);
05768 G4LorentzVector qe4M(0.,0.,0.,mPi);
05769 if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
05770 {
05771
05772
05773 G4ExceptionDescription ed;
05774 ed << "H->Pi+Pi DecayIn2 error: tM=" << totMass << "-> pi+ + pi-"
05775 << G4endl;
05776 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0023",
05777 FatalException, ed);
05778 }
05779 G4QHadron* H1 = new G4QHadron(211,fq4M);
05780 #ifdef debug
05781 G4cout<<"G4QNucleus::EvaporateNucleus:(3) PiPlus="<<fq4M<<G4endl;
05782 #endif
05783 evaHV->push_back(H1);
05784 G4QHadron* H2 = new G4QHadron(-211,qe4M);
05785 #ifdef debug
05786 G4cout<<"G4QNucleus::EvaporateNucleus:(3) PiMinus="<<qe4M<<G4endl;
05787 #endif
05788 evaHV->push_back(H2);
05789 }
05790 else if ((thePDG==221||thePDG==331)&&totMass>mPi0+mPi0)
05791 {
05792 #ifdef qdebug
05793 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (27) qH=0"<<G4endl;
05794 #endif
05795 delete qH;
05796 G4LorentzVector fq4M(0.,0.,0.,mPi0);
05797 G4LorentzVector qe4M(0.,0.,0.,mPi0);
05798 if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
05799 {
05800
05801
05802 G4ExceptionDescription ed;
05803 ed << "H->Pi+Pi DecayIn2 error: tM=" << totMass << "-> pi0 + pi0"
05804 << G4endl;
05805 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0024",
05806 FatalException, ed);
05807 }
05808 G4QHadron* H1 = new G4QHadron(111,fq4M);
05809 #ifdef debug
05810 G4cout<<"G4QNucleus::EvaporateNucleus:(4) Pi01="<<fq4M<<G4endl;
05811 #endif
05812 evaHV->push_back(H1);
05813 G4QHadron* H2 = new G4QHadron(111,qe4M);
05814 #ifdef debug
05815 G4cout<<"G4QNucleus::EvaporateNucleus:(4) Pi02="<<qe4M<<G4endl;
05816 #endif
05817 evaHV->push_back(H2);
05818 }
05819 else if (totMass>totM)
05820 {
05821 #ifdef qdebug
05822 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (28) qH=0"<<G4endl;
05823 #endif
05824 delete qH;
05825 G4LorentzVector fq4M(0.,0.,0.,0.);
05826 G4LorentzVector qe4M(0.,0.,0.,totM);
05827 if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
05828 {
05829
05830
05831 G4ExceptionDescription ed;
05832 ed << "H*->H+gamma DecIn2 error: tM=" << totMass << "->h1M="
05833 << totM << "+gam" << G4endl;
05834 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0025",
05835 FatalException, ed);
05836 }
05837 G4QHadron* H2 = new G4QHadron(thePDG,qe4M);
05838 #ifdef debug
05839 G4cout<<"G4QNucleus::EvaporateNucleus:(5) tot="<<thePDG<<qe4M<<G4endl;
05840 #endif
05841 evaHV->push_back(H2);
05842 G4QHadron* H1 = new G4QHadron(22,fq4M);
05843 #ifdef debug
05844 G4cout<<"G4QNucleus::EvaporateNucleus:(5) GamFortot="<<fq4M<<G4endl;
05845 #endif
05846 evaHV->push_back(H1);
05847 }
05848 else if (thePDG==111||thePDG==221||thePDG==331)
05849 {
05850 #ifdef qdebug
05851 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (29) qH=0"<<G4endl;
05852 #endif
05853 delete qH;
05854 G4LorentzVector fq4M(0.,0.,0.,0.);
05855 G4LorentzVector qe4M(0.,0.,0.,0.);
05856 if(!G4QHadron(q4M).DecayIn2(fq4M,qe4M))
05857 {
05858
05859
05860 G4ExceptionDescription ed;
05861 ed << "pi/eta->g+g DecIn2 error: tM=" << totMass
05862 << "->gamma + gamma" << G4endl;
05863 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0026",
05864 FatalException, ed);
05865 }
05866 G4QHadron* H2 = new G4QHadron(22,qe4M);
05867 #ifdef debug
05868 G4cout<<"G4QNucleus::EvaporateNucleus:(6) gam1="<<qe4M<<G4endl;
05869 #endif
05870 evaHV->push_back(H2);
05871 G4QHadron* H1 = new G4QHadron(22,fq4M);
05872 #ifdef debug
05873 G4cout<<"G4QNucleus::EvaporateNucleus:(6) gam2="<<fq4M<<G4endl;
05874 #endif
05875 evaHV->push_back(H1);
05876 }
05877 else
05878 {
05879 #ifdef qdebug
05880 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (30) qH=0"<<G4endl;
05881 #endif
05882 delete qH;
05883
05884
05885
05886 G4ExceptionDescription ed;
05887 ed << "Hadron is under MassShell: Nuc=" << thePDG << theQC
05888 << ", q4M=" << q4M << ", M=" << totMass <<" < GSM=" << totM
05889 <<", 2Pi=" << mPi+mPi << ", 2Pi0=" << mPi0+mPi0 << G4endl;
05890 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0027",
05891 FatalException, ed);
05892 }
05893 }
05894 }
05895 else
05896 {
05897 #ifdef qdebug
05898 if(!qH) G4cout<<"-Warning-G4QNucleus::EvaporateNucleus: (31) qH=0"<<G4endl;
05899 #endif
05900 delete qH;
05901
05902
05903 G4ExceptionDescription ed;
05904 ed << "This is not aNucleus nor aHadron: RN=" << thePDG << theQC
05905 << ",q4M=" << q4M <<",qM=" << totMass << G4endl;
05906 G4Exception("G4QNucleus::EvaporateNucleus()", "HAD_CHPS_0028",
05907 FatalException, ed);
05908 }
05909 }
05910 #ifdef qdebug
05911 if (qH)
05912 {
05913 G4cout<<"G4QNucleus::EvaporateNucleus: deletedAtEnd, PDG="<<qH->GetPDGCode()<<G4endl;
05914 if(!qH) G4cout<<"G4QNucleus::EvaporateNucleus: (20) qH="<<G4endl;
05915 else delete qH;
05916 }
05917 #endif
05918 #ifdef debug
05919 G4cout<<"G4QNucleus::EvaporateNucleus: =---=>> End. "<<G4endl;
05920 #endif
05921 return;
05922 }
05923
05924
05925 void G4QNucleus::DecayIsonucleus(G4QHadron* qH, G4QHadronVector* evaHV)
05926 {
05927 static const G4double mPi = G4QPDGCode(211).GetMass();
05928 static const G4double mNeut= G4QPDGCode(2112).GetMass();
05929 static const G4double mProt= G4QPDGCode(2212).GetMass();
05930 static const G4double mLamb= G4QPDGCode(3122).GetMass();
05931
05932 static const G4double mSigP= G4QPDGCode(3222).GetMass();
05933 static const G4double mSigM= G4QPDGCode(3112).GetMass();
05934 static const G4double eps = 0.003;
05935 G4LorentzVector q4M = qH->Get4Momentum();
05936 G4double qM=q4M.m();
05937 G4QContent qQC = qH->GetQC();
05938 G4int qBN=qQC.GetBaryonNumber();
05939 G4int qC=qQC.GetCharge();
05940 G4int qS=qQC.GetStrangeness();
05941 #ifdef debug
05942 G4cout<<"G4QNuc:DecayIson:QC="<<qQC<<",M="<<qM<<",B="<<qBN<<",S="<<qS<<",C="<<qC<<G4endl;
05943 #endif
05944 if(qS<0||qS>qBN)
05945 {
05946 G4cout<<"--Warning(Upgrade)--G4QNuc::DecIsonuc:FillAsIs,4M="<<q4M<<",QC="<<qQC<<G4endl;
05947 evaHV->push_back(qH);
05948 return;
05949 }
05950 G4int qPN=qC-qBN;
05951 G4int fPDG = 2212;
05952 G4int sPDG = 211;
05953 G4int tPDG = 3122;
05954 G4double fMass= mProt;
05955 G4double sMass= mPi;
05956 G4double tMass= mLamb;
05957
05958 if(qC<0)
05959 {
05960 if(qS&&qBN==qS)
05961 {
05962 sPDG = -211;
05963 if(-qC==qS && qS==1)
05964 {
05965 if(fabs(qM-mSigM)<eps)
05966 {
05967 evaHV->push_back(qH);
05968 return;
05969 }
05970 else if(qM>mLamb+mPi)
05971 {
05972 fPDG = 3122;
05973 fMass= mLamb;
05974 }
05975 else if(qM>mSigM)
05976 {
05977 fPDG = 3112;
05978 fMass= mSigM;
05979 sPDG = 22;
05980 sMass= 0.;
05981 }
05982 else
05983 {
05984 fPDG = 2112;
05985 fMass= mNeut;
05986 }
05987 qPN = 1;
05988 }
05989 else if(-qC==qS)
05990 {
05991 qPN = 1;
05992 fPDG = 3112;
05993 sPDG = 3112;
05994 sMass= mSigM;
05995 qBN--;
05996 fMass= mSigM;
05997 }
05998 else if(-qC>qS)
05999 {
06000 qPN = -qC-qS;
06001 fPDG = 3112;
06002 fMass= mSigM;
06003 }
06004 else
06005 {
06006 qBN += qC;
06007 fPDG = 3122;
06008 fMass= mLamb;
06009 qPN = -qC;
06010 sPDG = 3112;
06011 sMass= mSigM;
06012 }
06013 qS = 0;
06014 }
06015 else if(qS)
06016 {
06017 qBN -= qS;
06018 fPDG = 2112;
06019 fMass= mNeut;
06020 G4int nPin = -qC;
06021 if(qS==nPin)
06022 {
06023 qPN = qS;
06024 sPDG = 3112;
06025 sMass= mSigM;
06026 qS = 0;
06027 }
06028 else if(qS>nPin)
06029 {
06030 qS-=nPin;
06031 qPN = nPin;
06032 sPDG = 3112;
06033 sMass= mSigM;
06034 }
06035 else
06036 {
06037 qPN = nPin-qS;
06038 sPDG = -211;
06039 tPDG = 3112;
06040 tMass= mSigM;
06041 }
06042 }
06043 else
06044 {
06045 sPDG = -211;
06046 qPN = -qC;
06047 fPDG = 2112;
06048 fMass= mNeut;
06049 }
06050 }
06051 else if(!qC)
06052 {
06053 if(qS && qS<qBN)
06054 {
06055 qPN = qS;
06056 fPDG = 2112;
06057 sPDG = 3122;
06058 sMass= mLamb;
06059 qBN -= qS;
06060 fMass= mNeut;
06061 qS = 0;
06062 }
06063 else if(qS>1 && qBN==qS)
06064 {
06065 qPN = 1;
06066 fPDG = 3122;
06067 sPDG = 3122;
06068 sMass= mLamb;
06069 qBN--;
06070 fMass= mLamb;
06071 }
06072 else if(!qS && qBN>1)
06073 {
06074 qPN = 1;
06075 fPDG = 2112;
06076 sPDG = 2112;
06077 sMass= mNeut;
06078 qBN--;
06079 fMass= mNeut;
06080 }
06081 else G4cout<<"*?*G4QNuc::DecayIsonucleus: (1) QC="<<qQC<<G4endl;
06082 }
06083 else if(qC>0)
06084 {
06085 if(qS && qS+qC==qBN)
06086 {
06087 qPN = qS;
06088 qS = 0;
06089 fPDG = 2212;
06090 sPDG = 3122;
06091 sMass= mLamb;
06092 qBN = qC;
06093 fMass= mProt;
06094 }
06095 else if(qS && qC<qBN-qS)
06096 {
06097 qPN = qC;
06098 fPDG = 2112;
06099 sPDG = 2212;
06100 sMass= mProt;
06101 qBN -= qS+qC;
06102 fMass= mNeut;
06103 }
06104 else if(qS && qBN==qS)
06105 {
06106 if(qC==qS && qS==1)
06107 {
06108 if(fabs(qM-mSigP)<eps)
06109 {
06110 evaHV->push_back(qH);
06111 return;
06112 }
06113 else if(qM>mLamb+mPi)
06114 {
06115 fPDG = 3122;
06116 fMass= mLamb;
06117 }
06118 else if(qM>mNeut+mPi)
06119 {
06120 fPDG = 2112;
06121 fMass= mNeut;
06122 }
06123 else if(qM>mSigP)
06124 {
06125 fPDG = 3222;
06126 fMass= mSigP;
06127 sPDG = 22;
06128 sMass= 0.;
06129 }
06130 else
06131 {
06132 fPDG = 2212;
06133 fMass= mProt;
06134 sPDG = 22;
06135 sMass= 0.;
06136 }
06137 qPN = 1;
06138 }
06139 else if(qC==qS)
06140 {
06141 qPN = 1;
06142 fPDG = 3222;
06143 sPDG = 3222;
06144 sMass= mSigP;
06145 qBN--;
06146 fMass= mSigP;
06147 }
06148 else if(qC>qS)
06149 {
06150 qPN = qC-qS;
06151 fPDG = 3222;
06152 qBN = qS;
06153 fMass= mSigP;
06154 }
06155 else
06156 {
06157 qBN -= qC;
06158 fPDG = 3122;
06159 fMass= mLamb;
06160 qPN = qC;
06161 sPDG = 3222;
06162 sMass= mSigP;
06163 }
06164 qS = 0;
06165 }
06166 else if(qS && qC>qBN-qS)
06167 {
06168 qBN -= qS;
06169 G4int nPip = qC-qBN;
06170 if(qS==nPip)
06171 {
06172 qPN = qS;
06173 sPDG = 3222;
06174 sMass= mSigP;
06175 qS = 0;
06176 }
06177 else if(qS>nPip)
06178 {
06179 qS -= nPip;
06180 qPN = nPip;
06181 sPDG = 3222;
06182 sMass= mSigP;
06183 }
06184 else
06185 {
06186 qPN = nPip-qS;
06187 tPDG = 3222;
06188 tMass= mSigP;
06189 }
06190 }
06191 if(qC<qBN)
06192 {
06193 fPDG = 2112;
06194 fMass= mNeut;
06195 qPN = qC;
06196 sPDG = 2212;
06197 sMass= mProt;
06198 }
06199 else if(qBN==qC && qC>1)
06200 {
06201 qPN = 1;
06202 fPDG = 2212;
06203 sPDG = 2212;
06204 sMass= mProt;
06205 qBN--;
06206 fMass= mProt;
06207 }
06208 else if(qC<=qBN||!qBN) G4cout<<"*?*G4QNuc::DecayIsonucleus: (2) QC="<<qQC<<G4endl;
06209
06210 }
06211 G4double tfM=qBN*fMass;
06212 G4double tsM=qPN*sMass;
06213 G4double ttM=0.;
06214 if(qS) ttM=qS*tMass;
06215 G4LorentzVector f4Mom(0.,0.,0.,tfM);
06216 G4LorentzVector s4Mom(0.,0.,0.,tsM);
06217 G4LorentzVector t4Mom(0.,0.,0.,ttM);
06218 G4double sum=tfM+tsM+ttM;
06219 if(fabs(qM-sum)<eps)
06220 {
06221 f4Mom=q4M*(tfM/sum);
06222 s4Mom=q4M*(tsM/sum);
06223 if(qS) t4Mom=q4M*(ttM/sum);
06224 }
06225 else if(!qS && (qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom)))
06226 {
06227 #ifdef debug
06228 G4cout<<"***G4QNuc::DecIsonuc:fPDG="<<fPDG<<"*"<<qBN<<"(fM="<<fMass<<")+sPDG="<<sPDG
06229 <<"*"<<qPN<<"(sM="<<sMass<<")"<<"="<<sum<<" > TotM="<<qM<<q4M<<qQC<<qS<<G4endl;
06230 #endif
06231 evaHV->push_back(qH);
06232 return;
06233 }
06234 else if(qS && (qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom)))
06235 {
06236 #ifdef debug
06237 G4cout<<"***G4QNuc::DecIsonuc: "<<fPDG<<"*"<<qBN<<"("<<fMass<<")+"<<sPDG<<"*"<<qPN<<"("
06238 <<sMass<<")+Lamb*"<<qS<<"="<<sum<<" > TotM="<<qM<<q4M<<qQC<<G4endl;
06239 #endif
06240 evaHV->push_back(qH);
06241 return;
06242 }
06243 #ifdef debug
06244 G4cout<<"G4QNuc::DecayIsonucleus: *DONE* n="<<qPN<<f4Mom<<fPDG<<", m="<<qPN<<s4Mom<<sPDG
06245 <<", l="<<qS<<t4Mom<<G4endl;
06246 #endif
06247 delete qH;
06248 if(qBN)
06249 {
06250 f4Mom/=qBN;
06251 for(G4int ih=0; ih<qBN; ih++)
06252 {
06253 G4QHadron* Hi = new G4QHadron(fPDG,f4Mom);
06254 evaHV->push_back(Hi);
06255 }
06256 }
06257 if(qPN)
06258 {
06259 s4Mom/=qPN;
06260 for(G4int ip=0; ip<qPN; ip++)
06261 {
06262 G4QHadron* Hj = new G4QHadron(sPDG,s4Mom);
06263 evaHV->push_back(Hj);
06264 }
06265 }
06266 if(qS)
06267 {
06268 t4Mom/=qS;
06269 for(G4int il=0; il<qS; il++)
06270 {
06271 G4QHadron* Hk = new G4QHadron(tPDG,t4Mom);
06272 evaHV->push_back(Hk);
06273 }
06274 }
06275 #ifdef qdebug
06276 if (qH)
06277 {
06278 G4cout << "G4QNucleus::DecayIsonucleus: deleted at end - PDG: "
06279 << qH->GetPDGCode() << G4endl;
06280 delete qH;
06281 }
06282 #endif
06283 }
06284
06285
06286 void G4QNucleus::DecayDibaryon(G4QHadron* qH, G4QHadronVector* evaHV)
06287 {
06288 static const G4double mPi = G4QPDGCode(211).GetMass();
06289 static const G4double mNeut= G4QPDGCode(2112).GetMass();
06290 static const G4double mProt= G4QPDGCode(2212).GetMass();
06291 static const G4double mSigM= G4QPDGCode(3112).GetMass();
06292 static const G4double mLamb= G4QPDGCode(3122).GetMass();
06293 static const G4double mSigP= G4QPDGCode(3222).GetMass();
06294 static const G4double mKsiM= G4QPDGCode(3312).GetMass();
06295 static const G4double mKsiZ= G4QPDGCode(3322).GetMass();
06296 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
06297 static const G4double mPiN = mPi+mNeut;
06298 static const G4double mPiP = mPi+mProt;
06299 static const G4double dmPiN= mPiN+mPiN;
06300 static const G4double dmPiP= mPiP+mPiP;
06301 static const G4double nnPi = mNeut+mPiN;
06302 static const G4double ppPi = mProt+mPiP;
06303 static const G4double lnPi = mLamb+mPiN;
06304 static const G4double lpPi = mLamb+mPiP;
06305 static const G4double dNeut= mNeut+mNeut;
06306 static const G4double dProt= mProt+mProt;
06307 static const G4double dLamb= mLamb+mLamb;
06308 static const G4double dLaNe= mLamb+mNeut;
06309 static const G4double dLaPr= mLamb+mProt;
06310 static const G4double dSiPr= mSigP+mProt;
06311 static const G4double dSiNe= mSigM+mNeut;
06312 static const G4double dKsPr= mKsiZ+mProt;
06313 static const G4double dKsNe= mKsiM+mNeut;
06314 static const G4double eps = 0.003;
06315 static const G4QNucleus vacuum(90000000);
06316 G4bool four=false;
06317 G4LorentzVector q4M = qH->Get4Momentum();
06318 G4int qPDG = qH->GetPDGCode();
06319 G4double qM = q4M.m();
06320 G4double rM = qM+eps;
06321 #ifdef debug
06322 G4cout<<"G4QNucl::DecayDibaryon: *Called* PDG="<<qPDG<<",4Mom="<<q4M<<", M="<<qM<<G4endl;
06323 #endif
06324
06325 G4int fPDG = 2212;
06326 G4int sPDG = 2212;
06327 G4int tPDG = 0;
06328 G4double fMass= mProt;
06329 G4double sMass= mProt;
06330 G4double tMass= mPi;
06331 if (qPDG==90003998 && rM>=dmPiP)
06332 {
06333 sPDG = 211;
06334 sMass= mPi;
06335 four = true;
06336 }
06337 else if(qPDG==89998004 && rM>=dmPiN)
06338 {
06339 sPDG = -211;
06340 fPDG = 2112;
06341 sMass= mPi;
06342 fMass= mNeut;
06343 four = true;
06344 }
06345 else if(qPDG==90000002 && rM>=dNeut)
06346 {
06347 fPDG = 2112;
06348 sPDG = 2112;
06349 fMass= mNeut;
06350 sMass= mNeut;
06351 }
06352 else if(qPDG==90001001 && rM>=mDeut)
06353 {
06354 if(fabs(qM-mDeut)<eps)
06355 {
06356 evaHV->push_back(qH);
06357 return;
06358 }
06359 else if(mProt+mNeut<rM)
06360 {
06361 fPDG = 2112;
06362 fMass= mNeut;
06363 }
06364 else
06365 {
06366 fPDG = 22;
06367 sPDG = 90001001;
06368 fMass= 0.;
06369 sMass= mDeut;
06370 }
06371 }
06372 else if(qPDG==91000001 && rM>=dLaNe)
06373 {
06374 fPDG = 2112;
06375 sPDG = 3122;
06376 fMass= mNeut;
06377 sMass= mLamb;
06378 }
06379 else if(qPDG==91001000 && rM>=dLaPr)
06380 {
06381 sPDG = 3122;
06382 sMass= mLamb;
06383 }
06384 else if(qPDG==89999003 && rM>=nnPi)
06385 {
06386 fPDG = 2112;
06387 sPDG = 2112;
06388 tPDG = -211;
06389 fMass= mNeut;
06390 sMass= mNeut;
06391 }
06392 else if(qPDG==90002999 && rM>=ppPi)
06393 {
06394 tPDG = 211;
06395 }
06396 else if(qPDG==90999002 && rM>=lnPi)
06397 {
06398 fPDG = 2112;
06399 sPDG = 3122;
06400 tPDG = -211;
06401 fMass= mNeut;
06402 sMass= mLamb;
06403 }
06404 else if(qPDG==91001999 && rM>=lpPi)
06405 {
06406 sPDG = 3122;
06407 tPDG = 211;
06408 sMass= mLamb;
06409 }
06410 else if(qPDG==90999002 && rM>=dSiNe)
06411 {
06412 fPDG = 2112;
06413 sPDG = 3112;
06414 fMass= mNeut;
06415 sMass= mSigM;
06416 }
06417 else if(qPDG==91001999 && rM>=dSiPr)
06418 {
06419 sPDG = 3222;
06420 sMass= mSigP;
06421 }
06422 else if(qPDG==92000000 && rM>=dLamb)
06423 {
06424 fPDG = 3122;
06425 sPDG = 3122;
06426 fMass= mLamb;
06427 sMass= mLamb;
06428 }
06429 else if(qPDG==91999001 && rM>=dKsNe)
06430 {
06431 fPDG = 2112;
06432 sPDG = 3312;
06433 fMass= mNeut;
06434 sMass= mKsiM;
06435 }
06436 else if(qPDG==92000999 && rM>=dKsPr)
06437 {
06438 sPDG = 3322;
06439 sMass= mKsiZ;
06440 }
06441 else if(qPDG!=90002000|| rM<dProt)
06442 {
06443 G4int qS = qH->GetStrangeness();
06444 G4int qB = qH->GetBaryonNumber();
06445 if(qB>0&&qS<0)
06446 {
06447 DecayAntiStrange(qH,evaHV);
06448 return;
06449 }
06450 else
06451 {
06452 delete qH;
06453 G4cerr<<"***G4QN::DecDiBar: badPDG="<<qPDG<<" or smallM="<<qM<<",2mP="<<dProt
06454 <<",2mN="<<dNeut<<G4endl;
06455
06456
06457 }
06458 }
06459 G4LorentzVector f4Mom(0.,0.,0.,fMass);
06460 G4LorentzVector s4Mom(0.,0.,0.,sMass);
06461 G4LorentzVector t4Mom(0.,0.,0.,tMass);
06462 if(!tPDG&&!four)
06463 {
06464 G4double sum=fMass+sMass;
06465 if(fabs(qM-sum)<eps)
06466 {
06467 f4Mom=q4M*(fMass/sum);
06468 s4Mom=q4M*(sMass/sum);
06469 }
06470 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06471 {
06472 G4cout<<"---Warning---G4QN::DecDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG<<"(M="
06473 <<sMass<<")="<<sum<<" >? TotM="<<q4M.m()<<q4M<<G4endl;
06474
06475
06476 evaHV->push_back(qH);
06477 return;
06478 }
06479 #ifdef debug
06480 G4cout<<"G4QNucleus::DecayDibaryon:(2) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06481 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06482 #endif
06483 delete qH;
06484 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06485 evaHV->push_back(H1);
06486 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06487 evaHV->push_back(H2);
06488 }
06489 else if(four)
06490 {
06491 q4M=q4M/2.;
06492 qM/=2.;
06493 G4double sum=fMass+sMass;
06494 if(fabs(qM-sum)<eps)
06495 {
06496 f4Mom=q4M*(fMass/sum);
06497 s4Mom=q4M*(sMass/sum);
06498 }
06499 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06500 {
06501 G4cout<<"---Warning---G4QN::DecDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG<<"(M="
06502 <<sMass<<")"<<"="<<sum<<">tM="<<q4M.m()<<q4M<<G4endl;
06503
06504
06505 evaHV->push_back(qH);
06506 return;
06507 }
06508 #ifdef debug
06509 G4cout<<"G4QNucleus::DecayDibaryon:(3) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06510 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06511 #endif
06512 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06513 evaHV->push_back(H1);
06514 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06515 evaHV->push_back(H2);
06516
06517 if(fabs(qM-sum)<eps)
06518 {
06519 f4Mom=q4M*(fMass/sum);
06520 s4Mom=q4M*(sMass/sum);
06521 }
06522 else if(!G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06523 {
06524
06525 delete qH;
06526
06527
06528
06529 G4ExceptionDescription ed;
06530 ed << "General DecayIn2 error: fPDG=" << fPDG << "(fM=" << fMass
06531 << ") + sPDG=" << sPDG <<"(sM=" << sMass << ")=" << sum
06532 << " >? (DD2,Can't be here) TotM=" << q4M.m() << q4M << G4endl;
06533 G4Exception("G4QNucleus::DecayDibaryon()", "HAD_CHPS_0000",
06534 FatalException, ed);
06535 }
06536 #ifdef debug
06537 G4cout<<"G4QNucl::DecayDibaryon:(4) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06538 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06539 #endif
06540 G4QHadron* H3 = new G4QHadron(fPDG,f4Mom);
06541 evaHV->push_back(H3);
06542 G4QHadron* H4 = new G4QHadron(sPDG,s4Mom);
06543 evaHV->push_back(H4);
06544 delete qH;
06545 }
06546 else
06547 {
06548 G4double sum=fMass+sMass+tMass;
06549 if(fabs(qM-sum)<eps)
06550 {
06551 f4Mom=q4M*(fMass/sum);
06552 s4Mom=q4M*(sMass/sum);
06553 t4Mom=q4M*(tMass/sum);
06554 }
06555 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
06556 {
06557 G4cout<<"---Warning---G4QN::DecDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG<<"(M="
06558 <<sMass<<")+tPDG="<<tPDG<<"(tM="<<tMass<<")="<<sum<<">TotM="<<q4M.m()<<G4endl;
06559
06560
06561 evaHV->push_back(qH);
06562 return;
06563 }
06564 #ifdef debug
06565 G4cout<<"G4QNuc::DecayDibaryon:(5) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG<<", s4M="<<s4Mom
06566 <<",sPDG="<<sPDG<<", t4M="<<t4Mom<<",tPDG="<<tPDG<<G4endl;
06567 #endif
06568
06569
06570
06571 delete qH;
06572
06573 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06574 evaHV->push_back(H1);
06575 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06576 evaHV->push_back(H2);
06577 G4QHadron* H3 = new G4QHadron(tPDG,t4Mom);
06578 evaHV->push_back(H3);
06579 }
06580 #ifdef qdebug
06581 if (qH)
06582 {
06583 G4cout << "G4QNucleus::DecayDiBaryon: deleted at end - PDG: "
06584 << qH->GetPDGCode() << G4endl;
06585 delete qH;
06586 }
06587 #endif
06588 }
06589
06590
06591 void G4QNucleus::DecayAntiDibaryon(G4QHadron* qH, G4QHadronVector* evaHV)
06592 {
06593 static const G4double mPi = G4QPDGCode(211).GetMass();
06594 static const G4double mNeut= G4QPDGCode(2112).GetMass();
06595 static const G4double mProt= G4QPDGCode(2212).GetMass();
06596 static const G4double mSigM= G4QPDGCode(3112).GetMass();
06597 static const G4double mLamb= G4QPDGCode(3122).GetMass();
06598 static const G4double mSigP= G4QPDGCode(3222).GetMass();
06599 static const G4double mKsiM= G4QPDGCode(3312).GetMass();
06600 static const G4double mKsiZ= G4QPDGCode(3322).GetMass();
06601 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
06602 static const G4double mPiN = mPi+mNeut;
06603 static const G4double mPiP = mPi+mProt;
06604 static const G4double dmPiN= mPiN+mPiN;
06605 static const G4double dmPiP= mPiP+mPiP;
06606 static const G4double nnPi = mNeut+mPiN;
06607 static const G4double ppPi = mProt+mPiP;
06608 static const G4double lnPi = mLamb+mPiN;
06609 static const G4double lpPi = mLamb+mPiP;
06610 static const G4double dNeut= mNeut+mNeut;
06611 static const G4double dProt= mProt+mProt;
06612 static const G4double dLamb= mLamb+mLamb;
06613 static const G4double dLaNe= mLamb+mNeut;
06614 static const G4double dLaPr= mLamb+mProt;
06615 static const G4double dSiPr= mSigP+mProt;
06616 static const G4double dSiNe= mSigM+mNeut;
06617 static const G4double dKsPr= mKsiZ+mProt;
06618 static const G4double dKsNe= mKsiM+mNeut;
06619 static const G4double eps = 0.003;
06620 static const G4QNucleus vacuum(90000000);
06621 G4bool four=false;
06622 G4LorentzVector q4M = qH->Get4Momentum();
06623 G4int qPDG = qH->GetPDGCode();
06624 G4double qM = q4M.m();
06625 G4double rM = qM+eps;
06626 #ifdef debug
06627 G4cout<<"G4QNucl::DecayAntiDibar:*Called* PDG="<<qPDG<<",4Mom="<<q4M<<", M="<<qM<<G4endl;
06628 #endif
06629
06630 G4int fPDG = -2212;
06631 G4int sPDG = -2212;
06632 G4int tPDG = 0;
06633 G4double fMass= mProt;
06634 G4double sMass= mProt;
06635 G4double tMass= mPi;
06636 if (qPDG==89996002 && rM>=dmPiP)
06637 {
06638 sPDG = -211;
06639 sMass= mPi;
06640 four = true;
06641 }
06642 else if(qPDG==90001996 && rM>=dmPiN)
06643 {
06644 sPDG = 211;
06645 fPDG = -2112;
06646 sMass= mPi;
06647 fMass= mNeut;
06648 four = true;
06649 }
06650 else if(qPDG==89999998 && rM>=dNeut)
06651 {
06652 fPDG = -2112;
06653 sPDG = -2112;
06654 fMass= mNeut;
06655 sMass= mNeut;
06656 }
06657 else if(qPDG==89998999 && rM>=mDeut)
06658 {
06659 if(fabs(qM-mDeut)<eps)
06660 {
06661 evaHV->push_back(qH);
06662 return;
06663 }
06664 else if(mProt+mNeut<rM)
06665 {
06666 fPDG = -2112;
06667 fMass= mNeut;
06668 }
06669 else
06670 {
06671 fPDG = 22;
06672 sPDG = 89998999;
06673 fMass= 0.;
06674 sMass= mDeut;
06675 G4cout<<"--Warning--G4QNucl::DecayAntiDibar:ANTI-DEUTERON is created M="<<rM<<G4endl;
06676 }
06677 }
06678 else if(qPDG==88999999 && rM>=dLaNe)
06679 {
06680 fPDG = -2112;
06681 sPDG = -3122;
06682 fMass= mNeut;
06683 sMass= mLamb;
06684 }
06685 else if(qPDG==88999999 && rM>=dLaPr)
06686 {
06687 sPDG = -3122;
06688 sMass= mLamb;
06689 }
06690 else if(qPDG==90000997 && rM>=nnPi)
06691 {
06692 fPDG = -2112;
06693 sPDG = -2112;
06694 tPDG = 211;
06695 fMass= mNeut;
06696 sMass= mNeut;
06697 }
06698 else if(qPDG==89997001 && rM>=ppPi)
06699 {
06700 tPDG = -211;
06701 }
06702 else if(qPDG==89000998 && rM>=lnPi)
06703 {
06704 fPDG = -2112;
06705 sPDG = -3122;
06706 tPDG = 211;
06707 fMass= mNeut;
06708 sMass= mLamb;
06709 }
06710 else if(qPDG==889998001 && rM>=lpPi)
06711 {
06712 sPDG = -3122;
06713 tPDG = -211;
06714 sMass= mLamb;
06715 }
06716 else if(qPDG==89000998 && rM>=dSiNe)
06717 {
06718 fPDG = -2112;
06719 sPDG = -3112;
06720 fMass= mNeut;
06721 sMass= mSigM;
06722 }
06723 else if(qPDG==88998001 && rM>=dSiPr)
06724 {
06725 sPDG = -3222;
06726 sMass= mSigP;
06727 }
06728 else if(qPDG==88000000 && rM>=dLamb)
06729 {
06730 fPDG = -3122;
06731 sPDG = -3122;
06732 fMass= mLamb;
06733 sMass= mLamb;
06734 }
06735 else if(qPDG==88000999 && rM>=dKsNe)
06736 {
06737 fPDG = -2112;
06738 sPDG = -3312;
06739 fMass= mNeut;
06740 sMass= mKsiM;
06741 }
06742 else if(qPDG==87999001 && rM>=dKsPr)
06743 {
06744 sPDG = -3322;
06745 sMass= mKsiZ;
06746 }
06747 else if(qPDG!=89998000|| rM<dProt)
06748 {
06749 G4int qS = qH->GetStrangeness();
06750 G4int qB = qH->GetBaryonNumber();
06751 if(qB>0&&qS<0)
06752 {
06753 DecayAntiStrange(qH,evaHV);
06754 return;
06755 }
06756 else
06757 {
06758 delete qH;
06759 G4cerr<<"**G4QNuc::DecayAntiDiBar: badPDG="<<qPDG<<" or smallM="<<qM<<", 2mP="<<dProt
06760 <<", 2mN="<<dNeut<<G4endl;
06761
06762
06763 }
06764 }
06765 G4LorentzVector f4Mom(0.,0.,0.,fMass);
06766 G4LorentzVector s4Mom(0.,0.,0.,sMass);
06767 G4LorentzVector t4Mom(0.,0.,0.,tMass);
06768 if(!tPDG&&!four)
06769 {
06770 G4double sum=fMass+sMass;
06771 if(fabs(qM-sum)<eps)
06772 {
06773 f4Mom=q4M*(fMass/sum);
06774 s4Mom=q4M*(sMass/sum);
06775 }
06776 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06777 {
06778 G4cout<<"---Warning---G4QN::DecAntiDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG
06779 <<"(M="<<sMass<<")="<<sum<<" >? TotM="<<q4M.m()<<q4M<<G4endl;
06780
06781
06782 evaHV->push_back(qH);
06783 return;
06784 }
06785 #ifdef debug
06786 G4cout<<"G4QNucleus::DecayAntiDibaryon:(2) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06787 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06788 #endif
06789 delete qH;
06790 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06791 evaHV->push_back(H1);
06792 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06793 evaHV->push_back(H2);
06794 }
06795 else if(four)
06796 {
06797 q4M=q4M/2.;
06798 qM/=2.;
06799 G4double sum=fMass+sMass;
06800 if(fabs(qM-sum)<eps)
06801 {
06802 f4Mom=q4M*(fMass/sum);
06803 s4Mom=q4M*(sMass/sum);
06804 }
06805 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06806 {
06807 G4cout<<"---Warning---G4QN::DecAntiDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG
06808 <<"(M="<<sMass<<")"<<"="<<sum<<">tM="<<q4M.m()<<q4M<<G4endl;
06809
06810
06811 evaHV->push_back(qH);
06812 return;
06813 }
06814 #ifdef debug
06815 G4cout<<"G4QNucleus::DecayAntiDibaryon:(3) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06816 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06817 #endif
06818 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06819 evaHV->push_back(H1);
06820 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06821 evaHV->push_back(H2);
06822
06823 if(fabs(qM-sum)<eps)
06824 {
06825 f4Mom=q4M*(fMass/sum);
06826 s4Mom=q4M*(sMass/sum);
06827 }
06828 else if(!G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
06829 {
06830
06831 delete qH;
06832
06833
06834
06835 G4ExceptionDescription ed;
06836 ed << " General DecayIn2 error: fPDG=" << fPDG << "(fM=" << fMass
06837 << ")+sPDG=" << sPDG << "(sM=" << sMass << ")=" << sum
06838 << " >? (DD2,Can't be here) TotM=" << q4M.m() << q4M << G4endl;
06839 G4Exception("G4QNucleus::DecayAntiDibaryon()", "HAD_CHPS_0000",
06840 FatalException, ed);
06841 }
06842 #ifdef debug
06843 G4cout<<"G4QNucl::DecayAntiDibaryon:(4) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG
06844 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
06845 #endif
06846 G4QHadron* H3 = new G4QHadron(fPDG,f4Mom);
06847 evaHV->push_back(H3);
06848 G4QHadron* H4 = new G4QHadron(sPDG,s4Mom);
06849 evaHV->push_back(H4);
06850 delete qH;
06851 }
06852 else
06853 {
06854 G4double sum=fMass+sMass+tMass;
06855 if(fabs(qM-sum)<eps)
06856 {
06857 f4Mom=q4M*(fMass/sum);
06858 s4Mom=q4M*(sMass/sum);
06859 t4Mom=q4M*(tMass/sum);
06860 }
06861 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
06862 {
06863 G4cout<<"-Warning-G4QN::DecAntiDib:fPDG="<<fPDG<<"(M="<<fMass<<")+sPDG="<<sPDG<<"(M="
06864 <<sMass<<")+tPDG="<<tPDG<<"(tM="<<tMass<<")="<<sum<<">TotM="<<q4M.m()<<G4endl;
06865
06866
06867 evaHV->push_back(qH);
06868 return;
06869 }
06870 #ifdef debug
06871 G4cout<<"G4QNuc::DecayAbtiDibaryon:(5) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG<<", s4M="
06872 <<s4Mom<<",sPDG="<<sPDG<<", t4M="<<t4Mom<<",tPDG="<<tPDG<<G4endl;
06873 #endif
06874
06875
06876
06877 delete qH;
06878
06879 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
06880 evaHV->push_back(H1);
06881 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
06882 evaHV->push_back(H2);
06883 G4QHadron* H3 = new G4QHadron(tPDG,t4Mom);
06884 evaHV->push_back(H3);
06885 }
06886 #ifdef qdebug
06887 if (qH)
06888 {
06889 G4cout<<"G4QNucleus::DecayDiBaryon: deleted at end - PDG="<<qH->GetPDGCode()<<G4endl;
06890 delete qH;
06891 }
06892 #endif
06893 }
06894
06895
06896 void G4QNucleus::DecayAntiStrange(G4QHadron* qH, G4QHadronVector* evaHV)
06897 {
06898 static const G4double mK = G4QPDGCode(321).GetMass();
06899 static const G4double mK0 = G4QPDGCode(311).GetMass();
06900 static const G4double eps = 0.003;
06901 G4LorentzVector q4M = qH->Get4Momentum();
06902 G4double qM = q4M.m();
06903 G4QContent qQC= qH->GetQC();
06904 G4int qS = qH->GetStrangeness();
06905 G4int qB = qH->GetBaryonNumber();
06906 G4int qP = qH->GetCharge();
06907 #ifdef debug
06908 G4cout<<"G4QNuc::DecAntS:QC="<<qQC<<",S="<<qS<<",B="<<qB<<",C="<<qP<<",4M="<<q4M<<G4endl;
06909 #endif
06910 G4int qN = qB-qP-qS;
06911 if(qS>=0 || qB<1)
06912 {
06913 delete qH;
06914
06915
06916 G4ExceptionDescription ed;
06917 ed << "not an Anti Strange Nucleus: QC=" << qQC << ",S=" << qS << ",B="
06918 << qB << ",4M=" << q4M << G4endl;
06919 G4Exception("G4QNucleus::DecayAntiStrange()", "HAD_CHPS_0000",
06920 FatalException, ed);
06921 }
06922 G4int n1=1;
06923 G4double k1M=mK0;
06924 G4int k1PDG=311;
06925 G4int n2=0;
06926 G4double k2M=mK;
06927 G4int k2PDG=321;
06928 G4int aS=-qS;
06929 G4int sH=aS/2;
06930 G4int bH=aS-sH;
06931 if(qP>0 && qP>qN)
06932 {
06933 if(qP>=bH)
06934 {
06935 if(qN>=sH)
06936 {
06937 n1=sH;
06938 n2=bH;
06939 }
06940 else
06941 {
06942 G4int dPN=qP-qN;
06943 if(dPN>=aS)
06944 {
06945 n1=0;
06946 n2=aS;
06947 }
06948 else
06949 {
06950 G4int sS=(aS-dPN)/2;
06951 G4int bS=aS-dPN-sS;
06952 sS+=dPN;
06953 if(qP>=sS && qN>=bS)
06954 {
06955 n1=bS;
06956 n2=sS;
06957 }
06958 else if(qP<sS)
06959 {
06960 n1=aS-qP;
06961 n2=qP;
06962 }
06963 else
06964 {
06965 n1=qN;
06966 n2=aS-qN;
06967 }
06968 }
06969 }
06970 }
06971 }
06972 else if(qN>=bH)
06973 {
06974 if(qP>=sH)
06975 {
06976 n2=sH;
06977 n1=bH;
06978 }
06979 else
06980 {
06981 G4int dNP=qN-qP;
06982 if(dNP>=aS)
06983 {
06984 n1=aS;
06985 n2=0;
06986 }
06987 else
06988 {
06989 G4int sS=(aS-dNP)/2;
06990 G4int bS=aS-sS;
06991 if(qN>=bS && qP>=sS)
06992 {
06993 n1=bS;
06994 n2=sS;
06995 }
06996 else if(qN<bS)
06997 {
06998 n1=qN;
06999 n2=aS-qN;
07000 }
07001 else
07002 {
07003 n1=aS-qP;
07004 n2=qP;
07005 }
07006 }
07007 }
07008 }
07009 G4int qPDG=90000000+(qP-n2)*1000+(qN-n1);
07010 G4double nucM = G4QNucleus(qPDG).GetGSMass();
07011 #ifdef debug
07012 G4cout<<"G4QNucleus::DecayAnStran:nK0="<<n1<<",nK+="<<n2<<", nucM="<<nucM<<G4endl;
07013 #endif
07014 G4int m1=0;
07015 G4int m2_value=qP;
07016 if(qP>=-qS) m2_value=-qS;
07017 else if(qP>0) m1=-qS-qP;
07018 G4int sPDG=90000000+(qP-m2_value)*1000+(qN-m1);
07019 G4double mucM = G4QNucleus(sPDG).GetGSMass();
07020 if(mucM+m1*mK+m2_value*mK0<nucM+n1*mK+n2*mK0)
07021 {
07022 qPDG=sPDG;
07023 nucM=mucM;
07024 n1=m1;
07025 n2=m2_value;
07026 }
07027 #ifdef debug
07028 G4cout<<"G4QNucleus::DecayAnStran: n1="<<n1<<", n2="<<n2<<", nM="<<nucM<<G4endl;
07029 #endif
07030 if(!n1||!n2)
07031 {
07032 if(!n1)
07033 {
07034 if(n2==1 && mK+nucM>qM+.0001)
07035 {
07036 k1M=mK0;
07037 n1=1;
07038 qPDG=90000000+qP*1000+qN-1;
07039 nucM = G4QNucleus(qPDG).GetGSMass();
07040 }
07041 else
07042 {
07043 k1M=mK;
07044 k1PDG=321;
07045 n1=n2;
07046 }
07047 }
07048 else
07049 {
07050 if(n1==1 && mK0+nucM>qM+.0001)
07051 {
07052 k1M=mK;
07053 k1PDG=321;
07054 qPDG=90000000+(qP-1)*1000+qN;
07055 nucM = G4QNucleus(qPDG).GetGSMass();
07056 }
07057 else k1M=mK0;
07058 }
07059 #ifdef debug
07060 G4int naPDG=90000000+(qP-1)*1000+qN;
07061 G4double naM=G4QNucleus(naPDG).GetGSMass();
07062 G4double kaM=mK;
07063 if(k1PDG==321)
07064 {
07065 naPDG=90000000+qP*1000+qN-1;
07066 naM=G4QNucleus(naPDG).GetGSMass();
07067 kaM=mK0;
07068 }
07069 G4cout<<"G4QNucleus::DecayAnStran:M="<<qM<<",kM="<<k1M<<"+nM="<<nucM<<"="<<k1M+nucM
07070 <<",m="<<kaM<<"+n="<<naM<<"="<<kaM+naM<<G4endl;
07071 #endif
07072 G4double n1M=n1*k1M;
07073 G4LorentzVector f4Mom(0.,0.,0.,n1M);
07074 G4LorentzVector s4Mom(0.,0.,0.,nucM);
07075 G4double sum=nucM+n1M;
07076 if(sum>qM+eps && n1==1)
07077 {
07078 G4int naPDG=90000000+(qP-1)*1000+qN;
07079 G4double naM=G4QNucleus(naPDG).GetGSMass();
07080 G4int akPDG=321;
07081 G4double kaM=mK;
07082 if(k1PDG==321)
07083 {
07084 naPDG=90000000+qP*1000+qN-1;
07085 naM=G4QNucleus(naPDG).GetGSMass();
07086 akPDG=311;
07087 kaM=mK0;
07088 }
07089 G4double asum=naM+kaM;
07090 if(asum<sum)
07091 {
07092 nucM=naM;
07093 n1M=kaM;
07094 k1M=kaM;
07095 k1PDG=akPDG;
07096 qPDG=naPDG;
07097 f4Mom=G4LorentzVector(0.,0.,0.,n1M);
07098 s4Mom=G4LorentzVector(0.,0.,0.,nucM);
07099 }
07100 }
07101 if(fabs(qM-sum)<eps)
07102 {
07103 f4Mom=q4M*(n1M/sum);
07104 s4Mom=q4M*(nucM/sum);
07105 }
07106 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07107 {
07108 #ifdef debug
07109 G4cout<<"--Warning--G4QNuc::DASt:AsItIs, H="<<qQC<<q4M<<qM<<" < sum="<<sum<<"=(F)"
07110 <<nucM<<"+(kK)"<<n1M<<G4endl;
07111 #endif
07112 evaHV->push_back(qH);
07113 return;
07114 }
07115 #ifdef debug
07116 G4cout<<"G4QNuc::DecAntiS: nK+N "<<n1<<"*K="<<k1PDG<<f4Mom<<",N="<<qPDG<<s4Mom<<G4endl;
07117 #endif
07118 delete qH;
07119
07120 f4Mom/=n1;
07121 for(G4int i1=0; i1<n1; i1++)
07122 {
07123 G4QHadron* H1 = new G4QHadron(k1PDG,f4Mom);
07124 evaHV->push_back(H1);
07125 }
07126 G4QHadron* H2 = new G4QHadron(qPDG,s4Mom);
07127
07128 EvaporateNucleus(H2,evaHV);
07129 #ifdef debug
07130 G4cout<<"G4QNucleus::DecAntiStr:*** After EvaporateNucleus nH="<<evaHV->size()<<G4endl;
07131 #endif
07132 }
07133 else
07134 {
07135 G4double n1M=n1*k1M;
07136 G4double n2M=n2*k2M;
07137 G4LorentzVector f4Mom(0.,0.,0.,n1M);
07138 G4LorentzVector s4Mom(0.,0.,0.,n2M);
07139 G4LorentzVector t4Mom(0.,0.,0.,nucM);
07140 G4double sum=nucM+n1M+n2M;
07141 if(fabs(qM-sum)<eps)
07142 {
07143 f4Mom=q4M*(n1M/sum);
07144 s4Mom=q4M*(n2M/sum);
07145 t4Mom=q4M*(nucM/sum);
07146 }
07147 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
07148 {
07149 G4cout<<"---Warning---G4QN::DASt:nPDG="<<qPDG<<"(M="<<nucM<<")+1="<<k1PDG<<"(M="<<k1M
07150 <<")+2="<<k2PDG<<"(M="<<k2M<<")="<<nucM+n1*k1M+n2*k2M<<">tM="<<qM<<q4M<<G4endl;
07151 evaHV->push_back(qH);
07152 return;
07153 }
07154 #ifdef debug
07155 G4cout<<"G4QNuc::DecAntiS:*DONE* nPDG="<<qPDG<<",1="<<f4Mom<<",2="<<s4Mom<<",n="<<t4Mom
07156 <<G4endl;
07157 #endif
07158 delete qH;
07159
07160 f4Mom/=n1;
07161 for(G4int i1=0; i1<n1; i1++)
07162 {
07163 G4QHadron* H1 = new G4QHadron(k1PDG,f4Mom);
07164 evaHV->push_back(H1);
07165 }
07166 s4Mom/=n2;
07167 for(G4int i2=0; i2<n2; i2++)
07168 {
07169 G4QHadron* H2 = new G4QHadron(k2PDG,s4Mom);
07170 evaHV->push_back(H2);
07171 }
07172 G4QHadron* H3 = new G4QHadron(qPDG,t4Mom);
07173
07174 EvaporateNucleus(H3,evaHV);
07175 }
07176 #ifdef qdebug
07177 if (qH)
07178 {
07179 G4cout << "G4QNucleus::DecayAntiStrange: deleted at end - PDG: "
07180 << qH->GetPDGCode() << G4endl;
07181 delete qH;
07182 }
07183 #endif
07184 #ifdef debug
07185 G4cout<<"G4QNucleus::DecayAntiStrange: ===> End of DecayAntiStrangness"<<G4endl;
07186 #endif
07187 }
07188
07189
07190 void G4QNucleus::DecayMultyBaryon(G4QHadron* qH, G4QHadronVector* evaHV)
07191 {
07192 static const G4double mNeut= G4QPDGCode(2112).GetMass();
07193 static const G4double mProt= G4QPDGCode(2212).GetMass();
07194 static const G4double mLamb= G4QPDGCode(3122).GetMass();
07195 static const G4double eps=0.003;
07196 G4LorentzVector q4M = qH->Get4Momentum();
07197 G4double qM = q4M.m();
07198 G4int qPDG = qH->GetPDGCode();
07199 G4QContent qQC = qH->GetQC();
07200 #ifdef debug
07201 G4cout<<"G4QNuc::DecayMultyBaryon: *Called* PDG="<<qPDG<<",4M="<<q4M<<qQC<<G4endl;
07202 #endif
07203 G4int totS=qQC.GetStrangeness();
07204 G4int totC=qQC.GetCharge();
07205 G4int totBN=qQC.GetBaryonNumber();
07206 G4int totN=totBN-totS-totC;
07207 G4int fPDG = 3122;
07208 G4double fMass= mLamb;
07209 if (totN==totBN)
07210 {
07211 fPDG = 2112;
07212 fMass= mNeut;
07213 }
07214 else if(totC==totBN)
07215 {
07216 fPDG = 2212;
07217 fMass= mProt;
07218 }
07219 else if(totS!=totBN)
07220 {
07221 delete qH;
07222
07223
07224 G4ExceptionDescription ed;
07225 ed << "Can not decay this PDG Code: PDG=" << qPDG << G4endl;
07226 G4Exception("G4QNucleus::DecayMultyBaryon()", "HAD_CHPS_0000",
07227 FatalException, ed);
07228 }
07229 #ifdef debug
07230 else
07231 {
07232 delete qH;
07233
07234
07235 G4ExceptionDescription ed;
07236 ed << "Unknown PDG code of the MultiBaryon: PDG=" << qPDG << G4endl;
07237 G4Exception("G4QNucleus::DecayMultyBaryon()", "HAD_CHPS_0001",
07238 FatalException, ed);
07239 }
07240 #endif
07241 if(totBN==1) evaHV->push_back(qH);
07242 else if(totBN==2)
07243 {
07244 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07245 G4LorentzVector s4Mom(0.,0.,0.,fMass);
07246 G4double sum=fMass+fMass;
07247 if(fabs(qM-sum)<eps)
07248 {
07249 f4Mom=q4M/2.;
07250 s4Mom=f4Mom;
07251 }
07252 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07253 {
07254 G4cout<<"---Warning---G4QNucl::DecayMultyBar:fPDG="<<fPDG<<"(fM="<<fMass<<")*2="<<sum
07255 <<" > TotM="<<q4M.m()<<q4M<<G4endl;
07256
07257
07258 evaHV->push_back(qH);
07259 return;
07260 }
07261 #ifdef debug
07262 G4cout<<"G4QNucleus::DecMulBar:*DONE* fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<G4endl;
07263 #endif
07264 delete qH;
07265 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07266 evaHV->push_back(H1);
07267 G4QHadron* H2 = new G4QHadron(fPDG,s4Mom);
07268 evaHV->push_back(H2);
07269 }
07270 else if(totBN==3)
07271 {
07272 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07273 G4LorentzVector s4Mom(0.,0.,0.,fMass);
07274 G4LorentzVector t4Mom(0.,0.,0.,fMass);
07275 G4double sum=fMass+fMass+fMass;
07276 if(fabs(qM-sum)<eps)
07277 {
07278 f4Mom=q4M/3.;
07279 s4Mom=f4Mom;
07280 t4Mom=f4Mom;
07281 }
07282 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
07283 {
07284 G4cout<<"---Warning---G4QNuc::DecayMultyBaryon: fPDG="<<fPDG<<"(fM="<<fMass<<")*3 = "
07285 <<3*fMass<<" >? TotM="<<q4M.m()<<q4M<<G4endl;
07286
07287
07288 evaHV->push_back(qH);
07289 return;
07290 }
07291 #ifdef debug
07292 G4cout<<"G4QNuc::DecMBar:*DONE*, fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<",t="
07293 <<t4Mom<<G4endl;
07294 #endif
07295 delete qH;
07296 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07297 evaHV->push_back(H1);
07298 G4QHadron* H2 = new G4QHadron(fPDG,s4Mom);
07299 evaHV->push_back(H2);
07300 G4QHadron* H3 = new G4QHadron(fPDG,t4Mom);
07301 evaHV->push_back(H3);
07302 }
07303 else
07304 {
07305
07306
07307 G4LorentzVector f4Mom=q4M/totBN;
07308 #ifdef debug
07309
07310 G4cout<<"*G4QNul::DecMulBar:SplitMultiBar inEqParts M="<<totBN<<"*"<<f4Mom.m()<<G4endl;
07311 G4cout<<"G4QNucleus::DecMultyBaryon: *DONE* fPDG="<<fPDG<<", f="<<f4Mom<<G4endl;
07312 #endif
07313 delete qH;
07314 for(G4int h=0; h<totBN; h++)
07315 {
07316 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07317 evaHV->push_back(H1);
07318 }
07319 }
07320 #ifdef qdebug
07321 if (qH)
07322 {
07323 G4cout << "G4QNucleus::DecayMultyBaryon: deleted at end - PDG: "
07324 << qH->GetPDGCode() << G4endl;
07325 delete qH;
07326 }
07327 #endif
07328 }
07329
07330
07331 void G4QNucleus::DecayAlphaDiN(G4QHadron* qH, G4QHadronVector* evaHV)
07332 {
07333 static const G4double mNeut= G4QPDGCode(2112).GetMass();
07334 static const G4double mProt= G4QPDGCode(2212).GetMass();
07335 static const G4double mAlph= G4QPDGCode(2112).GetNuclMass(2,2,0);
07336 static const G4double mHel6= G4QPDGCode(2112).GetNuclMass(2,4,0);
07337 static const G4double eps=0.003;
07338 G4LorentzVector q4M = qH->Get4Momentum();
07339 G4double qM = q4M.m();
07340 G4int qPDG = qH->GetPDGCode();
07341 #ifdef debug
07342 G4cout<<"G4QNuc::DecayAlphaDiN: *Called* PDG="<<qPDG<<",4M="<<q4M<<G4endl;
07343 #endif
07344 G4int fPDG = 2212;
07345 G4double fMass= mProt;
07346 G4int sPDG = 90002002;
07347 G4double sMass= mAlph;
07348 if (qPDG==90002004)
07349 {
07350 if(fabs(qM-mHel6)<eps)
07351 {
07352 evaHV->push_back(qH);
07353 return;
07354 }
07355 else if(mNeut+mNeut+mAlph<qM)
07356 {
07357 fPDG = 2112;
07358 fMass= mNeut;
07359 }
07360 else
07361 {
07362 delete qH;
07363
07364
07365 G4ExceptionDescription ed;
07366 ed << "Cannot decay excited He6 with this mass: M(He6=" << mHel6 << ")="
07367 << qM << "<" << mNeut+mNeut+mAlph << G4endl;
07368 G4Exception("G4QNucleus::DecayAlphaDiN()", "HAD_CHPS_0000",
07369 FatalException, ed);
07370 }
07371 }
07372 else if(qPDG!=90004002)
07373 {
07374 delete qH;
07375
07376
07377 G4ExceptionDescription ed;
07378 ed << "Can not decay this PDG Code: PDG=" << qPDG << G4endl;
07379 G4Exception("G4QNucleus::DecayAlphaDiN()", "HAD_CHPS_0001",
07380 FatalException, ed);
07381 }
07382 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07383 G4LorentzVector s4Mom(0.,0.,0.,fMass);
07384 G4LorentzVector t4Mom(0.,0.,0.,sMass);
07385 G4double sum=fMass+fMass+sMass;
07386 if(fabs(qM-sum)<eps)
07387 {
07388 f4Mom=q4M*(fMass/sum);
07389 s4Mom=f4Mom;
07390 t4Mom=q4M*(sMass/sum);
07391 }
07392 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
07393 {
07394 G4cout<<"---Warning---G4QNuc::DecayAlphaDiN:fPDG="<<fPDG<<"(M="<<fMass<<")*2+mAlpha = "
07395 <<sum<<" >? TotM="<<qM<<q4M<<", d="<<sum-qM<<G4endl;
07396
07397
07398 evaHV->push_back(qH);
07399 return;
07400 }
07401 #ifdef debug
07402 G4cout<<"G4QNuc::DecAl2N: fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<",t="<<t4Mom<<G4endl;
07403 #endif
07404 delete qH;
07405 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07406 evaHV->push_back(H1);
07407 G4QHadron* H2 = new G4QHadron(fPDG,s4Mom);
07408 evaHV->push_back(H2);
07409 G4QHadron* H3 = new G4QHadron(sPDG,t4Mom);
07410 evaHV->push_back(H3);
07411 }
07412
07413
07414 void G4QNucleus::DecayAlphaBar(G4QHadron* qH, G4QHadronVector* evaHV)
07415 {
07416 static const G4double mNeut= G4QPDGCode(2112).GetMass();
07417 static const G4double mProt= G4QPDGCode(2212).GetMass();
07418 static const G4double mLamb= G4QPDGCode(3122).GetMass();
07419 static const G4double mAlph= G4QPDGCode(2112).GetNuclMass(2,2,0);
07420 static const G4double mTrit= G4QPDGCode(2112).GetNuclMass(1,2,0);
07421 static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0);
07422 static const G4double eps=0.003;
07423 G4LorentzVector q4M = qH->Get4Momentum();
07424 G4double qM = q4M.m();
07425 G4int qPDG = qH->GetPDGCode();
07426 G4QContent qQC = qH->GetQC();
07427 #ifdef debug
07428 G4cout<<"G4QNucleus::DecayAlphaBar: *Called* PDG="<<qPDG<<",4M="<<q4M<<qQC<<G4endl;
07429 #endif
07430 G4int totS=qQC.GetStrangeness();
07431 G4int totC=qQC.GetCharge();
07432 G4int totBN=qQC.GetBaryonNumber();
07433
07434 if ( ( (!totS && !totC) || totC == totBN || totS == totBN)
07435 && totBN > 1) DecayMultyBaryon(qH,evaHV);
07436 else if(qPDG==92001002||qPDG==92002001||qPDG==91003001||qPDG==91001003||qPDG==93001001)
07437 evaHV->push_back(qH);
07438 else if(qPDG==92000003||qPDG==92003000||qPDG==93000002||qPDG==93002000)
07439 {
07440 G4int fPDG = 3122;
07441 G4double fMass= mLamb;
07442 G4int sPDG = 2112;
07443 G4double sMass= mNeut;
07444 if (qPDG==92003000)
07445 {
07446 sPDG = 2212;
07447 sMass= mProt;
07448 }
07449 else if(qPDG==93000002)
07450 {
07451 fPDG = 2112;
07452 fMass= mNeut;
07453 sPDG = 3122;
07454 sMass= mLamb;
07455 }
07456 else if(qPDG==93002000)
07457 {
07458 fPDG = 2212;
07459 fMass= mProt;
07460 sPDG = 3122;
07461 sMass= mLamb;
07462 }
07463 G4double tfM=fMass+fMass;
07464 G4double tsM=sMass+sMass+sMass;
07465 G4LorentzVector f4Mom(0.,0.,0.,tfM);
07466 G4LorentzVector s4Mom(0.,0.,0.,tsM);
07467 G4double sum=tfM+tsM;
07468 if(fabs(qM-sum)<eps)
07469 {
07470 f4Mom=q4M*(tfM/sum);
07471 s4Mom=q4M*(tsM/sum);
07472 }
07473 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07474 {
07475 G4cout<<"--Warning--G4QNuc::DecAlB:fPDG="<<fPDG<<"(M="<<fMass<<")*2="<<2*fMass<<",s="
07476 <<sPDG<<"(sM="<<sMass<<")*3="<<3*sMass<<"="<<sum<<">M="<<q4M.m()<<q4M<<G4endl;
07477
07478
07479 evaHV->push_back(qH);
07480 return;
07481 }
07482 #ifdef debug
07483 G4cout<<"G4QNucleus::DecAlB:*DONE*, fPDG="<<fPDG<<f4Mom<<",sPDG="<<sPDG<<s4Mom<<G4endl;
07484 #endif
07485 delete qH;
07486 G4LorentzVector rf4Mom=f4Mom/2;
07487 G4QHadron* H1 = new G4QHadron(fPDG,rf4Mom);
07488 evaHV->push_back(H1);
07489 evaHV->push_back(H1);
07490 G4LorentzVector rs4Mom=s4Mom/3;
07491 G4QHadron* H2 = new G4QHadron(sPDG,rs4Mom);
07492 evaHV->push_back(H2);
07493 evaHV->push_back(H2);
07494 evaHV->push_back(H2);
07495 }
07496 else if(qPDG==90004001||qPDG==90001004)
07497 {
07498 G4int fPDG = 90002001;
07499 G4double fMass= mHe3;
07500 G4int sPDG = 2212;
07501 G4double sMass= mProt;
07502 if (qPDG==90001004)
07503 {
07504 fPDG = 90001002;
07505 fMass= mTrit;
07506 sPDG = 2112;
07507 sMass= mNeut;
07508 }
07509 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07510 G4LorentzVector s4Mom(0.,0.,0.,sMass);
07511 G4LorentzVector t4Mom(0.,0.,0.,sMass);
07512 G4double sum=fMass+sMass+sMass;
07513 if(fabs(qM-sum)<eps)
07514 {
07515 f4Mom=q4M*(fMass/sum);
07516 s4Mom=q4M*(sMass/sum);
07517 t4Mom=s4Mom;
07518 }
07519 else if(qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))
07520 {
07521 G4cout<<"--Warning--G4QNuc::DecAlB:fPDG="<<fPDG<<",M="<<fMass<<",sPDG="<<sPDG<<",sM="
07522 <<sMass<<",2sM+fM="<<2*sMass+fMass<<" > TotM="<<q4M.m()<<q4M<<G4endl;
07523
07524
07525 evaHV->push_back(qH);
07526 return;
07527 }
07528 #ifdef debug
07529 G4cout<<"G4QNucl::DecAlB: *DONE*, f="<<fPDG<<f4Mom<<", s="<<sPDG<<s4Mom<<t4Mom<<G4endl;
07530 #endif
07531 delete qH;
07532 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07533 evaHV->push_back(H1);
07534 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
07535 evaHV->push_back(H2);
07536 G4QHadron* H3 = new G4QHadron(sPDG,t4Mom);
07537 evaHV->push_back(H3);
07538 }
07539 else if(qPDG==94000001||qPDG==94001000||qPDG==91000004||qPDG==91004000)
07540 {
07541 G4int fPDG = 3122;
07542 G4double fMass= mLamb+mLamb;
07543 G4int sPDG = 2112;
07544 G4double sMass= mNeut;
07545 if (qPDG==94001000)
07546 {
07547 sPDG = 2212;
07548 sMass= mProt;
07549 }
07550 else if(qPDG==91000004)
07551 {
07552 fPDG = 2112;
07553 fMass= mNeut+mNeut;
07554 sPDG = 3122;
07555 sMass= mLamb;
07556 }
07557 else if(qPDG==91004000)
07558 {
07559 fPDG = 2212;
07560 fMass= mProt+mProt;
07561 sPDG = 3122;
07562 sMass= mLamb;
07563 }
07564 G4LorentzVector f4Mom(0.,0.,0.,fMass+fMass);
07565 G4LorentzVector s4Mom(0.,0.,0.,sMass);
07566 G4double sum=fMass+fMass+sMass;
07567 if(fabs(qM-sum)<eps)
07568 {
07569 f4Mom=q4M*((fMass+fMass)/sum);
07570 s4Mom=q4M*(sMass/sum);
07571 }
07572 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07573 {
07574 G4cout<<"--Warning--G4QNucl::DecAlphBar:fPDG="<<fPDG<<"(2*fM="<<fMass<<")*2="
07575 <<2*fMass<<",sPDG="<<sPDG<<"(sM="<<sMass<<" > TotM="<<q4M.m()<<q4M<<G4endl;
07576
07577
07578 evaHV->push_back(qH);
07579 return;
07580 }
07581 #ifdef debug
07582 G4cout<<"G4QNuc::DecAlphaB: *DONE*, fPDG="<<fPDG<<f4Mom<<",sPDG="<<sPDG<<s4Mom<<G4endl;
07583 #endif
07584 delete qH;
07585 G4LorentzVector rf4Mom=f4Mom/4;
07586 G4QHadron* H1 = new G4QHadron(fPDG,rf4Mom);
07587 evaHV->push_back(H1);
07588 evaHV->push_back(H1);
07589 evaHV->push_back(H1);
07590 evaHV->push_back(H1);
07591 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
07592 evaHV->push_back(H2);
07593 }
07594 else if(qPDG==90003002||qPDG==90002003||qPDG==91002002)
07595 {
07596 G4int fPDG = 90002002;
07597 G4int sPDG = 2112;
07598 G4double fMass= mAlph;
07599 G4double sMass= mNeut;
07600 if(qPDG==90003002)
07601 {
07602 sPDG = 2212;
07603 sMass= mProt;
07604 }
07605 else if(qPDG==9100202)
07606 {
07607 sPDG = 3122;
07608 sMass= mLamb;
07609 }
07610 else if(qPDG!=90002003)
07611 {
07612 evaHV->push_back(qH);
07613
07614 return;
07615 }
07616 G4double dM=fMass+sMass-qM;
07617 if(dM>0.&&dM<1.)
07618 {
07619 #ifdef debug
07620 G4cout<<"***Corrected***G4QNuc::DecayAlphaBar:fPDG="<<fPDG<<"(fM="<<fMass<<")+ sPDG="
07621 <<sPDG<<"(sM="<<sMass<<")="<<fMass+sMass<<" > TotM="<<qM<<q4M<<G4endl;
07622 #endif
07623 G4double hdM=dM/2;
07624 fMass-=hdM;
07625 sMass-=hdM;
07626 }
07627 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07628 G4LorentzVector s4Mom(0.,0.,0.,sMass);
07629 G4double sum=fMass+sMass;
07630 if(fabs(qM-sum)<eps)
07631 {
07632 f4Mom=q4M*(fMass/sum);
07633 s4Mom=q4M*(sMass/sum);
07634 }
07635 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07636 {
07637 G4cout<<"--Warning--G4QNuc::DecAlphaBar:fPDG="<<fPDG<<"(fM="<<fMass<<")+sPDG="<<sPDG
07638 <<"(sM="<<sMass<<")="<<fMass+sMass<<"="<<sum<<" > TotM="<<q4M.m()<<q4M<<G4endl;
07639
07640
07641 evaHV->push_back(qH);
07642 return;
07643 }
07644 #ifdef debug
07645 G4cout<<"G4QNucl::DecAlBar:*DONE*a4M="<<f4Mom<<",s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl;
07646 #endif
07647 delete qH;
07648 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07649 evaHV->push_back(H1);
07650 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
07651 evaHV->push_back(H2);
07652 }
07653 else G4cout<<"---Warning---G4QNucleus::DecayAlphaBar: Unknown PDG="<<qPDG<<G4endl;
07654 #ifdef qdebug
07655 if (qH)
07656 {
07657 G4cout << "G4QNucleus::DecayAlphaBar: deleted at end - PDG: "
07658 << qH->GetPDGCode() << G4endl;
07659 delete qH;
07660 }
07661 #endif
07662 }
07663
07664
07665 void G4QNucleus::DecayAlphaAlpha(G4QHadron* qH, G4QHadronVector* evaHV)
07666 {
07667 static const G4double mAlph= G4QPDGCode(2112).GetNuclMass(2,2,0);
07668 static const G4double aaGSM= G4QPDGCode(2112).GetNuclMass(4,4,0);
07669 static const G4double eps=0.003;
07670 G4int qPDG = qH->GetPDGCode();
07671 if(qPDG!=90004004)
07672 {
07673 delete qH;
07674
07675
07676 G4ExceptionDescription ed;
07677 ed << "Not Be8 state decais in 2 alphas: qPDG=" << qPDG << G4endl;
07678 G4Exception("G4QNucleus::DecayAlphaAlpha()", "HAD_CHPS_0000",
07679 FatalException, ed);
07680 }
07681 G4LorentzVector q4M = qH->Get4Momentum();
07682 G4double qM=q4M.m();
07683 #ifdef debug
07684 G4cout<<"G4QNucleus::DecayAlAl: *Called* PDG="<<qPDG<<",M="<<qM<<q4M<<">"<<aaGSM<<G4endl;
07685 #endif
07686
07687 if(2>3)
07688 {
07689 G4int fPDG = 22;
07690 G4int sPDG = 90004004;
07691 G4double fMass= 0.;
07692 G4double sMass= aaGSM;
07693 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07694 G4LorentzVector s4Mom(0.,0.,0.,sMass);
07695 G4double sum=fMass+sMass;
07696 if(fabs(qM-sum)<eps)
07697 {
07698 f4Mom=q4M*(fMass/sum);
07699 s4Mom=q4M*(sMass/sum);
07700 }
07701 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07702 {
07703 G4cout<<"---Warning---G4QNuc::DecayAlphaAlpha:gPDG="<<fPDG<<"(gM="<<fMass<<")+PDG="
07704 <<sPDG<<"(sM="<<sMass<<")="<<sum<<" > TotM="<<q4M.m()<<q4M<<G4endl;
07705
07706
07707 evaHV->push_back(qH);
07708 return;
07709 }
07710 #ifdef debug
07711 G4cout<<"G4QNucleus::DecayAlphaAlpha: *DONE* gam4M="<<f4Mom<<", aa4M="<<s4Mom<<G4endl;
07712 #endif
07713 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07714 evaHV->push_back(H1);
07715 qH->Set4Momentum(s4Mom);
07716 q4M=s4Mom;
07717 }
07718 G4int fPDG = 90002002;
07719 G4int sPDG = 90002002;
07720 G4double fMass= mAlph;
07721 G4LorentzVector f4Mom(0.,0.,0.,fMass);
07722 G4LorentzVector s4Mom(0.,0.,0.,fMass);
07723 G4double sum=fMass+fMass;
07724 if(fabs(qM-sum)<eps)
07725 {
07726 f4Mom=q4M*(fMass/sum);
07727 s4Mom=f4Mom;
07728 }
07729 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))
07730 {
07731 G4cout<<"---Warning---G4QNucl::DecayAlphaAlpha:fPDG="<<fPDG<<"(fM="<<fMass<<")*2="<<sum
07732 <<" > TotM="<<q4M.m()<<q4M<<G4endl;
07733
07734
07735 evaHV->push_back(qH);
07736 return;
07737 }
07738 #ifdef debug
07739 G4cout<<"G4QNucleus::DecayAlphaAlpha: *DONE* fal4M="<<f4Mom<<", sal4M="<<s4Mom<<G4endl;
07740 #endif
07741 delete qH;
07742 G4QHadron* H1 = new G4QHadron(fPDG,f4Mom);
07743 evaHV->push_back(H1);
07744 G4QHadron* H2 = new G4QHadron(sPDG,s4Mom);
07745 evaHV->push_back(H2);
07746 }