Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-20 09:06:57

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