Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:51

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, GSI (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 #define ABLAXX_IN_GEANT4_MODE 1
0034 
0035 #include "globals.hh"
0036 
0037 // Data structures needed by ABLA evaporation code.
0038 
0039 #ifndef G4AblaDataDefs_hh
0040 #define G4AblaDataDefs_hh 1
0041 
0042 #ifdef ABLAXX_IN_GEANT4_MODE
0043 #include "globals.hh"
0044 #else
0045 #include "G4INCLGeant4Compat.hh"
0046 #endif
0047 
0048 #include <cmath>
0049 
0050 // ABLA
0051 
0052 class G4Nevent {
0053 public:
0054   G4Nevent() {};
0055   ~G4Nevent() {};
0056   
0057   G4int ii;
0058 };
0059 
0060 // ABLA
0061 #define PACESIZEROWS 500
0062 #define PACESIZECOLS 500
0063 /**
0064  * Masses.
0065  */
0066 
0067 class G4Pace {
0068 
0069 public:
0070   G4Pace() {};
0071 
0072   ~G4Pace() {};
0073   
0074   G4double dm[PACESIZEROWS][PACESIZECOLS];
0075 };
0076 
0077 #define MASSIZEROWS 154
0078 #define MASSIZECOLS 13
0079 
0080 class G4Mexp {
0081 
0082 public:
0083   G4Mexp() {};
0084 
0085   ~G4Mexp() {};
0086   
0087   G4double massexp[MASSIZEROWS][MASSIZECOLS];
0088   G4double bind[MASSIZEROWS][MASSIZECOLS];
0089   G4int mexpiop[MASSIZEROWS][MASSIZECOLS];
0090 };
0091 
0092 #define EC2SUBROWS 154
0093 #define EC2SUBCOLS 99
0094   /**
0095    *
0096    */
0097 
0098 class G4Ec2sub {
0099 public:
0100   G4Ec2sub() {};
0101 
0102   ~G4Ec2sub() {};
0103 
0104   G4double ecnz[EC2SUBROWS][EC2SUBCOLS]; 
0105 
0106   /**
0107    * Dump the contents of the ecnz data table.
0108    */
0109   void dump() {
0110     for(G4int i = 0; i < EC2SUBROWS; i++) {
0111       for(G4int j = 0; j < EC2SUBCOLS; j++) {
0112     //G4cout << ecnz[i][j] << " ";
0113       }
0114       //      G4cout << G4endl;
0115     }
0116   }
0117 };
0118 
0119 class G4Ald {
0120 public:
0121   /**
0122    * 
0123    */
0124   G4Ald()
0125     :av(0.0), as(0.0), ak(0.0), optafan(0.0)
0126   {};
0127   ~G4Ald() {};
0128   
0129   G4double av,as,ak,optafan;
0130 };
0131 
0132 #define ECLDROWS 154
0133 #define ECLDCOLS 99
0134 
0135 #define ECLDROWSbeta 251
0136 #define ECLDCOLSbeta 137
0137 /**
0138  * Shell corrections and deformations.
0139  */
0140 
0141 class G4Ecld {
0142 
0143 public:
0144   G4Ecld() {};
0145   ~G4Ecld() {};
0146 
0147   /**
0148    * Ground state shell correction frldm for a spherical ground state.
0149    */
0150   G4double ecgnz[ECLDROWS][ECLDCOLS];
0151 
0152   /**
0153    * Shell correction for the saddle point (now: == 0).
0154    */
0155   G4double ecfnz[ECLDROWS][ECLDCOLS];
0156 
0157   /**
0158    * Difference between deformed ground state and ldm value.
0159    */
0160   G4double vgsld[ECLDROWS][ECLDCOLS]; 
0161 
0162   /**
0163    * Alpha ground state deformation (this is not beta2!)       
0164    * beta2 = std::sqrt(5/(4pi)) * alpha 
0165    */
0166   G4double alpha[ECLDROWS][ECLDCOLS];
0167 
0168   /**
0169    * RMS function for lcp emission barriers
0170    */
0171   G4double rms[ECLDROWS][ECLDCOLS];
0172 
0173   /**
0174    * Beta2 deformations
0175    */
0176   G4double beta2[ECLDROWSbeta][ECLDCOLSbeta];
0177 
0178   /**
0179    * Beta4 deformations
0180    */
0181   G4double beta4[ECLDROWSbeta][ECLDCOLSbeta];
0182 };
0183 
0184 class G4Fiss {
0185   /**
0186    * Options and parameters for fission channel.
0187    */
0188 
0189 public:
0190   G4Fiss()
0191     :bet(0.0), ifis(0.0), ucr(0.0), dcr(0.0), optshp(0), optxfis(0), optct(0), optcol(0), 
0192      at(0), zt(0)
0193   {};
0194   ~G4Fiss() {};
0195   
0196   G4double bet,ifis,ucr,dcr;
0197   G4int optshp, optxfis,optct,optcol,at,zt;
0198 };
0199 
0200 #define FBROWS 101
0201 #define FBCOLS 161
0202 /**
0203  * Fission barriers.
0204  */
0205  
0206 class G4Fb {
0207   
0208 public:
0209   G4Fb() {};
0210   ~G4Fb() {;}
0211   
0212   //  G4double efa[FBROWS][FBCOLS];
0213   G4double efa[FBCOLS][FBROWS];
0214 };
0215 
0216 /**
0217  * Options
0218  */
0219 
0220 class G4Opt {
0221 
0222 public:
0223   G4Opt()
0224     :optemd(0), optcha(0), optshpimf(0), optimfallowed(0), nblan0(0)
0225   {};
0226   ~G4Opt() {};
0227   
0228   G4int optemd,optcha,optshpimf,optimfallowed,nblan0;                                 
0229 };
0230 
0231 #define EENUCSIZE 2002
0232 #define XHESIZE 50
0233 class G4Eenuc {
0234 public:
0235   G4Eenuc() {
0236     for(G4int i = 0; i < EENUCSIZE; ++i) {
0237       she[i] = 0.0;
0238     }
0239     for(G4int i = 0; i < XHESIZE; ++i) {
0240       for(G4int j = 0; j < EENUCSIZE; ++j) {
0241     xhe[i][j] = 0.0;
0242       }
0243     }
0244   };
0245   ~G4Eenuc() {};
0246   
0247   G4double she[EENUCSIZE],xhe[XHESIZE][EENUCSIZE];                                            
0248 };
0249 
0250 //#define VOLANTSIZE 200
0251 #define VOLANTSIZE 301
0252 /**
0253  * Evaporation and fission output data.
0254  */
0255 
0256 class G4Volant {
0257   
0258 public:
0259   G4Volant()
0260   {
0261     clear();
0262   }
0263 
0264   ~G4Volant() {};
0265 
0266   void clear()
0267   {
0268     for(G4int i = 0; i < VOLANTSIZE; i++) {
0269       copied[i] = false;
0270       acv[i] = 0;
0271       zpcv[i] = 0;
0272       pcv[i] = 0;
0273       xcv[i] = 0;
0274       ycv[i] = 0;
0275       zcv[i] = 0;
0276       iv = 0;
0277     }
0278   }
0279 
0280   G4double getTotalMass()
0281   {
0282     G4double total = 0.0;
0283     for(G4int i = 0; i <= iv; i++) {
0284       total += acv[i];
0285     }
0286     return total;
0287   }
0288 
0289   void dump()
0290   {
0291 /*
0292     G4double totA = 0.0, totZ = 0.0, totP = 0.0;
0293     //    G4cout <<"i \t ACV \t ZPCV \t PCV" << G4endl; 
0294     for(G4int i = 0; i <= iv; i++) {
0295       if(i == 0 && acv[i] != 0) {
0296     //  G4cout <<"G4Volant: Particle stored at index " << i << G4endl;
0297       }
0298       totA += acv[i];
0299       totZ += zpcv[i];
0300       totP += pcv[i];
0301       //      G4cout << "volant" << i << "\t" << acv[i] << " \t " << zpcv[i] << " \t " << pcv[i] << G4endl;
0302     }
0303     //    G4cout <<"Particle count index (iv) = " << iv << G4endl;
0304     //    G4cout <<"ABLA Total: A = " << totA << " Z = " << totZ <<  " momentum = " << totP << G4endl;
0305 */
0306   }
0307 
0308   G4double acv[VOLANTSIZE],zpcv[VOLANTSIZE],pcv[VOLANTSIZE],xcv[VOLANTSIZE];
0309   G4double ycv[VOLANTSIZE],zcv[VOLANTSIZE];
0310   G4bool copied[VOLANTSIZE];
0311   G4int iv; 
0312 };
0313 
0314 #define VARNTPSIZE 301
0315 class G4VarNtp {
0316 public:
0317   G4VarNtp() {
0318     clear();
0319   };
0320 
0321   ~G4VarNtp() {};
0322 
0323   /**
0324    * Clear and initialize all variables and arrays.
0325    */
0326   void clear() {
0327     particleIndex = 0;
0328     projType = 0;
0329     projEnergy = 0.0;
0330     targetA = 0;
0331     targetZ = 0;
0332     masp = 0.0; mzsp = 0.0; exsp = 0.0; mrem = 0.0;
0333     // To be deleted?
0334     spectatorA = 0;
0335     spectatorZ = 0;
0336     spectatorEx = 0.0;
0337     spectatorM = 0.0;
0338     spectatorT = 0.0;
0339     spectatorP1 = 0.0;
0340     spectatorP2 = 0.0;
0341     spectatorP3 = 0.0;
0342     massini = 0;
0343     mzini = 0;
0344     exini = 0;
0345     pcorem = 0;
0346     mcorem = 0;
0347     pxrem = 0;
0348     pyrem = 0;
0349     pzrem = 0;
0350     erecrem = 0;
0351     mulncasc = 0;
0352     mulnevap = 0;
0353     mulntot = 0;
0354     bimpact = 0.0;
0355     jremn = 0;
0356     kfis = 0;
0357     estfis = 0;
0358     izfis = 0;
0359     iafis = 0;
0360     ntrack = 0;
0361     needsFermiBreakup = false;
0362     for(G4int i = 0; i < VARNTPSIZE; i++) {
0363       itypcasc[i] = 0;
0364       avv[i] = 0;
0365       zvv[i] = 0;
0366       svv[i] = 0;
0367       enerj[i] = 0.0;
0368       pxlab[i] = 0.0;
0369       pylab[i] = 0.0;
0370       pzlab[i] = 0.0;
0371       full[i] = false;
0372     }
0373   }
0374 
0375   /**
0376    * Add a particle to the INCL/ABLA final output.
0377    */
0378   void addParticle(G4double A, G4double Z, G4double E, G4double P, G4double theta, G4double phi) {
0379     if(full[particleIndex]) {
0380       //      G4cout <<"A = " << Z << " Z = " << Z << G4endl;
0381     } else {
0382       avv[particleIndex] = (int) A;
0383       zvv[particleIndex] = (int) Z;
0384       enerj[particleIndex] = E;
0385       plab[particleIndex] = P;
0386       tetlab[particleIndex] = theta;
0387       philab[particleIndex] = phi;
0388       full[particleIndex] = true;
0389       ntrack = particleIndex + 1;
0390       particleIndex++;
0391     }
0392   }
0393 
0394   /**
0395    * Baryon number conservation check.
0396    */
0397   G4int getTotalBaryonNumber() {
0398     G4int baryonNumber = 0;
0399     for(G4int i = 0; i < ntrack; i++) {
0400       if(avv[i] > 0) {
0401     baryonNumber += avv[i];
0402       }
0403     }
0404     return baryonNumber;
0405   }
0406 
0407   /**
0408    * Return total energy.
0409    */
0410   G4double getTotalEnergy() {
0411     G4double energy = 0.0;
0412     for(G4int i = 0; i < ntrack; i++) {
0413       energy += std::sqrt(std::pow(plab[i], 2) + std::pow(getMass(i), 2)); // E^2 = p^2 + m^2
0414     }
0415 
0416     return energy;
0417   }
0418 
0419   /**
0420    * Return total three momentum.
0421    */
0422   G4double getTotalThreeMomentum() {
0423     G4double momentum = 0;
0424     for(G4int i = 0; i < ntrack; i++) {
0425       momentum += plab[i];
0426     }
0427     return momentum;
0428   }
0429 
0430   G4double getMomentumSum() {
0431     G4double momentum = 0;
0432     for(G4int i = 0; i < ntrack; i++) {
0433       momentum += plab[i];
0434     }
0435     return momentum;
0436   }
0437 
0438   G4double getMass(G4int particle) {
0439     const G4double protonMass = 938.272;
0440     const G4double neutronMass = 939.565;
0441     const G4double pionMass = 139.57;
0442 
0443     G4double mass = 0.0;
0444     if(avv[particle] ==  1 && zvv[particle] ==  1) mass = protonMass;
0445     if(avv[particle] ==  1 && zvv[particle] ==  0) mass = neutronMass;
0446     if(avv[particle] == -1)                        mass = pionMass;
0447     if(avv[particle] > 1)
0448       mass = avv[particle] * protonMass + zvv[particle] * neutronMass;
0449     return mass;
0450   }
0451 
0452   /**
0453    * Dump debugging output.
0454    */
0455   void dump()
0456   {
0457 /*
0458     G4int nProton = 0, nNeutron = 0;
0459     G4int nPiPlus = 0, nPiZero = 0, nPiMinus = 0;
0460     G4int nH2 = 0, nHe3 = 0, nAlpha = 0;
0461     G4int nGamma=0;
0462     G4int nFragments = 0;
0463     G4int nParticles = 0;
0464     for(G4int i = 0; i < ntrack; i++) {
0465       nParticles++;
0466       if(avv[i] ==  1 && zvv[i] ==  1) nProton++;  // Count multiplicities
0467       if(avv[i] ==  1 && zvv[i] ==  0) nNeutron++;
0468       if(avv[i] ==  0 && zvv[i] ==  0) nGamma++;
0469       if(avv[i] == -1 && zvv[i] ==  1) nPiPlus++;
0470       if(avv[i] == -1 && zvv[i] ==  0) nPiZero++;
0471       if(avv[i] == -1 && zvv[i] == -1) nPiMinus++;
0472       if(avv[i] ==  2 && zvv[i] ==  1) nH2++;
0473       if(avv[i] ==  3 && zvv[i] ==  2) nHe3++;
0474       if(avv[i] ==  4 && zvv[i] ==  2) nAlpha++;
0475       if(                zvv[i] >   2) nFragments++;
0476     }
0477 */
0478   }
0479 
0480   /**
0481    * Projectile type.
0482    */
0483   G4int projType;
0484 
0485   /**
0486    * Projectile energy.
0487    */
0488   G4double projEnergy;
0489 
0490   /**
0491    * Target mass number.
0492    */
0493   G4int targetA;
0494 
0495   /**
0496    * Target charge number.
0497    */
0498   G4int targetZ;
0499 
0500   /**
0501    * Projectile spectator A, Z, Eex;
0502    */
0503   G4double masp, mzsp, exsp, mrem;
0504 
0505   /**
0506    * Spectator nucleus mass number for light ion projectile support.
0507    */
0508   G4int spectatorA;
0509 
0510   /**
0511    * Spectator nucleus charge number for light ion projectile support.
0512    */
0513   G4int spectatorZ;
0514 
0515   /**
0516    * Spectator nucleus excitation energy for light ion projectile support.
0517    */
0518   G4double spectatorEx;
0519 
0520   /**
0521    * Spectator nucleus mass.
0522    */
0523   G4double spectatorM;
0524 
0525   /**
0526    * Spectator nucleus kinetic energy.
0527    */
0528   G4double spectatorT;
0529 
0530   /**
0531    * Spectator nucleus momentum x-component.
0532    */
0533   G4double spectatorP1;
0534 
0535   /**
0536    * Spectator nucleus momentum y-component.
0537    */
0538   G4double spectatorP2;
0539 
0540   /**
0541    * Spectator nucleus momentum z-component.
0542    */
0543   G4double spectatorP3;
0544 
0545   /**
0546    * A of the remnant.
0547    */
0548   G4double massini;
0549 
0550   /**
0551    * Z of the remnant.
0552    */
0553   G4double mzini;
0554 
0555   /**
0556    * Excitation energy.
0557    */
0558   G4double exini;
0559 
0560   G4double pcorem, mcorem, pxrem, pyrem, pzrem, erecrem;
0561 
0562   /**
0563    * Cascade n multip.
0564    */
0565   G4int mulncasc;
0566 
0567   /**
0568    * Evaporation n multip.
0569    */
0570   G4int mulnevap;
0571 
0572   /**
0573    * Total n multip.
0574    */
0575   G4int mulntot;
0576 
0577   /**
0578    * Impact parameter.
0579    */
0580   G4double bimpact;
0581 
0582   /**
0583    * Remnant Intrinsic Spin.
0584    */
0585   G4int jremn;
0586 
0587   /**
0588    * Fission 1/0=Y/N.
0589    */
0590   G4int kfis;
0591 
0592   /**
0593    * Excit energy at fis.
0594    */
0595   G4double estfis;
0596 
0597   /**
0598    * Z of fiss nucleus.
0599    */
0600   G4int izfis;
0601 
0602   /**
0603    * A of fiss nucleus.
0604    */
0605   G4int iafis;
0606 
0607   /**
0608    * Number of particles.
0609    */
0610   G4int ntrack;
0611 
0612   /**
0613    * The state of the index:
0614    * true = reserved
0615    * false = free
0616    */
0617   G4bool full[VARNTPSIZE];
0618 
0619   /**
0620    * Does this nucleus require Fermi break-up treatment? Only
0621    * applicable when used together with Geant4.
0622    * true = do fermi break-up (and skip ABLA part)
0623    * false = use ABLA
0624    */
0625   G4bool needsFermiBreakup;
0626 
0627   /**
0628    * emitted in cascade (0) or evaporation (1).
0629    */
0630   G4int itypcasc[VARNTPSIZE];
0631 
0632   
0633   /**
0634    * A (-1 for pions).
0635    */
0636   G4int avv[VARNTPSIZE];
0637 
0638   /**
0639    * Z
0640    */
0641   G4int zvv[VARNTPSIZE];
0642 
0643   /**
0644    * S (-1 for lambda_0).
0645    */
0646   G4int svv[VARNTPSIZE];
0647 
0648   /**
0649    * Kinetic energy.
0650    */
0651   G4double enerj[VARNTPSIZE];
0652 
0653   /**
0654    * Momentum.
0655    */
0656   G4double plab[VARNTPSIZE];
0657   G4double pxlab[VARNTPSIZE];
0658   G4double pylab[VARNTPSIZE];
0659   G4double pzlab[VARNTPSIZE];
0660 
0661   /**
0662    * Theta angle.
0663    */
0664   G4double tetlab[VARNTPSIZE];
0665 
0666   /**
0667    * Phi angle.
0668    */
0669   G4double philab[VARNTPSIZE];
0670 
0671 private:
0672   G4int particleIndex;
0673 };
0674 
0675 #endif