Changeset 962 for trunk/source/processes/hadronic/models/incl
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/incl
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/incl/GNUmakefile
r819 r962 1 # $Id: GNUmakefile,v 1. 3 2007/10/11 07:25:55gcosmo Exp $1 # $Id: GNUmakefile,v 1.8 2008/07/11 08:25:37 gcosmo Exp $ 2 2 # ----------------------------------------------------------- 3 3 # GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96. … … 7 7 8 8 ifndef G4INSTALL 9 G4INSTALL = ../../../../.. /..9 G4INSTALL = ../../../../.. 10 10 endif 11 11 … … 26 26 -I$(G4BASE)/processes/hadronic/models/management/include \ 27 27 -I$(G4BASE)/processes/hadronic/models/util/include \ 28 -I$(G4BASE)/processes/hadronic/models/cascade/cascade/include \29 -I$(G4BASE)/processes/hadronic/models/cascade/utils/include \30 28 -I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include \ 31 29 -I$(G4BASE)/particles/management/include \ -
trunk/source/processes/hadronic/models/incl/History
r819 r962 4 4 Geant4 - an Object-Oriented Toolkit for Physics Simulation 5 5 ========================================================== 6 $Id: History,v 1. 9 2007/12/04 09:52:49 gcosmoExp $6 $Id: History,v 1.17 2008/11/06 10:11:27 kaitanie Exp $ 7 7 --------------------------------------------------------------------- 8 8 … … 17 17 --------------------------------------------------------------- 18 18 19 06 November 2008 - Pekka Kaitaniemi (hadr-incl-V09-01-05) 20 --------------------------------------------------------- 21 - Fixed GCC 4.3.2 "src/G4Incl.cc:1712: warning: array subscript is above array 22 bounds" problem. The problem occured because array size was used as an 23 index. 24 25 06 November 2008 - Gabriele Cosmo (hadr-incl-V09-01-04) 26 ------------------------------------------------------- 27 - Fix for compilation errors on Windows-VC++; include <time.h> in 28 G4AblaFission and G4AblaFissionSimfis18 translation units to make them 29 self-consistent. 30 31 24 October 2008 - Dennis Wright (hadr-incl-V09-01-03) 32 ----------------------------------------------------- 33 - use GetNuclearMass() instead of GetAtomicMass() in G4AblaEvaporation.cc 34 35 12 September 2008 - Pekka Kaitaniemi (hadr-incl-V09-01-02) 36 ------------------------------------ 37 - Bug fixes in INCL cascade: 38 o Fixed target nucleus initialization for targets with A >= 0.19 and 39 A <= 28. 40 o Fixed target nucleus radius calculation for targets 6 <= A < 19. 41 o Fixed conditional statements to avoid uninitialized variables. 42 o Several array index handling (off-by-one) bugs fixed. 43 o Several possible double/integer datatype problems fixed. 44 45 25 June 2008 - Pekka Kaitaniemi (hadr-incl-V09-01-01) 46 ------------------------------ 47 - Portability fixes and code clean-up: 48 o Removed all assert() calls. 49 o Removed all isnan() and isinf() calls. 50 o All math functions now use std:: namespace. 51 o Silenced the fission models. 52 53 26 May 2008 - Pekka Kaitaniemi (hadr-incl-V09-01-00) 54 ------------------------------ 55 - Bug fixes: 56 o Fixed serious data reading bug affecting the reading of data 57 files: flalpha.dat, frldm.dat and vgsld.dat. 58 - Fission reorganization: 59 o Two fission models are provided. By default GSI SimFis3 fission is 60 used. Optional SimFis18 is provided. 61 62 22 April 2008 - Pekka Kaitaniemi 63 ----------------------------------- 64 - INCL/ABLA changes: 65 o Fix: Partial fix to the Alpha evaporation energies. 66 o Fix: Neutron energies. 67 o Fix: Moved remnant direction calculation block and added safeguards. 68 o ABLA bugfix: switched the transformation matrix indices. 69 70 27 February 2008 - Pekka Kaitaniemi 71 ----------------------------------- 72 - INCL/ABLA changes since Geant4 9.1: 73 o Initialized variables to zero and improved coding style. 74 o Variable "bet" needs to be part of G4Fiss. 75 o Fixed a variable definition. Variable "homega" is part of "G4Fiss". 76 o Fixed an index off-by-one bug in G4Abla. 77 o Fix an infinite loop. 78 o Move the stored event number to the class definition. 79 o Added a possible (commented) fix for ABLA output off-by-one problem. 80 o Cleaned up G4Abla::qrot comments. 81 - Changes to the test suite since Geant4 9.1: 82 o Added more tests. 83 o New test system. 84 o Compare FORTRAN and C++ results. 85 o Preliminary GUI for running plotting scripts. 86 19 87 04 December 2007 - Gabriele Cosmo (hadr-incl-V09-00-09) 20 88 --------------------------------- 21 89 - Again commented out call to isnan() in G4Incl.cc for allow 22 90 porting to platforms other than Linux.... 91 92 03 December 2007 - Pekka Kaitaniemi 93 ----------------------------------- 94 - Added bugfixes to INCL nucleon array handling. Several off-by-one 95 bugs were fixed. These fixes help with INCL neutron energy spectra. 96 - 4-momentum conservation problem was noticed to be mainly ABLA 97 related. 98 o INCL alone violates energy conservation only by less than 20 MeV. 99 o ABLA has problems with baryon number conservation. Some produced 100 nucleons are not given back to INCL and Geant4. This is probably the 101 main reason for 4-momentum conservation violations. 102 - Added 4-momentum and baryon number conservation checking code to the 103 interfaces (behind flag DEBUGINCL). 23 104 24 105 15 November 2007 - Pekka Kaitaniemi -
trunk/source/processes/hadronic/models/incl/include/G4Abla.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Abla.hh,v 1. 7 2007/12/03 19:36:05 miheikkiExp $26 // $Id: G4Abla.hh,v 1.11 2008/06/25 17:20:03 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 33 33 #include "globals.hh" 34 34 35 #include "G4InclRandomNumbers.hh" 35 36 #include "G4AblaDataDefs.hh" 36 37 #include "G4InclDataDefs.hh" 38 #include "G4AblaFissionBase.hh" 39 40 #ifndef G4Abla_hh 41 #define G4Abla_hh 1 37 42 38 43 /** … … 44 49 public: 45 50 /** 46 * 47 * We support Doxygen with JavaDoc style. 48 * 49 * \author{pekka.kaitaniemi@helsinki.fi} 50 */ 51 52 /** 53 * A constructor. 51 * Basic constructor. 54 52 */ 55 53 G4Abla(); … … 65 63 66 64 /** 67 * 65 * Constructor that is to be used only for testing purposes. 66 * @param aHazard random seeds 67 * @param aVolant data structure for ABLA output 68 68 */ 69 69 G4Abla(G4Hazard *hazard, G4Volant *volant); 70 70 71 71 /** 72 * A destructor. 73 * A more elaborate description of the destructor. 72 * Basic destructor. 74 73 */ 75 74 ~G4Abla(); 76 75 77 76 /** 78 * 79 */ 80 void setVerboseLevel(G4int level); 77 * Set verbosity level. 78 */ 79 void setVerboseLevel(G4int level) { 80 verboseLevel = level; 81 } 82 83 /** 84 * Get the internal output data structure pointer. 85 */ 86 G4Volant* getVolant() { 87 return volant; 88 } 81 89 82 90 /** … … 102 110 /** 103 111 * Initialize ABLA evaporation code. 112 * 104 113 */ 105 114 void initEvapora(); 106 115 107 116 /** 108 * qrot including damping117 * Coefficient of collective enhancement including damping 109 118 * Input: z,a,bet,sig,u 110 119 * Output: qr - collective enhancement factor 111 120 * See junghans et al., nucl. phys. a 629 (1998) 635 121 * @param z charge number 122 * @param a mass number 123 * @param bet beta deformation 124 * @param sig perpendicular spin cut-off factor 125 * @param u Energy 126 * @return Coefficient of collective enhancement 112 127 */ 113 128 void qrot(G4double z, G4double a, G4double bet, G4double sig, G4double u, G4double *qr); … … 127 142 * 128 143 */ 129 //G4double spdef(G4int a, G4int z, G4int optxfis);144 G4double spdef(G4int a, G4int z, G4int optxfis); 130 145 131 146 /** 132 147 * Calculation of fissility parameter 133 148 */ 134 //G4double fissility(int a,int z, int optxfis);149 G4double fissility(int a,int z, int optxfis); 135 150 136 151 /** … … 224 239 225 240 /** 241 * Random numbers. 242 */ 243 G4double haz(G4int k); 244 void standardRandom(G4double *rndm, G4long *seed); 245 246 /** 226 247 * TIRAGE ALEATOIRE DANS UNE EXPONENTIELLLE : Y=EXP(-X/T) 227 248 */ … … 252 273 */ 253 274 void guet(G4double *x_par, G4double *z_par, G4double *find_par); 254 255 // Fission256 public:257 /**258 *259 */260 G4double spdef(G4int a, G4int z, G4int optxfis);261 262 /**263 *264 */265 G4double fissility(G4int a, G4int z, G4int optxfis);266 267 // void evapora(G4double zprf, G4double aprf, G4double ee, G4double jprf,268 // G4double *zf_par, G4double *af_par, G4double *mtota_par,269 // G4double *pleva_par, G4double *pxeva_par);270 // G4double bfms67(G4double zms, G4double ams);271 // void lpoly(G4double x, G4int n, G4double pl[]);272 // G4double expohaz(G4int k, G4double T);273 // G4double fd(G4double E);274 // G4double f(G4double E);275 // G4double fmaxhaz(G4double k, G4double T);276 void even_odd(G4double r_origin,G4double r_even_odd,G4int &i_out);277 G4double umass(G4double z,G4double n,G4double beta);278 G4double ecoul(G4double z1,G4double n1,G4double beta1,G4double z2,G4double n2,G4double beta2,G4double d);279 void fissionDistri(G4double &a,G4double &z,G4double &e,280 G4double &a1,G4double &z1,G4double &e1,G4double &v1,281 G4double &a2,G4double &z2,G4double &e2,G4double &v2);282 void standardRandom(G4double *rndm, G4long *seed);283 G4double haz(G4int k);284 G4double gausshaz(int k, double xmoy, double sig);285 286 275 287 276 public: … … 312 301 G4double utilabs(G4double a); 313 302 G4double dmin1(G4double a, G4double b, G4double c); 303 G4Ec2sub* getFrldmTable() { 304 return ec2sub; 305 } 314 306 315 307 private: 316 308 G4int verboseLevel; 317 309 G4int ilast; 310 311 G4AblaFissionBase *fissionModel; 312 G4InclRandomInterface *randomGenerator; 318 313 G4Pace *pace; 319 314 G4Hazard *hazard; 320 315 G4Ald *ald; 321 G4Ablamain *ablamain;322 G4Emdpar *emdpar;323 316 G4Eenuc *eenuc; 324 317 G4Ec2sub *ec2sub; … … 330 323 G4VarNtp *varntp; 331 324 }; 325 326 #endif -
trunk/source/processes/hadronic/models/incl/include/G4AblaDataDefs.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4AblaDataDefs.hh,v 1. 6 2007/12/03 19:36:06 miheikkiExp $26 // $Id: G4AblaDataDefs.hh,v 1.9 2008/06/25 17:20:04 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 76 76 77 77 G4double ecnz[EC2SUBROWS][EC2SUBCOLS]; 78 79 /** 80 * Dump the contents of the ecnz data table. 81 */ 82 void dump() { 83 for(G4int i = 0; i < EC2SUBROWS; i++) { 84 for(G4int j = 0; j < EC2SUBCOLS; j++) { 85 G4cout << ecnz[i][j] << " "; 86 } 87 G4cout << G4endl; 88 } 89 } 78 90 }; 79 91 … … 87 99 88 100 G4double av,as,ak,optafan; 89 };90 91 class G4Ablamain {92 public:93 G4Ablamain() {};94 ~G4Ablamain() {};95 96 G4double ap,zp,at,zt,eap,beta,bmaxnuc,crtot,crnuc,r_0, r_p,r_t,pi,bfpro,snpro,sppro,shell;97 G4int imax, inum;98 101 }; 99 102 … … 185 188 }; 186 189 187 #define EMDPARSIZE 1000188 /**189 * Energies widths and cross sections for em excitation.190 */191 192 class G4Emdpar {193 194 public:195 G4Emdpar() {};196 ~G4Emdpar() {};197 198 G4double egdr,egqr,fwhmgdr,fwhmgqr,cremde1,cremde2;199 G4double ae1[EMDPARSIZE],be1[EMDPARSIZE],ce1[EMDPARSIZE],ae2[EMDPARSIZE];200 G4double be2[EMDPARSIZE],ce2[EMDPARSIZE],sre1[EMDPARSIZE],sre2[EMDPARSIZE];201 G4double xre1[EMDPARSIZE],xre2[EMDPARSIZE],ds1,ds2;202 };203 204 190 //#define VOLANTSIZE 200 205 191 #define VOLANTSIZE 2000 … … 211 197 212 198 public: 213 G4Volant() {}; 199 G4Volant() 200 { 201 clear(); 202 } 203 214 204 ~G4Volant() {}; 215 205 206 void clear() 207 { 208 for(G4int i = 0; i < VOLANTSIZE; i++) { 209 copied[i] = false; 210 acv[i] = 0; 211 zpcv[i] = 0; 212 pcv[i] = 0; 213 xcv[i] = 0; 214 ycv[i] = 0; 215 zcv[i] = 0; 216 iv = 0; 217 } 218 } 219 220 G4double getTotalMass() 221 { 222 G4double total = 0.0; 223 for(G4int i = 0; i <= iv; i++) { 224 total += acv[i]; 225 } 226 return total; 227 } 228 216 229 void dump() 217 230 { 231 G4double totA = 0.0, totZ = 0.0, totP = 0.0; 218 232 G4cout <<"i \t ACV \t ZPCV \t PCV" << G4endl; 219 233 for(G4int i = 0; i <= iv; i++) { 234 if(i == 0 && acv[i] != 0) { 235 G4cout <<"G4Volant: Particle stored at index " << i << G4endl; 236 } 237 totA += acv[i]; 238 totZ += zpcv[i]; 239 totP += pcv[i]; 220 240 G4cout << "volant" << i << "\t" << acv[i] << " \t " << zpcv[i] << " \t " << pcv[i] << G4endl; 221 241 } 242 G4cout <<"Particle count index (iv) = " << iv << G4endl; 243 G4cout <<"ABLA Total: A = " << totA << " Z = " << totZ << " momentum = " << totP << G4endl; 222 244 } 223 245 224 246 G4double acv[VOLANTSIZE],zpcv[VOLANTSIZE],pcv[VOLANTSIZE],xcv[VOLANTSIZE]; 225 247 G4double ycv[VOLANTSIZE],zcv[VOLANTSIZE]; 248 G4bool copied[VOLANTSIZE]; 226 249 G4int iv; 227 250 }; -
trunk/source/processes/hadronic/models/incl/include/G4Incl.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Incl.hh,v 1.1 0 2007/12/03 19:36:06 miheikkiExp $26 // $Id: G4Incl.hh,v 1.13 2008/06/25 17:20:04 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 35 35 36 36 #include "globals.hh" 37 #include "G4InclRandomNumbers.hh" 37 38 #include "G4InclDataDefs.hh" 38 39 #include "G4Abla.hh" … … 816 817 G4Volant *volant; 817 818 G4Abla *abla; 819 G4InclRandomInterface *randomGenerator; 818 820 }; 819 821 -
trunk/source/processes/hadronic/models/incl/include/G4InclAblaVirtualData.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InclAblaVirtualData.hh,v 1. 3 2007/12/03 19:36:06 miheikkiExp $26 // $Id: G4InclAblaVirtualData.hh,v 1.5 2008/06/25 17:20:04 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 99 99 private: 100 100 101 static const G4int alphaRows = 15 5;102 static const G4int alphaCols = 100;101 static const G4int alphaRows = 154; 102 static const G4int alphaCols = 99; 103 103 104 104 static const G4int paceRows = 500; -
trunk/source/processes/hadronic/models/incl/include/G4InclDataDefs.hh
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InclDataDefs.hh,v 1. 2 2007/09/11 13:18:43 miheikkiExp $26 // $Id: G4InclDataDefs.hh,v 1.5 2008/06/25 17:20:04 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 564 564 565 565 /** 566 * Clear and initialize all variables and arrays. 567 */ 568 void clear() { 569 particleIndex = 0; 570 projType = 0; 571 projEnergy = 0.0; 572 targetA = 0; 573 targetZ = 0; 574 massini = 0; 575 mzini = 0; 576 exini = 0; 577 pcorem = 0; 578 mcorem = 0; 579 pxrem = 0; 580 pyrem = 0; 581 pzrem = 0; 582 mulncasc = 0; 583 mulnevap = 0; 584 mulntot = 0; 585 bimpact = 0.0; 586 jremn = 0; 587 kfis = 0; 588 estfis = 0; 589 izfis = 0; 590 iafis = 0; 591 ntrack = 0; 592 for(G4int i = 0; i < VARNTPSIZE; i++) { 593 itypcasc[i] = 0; 594 avv[i] = 0; 595 zvv[i] = 0; 596 enerj[i] = 0.0; 597 plab[i] = 0.0; 598 tetlab[i] = 0.0; 599 philab[i] = 0.0; 600 full[i] = false; 601 } 602 } 603 604 void addParticle(G4double A, G4double Z, G4double E, G4double P, G4double theta, G4double phi) { 605 if(full[particleIndex]) { 606 G4cout <<"G4VarNtp: Error. Index i = " << particleIndex << " is already occupied by particle:" << G4endl; 607 G4cout <<"A = " << avv[particleIndex] << " Z = " << zvv[particleIndex] << G4endl; 608 G4cout <<"Tried to replace it with:" << G4endl; 609 G4cout <<"A = " << Z << " Z = " << Z << G4endl; 610 } else { 611 avv[particleIndex] = (int) A; 612 zvv[particleIndex] = (int) Z; 613 enerj[particleIndex] = E; 614 plab[particleIndex] = P; 615 tetlab[particleIndex] = theta; 616 philab[particleIndex] = phi; 617 full[particleIndex] = true; 618 ntrack = particleIndex + 1; 619 particleIndex++; 620 } 621 } 622 623 /** 624 * Baryon number conservation check. 625 */ 626 G4int getTotalBaryonNumber() { 627 G4int baryonNumber = 0; 628 for(G4int i = 0; i < ntrack; i++) { 629 if(avv[i] > 0) { 630 baryonNumber += avv[i]; 631 } 632 } 633 return baryonNumber; 634 } 635 636 /** 637 * Return total energy. 638 */ 639 G4double getTotalEnergy() { 640 G4double energy = 0.0; 641 for(G4int i = 0; i < ntrack; i++) { 642 energy += std::sqrt(std::pow(plab[i], 2) + std::pow(getMass(i), 2)); // E^2 = p^2 + m^2 643 } 644 645 return energy; 646 } 647 648 /** 649 * Return total three momentum. 650 */ 651 G4double getTotalThreeMomentum() { 652 G4double momentum = 0; 653 for(G4int i = 0; i < ntrack; i++) { 654 momentum += plab[i]; 655 } 656 return momentum; 657 } 658 659 G4double getMomentumSum() { 660 G4double momentum = 0; 661 for(G4int i = 0; i < ntrack; i++) { 662 momentum += plab[i]; 663 } 664 return momentum; 665 } 666 667 G4double getMass(G4int particle) { 668 const G4double protonMass = 938.272; 669 const G4double neutronMass = 939.565; 670 const G4double pionMass = 139.57; 671 672 G4double mass = 0.0; 673 if(avv[particle] == 1 && zvv[particle] == 1) mass = protonMass; 674 if(avv[particle] == 1 && zvv[particle] == 0) mass = neutronMass; 675 if(avv[particle] == -1) mass = pionMass; 676 if(avv[particle] > 1) 677 mass = avv[particle] * protonMass + zvv[particle] * neutronMass; 678 return mass; 679 } 680 681 /** 682 * Dump debugging output. 683 */ 684 void dump() { 685 G4int nProton = 0, nNeutron = 0; 686 G4int nPiPlus = 0, nPiZero = 0, nPiMinus = 0; 687 G4int nH2 = 0, nHe3 = 0, nAlpha = 0; 688 G4int nFragments = 0; 689 G4int nParticles = 0; 690 G4cout <<"Particles produced in the event (" << ntrack << "):" << G4endl; 691 G4cout <<"A \t Z \t Ekin \t Ptot \t Theta \t Phi" << G4endl; 692 for(G4int i = 0; i < ntrack; i++) { 693 nParticles++; 694 if(avv[i] == 1 && zvv[i] == 1) nProton++; // Count multiplicities 695 if(avv[i] == 1 && zvv[i] == 0) nNeutron++; 696 if(avv[i] == -1 && zvv[i] == 1) nPiPlus++; 697 if(avv[i] == -1 && zvv[i] == 0) nPiZero++; 698 if(avv[i] == -1 && zvv[i] == -1) nPiMinus++; 699 if(avv[i] == 2 && zvv[i] == 1) nH2++; 700 if(avv[i] == 3 && zvv[i] == 2) nHe3++; 701 if(avv[i] == 4 && zvv[i] == 2) nAlpha++; 702 if( zvv[i] > 2) nFragments++; 703 704 G4cout << i << " \t " << avv[i] << " \t " << zvv[i] << " \t " << enerj[i] << " \t " 705 << plab[i] << " \t " << tetlab[i] << " \t " << philab[i] << G4endl; 706 } 707 708 G4cout <<"Summary of event: " << G4endl; 709 G4cout <<"Projectile type: " << projType <<" Energy: " << projEnergy << G4endl; 710 G4cout <<"Target A = " << targetA << " Z = " << targetZ << G4endl; 711 G4cout <<"Remnant from cascade: " << G4endl; 712 G4cout <<"A = " << massini << " Z = " << mzini << " excitation E = " << exini << G4endl; 713 G4cout <<"Particle multiplicities:" << G4endl; 714 G4cout <<"Protons: " << nProton << " Neutrons: " << nNeutron << G4endl; 715 G4cout <<"pi+: " << nPiPlus << " pi0: " << nPiZero << " pi-: " << nPiMinus << G4endl; 716 G4cout <<"H2: " << nH2 << " He3: " << nHe3 << " Alpha: " << nAlpha << G4endl; 717 G4cout <<"Nucleus fragments = " << nFragments << G4endl; 718 G4cout <<"Conservation laws:" << G4endl; 719 G4cout <<"Baryon number = " << getTotalBaryonNumber() << G4endl; 720 G4cout <<"Number of particles = " << nParticles << G4endl; 721 } 722 723 /** 724 * Projectile type. 725 */ 726 G4int projType; 727 728 /** 729 * Projectile energy. 730 */ 731 G4double projEnergy; 732 733 /** 734 * Target mass number. 735 */ 736 G4int targetA; 737 738 /** 739 * Target charge number. 740 */ 741 G4int targetZ; 742 743 /** 566 744 * A of the remnant. 567 745 */ … … 578 756 G4double exini; 579 757 758 G4double pcorem, mcorem, pxrem, pyrem, pzrem; 759 580 760 /** 581 761 * Cascade n multip. … … 629 809 630 810 /** 811 * The state of the index: 812 * true = reserved 813 * false = free 814 */ 815 G4bool full[VARNTPSIZE]; 816 817 /** 631 818 * emitted in cascade (0) or evaporation (1). 632 819 */ … … 663 850 */ 664 851 G4double philab[VARNTPSIZE]; 852 853 private: 854 G4int particleIndex; 665 855 }; 666 856 -
trunk/source/processes/hadronic/models/incl/src/G4Abla.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Abla.cc,v 1.1 4 2007/12/03 19:36:06 miheikkiExp $26 // $Id: G4Abla.cc,v 1.19 2008/09/15 08:16:45 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 36 36 #include "G4InclAblaDataFile.hh" 37 37 #include "Randomize.hh" 38 #include <assert.h> 38 #include "G4InclRandomNumbers.hh" 39 #include "G4Ranecu.hh" 40 #include "G4AblaFissionSimfis18.hh" 41 #include "G4AblaFission.hh" 39 42 40 43 G4Abla::G4Abla() 41 44 { 42 45 verboseLevel = 0; 46 ilast = 0; 43 47 } 44 48 … … 46 50 { 47 51 verboseLevel = 0; 48 52 ilast = 0; 49 53 volant = volant; // ABLA internal particle data 50 54 volant->iv = 0; 51 55 hazard = hazard; // Random seeds 52 56 57 randomGenerator = new G4InclGeant4Random(); 58 //randomGenerator = new G4Ranecu(); 53 59 varntp = new G4VarNtp(); 54 60 pace = new G4Pace(); 55 61 ald = new G4Ald(); 56 ablamain = new G4Ablamain();57 emdpar = new G4Emdpar();58 62 eenuc = new G4Eenuc(); 59 63 ec2sub = new G4Ec2sub(); … … 67 71 { 68 72 verboseLevel = 0; 69 73 ilast = 0; 70 74 volant = aVolant; // ABLA internal particle data 71 75 volant->iv = 0; … … 74 78 varntp->ntrack = 0; 75 79 80 randomGenerator = new G4InclGeant4Random(); 81 //randomGenerator = new G4Ranecu(); 82 83 // ABLA fission 84 // fissionModel = new G4AblaFissionSimfis18(hazard, randomGenerator); 85 fissionModel = new G4AblaFission(hazard, randomGenerator); 86 if(verboseLevel > 0) { 87 fissionModel->about(); 88 } 89 verboseLevel = 0; 76 90 pace = new G4Pace(); 77 91 ald = new G4Ald(); 78 ablamain = new G4Ablamain();79 emdpar = new G4Emdpar();80 92 eenuc = new G4Eenuc(); 81 93 ec2sub = new G4Ec2sub(); … … 88 100 G4Abla::~G4Abla() 89 101 { 102 delete randomGenerator; 90 103 delete pace; 91 104 delete ald; 92 delete ablamain;93 delete emdpar;94 105 delete eenuc; 95 106 delete ec2sub; … … 111 122 G4int eventnumber) 112 123 { 113 // C ************************* EVAPORATION KHS *********114 115 124 const G4double uma = 931.4942; 116 125 const G4double melec = 0.511; … … 118 127 const G4double fmn = 939.56563; 119 128 120 // Rotation matrix... 121 G4double sitet = 0.0; 122 G4double R[4][4]; 123 124 G4double plab1, gam1, eta1; 125 126 G4double plab2, gam2, eta2; 127 128 G4double stet1; 129 G4double stet2; 130 131 G4int nbpevap; 132 G4int mempaw = 0, memiv = 0; 133 129 G4double alrem = 0.0, berem = 0.0, garem = 0.0; 130 G4double R[4][4]; // Rotation matrix 134 131 G4double csdir1[4]; 135 132 G4double csdir2[4]; 136 137 133 G4double csrem[4]; 138 G4double alrem = 0.0, berem = 0.0, garem = 0.0;139 140 134 G4double pfis_rem[4]; 141 135 G4double pf1_rem[4]; 136 for(G4int init_i = 0; init_i < 4; init_i++) { 137 csdir1[init_i] = 0.0; 138 csdir2[init_i] = 0.0; 139 csrem[init_i] = 0.0; 140 pfis_rem[init_i] = 0.0; 141 pf1_rem[init_i] = 0.0; 142 for(G4int init_j = 0; init_j < 4; init_j++) { 143 R[init_i][init_j] = 0.0; 144 } 145 } 146 147 G4double plab1 = 0.0, gam1 = 0.0, eta1 = 0.0; 148 G4double plab2 = 0.0, gam2 = 0.0, eta2 = 0.0; 149 150 G4double sitet = 0.0; 151 G4double stet1 = 0.0; 152 G4double stet2 = 0.0; 153 154 G4int nbpevap = 0; 155 G4int mempaw = 0, memiv = 0; 142 156 143 157 G4double e_evapo = 0.0; 144 G4double el; 145 G4double fmcv; 146 147 G4double aff1; 148 G4double zff1; 149 G4double eff1; 150 151 G4double aff2; 152 G4double zff2; 153 G4double eff2; 154 155 G4double v1, v2; 158 G4double el = 0.0; 159 G4double fmcv = 0.0; 160 161 G4double aff1 = 0.0; 162 G4double zff1 = 0.0; 163 G4double eff1 = 0.0; 164 G4double aff2 = 0.0; 165 G4double zff2 = 0.0; 166 G4double eff2 = 0.0; 167 168 G4double v1 = 0.0, v2 = 0.0; 156 169 157 170 G4double t2 = 0.0; 158 G4double ctet1 ;171 G4double ctet1 = 0.0; 159 172 G4double ctet2 = 0.0; 160 G4double phi1 ;173 G4double phi1 = 0.0; 161 174 G4double phi2 = 0.0; 162 175 G4double p2 = 0.0; 163 G4double epf2_out = 0.0 ; ///AH adding initialization176 G4double epf2_out = 0.0 ; 164 177 G4int lma_pf1 = 0, lmi_pf1 = 0; 165 178 G4int lma_pf2 = 0, lmi_pf2 = 0; 166 179 G4int nopart = 0; 167 180 168 G4double cst , sst, csf, ssf;181 G4double cst = 0.0, sst = 0.0, csf = 0.0, ssf = 0.0; 169 182 170 G4double zf , af, mtota, pleva, pxeva, pyeva;183 G4double zf = 0.0, af = 0.0, mtota = 0.0, pleva = 0.0, pxeva = 0.0, pyeva = 0.0; 171 184 G4int ff = 0; 172 185 G4int inum = eventnumber; 173 G4int inttype ;186 G4int inttype = 0; 174 187 G4double esrem = excitationEnergy; 175 188 … … 181 194 182 195 G4double erecrem = recoilEnergy; 183 G4double trem ;196 G4double trem = 0.0; 184 197 G4double pxrem = momX; 185 198 G4double pyrem = momY; 186 199 G4double pzrem = momZ; 187 200 188 G4double remmass ;201 G4double remmass = 0.0; 189 202 203 volant->clear(); // Clean up an initialize ABLA output. 204 varntp->clear(); // Clean up an initialize ABLA output. 190 205 varntp->ntrack = 0; 191 volant->iv = 0; 206 volant->iv = 0; 207 //volant->iv = 1; 192 208 193 209 G4double pcorem = std::sqrt(erecrem*(erecrem +2.*938.2796*nucleusA)); 194 210 // G4double pcorem = std::sqrt(std::pow(momX,2) + std::pow(momY,2) + std::pow(momZ,2)); 195 // assert(isnan(pcorem) == false); 196 if(esrem >= 1.0e-3) { //then 197 // void evapora(G4double zprf, G4double aprf, G4double ee, G4double jprf, 198 // G4double *zf_par, G4double *af_par, G4double *mtota_par, 199 // G4double *pleva_par, G4double *pxeva_par, G4double *pyeva_par, 200 // G4double *ff_par, G4int *inttype_par, G4int *inum_par); 201 // G4cout <<"Evaporating nucleus: " << G4endl; 202 // G4cout <<"A = " << aprf << " Z = " << zprf << G4endl; 211 if(pcorem != 0) { // Guard against division by zero. 212 alrem = pxrem/pcorem; 213 berem = pyrem/pcorem; 214 garem = pzrem/pcorem; 215 } else { 216 alrem = 0.0; 217 berem = 0.0; 218 garem = 0.0; 219 } 220 221 G4int idebug = 0; 222 G4int itest = 0; 223 if(idebug == 1) { 224 zprf = 81.; 225 aprf = 201.; 226 // ee = 86.5877686; 227 ee = 300.0; 228 jprf = 32.; 229 zf = 0.; 230 af = 0.; 231 mtota = 0.; 232 pleva = 0.; 233 pxeva = 0.; 234 pyeva = 0.; 235 ff = -1; 236 inttype = 0; 237 inum = 2; 238 } 239 if(itest == 1) { 240 G4cout <<" PK::: EVAPORA event " << inum << G4endl; 241 G4cout <<" PK::: zprf = " << zprf << G4endl; 242 G4cout <<" PK::: aprf = " << aprf << G4endl; 243 G4cout <<" PK::: ee = " << ee << G4endl; 244 G4cout <<" PK::: eeDiff = " << ee - 86.5877686 << G4endl; 245 G4cout <<" PK::: jprf = " << jprf << G4endl; 246 G4cout <<" PK::: zf = " << zf << G4endl; 247 G4cout <<" PK::: af = " << af << G4endl; 248 G4cout <<" PK::: mtota = " << mtota << G4endl; 249 G4cout <<" PK::: pleva = " << pleva << G4endl; 250 G4cout <<" PK::: pxeva = " << pxeva << G4endl; 251 G4cout <<" PK::: pyeva = " << pyeva << G4endl; 252 G4cout <<" PK::: ff = " << ff << G4endl; 253 G4cout <<" PK::: inttype = " << inttype << G4endl; 254 G4cout <<" PK::: inum = " << inum << G4endl; 255 } 256 257 if(esrem >= 1.0e-3) { 203 258 evapora(zprf,aprf,ee,jprf, &zf, &af, &mtota, &pleva, &pxeva, &pyeva, &ff, &inttype, &inum); 204 // assert(isnan(pleva) == false);205 // assert(isnan(pxeva) == false);206 // assert(isnan(pyeva) == false);207 259 } 208 260 else { … … 213 265 pyeva = pyrem; 214 266 pleva = pzrem; 215 } // endif 216 // assert(isnan(zf) == false); 217 // assert(isnan(af) == false); 218 // assert(isnan(ee) == false); 219 // 220 // AFP,ZFP is the final fragment if no fission occurs (FF=0) 221 // In case of fission (FF=1) it is the nucleus that undergoes fission. 222 // G4double zfp = idnint(zf); 223 // G4double afp = idnint(af); 224 225 if (ff == 1) { //then 226 // --------------------- Here, a FISSION occures -------------------------- 227 // 228 // FEE: (EE) energy of fissioning nucleus ABOVE the fission barrier. 229 // 230 // calcul des impulsions des particules evaporees (avant fission) 231 // dans le systeme labo: 232 267 } 268 269 if (ff == 1) { 270 // Fission: 271 // variable ee: Energy of fissioning nucleus above the fission barrier. 272 // Calcul des impulsions des particules evaporees (avant fission) 273 // dans le systeme labo. 274 275 if(verboseLevel > 2) 276 G4cout << __FILE__ << ":" << __LINE__ << " Entering fission code." << G4endl; 233 277 trem = double(erecrem); 234 278 remmass = pace2(aprf,zprf) + aprf*uma - zprf*melec; // canonic 235 remmass = mcorem + double(esrem); // ok236 remmass = mcorem; //cugnon279 // remmass = mcorem + double(esrem); // ok 280 // remmass = mcorem; //cugnon 237 281 varntp->kfis = 1; 238 282 G4double gamrem = (remmass + trem)/remmass; 239 283 G4double etrem = std::sqrt(trem*(trem + 2.0*remmass))/remmass; 240 // assert(isnan(etrem) == false); 284 241 285 // This is not treated as accurately as for the non fission case for which 242 286 // the remnant mass is computed to satisfy the energy conservation … … 247 291 mglms(aprf,zprf,0,&el); 248 292 remmass = zprf*fmp + (aprf-zprf)*fmn + el + double(esrem); 249 250 293 gamrem = std::sqrt(std::pow(pcorem,2) + std::pow(remmass,2))/remmass; 251 // assert(isnan(gamrem) == false);252 294 etrem = pcorem/remmass; 253 // assert(isnan(etrem) == false);254 295 255 alrem = pxrem/pcorem;256 // assert(isnan(alrem) == false);257 berem = pyrem/pcorem;258 // assert(isnan(berem) == false);259 garem = pzrem/pcorem;260 // assert(isnan(garem) == false);261 262 296 csrem[0] = 0.0; // Should not be used. 263 297 csrem[1] = alrem; 264 298 csrem[2] = berem; 265 299 csrem[3] = garem; 266 300 if(verboseLevel > 1) { 301 G4cout << __FILE__ << ":" << __LINE__ << " momRem = (" << pxrem << ", " << pyrem << ", " << pzrem << ")" << G4endl; 302 G4cout << __FILE__ << ":" << __LINE__ << " csrem = (" << csrem[1] << ", " << csrem[2] << ", " << csrem[3] << ")" << G4endl; 303 } 304 267 305 // C Pour Vérif Remnant = evapo(Pre fission) + Noyau_fissionant (systÚme Remnant) 268 306 G4double bil_e = 0.0; … … 273 311 274 312 for(G4int iloc = 1; iloc <= volant->iv; iloc++) { //DO iloc=1,iv 275 // assert(isnan(volant->zpcv[iloc]) == false);276 // assert(volant->acv[iloc] != 0);277 // assert(volant->zpcv[iloc] != 0);278 313 mglms(double(volant->acv[iloc]),double(volant->zpcv[iloc]),0,&el); 279 // assert(isnan(el) == false);280 314 masse = volant->zpcv[iloc]*fmp + (volant->acv[iloc] - volant->zpcv[iloc])*fmn + el; 281 // assert(isnan(masse) == false);282 315 bil_e = bil_e + std::sqrt(std::pow(volant->pcv[iloc],2) + std::pow(masse,2)); 283 // assert(isnan(bil_e) == false);284 316 bil_px = bil_px + volant->pcv[iloc]*(volant->xcv[iloc]); 285 317 bil_py = bil_py + volant->pcv[iloc]*(volant->ycv[iloc]); … … 315 347 // G4double &a2,G4double &z2,G4double &e2,G4double &v2); 316 348 317 fissionDistri(af,zf,ee,aff1,zff1,eff1,v1,aff2,zff2,eff2,v2);318 349 //fissionModel->fissionDistri(af,zf,ee,aff1,zff1,eff1,v1,aff2,zff2,eff2,v2); 350 fissionModel->doFission(af,zf,ee,aff1,zff1,eff1,v1,aff2,zff2,eff2,v2); 319 351 // C verif des A et Z decimaux: 320 352 G4int na_f = int(std::floor(af + 0.5)); … … 342 374 //G4double ef = fb->efa[kboud][jboud]; // barriere de fission 343 375 G4double ef = fb->efa[jboud][kboud]; // barriere de fission 344 // assert(isnan(ef) == false);345 376 varntp->estfis = ee + ef; // copie dans le ntuple 346 377 … … 355 386 // C Attention aux parametres, ici 0=OPTSHP, NO microscopic correct. 356 387 mglms(af,zf,0,&el); 357 // assert(isnan(el) == false);358 388 G4double massef = zf*fmp + (af - zf)*fmn + el + ee + ef; 359 // assert(isnan(massef) == false);360 389 mglms(double(aff1),double(zff1),0,&el); 361 // assert(isnan(el) == false);362 390 G4double masse1 = zff1*fmp + (aff1-zff1)*fmn + el + eff1; 363 // assert(isnan(masse1) == false);364 391 mglms(aff2,zff2,0,&el); 365 // assert(isnan(el) == false);366 392 G4double masse2 = zff2*fmp + (aff2 - zff2)*fmn + el + eff2; 367 // assert(isnan(masse2) == false);368 393 // C WRITE(6,*) 'MASSEF,MASSE1,MASSE2',MASSEF,MASSE1,MASSE2 369 394 G4double b = massef - masse1 - masse2; … … 376 401 } //endif 377 402 G4double t1 = b*(b + 2.0*masse2)/(2.0*massef); 378 // assert(isnan(t1) == false);379 403 G4double p1 = std::sqrt(t1*(t1 + 2.0*masse1)); 380 // assert(isnan(p1) == false);381 404 382 405 G4double rndm; 383 standardRandom(&rndm, &(hazard->igraine[13])); 406 rndm = randomGenerator->getRandom(); 407 // standardRandom(&rndm, &(hazard->igraine[13])); 384 408 ctet1 = 2.0*rndm - 1.0; 385 standardRandom(&rndm,&(hazard->igraine[9])); 409 // standardRandom(&rndm,&(hazard->igraine[9])); 410 rndm = randomGenerator->getRandom(); 386 411 phi1 = rndm*2.0*3.141592654; 387 412 … … 389 414 G4double peva = std::pow(pxeva,2) + std::pow(pyeva,2) + std::pow(pleva,2); 390 415 G4double gamfis = std::sqrt(std::pow(massef,2) + peva)/massef; 391 // assert(isnan(gamfis) == false);392 416 peva = std::sqrt(peva); 393 // assert(isnan(peva) == false);394 417 G4double etfis = peva/massef; 395 418 396 G4double epf1_in ;397 G4double epf1_out ;419 G4double epf1_in = 0.0; 420 G4double epf1_out = 0.0; 398 421 399 422 // C ----Matrice de rotation (noyau de fission -> Remnant) 400 423 if(peva >= 1.0e-4) { 401 424 sitet = std::sqrt(std::pow(pxeva,2)+std::pow(pyeva,2))/peva; 402 // assert(isnan(sitet) == false);403 425 } 404 426 if(sitet > 1.0e-5) { //then … … 448 470 &ffpxeva1, &ffpyeva1, &ff1, &ftype1, &inum); 449 471 // C On ajoute le fragment: 450 // assert(af1 > 0);451 472 volant->iv = volant->iv + 1; 452 // assert(af1 != 0);453 // assert(zf1 != 0);454 473 volant->acv[volant->iv] = af1; 455 474 volant->zpcv[volant->iv] = zf1; 475 if(verboseLevel > 2) { 476 G4cout << __FILE__ << ":" << __LINE__ << " Added: zf1 = " << zf1 << " af1 = " << af1 << " at index " << volant->iv << G4endl; 477 volant->dump(); 478 } 456 479 if(verboseLevel > 2) { 457 480 G4cout <<"Added fission fragment: a = " << volant->acv[volant->iv] << " z = " << volant->zpcv[volant->iv] << G4endl; 458 481 } 459 482 peva = std::sqrt(std::pow(ffpxeva1,2) + std::pow(ffpyeva1,2) + std::pow(ffpleva1,2)); 460 // assert(isnan(peva) == false);461 483 volant->pcv[volant->iv] = peva; 462 484 if(peva > 0.001) { // then … … 480 502 mglms(volant->acv[iloc], volant->zpcv[iloc],0,&el); 481 503 masse = volant->zpcv[iloc]*fmp + (volant->acv[iloc] - volant->zpcv[iloc])*fmn + el; 482 // assert(isnan(masse) == false);483 504 bil1_e = bil1_e + std::sqrt(std::pow(volant->pcv[iloc],2) + std::pow(masse,2)); 484 // assert(isnan(bil1_e) == false);485 505 bil1_px = bil1_px + volant->pcv[iloc]*(volant->xcv[iloc]); 486 506 bil1_py = bil1_py + volant->pcv[iloc]*(volant->ycv[iloc]); … … 493 513 494 514 // calcul des impulsions des particules evaporees dans le systeme Remnant: 495 if(verboseLevel > 2) {515 if(verboseLevel > 2) 496 516 G4cout <<"2nd Translab (pf1 evap): Adding indices from " << nbpevap+1 << " to " << volant->iv << G4endl; 497 }498 517 nopart = varntp->ntrack - 1; 499 518 translab(gam1,eta1,csdir1,nopart,nbpevap+1); … … 531 550 volant->acv[volant->iv] = af2; 532 551 volant->zpcv[volant->iv] = zf2; 552 if(verboseLevel > 2) 553 G4cout << __FILE__ << ":" << __LINE__ << " Added: zf2 = " << zf2 << " af2 = " << af2 << " at index " << volant->iv << G4endl; 533 554 if(verboseLevel > 2) { 534 555 G4cout <<"Added fission fragment: a = " << volant->acv[volant->iv] << " z = " << volant->zpcv[volant->iv] << G4endl; 535 556 } 536 557 peva = std::sqrt(std::pow(ffpxeva2,2) + std::pow(ffpyeva2,2) + std::pow(ffpleva2,2)); 537 // assert(isnan(peva) == false);538 558 volant->pcv[volant->iv] = peva; 539 559 // exit(0); … … 558 578 masse = volant->zpcv[iloc]*fmp + (volant->acv[iloc] - volant->zpcv[iloc])*fmn + el; 559 579 bil2_e = bil2_e + std::sqrt(std::pow(volant->pcv[iloc],2) + std::pow(masse,2)); 560 // assert(isnan(bil2_e) == false);561 580 bil2_px = bil2_px + volant->pcv[iloc]*(volant->xcv[iloc]); 562 581 bil2_py = bil2_py + volant->pcv[iloc]*(volant->ycv[iloc]); … … 569 588 // G4double ctet2 = -ctet1; 570 589 ctet2 = -1.0*ctet1; 571 assert(std::fabs(ctet2) <= 1.0);572 // assert(isnan(ctet2) == false);573 590 phi2 = dmod(phi1+3.141592654,6.283185308); 574 // assert(isnan(phi2) == false);575 591 G4double p2 = std::sqrt(t2*(t2+2.0*masse2)); 576 // assert(isnan(p2) == false);577 592 578 593 // void translabpf(G4double masse1, G4double t1, G4double p1, G4double ctet1, … … 583 598 // C calcul des impulsions des particules evaporees dans le systeme Remnant: 584 599 // c 585 if(verboseLevel > 2) { 586 G4cout <<"3rd Translab (pf2 evap): Adding indices from " << nbpevap+1 << " to " << volant->iv << G4endl; 587 } 600 if(verboseLevel > 2) 601 G4cout <<"3rd Translab (pf2 evap): Adding indices from " << nbpevap+1 << " to " << volant->iv << G4endl; 588 602 nopart = varntp->ntrack - 1; 589 603 translab(gam2,eta2,csdir2,nopart,nbpevap+1); … … 603 617 604 618 stet1 = std::sqrt(1.0 - std::pow(ctet1,2)); 605 // assert(isnan(stet1) == false);606 619 pf1_rem[1] = p1*stet1*std::cos(phi1); 607 620 pf1_rem[2] = p1*stet1*std::sin(phi1); … … 612 625 613 626 stet2 = std::sqrt(1.0 - std::pow(ctet2,2)); 614 assert(std::pow(ctet2,2) >= 0.0);615 assert(std::pow(ctet2,2) <= 1.0);616 // assert(isnan(stet2) == false);617 627 618 628 G4double pf2_rem[4]; … … 672 682 // C 673 683 // G4double mempaw, memiv; 674 if(verboseLevel > 2) {684 if(verboseLevel > 2) 675 685 G4cout <<"4th Translab: Adding indices from " << memiv << " to " << volant->iv << G4endl; 676 }677 686 translab(gamrem,etrem,csrem,mempaw,memiv); 678 687 // C ******************* END of fission calculations ************************ 688 if(verboseLevel > 2) { 689 G4cout <<"Dump at the end of fission event " << G4endl; 690 volant->dump(); 691 G4cout <<"End of dump." << G4endl; 692 } 679 693 } 680 694 else { … … 689 703 volant->acv[volant->iv] = af; 690 704 volant->zpcv[volant->iv] = zf; 705 if(verboseLevel > 2) 706 G4cout << __FILE__ << ":" << __LINE__ << " Added: zf = " << zf << " af = " << af << " at index " << volant->iv << G4endl; 691 707 G4double peva = std::sqrt(std::pow(pxeva,2)+std::pow(pyeva,2)+std::pow(pleva,2)); 692 // assert(isnan(peva) == false);693 708 volant->pcv[volant->iv] = peva; 694 709 if(peva > 0.001) { //then … … 726 741 } 727 742 if(volant->acv[j] > 0) { 728 assert(volant->acv[j] != 0);729 // assert(volant->zpcv[j] != 0);730 743 mglms(volant->acv[j],volant->zpcv[j],0,&el); 731 744 fmcv = volant->zpcv[j]*fmp + (volant->acv[j] - volant->zpcv[j])*fmn + el; 732 745 e_evapo = e_evapo + std::sqrt(std::pow(volant->pcv[j],2) + std::pow(fmcv,2)); 733 // assert(isnan(e_evapo) == false);734 746 } 735 747 } // enddo … … 741 753 742 754 G4double gamrem = std::sqrt(std::pow(pcorem,2)+std::pow(remmass,2))/remmass; 743 // assert(isnan(gamrem) == false);744 755 G4double etrem = pcorem/remmass; 745 756 746 if(verboseLevel > 2) {757 if(verboseLevel > 2) 747 758 G4cout <<"5th Translab (no fission): Adding indices from " << 1 << " to " << volant->iv << G4endl; 748 }749 759 nopart = varntp->ntrack - 1; 750 760 translab(gamrem,etrem,csrem,nopart,1); 751 761 762 if(verboseLevel > 2) { 763 G4cout <<"Dump at the end of evaporation event " << G4endl; 764 volant->dump(); 765 G4cout <<"End of dump." << G4endl; 766 } 752 767 // C End of the (FISSION - NO FISSION) condition (FF=1 or 0) 753 768 } //end if … … 758 773 void G4Abla::initEvapora() 759 774 { 760 // 6 C *******************************************************************761 // 7 C762 // 8 C SUBROUTINE ABLAINIT(STATUS,TSTAT,NAME,FPATH)763 // 9 C********************************************************************764 // 10765 // 11 SUBROUTINE INIT_EVAPORA(RACINE)766 // 12767 // 13 C********************************************************************768 // 14 C ON INPUT: INPUT PARAMETERS FROM FILE769 // 15 C---------------------------------------------------------------------770 // 16 C ON OUTPUT:771 // 17 C STATUS - FLAG FOR END OF INPUT FILE772 // 18 C TSTAT - FLAG FOR NTUPLE-OUTPUT773 // 19 C NAME - NAME FOR ISOTOPIC PRODUCTION CROSS SECTION FILES774 // 20 C FPATH - PATH FOR " " " " "775 // 21 C---------------------------------------------------------------------776 // 22 C777 // 23 C Modification 5-january-2000 by KHS and BJ778 // 24 C779 // 25 C New treatment of dissipation.780 // 26 C See report of Beatriz Jurado, Jan. 2000781 // 27 C782 // 28 C---------------------------------------------------------------------783 // 29 C784 // 30 C MODIFICATION 6-aug-1999 by JB and MVR785 // 31 C786 // 32 C Some problems arised from an uncorrect evaluation of the fission barrier787 // 33 C { 1) shell correction ( ECGNZ(J,K) ) was not subctracted (20-jul-99)788 // 34 C 2) fiss. barrier EF was calc. before ang. mom. correct. (6-aug-99) }789 // 35 C790 // 36 C---------------------------------------------------------------------791 775 // 37 C PROJECTILE AND TARGET PARAMETERS + CROSS SECTIONS 792 776 // 38 C COMMON /ABLAMAIN/ AP,ZP,AT,ZT,EAP,BETA,BMAXNUC,CRTOT,CRNUC, … … 996 980 } 997 981 998 for(int z = 0; z < 9 8; z++) { //do 30 z = 0,98,1982 for(int z = 0; z < 99; z++) { //do 30 z = 0,98,1 999 983 for(int n = 0; n < 154; n++) { //do 31 n = 0,153,1 1000 984 ecld->ecfnz[n][z] = 0.e0; … … 1003 987 ecld->alpha[n][z] = dataInterface->getAlpha(n,z); 1004 988 ecld->vgsld[n][z] = dataInterface->getVgsld(n,z); 989 // if(ecld->ecgnz[n][z] != 0.0) G4cout <<"ecgnz[" << n << "][" << z << "] = " << ecld->ecgnz[n][z] << G4endl; 1005 990 } 1006 991 } … … 1017 1002 void G4Abla::qrot(G4double z, G4double a, G4double bet, G4double sig, G4double u, G4double *qr) 1018 1003 { 1019 // QROT INCLUDING DAMPING 1020 // INPUT: Z,A,BET,SIG,U 1021 // OUTPUT: QR - COLLECTIVE ENHANCEMENT FACTOR 1022 // 1023 // SEE JUNGHANS ET AL., NUCL. PHYS. A 629 (1998) 635 1024 // 1025 // 1026 // FR(U) EXPONENTIAL FUNCTION TO DEFINE DAMPING 1027 // UCR CRITICAL ENERGY FOR DAMPING 1028 // DCR WIDTH OF DAMPING 1029 // BET BETA-DEFORMATION ! 1030 // SIG PERPENDICULAR SPIN CUTOFF FACTOR 1031 // U ENERGY 1032 // QR COEFFICIENT OF COLLECTIVE ENHANCEMENT 1033 // A MASS NUMBER 1034 // Z CHARGE NUMBER 1035 1036 G4double ucr,dcr,ponq,dn,n,dz; 1037 1038 dcr = 10.0; 1039 1040 ucr = 40.0; 1004 G4double ucr = 10.0; // Critical energy for damping. 1005 G4double dcr = 40.0; // Width of damping. 1006 G4double ponq = 0.0, dn = 0.0, n = 0.0, dz = 0.0; 1041 1007 1042 1008 if(((std::fabs(bet)-1.15) < 0) || ((std::fabs(bet)-1.15) == 0)) { … … 1085 1051 // USUALLY AN OBSOLETE OPTION 1086 1052 1087 G4int a1 ,z1;1053 G4int a1 = 0, z1 = 0; 1088 1054 G4double xv = 0.0, xs = 0.0, xc = 0.0, xa = 0.0; 1089 1055 … … 1143 1109 // binding energy incl. pairing contr. is calculated from 1144 1110 // function eflmac 1145 assert(a1 != 0);1146 1111 (*el) = eflmac(a1,z1,0,refopt4); 1147 // assert(isnan((*el)) == false);1148 1112 if (refopt4 > 0) { 1149 1113 if (refopt4 != 2) { 1150 1114 (*el) = (*el) + ec2sub->ecnz[a1-z1][z1]; 1151 1115 //(*el) = (*el) + ec2sub->ecnz[z1][a1-z1]; 1152 //assert(isnan((*el)) == false);1153 1116 } 1154 1117 } … … 1167 1130 // RANGING FROM FISSILITY X=0.30 TO X=1.00 IN STEPS OF 0.02 1168 1131 1169 G4int index ;1170 G4double x ,v,dx;1132 G4int index = 0; 1133 G4double x = 0.0, v = 0.0, dx = 0.0; 1171 1134 1172 1135 const G4int alpha2Size = 37; … … 1216 1179 // 2 : ANDREYEV 1217 1180 1218 G4double aa ,zz,i;1181 G4double aa = 0.0, zz = 0.0, i = 0.0; 1219 1182 G4double fissilityResult = 0.0; 1220 1183 … … 1256 1219 G4int inum = (*inum_par); 1257 1220 1221 G4int idebug = 0; 1222 1223 if(idebug == 666) { 1224 zprf = 81.; 1225 aprf = 201.; 1226 // ee = 86.5877686; 1227 ee = 300.0; 1228 jprf = 32.; 1229 zf = 0.; 1230 af = 0.; 1231 mtota = 0.; 1232 pleva = 0.; 1233 pxeva = 0.; 1234 pyeva = 0.; 1235 ff = -1; 1236 inttype = 0; 1237 inum = 2; 1238 G4cout <<" PK::: EVAPORA event " << inum << G4endl; 1239 G4cout <<" PK::: zprf = " << zprf << G4endl; 1240 G4cout <<" PK::: aprf = " << aprf << G4endl; 1241 G4cout <<" PK::: ee = " << ee << G4endl; 1242 G4cout <<" PK::: eeDiff = " << ee - 86.5877686 << G4endl; 1243 G4cout <<" PK::: jprf = " << jprf << G4endl; 1244 G4cout <<" PK::: zf = " << zf << G4endl; 1245 G4cout <<" PK::: af = " << af << G4endl; 1246 G4cout <<" PK::: mtota = " << mtota << G4endl; 1247 G4cout <<" PK::: pleva = " << pleva << G4endl; 1248 G4cout <<" PK::: pxeva = " << pxeva << G4endl; 1249 G4cout <<" PK::: pyeva = " << pyeva << G4endl; 1250 G4cout <<" PK::: ff = " << ff << G4endl; 1251 G4cout <<" PK::: inttype = " << inttype << G4endl; 1252 G4cout <<" PK::: inum = " << inum << G4endl; 1253 } 1258 1254 // 533 C 1259 1255 // 534 C INPUT: … … 1348 1344 // SAVE -> static 1349 1345 1350 static G4int sortie; 1351 static G4double epsiln,probp,probn,proba,ptotl,e; 1352 static G4double sn,sbp,sba,x,amoins,zmoins,ecn,ecp,eca,bp,ba; 1353 static G4double pteva; 1354 1355 static G4int itest; 1356 static G4double probf; 1357 1358 static G4int k, j, il; 1359 1360 static G4double ctet1,stet1,phi1; 1361 static G4double sbfis,rnd; 1362 static G4double selmax; 1363 static G4double segs; 1364 static G4double ef; 1365 static G4int irndm; 1366 1367 static G4double pc, malpha; 1346 static G4int sortie = 0; 1347 static G4double epsiln = 0.0, probp = 0.0, probn = 0.0, proba = 0.0, ptotl = 0.0, e = 0.0; 1348 static G4double sn = 0.0, sbp = 0.0, sba = 0.0, x = 0.0, amoins = 0.0, zmoins = 0.0; 1349 G4double ecn = 0.0, ecp = 0.0,eca = 0.0, bp = 0.0, ba = 0.0; 1350 static G4double pteva = 0.0; 1351 1352 static G4int itest = 0; 1353 static G4double probf = 0.0; 1354 1355 static G4int k = 0, j = 0, il = 0; 1356 1357 static G4double ctet1 = 0.0, stet1 = 0.0, phi1 = 0.0; 1358 static G4double sbfis = 0.0, rnd = 0.0; 1359 static G4double selmax = 0.0; 1360 static G4double segs = 0.0; 1361 static G4double ef = 0.0; 1362 static G4int irndm = 0; 1363 1364 static G4double pc = 0.0, malpha = 0.0; 1368 1365 1369 1366 zf = zprf; … … 1392 1389 direct(zf,af,ee,jprf,&probp,&probn,&proba,&probf,&ptotl, 1393 1390 &sn,&sbp,&sba,&ecn,&ecp,&eca,&bp,&ba,inttype,inum,itest); //:::FIXME::: Call 1394 // assert(isnan(proba) == false); 1395 // assert(isnan(probp) == false); 1396 // assert(isnan(probn) == false); 1397 // assert(isnan(probf) == false); 1398 assert((eca+ba) >= 0); 1399 assert((ecp+bp) >= 0); 1400 // assert(isnan(ecp) == false); 1401 // assert(isnan(ecn) == false); 1402 // assert(isnan(bp) == false); 1403 // assert(isnan(ba) == false); 1391 if((eca+ba) < 0) { 1392 eca = 0.0; 1393 ba = 0.0; 1394 } 1404 1395 k = idnint(zf); 1405 1396 j = idnint(af-zf); … … 1411 1402 il = idnint(jprf); 1412 1403 barfit(k,k+j,il,&sbfis,&segs,&selmax); 1413 // assert(isnan(sbfis) == false);1414 1404 1415 1405 if ((fiss->optshp == 1) || (fiss->optshp == 3)) { //then … … 1423 1413 ef = fb->efa[j][k]; 1424 1414 // ef = fb->efa[j][k]; 1425 // assert(isnan(fb->efa[j][k]) == false);1426 1415 // here the final steps of the evaporation are calculated 1427 1416 if ((sortie == 1) || (ptotl == 0.e0)) { … … 1460 1449 // random number for the evaporation 1461 1450 // x = double(Rndm(irndm))*ptotl; 1462 x = double(haz(1))*ptotl;1463 1451 // x = double(haz(1))*ptotl; 1452 x = randomGenerator->getRandom() * ptotl; 1464 1453 // G4cout <<"proba = " << proba << G4endl; 1465 1454 // G4cout <<"probp = " << probp << G4endl; … … 1471 1460 // alpha evaporation 1472 1461 if (itest == 1) { 1473 G4cout <<" < alpha evaporation >" << G4endl;1462 G4cout <<"PK::: < alpha evaporation >" << G4endl; 1474 1463 } 1475 1464 amoins = 4.0; 1476 1465 zmoins = 2.0; 1477 1466 epsiln = sba + eca; 1478 assert((std::pow((1.0 + (eca+ba)/3.72834e3),2) - 1.0) >= 0);1479 1467 pc = std::sqrt(std::pow((1.0 + (eca+ba)/3.72834e3),2) - 1.0) * 3.72834e3; 1480 // assert(isnan(pc) == false);1481 1468 malpha = 4.0; 1482 1469 … … 1490 1477 // proton evaporation 1491 1478 if (itest == 1) { 1492 G4cout <<" < proton evaporation >" << G4endl;1479 G4cout <<"PK::: < proton evaporation >" << G4endl; 1493 1480 } 1494 1481 amoins = 1.0; 1495 1482 zmoins = 1.0; 1496 1483 epsiln = sbp + ecp; 1497 assert((std::pow((1.0 + (ecp + bp)/9.3827e2),2) - 1.0) >= 0);1498 1484 pc = std::sqrt(std::pow((1.0 + (ecp + bp)/9.3827e2),2) - 1.0) * 9.3827e2; 1499 // assert(isnan(pc) == false);1500 1485 malpha = 0.0; 1501 1486 // volant: 1502 1487 volant->iv = volant->iv + 1; 1503 volant->acv[volant->iv] = 1. ;1488 volant->acv[volant->iv] = 1.0; 1504 1489 volant->zpcv[volant->iv] = 1.; 1505 1490 volant->pcv[volant->iv] = pc; … … 1508 1493 // neutron evaporation 1509 1494 if (itest == 1) { 1510 G4cout <<" < neutron evaporation >" << G4endl;1495 G4cout <<"PK::: < neutron evaporation >" << G4endl; 1511 1496 } 1512 1497 amoins = 1.0; 1513 1498 zmoins = 0.0; 1514 1499 epsiln = sn + ecn; 1515 assert((std::pow((1.0 + (ecn)/9.3956e2),2) - 1.0) >= 0);1516 1500 pc = std::sqrt(std::pow((1.0 + (ecn)/9.3956e2),2) - 1.0) * 9.3956e2; 1517 // assert(isnan(pc) == false); 1501 if(itest == 1) { 1502 G4cout <<"PK::: pc " << pc << G4endl; 1503 } 1518 1504 malpha = 0.0; 1519 1505 … … 1523 1509 volant->zpcv[volant->iv] = 0.; 1524 1510 volant->pcv[volant->iv] = pc; 1511 1512 if(volant->getTotalMass() > 209 && verboseLevel > 0) { 1513 volant->dump(); 1514 G4cout <<"DEBUGA Total = " << volant->getTotalMass() << G4endl; 1515 } 1525 1516 } 1526 1517 else { … … 1530 1521 // fission fragment mass distribution is calulated in subroutine fisdis 1531 1522 if (itest == 1) { 1532 G4cout <<" < fission >" << G4endl;1523 G4cout <<"PK::: < fission >" << G4endl; 1533 1524 } 1534 1525 amoins = 0.0; … … 1539 1530 pc = 0.0; 1540 1531 ff = 1; 1541 // 1532 // ff = 0; // For testing, allows to disable fission! 1542 1533 } 1543 1534 1544 1535 if (itest == 1) { 1545 G4cout << "sn,sbp,sba,ef" << sn << "," << sbp << "," << sba <<"," << ef << G4endl;1546 G4cout << "probn,probp,proba,probf,ptotl " <<","<< probn <<","<< probp <<","<< proba <<","<< probf <<","<< ptotl << G4endl;1536 G4cout << std::setprecision(9) <<"PK::: SN,SBP,SBA,EF " << sn << " " << sbp << " " << sba <<" " << ef << G4endl; 1537 G4cout << std::setprecision(9) <<"PK::: PROBN,PROBP,PROBA,PROBF,PTOTL " <<" "<< probn <<" "<< probp <<" "<< proba <<" "<< probf <<" "<< ptotl << G4endl; 1547 1538 } 1548 1539 … … 1557 1548 1558 1549 if(ff == 0) { 1559 standardRandom(&rnd,&(hazard->igraine[8])); 1550 rnd = randomGenerator->getRandom(); 1551 // standardRandom(&rnd,&(hazard->igraine[8])); 1560 1552 ctet1 = 2.0*rnd - 1.0; 1561 standardRandom(&rnd,&(hazard->igraine[4])); 1553 rnd = randomGenerator->getRandom(); 1554 // standardRandom(&rnd,&(hazard->igraine[4])); 1562 1555 phi1 = rnd*2.0*3.141592654; 1563 1556 stet1 = std::sqrt(1.0 - std::pow(ctet1,2)); 1564 // assert(isnan(stet1) == false);1565 1557 volant->xcv[volant->iv] = stet1*std::cos(phi1); 1566 1558 volant->ycv[volant->iv] = stet1*std::sin(phi1); … … 1569 1561 pyeva = pyeva - pc * volant->ycv[volant->iv]; 1570 1562 pleva = pleva - pc * ctet1; 1571 // assert(isnan(pleva) == false);1572 1563 } 1573 1564 … … 1599 1590 G4double *ba_par, G4int inttype, G4int inum, G4int itest) 1600 1591 { 1601 G4int dummy0 ;1592 G4int dummy0 = 0; 1602 1593 1603 1594 G4double probp = (*probp_par); … … 1680 1671 // - AVERAGE KINETIC ENERGIES (2*T) AND EFFECTIVE BARRIERS 1681 1672 1682 static G4double bk; 1683 static G4int afp; 1684 static G4double at; // = 0.0; 1685 static G4double bet; // = 0.0; 1686 static G4double bs; 1687 static G4double bshell; 1688 static G4double cf; 1689 static G4double dconst; 1690 static G4double defbet; 1691 static G4double denomi; 1692 static G4double densa; 1693 static G4double densf; 1694 static G4double densg; 1695 static G4double densn; 1696 static G4double densp; 1697 static G4double edyn; 1698 static G4double eer; 1699 static G4double ef; 1700 static G4double ft; 1701 static G4double ga; // = 0.0; 1702 static G4double gf; // = 0.0; 1703 static G4double gn; // = 0.0; 1704 static G4double gngf; 1705 static G4double gp; // = 0.0; 1706 static G4double gsum; 1673 static G4double bk = 0.0; 1674 static G4int afp = 0; 1675 static G4double at = 0.0; 1676 static G4double bs = 0.0; 1677 static G4double bshell = 0.0; 1678 static G4double cf = 0.0; 1679 static G4double dconst = 0.0; 1680 static G4double defbet = 0.0; 1681 static G4double denomi = 0.0; 1682 static G4double densa = 0.0; 1683 static G4double densf = 0.0; 1684 static G4double densg = 0.0; 1685 static G4double densn = 0.0; 1686 static G4double densp = 0.0; 1687 static G4double edyn = 0.0; 1688 static G4double eer = 0.0; 1689 static G4double ef = 0.0; 1690 static G4double ft = 0.0; 1691 static G4double ga = 0.0; 1692 static G4double gf = 0.0; 1693 static G4double gn = 0.0; 1694 static G4double gngf = 0.0; 1695 static G4double gp = 0.0; 1696 static G4double gsum = 0.0; 1707 1697 static G4double hbar = 6.582122e-22; // = 0.0; 1708 static G4double homega; // = 0.0; 1709 static G4double iflag; 1710 static G4int il; 1711 static G4int ilast; 1712 static G4int imaxwell; 1713 static G4int in; 1714 static G4int iz; 1715 static G4int j; 1716 static G4int k; 1717 static G4double ma1z; 1718 static G4double ma1z1; 1719 static G4double ma4z2; 1720 static G4double maz; 1721 static G4double nprf; 1722 static G4double nt; 1723 static G4double parc; 1698 static G4double iflag = 0.0; 1699 static G4int il = 0; 1700 static G4int imaxwell = 0; 1701 static G4int in = 0; 1702 static G4int iz = 0; 1703 static G4int j = 0; 1704 static G4int k = 0; 1705 static G4double ma1z = 0.0; 1706 static G4double ma1z1 = 0.0; 1707 static G4double ma4z2 = 0.0; 1708 static G4double maz = 0.0; 1709 static G4double nprf = 0.0; 1710 static G4double nt = 0.0; 1711 static G4double parc = 0.0; 1724 1712 static G4double pi = 3.14159265; 1725 static G4double pt ;1726 static G4double ra ;1727 static G4double rat ;1728 static G4double refmod ;1729 static G4double rf ;1730 static G4double rn ;1731 static G4double rnd ;1732 static G4double rnt ;1733 static G4double rp ;1734 static G4double rpt ;1735 static G4double sa ;1736 static G4double sbf ;1737 static G4double sbfis ;1738 static G4double segs ;1739 static G4double selmax ;1740 static G4double sp ;1741 static G4double tauc ;1742 static G4double tconst ;1743 static G4double temp ;1744 static G4double ts1 ;1745 static G4double tsum ;1746 static G4double wf ; //= 0.0;1747 static G4double wfex ;1748 static G4double xx ;1749 static G4double y ;1713 static G4double pt = 0.0; 1714 static G4double ra = 0.0; 1715 static G4double rat = 0.0; 1716 static G4double refmod = 0.0; 1717 static G4double rf = 0.0; 1718 static G4double rn = 0.0; 1719 static G4double rnd = 0.0; 1720 static G4double rnt = 0.0; 1721 static G4double rp = 0.0; 1722 static G4double rpt = 0.0; 1723 static G4double sa = 0.0; 1724 static G4double sbf = 0.0; 1725 static G4double sbfis = 0.0; 1726 static G4double segs = 0.0; 1727 static G4double selmax = 0.0; 1728 static G4double sp = 0.0; 1729 static G4double tauc = 0.0; 1730 static G4double tconst = 0.0; 1731 static G4double temp = 0.0; 1732 static G4double ts1 = 0.0; 1733 static G4double tsum = 0.0; 1734 static G4double wf = 0.0; 1735 static G4double wfex = 0.0; 1736 static G4double xx = 0.0; 1737 static G4double y = 0.0; 1750 1738 1751 1739 imaxwell = 1; … … 1757 1745 1758 1746 // no limit if statistical model is calculated. 1759 if ( bet <= 1.0e-16) {1747 if (fiss->bet <= 1.0e-16) { 1760 1748 edyn = 10000.0; 1761 1749 } … … 1763 1751 // just a change of name until the end of this subroutine 1764 1752 eer = ee; 1753 if(verboseLevel > 2) 1754 G4cout << __FILE__ << ":" << __LINE__ << " eer = " << eer << G4endl; 1765 1755 if (inum == 1) { 1766 1756 ilast = 1; … … 1784 1774 mglw(a-4.0,zprf-2.0,&ma4z2); 1785 1775 } 1786 // assert(isnan(maz) == false);1787 // assert(isnan(ma1z) == false);1788 // assert(isnan(ma1z1) == false);1789 // assert(isnan(ma4z2) == false);1790 1776 1791 1777 // separation energies and effective barriers … … 1804 1790 1805 1791 sbp = sp + bp; 1806 // assert(isnan(sbp) == false);1807 // assert(isinf(sbp) == false);1808 1792 if (a-4.0 <= 0.0) { 1809 1793 sba = 1.0e+75; … … 1817 1801 1818 1802 sba = sa + ba; 1819 // assert(isnan(sba) == false);1820 // assert(isinf(sba) == false);1821 1803 direct30: 1822 1804 … … 1833 1815 il = idnint(jprf); 1834 1816 barfit(k,k+j,il,&sbfis,&segs,&selmax); 1835 // assert(isnan(sbfis) == false);1836 1817 if ((fiss->optshp == 1) || (fiss->optshp == 3)) { 1837 1818 // fb->efa[k][j] = G4double(sbfis) - ecld->ecgnz[j][k]; … … 1857 1838 fb->efa[j][k] = 0.0; 1858 1839 } 1859 // assert(isnan(fb->efa[j][k]) == false);1860 1840 1861 1841 // factor with jprf should be 0.0025d0 - 0.01d0 for … … 1867 1847 } 1868 1848 xx = fissility((k+j),k,fiss->optxfis); 1869 // assert(isnan(xx) == false);1870 // assert(isinf(xx) == false);1871 1849 1872 1850 y = 1.00 - xx; … … 1878 1856 } 1879 1857 bs = bipol(1,y); 1880 // assert(isnan(bs) == false);1881 // assert(isinf(bs) == false);1882 1858 bk = bipol(2,y); 1883 // assert(isnan(bk) == false);1884 // assert(isinf(bk) == false);1885 1859 } 1886 1860 else { … … 1895 1869 in = afp - iz; 1896 1870 bshell = ecld->ecfnz[in][iz]; 1897 // assert(isnan(bshell) == false);1898 1871 1899 1872 // ld saddle point deformation … … 1905 1878 // a.r.j. 6.8.97 1906 1879 defbet = 1.58533e0 * spdef(idnint(a),idnint(zprf),fiss->optxfis); 1907 // assert(isnan(defbet) == false);1908 1880 1909 1881 // level density and temperature at the saddle point … … 1919 1891 // G4cout <<"densf = " << densf << G4endl; 1920 1892 // G4cout <<"temp = " << temp << G4endl; 1921 // assert(isnan(densf) == false);1922 // assert(isnan(temp) == false);1923 // assert(temp != 0);1924 1893 ft = temp; 1925 1894 if (iz >= 2) { … … 1929 1898 // level density and temperature in the proton daughter 1930 1899 densniv(a-1.0,zprf-1.0e0,ee,sbp,&densp, bshell,1.e0,1.e0,&temp,int(fiss->optshp),int(fiss->optcol),defbet); 1931 assert(temp >= 0);1932 // assert(isnan(temp) == false);1933 1900 pt = temp; 1934 1901 if (imaxwell == 1) { … … 1946 1913 iflag = iflag + 1; 1947 1914 if(iflag >= 10) { 1948 standardRandom(&rnd,&(hazard->igraine[5])); 1915 rnd = randomGenerator->getRandom(); 1916 // standardRandom(&rnd,&(hazard->igraine[5])); 1949 1917 ecp=std::sqrt(rnd)*(eer-sbp); 1950 // assert(isnan(ecp) == false);1951 1918 goto direct2914; 1952 1919 } … … 1976 1943 densniv(a-1.0,zprf,ee,sn,&densn,bshell, 1.e0,1.e0,&temp,int(fiss->optshp),int(fiss->optcol),defbet); 1977 1944 nt = temp; 1978 1945 if(itest == 1) 1946 G4cout <<"PK::: nt = " << nt <<G4endl; 1979 1947 if (imaxwell == 1) { 1980 1948 // valentina - random kinetic energy in a maxwelliam distribution … … 1988 1956 1989 1957 iflag=0; 1990 1958 direct1915: 1991 1959 ecn = fmaxhaz(rnt); 1960 if(verboseLevel > 2) { 1961 G4cout <<"rnt = " << rnt << G4endl; 1962 G4cout << __FILE__ << ":" << __LINE__ << " ecn = " << ecn << G4endl; 1963 } 1992 1964 iflag=iflag+1; 1993 1965 if(iflag >= 10) { 1994 standardRandom(&rnd,&(hazard->igraine[6])); 1966 rnd = randomGenerator->getRandom(); 1967 // standardRandom(&rnd,&(hazard->igraine[6])); 1995 1968 ecn = std::sqrt(rnd)*(eer-sn); 1996 // assert(isnan(ecn) == false); 1969 if(verboseLevel > 2) 1970 G4cout << __FILE__ << ":" << __LINE__ << " ecn = " << ecn << G4endl; 1997 1971 goto direct2915; 1998 1972 } 1999 // if((ecn+sn) > eer) { 2000 // goto direct1915; 2001 // } 2002 // else { 2003 // ecn = 2.e0 * nt; 2004 // } 2005 if((ecn + sn) <= eer) { 2006 ecn = 2.0 * nt; 2007 } 1973 if((ecn+sn) > eer) { 1974 goto direct1915; 1975 } 1976 } 1977 else { 1978 ecn = 2.e0 * nt; 1979 if(verboseLevel > 2) 1980 G4cout << __FILE__ << ":" << __LINE__ << " ecn = " << ecn << G4endl; 1981 } 1982 // if((ecn + sn) <= eer) { 1983 // ecn = 2.0 * nt; 1984 // G4cout << __FILE__ << ":" << __LINE__ << " ecn = " << ecn << G4endl; 1985 // } 2008 1986 direct2915: 2009 1987 dummy0 = 0; 2010 1988 // G4cout <<"" <<G4endl; 2011 } 2012 } 1989 } 2013 1990 else { 2014 1991 densn = 0.0; … … 2021 1998 defbet = 1.5 * (ecld->alpha[in-2][iz-2]); 2022 1999 2000 // For debugging: 2001 // bshell = -10.7; 2002 // defbet = -0.06105; 2003 // G4cout <<"ecgnz N = " << in-2 << G4endl; 2004 // G4cout <<"ecgnz Z = " << iz-2 << G4endl; 2005 // G4cout <<"bshell = " << bshell << G4endl; 2006 // G4cout <<"defbet = " << defbet << G4endl; 2023 2007 // level density and temperature in the alpha daughter 2024 2008 densniv(a-4.0,zprf-2.0e0,ee,sba,&densa,bshell,1.e0,1.e0,&temp,int(fiss->optshp),int(fiss->optcol),defbet); 2009 // G4cout <<"densa = " << densa << G4endl; 2010 // G4cout <<"temp = " << temp << G4endl; 2025 2011 2026 2012 // valentina - random kinetic energy in a maxwelliam distribution … … 2039 2025 iflag=iflag+1; 2040 2026 if(iflag >= 10) { 2041 standardRandom(&rnd,&(hazard->igraine[7])); 2027 rnd = randomGenerator->getRandom(); 2028 // standardRandom(&rnd,&(hazard->igraine[7])); 2042 2029 eca=std::sqrt(rnd)*(eer-sba); 2043 // assert(isnan(eca) == false);2044 2030 goto direct2916; 2045 2031 } … … 2047 2033 goto direct1916; 2048 2034 } 2049 else { 2050 eca = 2.0 * at; 2051 } 2035 } 2036 else { 2037 eca = 2.0 * at; 2038 } 2052 2039 direct2916: 2053 2040 dummy0 = 0; 2054 2041 // G4cout <<"" << G4endl; 2055 2056 2057 2058 2059 2060 2061 } // PK2042 } 2043 else { 2044 densa = 0.0; 2045 eca = 0.0; 2046 at = 0.0; 2047 } 2048 //} // PK 2062 2049 2063 2050 // special treatment for unbound nuclei … … 2087 2074 // compound nucleus level density 2088 2075 densniv(a,zprf,ee,0.0e0,&densg,bshell,1.e0,1.e0,&temp,int(fiss->optshp),int(fiss->optcol),defbet); 2089 // assert(isnan(densg) == false);2090 // assert(isnan(temp) == false);2091 2076 2092 2077 if ( densg > 0.e0) { … … 2097 2082 ga = (std::pow(a,(2.0/3.0))/fiss->akap)*densa/densg/pi*2.0*std::pow(at,2); 2098 2083 gf = densf/densg/pi/2.0*ft; 2099 // assert(isnan(gf) == false);2100 2101 // assert(isnan(gp) == false);2102 // assert(isnan(gn) == false);2103 // assert(isnan(ga) == false);2104 // assert(isnan(ft) == false);2105 // assert(ft != 0);2106 // assert(isnan(gf) == false);2107 2084 2108 2085 if(itest == 1) { … … 2117 2094 2118 2095 gsum = ga + gp + gn; 2119 // assert(isinf(gsum) == false);2120 // assert(isnan(gsum) == false);2121 2096 if (gsum > 0.0) { 2122 2097 ts1 = hbar / gsum; … … 2162 2137 rp = 1.0; 2163 2138 rn = densn/densp*std::pow((nt/pt),2); 2164 // assert(isnan(rn) == false);2165 2139 ra = densa*2.0/densp*std::pow((at/pt),2); 2166 // assert(isnan(ra) == false);2167 2140 goto direct50; 2168 2141 } … … 2173 2146 // cramers and weidenmueller factors for the dynamical hindrances of 2174 2147 // fission 2175 if ( bet <= 1.0e-16) {2148 if (fiss->bet <= 1.0e-16) { 2176 2149 cf = 1.0; 2177 2150 wf = 1.0; 2178 2151 } 2179 2152 else if (sbf > 0.0e0) { 2180 cf = cram( bet,homega);2153 cf = cram(fiss->bet,fiss->homega); 2181 2154 // if fission barrier ef=0.d0 then fission is the only possible 2182 2155 // channel. to avoid std::log(0) in function tau … … 2190 2163 else { 2191 2164 // transient time tau() 2192 tauc = tau(bet,homega,ef,ft); 2193 // assert(isnan(tauc) == false); 2165 tauc = tau(fiss->bet,fiss->homega,ef,ft); 2194 2166 } 2195 2167 wfex = (tauc - tsum)/ts1; … … 2216 2188 tconst = 0.7; 2217 2189 dconst = 12.0/std::sqrt(a); 2218 // assert(isnan(dconst) == false);2219 2190 nprf = a - zprf; 2220 2191 2221 2192 if (fiss->optshp >= 2) { //then 2222 2193 parite(nprf,&parc); 2223 // assert(isnan(parc) == false);2224 2194 dconst = dconst*parc; 2225 2195 } … … 2241 2211 else { 2242 2212 rn=gngf; 2243 // assert(isnan(rn) == false);2244 2213 rp=gngf*gp/gn; 2245 // assert(isnan(rp) == false);2246 2214 ra=gngf*ga/gn; 2247 // assert(isnan(ra) == false);2248 2215 } 2249 2216 } else { 2250 // assert(isnan(cf) == false);2251 // assert(isinf(gn) == false);2252 // assert(isinf(gf) == false);2253 // assert(isinf(cf) == false);2254 assert(gn > 0 || (gf != 0 && cf != 0));2255 2217 rn = gn/(gf*cf); 2256 2218 // G4cout <<"rn = " << G4endl; 2257 2219 // G4cout <<"gn = " << gn << " gf = " << gf << " cf = " << cf << G4endl; 2258 // assert(isnan(rn) == false);2259 2220 rp = gp/(gf*cf); 2260 // assert(isnan(rp) == false);2261 2221 ra = ga/(gf*cf); 2262 // assert(isnan(ra) == false);2263 2222 } 2264 2223 direct50: 2265 2224 // relative decay probabilities 2266 // assert(isnan(ra) == false);2267 // assert(isnan(rp) == false);2268 // assert(isnan(rn) == false);2269 // assert(isnan(rf) == false);2270 2271 2225 denomi = rp+rn+ra+rf; 2272 // assert(isnan(denomi) == false);2273 assert(denomi > 0);2274 2226 // decay probabilities after transient time 2275 2227 probf = rf/denomi; 2276 // assert(isnan(probf) == false);2277 2228 probp = rp/denomi; 2278 // assert(isnan(probp) == false);2279 2229 probn = rn/denomi; 2280 // assert(isnan(probn) == false);2281 2230 proba = ra/denomi; 2282 // assert(isnan(proba) == false);2283 // assert(isinf(proba) == false);2284 2231 2285 2232 // new treatment of grange-weidenmueller factor, 5.1.2000, khs !!! 2286 2233 2287 2234 // decay probabilites with transient time included 2288 // assert(isnan(wf) == false);2289 assert(std::fabs(probf) <= 1.0);2290 2235 probf = probf * wf; 2291 2236 if(probf == 1.0) { … … 2300 2245 } 2301 2246 direct70: 2302 // assert(isnan(probp) == false);2303 // assert(isnan(probn) == false);2304 // assert(isnan(probf) == false);2305 // assert(isnan(proba) == false);2306 2247 ptotl = probp+probn+proba+probf; 2307 // assert(isnan(ptotl) == false);2308 2248 2309 2249 ee = eer; … … 2311 2251 2312 2252 // Return values: 2313 // assert(isnan(proba) == false);2314 2253 (*probp_par) = probp; 2315 2254 (*probn_par) = probn; … … 2378 2317 // 1544 C 2379 2318 // 1545 C 2380 G4double afp ;2381 G4double delta0 ;2382 G4double deltau ;2383 G4double deltpp ;2384 G4double e ;2319 G4double afp = 0.0; 2320 G4double delta0 = 0.0; 2321 G4double deltau = 0.0; 2322 G4double deltpp = 0.0; 2323 G4double e = 0.0; 2385 2324 G4double ecor = 0.0; 2386 G4double ecor1 ;2387 G4double ecr ;2388 G4double er ;2389 G4double fe ;2390 G4double fp ;2391 G4double he ;2392 G4double iz ;2393 G4double pa ;2394 G4double para ;2395 G4double parz ;2396 G4double ponfe ;2397 G4double ponniv ;2398 G4double qr ;2399 G4double sig ;2400 G4double y01 ;2401 G4double y11 ;2402 G4double y2 ;2403 G4double y21 ;2404 G4double y1 ;2405 G4double y0 ;2325 G4double ecor1 = 0.0; 2326 G4double ecr = 0.0; 2327 G4double er = 0.0; 2328 G4double fe = 0.0; 2329 G4double fp = 0.0; 2330 G4double he = 0.0; 2331 G4double iz = 0.0; 2332 G4double pa = 0.0; 2333 G4double para = 0.0; 2334 G4double parz = 0.0; 2335 G4double ponfe = 0.0; 2336 G4double ponniv = 0.0; 2337 G4double qr = 0.0; 2338 G4double sig = 0.0; 2339 G4double y01 = 0.0; 2340 G4double y11 = 0.0; 2341 G4double y2 = 0.0; 2342 G4double y21 = 0.0; 2343 G4double y1 = 0.0; 2344 G4double y0 = 0.0; 2406 2345 2407 2346 G4double pi6 = std::pow(3.1415926535,2) / 6.0; … … 2453 2392 // deltpp = -0.25e0* (delta0/std::pow(std::sqrt(a),2)) * pa /pi6 + 2.e0*delta0/std::sqrt(a); 2454 2393 deltpp = -0.25e0* std::pow((delta0/std::sqrt(a)),2) * pa /pi6 + 2.e0*delta0/std::sqrt(a); 2455 // assert(isnan(deltpp) == false);2456 2394 2457 2395 parite(a,¶); 2458 2396 if (para < 0.0) { 2459 2397 e = e - delta0/std::sqrt(a); 2460 // assert(isnan(e) == false);2461 2398 } else { 2462 2399 parite(z,&parz); 2463 2400 if (parz > 0.e0) { 2464 2401 e = e - 2.0*delta0/std::sqrt(a); 2465 // assert(isnan(e) == false);2466 2402 } else { 2467 2403 e = e; 2468 // assert(isnan(e) == false);2469 2404 } 2470 2405 } … … 2510 2445 if (ee < 5.0) { 2511 2446 y1 = std::sqrt(pa*ecor); 2512 // assert(isnan(y1) == false);2513 2447 for(int j = 0; j < 5; j++) { 2514 2448 y2 = pa*ecor*(1.e0-std::exp(-y1)); 2515 // assert(isnan(y2) == false);2516 2449 y1 = std::sqrt(y2); 2517 // assert(isnan(y1) == false);2518 2450 } 2519 2451 2520 2452 y0 = pa/y1; 2521 // assert(isnan(y0) == false);2522 assert(y0 != 0.0);2523 2453 (*temp)=1.0/y0; 2524 2454 (*dens) = std::exp(y0*ecor)/ (std::pow((std::pow(ecor,3)*y0),0.5)*std::pow((1.0-0.5*y0*ecor*std::exp(-y1)),0.5))* std::exp(y1)*(1.0-std::exp(-y1))*0.1477045; … … 2526 2456 ecor1=1.0; 2527 2457 y11 = std::sqrt(pa*ecor1); 2528 // assert(isnan(y11) == false);2529 2458 for(int j = 0; j < 7; j++) { 2530 2459 y21 = pa*ecor1*(1.0-std::exp(-y11)); 2531 // assert(isnan(21) == false);2532 2460 y11 = std::sqrt(y21); 2533 // assert(isnan(y11) == false);2534 2461 } 2535 2462 2536 2463 y01 = pa/y11; 2537 // assert(isnan(y01) == false);2538 2464 (*dens) = (*dens)*std::pow((y01/y0),1.5); 2539 2465 (*temp) = (*temp)*std::pow((y01/y0),1.5); … … 2542 2468 else { 2543 2469 ponniv = 2.0*std::sqrt(pa*ecor); 2544 // assert(isnan(ponniv) == false);2545 2470 if (ponniv > 700.0) { 2546 2471 ponniv = 700.0; … … 2549 2474 // fermi gas state density 2550 2475 (*dens) = std::pow(pa,(-0.25e0))*std::pow(ecor,(-1.25e0))*std::exp(ponniv) * 0.1477045e0; 2551 // assert(isnan(std::sqrt(ecor/pa)) == false);2552 2476 (*temp) = std::sqrt(ecor/pa); 2553 2477 } … … 2566 2490 2567 2491 (*dens) = (*dens) * qr; 2492 if(verboseLevel > 2) { 2493 G4cout <<"PK::: dens = " << (*dens) << G4endl; 2494 G4cout <<"PK::: AFP, IZ, ECOR, ECOR1 " << afp << " " << iz << " " << ecor << " " << ecor1 << G4endl; 2495 } 2568 2496 } 2569 2497 … … 2576 2504 // replaces tables. Barrier heights from Myers and Swiatecki !!! 2577 2505 2578 G4double nms ,ims,ksims,xms, ums;2506 G4double nms = 0.0, ims = 0.0, ksims = 0.0, xms = 0.0, ums = 0.0; 2579 2507 2580 2508 nms = ams - zms; … … 2623 2551 // otherwise - return pairing (= -1/2 dpn + 1/2 (Dp + Dn)) 2624 2552 2625 G4double eflmacResult; 2626 2627 G4int in; 2628 G4double z,n,a,av,as,a0,c1,c4,b1,b3,f,ca,w,dp,dn,dpn,efl,pi; 2629 G4double rmac,bs,h,r0,kf,ks,kv,rp,ay,aden,x0,y0,mh,mn,esq,ael,i; 2630 pi = 3.141592653589793238e0; 2553 G4double eflmacResult = 0.0; 2554 2555 G4int in = 0; 2556 G4double z = 0.0, n = 0.0, a = 0.0, av = 0.0, as = 0.0; 2557 G4double a0 = 0.0, c1 = 0.0, c4 = 0.0, b1 = 0.0, b3 = 0.0; 2558 G4double f = 0.0, ca = 0.0, w = 0.0, dp = 0.0, dn = 0.0, dpn = 0.0, efl = 0.0; 2559 G4double rmac = 0.0, bs = 0.0, h = 0.0, r0 = 0.0, kf = 0.0, ks = 0.0; 2560 G4double kv = 0.0, rp = 0.0, ay = 0.0, aden = 0.0, x0 = 0.0, y0 = 0.0; 2561 G4double mh = 0.0, mn = 0.0, esq = 0.0, ael = 0.0, i = 0.0; 2562 G4double pi = 3.141592653589793238e0; 2631 2563 2632 2564 // fundamental constants … … 2696 2628 dp = rmac*bs/std::pow(z,(1.0/3.0)); 2697 2629 dpn = h/bs/std::pow(a,(2.0/3.0)); 2698 // assert(isnan(dpn) == false);2699 2630 2700 2631 c1 = 3.0/5.0*esq/r0; 2701 // assert(isnan(c1) == false);2702 // assert(isinf(c1) == false);2703 2704 2632 c4 = 5.0/4.0*std::pow((3.0/(2.0*pi)),(2.0/3.0)) * c1; 2705 // assert(isnan(c4) == false);2706 // assert(isinf(c4) == false);2707 2708 // assert(isnan(pi) == false);2709 // assert(isnan(z) == false);2710 // assert(isnan(a) == false);2711 // assert(isnan(r0) == false);2712 2633 kf = std::pow((9.0*pi*z/(4.0*a)),(1.0/3.0))/r0; 2713 // assert(isnan(kf) == false);2714 // assert(isinf(kf) == false);2715 2634 2716 2635 f = -1.0/8.0*rp*rp*esq/std::pow(r0,3) * (145.0/48.0 - 327.0/2880.0*std::pow(kf,2) * std::pow(rp,2) + 1527.0/1209600.0*std::pow(kf,4) * std::pow(rp,4)); … … 2772 2691 // ENERGY OF A SPECIFIC NUCLEUS 2773 2692 2774 double para ,parz;2693 double para = 0.0, parz = 0.0; 2775 2694 // A MASS NUMBER 2776 2695 // Z NUCLEAR CHARGE … … 2787 2706 parite(z, &parz); 2788 2707 if (parz > 0.0) { 2789 // assert(isnan(std::sqrt(a)) == false);2790 2708 (*del) = -12.0/std::sqrt(a); 2791 2709 } 2792 2710 else { 2793 // assert(isnan(std::sqrt(a)) == false);2794 2711 (*del) = 12.0/std::sqrt(a); 2795 2712 } … … 2804 2721 // RETURNS -1 IF N IS ODD AND +1 IF N IS EVEN 2805 2722 2806 G4double n1 , n2, n3;2723 G4double n1 = 0.0, n2 = 0.0, n3 = 0.0; 2807 2724 2808 2725 // N NUMBER TO BE TESTED … … 2833 2750 // T - NUCLEAR TEMPERATURE 2834 2751 2835 G4double tauResult; 2836 2837 G4double tlim; 2838 tlim = 8.e0 * ef; 2752 G4double tauResult = 0.0; 2753 2754 G4double tlim = 8.e0 * ef; 2839 2755 if (t > tlim) { 2840 2756 t = tlim; … … 2844 2760 if (bet/(std::sqrt(2.0)*10.0*(homega/6.582122)) <= 1.0) { 2845 2761 tauResult = std::log(10.0*ef/t)/(bet*1.0e21); 2846 // assert(isnan(tauResult) == false);2847 2762 } 2848 2763 else { 2849 2764 tauResult = std::log(10.0*ef/t)/ (2.0*std::pow((10.0*homega/6.582122),2))*(bet*1.0e-21); 2850 // assert(isnan(tauResult) == false);2851 2765 } //end if 2852 2766 … … 2868 2782 } 2869 2783 2870 // assert(isnan(cramResult) == false);2871 2784 return cramResult; 2872 2785 } … … 2883 2796 // LINEAR INTERPOLATION OF BS BK TABLE 2884 2797 2885 int i ;2886 2887 G4double bipolResult ;2798 int i = 0; 2799 2800 G4double bipolResult = 0.0; 2888 2801 2889 2802 const int bsbkSize = 54; … … 2908 2821 2909 2822 i = idint(y/(2.0e-02)) + 1; 2910 assert(i >= 1);2911 2823 2912 2824 if(i >= bsbkSize) { … … 2925 2837 } 2926 2838 2927 // assert(isnan(bipolResult) == false);2928 2839 return bipolResult; 2929 2840 } … … 2998 2909 2999 2910 G4double pa[7],pz[7],pl[10]; 3000 G4double a,z,amin,amax,amin2,amax2,aa,zz,bfis; 3001 G4double bfis0,ell,el,egs,el80,el20,elmax,sel80,sel20,x,y,q,qa,qb; 3002 G4double aj,ak,a1,a2; 3003 3004 G4int i,j,k,m; 3005 G4int l; 2911 for(G4int init_i = 0; init_i < 7; init_i++) { 2912 pa[init_i] = 0.0; 2913 pz[init_i] = 0.0; 2914 } 2915 for(G4int init_i = 0; init_i < 10; init_i++) { 2916 pl[init_i] = 0.0; 2917 } 2918 2919 G4double a = 0.0, z = 0.0, amin = 0.0, amax = 0.0, amin2 = 0.0; 2920 G4double amax2 = 0.0, aa = 0.0, zz = 0.0, bfis = 0.0; 2921 G4double bfis0 = 0.0, ell = 0.0, el = 0.0, egs = 0.0, el80 = 0.0, el20 = 0.0; 2922 G4double elmax = 0.0, sel80 = 0.0, sel20 = 0.0, x = 0.0, y = 0.0, q = 0.0, qa = 0.0, qb = 0.0; 2923 G4double aj = 0.0, ak = 0.0, a1 = 0.0, a2 = 0.0; 2924 2925 G4int i = 0, j = 0, k = 0, m = 0; 2926 G4int l = 0; 3006 2927 3007 2928 G4double emncof[4][5] = {{-9.01100e+2,-1.40818e+3, 2.77000e+3,-7.06695e+2, 8.89867e+2}, … … 3110 3031 3111 3032 bfis=bfis0; 3112 // assert(isnan(bfis) == false);3113 3033 3114 3034 (*sbfis)=bfis; … … 3155 3075 } 3156 3076 3157 // assert(isnan(elmax) == false);3158 3077 (*selmax)=elmax; 3159 3078 … … 3164 3083 3165 3084 x = sel20/(*selmax); 3166 // assert(isnan(x) == false);3167 3085 y = sel80/(*selmax); 3168 // assert(isnan(y) == false);3169 3086 3170 3087 if(el <= sel20) { … … 3252 3169 // TIRAGE ALEATOIRE DANS UNE EXPONENTIELLLE : Y=EXP(-X/T) 3253 3170 3254 // assert(isnan((-1*T*std::log(haz(k)))) == false);3255 3171 return (-1.0*T*std::log(haz(k))); 3256 3172 } … … 3281 3197 3282 3198 // ial generateur pour le cascade (et les iy pour eviter les correlations) 3283 static G4int i ;3199 static G4int i = 0; 3284 3200 static G4int itest = 0; 3285 3201 // programme principal … … 3288 3204 p[pSize-1] = 8.0; 3289 3205 G4double x = 0.1; 3290 G4double x1 ;3291 G4double y ;3206 G4double x1 = 0.0; 3207 G4double y = 0.0; 3292 3208 3293 3209 if (itest == 1) { … … 3312 3228 // par regression lineaire 3313 3229 fmaxhaz120: 3314 standardRandom(&y, &(hazard->igraine[17])); 3230 y = randomGenerator->getRandom(); 3231 // standardRandom(&y, &(hazard->igraine[17])); 3315 3232 i = nint(y*100); 3316 3233 … … 3336 3253 // Révisée pour a, z flottants 25/4/2002 = 3337 3254 3338 G4double pace2 ;3255 G4double pace2 = 0.0; 3339 3256 3340 3257 G4int ii = idint(a+0.5); … … 3383 3300 const G4int qcols = 70; 3384 3301 G4double q[qrows][qcols]; 3302 for(G4int init_i = 0; init_i < qrows; init_i++) { 3303 for(G4int init_j = 0; init_j < qcols; init_j++) { 3304 q[init_i][init_j] = 0.0; 3305 } 3306 } 3385 3307 3386 3308 G4int ix=G4int(std::floor(x+0.5)); … … 3431 3353 (*z_par) = z; 3432 3354 (*find_par) = find; 3433 }3434 3435 3436 // Fission code3437 3438 void G4Abla::even_odd(G4double r_origin,G4double r_even_odd,G4int &i_out)3439 {3440 // Procedure to calculate I_OUT from R_IN in a way that3441 // on the average a flat distribution in R_IN results in a3442 // fluctuating distribution in I_OUT with an even-odd effect as3443 // given by R_EVEN_ODD3444 3445 // /* ------------------------------------------------------------ */3446 // /* EXAMPLES : */3447 // /* ------------------------------------------------------------ */3448 // /* If R_EVEN_ODD = 0 : */3449 // /* CEIL(R_IN) ---- */3450 // /* */3451 // /* R_IN -> */3452 // /* (somewhere in between CEIL(R_IN) and FLOOR(R_IN)) */ */3453 // /* */3454 // /* FLOOR(R_IN) ---- --> I_OUT */3455 // /* ------------------------------------------------------------ */3456 // /* If R_EVEN_ODD > 0 : */3457 // /* The interval for the above treatment is */3458 // /* larger for FLOOR(R_IN) = even and */3459 // /* smaller for FLOOR(R_IN) = odd */3460 // /* For R_EVEN_ODD < 0 : just opposite treatment */3461 // /* ------------------------------------------------------------ */3462 3463 // /* ------------------------------------------------------------ */3464 // /* On input: R_ORIGIN nuclear charge (real number) */3465 // /* R_EVEN_ODD requested even-odd effect */3466 // /* Intermediate quantity: R_IN = R_ORIGIN + 0.5 */3467 // /* On output: I_OUT nuclear charge (integer) */3468 // /* ------------------------------------------------------------ */3469 3470 // G4double R_ORIGIN,R_IN,R_EVEN_ODD,R_REST,R_HELP;3471 G4double r_in,r_rest,r_help;3472 G4double r_floor;3473 G4double r_middle;3474 // G4int I_OUT,N_FLOOR;3475 G4int n_floor;3476 3477 r_in = r_origin + 0.5;3478 r_floor = (float)((int)(r_in));3479 if (r_even_odd < 0.001) {3480 i_out = (int)(r_floor);3481 }3482 else {3483 r_rest = r_in - r_floor;3484 r_middle = r_floor + 0.5;3485 n_floor = (int)(r_floor);3486 if (n_floor%2 == 0) {3487 // even before modif.3488 r_help = r_middle + (r_rest - 0.5) * (1.0 - r_even_odd);3489 }3490 else {3491 // odd before modification3492 r_help = r_middle + (r_rest - 0.5) * (1.0 + r_even_odd);3493 }3494 i_out = (int)(r_help);3495 }3496 }3497 3498 G4double G4Abla::umass(G4double z,G4double n,G4double beta)3499 {3500 // liquid-drop mass, Myers & Swiatecki, Lysekil, 19673501 // pure liquid drop, without pairing and shell effects3502 3503 // On input: Z nuclear charge of nucleus3504 // N number of neutrons in nucleus3505 // beta deformation of nucleus3506 // On output: binding energy of nucleus3507 3508 G4double a,umass;3509 G4double alpha;3510 G4double xcom,xvs,xe;3511 const G4double pi = 3.1416;3512 3513 a = n + z;3514 alpha = ( std::sqrt(5.0/(4.0*pi)) ) * beta;3515 // assert(isnan(alpha) == false);3516 3517 xcom = 1.0 - 1.7826 * ((a - 2.0*z)/a)*((a - 2.0*z)/a);3518 // assert(isnan(xcom) == false);3519 // factor for asymmetry dependence of surface and volume term3520 xvs = - xcom * ( 15.4941 * a -3521 17.9439 * std::pow(a,0.66667) * (1.0+0.4*alpha*alpha) );3522 // sum of volume and surface energy3523 xe = z*z * (0.7053/(std::pow(a,0.33333)) * (1.0-0.2*alpha*alpha) - 1.1529/a);3524 // assert(isnan(xe) == false);3525 umass = xvs + xe;3526 3527 return umass;3528 }3529 3530 G4double G4Abla::ecoul(G4double z1,G4double n1,G4double beta1,G4double z2,G4double n2,G4double beta2,G4double d)3531 {3532 // Coulomb potential between two nuclei3533 // surfaces are in a distance of d3534 // in a tip to tip configuration3535 3536 // approximate formulation3537 // On input: Z1 nuclear charge of first nucleus3538 // N1 number of neutrons in first nucleus3539 // beta1 deformation of first nucleus3540 // Z2 nuclear charge of second nucleus3541 // N2 number of neutrons in second nucleus3542 // beta2 deformation of second nucleus3543 // d distance of surfaces of the nuclei3544 3545 // G4double Z1,N1,beta1,Z2,N2,beta2,d,ecoul;3546 G4double ecoul;3547 G4double dtot;3548 const G4double r0 = 1.16;3549 3550 dtot = r0 * ( std::pow((z1+n1),0.33333) * (1.0+(2.0/3.0)*beta1)3551 + std::pow((z2+n2),0.33333) * (1.0+(2.0/3.0)*beta2) ) + d;3552 ecoul = z1 * z2 * 1.44 / dtot;3553 3554 // assert(isnan(ecoul) == false);3555 return ecoul;3556 }3557 3558 void G4Abla::fissionDistri(G4double &a,G4double &z,G4double &e,3559 G4double &a1,G4double &z1,G4double &e1,G4double &v1,3560 G4double &a2,G4double &z2,G4double &e2,G4double &v2)3561 {3562 // On input: A, Z, E (mass, atomic number and exc. energy of compound nucleus3563 // before fission)3564 // On output: Ai, Zi, Ei (mass, atomic number and exc. energy of fragment 1 and 23565 // after fission)3566 3567 // Additionally calculated but not put in the parameter list:3568 // Kinetic energy of prefragments EkinR1, EkinR23569 3570 // Translation of SIMFIS18.PLI (KHS, 2.1.2001)3571 3572 // This program calculates isotopic distributions of fission fragments3573 // with a semiempirical model3574 // Copy from SIMFIS3, KHS, 8. February 19953575 // Modifications made by Jose Benlliure and KHS in August 19963576 // Energy counted from lowest barrier (J. Benlliure, KHS 1997)3577 // Some bugs corrected (J. Benlliure, KHS 1997)3578 // Version used for thesis S. Steinhaueser (August 1997)3579 // (Curvature of LD potential increased by factor of 2!)3580 3581 // Weiter veraendert mit der Absicht, eine Version zu erhalten, die3582 // derjenigen entspricht, die von J. Benlliure et al.3583 // in Nucl. Phys. A 628 (1998) 458 verwendet wurde,3584 // allerdings ohne volle Neutronenabdampfung.3585 3586 // The excitation energy was calculate now for each fission channel3587 // separately. The dissipation from saddle to scission was taken from3588 // systematics, the deformation energy at scission considers the shell3589 // effects in a simplified way, and the fluctuation is included.3590 // KHS, April 19993591 3592 // The width in N/Z was carefully adapted to values given by Lang et al.3593 3594 // The width and eventually a shift in N/Z (polarization) follows the3595 // following rules:3596 3597 // The line N/Z following UCD has an angle of std::atan(Zcn/Ncn)3598 // to the horizontal axis on a chart of nuclides.3599 // (For 238U the angle is 32.2 deg.)3600 3601 // The following relations hold: (from Armbruster)3602 //3603 // sigma(N) (A=const) = sigma(Z) (A=const)3604 // sigma(A) (N=const) = sigma(Z) (N=const)3605 // sigma(A) (Z=const) = sigma(N) (Z=const)3606 //3607 // From this we get:3608 // sigma(Z) (N=const) * N = sigma(N) (Z=const) * Z3609 // sigma(A) (Z=const) = sigma(Z) (A=const) * A/Z3610 // sigma(N) (Z=const) = sigma(Z) (A=const) * A/Z3611 // Z*sigma(N) (Z=const) = N*sigma(Z) (N=const) = A*sigma(Z) (A=const)3612 3613 // Excitation energy now calculated above the lowest potential point3614 // Inclusion of a distribution of excitation energies3615 3616 // Several modifications, starting from SIMFIS12: KHS November 20003617 // This version seems to work quite well for 238U.3618 // The transition from symmetric to asymmetric fission around 226Th3619 // is reasonably well reproduced, although St. I is too strong and St. II3620 // is too weak. St. I and St. II are also weakly seen for 208Pb.3621 3622 // Extensions for an event generator of fission events (21.11.2000,KHS)3623 3624 // Defalt parameters (IPARS) rather carefully adjusted to3625 // pre-neutron mass distributions of Vives et al. (238U + n)3626 // Die Parameter Fgamma1 und Fgamma2 sind kleiner als die resultierenden3627 // Breiten der Massenverteilungen!!!3628 // Fgamma1 und Fgamma2 wurden angepaï¿œ, so daï¿œ3629 // Sigma-A(ST-I) = 3.3, Sigma-A(St-II) = 5.8 (nach Vives)3630 3631 // Parameters of the model carefully adjusted by KHS (2.2.2001) to3632 // 238U + 208Pb, 1000 A MeV, Timo Enqvist et al.3633 3634 3635 G4double n;3636 G4double nlight1,nlight2;3637 G4double aheavy1,alight1,aheavy2,alight2;3638 G4double eheavy1,elight1,eheavy2,elight2;3639 G4double zheavy1_shell,zheavy2_shell;3640 G4double zlight1,zlight2;3641 G4double masscurv;3642 G4double sasymm1,sasymm2,ssymm,ysum,yasymm;3643 G4double ssymm_mode1,ssymm_mode2;3644 G4double cz_asymm1_saddle,cz_asymm2_saddle;3645 // Curvature at saddle, modified by ld-potential3646 G4double wzasymm1_saddle, wzasymm2_saddle, wzsymm_saddle;3647 G4double wzasymm1_scission, wzasymm2_scission, wzsymm_scission;3648 G4double wzasymm1,wzasymm2,wzsymm;3649 G4double nlight1_eff, nlight2_eff;3650 G4int imode = 0;3651 G4double rmode;3652 G4double z1mean = 0.0, z2mean = 0.0, z1width = 0.0, za1width = 0.0;3653 // G4double Z1,Z2,N1R,N2R,A1R,A2R,N1,N2,A1,A2;3654 G4double n1r,n2r,a1r,a2r,n1,n2;3655 3656 G4double zsymm,nsymm,asymm;3657 G4double n1mean = 0.0, n2mean, n1width;3658 G4double dueff;3659 // effective shell effect at lowest barrier3660 G4double eld;3661 // Excitation energy with respect to ld barrier3662 G4double re1,re2,re3;3663 G4double eps1,eps2;3664 G4double n1ucd,n2ucd,z1ucd,z2ucd;3665 G4double beta = 0.0, beta1 = 0.0, beta2 = 0.0;3666 3667 G4double dn1_pol;3668 // shift of most probable neutron number for given Z,3669 // according to polarization3670 G4int i_help;3671 3672 // /* Parameters of the semiempirical fission model */3673 G4double a_levdens;3674 // /* level-density parameter */3675 G4double a_levdens_light1,a_levdens_light2;3676 G4double a_levdens_heavy1,a_levdens_heavy2;3677 const G4double r_null = 1.16;3678 // /* radius parameter */3679 G4double epsilon_1_saddle,epsilon0_1_saddle;3680 G4double epsilon_2_saddle,epsilon0_2_saddle,epsilon_symm_saddle;3681 G4double epsilon_1_scission,epsilon0_1_scission;3682 G4double epsilon_2_scission,epsilon0_2_scission;3683 G4double epsilon_symm_scission;3684 // /* modified energy */3685 G4double e_eff1_saddle,e_eff2_saddle;3686 G4double epot0_mode1_saddle,epot0_mode2_saddle,epot0_symm_saddle;3687 G4double epot_mode1_saddle,epot_mode2_saddle,epot_symm_saddle;3688 G4double e_defo, e_defo1,e_defo2, e_scission = 0.0, e_asym;3689 G4double e1exc = 0.0, e2exc = 0.0;3690 G4double e1exc_sigma,e2exc_sigma;3691 G4double e1final,e2final;3692 3693 const G4double r0 = 1.16;3694 G4double tker;3695 G4double ekin1,ekin2;3696 // G4double EkinR1,EkinR2,E1,E2,V1,V2;3697 G4double ekinr1,ekinr2;3698 G4int icz,k;3699 3700 // Input parameters:3701 //OMMENT(Nuclear charge number);3702 // G4double Z;3703 //OMMENT(Nuclear mass number);3704 // G4double A;3705 //OMMENT(Excitation energy above fission barrier);3706 // G4double E;3707 3708 // Model parameters:3709 //OMMENT(position of heavy peak valley 1);3710 const G4double nheavy1 = 83.0;3711 //OMMENT(position of heavy peak valley 2);3712 const G4double nheavy2 = 90.0;3713 //OMMENT(Shell effect for valley 1);3714 const G4double delta_u1_shell = -2.65;3715 // Parameter (Delta_U1_shell = -2)3716 //OMMENT(Shell effect for valley 2);3717 const G4double delta_u2_shell = -3.8;3718 // Parameter (Delta_U2_shell = -3.2)3719 //OMMENT(I: used shell effect);3720 G4double delta_u1;3721 //omment(I: used shell effect);3722 G4double delta_u2;3723 //OMMENT(Curvature of asymmetric valley 1);3724 const G4double cz_asymm1_shell = 0.7;3725 //OMMENT(Curvature of asymmetric valley 2);3726 const G4double cz_asymm2_shell = 0.15;3727 //OMMENT(Factor for width of distr. valley 1);3728 const G4double fwidth_asymm1 = 0.63;3729 //OMMENT(Factor for width of distr. valley 2);3730 const G4double fwidth_asymm2 = 0.97;3731 // Parameter (CZ_asymm2_scission = 0.12)3732 //OMMENT(Parameter x: a = A/x);3733 const G4double xlevdens = 12.0;3734 //OMMENT(Factor to gamma_heavy1);3735 const G4double fgamma1 = 2.0;3736 //OMMENT(I: fading of shells (general));3737 G4double gamma;3738 //OMMENT(I: fading of shell 1);3739 G4double gamma_heavy1;3740 //OMMENT(I: fading of shell 2);3741 G4double gamma_heavy2;3742 //OMMENT(Zero-point energy at saddle);3743 const G4double e_zero_point = 0.5;3744 //OMMENT(I: friction from saddle to scission);3745 G4double e_saddle_scission;3746 //OMMENT(Friction factor);3747 const G4double friction_factor = 1.0;3748 //OMMENT(I: Internal counter for different modes); INIT(0,0,0)3749 // Integer*4 I_MODE(3)3750 //OMMENT(I: Yield of symmetric mode);3751 G4double ysymm = 0.0;3752 //OMMENT(I: Yield of asymmetric mode 1);3753 G4double yasymm1 = 0.0;3754 //OMMENT(I: Yield of asymmetric mode 2);3755 G4double yasymm2 = 0.0;3756 //OMMENT(I: Effective position of valley 1);3757 G4double nheavy1_eff;3758 //OMMENT(I: position of heavy peak valley 1);3759 G4double zheavy1;3760 //omment(I: Effective position of valley 2);3761 G4double nheavy2_eff;3762 //OMMENT(I: position of heavy peak valley 2);3763 G4double zheavy2;3764 //omment(I: Excitation energy above saddle 1);3765 G4double eexc1_saddle;3766 //omment(I: Excitation energy above saddle 2);3767 G4double eexc2_saddle;3768 //omment(I: Excitation energy above lowest saddle);3769 G4double eexc_max;3770 //omment(I: Effective mass mode 1);3771 G4double aheavy1_mean;3772 //omment(I: Effective mass mode 2);3773 G4double aheavy2_mean;3774 //omment(I: Width of symmetric mode);3775 G4double wasymm_saddle;3776 //OMMENT(I: Width of asymmetric mode 1);3777 G4double waheavy1_saddle;3778 //OMMENT(I: Width of asymmetric mode 2);3779 G4double waheavy2_saddle;3780 //omment(I: Width of symmetric mode);3781 G4double wasymm;3782 //OMMENT(I: Width of asymmetric mode 1);3783 G4double waheavy1;3784 //OMMENT(I: Width of asymmetric mode 2);3785 G4double waheavy2;3786 //OMMENT(I: Even-odd effect in Z);3787 G4double r_e_o,r_e_o_exp;3788 //OMMENT(I: Curveture of symmetric valley);3789 G4double cz_symm;3790 //OMMENT(I: Curvature of mass distribution for fixed Z);3791 G4double cn;3792 //OMMENT(I: Curvature of Z distribution for fixed A);3793 G4double cz;3794 //OMMENT(Minimum neutron width for constant Z);3795 const G4double sigzmin = 1.16;3796 //OMMENT(Surface distance of scission configuration);3797 const G4double d = 2.0;3798 3799 // /* Charge polarisation from Wagemanns p. 397: */3800 //OMMENT(Charge polarisation standard I);3801 const G4double cpol1 = 0.65;3802 //OMMENT(Charge polarisation standard II);3803 const G4double cpol2 = 0.55;3804 //OMMENT(=1: Polarisation simult. in N and Z);3805 const G4int nzpol = 1;3806 //OMMENT(=1: test output, =0: no test output);3807 const G4int itest = 0;3808 3809 // G4double UMASS, ECOUL, reps1, reps2, rn1_pol;3810 G4double reps1, reps2, rn1_pol;3811 // Float_t HAZ,GAUSSHAZ;3812 G4int kkk = 0;3813 // G4int kkk = 10; // PK3814 3815 // I_MODE = 0;3816 3817 if(itest == 1) {3818 G4cout << " cn mass " << a << G4endl;3819 G4cout << " cn charge " << z << G4endl;3820 G4cout << " cn energy " << e << G4endl;3821 }3822 3823 // /* average Z of asymmetric and symmetric components: */3824 n = a - z; /* neutron number of the fissioning nucleus */3825 3826 k = 0;3827 icz = 0;3828 if ( (std::pow(z,2)/a < 25.0) || (n < nheavy2) || (e > 500.0) ) {3829 icz = -1;3830 // GOTO 1002;3831 goto milledeux;3832 }3833 3834 nlight1 = n - nheavy1;3835 nlight2 = n - nheavy2;3836 3837 // /* Polarisation assumed for standard I and standard II:3838 // Z - Zucd = cpol (for A = const);3839 // from this we get (see Armbruster)3840 // Z - Zucd = Acn/Ncn * cpol (for N = const) */3841 3842 zheavy1_shell = ((nheavy1/n) * z) - ((a/n) * cpol1);3843 zheavy2_shell = ((nheavy2/n) * z) - ((a/n) * cpol2);3844 3845 e_saddle_scission =3846 (-24.0 + 0.02227 * (std::pow(z,2))/(std::pow(a,0.33333)) ) * friction_factor;3847 3848 // /* Energy dissipated from saddle to scission */3849 // /* F. Rejmund et al., Nucl. Phys. A 678 (2000) 215, fig. 4 b */3850 // E_saddle_scission = DMAX1(0.,E_saddle_scission);3851 if (e_saddle_scission > 0.) {3852 e_saddle_scission = e_saddle_scission;3853 }3854 else {3855 e_saddle_scission = 0.;3856 }3857 // /* Semiempirical fission model: */3858 3859 // /* Fit to experimental result on curvature of potential at saddle */3860 // /* reference: */3861 // /* IF Z**2/A < 33.15E0 THEN3862 // MassCurv = 30.5438538E0 - 4.00212049E0 * Z**2/A3863 // + 0.11983384E0 * Z**4 / (A**2) ;3864 // ELSE3865 // MassCurv = 10.E0 ** (7.16993332E0 - 0.26602401E0 * Z**2/A3866 // + 0.00283802E0 * Z**4 / (A**2)) ; */3867 // /* New parametrization of T. Enqvist according to Mulgin et al. 1998 */3868 if ( (std::pow(z,2))/a < 34.0) {3869 masscurv = std::pow( 10.0,(-1.093364 + 0.082933 * (std::pow(z,2)/a)3870 - 0.0002602 * (std::pow(z,4)/std::pow(a,2))) );3871 } else {3872 masscurv = std::pow( 10.0,(3.053536 - 0.056477 * (std::pow(z,2)/a)3873 + 0.0002454 * (std::pow(z,4)/std::pow(a,2))) );3874 }3875 3876 cz_symm = (8.0/std::pow(z,2)) * masscurv;3877 3878 if(itest == 1) {3879 G4cout << "cz_symmetry= " << cz_symm << G4endl;3880 }3881 3882 if (cz_symm < 0) {3883 icz = -1;3884 // GOTO 1002;3885 goto milledeux;3886 }3887 3888 // /* proton number in symmetric fission (centre) */3889 zsymm = z/2.0;3890 nsymm = n/2.0;3891 asymm = nsymm + zsymm;3892 3893 zheavy1 = (cz_symm*zsymm + cz_asymm1_shell*zheavy1_shell)/(cz_symm + cz_asymm1_shell);3894 zheavy2 = (cz_symm*zsymm + cz_asymm2_shell*zheavy2_shell)/(cz_symm + cz_asymm2_shell);3895 // /* position of valley due to influence of liquid-drop potential */3896 nheavy1_eff = (zheavy1 + (a/n * cpol1))*(n/z);3897 nheavy2_eff = (zheavy2 + (a/n * cpol2))*(n/z);3898 nlight1_eff = n - nheavy1_eff;3899 nlight2_eff = n - nheavy2_eff;3900 // /* proton number of light fragments (centre) */3901 zlight1 = z - zheavy1;3902 // /* proton number of light fragments (centre) */3903 zlight2 = z - zheavy2;3904 aheavy1 = nheavy1_eff + zheavy1;3905 aheavy2 = nheavy2_eff + zheavy2;3906 aheavy1_mean = aheavy1;3907 aheavy2_mean = aheavy2;3908 alight1 = nlight1_eff + zlight1;3909 alight2 = nlight2_eff + zlight2;3910 3911 a_levdens = a / xlevdens;3912 a_levdens_heavy1 = aheavy1 / xlevdens;3913 a_levdens_heavy2 = aheavy2 / xlevdens;3914 a_levdens_light1 = alight1 / xlevdens;3915 a_levdens_light2 = alight2 / xlevdens;3916 gamma = a_levdens / (0.4 * (std::pow(a,1.3333)) );3917 gamma_heavy1 = ( a_levdens_heavy1 / (0.4 * (std::pow(aheavy1,1.3333)) ) ) * fgamma1;3918 gamma_heavy2 = a_levdens_heavy2 / (0.4 * (std::pow(aheavy2,1.3333)) );3919 3920 cz_asymm1_saddle = cz_asymm1_shell + cz_symm;3921 cz_asymm2_saddle = cz_asymm2_shell + cz_symm;3922 3923 // Up to here: Ok! Checked CS 10/10/053924 3925 cn = umass(zsymm,(nsymm+1.),0.0) + umass(zsymm,(nsymm-1.),0.0)3926 + 1.44 * (std::pow(zsymm,2))/3927 ( (std::pow(r_null,2)) *3928 ( std::pow((asymm+1.0),0.33333) + std::pow((asymm-1.0),0.33333) ) *3929 ( std::pow((asymm+1.0),0.33333) + std::pow((asymm-1.0),0.33333) ) )3930 - 2.0 * umass(zsymm,nsymm,0.0)3931 - 1.44 * (std::pow(zsymm,2))/3932 ( ( 2.0 * r_null * (std::pow(asymm,0.33333)) ) *3933 ( 2.0 * r_null * (std::pow(asymm,0.33333)) ) );3934 3935 // /* shell effect in valley of mode 1 */3936 delta_u1 = delta_u1_shell + (std::pow((zheavy1_shell-zheavy1),2))*cz_asymm1_shell;3937 // /* shell effect in valley of mode 2 */3938 delta_u2 = delta_u2_shell + (std::pow((zheavy2_shell-zheavy2),2))*cz_asymm2_shell;3939 3940 // /* liquid drop energies3941 // at the centres of the different shell effects3942 // with respect to liquid drop at symmetry: */3943 epot0_mode1_saddle = (std::pow((zheavy1-zsymm),2)) * cz_symm;3944 epot0_mode2_saddle = (std::pow((zheavy2-zsymm),2)) * cz_symm;3945 epot0_symm_saddle = 0.0;3946 3947 if (itest == 1) {3948 G4cout << "check zheavy1 = " << zheavy1 << G4endl;3949 G4cout << "check zheavy2 = " << zheavy2 << G4endl;3950 G4cout << "check zsymm = " << zsymm << G4endl;3951 G4cout << "check czsymm = " << cz_symm << G4endl;3952 G4cout << "check epot0_mode1_saddle = " << epot0_mode1_saddle << G4endl;3953 G4cout << "check epot0_mode2_saddle = " << epot0_mode2_saddle << G4endl;3954 G4cout << "check epot0_symm_saddle = " << epot0_symm_saddle << G4endl;3955 G4cout << "delta_u1 = " << delta_u1 << G4endl;3956 G4cout << "delta_u2 = " << delta_u2 << G4endl;3957 }3958 3959 // /* energies including shell effects3960 // at the centres of the different shell effects3961 // with respect to liquid drop at symmetry: */3962 epot_mode1_saddle = epot0_mode1_saddle + delta_u1;3963 epot_mode2_saddle = epot0_mode2_saddle + delta_u2;3964 epot_symm_saddle = epot0_symm_saddle;3965 if (itest == 1) {3966 G4cout << "check epot_mode1_saddle = " << epot_mode1_saddle << G4endl;3967 G4cout << "check epot_mode2_saddle = " << epot_mode2_saddle << G4endl;3968 G4cout << "check epot_symm_saddle = " << epot_symm_saddle << G4endl;3969 }3970 3971 // /* Minimum of potential with respect to ld potential at symmetry */3972 dueff = min(epot_mode1_saddle,epot_mode2_saddle);3973 dueff = min(dueff,epot_symm_saddle);3974 dueff = dueff - epot_symm_saddle;3975 3976 eld = e + dueff + e_zero_point;3977 3978 if (itest == 1) {3979 G4cout << "check dueff = " << dueff << G4endl;3980 G4cout << "check e = " << e << G4endl;3981 G4cout << "check e_zero_point = " << e_zero_point << G4endl;3982 G4cout << "check eld = " << eld << G4endl;3983 }3984 // Up to here: Ok! Checked CS 10/10/053985 3986 // /* E = energy above lowest effective barrier */3987 // /* Eld = energy above liquid-drop barrier */3988 3989 // /* Due to this treatment the energy E on input means the excitation */3990 // /* energy above the lowest saddle. */3991 3992 // /* These energies are not used */3993 eheavy1 = e * aheavy1 / a;3994 eheavy2 = e * aheavy2 / a;3995 elight1 = e * alight1 / a;3996 elight2 = e * alight2 / a;3997 3998 epsilon0_1_saddle = eld - e_zero_point - epot0_mode1_saddle;3999 // /* excitation energy at saddle mode 1 without shell effect */4000 epsilon0_2_saddle = eld - e_zero_point - epot0_mode2_saddle;4001 // /* excitation energy at saddle mode 2 without shell effect */4002 4003 epsilon_1_saddle = eld - e_zero_point - epot_mode1_saddle;4004 // /* excitation energy at saddle mode 1 with shell effect */4005 epsilon_2_saddle = eld - e_zero_point - epot_mode2_saddle;4006 // /* excitation energy at saddle mode 2 with shell effect */4007 epsilon_symm_saddle = eld - e_zero_point - epot_symm_saddle;4008 4009 // /* global parameters */4010 eexc1_saddle = epsilon_1_saddle;4011 eexc2_saddle = epsilon_2_saddle;4012 eexc_max = max(eexc1_saddle,eexc2_saddle);4013 eexc_max = max(eexc_max,eld);4014 4015 // /* EEXC_MAX is energy above the lowest saddle */4016 4017 4018 epsilon0_1_scission = eld + e_saddle_scission - epot0_mode1_saddle;4019 // /* excitation energy without shell effect */4020 epsilon0_2_scission = eld + e_saddle_scission - epot0_mode2_saddle;4021 // /* excitation energy without shell effect */4022 4023 epsilon_1_scission = eld + e_saddle_scission - epot_mode1_saddle;4024 // /* excitation energy at scission */4025 epsilon_2_scission = eld+ e_saddle_scission - epot_mode2_saddle;4026 // /* excitation energy at scission */4027 epsilon_symm_scission = eld + e_saddle_scission - epot_symm_saddle;4028 // /* excitation energy of symmetric fragment at scission */4029 4030 // /* Calculate widhts at the saddle: */4031 4032 e_eff1_saddle = epsilon0_1_saddle - delta_u1 * (std::exp((-epsilon_1_saddle*gamma)));4033 4034 if (e_eff1_saddle > 0.0) {4035 wzasymm1_saddle = std::sqrt( (0.5 *4036 (std::sqrt(1.0/a_levdens*e_eff1_saddle)) /4037 (cz_asymm1_shell * std::exp((-epsilon_1_saddle*gamma)) + cz_symm) ) );4038 }4039 else {4040 wzasymm1_saddle = 1.0;4041 }4042 4043 e_eff2_saddle = epsilon0_2_saddle - delta_u2 * (std::exp((-epsilon_2_saddle*gamma)));4044 if (e_eff2_saddle > 0.0) {4045 wzasymm2_saddle = std::sqrt( (0.5 *4046 (std::sqrt(1.0/a_levdens*e_eff2_saddle)) /4047 (cz_asymm2_shell * std::exp((-epsilon_2_saddle*gamma)) + cz_symm) ) );4048 }4049 else {4050 wzasymm2_saddle = 1.0;4051 }4052 4053 if (eld > e_zero_point) {4054 if ( (eld + epsilon_symm_saddle) < 0.0) {4055 G4cout << "<e> eld + epsilon_symm_saddle < 0" << G4endl;4056 }4057 wzsymm_saddle = std::sqrt( (0.5 *4058 (std::sqrt(1.0/a_levdens*(eld+epsilon_symm_saddle))) / cz_symm ) );4059 } else {4060 wzsymm_saddle = 1.0;4061 }4062 4063 if (itest == 1) {4064 G4cout << "wz1(saddle) = " << wzasymm1_saddle << G4endl;4065 G4cout << "wz2(saddle) = " << wzasymm2_saddle << G4endl;4066 G4cout << "wzsymm(saddle) = " << wzsymm_saddle << G4endl;4067 }4068 4069 // /* Calculate widhts at the scission point: */4070 // /* fits of ref. Beizin 1991 (Plots brought to GSI by Sergei Zhdanov) */4071 4072 wzsymm_scission = wzsymm_saddle;4073 4074 if (e_saddle_scission == 0.0) {4075 4076 wzasymm1_scission = wzasymm1_saddle;4077 wzasymm2_scission = wzasymm2_saddle;4078 4079 }4080 else {4081 4082 if (nheavy1_eff > 75.0) {4083 wzasymm1_scission = (std::sqrt(21.0)) * z/a;4084 wzasymm2_scission = (std::sqrt (max( (70.0-28.0)/3.0*(z*z/a-35.0)+28.,0.0 )) ) * z/a;4085 }4086 else {4087 wzasymm1_scission = wzasymm1_saddle;4088 wzasymm2_scission = wzasymm2_saddle;4089 }4090 4091 }4092 4093 wzasymm1_scission = max(wzasymm1_scission,wzasymm1_saddle);4094 wzasymm2_scission = max(wzasymm2_scission,wzasymm2_saddle);4095 4096 wzasymm1 = wzasymm1_scission * fwidth_asymm1;4097 wzasymm2 = wzasymm2_scission * fwidth_asymm2;4098 wzsymm = wzsymm_scission;4099 4100 /* if (ITEST == 1) {4101 G4cout << "WZ1(scission) = " << WZasymm1_scission << G4endl;4102 G4cout << "WZ2(scission) = " << WZasymm2_scission << G4endl;4103 G4cout << "WZsymm(scission) = " << WZsymm_scission << G4endl;4104 }4105 if (ITEST == 1) {4106 G4cout << "WZ1(scission) final= " << WZasymm1 << G4endl;4107 G4cout << "WZ2(scission) final= " << WZasymm2 << G4endl;4108 G4cout << "WZsymm(scission) final= " << WZsymm << G4endl;4109 } */4110 4111 wasymm = wzsymm * a/z;4112 waheavy1 = wzasymm1 * a/z;4113 waheavy2 = wzasymm2 * a/z;4114 4115 wasymm_saddle = wzsymm_saddle * a/z;4116 waheavy1_saddle = wzasymm1_saddle * a/z;4117 waheavy2_saddle = wzasymm2_saddle * a/z;4118 4119 if (itest == 1) {4120 G4cout << "wasymm = " << wzsymm << G4endl;4121 G4cout << "waheavy1 = " << waheavy1 << G4endl;4122 G4cout << "waheavy2 = " << waheavy2 << G4endl;4123 }4124 // Up to here: Ok! Checked CS 11/10/054125 4126 if ( (epsilon0_1_saddle - delta_u1*std::exp((-epsilon_1_saddle*gamma_heavy1))) < 0.0) {4127 sasymm1 = -10.0;4128 }4129 else {4130 sasymm1 = 2.0 * std::sqrt( a_levdens * (epsilon0_1_saddle -4131 delta_u1*(std::exp((-epsilon_1_saddle*gamma_heavy1))) ) );4132 }4133 4134 if ( (epsilon0_2_saddle - delta_u2*std::exp((-epsilon_2_saddle*gamma_heavy2))) < 0.0) {4135 sasymm2 = -10.0;4136 }4137 else {4138 sasymm2 = 2.0 * std::sqrt( a_levdens * (epsilon0_2_saddle -4139 delta_u2*(std::exp((-epsilon_2_saddle*gamma_heavy2))) ) );4140 }4141 4142 if (epsilon_symm_saddle > 0.0) {4143 ssymm = 2.0 * std::sqrt( a_levdens*(epsilon_symm_saddle) );4144 }4145 else {4146 ssymm = -10.0;4147 }4148 4149 if (ssymm > -10.0) {4150 ysymm = 1.0;4151 4152 if (epsilon0_1_saddle < 0.0) {4153 // /* low energy */4154 yasymm1 = std::exp((sasymm1-ssymm)) * wzasymm1_saddle / wzsymm_saddle * 2.0;4155 // /* factor of 2 for symmetry classes */4156 }4157 else {4158 // /* high energy */4159 ssymm_mode1 = 2.0 * std::sqrt( a_levdens*(epsilon0_1_saddle) );4160 yasymm1 = ( std::exp((sasymm1-ssymm)) - std::exp((ssymm_mode1 - ssymm)) )4161 * wzasymm1_saddle / wzsymm_saddle * 2.0;4162 }4163 4164 if (epsilon0_2_saddle < 0.0) {4165 // /* low energy */4166 yasymm2 = std::exp((sasymm2-ssymm)) * wzasymm2_saddle / wzsymm_saddle * 2.0;4167 // /* factor of 2 for symmetry classes */4168 }4169 else {4170 // /* high energy */4171 ssymm_mode2 = 2.0 * std::sqrt( a_levdens*(epsilon0_2_saddle) );4172 yasymm2 = ( std::exp((sasymm2-ssymm)) - std::exp((ssymm_mode2 - ssymm)) )4173 * wzasymm2_saddle / wzsymm_saddle * 2.0;4174 }4175 // /* difference in the exponent in order */4176 // /* to avoid numerical overflow */4177 4178 }4179 else {4180 if ( (sasymm1 > -10.0) && (sasymm2 > -10.0) ) {4181 ysymm = 0.0;4182 yasymm1 = std::exp(sasymm1) * wzasymm1_saddle * 2.0;4183 yasymm2 = std::exp(sasymm2) * wzasymm2_saddle * 2.0;4184 }4185 }4186 4187 // /* normalize */4188 ysum = ysymm + yasymm1 + yasymm2;4189 if (ysum > 0.0) {4190 ysymm = ysymm / ysum;4191 yasymm1 = yasymm1 / ysum;4192 yasymm2 = yasymm2 / ysum;4193 yasymm = yasymm1 + yasymm2;4194 }4195 else {4196 ysymm = 0.0;4197 yasymm1 = 0.0;4198 yasymm2 = 0.0;4199 // /* search minimum threshold and attribute all events to this mode */4200 if ( (epsilon_symm_saddle < epsilon_1_saddle) && (epsilon_symm_saddle < epsilon_2_saddle) ) {4201 ysymm = 1.0;4202 }4203 else {4204 if (epsilon_1_saddle < epsilon_2_saddle) {4205 yasymm1 = 1.0;4206 }4207 else {4208 yasymm2 = 1.0;4209 }4210 }4211 }4212 4213 if (itest == 1) {4214 G4cout << "ysymm normalized= " << ysymm << G4endl;4215 G4cout << "yasymm1 normalized= " << yasymm1 << G4endl;4216 G4cout << "yasymm2 normalized= " << yasymm2 << G4endl;4217 }4218 // Up to here: Ok! Ckecked CS 11/10/054219 4220 // /* even-odd effect */4221 // /* simple parametrization KHS, Nov. 2000. From Rejmund et al. */4222 if ((int)(z) % 2 == 0) {4223 r_e_o_exp = -0.017 * (e_saddle_scission + eld) * (e_saddle_scission + eld);4224 if ( r_e_o_exp < -307.0) {4225 r_e_o_exp = -307.0;4226 r_e_o = std::pow(10.0,r_e_o_exp);4227 }4228 else {4229 r_e_o = std::pow(10.0,r_e_o_exp);4230 }4231 }4232 else {4233 r_e_o = 0.0;4234 }4235 4236 // $LOOP; /* event loop */4237 // I_COUNT = I_COUNT + 1;4238 4239 // /* random decision: symmetric or asymmetric */4240 // /* IMODE = 1 means asymmetric fission, mode 1,4241 // IMODE = 2 means asymmetric fission, mode 2,4242 // IMODE = 3 means symmetric */4243 // RMODE = dble(HAZ(k));4244 // rmode = rnd.rndm();4245 rmode = haz(k);4246 // Cast for test CS 11/10/054247 // RMODE = 0.54;4248 // rmode = 0.54;4249 if (rmode < yasymm1) {4250 imode = 1;4251 }4252 if ( (rmode > yasymm1) && (rmode < (yasymm1+yasymm2)) ) {4253 imode = 2;4254 }4255 if ( (rmode > yasymm1) && (rmode > (yasymm1+yasymm2)) ) {4256 imode = 3;4257 }4258 4259 // /* determine parameters of the Z distribution */4260 // force imode (for testing, PK)4261 // imode = 3;4262 if (imode == 1) {4263 z1mean = zheavy1;4264 z1width = wzasymm1;4265 }4266 if (imode == 2) {4267 z1mean = zheavy2;4268 z1width = wzasymm2;4269 }4270 if (imode == 3) {4271 z1mean = zsymm;4272 z1width = wzsymm;4273 }4274 4275 if (itest == 1) {4276 G4cout << "nbre aleatoire tire " << rmode << G4endl;4277 G4cout << "fission mode " << imode << G4endl;4278 G4cout << "z1mean= " << z1mean << G4endl;4279 G4cout << "z1width= " << z1width << G4endl;4280 }4281 4282 // /* random decision: Z1 and Z2 at scission: */4283 z1 = 1.0;4284 z2 = 1.0;4285 while ( (z1<5.0) || (z2<5.0) ) {4286 // Z1 = dble(GAUSSHAZ(K,sngl(Z1mean),sngl(Z1width)));4287 // z1 = rnd.gaus(z1mean,z1width);4288 z1 = gausshaz(k, z1mean, z1width);4289 z2 = z - z1;4290 }4291 if (itest == 1) {4292 G4cout << "ff charge sample " << G4endl;4293 G4cout << "z1 = " << z1 << G4endl;4294 G4cout << "z2 = " << z2 << G4endl;4295 }4296 4297 // CALL EVEN_ODD(Z1,R_E_O,I_HELP);4298 // /* Integer proton number with even-odd effect */4299 // Z1 = REAL(I_HELP)4300 // /* Z1 = INT(Z1+0.5E0); */4301 z2 = z - z1;4302 4303 // /* average N of both fragments: */4304 if (imode == 1) {4305 n1mean = (z1 + cpol1 * a/n) * n/z;4306 }4307 if (imode == 2) {4308 n1mean = (z1 + cpol2 * a/n) * n/z;4309 }4310 /* CASE(99) ! only for testing;4311 N1UCD = Z1 * N/Z;4312 N2UCD = Z2 * N/Z;4313 re1 = UMASS(Z1,N1UCD,0.6) +;4314 & UMASS(Z2,N2UCD,0.6) +;4315 & ECOUL(Z1,N1UCD,0.6,Z2,N2UCD,0.6,d);4316 re2 = UMASS(Z1,N1UCD+1.,0.6) +;4317 & UMASS(Z2,N2UCD-1.,0.6) +;4318 & ECOUL(Z1,N1UCD+1.,0.6,Z2,N2UCD-1.,0.6,d);4319 re3 = UMASS(Z1,N1UCD+2.,0.6) +;4320 & UMASS(Z2,N2UCD-2.,0.6) +;4321 & ECOUL(Z1,N1UCD+2.,0.6,Z2,N2UCD-2.,0.6,d);4322 eps2 = (re1-2.0*re2+re3) / 2.0;4323 eps1 = re2 - re1 - eps2;4324 DN1_POL = - eps1 / (2.0 * eps2);4325 N1mean = N1UCD + DN1_POL; */4326 if (imode == 3) {4327 n1ucd = z1 * n/z;4328 n2ucd = z2 * n/z;4329 re1 = umass(z1,n1ucd,0.6) + umass(z2,n2ucd,0.6) + ecoul(z1,n1ucd,0.6,z2,n2ucd,0.6,d);4330 re2 = umass(z1,n1ucd+1.,0.6) + umass(z2,n2ucd-1.,0.6) + ecoul(z1,n1ucd+1.,0.6,z2,n2ucd-1.,0.6,d);4331 re3 = umass(z1,n1ucd+2.,0.6) + umass(z2,n2ucd-2.,0.6) + ecoul(z1,n1ucd+2.,0.6,z2,n2ucd-2.,0.6,d);4332 eps2 = (re1-2.0*re2+re3) / 2.0;4333 eps1 = re2 - re1 - eps2;4334 dn1_pol = - eps1 / (2.0 * eps2);4335 n1mean = n1ucd + dn1_pol;4336 }4337 // all fission modes features have been checked CS 11/10/054338 n2mean = n - n1mean;4339 z2mean = z - z1mean;4340 4341 // /* Excitation energies */4342 // /* formulated in energies in close consistency with the fission model */4343 4344 // /* E_defo = UMASS(Z*0.5E0,N*0.5E0,0.6E0) -4345 // UMASS(Z*0.5E0,N*0.5E0,0); */4346 // /* calculates the deformation energy of the liquid drop for4347 // deformation beta = 0.6 which is most probable at scission */4348 4349 // /* N1R and N2R provisionaly taken without fluctuations in4350 // polarisation: */4351 n1r = n1mean;4352 n2r = n2mean;4353 a1r = n1r + z1;4354 a2r = n2r + z2;4355 4356 if (imode == 1) { /* N = 82 */;4357 //! /* Eexc at scission */4358 e_scission = max(epsilon_1_scission,1.0);4359 if (n1mean > (n * 0.5) ) {4360 //! /* 1. fragment is spherical */4361 beta1 = 0.0;4362 beta2 = 0.6;4363 e1exc = epsilon_1_scission * a1r / a;4364 e_defo = umass(z2,n2r,beta2) - umass(z2,n2r,0.0);4365 e2exc = epsilon_1_scission * a2r / a + e_defo;4366 }4367 else {4368 //! /* 2. fragment is spherical */4369 beta1 = 0.6;4370 beta2 = 0.0;4371 e_defo = umass(z1,n1r,beta1) - umass(z1,n1r,0.0);4372 e1exc = epsilon_1_scission * a1r / a + e_defo;4373 e2exc = epsilon_1_scission * a2r / a;4374 }4375 }4376 4377 if (imode == 2) {4378 //! /* N appr. 86 */4379 e_scission = max(epsilon_2_scission,1.0);4380 if (n1mean > (n * 0.5) ) {4381 //! /* 2. fragment is spherical */4382 beta1 = (n1r - nheavy2) * 0.034 + 0.3;4383 e_defo = umass(z1,n1r,beta1) - umass(z1,n1r,0.0);4384 e1exc = epsilon_2_scission * a1r / a + e_defo;4385 beta2 = 0.6 - beta1;4386 e_defo = umass(z2,n2r,beta2) - umass(z2,n2r,0.0);4387 e2exc = epsilon_2_scission * a2r / a + e_defo;4388 }4389 else {4390 //! /* 1. fragment is spherical */4391 beta2 = (n2r - nheavy2) * 0.034 + 0.3;4392 e_defo = umass(z2,n2r,beta2) - umass(z2,n2r,0.0);4393 e2exc = epsilon_2_scission * a2r / a + e_defo;4394 beta1 = 0.6 - beta2;4395 e_defo = umass(z1,n1r,beta1) - umass(z1,n1r,0.0);4396 e1exc = epsilon_2_scission * a1r / a + e_defo;4397 }4398 }4399 4400 if (imode == 3) {4401 // ! /* Symmetric fission channel */4402 4403 // /* the fit function for beta is the deformation for4404 // optimum energy at the scission point, d = 2 */4405 // /* beta : deformation of symmetric fragments */4406 // /* beta1 : deformation of first fragment */4407 // /* beta2 : deformation of second fragment */4408 beta = 0.177963 + 0.0153241 * zsymm - 0.000162037 * zsymm*zsymm;4409 beta1 = 0.177963 + 0.0153241 * z1 - 0.000162037 * z1*z1;4410 // beta1 = 0.64411 e_defo1 = umass(z1,n1r,beta1) - umass(z1,n1r,0.0);4412 beta2 = 0.177963 + 0.0153241 * z2 - 0.000162037 * z2*z2;4413 // beta2 = 0.64414 e_defo2 = umass(z2,n2r,beta2) - umass(z2,n2r,0.0);4415 e_asym = umass(z1 , n1r, beta1) + umass(z2, n2r ,beta2)4416 + ecoul(z1,n1r,beta1,z2,n2r,beta2,2.0)4417 - 2.0 * umass(zsymm,nsymm,beta)4418 - ecoul(zsymm,nsymm,beta,zsymm,nsymm,beta,2.0);4419 // E_asym = CZ_symm * (Z1 - Zsymm)**24420 e_scission = max((epsilon_symm_scission - e_asym),1.0);4421 // /* $LIST(Z1,N1R,Z2,N2R,E_asym,E_scission); */4422 e1exc = e_scission * a1r / a + e_defo1;4423 e2exc = e_scission * a2r / a + e_defo2;4424 }4425 // Energies checked for all the modes CS 11/10/054426 4427 // /* random decision: N1R and N2R at scission, before evaporation: */4428 // /* CN = UMASS(Zsymm , Nsymm + 1.E0,0) +4429 // UMASS(Zsymm, Nsymm - 1.E0,0)4430 // + 1.44E0 * (Zsymm)**2 /4431 // (r_null**2 * ((Asymm+1)**1/3 + (Asymm-1)**1/3)**2 )4432 // - 2.E0 * UMASS(Zsymm,Nsymm,0)4433 // - 1.44E0 * (Zsymm)**2 / (r_null * 2.E0 * (Asymm)**1/3)**2; */4434 4435 4436 // /* N1width = std::sqrt(0.5E0 * std::sqrt(1.E0/A_levdens*(Eld+E_saddle_scission)) / CN); */4437 // /* 8. 9. 1998: KHS (see also consideration in the first comment block)4438 // sigma_N(Z=const) = A/Z * sigma_Z(A=const)4439 // sigma_Z(A=const) = 0.4 to 0.5 (from Lang paper Nucl Phys. A345 (1980) 34)4440 // sigma_N(Z=const) = 0.45 * A/Z (= 1.16 for 238U)4441 // therefore: SIGZMIN = 1.16 */4442 4443 if ( (imode == 1) || (imode == 2) ) {4444 cn=(umass(z1,n1mean+1.,beta1) + umass(z1,n1mean-1.,beta1)4445 + umass(z2,n2mean+1.,beta2) + umass(z2,n2mean-1.,beta2)4446 + ecoul(z1,n1mean+1.,beta1,z2,n2mean-1.,beta2,2.0)4447 + ecoul(z1,n1mean-1.,beta1,z2,n2mean+1.,beta2,2.0)4448 - 2.0 * ecoul(z1,n1mean,beta1,z2,n2mean,beta2,2.0)4449 - 2.0 * umass(z1, n1mean, beta1)4450 - 2.0 * umass(z2, n2mean, beta2) ) * 0.5;4451 // /* Coulomb energy neglected for the moment! */4452 // IF (E_scission.lt.0.) Then4453 // write(6,*)'<E> E_scission < 0, MODE 1,2'4454 // ENDIF4455 // IF (CN.lt.0.) Then4456 // write(6,*)'CN < 0, MODE 1,2'4457 // ENDIF4458 n1width=std::sqrt( (0.5 * (std::sqrt(1.0/a_levdens*(e_scission)))/cn) );4459 n1width=max(n1width, sigzmin);4460 4461 // /* random decision: N1R and N2R at scission, before evaporation: */4462 n1r = 1.0;4463 n2r = 1.0;4464 while ( (n1r<5.0) || (n2r<5.0) ) {4465 // n1r = dble(gausshaz(k,sngl(n1mean),sngl(n1width)));4466 // n1r = rnd.gaus(n1mean,n1width);4467 n1r = gausshaz(k, n1mean, n1width);4468 n2r = n - n1r;4469 }4470 // N1R = GAUSSHAZ(K,N1mean,N1width)4471 if (itest == 1) {4472 G4cout << "after neutron sample " << n1r << G4endl;4473 }4474 n1r = (float)( (int)((n1r+0.5)) );4475 n2r = n - n1r;4476 4477 even_odd(z1,r_e_o,i_help);4478 // /* proton number with even-odd effect */4479 z1 = (float)(i_help);4480 z2 = z - z1;4481 4482 a1r = z1 + n1r;4483 a2r = z2 + n2r;4484 }4485 4486 if (imode == 3) {4487 //! /* When(3) */4488 if (nzpol > 0.0) {4489 // /* We treat a simultaneous split in Z and N to determine polarisation */4490 cz = ( umass(z1-1., n1mean+1.,beta1)4491 + umass(z2+1., n2mean-1.,beta1)4492 + umass(z1+1., n1mean-1.,beta2)4493 + umass(z2 - 1., n2mean + 1.,beta2)4494 + ecoul(z1-1.,n1mean+1.,beta1,z2+1.,n2mean-1.,beta2,2.0)4495 + ecoul(z1+1.,n1mean-1.,beta1,z2-1.,n2mean+1.,beta2,2.0)4496 - 2.0 * ecoul(z1,n1mean,beta1,z2,n2mean,beta2,2.0)4497 - 2.0 * umass(z1, n1mean,beta1)4498 - 2.0 * umass(z2, n2mean,beta2) ) * 0.5;4499 // IF (E_scission.lt.0.) Then4500 // write(6,*) '<E> E_scission < 0, MODE 1,2'4501 // ENDIF4502 // IF (CZ.lt.0.) Then4503 // write(6,*) 'CZ < 0, MODE 1,2'4504 // ENDIF4505 za1width=std::sqrt( (0.5 * std::sqrt(1.0/a_levdens*(e_scission)) / cz) );4506 za1width=std::sqrt( (max((za1width*za1width-(1.0/12.0)),0.1)) );4507 // /* Check the value of 0.1 ! */4508 // /* Shephard correction */4509 a1r = z1 + n1mean;4510 a1r = (float)((int)((a1r+0.5)));4511 a2r = a - a1r;4512 // /* A1R and A2R are integer numbers now */4513 // /* $LIST(A1R,A2R,ZA1WIDTH); */4514 4515 n1ucd = n/a * a1r;4516 n2ucd = n/a * a2r;4517 z1ucd = z/a * a1r;4518 z2ucd = z/a * a2r;4519 4520 re1 = umass(z1ucd-1.,n1ucd+1.,beta1) + umass(z2ucd+1.,n2ucd-1.,beta2)4521 + ecoul(z1ucd-1.,n1ucd+1.,beta1,z2ucd+1.,n2ucd-1.,beta2,d);4522 re2 = umass(z1ucd,n1ucd,beta1) + umass(z2ucd,n2ucd,beta2)4523 + ecoul(z1ucd,n1ucd,beta1,z2ucd,n2ucd,beta2,d);4524 re3 = umass(z1ucd+1.,n1ucd-1.,beta1) + umass(z2ucd-1.,n2ucd+1.,beta2) +4525 + ecoul(z1ucd+1.,n1ucd-1.,beta1,z2ucd-1.,n2ucd+1.,beta2,d);4526 4527 eps2 = (re1-2.0*re2+re3) / 2.0;4528 eps1 = (re3 - re1)/2.0;4529 dn1_pol = - eps1 / (2.0 * eps2);4530 z1 = z1ucd + dn1_pol;4531 if (itest == 1) {4532 G4cout << "before proton sample " << z1 << G4endl;4533 }4534 // Z1 = dble(GAUSSHAZ(k,sngl(Z1),sngl(ZA1width)));4535 // z1 = rnd.gaus(z1,za1width);4536 z1 = gausshaz(k, z1, za1width);4537 if (itest == 1) {4538 G4cout << "after proton sample " << z1 << G4endl;4539 }4540 even_odd(z1,r_e_o,i_help);4541 // /* proton number with even-odd effect */4542 z1 = (float)(i_help);4543 z2 = (float)((int)( (z - z1 + 0.5)) );4544 4545 n1r = a1r - z1;4546 n2r = n - n1r;4547 }4548 else {4549 // /* First division of protons, then adjustment of neutrons */4550 cn = ( umass(z1, n1mean+1.,beta1) + umass(z1, n1mean-1., beta1)4551 + umass(z2, n2mean+1.,beta2) + umass(z2, n2mean-1., beta2)4552 + ecoul(z1,n1mean+1.,beta1,z2,n2mean-1.,beta2,2.0)4553 + ecoul(z1,n1mean-1.,beta1,z2,n2mean+1.,beta2,2.0)4554 - 2.0 * ecoul(z1,n1mean,beta1,z2,n2mean,beta2,2.0)4555 - 2.0 * umass(z1, n1mean, 0.6)4556 - 2.0 * umass(z2, n2mean, 0.6) ) * 0.5;4557 // /* Coulomb energy neglected for the moment! */4558 // IF (E_scission.lt.0.) Then4559 // write(6,*) '<E> E_scission < 0, MODE 1,2'4560 // Endif4561 // IF (CN.lt.0.) Then4562 // write(6,*) 'CN < 0, MODE 1,2'4563 // Endif4564 n1width=std::sqrt( (0.5 * std::sqrt(1.0/a_levdens*(e_scission)) / cn) );4565 n1width=max(n1width, sigzmin);4566 4567 // /* random decision: N1R and N2R at scission, before evaporation: */4568 // N1R = dble(GAUSSHAZ(k,sngl(N1mean),sngl(N1width)));4569 // n1r = rnd.gaus(n1mean,n1width);4570 n1r = gausshaz(k, n1mean, n1width);4571 n1r = (float)( (int)((n1r+0.5)) );4572 n2r = n - n1r;4573 4574 even_odd(z1,r_e_o,i_help);4575 // /* Integer proton number with even-odd effect */4576 z1 = (float)(i_help);4577 z2 = z - z1;4578 4579 a1r = z1 + n1r;4580 a2r = z2 + n2r;4581 4582 }4583 }4584 4585 if (itest == 1) {4586 G4cout << "remid imode = " << imode << G4endl;4587 G4cout << "n1width = " << n1width << G4endl;4588 G4cout << "n1r = " << n1r << G4endl;4589 G4cout << "a1r = " << a1r << G4endl;4590 G4cout << "n2r = " << n2r << G4endl;4591 G4cout << "a2r = " << a2r << G4endl;4592 }4593 // Up to here: checked CS 11/10/054594 4595 // /* Extracted from Lang et al. Nucl. Phys. A 345 (1980) 34 */4596 e1exc_sigma = 5.5;4597 e2exc_sigma = 5.5;4598 4599 neufcentquatrevingtsept:4600 // E1final = dble(Gausshaz(k,sngl(E1exc),sngl(E1exc_sigma)));4601 // E2final = dble(Gausshaz(k,sngl(E2exc),sngl(E2exc_sigma)));4602 // e1final = rnd.gaus(e1exc,e1exc_sigma);4603 // e2final = rnd.gaus(e2exc,e2exc_sigma);4604 e1final = gausshaz(k, e1exc, e1exc_sigma);4605 e2final = gausshaz(k, e2exc, e2exc_sigma);4606 if ( (e1final < 0.0) || (e2final < 0.0) ) goto neufcentquatrevingtsept;4607 if (itest == 1) {4608 G4cout << "sampled exc 1 " << e1final << G4endl;4609 G4cout << "sampled exc 2 " << e2final << G4endl;4610 }4611 4612 // /* OUTPUT QUANTITIES OF THE EVENT GENERATOR: */4613 4614 // /* Quantities before neutron evaporation */4615 4616 // /* Neutron number of prefragments: N1R and N2R */4617 // /* Atomic number of fragments: Z1 and Z2 */4618 // /* Kinetic energy of fragments: EkinR1, EkinR2 *74619 4620 // /* Quantities after neutron evaporation: */4621 4622 // /* Neutron number of fragments: N1 and N2 */4623 // /* Mass number of fragments: A1 and A2 */4624 // /* Atomic number of fragments: Z1 and Z2 */4625 // /* Number of evaporated neutrons: N1R-N1 and N2R-N2 */4626 // /* Kinetic energy of fragments: EkinR1*A1/A1R and4627 // EkinR2*A2/A2R */4628 4629 n1 = n1r;4630 n2 = n2r;4631 a1 = n1 + z1;4632 a2 = n2 + z2;4633 e1 = e1final;4634 e2 = e2final;4635 4636 // /* Pre-neutron-emission total kinetic energy: */4637 tker = (z1 * z2 * 1.44) /4638 ( r0 * std::pow(a1,0.33333) * (1.0 + 2.0/3.0 * beta1) +4639 r0 * std::pow(a2,0.33333) * (1.0 + 2.0/3.0 * beta2) + 2.0 );4640 // /* Pre-neutron-emission kinetic energy of 1. fragment: */4641 ekinr1 = tker * a2 / a;4642 // /* Pre-neutron-emission kinetic energy of 2. fragment: */4643 ekinr2 = tker * a1 / a;4644 4645 v1 = std::sqrt( (ekinr1/a1) ) * 1.3887;4646 v2 = std::sqrt( (ekinr2/a2) ) * 1.3887;4647 4648 if (itest == 1) {4649 G4cout << "ekinr1 " << ekinr1 << G4endl;4650 G4cout << "ekinr2 " << ekinr2 << G4endl;4651 }4652 4653 milledeux:4654 //**************************4655 //*** only symmetric fission4656 //**************************4657 // Symmetric fission: Ok! Checked CS 10/10/054658 if ( (icz == -1) || (a1 < 0.0) || (a2 < 0.0) ) {4659 // IF (z.eq.92) THEN4660 // write(6,*)'symmetric fission'4661 // write(6,*)'Z,A,E,A1,A2,icz,Atot',Z,A,E,A1,A2,icz,Atot4662 // END IF4663 4664 if (itest == 1) {4665 G4cout << "milledeux: liquid-drop option " << G4endl;4666 }4667 4668 n = a-z;4669 // proton number in symmetric fission (centre) *4670 zsymm = z / 2.0;4671 nsymm = n / 2.0;4672 asymm = nsymm + zsymm;4673 4674 a_levdens = a / xlevdens;4675 4676 masscurv = 2.0;4677 cz_symm = 8.0 / std::pow(z,2) * masscurv;4678 4679 wzsymm = std::sqrt( (0.5 * std::sqrt(1.0/a_levdens*e) / cz_symm) ) ;4680 4681 if (itest == 1) {4682 G4cout << " symmetric high energy fission " << G4endl;4683 G4cout << "wzsymm " << wzsymm << G4endl;4684 }4685 4686 z1mean = zsymm;4687 z1width = wzsymm;4688 4689 // random decision: Z1 and Z2 at scission: */4690 z1 = 1.0;4691 z2 = 1.0;4692 while ( (z1 < 5.0) || (z2 < 5.0) ) {4693 // z1 = dble(gausshaz(kkk,sngl(z1mean),sngl(z1width)));4694 // z1 = rnd.gaus(z1mean,z1width);4695 z1 = gausshaz(kkk, z1mean, z1width);4696 z2 = z - z1;4697 }4698 4699 if (itest == 1) {4700 G4cout << " z1 " << z1 << G4endl;4701 G4cout << " z2 " << z2 << G4endl;4702 }4703 if (itest == 1) {4704 G4cout << " zsymm " << zsymm << G4endl;4705 G4cout << " nsymm " << nsymm << G4endl;4706 G4cout << " asymm " << asymm << G4endl;4707 }4708 // CN = UMASS(Zsymm , Nsymm + 1.E0) + UMASS(Zsymm, Nsymm - 1.E0)4709 // # + 1.44E0 * (Zsymm)**2 /4710 // # (r_null**2 * ((Asymm+1)**(1./3.) +4711 // # (Asymm-1)**(1./3.))**2 )4712 // # - 2.E0 * UMASS(Zsymm,Nsymm)4713 // # - 1.44E0 * (Zsymm)**2 /4714 // # (r_null * 2.E0 * (Asymm)**(1./3.))**24715 4716 n1ucd = z1 * n/z;4717 n2ucd = z2 * n/z;4718 re1 = umass(z1,n1ucd,0.6) + umass(z2,n2ucd,0.6) +4719 ecoul(z1,n1ucd,0.6,z2,n2ucd,0.6,2.0);4720 re2 = umass(z1,n1ucd+1.,0.6) + umass(z2,n2ucd-1.,0.6) +4721 ecoul(z1,n1ucd+1.,0.6,z2,n2ucd-1.,0.6,2.0);4722 re3 = umass(z1,n1ucd+2.,0.6) + umass(z2,n2ucd-2.,0.6) +4723 ecoul(z1,n1ucd+2.,0.6,z2,n2ucd-2.,0.6,2.0);4724 reps2 = (re1-2.0*re2+re3)/2.0;4725 reps1 = re2 - re1 -reps2;4726 rn1_pol = -reps1/(2.0*reps2);4727 n1mean = n1ucd + rn1_pol;4728 n2mean = n - n1mean;4729 4730 if (itest == 1) {4731 G4cout << " n1mean " << n1mean << G4endl;4732 G4cout << " n2mean " << n2mean << G4endl;4733 }4734 4735 cn = (umass(z1,n1mean+1.,0.0) + umass(z1,n1mean-1.,0.0) +4736 + umass(z2,n2mean+1.,0.0) + umass(z2,n2mean-1.,0.0)4737 - 2.0 * umass(z1,n1mean,0.0) +4738 - 2.0 * umass(z2,n2mean,0.0) ) * 0.5;4739 // This is an approximation! Coulomb energy is neglected.4740 4741 n1width = std::sqrt( (0.5 * std::sqrt(1.0/a_levdens*e) / cn) );4742 4743 if (itest == 1) {4744 G4cout << " cn " << cn << G4endl;4745 G4cout << " n1width " << n1width << G4endl;4746 }4747 4748 // random decision: N1R and N2R at scission, before evaporation: */4749 // N1R = dfloat(NINT(GAUSSHAZ(KKK,sngl(N1mean),sngl(N1width))));4750 // n1r = (float)( (int)(rnd.gaus(n1mean,n1width)) );4751 n1r = (float)( (int)(gausshaz(k, n1mean,n1width)) );4752 n2r = n - n1r;4753 // Mass of first and second fragment */4754 a1 = z1 + n1r;4755 a2 = z2 + n2r;4756 4757 e1 = e*a1/(a1+a2);4758 e2 = e - e*a1/(a1+a2);4759 if (itest == 1) {4760 G4cout << " n1r " << n1r << G4endl;4761 G4cout << " n2r " << n2r << G4endl;4762 }4763 4764 }4765 4766 if (itest == 1) {4767 G4cout << " a1 " << a1 << G4endl;4768 G4cout << " z1 " << z1 << G4endl;4769 G4cout << " a2 " << a2 << G4endl;4770 G4cout << " z2 " << z2 << G4endl;4771 G4cout << " e1 " << e1 << G4endl;4772 G4cout << " e2 " << e << G4endl;4773 }4774 4775 // /* Pre-neutron-emission total kinetic energy: */4776 tker = (z1 * z2 * 1.44) /4777 ( r0 * std::pow(a1,0.33333) * (1.0 + 2.0/3.0 * beta1) +4778 r0 * std::pow(a2,0.33333) * (1.0 + 2.0/3.0 * beta2) + 2.0 );4779 // /* Pre-neutron-emission kinetic energy of 1. fragment: */4780 ekin1 = tker * a2 / a;4781 // /* Pre-neutron-emission kinetic energy of 2. fragment: */4782 ekin2 = tker * a1 / a;4783 4784 v1 = std::sqrt( (ekin1/a1) ) * 1.3887;4785 v2 = std::sqrt( (ekin2/a2) ) * 1.3887;4786 4787 if (itest == 1) {4788 G4cout << " kinetic energies " << G4endl;4789 G4cout << " ekin1 " << ekin1 << G4endl;4790 G4cout << " ekin2 " << ekin2 << G4endl;4791 }4792 3355 } 4793 3356 … … 4822 3385 4823 3386 // C Matrice de rotation dans le labo: 3387 G4double avv = 0.0, zvv = 0.0, enerj = 0.0, plab = 0.0, tetlab = 0.0, philab = 0.0; 3388 G4int itypcasc = 0; 4824 3389 G4double sitet = std::sqrt(std::pow(csrem[1],2)+std::pow(csrem[2],2)); 4825 G4double cstet , siphi, csphi;3390 G4double cstet = 0.0, siphi = 0.0, csphi = 0.0; 4826 3391 G4double R[4][4]; 4827 3392 for(G4int init_i = 0; init_i < 4; init_i++) { 3393 for(G4int init_j = 0; init_j < 4; init_j++) { 3394 R[init_i][init_j] = 0.0; 3395 } 3396 } 3397 if(verboseLevel > 1) 3398 G4cout <<"csrem = " << csrem[1] << ", " << csrem[2] << ", " << csrem[3] << ")" << G4endl; 4828 3399 if(sitet > 1.0e-6) { //then 4829 3400 cstet = csrem[3]; … … 4861 3432 G4double plabf[4]; 4862 3433 G4double bidon = 0.0; 4863 3434 for(G4int init_i = 0; init_i < 4; init_i++) { 3435 plabi[init_i] = 0.0; 3436 plabf[init_i] = 0.0; 3437 } 3438 ndec = 1; 4864 3439 for(G4int i = ndec; i <= volant->iv; i++) { //do i=ndec,iv 4865 3440 intp = i + nopart; 3441 if(volant->copied[i]) continue; // Avoid double copying 3442 #ifdef USE_LEGACY_CODE 4866 3443 varntp->ntrack = varntp->ntrack + 1; 3444 #endif 4867 3445 if(nint(volant->acv[i]) == 0 && nint(volant->zpcv[i]) == 0) { 4868 if(verboseLevel > 2) {4869 G4cout << "Error: Particles with A = 0 Z = 0 detected! " << G4endl;3446 if(verboseLevel > -1) { 3447 G4cout << __FILE__ << ":" << __LINE__ << " Error: Particles with A = 0 Z = 0 detected! " << G4endl; 4870 3448 } 4871 3449 continue; … … 4876 3454 } 4877 3455 } 3456 #ifdef USE_LEGACY_CODE 4878 3457 varntp->avv[intp] = nint(volant->acv[i]); 4879 3458 varntp->zvv[intp] = nint(volant->zpcv[i]); 4880 3459 varntp->itypcasc[intp] = 0; 3460 #else 3461 avv = nint(volant->acv[i]); 3462 zvv = nint(volant->zpcv[i]); 3463 itypcasc = 0; 3464 #endif 4881 3465 // transformation de lorentz remnan --> labo: 3466 #ifdef USE_LEGACY_CODE 4882 3467 if (varntp->avv[intp] == -1) { //then 3468 #else 3469 if(avv == -1) { 3470 #endif 4883 3471 masse = 138.00; // cugnon 4884 3472 // c if (avv(intp).eq.1) masse=938.2796 !cugnon … … 4887 3475 else { 4888 3476 mglms(double(volant->acv[i]),double(volant->zpcv[i]),0, &el); 4889 // assert(isnan(el) == false);4890 3477 masse = volant->zpcv[i]*938.27 + (volant->acv[i] - volant->zpcv[i])*939.56 + el; 4891 3478 } //end if 4892 3479 4893 3480 er = std::sqrt(std::pow(volant->pcv[i],2) + std::pow(masse,2)); 4894 // assert(isnan(er) == false);4895 3481 plabi[1] = volant->pcv[i]*(volant->xcv[i]); 4896 3482 plabi[2] = volant->pcv[i]*(volant->ycv[i]); … … 4898 3484 4899 3485 ptrav2 = std::pow(plabi[1],2) + std::pow(plabi[2],2) + std::pow(plabi[3],2); 4900 // assert(isnan(ptrav2) == false); 3486 #ifdef USE_LEGACY_CODE 4901 3487 varntp->plab[intp] = std::sqrt(ptrav2); 3488 #else 3489 plab = std::sqrt(ptrav2); 3490 #endif 3491 #ifdef USE_LEGACY_CODE 3492 if(std::abs(varntp->plab[intp] - 122.009) < 1.0e-3) { 3493 G4cout <<__FILE__ << ":" << __LINE__ << " Error: varntp->plab["<< intp <<"] = " << varntp->plab[intp] << G4endl; 3494 3495 volant->dump(); 3496 varntp->dump(); 3497 # 3498 G4cout <<"varntp->plab[intp] = " << varntp->plab[intp] << G4endl; 3499 G4cout <<"ndec (starting index for loop) = " << ndec << G4endl; 3500 G4cout <<"volant->iv (stopping index for loop) = " << volant->iv << G4endl; 3501 G4cout <<"i (current position) = " << i << G4endl; 3502 G4cout <<"intp (index for writing to varntp) = " << intp << G4endl; 3503 // exit(0); 3504 } 3505 #endif 3506 3507 #ifdef USE_LEGACY_CODE 4902 3508 varntp->enerj[intp] = std::sqrt(ptrav2 + std::pow(masse,2)) - masse; 4903 3509 #else 3510 enerj = std::sqrt(ptrav2 + std::pow(masse,2)) - masse; 3511 #endif 4904 3512 // Rotation dans le labo: 4905 3513 for(G4int j = 1; j <= 3; j++) { //do j=1,3 4906 3514 plabf[j] = 0.0; 4907 3515 for(G4int k = 1; k <= 3; k++) { //do k=1,3 4908 plabf[j] = plabf[j] + R[k][j]*plabi[k]; // :::Fixme::: (indices?) 3516 //plabf[j] = plabf[j] + R[k][j]*plabi[k]; // :::Fixme::: (indices?) 3517 plabf[j] = plabf[j] + R[j][k]*plabi[k]; // :::Fixme::: (indices?) 4909 3518 } // end do 4910 3519 } // end do 4911 3520 // C impulsions dans le nouveau systeme copiees dans /volant/ 3521 #ifdef USE_LEGACY_CODE 4912 3522 volant->pcv[i] = varntp->plab[intp]; 3523 #else 3524 volant->pcv[i] = plab; 3525 #endif 4913 3526 ptrav2 = std::sqrt(std::pow(plabf[1],2) + std::pow(plabf[2],2) + std::pow(plabf[3],2)); 4914 3527 if(ptrav2 >= 1.0e-6) { //then … … 4923 3536 } //endif 4924 3537 // impulsions dans le nouveau systeme copiees dans /VAR_NTP/ 3538 #ifdef USE_LEGACY_CODE 4925 3539 if(varntp->plab[intp] >= 1.0e-6) { //then 3540 #else 3541 if(plab >= 1.0e-6) { //then 3542 #endif 3543 #ifdef USE_LEGACY_CODE 4926 3544 bidon = plabf[3]/(varntp->plab[intp]); 4927 // assert(isnan(bidon) == false); 3545 #else 3546 bidon = plabf[3]/plab; 3547 #endif 4928 3548 if(bidon > 1.0) { 4929 3549 bidon = 1.0; … … 4932 3552 bidon = -1.0; 4933 3553 } 3554 #ifdef USE_LEGACY_CODE 4934 3555 varntp->tetlab[intp] = std::acos(bidon); 4935 3556 sitet = std::sin(varntp->tetlab[intp]); … … 4937 3558 varntp->tetlab[intp] = varntp->tetlab[intp]*57.2957795; 4938 3559 varntp->philab[intp] = varntp->philab[intp]*57.2957795; 3560 #else 3561 tetlab = std::acos(bidon); 3562 sitet = std::sin(tetlab); 3563 philab = std::atan2(plabf[2],plabf[1]); 3564 tetlab = tetlab*57.2957795; 3565 philab = philab*57.2957795; 3566 #endif 4939 3567 } 4940 3568 else { 3569 #ifdef USE_LEGACY_CODE 4941 3570 varntp->tetlab[intp] = 90.0; 4942 3571 varntp->philab[intp] = 0.0; 3572 #else 3573 tetlab = 90.0; 3574 philab = 0.0; 3575 #endif 4943 3576 } // endif 3577 volant->copied[i] = true; 3578 #ifndef USE_LEGACY_CODE 3579 varntp->addParticle(avv, zvv, enerj, plab, tetlab, philab); 3580 #else 3581 G4cout <<__FILE__ << ":" << __LINE__ << " volant -> varntp: " << " intp = " << intp << "Avv = " << varntp->avv[intp] << " Zvv = " << varntp->zvv[intp] << " Plab = " << varntp->plab[intp] << G4endl; 3582 G4cout <<__FILE__ << ":" << __LINE__ << " volant index i = " << i << " varnpt index intp = " << intp << G4endl; 3583 #endif 4944 3584 } // end do 4945 3585 } … … 4971 3611 G4double plabi[4]; 4972 3612 G4double plabf[4]; 3613 for(G4int init_i = 0; init_i < 4; init_i++) { 3614 plabi[init_i] = 0.0; 3615 plabf[init_i] = 0.0; 3616 } 3617 4973 3618 // C ----Transformation de Lorentz Noyau fissionnant --> Remnant: 4974 3619 plabi[1] = p1*sitet*std::cos(phi1); … … 4980 3625 plabf[j] = 0.0; 4981 3626 for(G4int k = 1; k <= 3; k++) { //do k=1,3 4982 //plabf[j] = plabf[j] + R[j][k]*plabi[k];4983 plabf[j] = plabf[j] + R[k][j]*plabi[k];3627 plabf[j] = plabf[j] + R[j][k]*plabi[k]; 3628 //plabf[j] = plabf[j] + R[k][j]*plabi[k]; 4984 3629 } //end do 4985 3630 } //end do … … 5029 3674 pout[i] = 0.0; 5030 3675 for(G4int j = 1; j <= 3; j++) { //do j=1,3 5031 //pout[i] = pout[i] + R[i][j]*pin[j];5032 pout[i] = pout[i] + R[j][i]*pin[j];3676 pout[i] = pout[i] + R[i][j]*pin[j]; 3677 //pout[i] = pout[i] + R[j][i]*pin[j]; 5033 3678 } // enddo 5034 3679 } //enddo … … 5043 3688 (*seed) = (*seed); // Avoid warning during compilation. 5044 3689 // Use Geant4 G4UniformRand 5045 (*rndm) = G4UniformRand();3690 (*rndm) = randomGenerator->getRandom(); 5046 3691 } 5047 3692 … … 5050 3695 const G4int pSize = 110; 5051 3696 static G4double p[pSize]; 5052 static G4long ix ,i;5053 static G4double x ,y,a,haz;3697 static G4long ix = 0, i = 0; 3698 static G4double x = 0.0, y = 0.0, a = 0.0, haz = 0.0; 5054 3699 // k =< -1 on initialise 5055 3700 // k = -1 c'est reproductible … … 5079 3724 // the behavior of the routines in C++ and FORTRAN versions is no 5080 3725 // longer exactly the same! 5081 standardRandom(&x, &ix); 3726 x = randomGenerator->getRandom(); 3727 // standardRandom(&x, &ix); 5082 3728 for(G4int i = 0; i < pSize; i++) { //do i=1,110 5083 standardRandom(&(p[i]), &ix); 5084 } 3729 p[i] = randomGenerator->getRandom(); 3730 // standardRandom(&(p[i]), &ix); 3731 } 3732 a = randomGenerator->getRandom(); 5085 3733 standardRandom(&a, &ix); 5086 3734 k = 0; … … 5089 3737 i = nint(100*a)+1; 5090 3738 haz = p[i]; 5091 standardRandom(&a, &ix); 3739 a = randomGenerator->getRandom(); 3740 // standardRandom(&a, &ix); 5092 3741 p[i] = a; 5093 3742 5094 3743 hazard->ial = ix; 5095 5096 3744 return haz; 5097 3745 } 5098 5099 5100 G4double G4Abla::gausshaz(int k, double xmoy, double sig)5101 {5102 // Gaussian random numbers:5103 5104 // 1005 C*** TIRAGE ALEATOIRE DANS UNE GAUSSIENNE DE LARGEUR SIG ET MOYENNE XMOY5105 static G4int iset = 0;5106 static G4double v1,v2,r,fac,gset,gausshaz;5107 5108 if(iset == 0) { //then5109 do {5110 v1 = 2.0*haz(k) - 1.0;5111 v2 = 2.0*haz(k) - 1.0;5112 r = std::pow(v1,2) + std::pow(v2,2);5113 } while(r >= 1);5114 5115 fac = std::sqrt(-2.*std::log(r)/r);5116 // assert(isnan(fac) == false);5117 gset = v1*fac;5118 gausshaz = v2*fac*sig+xmoy;5119 iset = 1;5120 }5121 else {5122 gausshaz=gset*sig+xmoy;5123 iset=0;5124 }5125 5126 return gausshaz;5127 }5128 5129 3746 5130 3747 // Utilities … … 5172 3789 G4int G4Abla::nint(G4double number) 5173 3790 { 5174 G4double intpart ;5175 G4double fractpart ;3791 G4double intpart = 0.0; 3792 G4double fractpart = 0.0; 5176 3793 fractpart = std::modf(number, &intpart); 5177 3794 if(number == 0) { -
trunk/source/processes/hadronic/models/incl/src/G4AblaEvaporation.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4AblaEvaporation.cc,v 1. 3 2007/10/11 08:20:08 gcosmoExp $26 // $Id: G4AblaEvaporation.cc,v 1.4 2008/10/24 21:07:40 dennis Exp $ 27 27 // 28 28 #include <numeric> … … 121 121 G4double nucleusA = theNucleus.GetA(); 122 122 G4double nucleusZ = theNucleus.GetZ(); 123 G4double nucleusMass = G4NucleiProperties::Get AtomicMass(nucleusA, nucleusZ);123 G4double nucleusMass = G4NucleiProperties::GetNuclearMass(nucleusA, nucleusZ); 124 124 G4double excitationEnergy = theNucleus.GetExcitationEnergy(); 125 125 G4double angularMomentum = 0.0; // Don't know how to get this quantity... From Geant4??? … … 147 147 } 148 148 149 // G4double mTar = G4NucleiProperties::Get AtomicMass(A, Z); // Mass of the target nucleus149 // G4double mTar = G4NucleiProperties::GetNuclearMass(A, Z); // Mass of the target nucleus 150 150 varntp->exini = exitationE; 151 151 -
trunk/source/processes/hadronic/models/incl/src/G4Incl.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Incl.cc,v 1. 14 2007/12/04 09:49:49 gcosmoExp $26 // $Id: G4Incl.cc,v 1.20 2008/11/06 10:11:27 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 33 33 #include "G4Incl.hh" 34 34 #include <iostream> 35 #include <assert.h>36 35 #include "Randomize.hh" 36 #include "G4InclRandomNumbers.hh" 37 #include "G4Ranecu.hh" 37 38 38 39 G4Incl::G4Incl() … … 47 48 derivGausFunction = 4; 48 49 densFunction = 5; 50 51 // randomGenerator = new G4InclGeant4Random(); 52 randomGenerator = new G4Ranecu(); 49 53 } 50 54 … … 52 56 { 53 57 verboseLevel = 0; 54 58 55 59 // Set functions to be used for integration routine. 56 60 wsaxFunction = 0; … … 66 70 saxw = aSaxw; 67 71 ws = aWs; 72 73 //randomGenerator = new G4Ranecu(); 74 randomGenerator = new G4InclGeant4Random(); 68 75 } 69 76 … … 87 94 varntp = aVarntp; 88 95 96 // randomGenerator = new G4InclGeant4Random(); 97 randomGenerator = new G4Ranecu(); 89 98 light_gaus_nuc = new G4LightGausNuc(); 90 99 light_nuc = new G4LightNuc(); … … 118 127 G4Incl::~G4Incl() 119 128 { 129 delete randomGenerator; 120 130 delete light_gaus_nuc; 121 131 delete light_nuc; … … 321 331 const G4double melec = 0.511; 322 332 323 G4double pcorem ;324 G4double pxrem ;325 G4double pyrem ;326 G4double pzrem ;333 G4double pcorem = 0.0; 334 G4double pxrem = 0.0; 335 G4double pyrem = 0.0; 336 G4double pzrem = 0.0; 327 337 328 338 G4double ap = 0.0, zp = 0.0, mprojo = 0.0, pbeam = 0.0; 329 339 340 varntp->clear(); 330 341 if(calincl->f[6] == 3.0) { // pi+ 331 342 mprojo = 139.56995; … … 392 403 G4int ibert = 1; 393 404 394 G4int nopart ;395 G4int izrem ;396 G4int iarem ;397 G4double esrem ;398 G4double erecrem ;399 G4double berem ;400 G4double garem ;401 G4double bimpac ;402 G4int jrem ;403 G4double alrem ;405 G4int nopart = 0; 406 G4int izrem = 0; 407 G4int iarem = 0; 408 G4double esrem = 0.0; 409 G4double erecrem = 0.0; 410 G4double berem = 0.0; 411 G4double garem = 0.0; 412 G4double bimpac = 0.0; 413 G4int jrem = 0; 414 G4double alrem = 0.0; 404 415 405 416 /** 406 417 * Coulomb barrier treatment. 407 418 */ 408 G4double probaTrans ;409 G4double rndm ;419 G4double probaTrans = 0.0; 420 G4double rndm = 0.0; 410 421 if((calincl->f[6] == 1.0) || (calincl->f[6] >= 6.0)) { 411 422 probaTrans = coulombTransm(calincl->f[2],ap,zp,calincl->f[0],calincl->f[1]); … … 656 667 const G4double melec = 0.511; 657 668 658 G4double pcorem ;659 G4double pxrem ;660 G4double pyrem ;661 G4double pzrem ;669 G4double pcorem = 0.0; 670 G4double pxrem = 0.0; 671 G4double pyrem = 0.0; 672 G4double pzrem = 0.0; 662 673 663 674 G4double ap = 0.0, zp = 0.0, mprojo = 0.0, pbeam = 0.0; 675 676 varntp->clear(); 664 677 665 678 // pi+ … … 737 750 G4int ibert = 1; 738 751 739 G4int nopart ;740 G4int izrem ;741 G4int iarem ;742 G4double esrem ;743 G4double erecrem ;744 G4double berem ;745 G4double garem ;746 G4double bimpac ;747 G4int jrem ;748 G4double alrem ;752 G4int nopart = 0; 753 G4int izrem = 0; 754 G4int iarem = 0; 755 G4double esrem = 0.0; 756 G4double erecrem = 0.0; 757 G4double berem = 0.0; 758 G4double garem = 0.0; 759 G4double bimpac = 0.0; 760 G4int jrem = 0; 761 G4double alrem = 0.0; 749 762 750 763 // Coulomb barrier 751 764 752 G4double probaTrans ;753 G4double rndm ;765 G4double probaTrans = 0.0; 766 G4double rndm = 0.0; 754 767 755 768 if((calincl->f[6] == 1.0) || (calincl->f[6] >= 6.0)) { … … 765 778 // Call the actual INCL routine: 766 779 pnu(&ibert, &nopart,&izrem,&iarem,&esrem,&erecrem,&alrem,&berem,&garem,&bimpac,&jrem); 767 780 // nopart=1; 781 // kind[0]=1; 782 // ep[0]=799.835; 783 // alpha[0]=0.08716; 784 // beta[0]=0.; 785 // gam[0]=0.99619; 786 // izrem=82; 787 // iarem=208; 788 // esrem=200.; 789 // erecrem=0.18870; 790 // alrem=-0.47101; 791 // berem=0.; 792 // garem=0.88213; 793 // bimpac=2.; 768 794 forceAbsor(&nopart, &iarem, &izrem, &esrem, &erecrem, &alrem, &berem, &garem, &jrem); 769 795 G4double aprf = double(iarem); // mass number of the prefragment … … 836 862 } 837 863 } 838 864 839 865 if(kind[j] == 3) { 840 866 varntp->avv[j] = -1; … … 938 964 pcorem = std::sqrt(erecrem*(erecrem + 2.0 * 938.2796 * iarem)); // cugnon 939 965 mcorem = 938.2796 * iarem; // cugnon 940 966 varntp->pcorem = pcorem; 967 varntp->mcorem = mcorem; 941 968 // Note: Il faut negliger l'energie d'excitation (ESREM) pour que le bilan 942 969 // d'impulsion soit correct a la sortie de la cascade.....et prendre la … … 945 972 pyrem = pcorem * berem; 946 973 pzrem = pcorem * garem; 947 974 varntp->pxrem = pxrem; 975 varntp->pyrem = pyrem; 976 varntp->pzrem = pzrem; 948 977 pxbil = pxbil + pxrem; 949 978 pybil = pybil + pyrem; … … 963 992 964 993 // on recopie le remnant dans le ntuple 965 // 994 // varntp->ntrack = varntp->ntrack + 1; 966 995 varntp->massini = iarem; 967 996 varntp->mzini = izrem; 968 997 varntp->exini = esrem; 969 998 999 if(verboseLevel > 2) { 1000 G4cout << __FILE__ << ":" << __LINE__ << "Dump varntp after cascade: " << G4endl; 1001 varntp->dump(); 1002 } 970 1003 // Evaporation/fission: 971 1004 evaporationResult->ntrack = 0; … … 973 1006 erecrem, pxrem, pyrem, pzrem, eventnumber); 974 1007 975 // assert(evaporationResult->ntrack > 0); 976 for(G4int evaporatedParticle = 1; evaporatedParticle < evaporationResult->ntrack; evaporatedParticle++) { 1008 if(verboseLevel > 2) { 1009 G4cout << __FILE__ << ":" << __LINE__ << "Dump evaporationResult after evaporation: " << G4endl; 1010 evaporationResult->dump(); 1011 } 1012 for(G4int evaporatedParticle = 0; evaporatedParticle < evaporationResult->ntrack; evaporatedParticle++) { 977 1013 if(evaporationResult->avv[evaporatedParticle] == 0 && evaporationResult->zvv[evaporatedParticle] == 0) { //Fix: Skip "empty" particles with A = 0 and Z = 0 978 continue;1014 // continue; 979 1015 } 980 1016 varntp->kfis = evaporationResult->kfis; … … 1009 1045 evaporationResult->ntrack = -1; 1010 1046 } 1047 if(verboseLevel > 2) { 1048 G4cout << __FILE__ << ":" << __LINE__ << "Dump varntp after combining: " << G4endl; 1049 varntp->dump(); 1050 } 1011 1051 } 1012 1052 … … 1025 1065 // input: should contain a seed (ial, odd and of 5 digits) to start the work. 1026 1066 1027 G4double xrand ;1028 G4double ialdep ;1029 G4int imat ;1030 G4int iamat , izmat;1067 G4double xrand = 0.0; 1068 G4double ialdep = 0.0; 1069 G4int imat = 0; 1070 G4int iamat = 0, izmat = 0; 1031 1071 1032 1072 // for the 19 secondary seeds of hazard: … … 1045 1085 if(initRandomSeed) { 1046 1086 ialdep=hazard->ial; 1047 for( int i = 0; i < IGRAINESIZE; i++) {1048 for( int j = 0; j < nbtirhaz[i]; j++) {1087 for(G4int i = 0; i < IGRAINESIZE; i++) { 1088 for(G4int j = 0; j < nbtirhaz[i]; j++) { 1049 1089 standardRandom(&xrand,&(hazard->ial)); 1050 1090 } … … 1095 1135 void G4Incl::initMaterial(G4int izmat, G4int iamat, G4int imat) 1096 1136 { 1097 G4double res_dws ;1098 G4double fnor ;1099 1100 G4double rcour , geom;1101 G4int nbr ;1102 1103 G4double step , f_r;1137 G4double res_dws = 0.0; 1138 G4double fnor = 0.0; 1139 1140 G4double rcour = 0.0, geom = 0.0; 1141 G4int nbr = 0; 1142 1143 G4double step = 0.0, f_r = 0.0; 1104 1144 1105 1145 // rms espace r, espace p, fermi momentum and energy for light gauss nuc. … … 1133 1173 } 1134 1174 1135 const G4double fmp = 938.2796; 1175 const G4double fmp = 938.2796; // From INCL data 1136 1176 1137 1177 // parametres moyens de densite de la cible (fermi 2 parametres) … … 1142 1182 } 1143 1183 else if(iamat >= 19) { 1144 ws->r0 = light_nuc->r[iamat ];1145 ws->adif = light_nuc->a[iamat ];1184 ws->r0 = light_nuc->r[iamat-1]; 1185 ws->adif = light_nuc->a[iamat-1]; 1146 1186 ws->rmaxws = ws->r0 + (ws->xfoisa)*(ws->adif); 1147 1187 } 1148 1188 else if(iamat >= 6) { 1149 ws->r0 = light_nuc->r[iamat ];1150 ws->adif = light_nuc->a[iamat ];1151 ws->rmaxws = 5.5 + 0.3*( iamat-6.)/12.;1189 ws->r0 = light_nuc->r[iamat-1]; 1190 ws->adif = light_nuc->a[iamat-1]; 1191 ws->rmaxws = 5.5 + 0.3*(double(iamat)-6.)/12.; 1152 1192 } 1153 1193 else if(iamat >= 2) { … … 1172 1212 if(iamat == 3 && izmat == 2) { 1173 1213 ws->r0 = light_gaus_nuc->rms1t[7]; // Orig: rms1t(8) 1174 light_gaus_nuc->pfln[7] = light_gaus_nuc->pf1t[7]*1.291; //!s qrt(5/3)=1.2911214 light_gaus_nuc->pfln[7] = light_gaus_nuc->pf1t[7]*1.291; //!std::sqrt(5/3)=1.291 1175 1215 light_gaus_nuc->tfln[7] = std::sqrt(std::pow(light_gaus_nuc->pfln[7],2) + fmp*fmp) - fmp; 1176 1216 light_gaus_nuc->vnuc[7] = light_gaus_nuc->tfln[7] + 3.86; … … 1181 1221 if(iamat == 4) { 1182 1222 ws->r0 = light_gaus_nuc->rms1t[8]; // Orig: rms1t(9) 1183 light_gaus_nuc->pfln[8] = light_gaus_nuc->pf1t[8]*1.291; // !s qrt(5/3)=1.2911223 light_gaus_nuc->pfln[8] = light_gaus_nuc->pf1t[8]*1.291; // !std::sqrt(5/3)=1.291 1184 1224 light_gaus_nuc->tfln[8] = std::sqrt(std::pow(light_gaus_nuc->pfln[8],2) + fmp*fmp) - fmp; 1185 1225 light_gaus_nuc->vnuc[8] = light_gaus_nuc->tfln[8] + 9.43; … … 1194 1234 1195 1235 // bmax for sigma geom and various projectiles (p,n,pion/d/t/he3/he4/) 1196 G4int j ;1236 G4int j = 0; 1197 1237 for(G4int i = 0; i < MATGEOSIZE; i++) { // Orig: do i=1,6 1198 1238 j = i; … … 1440 1480 G4double q[qsize]; 1441 1481 G4double f[qsize]; 1482 for(G4int init_i = 0; init_i < qsize; init_i++) { 1483 q[init_i] = 0.0; 1484 f[init_i] = 0.0; 1485 } 1486 1442 1487 G4double dq=0.01; 1443 1488 q[0]=0.0; … … 1480 1525 G4double G4Incl::integrate(G4double ami, G4double ama, G4double step, G4int functionChoice) 1481 1526 { 1482 G4double res ;1527 G4double res = 0.0; 1483 1528 G4double x1[5]; 1529 for(G4int init_i = 0; init_i < 5; init_i++) { 1530 x1[init_i] = 0.0; 1531 } 1484 1532 G4double ri = ami; 1485 1533 G4double ra = ama; 1486 G4int nb ;1534 G4int nb = 0; 1487 1535 G4double acont = 1.0; 1488 1536 G4double dr = step; … … 1538 1586 void G4Incl::spl2ab() 1539 1587 { 1540 G4int i , j, k;1588 G4int i = 0, j = 0, k = 0; 1541 1589 1542 1590 for(i=0; i <= spl2->n-3; i++) { … … 1561 1609 G4double G4Incl::splineab(G4double xv) 1562 1610 { 1563 G4double tz ;1611 G4double tz = xv-spl2->x[0]; 1564 1612 G4int j; 1565 1566 tz = xv-spl2->x[0];1567 1613 1568 1614 if(tz < 0) { … … 1619 1665 G4int l = (*l_p); 1620 1666 1621 G4double minus_b1, minus_b2, minus_b3; 1622 //alog 1623 G4double aml1; 1624 G4double aml2; 1625 G4double amlnew; 1626 G4double arg; 1627 G4double b1; 1628 G4double b2; 1629 G4double b3; 1630 G4double bb2; 1631 G4double be; 1667 G4double minus_b1 = 0.0, minus_b2 = 0.0, minus_b3 = 0.0; 1668 G4double aml1 = 0.0; 1669 G4double aml2 = 0.0; 1670 G4double amlnew = 0.0; 1671 G4double arg = 0.0; 1672 G4double b1 = 0.0; 1673 G4double b2 = 0.0; 1674 G4double b3 = 0.0; 1675 G4double bb2 = 0.0; 1676 G4double be = 0.0; 1632 1677 G4double bmass[2000]; 1633 G4double bmax2; 1634 G4double c1; 1635 G4double c2; 1636 G4double cb0; 1637 G4double cchi; 1638 G4double ccr; 1639 G4double cg; 1640 G4double cif; 1641 G4double cmultn; 1642 G4double cobe; 1643 G4double coeffb0; 1644 G4double comom; 1645 G4double cstet; 1646 G4double dis1; 1647 G4double dis2; 1648 G4double dis3; 1649 G4double dist; 1650 G4double eb0; 1651 G4double ecoreh5; 1652 G4double efer; 1653 G4double egs; 1654 G4double eh5; 1655 G4double eh6; 1656 G4double eij; 1657 G4double ekout; 1658 G4double elead; 1659 G4double energie_in; 1660 G4double ener_max; 1661 G4double eout; 1678 for(G4int init_i = 0; init_i < 2000; init_i++) { 1679 bmass[init_i] = 0.0; 1680 } 1681 G4double bmax2 = 0.0; 1682 G4double c1 = 0.0; 1683 G4double c2 = 0.0; 1684 G4double cb0 = 0.0; 1685 G4double cchi = 0.0; 1686 G4double ccr = 0.0; 1687 G4double cg = 0.0; 1688 G4double cif = 0.0; 1689 G4double cmultn = 0.0; 1690 G4double cobe = 0.0; 1691 G4double coeffb0 = 0.0; 1692 G4double comom = 0.0; 1693 G4double cstet = 0.0; 1694 G4double dis1 = 0.0; 1695 G4double dis2 = 0.0; 1696 G4double dis3 = 0.0; 1697 G4double dist = 0.0; 1698 G4double eb0 = 0.0; 1699 G4double ecoreh5 = 0.0; 1700 G4double efer = 0.0; 1701 G4double egs = 0.0; 1702 G4double eh5 = 0.0; 1703 G4double eh6 = 0.0; 1704 G4double eij = 0.0; 1705 G4double ekout = 0.0; 1706 G4double elead = 0.0; 1707 G4double energie_in = 0.0; 1708 G4double ener_max = 0.0; 1709 G4double eout = 0.0; 1662 1710 G4double eps_c[BL1SIZE]; 1663 G4double epsv; 1664 G4double erecg; 1665 G4double erem; 1666 G4double exi; 1667 G4double expob0; 1668 G4double factemp; 1669 G4double fffc; 1670 G4double fm; 1671 G4double g1; 1672 G4double g2; 1673 G4double ge; 1674 G4double geff; 1675 G4double gg; 1676 G4double gl1; 1677 G4double gl2; 1678 G4double gpsg; 1679 G4int i1; 1680 G4int i20; 1681 G4int ic33; 1682 G4int ich1; 1683 G4int ich2; 1684 G4int ich3; 1685 G4int ich4; 1686 G4int ichd; 1687 G4int ichpion; 1688 G4int idecf; 1689 G4int idep; 1690 G4int iej; 1691 G4int iejn; 1692 G4int iejp; 1693 G4int i_emax; 1694 G4int iflag; 1711 for(G4int init_i = 0; init_i < BL1SIZE; init_i++) { 1712 eps_c[init_i] = 0.0; 1713 } 1714 G4double epsv = 0.0; 1715 G4double erecg = 0.0; 1716 G4double erem = 0.0; 1717 G4double exi = 0.0; 1718 G4double expob0 = 0.0; 1719 G4double factemp = 0.0; 1720 G4double fffc = 0.0; 1721 G4double fm = 0.0; 1722 G4double g1 = 0.0; 1723 G4double g2 = 0.0; 1724 G4double ge = 0.0; 1725 G4double geff = 0.0; 1726 G4double gg = 0.0; 1727 G4double gl1 = 0.0; 1728 G4double gl2 = 0.0; 1729 G4double gpsg = 0.0; 1730 G4int i1 = 0; 1731 G4int i20 = 0; 1732 G4int ic33 = 0; 1733 G4int ich1 = 0; 1734 G4int ich2 = 0; 1735 G4int ich3 = 0; 1736 G4int ich4 = 0; 1737 G4int ichd = 0; 1738 G4int ichpion = 0; 1739 G4int idecf = 0; 1740 G4int idep = 0; 1741 G4int iej = 0; 1742 G4int iejn = 0; 1743 G4int iejp = 0; 1744 G4int i_emax = 0; 1745 G4int iflag = 0; 1695 1746 G4int iflag20 = 0; 1696 1747 G4int iflag40 = 0; 1697 1748 G4int iflag60 = 0; 1698 1749 G4int ilm = 0; 1699 G4int imin ;1750 G4int imin = 0; 1700 1751 G4int indic[3000]; 1701 G4int inrem; 1702 G4int ip; 1752 for(G4int init_i = 0; init_i < 3000; init_i++) { 1753 indic[init_i] = 0; 1754 } 1755 G4int inrem = 0; 1756 G4int ip = 0; 1703 1757 G4int ipi[2000]; 1704 G4int iqe; 1705 G4int irem; 1706 G4int irst_avatar; 1758 for(G4int init_i = 0; init_i < 2000; init_i++) { 1759 ipi[init_i] = 0; 1760 } 1761 G4int iqe = 0; 1762 G4int irem = 0; 1763 G4int irst_avatar = 0; 1707 1764 G4int isos = 0; 1708 G4int itch ;1709 G4int iteste ;1710 G4int itt ;1711 G4int ixr1 ;1712 G4int ixr2 ;1713 G4int ixr3 ;1765 G4int itch = 0; 1766 G4int iteste = 0; 1767 G4int itt = 0; 1768 G4int ixr1 = 0; 1769 G4int ixr2 = 0; 1770 G4int ixr3 = 0; 1714 1771 // G4int k; 1715 G4int kcol ;1716 G4int kd ;1772 G4int kcol = 0; 1773 G4int kd = 0; 1717 1774 // G4int klm = 0; 1718 1775 // G4int l1; 1719 1776 // G4int l2; 1720 G4int ldel ;1721 G4int lead ;1722 G4int led ;1723 G4int lnew ;1777 G4int ldel = 0; 1778 G4int lead = 0; 1779 G4int led = 0; 1780 G4int lnew = 0; 1724 1781 G4int lp = 0; 1725 G4int lp1 ;1726 G4double mcdd ;1782 G4int lp1 = 0; 1783 G4double mcdd = 0.0; 1727 1784 //G4double mg; 1728 G4int mg; 1729 G4double mpaul1; 1730 G4double mpaul2; 1731 G4double mrdd; 1732 G4double mrdn; 1733 G4double mrdp; 1734 G4double mrnd; 1735 G4double mrnn; 1736 G4double mrpd; 1737 G4int n20; 1738 G4int nbalttf; 1739 G4int nbquit; 1740 G4int nbtest; 1741 G4int nc[300]; 1742 G4int ncol; 1743 G4int ncol_2c; 1744 G4int next; 1745 G4int nmiss; 1746 G4int np; 1747 G4int npidir; 1748 G4int npion = 0; 1749 G4int npproj[300]; 1750 G4int npx; 1751 G4int nsum_col; 1752 G4double p1v; 1753 G4double p2v; 1754 G4double p3_c[BL1SIZE]; 1755 G4double p3v; 1756 G4double pfrem1; 1757 G4double pfrem2; 1758 G4double pfrem3; 1759 G4double pfreml; 1760 G4double pfreml2; 1761 G4double phi; 1762 G4double p_mod; 1763 G4double pot; 1764 G4double pout1; 1765 G4double pout2; 1766 G4double pout3; 1767 G4double pppp; 1768 G4double prem1; 1769 G4double prem2; 1770 G4double prem3; 1771 G4double psf; 1772 G4double pspr; 1773 G4double ptotl; 1774 G4double qdeut; 1775 G4double qqq; 1776 G4double r22; 1777 G4double rcm1; 1778 G4double rcm2; 1779 G4double rcm3; 1780 G4double rcorr; 1781 G4double rhopi; 1782 G4double rndm; 1783 G4double rr; 1784 G4double rrrr; 1785 G4double s; 1786 G4double s1t1; 1787 G4double s2t1; 1788 G4double s3t1; 1789 G4double schi; 1790 G4double sepa; 1791 G4double sif; 1792 G4double sitet; 1793 G4double sp1t1; 1794 G4double sp2t1; 1795 G4double sp3t1; 1796 G4double sq = 0.0; 1797 G4double sueps; 1798 G4double t[50]; 1799 G4double t0; 1800 G4double t1; 1801 G4double t2; 1802 G4double t3; 1803 G4double t33; 1804 G4double t4; 1805 G4double t5; 1806 G4double t6; 1807 G4double t7; 1808 G4double t8; 1809 G4double tau; 1810 G4double tbid; 1811 G4double tdel; 1812 G4double temfin; 1813 G4double tim; 1814 G4double timi; 1815 G4double tlabu; 1816 G4double tp; 1817 G4double tref; 1818 G4double tri; 1819 G4double tt31; 1820 G4double tt32; 1821 G4double tt33; 1822 G4double tt34; 1823 G4double tt35; 1824 G4double tt36; 1825 G4double tte; 1826 G4double u; 1827 G4double v; 1828 G4double var_ab; 1829 G4double x; 1830 G4double x1l1; 1831 G4double x1l2; 1785 G4int mg = 0; 1786 G4double mpaul1 = 0.0; 1787 G4double mpaul2 = 0.0; 1788 G4double mrdd = 0.0; 1789 G4double mrdn = 0.0; 1790 G4double mrdp = 0.0; 1791 G4double mrnd = 0.0; 1792 G4double mrnn = 0.0; 1793 G4double mrpd = 0.0; 1794 G4int n20 = 0; 1795 G4int nbalttf = 0; 1796 G4int nbquit = 0; 1797 G4int nbtest = 0; 1798 G4int nc[300]; 1799 G4int npproj[300]; 1800 for(G4int init_i = 0; init_i < 300; init_i++) { 1801 nc[init_i] = 0; 1802 npproj[init_i] = 0; 1803 } 1804 G4int ncol = 0; 1805 G4int ncol_2c = 0; 1806 G4int next = 0; 1807 G4int nmiss = 0; 1808 G4int np = 0; 1809 G4int npidir = 0; 1810 G4int npion = 0; 1811 G4int npx = 0; 1812 G4int nsum_col = 0; 1813 G4double p1v = 0.0; 1814 G4double p2v = 0.0; 1815 G4double p3v = 0.0; 1816 G4double pfrem1 = 0.0; 1817 G4double pfrem2 = 0.0; 1818 G4double pfrem3 = 0.0; 1819 G4double pfreml = 0.0; 1820 G4double pfreml2 = 0.0; 1821 G4double phi = 0.0; 1822 G4double p_mod = 0.0; 1823 G4double pot = 0.0; 1824 G4double pout1 = 0.0; 1825 G4double pout2 = 0.0; 1826 G4double pout3 = 0.0; 1827 G4double pppp = 0.0; 1828 G4double prem1 = 0.0; 1829 G4double prem2 = 0.0; 1830 G4double prem3 = 0.0; 1831 G4double psf = 0.0; 1832 G4double pspr = 0.0; 1833 G4double ptotl = 0.0; 1834 G4double qdeut = 0.0; 1835 G4double qqq = 0.0; 1836 G4double r22 = 0.0; 1837 G4double rcm1 = 0.0; 1838 G4double rcm2 = 0.0; 1839 G4double rcm3 = 0.0; 1840 G4double rcorr = 0.0; 1841 G4double rhopi = 0.0; 1842 G4double rndm = 0.0; 1843 G4double rr = 0.0; 1844 G4double rrrr = 0.0; 1845 G4double s = 0.0; 1846 G4double s1t1 = 0.0; 1847 G4double s2t1 = 0.0; 1848 G4double s3t1 = 0.0; 1849 G4double schi = 0.0; 1850 G4double sepa = 0.0; 1851 G4double sif = 0.0; 1852 G4double sitet = 0.0; 1853 G4double sp1t1 = 0.0; 1854 G4double sp2t1 = 0.0; 1855 G4double sp3t1 = 0.0; 1856 G4double sq = 0.0; 1857 G4double sueps = 0.0; 1858 G4double t[50]; 1859 for(G4int init_i = 0; init_i < 50; init_i++) { 1860 t[init_i] = 0.0; 1861 } 1862 G4double t0 = 0.0; 1863 G4double t1 = 0.0; 1864 G4double t2 = 0.0; 1865 G4double t3 = 0.0; 1866 G4double t33 = 0.0; 1867 G4double t4 = 0.0; 1868 G4double t5 = 0.0; 1869 G4double t6 = 0.0; 1870 G4double t7 = 0.0; 1871 G4double t8 = 0.0; 1872 G4double tau = 0.0; 1873 G4double tbid = 0.0; 1874 G4double tdel = 0.0; 1875 G4double temfin = 0.0; 1876 G4double tim = 0.0; 1877 G4double timi = 0.0; 1878 G4double tlabu = 0.0; 1879 G4double tp = 0.0; 1880 G4double tref = 0.0; 1881 G4double tri = 0.0; 1882 G4double tt31 = 0.0; 1883 G4double tt32 = 0.0; 1884 G4double tt33 = 0.0; 1885 G4double tt34 = 0.0; 1886 G4double tt35 = 0.0; 1887 G4double tt36 = 0.0; 1888 G4double tte = 0.0; 1889 G4double u = 0.0; 1890 G4double v = 0.0; 1891 G4double var_ab = 0.0; 1892 G4double x = 0.0; 1893 G4double x1l1 = 0.0; 1894 G4double x1l2 = 0.0; 1832 1895 G4double x1_target = 0.0; 1833 1896 G4double x2_target = 0.0; 1834 1897 G4double x3_target = 0.0; 1835 G4double x2cour; 1836 G4double x2l1; 1837 G4double x2l2; 1838 G4double x3l1; 1839 G4double x3l2; 1840 G4double xapres; 1841 G4double xavant; 1842 G4double xbl1; 1843 G4double xbl2; 1844 G4double xc; 1845 G4double xe; 1846 G4double xga; 1847 G4double xl1; 1848 G4double xl2; 1849 G4double xl3; 1850 G4double xlab; 1851 G4double xleng; 1852 G4double xlengm; 1853 G4double xmodp; 1854 G4double xpb; 1855 G4double xq; 1856 G4double xr1; 1857 G4double xr2; 1858 G4double xr3; 1859 G4double xr4; 1860 G4double xr5; 1861 G4double xr6; 1862 G4double xr7; 1863 G4double xr8; 1864 G4double xv; 1865 G4double xxx; 1866 G4double xy1; 1867 G4double xy2; 1868 G4double xy3; 1869 G4double xye; 1870 G4double y; 1871 G4double q1[BL1SIZE]; 1872 G4double q2[BL1SIZE]; 1873 G4double q3[BL1SIZE]; 1874 G4double q4[BL1SIZE]; 1898 G4double x2cour = 0.0; 1899 G4double x2l1 = 0.0; 1900 G4double x2l2 = 0.0; 1901 G4double x3l1 = 0.0; 1902 G4double x3l2 = 0.0; 1903 G4double xapres = 0.0; 1904 G4double xavant = 0.0; 1905 G4double xbl1 = 0.0; 1906 G4double xbl2 = 0.0; 1907 G4double xc = 0.0; 1908 G4double xe = 0.0; 1909 G4double xga = 0.0; 1910 G4double xl1 = 0.0; 1911 G4double xl2 = 0.0; 1912 G4double xl3 = 0.0; 1913 G4double xlab = 0.0; 1914 G4double xleng = 0.0; 1915 G4double xlengm = 0.0; 1916 G4double xmodp = 0.0; 1917 G4double xpb = 0.0; 1918 G4double xq = 0.0; 1919 G4double xr1 = 0.0; 1920 G4double xr2 = 0.0; 1921 G4double xr3 = 0.0; 1922 G4double xr4 = 0.0; 1923 G4double xr5 = 0.0; 1924 G4double xr6 = 0.0; 1925 G4double xr7 = 0.0; 1926 G4double xr8 = 0.0; 1927 G4double xv = 0.0; 1928 G4double xxx = 0.0; 1929 G4double xy1 = 0.0; 1930 G4double xy2 = 0.0; 1931 G4double xy3 = 0.0; 1932 G4double xye = 0.0; 1933 G4double y = 0.0; 1934 G4double p3_c[BL1SIZE]; 1935 G4double q1[BL1SIZE]; 1936 G4double q2[BL1SIZE]; 1937 G4double q3[BL1SIZE]; 1938 G4double q4[BL1SIZE]; 1939 G4double ym[BL1SIZE]; 1940 for(G4int init_i = 0; init_i < BL1SIZE; init_i++) { 1941 q1[init_i] = 0.0; 1942 q2[init_i] = 0.0; 1943 q3[init_i] = 0.0; 1944 q4[init_i] = 0.0; 1945 ym[init_i] = 0.0; 1946 } 1875 1947 G4double y1[BL3SIZE]; 1876 G4double y2[BL3SIZE]; 1877 G4double y3[BL3SIZE]; 1878 // G4double ym[2000]; 1879 G4double ym[BL1SIZE]; 1880 G4double z; 1881 G4double za_i; 1882 G4double zai2; 1883 G4double zshif; 1948 G4double y2[BL3SIZE]; 1949 G4double y3[BL3SIZE]; 1950 for(G4int init_i = 0; init_i < BL1SIZE; init_i++) { 1951 y1[init_i] = 0.0; 1952 y2[init_i] = 0.0; 1953 y3[init_i] = 0.0; 1954 } 1955 G4double z = 0.0; 1956 G4double za_i = 0.0; 1957 G4double zai2 = 0.0; 1958 G4double zshif = 0.0; 1884 1959 G4double ztouch = 0.0; 1885 G4double ztu ;1960 G4double ztu = 0.0; 1886 1961 1887 1962 // LIEGE INC-model as a subroutine … … 2209 2284 // end for logging 2210 2285 2211 // G4int jparticip[300];2212 2286 G4int jparticip[BL1SIZE]; 2287 for(G4int i = 0; i < BL1SIZE; i++) { 2288 jparticip[i] = 0; 2289 } 2290 2213 2291 G4double beproj = 0.; 2214 bl3->ia2 = G4int( calincl->f[0]); // f(1)->f[0] and so on..., calincl added2215 G4int iz2 = G4int( calincl->f[1]);2292 bl3->ia2 = G4int(std::floor(calincl->f[0] + 0.1)); // f(1)->f[0] and so on..., calincl added 2293 G4int iz2 = G4int(std::floor(calincl->f[1] + 0.1)); 2216 2294 G4double r02 = 1.12; 2217 2295 kindstruct->kindf7 = int(std::floor(calincl->f[6] + 0.1)); … … 2263 2341 2264 2342 // parametres moyens de densite de la cible (fermi 2 parametres) 2265 if (bl3->ia2 > 28) { //then2343 if (bl3->ia2 >= 28) { //then 2266 2344 ws->r0 = (2.745e-4*bl3->ia2+1.063)*std::pow(G4double(bl3->ia2),0.33333333); 2267 2345 ws->adif = 1.63e-4*bl3->ia2 + 0.510; 2268 2346 ws->rmaxws = ws->r0 + ws->xfoisa*(ws->adif); 2269 2347 } 2270 else if(bl3->ia2 >= 0.19) { //then2271 ws->r0 = light_nuc->r[bl3->ia2 ];2272 ws->adif = light_nuc->a[bl3->ia2 ];2348 else if(bl3->ia2 >= 19) { //then 2349 ws->r0 = light_nuc->r[bl3->ia2-1]; 2350 ws->adif = light_nuc->a[bl3->ia2-1]; 2273 2351 ws->rmaxws = ws->r0 + ws->xfoisa*(ws->adif); 2274 2352 } 2275 2353 else if(bl3->ia2>=6) { //then 2276 ws->r0 = 1.581*(light_nuc->a[bl3->ia2 ]) * (2.0 + 5.0 * (light_nuc->r[bl3->ia2])/(2.0 + 3.0*(light_nuc->r[bl3->ia2])));2277 ws->adif = light_nuc->a[bl3->ia2 ];2278 ws->rmaxws = 5.5 + 0.3*( bl3->ia2- 6.0)/12.0;2354 ws->r0 = 1.581*(light_nuc->a[bl3->ia2-1]) * (2.0 + 5.0 * (light_nuc->r[bl3->ia2-1]))/(2.0 + 3.0*(light_nuc->r[bl3->ia2-1])); 2355 ws->adif = light_nuc->a[bl3->ia2-1]; 2356 ws->rmaxws = 5.5 + 0.3*(double(bl3->ia2) - 6.0)/12.0; 2279 2357 } 2280 2358 else if(bl3->ia2 >= 2) { // then … … 2321 2399 2322 2400 G4double tnr = tlab; 2323 assert((tnr*tnr + 2.0*tlab*fmpinc) >= 0);2324 assert((tnr+fmpinc) != 0);2325 2401 G4double binc = std::sqrt(tnr*tnr + 2.0*tlab*fmpinc)/(tnr+fmpinc); 2326 assert((1.0 - binc*binc) > 0);2327 2402 G4double ginc=1.0/std::sqrt(1.0 - binc*binc); 2328 2403 G4double pinc = fmpinc*binc*ginc; 2329 2330 // for(G4int i = 0; i < ia; i++) {2331 // jparticip[i]=0;2332 // }2333 for(G4int i = 0; i < 300; i++) {2334 jparticip[i] = 0;2335 }2336 2404 2337 2405 for(G4int bli = 0; bli < BL1SIZE; bli++) { … … 2424 2492 else { 2425 2493 // deutons 2426 tlabu = tlab/ bl3->ia1;2494 tlabu = tlab/double(bl3->ia1); 2427 2495 if (tlabu <= 400) { 2428 2496 coeffb0 = -0.0035*tlabu + 6.86; … … 2555 2623 standardRandom(&u, &(hazard->igraine[10])); 2556 2624 cstet = u*2 - 1; 2557 assert((1.0 - std::pow(cstet,2)) >= 0);2558 2625 sitet = std::sqrt(1.0 - std::pow(cstet,2)); 2559 2626 standardRandom(&v, &(hazard->igraine[11])); … … 2575 2642 2576 2643 bl1->eps[i] = w(bl1->p1[i],bl1->p2[i],bl1->p3[i],fmp); 2577 // assert(isnan(bl1->eps[i]) == false);2578 // assert(isnan(energyTest(i)) == false);2579 2644 2580 2645 sp1t1 = sp1t1 + bl1->p1[i]; … … 2594 2659 bl1->p3[bl3->ia1] = -sp3t1; 2595 2660 bl1->eps[bl3->ia1] = w(bl1->p1[bl3->ia1],bl1->p2[bl3->ia1],bl1->p3[bl3->ia1],fmp); 2596 // assert(isnan(bl1->eps[bl3->ia1]) == false);2597 // assert(isnan(energyTest(bl3->ia1)) == false);2598 2661 2599 2662 // deutons … … 2631 2694 t[5] = 6.283185*t[5]; // t(6) -> t[5] 2632 2695 t1 = t[1]; // t(2)->t[1] 2633 assert((1.0 - t1*t1) >= 0);2634 2696 t2 = std::sqrt(1.0 - t1*t1); 2635 2697 t3 = std::cos(t[2]); //t(3)->t[2] 2636 2698 t4 = std::sin(t[2]); //t(3)->t[2] 2637 2699 t5 = t[4]; // t(5)->t[4] 2638 assert((1.0 - t5*t5) >= 0);2639 2700 t6 = std::sqrt(1.0 - t5*t5); 2640 2701 t7 = std::cos(t[5]); //t(6) -> t[5] … … 2667 2728 bl1->ind1[i] = 0; 2668 2729 bl1->eps[i] = w(bl1->p1[i],bl1->p2[i],bl1->p3[i],fmp); 2669 // assert(isnan(bl1->eps[i]) == false);2670 // assert(isnan(energyTest(i)) == false);2671 2730 bl9->hel[i] = 0.0; 2672 2731 efer = efer + bl1->eps[i] - fmp; … … 2680 2739 bl3->x2[ia] = -s2t1; 2681 2740 bl3->x3[ia] = -s3t1; 2682 // assert(isnan(bl3->x3[ia]) == false);2683 2741 bl1->p1[ia] = -sp1t1; 2684 2742 bl1->p2[ia] = -sp2t1; 2685 2743 bl1->p3[ia] = -sp3t1; 2686 2744 2687 assert((std::pow(bl1->p1[ia],2) + std::pow(bl1->p2[ia],2) + std::pow(bl1->p3[ia],2)) >= 0);2688 2745 p_mod = std::sqrt(std::pow(bl1->p1[ia],2) + std::pow(bl1->p2[ia],2) + std::pow(bl1->p3[ia],2)); 2689 2746 if(p_mod > ((bl10->pf)+0.05)) { … … 2692 2749 2693 2750 bl1->eps[ia] = w(bl1->p1[ia],bl1->p2[ia],bl1->p3[ia],fmp); 2694 // assert(isnan(energyTest(ia)) == false);2695 2751 2696 2752 efer = efer + bl1->eps[ia]-fmp; … … 2720 2776 t[5] = 6.283185*t[5]; //t(6)->t[5] 2721 2777 t1 = t[1]; // t(2)->t[1] 2722 assert((1.0 - t1*t1) >= 0);2723 2778 t2 = std::sqrt(1.0 - t1*t1); 2724 2779 t3 = std::cos(t[2]); //t(3)->t[2] 2725 2780 t4 = std::sin(t[2]); //t(3)->t[2] 2726 2781 t5 = t[4]; //t(5)->t[4] 2727 assert((1.0 - t5*t5) >= 0);2728 2782 t6 = std::sqrt(1.0 - t5*t5); 2729 2783 t7 = std::cos(t[5]); //t(6)->t[5] … … 2753 2807 bl1->ind1[i] = 0; 2754 2808 bl1->eps[i] = w(bl1->p1[i],bl1->p2[i],bl1->p3[i],fmp); 2755 // assert(isnan(energyTest(i)) == false);2756 2809 2757 2810 bl9->hel[i] = 0.0; 2758 2811 efer = efer + bl1->eps[i] - fmp; 2759 2812 } 2760 x1_target = x1_target/ bl3->ia2;2761 x2_target = x2_target/ bl3->ia2;2762 x3_target = x3_target/ bl3->ia2;2813 x1_target = x1_target/double(bl3->ia2); 2814 x2_target = x2_target/double(bl3->ia2); 2815 x3_target = x3_target/double(bl3->ia2); 2763 2816 } 2764 2817 … … 2773 2826 } 2774 2827 2775 assert(z >= 0);2776 2828 z = std::sqrt(z); 2777 2829 // random azimuthal direction of the impact parameter (sept 99) … … 2810 2862 for(G4int i = 1; i <= bl3->ia1; i++) { 2811 2863 // for(G4int i = 1; i < bl3->ia1; i++) { 2812 // assert(isnan(ginc) == false);2813 assert(ginc != 0);2814 2864 bl3->x3[i] = bl3->x3[i]/ginc; 2815 // assert(isnan(bl3->x3[i]) == false);2816 2865 zai2 = ws->rmaxws*(ws->rmaxws) - std::pow((b+bl3->x1[i]),2) - std::pow(bl3->x2[i],2); 2817 2866 if (zai2 < 0.0) { … … 2828 2877 ilm = i; 2829 2878 xlengm = xleng; 2830 // assert(isnan(ztu) == false);2831 2879 ztouch = ztu; 2832 2880 // goto pnu21; … … 2876 2924 b1 = (binc - be)/(1.0 - be*binc); 2877 2925 b2 = -be; 2878 assert((1.0 - b1*b1) > 0);2879 2926 g1 = 1.0/std::sqrt(1.0 - b1*b1); 2880 2927 g2 = 1.0; … … 2883 2930 if (kindstruct->kindf7 <= 2) { 2884 2931 bl1->eps[1] = g1*fmp + v0; 2885 assert((std::pow(bl1->eps[1],2) - std::pow(fmp,2)) >= 0);2886 2932 bl1->p3[1] = std::sqrt(std::pow(bl1->eps[1],2) - std::pow(fmp,2)); 2887 // assert(isnan(energyTest(1)) == false);2888 2933 } 2889 2934 else { … … 2900 2945 if((energie_in) <= (bl3->ia1*fmp)) { 2901 2946 for(G4int i = 1; i <= bl3->ia1; i++) { 2902 bl1->eps[i] = energie_in/ bl3->ia1;2947 bl1->eps[i] = energie_in/double(bl3->ia1); 2903 2948 bl1->p1[i] = 0.0; 2904 2949 bl1->p2[i] = 0.0; 2905 bl1->p3[i] = pinc/bl3->ia1; 2906 // assert(isnan(energyTest(i)) == false); 2950 bl1->p3[i] = pinc/double(bl3->ia1); 2907 2951 } 2908 2952 goto pnu1871; … … 2928 2972 bl1->eps[i] = g1*(eps_c[i] + b1*p3_c[i]); 2929 2973 bl1->p3[i] = g1*(b1*tte + p3_c[i]); 2930 // assert(isnan(energyTest(i)) == false);2931 2974 sueps = sueps + bl1->eps[i]; 2932 2975 } //enddo 2933 2976 2934 assert(sueps != 0);2935 2977 cobe = (tlab + fmpinc)/sueps; 2936 2978 … … 2947 2989 } 2948 2990 for(G4int i = 1; i <= bl3->ia1; i++) { //do i=1,bl3->ia1 2949 // assert(isnan(energyTest(i)) == false);2950 2991 arg = std::pow((cobe*(bl1->eps[i])),2)-pm2; 2951 2992 if (arg <= 0.) { //then ! put maximum momentum to 0. … … 2998 3039 for(G4int i = 1; i <= bl3->ia1; i++) { //do i=1,bl3->ia1 2999 3040 // for(G4int i = 1; i < bl3->ia1; i++) { //do i=1,bl3->ia1 3000 // assert(isnan(energyTest(i)) == false);3001 3041 arg = std::pow((cobe*(bl1->eps[i])),2) - pm2; 3002 3042 comom = std::sqrt(arg/(std::pow(bl1->eps[i],2) - pm2)); 3003 // assert(isnan(comom) == false);3004 3043 bl1->p1[i] = comom*(bl1->p1[i]); 3005 3044 bl1->p2[i] = comom*(bl1->p2[i]); 3006 3045 bl1->p3[i] = comom*(bl1->p3[i]); 3007 3046 bl1->eps[i] = bl1->eps[i]*cobe; 3008 // assert(isnan(energyTest(i)) == false);3009 3047 if (std::fabs(am(bl1->p1[i],bl1->p2[i],bl1->p3[i],bl1->eps[i])-fmp) > 0.01) { 3010 3048 if(verboseLevel > 2) { … … 3029 3067 // bl2->k = bl2->k + 1; 3030 3068 // tref=ref(x1(i),x2(i),x3(i),p1(i),p2(i),p3(i),eps(i),r22) p-n04740 3031 // assert(isnan(energyTest(i)) == false);3032 3069 tref = ref(bl3->x1[i], bl3->x2[i], bl3->x3[i], bl1->p1[i], bl1->p2[i], bl1->p3[i], bl1->eps[i], r22); 3033 // assert(isnan(tref) == false);3034 3070 if (tref > bl4->tmax5) { 3035 3071 goto pnu45; … … 3037 3073 3038 3074 bl2->k = bl2->k + 1; 3039 assert((bl2->k >= 0) && (bl2->k < BL2INDSIZE));3040 3075 bl2->crois[bl2->k]=tref; 3041 3076 bl2->ind[bl2->k]=i; … … 3061 3096 } 3062 3097 eij=am(bl1->p1[i]+bl1->p1[j],bl1->p2[i]+bl1->p2[j],bl1->p3[i]+bl1->p3[j],bl1->eps[i]+bl1->eps[j]); 3063 // assert(isnan(eij) == false);3064 3098 if (eij < 1925.0) { 3065 3099 continue; … … 3067 3101 isos=bl1->ind2[i]+bl1->ind2[j]; 3068 3102 3069 // assert(isnan(eij) == false);3070 // assert(isnan(isos) == false);3071 3103 if (31.0*(bl3->rab2) > totalCrossSection(eij,0,isos)) { 3072 3104 continue; … … 3074 3106 3075 3107 bl2->k = bl2->k + 1; 3076 assert((bl2->k >= 0) && (bl2->k < BL2INDSIZE));3077 3108 if (j == 1) { 3078 3109 kcol = kcol + 1; … … 3096 3127 // here for incoming pions: 3097 3128 for(G4int i = bl3->ia1+1; i <= ia; i++) { //do i=ia1+1,ia 3098 // assert(isnan(energyTest(i)) == false);3099 3129 tref = ref(bl3->x1[i], bl3->x2[i], bl3->x3[i], bl1->p1[i], bl1->p2[i], bl1->p3[i], bl1->eps[i], r22); 3100 // assert(isnan(tref) == false);3101 // assert(isnan(tref) == false);3102 3130 if (tref < bl4->tmax5) { 3103 3131 bl2->k = bl2->k + 1; 3104 assert((bl2->k >= 0) && (bl2->k < BL2INDSIZE));3105 3132 bl2->crois[bl2->k] = tref; 3106 3133 bl2->ind[bl2->k] = i; … … 3123 3150 goto pnu36; 3124 3151 } 3125 // assert(isnan(energyTest(i)) == false);3126 3152 tref = ref(bl3->x1[i], bl3->x2[i], bl3->x3[i], bl1->p1[i], bl1->p2[i], bl1->p3[i], bl1->eps[i], r22); 3127 // assert(isnan(tref) == false);3128 3153 if(verboseLevel > 3) { 3129 3154 if(tref < 0.0) { … … 3139 3164 t1 = bl3->x1[i]*(bl1->p1[i])+bl3->x2[i]*(bl1->p2[i])+bl3->x3[i]*(bl1->p3[i]); 3140 3165 t2 = bl1->p1[i]*(bl1->p1[i])+bl1->p2[i]*(bl1->p2[i])+bl1->p3[i]*(bl1->p3[i]); 3141 assert(t2 != 0);3142 3166 t3 = t1/t2; 3143 3167 t4 = bl3->x1[i]*(bl3->x1[i])+bl3->x2[i]*(bl3->x2[i])+bl3->x3[i]*(bl3->x3[i]); … … 3157 3181 } 3158 3182 tref = (-1.0*t3 - std::sqrt(t5))*(bl1->eps[i]); 3159 // assert(isnan(tref) == false);3160 3183 if (tref > bl4->tmax5) { 3161 3184 continue; … … 3164 3187 pnu37: 3165 3188 bl2->k = bl2->k + 1; 3166 assert((bl2->k >= 0) && (bl2->k < BL2INDSIZE));3167 3189 bl2->crois[bl2->k] = tref; 3168 3190 bl2->ind[bl2->k] = i; … … 3174 3196 for(G4int i = bl3->ia1+1; i <= ia; i++) { //do 39 i=ia1+1,ia 3175 3197 npproj[i] = 0; 3176 // assert(isnan(energyTest(i)) == false);3177 3198 tref = ref(bl3->x1[i], bl3->x2[i], bl3->x3[i], bl1->p1[i], bl1->p2[i], bl1->p3[i], bl1->eps[i], r22); // line 2609 3178 // assert(isnan(tref) == false);3179 3199 if(verboseLevel > 3) { 3180 3200 if(tref < 0.0) { … … 3198 3218 } 3199 3219 eij=am(bl1->p1[i]+bl1->p1[ilm],bl1->p2[i]+bl1->p2[ilm],bl1->p3[i]+bl1->p3[ilm],bl1->eps[i]+bl1->eps[ilm]); 3200 // assert(isnan(eij) == false);3201 3220 if (eij < 1925.0) { 3202 3221 continue; 3203 3222 } 3204 3223 isos=bl1->ind2[i]+bl1->ind2[ilm]; 3205 // assert(isnan(eij) == false);3206 // assert(isnan(isos) == false);3207 3224 if (31.*(bl3->rab2) > totalCrossSection(eij,0,isos)) { 3208 3225 continue; … … 3354 3371 } 3355 3372 3356 // assert(isnan(tau) == false);3357 3373 if(verboseLevel > 3) { 3358 3374 G4cout <<"next = " << next << G4endl; … … 3521 3537 3522 3538 // parameters for the next colliding pair 3523 // assert(isnan(energyTest(l1)) == false);3524 // assert(isnan(energyTest(l2)) == false);3525 3539 t[9] = bl1->eps[bl9->l1] + bl1->eps[bl9->l2]; //t(10)->t[9] 3526 3540 t0 = 1.0/t[9]; // t(10)->t[9] … … 3544 3558 } 3545 3559 3546 assert(bl1->eps[bl9->l1] != 0);3547 3560 bl1->ta = tau/bl1->eps[bl9->l1]; 3548 3561 x1l1 = bl3->x1[bl9->l1] + bl1->p1[bl9->l1]*(bl1->ta); … … 3550 3563 x3l1 = bl3->x3[bl9->l1] + bl1->p3[bl9->l1]*(bl1->ta); 3551 3564 3552 assert(bl1->eps[bl9->l2] != 0);3553 3565 bl1->ta = tau/bl1->eps[bl9->l2]; 3554 3566 x1l2 = bl3->x1[bl9->l2] + bl1->p1[bl9->l2]*(bl1->ta); … … 3572 3584 // if (k3 == 1) go to 260 3573 3585 // if (k4 == 0) go to 260 3574 mg=bl1->ind1[bl9->l1]+bl1->ind1[bl9->l2]; 3586 if(k3 != 1 && k4 != 0) { 3587 mg=bl1->ind1[bl9->l1]+bl1->ind1[bl9->l2]; 3588 isos=bl1->ind2[bl9->l1]+bl1->ind2[bl9->l2]; 3589 } 3575 3590 if((k3 != 1) && (k4 != 0) && (mg == 1)) { 3576 isos=bl1->ind2[bl9->l1]+bl1->ind2[bl9->l2];3577 3591 // if (mg != 1) go to 260 3578 3592 ldel = bl9->l2; … … 3580 3594 ldel = bl9->l1; 3581 3595 } 3582 // assert(isnan(energyTest(ldel)) == false);3583 3596 bl6->xx10 = std::sqrt(std::pow(bl1->eps[ldel],2) - std::pow(bl1->p1[ldel],2) - std::pow(bl1->p2[ldel],2) - std::pow(bl1->p3[ldel],2)); 3584 3597 bl6->isa = bl1->ind2[ldel]; 3585 // assert(isnan(sq) == false);3586 // assert(isnan(mg) == false);3587 // assert(isnan(isos) == false);3588 3598 bmax2 = totalCrossSection(sq,mg,isos)/31.415926; 3589 3599 if (k5 == 0 && mg != 0) { … … 3593 3603 } 3594 3604 else { 3595 // assert(isnan(sq) == false);3596 // assert(isnan(mg) == false);3597 // assert(isnan(isos) == false);3598 3605 bmax2 = totalCrossSection(sq,mg,isos)/31.41592; 3599 3606 } … … 3649 3656 if (irst_avatar == 1) { 3650 3657 for(G4int i = 1; i <= bl9->l1; i = i + bl9->l1 - 1) { // bugfix! 3651 assert(bl1->eps[i] != 0);3652 // assert(isnan(energyTest(i)) == false);3653 3658 bl1->ta = tau/bl1->eps[i]; 3654 3659 bl3->x1[i] = bl3->x1[i] + bl1->p1[i]*(bl1->ta); … … 3665 3670 else { 3666 3671 for(G4int i = 1; i <= ia; i++) { 3667 // assert(isnan(energyTest(i)) == false);3668 assert(bl1->eps[i] != 0);3669 3672 bl1->ta = tau/bl1->eps[i]; 3670 3673 bl3->x1[i] = bl3->x1[i] + bl1->p1[i]*(bl1->ta); … … 3716 3719 ich3 = bl1->ind2[bl9->l1]; 3717 3720 ich4 = bl1->ind2[bl9->l2]; 3718 // assert(isnan(energyTest(l1)) == false);3719 // assert(isnan(energyTest(l2)) == false);3720 3721 aml1 = std::sqrt(std::pow(bl1->eps[bl9->l1],2) - std::pow(bl1->p1[bl9->l1],2) - std::pow(bl1->p2[bl9->l1],2) - std::pow(bl1->p3[bl9->l1],2)); 3721 3722 aml2 = std::sqrt(std::pow(bl1->eps[bl9->l2],2) - std::pow(bl1->p1[bl9->l2],2) - std::pow(bl1->p2[bl9->l2],2) - std::pow(bl1->p3[bl9->l2],2)); … … 3767 3768 G4cout <<"Momentum: p1 = " << bl1->p1[bl9->l2] << " p2 = " << bl1->p2[bl9->l2] << " p3 = " << bl1->p3[bl9->l2] << G4endl; 3768 3769 } 3769 // assert(isnan(energyTest(l1)) == false);3770 // assert(isnan(energyTest(l2)) == false);3771 3770 // bl9->l1 = l1; 3772 3771 // bl9->l2 = l2; … … 3777 3776 // l1 = bl9->l1; 3778 3777 // l2 = bl9->l2; 3779 // assert(isnan(energyTest(l1)) == false);3780 // assert(isnan(energyTest(l2)) == false);3781 3778 if(verboseLevel > 3) { 3782 3779 G4cout <<"End of collis call" << G4endl; … … 3822 3819 } 3823 3820 // restitution de l1 et l2 si rejet de la col. par pauli: 3824 // assert(isnan(energyTest(l1)) == false);3825 // assert(isnan(energyTest(l2)) == false);3826 3821 bl1->p1[bl9->l1] = t[20]; //t(21)->t[20] 3827 3822 bl1->p2[bl9->l1] = t[21]; //t(22)->t[21] … … 3836 3831 bl1->ind2[bl9->l1] = ich3; 3837 3832 bl1->ind2[bl9->l2] = ich4; 3838 // assert(isnan(energyTest(l1)) == false);3839 // assert(isnan(energyTest(l2)) == false);3840 3833 3841 3834 if (bl2->k == 0) { … … 3896 3889 } 3897 3890 3898 if(egs < (efer- (bl3->ia2-nbalttf)*tf)) {3891 if(egs < (efer- double(bl3->ia2-nbalttf)*tf)) { 3899 3892 if(varavat->kveux == 1) { 3900 3893 varavat->bloc_cdpp[iavat] = 1; … … 3982 3975 bl1->p3[bl9->l1] = bl1->p3[bl9->l2]; 3983 3976 bl1->eps[bl9->l1] = bl1->eps[bl9->l2]; 3984 // assert(isnan(energyTest(l1)) == false);3985 3977 3986 3978 bl3->x1[bl9->l1] = bl3->x1[bl9->l2]; … … 3995 3987 bl1->p3[bl9->l2] = xr3; 3996 3988 bl1->eps[bl9->l2] = xr4; 3997 // assert(isnan(energyTest(l2)) == false);3998 3989 3999 3990 bl3->x1[bl9->l2] = xr5; … … 4043 4034 led = 1; 4044 4035 } 4045 if((ich1+ich2-1) ==0) {4036 if((ich1+ich2-1) > 0) { 4046 4037 mcdd = mcdd + 1; 4047 4038 led = 1; … … 4059 4050 aml1 = am(bl1->p1[bl9->l1],bl1->p2[bl9->l1],bl1->p3[bl9->l1],bl1->eps[bl9->l1]); 4060 4051 aml2 = am(bl1->p1[bl9->l2],bl1->p2[bl9->l2],bl1->p3[bl9->l2],bl1->eps[bl9->l2]); 4061 // assert(isnan(aml1) == false);4062 // assert(isnan(aml2) == false);4063 4052 4064 4053 t[36] = (aml2*(bl1->p1[bl9->l1]) - aml1*(bl1->p1[bl9->l2]))/(aml1+aml2); //t(37)->t[36] … … 4074 4063 t[42] = t[42]/t[45]; //t(N)->t[N-1] 4075 4064 t[43] = t[43]/t[45]; //t(N)->t[N-1] 4076 t[4 5] = t[45]/t[46];4065 t[44] = t[44]/t[45]; 4077 4066 cif = (t[33]*t[36] + t[34]*t[37] + t[35]*t[38])/t[39]/t[40]; //t(N)->t[N-1] 4078 4067 … … 4103 4092 bl1->p3[bl9->l1] = aml1*tt36/(aml1 + aml2) + t[38]; //t(39)->t[38] 4104 4093 bl1->eps[bl9->l1] = w(bl1->p1[bl9->l1],bl1->p2[bl9->l1],bl1->p3[bl9->l1],aml1); 4105 // assert(isnan(energyTest(l1)) == false);4106 4094 bl1->p1[bl9->l2] = aml2*tt34/(aml1 + aml2) - t[36]; //t(37)->t[36] 4107 4095 bl1->p2[bl9->l2] = aml2*tt35/(aml1 + aml2) - t[37]; //t(38)->t[37] 4108 4096 bl1->p3[bl9->l2] = aml2*tt36/(aml1 + aml2) - t[38]; //t(39)->t[38] 4109 4097 bl1->eps[bl9->l2] = w(bl1->p1[bl9->l2],bl1->p2[bl9->l2],bl1->p3[bl9->l2],aml2); 4110 // assert(isnan(energyTest(l2)) == false);4111 4098 } 4112 4099 // l-conservation … … 4188 4175 4189 4176 tref=ref(bl3->x1[bl9->l1], bl3->x2[bl9->l1], bl3->x3[bl9->l1], bl1->p1[bl9->l1], bl1->p2[bl9->l1], bl1->p3[bl9->l1], bl1->eps[bl9->l1],r22); // line 3502 4190 // assert(isnan(tref) == false);4191 4177 4192 4178 if(verboseLevel > 3) { … … 4204 4190 4205 4191 tref=ref(bl3->x1[bl9->l2], bl3->x2[bl9->l2], bl3->x3[bl9->l2], bl1->p1[bl9->l2], bl1->p2[bl9->l2], bl1->p3[bl9->l2], bl1->eps[bl9->l2],r22); // line 3516 4206 // assert(isnan(tref) == false);4207 4192 4208 4193 if(verboseLevel > 3) { … … 4282 4267 // largeur variable du delta (phase space factor G4introduced 4/2001) 4283 4268 amlnew = std::sqrt(std::pow(bl1->eps[lnew],2)-std::pow(bl1->p1[lnew],2)-std::pow(bl1->p2[lnew],2)-std::pow(bl1->p3[lnew],2)); 4284 // assert(isnan(amlnew) == false);4285 4269 4286 4270 geff = bl1->eps[lnew]/amlnew; 4287 4271 qqq = std::sqrt((std::pow(amlnew,2) - std::pow((fmp+fmpi),2))*(std::pow(amlnew,2) - std::pow((fmp-fmpi),2)))/(2.0*amlnew); 4288 // assert(isnan(qqq) == false);4289 4272 4290 4273 psf = std::pow(qqq,3)/(std::pow(qqq,3) + 5832000.0); 4291 4274 tdel = -hc/(g0*psf)*std::log(rndm)*geff; 4292 // assert(isnan(tdel) == false);4293 4275 4294 4276 if(tdel <= bl4->tmax5) { … … 4317 4299 t[33] = bl1->eps[bl9->l1]; //t(34)->t[33] 4318 4300 var_ab = std::pow(bl1->eps[bl9->l1],2) - std::pow(bl1->p1[bl9->l1],2) - std::pow(bl1->p2[bl9->l1],2) - std::pow(bl1->p3[bl9->l1],2); 4319 assert(var_ab > 0);4320 4301 ym[npion] = 0.0; 4321 4302 … … 4331 4312 // } 4332 4313 // PK 4333 // assert(isnan(ym[npion]) == false);4334 assert(ym[npion] != 0);4335 // assert(isnan(pcm(ym[npion], fmp, fmpi)) == false);4336 4314 if(varavat->kveux == 1) { 4337 4315 varavat->del1avat[iavat] = bl1->ind1[bl9->l1]; … … 4344 4322 G4cout <<"q1 = " << q1[npion] << " q2 = " << q2[npion] << " q3 = " << q3[npion] << " q4 = " << q4[npion] << G4endl; 4345 4323 } 4346 assert(ym[npion] != 0);4347 4324 decay2(&(bl1->p1[bl9->l1]), &(bl1->p2[bl9->l1]), &(bl1->p3[bl9->l1]), &(bl1->eps[bl9->l1]), &(q1[npion]), &(q2[npion]), &(q3[npion]), 4348 4325 &(q4[npion]), &(ym[npion]), &fmp, &fmpi, &(bl9->hel[bl9->l1])); … … 4404 4381 } 4405 4382 } 4406 if(egs >= (efer -(bl3->ia2-nbalttf)*tf)) {4383 if(egs >= (efer - double(bl3->ia2-nbalttf)*tf)) { 4407 4384 goto pnu850; 4408 4385 } … … 4732 4709 4733 4710 var_ab = std::pow(bl1->p1[bl9->l1],2) + std::pow(bl1->p2[bl9->l1],2) + std::pow(bl1->p3[bl9->l1],2); 4734 assert(var_ab > 0);4735 4711 gpsg = 0.0; 4736 4712 if (var_ab > 0.0) { … … 4798 4774 itch = itch - (1 + bl1->ind2[bl9->l1])/2; 4799 4775 var_ab = std::pow(bl1->p1[bl9->l1],2) + std::pow(bl1->p2[bl9->l1],2) + std::pow(bl1->p3[bl9->l1],2); 4800 assert(var_ab > 0);4801 4776 gpsg = 0.0; 4802 4777 if(var_ab > 0.0) { … … 4968 4943 npion = npion + 1; 4969 4944 var_ab = std::pow(bl1->eps[i],2) - std::pow(bl1->p1[i],2) - std::pow(bl1->p2[i],2) - std::pow(bl1->p3[i],2); 4970 assert(var_ab > 0);4971 4945 ym[npion] = 0.0; 4972 4946 … … 5427 5401 G4double e1 = (*e1_p); 5428 5402 5429 G4double debugOutput ;5403 G4double debugOutput = 0.0; 5430 5404 debugOutput = am(p1,p2,p3,e1); 5431 // assert(isnan(debugOutput) == false);5432 5405 5433 5406 G4double pout11 = (*pout11_p); … … 5457 5430 5458 5431 // Variables: 5459 G4double a ;5460 G4double aaa ;5461 G4double aac ;5432 G4double a = 0.0; 5433 G4double aaa = 0.0; 5434 G4double aac = 0.0; 5462 5435 // G4double alog; 5463 G4double alphac ;5436 G4double alphac = 0.0; 5464 5437 // G4double amax1; 5465 G4double apt ;5466 G4double argu ;5467 G4double b ;5468 G4double btmax ;5469 G4double cfi ;5470 G4double cpt ;5471 G4double ctet ;5472 G4double e3 ;5473 G4double ecm ;5438 G4double apt = 0.0; 5439 G4double argu = 0.0; 5440 G4double b = 0.0; 5441 G4double btmax = 0.0; 5442 G4double cfi = 0.0; 5443 G4double cpt = 0.0; 5444 G4double ctet = 0.0; 5445 G4double e3 = 0.0; 5446 G4double ecm = 0.0; 5474 5447 G4double ex[3]; 5475 5448 G4double ey[3]; 5476 5449 G4double ez[3]; 5477 G4double f3; 5478 G4double f3max; 5479 G4double fi; 5480 G4double fracpn; 5481 G4double heli; 5482 G4int iexpi; 5483 G4int ii; 5484 G4int index; 5485 G4int index2; 5486 G4int isi; 5487 G4double pin; 5488 G4double pl; 5489 G4double pnorm; 5450 G4double qq[3]; 5451 for(G4int init_i = 0; init_i < 3; init_i++) { 5452 ex[init_i] = 0.0; 5453 ey[init_i] = 0.0; 5454 ez[init_i] = 0.0; 5455 qq[init_i] = 0.0; 5456 } 5457 G4double f3 = 0.0; 5458 G4double f3max = 0.0; 5459 G4double fi = 0.0; 5460 G4double fracpn = 0.0; 5461 G4double heli = 0.0; 5462 G4int iexpi = 0; 5463 G4int ii = 0; 5464 G4int index = 0; 5465 G4int index2 = 0; 5466 G4int isi = 0; 5467 G4double pin = 0.0; 5468 G4double pl = 0.0; 5469 G4double pnorm = 0.0; 5490 5470 // G4double pq = 0.0; 5491 G4double psq; 5492 G4double qq[3]; 5493 G4double qq4; 5494 G4double ranres; 5495 G4double rndm; 5496 G4double s; 5497 G4double s1; 5471 G4double psq = 0.0; 5472 G4double qq4 = 0.0; 5473 G4double ranres = 0.0; 5474 G4double rndm = 0.0; 5475 G4double s = 0.0; 5476 G4double s1 = 0.0; 5498 5477 // G4double sel; 5499 G4double sfi ;5500 G4double stet ;5501 G4double t ;5502 G4double x ;5503 G4double xkh ;5504 G4double xp1 ;5505 G4double xp2 ;5506 G4double xp3 ;5507 G4double xx ;5508 G4double y ;5509 G4double yn ;5510 G4double z ;5511 G4double zn ;5512 G4double zz ;5478 G4double sfi = 0.0; 5479 G4double stet = 0.0; 5480 G4double t = 0.0; 5481 G4double x = 0.0; 5482 G4double xkh = 0.0; 5483 G4double xp1 = 0.0; 5484 G4double xp2 = 0.0; 5485 G4double xp3 = 0.0; 5486 G4double xx = 0.0; 5487 G4double y = 0.0; 5488 G4double yn = 0.0; 5489 G4double z = 0.0; 5490 G4double zn = 0.0; 5491 G4double zz = 0.0; 5513 5492 5514 5493 // !!! q4 = -1*q4; … … 5539 5518 np = 0; 5540 5519 psq = p1*p1 + p2*p2 + p3*p3; 5541 assert(psq >= 0);5542 5520 pnorm = std::sqrt(psq); 5543 5521 ecm = e1 + eout1; 5544 // assert(isnan(ecm) == false);5545 5522 5546 5523 if(ecm < 1925.0) { … … 5552 5529 } 5553 5530 5554 // assert(isnan(bl8->rathr) == false);5555 5531 if(ecm < (2065.0 + bl8->rathr)) { 5556 5532 goto collis17; … … 5579 5555 5580 5556 collis19: 5581 // assert(isnan(bl8->ramass) == false);5582 5557 if((ecm-2170.4-bl8->ramass) <= 0) { 5583 5558 goto collis17; … … 5606 5581 standardRandom(&rndm, &(hazard->igraine[10])); 5607 5582 5608 // assert(isnan(ecm) == false);5609 // assert(isnan(iso) == false);5610 5583 s1 = lowEnergy(ecm, 1, iso); 5611 // assert(isnan(s1) == false);5612 5584 5613 5585 if(m1 != 0) { 5614 assert((e1*e1 - psq) >= 0);5615 5586 bl6->xx10=std::sqrt(e1*e1-psq); 5616 5587 bl6->isa=is1; 5617 // assert(isnan(bl6->isa) == false);5618 5588 } 5619 5589 else { 5620 assert((std::pow(eout1,2)-psq) >= 0);5621 5590 bl6->xx10 = std::sqrt(std::pow(eout1,2)-psq); 5622 5591 bl6->isa = is2; 5623 // assert(isnan(bl6->isa) == false);5624 5592 } 5625 5593 5626 5594 s = s1 + srec(ecm,bl6->xx10, iso,int(bl6->isa)); 5627 // assert(isnan(s) == false);5628 assert(s != 0);5629 5595 a = (s - s1)/s; 5630 // assert(isnan(a) == false);5631 5596 5632 5597 if((rndm-a) <= 0) { … … 5648 5613 standardRandom(&rndm, &(hazard->igraine[0])); 5649 5614 s = lowEnergy(ecm,0,iso); 5650 // assert(isnan(ecm) == false);5651 // assert(isnan(iso) == false);5652 5615 a = deltaProductionCrossSection(ecm,iso); 5653 5616 a = s/(s+a); … … 5662 5625 // j.c et al, prc56(1997)2431 5663 5626 collis17: 5664 assert((std::pow(ecm,2) - 4.0*xm2) >= 0);5665 5627 pl = 0.5*ecm*std::sqrt(std::pow(ecm,2) - 4.0*xm2)/xm; 5666 5628 x = 0.001*pl; 5667 // assert(isnan(x) == false);5668 5629 5669 5630 if (iso == 0) { … … 5698 5659 collis82: 5699 5660 debugOutput = am(p1,p2,p3,e1); 5700 // assert(isnan(debugOutput) == false);5701 5661 5702 5662 btmax = 4.0*psq*b; … … 5705 5665 ranres = rndm; 5706 5666 y = 1.0 - rndm*(1.0 - z); 5707 assert(y >= 0);5708 5667 t = std::log(y)/b; 5709 5668 iexpi = 0; … … 5733 5692 // y = 1.0 - ranres*(10.0 - z); 5734 5693 y = 1.0 - ranres*(1.0 - z); 5735 assert(y >= 0);5736 5694 t = std::log(y)/alphac; 5737 5695 } … … 5744 5702 } 5745 5703 5746 assert((1.0 - std::pow(ctet,2)) >= 0);5747 5704 stet = std::sqrt(1.0 - std::pow(ctet,2)); 5748 5705 standardRandom(&rndm, &(hazard->igraine[2])); … … 5754 5711 5755 5712 debugOutput = am(p1,p2,p3,e1); 5756 // assert(isnan(debugOutput) == false);5757 5713 5758 5714 if(xx >= (zz*1.0e-8)) { 5759 assert(xx >= 0);5760 5715 yn=std::sqrt(xx); 5761 5716 zn=yn*pnorm; 5762 assert(pnorm != 0);5763 5717 ez[0] = p1/pnorm; // ez(1) -> ez[0] and so on... 5764 5718 ez[1] = p2/pnorm; 5765 5719 ez[2] = p3/pnorm; 5766 assert(yn != 0);5767 5720 ex[0] = p2/yn; 5768 5721 ex[1] = -p1/yn; 5769 5722 ex[2] = 0.0; 5770 assert(zn != 0);5771 5723 ey[0] = p1*p3/zn; 5772 5724 ey[1] = p2*p3/zn; … … 5785 5737 pout13 = -p3; 5786 5738 debugOutput = am(p1,p2,p3,e1); 5787 // assert(isnan(debugOutput) == false);5788 5739 5789 5740 // backward scattering according the parametrization of ref … … 5804 5755 5805 5756 debugOutput = am(p1,p2,p3,e1); 5806 // assert(isnan(debugOutput) == false);5807 5757 goto exitRoutine; 5808 5758 … … 5835 5785 y = std::pow(ecm,2); 5836 5786 q2 = (y - std::pow(1076.0,2))*(y - std::pow(800.0,2))/y/4.0; 5837 assert(q2 >= 0);5838 5787 q3 = std::pow((std::sqrt(q2)),3); 5839 5788 f3max = q3/(q3 + std::pow(180.0,3)); 5840 5789 y = std::pow(x,2); 5841 5790 q2 = (y - std::pow(1076.0,2))*(y - std::pow(800.0,2))/y/4.0; 5842 assert(q2 >= 0);5843 5791 q3 = std::pow((std::sqrt(q2)),3); 5844 5792 f3 = q3/(q3 + std::pow(180.0,3)); … … 5853 5801 pin = pnorm; 5854 5802 pnorm = pcm(ecm,xm,xmdel); 5855 // assert(isnan(pnorm) == false);5856 5803 if (pnorm <= 0) { 5857 5804 pnorm = 0.000001; … … 5873 5820 5874 5821 standardRandom(&rndm, &(hazard->igraine[5])); 5875 assert((std::pow(ecm,2) - 4.0*xm2) >= 0);5876 5822 x = 0.001*0.5*ecm*std::sqrt(std::pow(ecm,2) - 4.0*xm2)/xm; 5877 5823 if(x < 1.4) { … … 5888 5834 } 5889 5835 5890 assert((1.0 - std::pow(ctet,2)) >= 0);5891 5836 stet = std::sqrt(1.0 - std::pow(ctet,2)); 5892 5837 standardRandom(&rndm, &(hazard->igraine[6])); … … 5899 5844 zz = p3*p3; 5900 5845 if(xx >= (zz*1.0e-8)) { 5901 assert(xx >= 0);5902 5846 yn = std::sqrt(xx); 5903 5847 zn = yn*pin; … … 5922 5866 // end of correction angular distribution of delta production 5923 5867 5924 assert((xp1*xp1 + xp2*xp2 + xp3*xp3 + xm*xm) >= 0);5925 5868 e3 = std::sqrt(xp1*xp1 + xp2*xp2 + xp3*xp3 + xm*xm); 5926 5869 if(k4 != 0) { … … 5934 5877 qq[1] = xp2; 5935 5878 qq[2] = xp3; 5936 assert((xp1*xp1 + xp2*xp2 + xp3*xp3 + xmdel*xmdel) >= 0);5937 5879 qq4 = std::sqrt(xp1*xp1 + xp2*xp2 + xp3*xp3 + xmdel*xmdel); 5938 5880 heli = std::pow(ctet,2); … … 5963 5905 } 5964 5906 debugOutput = am(p1,p2,p3,e1); 5965 // assert(isnan(debugOutput) == false);5966 5907 5967 5908 if (iso == 0) { … … 5970 5911 if (rndm > 0.333333) { 5971 5912 debugOutput = am(p1,p2,p3,e1); 5972 // assert(isnan(debugOutput) == false);5973 5913 goto exitRoutine; 5974 5914 } … … 5980 5920 if (index == 1) { 5981 5921 debugOutput = am(p1,p2,p3,e1); 5982 // assert(isnan(debugOutput) == false);5983 5922 goto exitRoutine; 5984 5923 } … … 5990 5929 ip = -2; 5991 5930 debugOutput = am(p1,p2,p3,e1); 5992 // assert(isnan(debugOutput) == false);5993 5931 goto exitRoutine; 5994 5932 … … 5998 5936 ip = 2; 5999 5937 debugOutput = am(p1,p2,p3,e1); 6000 // assert(isnan(debugOutput) == false);6001 5938 goto exitRoutine; 6002 5939 … … 6006 5943 pout13 = -p3; 6007 5944 debugOutput = am(p1,p2,p3,e1); 6008 // assert(isnan(debugOutput) == false);6009 5945 goto exitRoutine; 6010 5946 … … 6028 5964 } 6029 5965 debugOutput = am(p1,p2,p3,e1); 6030 // assert(isnan(debugOutput) == false);6031 5966 6032 5967 // symmetrization of charges in pn -> n delta … … 6056 5991 collis170: 6057 5992 pnorm = pcm(ecm,xm,xm); 6058 // assert(isnan(pnorm) == false);6059 5993 standardRandom(&rndm, &(hazard->igraine[11])); 6060 5994 ctet = -1.0 + 2.0*rndm; … … 6062 5996 ctet = sign(1.0,ctet); 6063 5997 } 6064 assert((1.0 - ctet*ctet) >= 0);6065 5998 stet = std::sqrt(1.0 - ctet*ctet); 6066 5999 standardRandom(&rndm, &(hazard->igraine[12])); … … 6073 6006 m1 = 0; 6074 6007 m2 = 0; 6075 assert((p1*p1 + p2*p2 + p3*p3 + xm*xm) >= 0);6076 6008 e1 = std::sqrt(p1*p1 + p2*p2 + p3*p3 + xm*xm); 6077 6009 eout1 = ecm - e1; 6078 6010 debugOutput = am(p1,p2,p3,e1); 6079 // assert(isnan(debugOutput) == false);6080 6011 6081 6012 if (iso == 0) { … … 6088 6019 exitRoutine: 6089 6020 debugOutput = am(p1,p2,p3,e1); 6090 // assert(isnan(debugOutput) == false);6091 6021 (*p1_p) = p1;// Was pq 6092 6022 (*p2_p) = p2; … … 6096 6026 6097 6027 debugOutput = am(pout11,pout12,pout13,eout1); 6098 // assert(isnan(debugOutput) == false);6099 6028 (*pout11_p) = pout11; 6100 6029 (*pout12_p) = pout12; … … 6152 6081 G4double hel = (*hel_p); 6153 6082 6154 G4double rndm ;6083 G4double rndm = 0.0; 6155 6084 6156 6085 G4double xe = wp; … … 6164 6093 // PK 6165 6094 G4double xq = pcm(xi,x1,x2); 6166 // assert(isnan(xq) == false); 6167 G4double ctet, stet; 6168 6169 G4double fi, cfi, sfi; 6170 G4double sal, cal; 6171 G4double t1, t2; 6172 G4double w1; 6173 G4double beta; 6095 G4double ctet = 0.0, stet = 0.0; 6096 6097 G4double fi = 0.0, cfi = 0.0, sfi = 0.0; 6098 G4double sal = 0.0, cal = 0.0; 6099 G4double t1 = 0.0, t2 = 0.0; 6100 G4double w1 = 0.0; 6101 G4double beta = 0.0; 6174 6102 6175 6103 if(verboseLevel > 3) { … … 6186 6114 ctet = sign(1.0,ctet); 6187 6115 } 6188 assert((1.0 - std::pow(ctet,2)) >= 0);6189 6116 stet = std::sqrt(1.0 - std::pow(ctet,2)); 6190 6117 standardRandom(&rndm, &(hazard->igraine[9])); … … 6195 6122 cfi = std::cos(fi); 6196 6123 sfi = std::sin(fi); 6197 assert((b1*b1+b2*b2+b3*b3) >= 0);6198 6124 beta = std::sqrt(b1*b1+b2*b2+b3*b3); 6199 // assert(isnan(beta) == false); 6200 assert(beta != 0); 6201 6202 assert((std::pow(b1,2) + std::pow(b2,2)) >= 0); 6125 6203 6126 sal = std::sqrt(std::pow(b1,2) + std::pow(b2,2))/beta; 6204 6127 cal = b3/beta; … … 6206 6129 if((beta >= 1.0e-10) || (sal >= 1.0e-6)) { 6207 6130 t1 = ctet + cal*stet*sfi/sal; 6208 assert(sal != 0);6209 6131 t2 = stet/sal; 6210 6132 q1 = xq*(b1*t1 + b2*t2*cfi)/beta; … … 6220 6142 hel = 0.0; 6221 6143 w1 = q1*q1 + q2*q2 + q3*q3; 6222 assert((w1 + x2*x2) >= 0);6223 6144 wq = std::sqrt(w1 + x2*x2); 6224 6145 p1 = -q1; 6225 6146 p2 = -q2; 6226 6147 p3 = -q3; 6227 assert((w1+x1*x1) >= 0);6228 6148 wp = std::sqrt(w1+x1*x1); 6229 6149 loren(&q1, &q2, &q3, &b1, &b2, &b3, &wq); … … 6251 6171 { 6252 6172 // time 6253 G4double t[10] ;6173 G4double t[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; 6254 6174 6255 6175 t[0] = bl1->p1[i]/bl1->eps[i] - bl1->p1[j]/bl1->eps[j]; // t(1)->t[0] … … 6275 6195 void G4Incl::newt(G4int l1, G4int l2) 6276 6196 { 6277 G4int ig , id, kg, kd;6278 G4int iy , ix;6279 G4double E ;6197 G4int ig = 0, id = 0, kg = 0, kd = 0; 6198 G4int iy = 0, ix = 0; 6199 G4double E = 0.0; 6280 6200 6281 6201 G4int ia = bl3->ia1 + bl3->ia2; … … 6349 6269 bl6->isa=bl1->ind2[ix]; 6350 6270 newt61: 6351 // assert(isnan(E) == false);6352 // assert(isnan(iy) == false);6353 // assert(isnan(bl1->ind2[ig]) == false);6354 // assert(isnan(bl1->ind2[id]) == false);6355 6271 if ((31.*(bl3->rab2)) > totalCrossSection(E,iy,bl1->ind2[ig]+bl1->ind2[id])) { 6356 6272 goto newt50; … … 6387 6303 bl6->isa=bl1->ind2[ix]; 6388 6304 newt63: 6389 // assert(isnan(E) == false);6390 // assert(isnan(iy) == false);6391 // assert(isnan(bl1->ind2[kg]) == false);6392 // assert(isnan(bl1->ind2[kd]) == false);6393 6305 if ((31.*(bl3->rab2)) > totalCrossSection(E,iy,bl1->ind2[kg]+bl1->ind2[kd])) { 6394 6306 continue; … … 6404 6316 void G4Incl::new1(G4int l1) 6405 6317 { 6406 G4int ia , iy, ix;6407 G4double E ;6318 G4int ia = 0, iy = 0, ix = 0; 6319 G4double E = 0.0; 6408 6320 6409 6321 ia=bl3->ia1+bl3->ia2; … … 6445 6357 bl6->isa=bl1->ind2[ix]; 6446 6358 new161: 6447 // assert(isnan(E) == false);6448 // assert(isnan(iy) == false);6449 // assert(isnan(bl1->ind2[i]) == false);6450 // assert(isnan(bl1->ind2[l1]) == false);6451 6359 if ((31.*(bl3->rab2)) > totalCrossSection(E ,iy,bl1->ind2[i]+bl1->ind2[l1])) { 6452 6360 continue; … … 6481 6389 bl6->isa=bl1->ind2[ix]; 6482 6390 new171: 6483 // assert(isnan(E) == false);6484 // assert(isnan(iy) == false);6485 // assert(isnan(bl1->ind2[i]) == false);6486 // assert(isnan(bl1->ind2[l1]) == false);6487 6391 if ((31.0*(bl3->rab2)) > totalCrossSection(E,iy,bl1->ind2[i]+bl1->ind2[l1])) { 6488 6392 continue; … … 6504 6408 G4double q4, G4int npion, G4int l1) 6505 6409 { 6506 G4double t[10] ;6410 G4double t[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; 6507 6411 6508 6412 G4int ia = bl3->ia1 + bl3->ia2; … … 6518 6422 } 6519 6423 6520 assert(q4 != 0);6521 assert(bl1->eps[i] != 0);6522 6424 t[0] = bl1->p1[i]/bl1->eps[i] - q1/q4; 6523 6425 t[1] = bl1->p2[i]/bl1->eps[i] - q2/q4; … … 6539 6441 G4double xx2 = t[3]*t[3] + t[4]*t[4] + t[5]*t[5] + (bl1->ta)*t[6]; 6540 6442 G4double E = std::sqrt(std::pow((bl1->eps[i]+q4),2) - std::pow((bl1->p1[i]+q1),2) - std::pow((bl1->p2[i]+q2),2) - std::pow((bl1->p3[i]+q3),2)); 6541 // assert(isnan(E) == false);6542 6443 if ((31.0*xx2) > pionNucleonCrossSection(E)) { 6543 6444 continue; … … 6553 6454 G4double q4, G4int npion, G4int l1) 6554 6455 { 6555 G4double t[10] ;6556 G4double E , xx2;6557 G4int ia ;6456 G4double t[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; 6457 G4double E = 0.0, xx2 = 0.0; 6458 G4int ia = 0; 6558 6459 6559 6460 if(bl5->nesc[l1] > 0) { … … 6561 6462 } 6562 6463 6563 assert(q4 != 0);6564 assert(bl1->eps[l1] != 0);6565 6464 t[0] = bl1->p1[l1]/bl1->eps[l1] - q1/q4; 6566 6465 t[1] = bl1->p2[l1]/bl1->eps[l1] - q2/q4; … … 6585 6484 xx2 = t[3]*t[3] + t[4]*t[4] + t[5]*t[5] + (bl1->ta)*t[6]; 6586 6485 E = std::sqrt(std::pow((bl1->eps[l1]+q4),2) - std::pow((bl1->p1[l1]+q1),2) - std::pow((bl1->p2[l1]+q2),2) - std::pow((bl1->p3[l1]+q3),2)); 6587 // assert(isnan(E) == false);6588 6486 if ((31.0*xx2) > pionNucleonCrossSection(E)) { 6589 6487 return; … … 6633 6531 // 3760 common/ws/r0,adif,rmaxws,drws,nosurf,xfoisa,npaulstr,bmax 6634 6532 6635 G4double pmod , pr2;6636 G4double xr2 , rdeq, dx2, dp2;6637 G4double rs , vol;6638 G4int nl ;6639 G4int ia ;6533 G4double pmod = 0.0, pr2 = 0.0; 6534 G4double xr2 = 0.0, rdeq = 0.0, dx2 = 0.0, dp2 = 0.0; 6535 G4double rs = 0.0, vol = 0.0; 6536 G4int nl = 0; 6537 G4int ia = 0; 6640 6538 6641 6539 if (ws->npaulstr == 2) { … … 6648 6546 if (pmod < 270.0) { 6649 6547 return 1.0; 6650 } 6651 else { 6548 } else { 6652 6549 return 0.0; 6653 6550 } 6654 } 6655 else { 6551 } else { 6656 6552 // Statistic Pauli blocking 6657 6553 xr2 = xr*xr; … … 6659 6555 vol = std::pow((40.0*3.1415926/3.0),2) * (std::pow((xr*pr)/(2.0*3.1415926*197.13),3)); 6660 6556 rs = std::sqrt(bl3->x1[l]*bl3->x1[l] + bl3->x2[l]*bl3->x2[l] + bl3->x3[l]*bl3->x3[l]); 6661 // assert(isnan(rs) == false);6662 6557 if (ws->nosurf <= 0) { 6663 6558 // modifs a.b.: r2 -> rmaxws pour la densite en w.s. 6664 6559 rdeq = ws->rmaxws; 6665 } 6666 else { 6560 } else { 6667 6561 rdeq = ws->r0; 6668 6562 } … … 6683 6577 if(((nl - 1)/vol/2.0) > 1.0) { 6684 6578 return 1.0; 6685 } 6686 else { 6579 } else { 6687 6580 return ((nl - 1)/vol/2.0); 6688 6581 } … … 6690 6583 nl = nl + 1; 6691 6584 } 6692 } 6693 else { 6585 } else { 6694 6586 return 0.0; 6695 6587 } … … 6709 6601 G4double plab = E*std::sqrt(E*E-3.52e6)/1876.6; 6710 6602 G4double p1 = 0.001*plab; 6711 G4double alp ;6603 G4double alp = 0.0; 6712 6604 6713 6605 if(plab > 2000.0) { … … 6756 6648 // m=0,1,2 for nucleon-nucleon,nucleon-delta,delta,delta 6757 6649 6758 G4double stotResult ;6650 G4double stotResult = 0.0; 6759 6651 G4double sine = 0.0; 6760 6652 6761 6653 if((m-1) < 0) { 6762 // assert(isnan(E) == false);6763 // assert(isnan(i) == false);6764 6654 sine = deltaProductionCrossSection(E,int(i)); 6765 6655 } … … 6774 6664 6775 6665 stotResult = sine + lowEnergy(E,m,i); 6776 // assert(isnan(stotResult) == false);6777 6666 return stotResult; 6778 6667 } … … 6781 6670 { 6782 6671 G4double E = Ein; 6783 G4double s ;6784 G4double x , y;6785 G4double srecResult ;6672 G4double s = 0.0; 6673 G4double x = 0.0, y = 0.0; 6674 G4double srecResult = 0.0; 6786 6675 6787 6676 if (i*i == 16) { … … 6791 6680 if(E <= (938.3 + d)) { 6792 6681 return 0.0; 6793 } 6794 else { 6682 } else { 6795 6683 if(E < (938.3 + d + 2.0)) { 6796 6684 E = 938.3 + d + 2.0; … … 6799 6687 x = (s - 3.523e6)/(s - std::pow((938.3 + d),2)); 6800 6688 y = s/(s - std::pow((d - 938.3),2)); 6801 // assert(isnan(E) == false);6802 // assert(isnan(i) == false);6803 6689 srecResult = 0.5*x*y*deltaProductionCrossSection(E, i); 6804 6690 srecResult = srecResult*(32.0 + i*i*(isa*isa - 5))/64.0; … … 6877 6763 // } 6878 6764 double scali=1.0; 6879 double plab; 6880 double p1; 6881 double sproResult; 6882 6883 double EE=E-(bl8->rathr); 6884 6885 // assert(isnan(EE) == false); 6765 double plab = 0.0; 6766 double p1 = 0.0; 6767 double sproResult = 0.0; 6768 6769 double EE = E -(bl8->rathr); 6770 6886 6771 if(EE*EE-3.53e6 < 0) { 6887 6772 goto spro22; 6888 6773 } 6889 plab=EE*std::sqrt(EE*EE-3.52e6)/1876.6; 6890 // assert(isnan(plab) == false); 6891 p1=0.001*plab; 6774 plab = EE * std::sqrt(EE*EE - 3.52e6)/1876.6; 6775 p1 = 0.001*plab; 6892 6776 if (plab > 800.) { 6893 6777 goto spro1; 6894 6778 } 6895 6779 spro22: 6896 sproResult =0.0;6780 sproResult = 0.0; 6897 6781 return sproResult; 6898 6782 … … 6911 6795 sproResult=(24.2+8.9*p1-31.1/std::sqrt(p1))*scali; 6912 6796 return sproResult; 6913 spro3: sproResult =(33.0 + 196.0*std::sqrt(std::pow(std::fabs(p1-0.95),5))-31.1/std::sqrt(p1))*scali;6797 spro3: sproResult = (33.0 + 196.0*std::sqrt(std::pow(std::fabs(p1 - 0.95),5)) - 31.1/std::sqrt(p1))*scali; 6914 6798 return sproResult; 6915 6799 spro10: if (plab < 2000.) { 6916 6800 goto spro11; 6917 6801 } 6918 sproResult =(41.+(60.*p1-54.)*std::exp(-1.2*p1)-77./(p1+1.5))*scali;6802 sproResult = (41.0 + (60.0*p1 - 54.0)*std::exp(-1.2*p1) - 77.0/(p1 + 1.5))*scali; 6919 6803 return sproResult; 6920 6804 spro11: if (plab < 1500.) { 6921 6805 goto spro12; 6922 6806 } 6923 sproResult=41.+60.*(p1-0.9)*std::exp(-1.2*p1)-1250./(p1+50.)+4.*std::pow((p1-1.3),2); 6807 sproResult = 41.0 + 60.0*(p1 - 0.9)*std::exp(-1.2*p1) - 1250.0/(p1 + 50.0)+4.0*std::pow((p1-1.3),2); 6808 sproResult = sproResult*scali; 6809 return sproResult; 6810 spro12: sproResult=23.5 + 24.6/(1.0 + std::exp(-10.0*p1 + 12.0)) - 1250.0/(p1 + 50.0) + 4.0*std::pow((p1 - 1.3),2); 6924 6811 sproResult=sproResult*scali; 6925 6812 return sproResult; 6926 spro12: sproResult=23.5+24.6/(1.+std::exp(-10.*p1+12.))-1250./(p1+50.)+4.*std::pow((p1-1.3),2);6927 sproResult=sproResult*scali;6928 return sproResult;6929 6930 6813 } 6931 6814 … … 6938 6821 G4double y = x*x; 6939 6822 G4double q2 = (y-std::pow(1076.0,2))*(y-std::pow(800.0,2))/y/4.0; 6940 assert(q2 >= 0); 6941 G4double q3, f3; 6942 G4double spn; 6823 G4double q3 = 0.0, f3 = 0.0; 6824 G4double spn = 0.0; 6943 6825 6944 6826 if(q2 <= 0) { 6945 6827 return 0.0; 6946 } 6947 else { 6828 } else { 6948 6829 q3 = std::pow((std::sqrt(q2)),3); 6949 6830 f3 = q3/(q3+std::pow(180.0,3)); … … 6961 6842 // of the nucleus and r is the target radius 6962 6843 6963 G4double x ;6844 G4double x = 0.0; 6964 6845 G4double barr = 0.0; 6965 6846 6966 6847 // We need enough energy to escape from the potential well. 6967 6848 if (E > v0) { 6968 x = std::sqrt(E*(E-v0)); 6969 // assert(isnan(x) == false); 6970 barr = 4.*x/(E+E-v0+x+x); 6971 // assert(isnan(barr) == false); 6849 x = std::sqrt(E*(E - v0)); 6850 barr = 4.0*x/(E + E - v0 + x + x); 6972 6851 if (iz > 0) { 6973 6852 G4double b = izn*1.44/r; 6974 G4double px = std::sqrt((E-v0)/b); 6975 // assert(isnan(px) == false); 6853 G4double px = std::sqrt((E - v0)/b); 6976 6854 6977 6855 if (px < 1.0) { 6978 G4double g = izn/137.03*std::sqrt(2.*938.3/(E-v0))*(std::acos(px)-px*std::sqrt(1.-px*px)); 6979 // assert(isnan(g) == false); 6856 G4double g = izn/137.03*std::sqrt(2.0*938.3/(E - v0))*(std::acos(px) - px*std::sqrt(1.0 - px*px)); 6980 6857 if (g > 35.){ 6981 6858 barr=0.0; 6982 } 6983 else { 6859 } else { 6984 6860 barr = barr*std::exp(-2.0*g); 6985 6861 } 6986 6862 return barr; 6987 } 6988 else { 6863 } else { 6989 6864 return barr; 6990 6865 } 6991 } 6992 else { 6866 } else { 6993 6867 return barr; 6994 6868 } 6995 } 6996 else { 6869 } else { 6997 6870 return barr; 6998 6871 } … … 7003 6876 const G4double pf = 270.339 , pf2 = 73083.4; 7004 6877 7005 G4double ref ;7006 G4double t1 , t3, t4, t5;6878 G4double ref = 0.0; 6879 G4double t1 = 0.0, t3 = 0.0, t4 = 0.0, t5 = 0.0; 7007 6880 7008 G4double t2 = p1*p1+p2*p2+p3*p3; 7009 assert(t2 >= 0); 6881 G4double t2 = p1*p1 + p2*p2 + p3*p3; 7010 6882 G4double p = std::sqrt(t2); 7011 6883 G4double r = r2; 7012 G4double xv ;7013 G4double s ;6884 G4double xv = 0.0; 6885 G4double s = 0.0; 7014 6886 7015 6887 if (ws->nosurf <= 0) { 7016 6888 xv = p/pf; 7017 // assert(isnan(xv) == false);7018 6889 r = interpolateFunction(xv); 7019 // assert(isnan(r) == false);7020 6890 r = r*r; 7021 6891 if (t2 > pf2) { … … 7039 6909 if (t5 > 0) { 7040 6910 ref = (-t3 + std::sqrt(t5))*E; 7041 // assert(isnan(ref) == false);7042 6911 return ref; 7043 6912 } … … 7078 6947 } 7079 6948 7080 bl3->ia2 = int( calincl->f[0]); // f(1) -> f[0]6949 bl3->ia2 = int(std::floor(calincl->f[0] + 0.1)); // f(1) -> f[0] 7081 6950 sep = 6.8309; 7082 6951 … … 7105 6974 bmaxt = ws->bmax; 7106 6975 proba_trans = coulombTransm(calincl->f[2],bl3->ia1,iz1,calincl->f[0],calincl->f[1]); 7107 // assert(isnan(proba_trans) == false);7108 7109 6976 proba = forceAbs(1,calincl->f[0],calincl->f[1],calincl->f[2],bmaxt,proba_trans); 7110 // assert(isnan(proba) == false);7111 6977 7112 6978 standardRandom(&alea,&(hazard->igraine[4])); … … 7119 6985 7120 6986 del = std::sqrt(std::pow(((calincl->f[0] + 1.0)*fmpinc + calincl->f[2]),2) - pbeam2); 7121 // assert(isnan(del) == false);7122 6987 7123 6988 (*erecrem) = pbeam2/((calincl->f[0] + 1.0)*fmpinc+calincl->f[2] + del); … … 7139 7004 bmaxt = ws->bmax; 7140 7005 proba_trans = coulombTransm(calincl->f[2],bl3->ia1,iz1,calincl->f[0],calincl->f[1]); 7141 // assert(isnan(proba_trans) == false);7142 7143 7006 proba = forceAbs(1,calincl->f[0],calincl->f[1],calincl->f[2],bmaxt,proba_trans); 7144 // assert(isnan(proba) == false);7145 7007 7146 7008 standardRandom(&alea,&(hazard->igraine[4])); … … 7153 7015 7154 7016 del = std::sqrt(std::pow(((calincl->f[0]+1.)*fmpinc+calincl->f[2]),2)-pbeam2); 7155 // assert(isnan(del) == false);7156 7017 7157 7018 (*erecrem) = pbeam2/((calincl->f[0] + 1.0)*fmpinc + calincl->f[2] + del); … … 7190 7051 7191 7052 sig_exp = xabs2(zp, ap, zt, at, ep); 7192 // assert(isnan(sig_exp) == false);7193 7194 7053 sig_incl = crossSection(int(iprojo), ep, at); 7195 // assert(isnan(sig_incl) == false);7196 7054 7197 7055 proba = (sig_exp-pt*sig_incl)/(pt*(sig_g - sig_incl)); … … 7268 7126 gcm = (ap*(dp1 + E/938.0) + at)/(std::pow((std::pow(ap,2) + std::pow(at,2) + dp2*ap*(E + 938.0)*at/938.e0),dph)); 7269 7127 bcm = std::sqrt(dp1-dp1/(std::pow(gcm,2))); 7270 // assert(isnan(bcm) == false);7271 7128 7272 7129 plab = ap*std::sqrt(dp2*938.0*E + E*E); 7273 // assert(isnan(plab) == false);7274 7130 ecmp = gcm*(E+938.0)*ap - bcm*gcm*plab - ap*938.0; 7275 7131 ecmt = gcm*938.0*at - at*938.0; … … 7281 7137 rm = (197.32/137.01)*zp*zt/ecm; 7282 7138 bigr = rp + rt + 1.2*(std::pow(ap,dpth) + std::pow(at,dpth))/(std::pow(ecm,dpth)); 7283 // assert(isnan(bigr) == false);7284 7139 7285 7140 bigb = 1.44*zp*zt/bigr; 7286 // assert(isnan(bigb) == false);7287 7141 7288 7142 if ((nint(zp) == 1) && (nint(at) > 56)) { … … 7420 7274 } 7421 7275 7422 // if(isnan(sig)) {7423 // sig = 0.0;7424 // }7425 7426 7276 return sig; 7427 7277 } … … 7431 7281 (*seed) = (*seed); // Avoid warning during compilation. 7432 7282 // Use Geant4 G4UniformRand 7433 (*rndm) = G4UniformRand(); 7283 // (*rndm) = G4UniformRand(); 7284 (*rndm) = randomGenerator->getRandom(); 7434 7285 } 7435 7286 … … 7516 7367 {-0.01087e+0,2.6494e+0,-2.5173e+0}}; 7517 7368 7518 G4double apow[3] , epow[5];7519 G4int ii , jj;7369 G4double apow[3] = {0.0, 0.0, 0.0}, epow[5] = {0.0, 0.0, 0.0}; 7370 G4int ii = 0, jj = 0; 7520 7371 7521 7372 if(A >= 27.0) { 7522 7373 ii = 3; 7523 7374 jj = 4; 7524 } 7525 else { 7375 } else { 7526 7376 ii = 3; 7527 7377 jj = 5; … … 7545 7395 } 7546 7396 } 7547 } 7548 else { 7397 } else { 7549 7398 for(G4int i = 0; i < ii; i++ ) { 7550 7399 for(G4int j = 0; j < jj; j++) { … … 7553 7402 } 7554 7403 } 7555 } 7556 else { 7404 } else { 7557 7405 for(G4int i = 0; i < ii; i++) { 7558 7406 for(G4int j = 0; j < jj; j++) { … … 7567 7415 G4double G4Incl::coulombTransm(G4double E, G4double fm1, G4double z1, G4double fm2, G4double z2) 7568 7416 { 7569 G4double eta ,rho;7417 G4double eta = 0.0, rho = 0.0; 7570 7418 const G4double c2 = 0.00516; 7571 7419 const G4double c3 = 0.007165; 7572 7420 const G4double uma = 938.0; 7573 G4double ml ;7421 G4double ml = 0.0; 7574 7422 7575 7423 G4double ecm = E*fm2/(fm1+fm2); … … 7603 7451 static G4double psi = rho*y; 7604 7452 7605 static G4int i0 , j0;7453 static G4int i0 = 0, j0 = 0; 7606 7454 7607 static G4double prob ;7608 static G4double dumm , x, cx;7609 static G4double t , t1, t2, t3;7610 static G4double f , g;7611 static G4double temp , temp1, temp2;7612 static G4double xk , delp0, delp1, delx0, delx1;7455 static G4double prob = 0.0; 7456 static G4double dumm = 0.0, x = 0.0, cx = 0.0; 7457 static G4double t = 0.0, t1 = 0.0, t2 = 0.0, t3 = 0.0; 7458 static G4double f = 0.0, g = 0.0; 7459 static G4double temp = 0.0, temp1 = 0.0, temp2 = 0.0; 7460 static G4double xk = 0.0, delp0 = 0.0, delp1 = 0.0, delx0 = 0.0, delx1 = 0.0; 7613 7461 7614 7462 if (rho > y) { 7615 7463 if (psi > dp4 && psi < 50.0) { 7616 7464 prob = clmb2(rho,eta,&dumm); 7617 } 7618 else { 7465 } else { 7619 7466 x = std::exp(std::log(eta)/6.0); 7620 7467 prob = std::sqrt(dp1 - y*x/(c0 + c1 * std::pow(x,3) + rho * x)); 7621 7468 } 7622 7469 (*ml) = 0; 7623 } 7624 else { 7470 } else { 7625 7471 x = rho/y; 7626 7472 if (psi <= psi0[0]) { … … 7631 7477 if (eta > dp1) { 7632 7478 t3 = std::log(psi)+dp2*gamma - dp1 + dp1/(12.e0*std::pow(eta,2))+dp1/(12.e1*std::pow(eta,4)); 7633 } 7634 else { 7479 } else { 7635 7480 t3 = std::log(dp2*rho) + gamma - dp1/(dp1 + std::pow(eta,2)) + s3*std::pow(eta,2) + s4*std::pow(eta,4); 7636 7481 } … … 7639 7484 prob = cx/(std::pow(g,2)+std::pow(f,2)); 7640 7485 (*ml) = 3; 7641 } 7642 else if (psi <= psi0[ln0-1]) { 7486 } else if (psi <= psi0[ln0-1]) { 7643 7487 if (x <= x0[0]) { 7644 7488 temp = std::log(psi/psi0[0]); … … 7653 7497 prob = cx/std::pow(prob,2); 7654 7498 (*ml) = 1; 7655 } 7656 else { 7499 } else { 7657 7500 temp1 = std::log(x/x0[0]); 7658 7501 i0 = min(max(1 + int(temp1/delx0),1),lt0-1); … … 7666 7509 (*ml)=2; 7667 7510 } 7668 } 7669 else if (psi <= psi1[ln1-1]) { 7511 } else if (psi <= psi1[ln1-1]) { 7670 7512 if (x <= x1[0]) { 7671 7513 temp = std::log(psi/psi1[0]); … … 7678 7520 prob = cx/std::pow(prob,2); 7679 7521 (*ml) = 1; 7680 } 7681 else { 7522 } else { 7682 7523 temp1 = std::log(x/x1[0]); 7683 7524 i0 = min(max(1+int(temp1/delx1),1),lt1-1); … … 7691 7532 (*ml)=2; 7692 7533 } 7693 } 7694 else { 7534 } else { 7695 7535 prob = clmb2(rho,eta,&dumm); 7696 7536 (*ml) = 4; … … 7722 7562 const G4double x1 = 0.01; 7723 7563 const G4double xi = 100; 7724 static G4double x ,temp,prob;7725 static G4int i ;7564 static G4double x = 0.0, temp = 0.0, prob = 0.0; 7565 static G4int i = 0; 7726 7566 7727 7567 x = dp1/(dp1 + std::sqrt(dph*rho*eta)); 7728 7568 if (x < x1) { 7729 7569 temp = t0[2] * std::pow((x/x1),dpth); 7730 } 7731 else { 7570 } else { 7732 7571 i = int(std::floor(xi*x)); 7733 7572 i = i + 1; … … 7750 7589 if(a < b) { 7751 7590 return a; 7752 } 7753 else { 7591 } else { 7754 7592 return b; 7755 7593 } … … 7760 7598 if(a < b) { 7761 7599 return a; 7762 } 7763 else { 7600 } else { 7764 7601 return b; 7765 7602 } … … 7770 7607 if(a > b) { 7771 7608 return a; 7772 } 7773 else { 7609 } else { 7774 7610 return b; 7775 7611 } … … 7780 7616 if(a > b) { 7781 7617 return a; 7782 } 7783 else { 7618 } else { 7784 7619 return b; 7785 7620 } … … 7797 7632 if(fractpart < 0.5) { 7798 7633 return int(std::floor(number)); 7799 } 7800 else { 7634 } else { 7801 7635 return int(std::ceil(number)); 7802 7636 } … … 7805 7639 if(fractpart < -0.5) { 7806 7640 return int(std::floor(number)); 7807 } 7808 else { 7641 } else { 7809 7642 return int(std::ceil(number)); 7810 7643 } … … 7845 7678 G4double G4Incl::pcm(G4double E, G4double A, G4double C) 7846 7679 { 7847 // assert(((std::pow(E,2)-std::pow((A+C),2))*(std::pow(E,2)-std::pow((A-C),2))) >= 0);7848 // assert(E != 0);7849 7680 return (0.5*std::sqrt((std::pow(E,2)-std::pow((A+C),2))*(std::pow(E,2)-std::pow((A-C),2)))/E); 7850 7681 } -
trunk/source/processes/hadronic/models/incl/src/G4InclAblaDataFile.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InclAblaDataFile.cc,v 1. 5 2007/12/03 19:36:06 miheikkiExp $26 // $Id: G4InclAblaDataFile.cc,v 1.7 2008/06/25 17:20:04 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 87 87 88 88 G4double flalpha, frldm, vgsld, pace2; 89 const G4int rows = 9 8;90 const G4int cols = 15 3;89 const G4int rows = 99; 90 const G4int cols = 154; 91 91 const G4int massnumbers = 263; 92 for(int i = 0; i < rows; i++) {93 for(int j = 0; j < cols; j++) {92 for(int i = 0; i < cols; i++) { 93 for(int j = 0; j < rows; j++) { 94 94 setAlpha(j, i, 0.0); 95 95 setEcnz( j, i, 0.0); … … 98 98 } 99 99 100 for(int i = 0; i < rows; i++) {101 for(int j = 0; j < cols; j++) {100 for(int i = 0; i < cols; i++) { 101 for(int j = 0; j < rows; j++) { 102 102 flalphain >> flalpha; 103 103 frldmin >> frldm; 104 104 vgsldin >> vgsld; 105 setAlpha( j, i, flalpha);106 setEcnz( j, i, frldm);107 setVgsld( j, i, vgsld);105 setAlpha(i, j, flalpha); 106 setEcnz( i, j, frldm); 107 setVgsld(i, j, vgsld); 108 108 } 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.