Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:57:56

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // ABLAXX statistical de-excitation model
0027 // Jose Luis Rodriguez, UDC (translation from ABLA07 and contact person)
0028 // Pekka Kaitaniemi, HIP (initial translation of ablav3p)
0029 // Aleksandra Kelic, GSI (ABLA07 code)
0030 // Davide Mancusi, CEA (contact person INCL)
0031 // Aatos Heikkinen, HIP (project coordination)
0032 //
0033 
0034 #pragma once
0035 
0036 #include "globals.hh"
0037 #include <memory>
0038 
0039 #include "G4AblaDataDefs.hh"
0040 #include "G4AblaRandom.hh"
0041 
0042 /**
0043  *  Class containing ABLA++ de-excitation code.
0044  */
0045 
0046 class G4Abla {
0047 
0048 public:
0049   /**
0050    * This constructor is used by standalone test driver and the Geant4
0051    * interface.
0052    *
0053    * @param aHazard random seeds
0054    * @param aVolant data structure for ABLA output
0055    * @param aVarNtp data structure for transfering ABLA output to Geant4
0056    * interface
0057    */
0058   G4Abla(G4VarNtp *aVarntp);
0059 
0060   /**
0061    * Basic destructor.
0062    */
0063   ~G4Abla() = default;
0064 
0065   /// \brief Dummy copy constructor
0066   G4Abla(G4Abla const &other);
0067 
0068   /// \brief Dummy assignment operator
0069   G4Abla &operator=(G4Abla const &other);
0070 
0071   /**
0072    * Set verbosity level.
0073    */
0074   void setVerboseLevel(G4int level);
0075 
0076   /**
0077    * Main interface to the de-excitation code.
0078    *
0079    * @param nucleusA mass number of the nucleus
0080    * @param nucleusZ charge number of the nucleus
0081    * @param excitationEnergy excitation energy of the nucleus
0082    * @param angularMomentum angular momentum of the nucleus (produced as output
0083    * by INCL4)
0084    * @param momX momentum x-component
0085    * @param momY momentum y-component
0086    * @param momZ momentum z-component
0087    * @param eventnumber number of the event
0088    */
0089   void DeexcitationAblaxx(G4int nucleusA, G4int nucleusZ,
0090                           G4double excitationEnergy, G4double angularMomentum,
0091                           G4double momX, G4double momY, G4double momZ,
0092                           G4int eventnumber);
0093 
0094   /**
0095    * Main interface to the de-excitation code for hyper-nuclei.
0096    *
0097    * @param nucleusA mass number of the nucleus
0098    * @param nucleusZ charge number of the nucleus
0099    * @param excitationEnergy excitation energy of the nucleus
0100    * @param angularMomentum angular momentum of the nucleus (produced as output
0101    * by INCL)
0102    * @param momX momentum x-component
0103    * @param momY momentum y-component
0104    * @param momZ momentum z-component
0105    * @param eventnumber number of the event
0106    * @param nucleusS is the strange number
0107    */
0108   void DeexcitationAblaxx(G4int nucleusA, G4int nucleusZ,
0109                           G4double excitationEnergy, G4double angularMomentum,
0110                           G4double momX, G4double momY, G4double momZ,
0111                           G4int eventnumber, G4int nucleusS);
0112 
0113   // Evaporation
0114 public:
0115   /**
0116    * Initialize ABLA evaporation code.
0117    *
0118    */
0119   void initEvapora();
0120 
0121   /**
0122    * Initialize ABLA parameters.
0123    *
0124    */
0125   void SetParameters();
0126   void SetParametersG4(G4int z, G4int a);
0127 
0128   /**
0129    * Coefficient of collective enhancement including damping
0130    * Input: z,a,bet,sig,u
0131    * Output: qr - collective enhancement factor
0132    * See  junghans et al., nucl. phys. a 629 (1998) 635
0133    * @param z charge number
0134    * @param a mass number
0135    * @param bet beta deformation
0136    * @param sig perpendicular spin cut-off factor
0137    * @param u Energy
0138    * @return Coefficient of collective enhancement
0139    */
0140   void qrot(G4double z, G4double a, G4double bet, G4double sig, G4double u,
0141             G4double *qr);
0142 
0143   /**
0144    * Model de la goutte liquide de c. f. weizsacker.
0145    * usually an obsolete option
0146    */
0147   void mglw(G4double a, G4double z, G4double *el);
0148 
0149   /**
0150    * Mglms
0151    */
0152   void mglms(G4double a, G4double z, G4int refopt4, G4double *el);
0153 
0154   /**
0155    *
0156    */
0157   G4double spdef(G4int a, G4int z, G4int optxfis);
0158 
0159   /**
0160    * Calculation of fissility parameter
0161    */
0162   G4double fissility(G4int a, G4int z, G4int ny, G4double sn, G4double slam,
0163                      G4int optxfis);
0164 
0165   /**
0166    * Main evaporation routine.
0167    */
0168   void evapora(G4double zprf, G4double aprf, G4double *ee_par, G4double jprf,
0169                G4double *zf_par, G4double *af_par, G4double *mtota_par,
0170                G4double *vleva_par, G4double *vxeva_par, G4double *vyeva_par,
0171                G4int *ff_par, G4int *fimf_par, G4double *fzimf, G4double *faimf,
0172                G4double *tkeimf_par, G4double *jprfout, G4int *inttype_par,
0173                G4int *inum_par, G4double EV_TEMP[indexpart][6],
0174                G4int *iev_tab_temp_par, G4int *nblam0);
0175 
0176   /**
0177    * Calculation of particle emission probabilities.
0178    */
0179   void direct(G4double zprf, G4double a, G4double ee, G4double jprf,
0180               G4double *probp_par, G4double *probd_par, G4double *probt_par,
0181               G4double *probn_par, G4double *probhe_par, G4double *proba_par,
0182               G4double *probg_par, G4double *probimf_par, G4double *probf_par,
0183               G4double *problamb0_par, G4double *ptotl_par, G4double *sn_par,
0184               G4double *sbp_par, G4double *sbd_par, G4double *sbt_par,
0185               G4double *sbhe_par, G4double *sba_par, G4double *slamb0_par,
0186               G4double *ecn_par, G4double *ecp_par, G4double *ecd_par,
0187               G4double *ect_par, G4double *eche_par, G4double *eca_par,
0188               G4double *ecg_par, G4double *eclamb0_par, G4double *bp_par,
0189               G4double *bd_par, G4double *bt_par, G4double *bhe_par,
0190               G4double *ba_par, G4double *sp_par, G4double *sd_par,
0191               G4double *st_par, G4double *she_par, G4double *sa_par,
0192               G4double *ef_par, G4double *ts1_par, G4int, G4int inum,
0193               G4int itest, G4int *sortie, G4double *tcn, G4double *jprfn_par,
0194               G4double *jprfp_par, G4double *jprfd_par, G4double *jprft_par,
0195               G4double *jprfhe_par, G4double *jprfa_par,
0196               G4double *jprflamb0_par, G4double *tsum_par, G4int NbLam0);
0197 
0198   /**
0199    * Calculation of fission and the particle emission probabilities after
0200    * fission.
0201    */
0202   void fission(G4double AF, G4double ZF, G4double EE, G4double JPRF,
0203                G4double *VX1_FISSION, G4double *VY1_FISSION,
0204                G4double *VZ1_FISSION, G4double *VX2_FISSION,
0205                G4double *VY2_FISSION, G4double *VZ2_FISSION, G4int *ZFP1,
0206                G4int *AFP1, G4int *SFP1, G4int *ZFP2, G4int *AFP2, G4int *SFP2,
0207                G4int *imode, G4double *VX_EVA_SC, G4double *VY_EVA_SC,
0208                G4double *VZ_EVA_SC, G4double EV_TEMP[indexpart][6],
0209                G4int *IEV_TAB_FIS, G4int *NbLam0);
0210 
0211   /**
0212    * Calculation of lorentz's boost
0213    */
0214   void lorentz_boost(G4double VXRIN, G4double VYRIN, G4double VZRIN,
0215                      G4double VXIN, G4double VYIN, G4double VZIN,
0216                      G4double *VXOUT, G4double *VYOUT, G4double *VZOUT);
0217 
0218   /**
0219    * Calculation of unstable nuclei
0220    */
0221   void unstable_nuclei(G4int AFP, G4int ZFP, G4int *AFPNEW, G4int *ZFPNEW,
0222                        G4int &IOUNSTABLE, G4double VX, G4double VY, G4double VZ,
0223                        G4double *VP1X, G4double *VP1Y, G4double *VP1Z,
0224                        G4double BU_TAB_TEMP[indexpart][6], G4int *ILOOP);
0225 
0226   /**
0227    * Calculation of unstable nuclei tke
0228    */
0229   void unstable_tke(G4double AIN, G4double ZIN, G4double ANEW, G4double ZNEW,
0230                     G4double VXIN, G4double VYIN, G4double VZIN, G4double *V1X,
0231                     G4double *V1Y, G4double *V1Z, G4double *V2X, G4double *V2Y,
0232                     G4double *V2Z);
0233 
0234   /**
0235    * Calculation of tke for breakup fragments
0236    */
0237   void tke_bu(G4double Z, G4double A, G4double ZALL, G4double AAL, G4double *VX,
0238               G4double *VY, G4double *VZ);
0239 
0240   /**
0241    * Calculation of the angular momentum of breakup fragments
0242    * according to Goldhaber model
0243    */
0244   void AMOMENT(G4double AABRA, G4double APRF, G4int IMULTIFR, G4double *PX,
0245                G4double *PY, G4double *PZ);
0246 
0247   /**
0248    * Calculation of particle emission barriers.
0249    */
0250   void barrs(G4int Z1, G4int A1, G4int Z2, G4int A2, G4double *sBARR,
0251              G4double *sOMEGA);
0252 
0253   /**
0254    * Calculation of particle emission between the saddle and scission point.
0255    */
0256   void evap_postsaddle(G4double A, G4double Z, G4double E_scission_pre,
0257                        G4double *E_scission_post, G4double *A_scission,
0258                        G4double *Z_scission, G4double &vx_eva, G4double &vy_eva,
0259                        G4double &vz_eva, G4int *NbLam0_par);
0260 
0261   /**
0262    * Calculation of imfs.
0263    */
0264   void imf(G4double ACN, G4double ZCN, G4double TEMP, G4double EE,
0265            G4double *ZIMF, G4double *AIMF, G4double *BIMF, G4double *SBIMF,
0266            G4double *TIMF, G4double JPRF);
0267 
0268   /**
0269    * Calculation of omega at saddle point.
0270    */
0271   void fomega_sp(G4double AF, G4double Y, G4double *MFCD, G4double *sOMEGA,
0272                  G4double *sHOMEGA);
0273 
0274   /**
0275    * Calculation of omega at ground state.
0276    */
0277   void fomega_gs(G4double AF, G4double ZF, G4double *K1, G4double *sOMEGA,
0278                  G4double *sHOMEGA);
0279 
0280   /**
0281    * Calculation of tunnelling effect in fission.
0282    */
0283   G4double tunnelling(G4double A, G4double ZPRF, G4double Y, G4double EE,
0284                       G4double EF, G4double TEMP, G4double DENSG,
0285                       G4double DENSF, G4double ENH_FACT);
0286 
0287   /**
0288    * Calculation of fission width at the saddle point according to B&W.
0289    */
0290   void fission_width(G4double ZPRF, G4double A, G4double EE, G4double BS,
0291                      G4double BK, G4double EF, G4double Y, G4double *GF,
0292                      G4double *TEMP, G4double JPR, G4int IEROT,
0293                      G4int FF_ALLOWED, G4int OPTCOL, G4int OPTSHP,
0294                      G4double DENSG);
0295 
0296   /**
0297    * Calculation of unbound nuclei.
0298    */
0299   void unbound(G4double SN, G4double SP, G4double SD, G4double ST, G4double SHE,
0300                G4double SA, G4double BP, G4double BD, G4double BT, G4double BHE,
0301                G4double BA, G4double *PROBF, G4double *PROBN, G4double *PROBP,
0302                G4double *PROBD, G4double *PROBT, G4double *PROBHE,
0303                G4double *PROBA, G4double *PROBIMF, G4double *PROBG,
0304                G4double *ECN, G4double *ECP, G4double *ECD, G4double *ECT,
0305                G4double *ECHE, G4double *ECA);
0306 
0307   /**
0308    * Calculation of the fission distribution.
0309    */
0310   void fissionDistri(G4double &a, G4double &z, G4double &e, G4double &a1,
0311                      G4double &z1, G4double &e1, G4double &v1, G4double &a2,
0312                      G4double &z2, G4double &e2, G4double &v2,
0313                      G4double &vx_eva_sc, G4double &vy_eva_sc,
0314                      G4double &vz_eva_sc, G4int *NbLam0_par);
0315 
0316   /**
0317    * Calculation of even-odd effects in fission.
0318    */
0319   void even_odd(G4double r_origin, G4double r_even_odd, G4int &i_out);
0320 
0321   /**
0322    * Functions for the fission model.
0323    */
0324   G4double umass(G4double z, G4double n, G4double beta);
0325   G4double ecoul(G4double z1, G4double n1, G4double beta1, G4double z2,
0326                  G4double n2, G4double beta2, G4double d);
0327   G4double Uwash(G4double E, G4double Ecrit, G4double Freduction,
0328                  G4double gamma);
0329   G4double frldm(G4double z, G4double n, G4double beta);
0330   G4double eflmac_profi(G4double a, G4double z);
0331   G4double gausshaz(G4int k, G4double xmoy, G4double sig);
0332   G4double haz(G4int k);
0333 
0334   /**
0335    * Level density parameters.
0336    */
0337   void densniv(G4double a, G4double z, G4double ee, G4double ef, G4double *dens,
0338                G4double bshell, G4double bs, G4double bk, G4double *temp,
0339                G4int optshp, G4int optcol, G4double defbet, G4double *ecor,
0340                G4double jprf, G4int ifis, G4double *qr);
0341 
0342   /**
0343    * Calculation of the fission probability modified by transient time effects.
0344    */
0345   void part_fiss(G4double BET, G4double GP, G4double GF, G4double Y,
0346                  G4double TAUF, G4double TS1, G4double TSUM, G4int *CHOICE,
0347                  G4double ZF, G4double AF, G4double FT, G4double *T_LAPSE,
0348                  G4double *GF_LOC);
0349 
0350   G4double func_trans(G4double TIME, G4double ZF, G4double AF, G4double BET,
0351                       G4double Y, G4double FT, G4double T_0);
0352 
0353   /**
0354    * This subroutine calculates the ordinary legendre polynomials of
0355    * order 0 to n-1 of argument x and stores them in the vector pl.
0356    * They are calculated by recursion relation from the first two
0357    * polynomials.
0358    * Written by A.J.Sierk  LANL  t-9  February, 1984
0359    */
0360   void lpoly(G4double x, G4int n, G4double pl[]);
0361 
0362   /**
0363    * This function will calculate the liquid-drop nuclear mass for spheri
0364    * configuration according to the preprint NUCLEAR GROUND-STATE
0365    * MASSES and DEFORMATIONS by P. Mo"ller et al. from August 16, 1993 p.
0366    * All constants are taken from this publication for consistency.
0367    */
0368   G4double eflmac(G4int ia, G4int iz, G4int flag, G4int optshp);
0369 
0370   /**
0371    * Procedure for calculating the pairing correction to the binding
0372    * energy of a specific nucleus.
0373    */
0374   void appariem(G4double a, G4double z, G4double *del);
0375 
0376   /**
0377    * PROCEDURE FOR CALCULATING THE PARITY OF THE NUMBER N.
0378    * RETURNS -1 IF N IS ODD AND +1 IF N IS EVEN
0379    */
0380   void parite(G4double n, G4double *par);
0381 
0382   /**
0383    * RISE TIME IN WHICH THE FISSION WIDTH HAS REACHED
0384    * 90 PERCENT OF ITS FINAL VALUE
0385    */
0386   G4double tau(G4double bet, G4double homega, G4double ef, G4double t);
0387 
0388   /**
0389    * KRAMERS FAKTOR  - REDUCTION OF THE FISSION PROBABILITY
0390    * INDEPENDENT OF EXCITATION ENERGY
0391    */
0392   G4double cram(G4double bet, G4double homega);
0393 
0394   /**
0395    * CALCULATION OF THE SURFACE BS OR CURVATURE BK OF A NUCLEUS
0396    * RELATIVE TO THE SPHERICAL CONFIGURATION
0397    * BASED ON  MYERS, DROPLET MODEL FOR ARBITRARY SHAPES
0398    */
0399   G4double bipol(G4int iflag, G4double y);
0400 
0401   /**
0402    * THIS SUBROUTINE RETURNS THE BARRIER HEIGHT BFIS, THE
0403    * GROUND-STATE ENERGY SEGS, IN MEV, AND THE ANGULAR MOMENTUM
0404    * AT WHICH THE FISSION BARRIER DISAPPEARS, LMAX, IN UNITS OF
0405    * H-BAR, WHEN CALLED WITH INTEGER AGUMENTS IZ, THE ATOMIC
0406    * NUMBER, IA, THE ATOMIC MASS NUMBER, AND IL, THE ANGULAR
0407    * MOMENTUM IN UNITS OF H-BAR. (PLANCK'S CONSTANT DIVIDED BY
0408    * 2*PI).
0409    */
0410   void barfit(G4int iz, G4int ia, G4int il, G4double *sbfis, G4double *segs,
0411               G4double *selmax);
0412 
0413   /**
0414    * Calculation of decay widths for light particles.
0415    */
0416   G4double width(G4double AMOTHER, G4double ZMOTHER, G4double APART,
0417                  G4double ZPART, G4double TEMP, G4double B1, G4double SB1,
0418                  G4double EXC);
0419 
0420   /**
0421    * Calculation of penetration factors for light charged particles.
0422    */
0423   G4double pen(G4double A, G4double ap, G4double omega, G4double T);
0424 
0425   /**
0426    * Calculation of mean value of orbital angular momentum.
0427    */
0428   void lorb(G4double AMOTHER, G4double ADAUGHTER, G4double LMOTHER,
0429             G4double EEFINAL, G4double *LORBITAL, G4double *SIGMA_LORBITAL);
0430 
0431   /**
0432    * Calculation of BS and BK for the nuclear-level density.
0433    */
0434   void bsbkbc(G4double A, G4double Z, G4double *BS, G4double *BK, G4double *BC);
0435 
0436   /**
0437    * Special functions used for the emission of particles.
0438    */
0439   G4double erf(G4double x);
0440 
0441   G4double gammp(G4double a, G4double x);
0442 
0443   void gcf(G4double *gammcf, G4double a, G4double x, G4double gln);
0444 
0445   void gser(G4double *gamser, G4double a, G4double x, G4double gln);
0446 
0447   G4double fvmaxhaz(G4double T);
0448 
0449   G4double fvmaxhaz_neut(G4double x);
0450 
0451   /**
0452    * Random numbers.
0453    */
0454   void standardRandom(G4double *rndm, G4long *seed);
0455 
0456   /**
0457    * LOGARITHM OF THE GAMM FUNCTION
0458    */
0459   G4double gammln(G4double xx);
0460 
0461   /**
0462    * DISTRIBUTION DE MAXWELL
0463    */
0464   G4double fd(G4double E);
0465 
0466   /**
0467    *FONCTION INTEGRALE DE FD(E)
0468    */
0469   G4double f(G4double E);
0470 
0471   /**
0472    * tirage aleatoire dans une maxwellienne
0473    */
0474   G4double fmaxhaz(G4double T);
0475 
0476   /**
0477    * tirage aleatoire dans une maxwellienne
0478    */
0479   G4double fmaxhaz_old(G4double T);
0480 
0481   /**
0482    * Random generator according to the
0483      powerfunction y = x**(lambda) in the range from xmin to xmax
0484    */
0485   G4int IPOWERLIMHAZ(G4double lambda, G4int xmin, G4int xmax);
0486 
0487   /**
0488    *
0489    */
0490   void guet(G4double *x_par, G4double *z_par, G4double *find_par);
0491 
0492   /**
0493    * Limits of existing nuclei
0494    */
0495   void isostab_lim(G4int z, G4int *nmin, G4int *nmax);
0496 
0497   /**
0498    * Fill the data array for INCL
0499    */
0500   void FillData(G4int IMULTBU, G4int IEV_TAB);
0501 
0502   /**
0503    * Separation energies of lambda
0504    */
0505   G4double gethyperseparation(G4double A, G4double Z, G4int ny);
0506 
0507   /**
0508    * Separation energies of for other particles for hypernuclei
0509    */
0510   G4double getdeltabinding(G4double a, G4int nblamb);
0511   G4double gethyperbinding(G4double A, G4double Z, G4int ny);
0512 
0513 public:
0514   // Utils
0515   G4int min(G4int a, G4int b);
0516   G4double min(G4double a, G4double b);
0517   G4int max(G4int a, G4int b);
0518   G4double max(G4double a, G4double b);
0519   G4double DSIGN(G4double a, G4double b);
0520   G4int ISIGN(G4int a, G4int b);
0521   G4int nint(G4double number);
0522   G4int secnds(G4int x);
0523   G4int mod(G4int a, G4int b);
0524   G4double dmod(G4double a, G4double b);
0525   G4double dint(G4double a);
0526   G4int idint(G4double a);
0527   G4int idnint(G4double value);
0528   G4double utilabs(G4double a);
0529   G4double dmin1(G4double a, G4double b, G4double c);
0530 
0531 private:
0532   G4int verboseLevel;
0533   G4int ilast;
0534   G4double T_freeze_out_in;
0535   G4int IEV_TAB_SSC;
0536   G4double BU_TAB[indexpart][12], EV_TAB[indexpart][6], EV_TAB_SSC[indexpart][6];
0537   G4int gammaemission;
0538   G4double T_freeze_out;
0539   std::unique_ptr<G4Ald> ald;
0540   std::unique_ptr<G4Ec2sub> ec2sub;
0541   std::unique_ptr<G4Ecld> ecld;
0542   std::unique_ptr<G4Mexp> masses;
0543   std::unique_ptr<G4Fb> fb;
0544   std::unique_ptr<G4Fiss> fiss;
0545   std::unique_ptr<G4Opt> opt;
0546   G4VarNtp *varntp;
0547   G4int Ainit, Zinit, Sinit;
0548 };