Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 header file
|
||||
//
|
||||
// File name: G4NuDEXNeutronCaptureModel
|
||||
//
|
||||
// Author: E.Mendoza & A.Ribon
|
||||
//
|
||||
// Creation date: 29 May 2024
|
||||
//
|
||||
// Description: This class (a proxy of the class G4NuDEX) uses
|
||||
// the NuDEX model to produce gammas and internal
|
||||
// conversion electrons from neutron capture.
|
||||
// Whenever NuDEX is not applicable, G4PhotonEvaporation
|
||||
// is used.
|
||||
// The implementation of this class follows the code
|
||||
// of the class G4NeutronRadCapture.
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Class to use NuDEX model inside Geant4
|
||||
//
|
||||
|
||||
#ifndef G4NUDEXNEUTRONCAPTUREMODEL_HH
|
||||
#define G4NUDEXNEUTRONCAPTUREMODEL_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4HadronicInteraction.hh"
|
||||
#include "G4HadProjectile.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
|
||||
class G4NuDEXStatisticalNucleus;
|
||||
class G4VEvaporationChannel;
|
||||
|
||||
|
||||
#define G4NUDEX_MAXZA 120000
|
||||
|
||||
|
||||
class G4NuDEXNeutronCaptureModel : public G4HadronicInteraction {
|
||||
public:
|
||||
explicit G4NuDEXNeutronCaptureModel();
|
||||
virtual ~G4NuDEXNeutronCaptureModel();
|
||||
|
||||
virtual G4HadFinalState* ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus ) final;
|
||||
virtual void InitialiseModel() final;
|
||||
|
||||
private:
|
||||
G4NuDEXNeutronCaptureModel & operator=( const G4NuDEXNeutronCaptureModel &right ) = delete;
|
||||
G4NuDEXNeutronCaptureModel( const G4NuDEXNeutronCaptureModel& ) = delete;
|
||||
|
||||
G4int GenerateNeutronCaptureCascade( G4int theZ, G4int theA, G4double NeutronEnergy, G4int InitialLevel,
|
||||
std::vector< char >& pType, std::vector< G4double >& pEnergy, std::vector< G4double >& pTime );
|
||||
|
||||
// Initial level for neutron capture. If jspinx2v < 0 it is sampled according to the 2J+1 rule
|
||||
// l-spin = 0, 1, 2 --> s-wave, p-wave, d-wave ...
|
||||
G4int SelectInitialLevel( G4int theCompoundZ, G4int theCompoundA, G4double NeutronEnergy, G4int lspin, G4int jspinx2 );
|
||||
G4int SampleJ( G4int theCompoundZ, G4int theCompoundA, G4int lspin );
|
||||
G4int GetAllowedJx2values( G4int theCompoundZ, G4int theCompoundA, G4int lspin, G4int* jx2vals );
|
||||
|
||||
const G4NuDEXStatisticalNucleus* GetStatisticalNucleus( G4int za ) { return theStatisticalNucleus[za]; }
|
||||
G4int Init( G4int theZA, unsigned int seed1 = 0, unsigned int seed2 = 0, unsigned int seed3 = 0 );
|
||||
void SetBandWidth( G4double bandWidth ) { BandWidth = bandWidth; }
|
||||
void SetBrOption( G4int brOption ) { BrOption = brOption; }
|
||||
|
||||
G4NuDEXStatisticalNucleus* theStatisticalNucleus[G4NUDEX_MAXZA];
|
||||
G4int HasData[G4NUDEX_MAXZA]; // -1:no; 0:don't know; 1:yes
|
||||
G4String NuDEXLibDirectory;
|
||||
G4int BrOption;
|
||||
G4double BandWidth;
|
||||
|
||||
G4int secID; // creator model ID for the other secondaries produced by this model
|
||||
G4double lowestEnergyLimit;
|
||||
G4double minExcitation;
|
||||
G4VEvaporationChannel* photonEvaporation; // Needed when NuDEX is not applicable
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Author: E.Mendoza
|
||||
//
|
||||
// Creation date: May 2024
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// NuDEX code (https://doi.org/10.1016/j.nima.2022.167894)
|
||||
//
|
||||
|
||||
|
||||
#ifndef NUDEXINTERNALCONVERSION_HH
|
||||
#define NUDEXINTERNALCONVERSION_HH 1
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "G4NuDEXRandom.hh"
|
||||
|
||||
#define ICC_MAXNSHELLS 40
|
||||
#define ICC_NMULTIP 5
|
||||
#define MINZINTABLES 10 //below this value, the alpha is always 0
|
||||
|
||||
/*
|
||||
Class to manage the internal conversion factors and the generation of converted-e-
|
||||
Still not included the fluorescence-auger effects, i.e., what happens with the hole
|
||||
We read the occ factors from a file, and they are stored in a matrix
|
||||
The total Icc are in index=0 (data from the libraries) and index=NShells (sum of the partials)
|
||||
Data are taken from: https://doi.org/10.1006/adnd.2002.0884
|
||||
*/
|
||||
|
||||
class G4NuDEXInternalConversion{
|
||||
|
||||
public:
|
||||
G4NuDEXInternalConversion(G4int Z);
|
||||
~G4NuDEXInternalConversion();
|
||||
void Init(const char* fname);
|
||||
void PrintICC(std::ostream &out);
|
||||
G4double GetICC(G4double Ene,G4int multipolarity,G4int i_shell=-1);
|
||||
G4bool SampleInternalConversion(G4double Ene,G4int multipolarity,G4double alpha=-1,G4bool CalculateProducts=true);
|
||||
void FillElectronHole(G4int i_shell); //Fluorescence/auger
|
||||
void SetRandom4Seed(unsigned int seed){theRandom4->SetSeed(seed);}
|
||||
|
||||
|
||||
private:
|
||||
G4double Interpolate(G4double val,G4int npoints,G4double* x,G4double* y);
|
||||
void MakeTotal();
|
||||
|
||||
|
||||
private:
|
||||
G4int theZ,NShells;
|
||||
G4double BindingEnergy[ICC_MAXNSHELLS];
|
||||
G4double *Eg[ICC_MAXNSHELLS],*Icc_E[ICC_NMULTIP][ICC_MAXNSHELLS],*Icc_M[ICC_NMULTIP][ICC_MAXNSHELLS];
|
||||
G4int np[ICC_MAXNSHELLS];
|
||||
std::string OrbitalName[ICC_MAXNSHELLS];
|
||||
G4NuDEXRandom* theRandom4;
|
||||
|
||||
public:
|
||||
G4int Ne,Ng;
|
||||
G4double Eele[100],Egam[100];
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Author: E.Mendoza
|
||||
//
|
||||
// Creation date: May 2024
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// NuDEX code (https://doi.org/10.1016/j.nima.2022.167894)
|
||||
//
|
||||
|
||||
|
||||
#ifndef NUDEXLEVELDENSITY_HH
|
||||
#define NUDEXLEVELDENSITY_HH 1
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
|
||||
//Level densities as they are defined in the RIPL-3 manual
|
||||
|
||||
//LDTYPE=1,2,3 --> Back-Shifted-Fermi-Gas model, Constant Temperature, Back-shifted: Egidy
|
||||
|
||||
#define DEFAULTLDTYPE 1
|
||||
|
||||
//using namespace std;
|
||||
|
||||
class G4NuDEXLevelDensity{
|
||||
|
||||
public:
|
||||
G4NuDEXLevelDensity(G4int aZ,G4int aA,G4int ldtype=DEFAULTLDTYPE);
|
||||
~G4NuDEXLevelDensity(){}
|
||||
|
||||
|
||||
G4int ReadLDParameters(const char* dirname,const char* inputfname=0,const char* defaultinputfname=0);
|
||||
G4int CalculateLDParameters_BSFG(const char* dirname);
|
||||
G4int SearchLDParametersInInputFile(const char* inputfname);
|
||||
void GetSnD0I0Vals(G4double &aSn,G4double &aD0,G4double &aI0){aSn=Sn; aD0=D0; aI0=I0;}
|
||||
|
||||
G4int GetLDType(){return LDType;}
|
||||
G4double GetNucleusTemperature(G4double ExcEnergy);
|
||||
G4double GetLevelDensity(G4double ExcEnergy_MeV,G4double spin,G4bool parity,G4bool TotalLevelDensity=false);
|
||||
G4double EstimateInverse(G4double LevDen_iMeV,G4double spin,G4bool parity); //an approximate value of ExcEnergy(rho), the inverse function of rho(ExcEnergy) - iMeV means 1/MeV
|
||||
G4double Integrate(G4double Emin,G4double Emax,G4double spin,G4bool parity);
|
||||
|
||||
void PrintParameters(std::ostream &out);
|
||||
void PrintParametersInInputFileFormat(std::ostream &out);
|
||||
|
||||
private:
|
||||
|
||||
//General info:
|
||||
G4int A_Int,Z_Int;
|
||||
G4int LDType; //=1,2,3 --> Back-Shifted-Fermi-Gas model, Constant Temperature, Back-shifted: Egidy
|
||||
G4double Sn,D0,I0; //I0 es el del nucleo A-1 (el que captura)
|
||||
G4double Ed;
|
||||
|
||||
G4bool HasData;
|
||||
|
||||
//Level density parameters:
|
||||
G4double A_mass,ainf_ldpar,gamma_ldpar,dW_ldpar,Delta_ldpar,T_ldpar,E0_ldpar,Ex_ldpar;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Author: E.Mendoza
|
||||
//
|
||||
// Creation date: May 2024
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// NuDEX code (https://doi.org/10.1016/j.nima.2022.167894)
|
||||
//
|
||||
|
||||
|
||||
#ifndef NUDEXPSF_HH
|
||||
#define NUDEXPSF_HH 1
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
|
||||
//using namespace std;
|
||||
|
||||
class G4NuDEXLevelDensity;
|
||||
|
||||
/*
|
||||
All energies in MeV
|
||||
PSF are defined as in RIPL-3: PSF=Eg**(-2L-1) x Gamma width x level density
|
||||
JL defines PSF x Eg**(2L+1) instead
|
||||
|
||||
PSFType=0 --> SLO
|
||||
PSFType=1 --> EGLO, as defined in RIPL-3, but using always Tf in the formula
|
||||
PSFType=2 --> SMLO, as defined in RIPL-3
|
||||
PSFType=3 --> GLO (like EGLO, but k1=k2=1)
|
||||
PSFType=4 --> MGLO (like EGLO, but k2=1)
|
||||
PSFType=5 --> KMF
|
||||
PSFType=6 --> GH
|
||||
PSFType=7 --> EGLO, but the k parameter is provided (MEGLO)
|
||||
PSFType=8 --> EGLO, but the "k1" and "k2" parameters are provided (MEGLO)
|
||||
PSFType=9 --> EGLO, but the k parameter and a constant temperature of the nucleus is provided (MEGLO)
|
||||
PSFType=10 --> EGLO, but the "k1" and "k2" parameters and a constant temperature of the nucleus are provided (MEGLO)
|
||||
PSFType=11 --> SMLO, as defined in Eur. Phys. J. A (2019) 55: 172
|
||||
PSFType=20 --> gaussian (to simulate small bumps or resonances)
|
||||
PSFType=21 --> expo --> C*exp(-eta*Eg). It is defined with three entries: C eta dummy
|
||||
PSFType=40 --> pointwise function type 1 (only input file)
|
||||
PSFType=41 --> pointwise function type 2 (only input file)
|
||||
|
||||
Procedure to obtain the PSF, in order of hierarchy:
|
||||
- Get the data from inputfname
|
||||
- Get the data from PSF_param.dat file
|
||||
- Get the data from IAEA-2019 PSF values (if PSFflag==0)
|
||||
- Get the data from RIPL-3 experimental MLO values --> gdr-parameters&errors-exp-MLO.dat
|
||||
- Get the data from RIPL-3 Theorethical values --> gdr-parameters-theor.dat
|
||||
- Use RIPL-3 and RIPL-2 theoretical formulas
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class G4NuDEXPSF{
|
||||
|
||||
public:
|
||||
G4NuDEXPSF(G4int aZ,G4int aA);
|
||||
~G4NuDEXPSF();
|
||||
|
||||
G4int Init(const char* dirname,G4NuDEXLevelDensity* aLD,const char* inputfname=0,const char* defaultinputfname=0,G4int PSFflag=0);
|
||||
G4double GetE1(G4double Eg,G4double ExcitationEnergy);
|
||||
G4double GetM1(G4double Eg,G4double ExcitationEnergy);
|
||||
G4double GetE2(G4double Eg,G4double ExcitationEnergy);
|
||||
void PrintPSFParameters(std::ostream &out);
|
||||
void PrintPSFParametersInInputFileFormat(std::ostream &out);
|
||||
|
||||
private:
|
||||
|
||||
G4bool TakePSFFromInputFile(const char* fname);
|
||||
G4bool TakePSFFromDetailedParFile(const char* fname);
|
||||
G4bool TakePSFFromIAEA01(const char* fname); // IAEA - PSF values 2019
|
||||
G4bool TakePSFFromRIPL01(const char* fname); // RIPL3-MLO values
|
||||
G4bool TakePSFFromRIPL02(const char* fname); // RIPL3-Theorethical values
|
||||
void GenerateM1AndE2FromE1(); // From RIPL-3 and RIPL-2 recommendations
|
||||
|
||||
|
||||
//Shapes:
|
||||
//Typical ones:
|
||||
G4double SLO(G4double Eg,G4double Er,G4double Gr,G4double sr); //PSFType=0
|
||||
G4double EGLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=1
|
||||
G4double SMLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=2
|
||||
G4double GLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=3
|
||||
G4double MGLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=4
|
||||
G4double KMF(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=5
|
||||
G4double GH(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=6
|
||||
G4double MEGLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy,G4double k_param1,G4double k_param2,G4double Temp=-1);//PSFType=6,7,8,9,10
|
||||
G4double SMLO_v2(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy); //PSFType=11
|
||||
|
||||
|
||||
G4double Gauss(G4double Eg,G4double Er,G4double Gr,G4double sr); //PSFType=20
|
||||
G4double Expo(G4double Eg,G4double C,G4double eta); //PSFType=21
|
||||
|
||||
//PSFType=40, PSFType=41 are pointwise defined functions
|
||||
|
||||
//------------------------------
|
||||
G4double EGLO_GLO_MGLO(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double ExcitationEnergy,G4int Opt);
|
||||
G4double FlexibleGLOType(G4double Eg,G4double Er,G4double Gr,G4double sr,G4double Temp1,G4double k_param1,G4double Temp2,G4double k_param2);
|
||||
G4double Gamma_k(G4double Eg,G4double Er,G4double Gr,G4double Temp,G4double k_param);
|
||||
|
||||
private:
|
||||
G4int Z_Int,A_Int;
|
||||
|
||||
G4int nR_E1,nR_M1,nR_E2;
|
||||
G4int PSFType_E1[10], PSFType_M1[10], PSFType_E2[10];
|
||||
G4double E_E1[10],G_E1[10],s_E1[10],p1_E1[10],p2_E1[10],p3_E1[10];
|
||||
G4double E_M1[10],G_M1[10],s_M1[10],p1_M1[10],p2_M1[10],p3_M1[10];
|
||||
G4double E_E2[10],G_E2[10],s_E2[10],p1_E2[10],p2_E2[10],p3_E2[10];
|
||||
|
||||
//-----------------------------------------------
|
||||
//PSF pointwise defined PSF --> PSFType=3,4,6
|
||||
G4int np_E1,np_M1,np_E2;
|
||||
G4double *x_E1,*y_E1;
|
||||
G4double *x_M1,*y_M1;
|
||||
G4double *x_E2,*y_E2;
|
||||
G4double E1_normFac,M1_normFac,E2_normFac;
|
||||
G4double NormEmin,NormEmax;
|
||||
//-----------------------------------------------
|
||||
|
||||
G4double ScaleFactor_E1,ScaleFactor_M1,ScaleFactor_E2;
|
||||
|
||||
G4double EvaluateFunction(G4double xval,G4int np,G4double* x,G4double* y);
|
||||
void Renormalize();
|
||||
|
||||
G4NuDEXLevelDensity* theLD;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Author: E.Mendoza
|
||||
//
|
||||
// Creation date: May 2024
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// NuDEX code (https://doi.org/10.1016/j.nima.2022.167894)
|
||||
//
|
||||
|
||||
|
||||
#ifndef NUDEXRANDOM_HH
|
||||
#define NUDEXRANDOM_HH 1
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
|
||||
//COMPILATIONTYPE==1 compile with ROOT
|
||||
//COMPILATIONTYPE==2 compile with GEANT4
|
||||
|
||||
#define COMPILATIONTYPE 2
|
||||
|
||||
#if COMPILATIONTYPE == 1
|
||||
//------------------------------------------------------------
|
||||
// ROOT
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include "TRandom2.h"
|
||||
#pragma GCC diagnostic pop
|
||||
//------------------------------------------------------------
|
||||
#elif COMPILATIONTYPE == 2
|
||||
//------------------------------------------------------------
|
||||
// GEANT4
|
||||
#include "Randomize.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Exception.hh"
|
||||
//------------------------------------------------------------
|
||||
#else
|
||||
#error Unsupported COMPILATIONTYPE setting
|
||||
#endif
|
||||
|
||||
void NuDEXException(const char* originOfException,const char* exceptionCode,const char* description);
|
||||
|
||||
class G4NuDEXRandom{
|
||||
|
||||
public:
|
||||
G4NuDEXRandom(unsigned int seed);
|
||||
~G4NuDEXRandom();
|
||||
|
||||
public:
|
||||
void SetSeed(unsigned int seed);
|
||||
unsigned int GetSeed();
|
||||
G4double Uniform(G4double Xmin=0,G4double Xmax=1);
|
||||
unsigned int Integer(unsigned int IntegerMax);
|
||||
G4double Exp(G4double tau);
|
||||
G4double Gaus(G4double mean=0,G4double sigma=1);
|
||||
G4long Poisson(G4double mean);
|
||||
|
||||
private:
|
||||
|
||||
#if COMPILATIONTYPE == 1
|
||||
TRandom2* theRandom;
|
||||
#elif COMPILATIONTYPE == 2
|
||||
CLHEP::HepJamesRandom* theEngine;
|
||||
CLHEP::RandFlat* theRandFlat;
|
||||
CLHEP::RandExponential* theRandExponential;
|
||||
CLHEP::RandGauss* theRandGauss;
|
||||
CLHEP::RandPoisson* theRandPoisson;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Author: E.Mendoza
|
||||
//
|
||||
// Creation date: May 2024
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// NuDEX code (https://doi.org/10.1016/j.nima.2022.167894)
|
||||
//
|
||||
|
||||
|
||||
#ifndef NUDEXSTATISTICALNUCLEUS_HH
|
||||
#define NUDEXSTATISTICALNUCLEUS_HH 1
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include "G4NuDEXRandom.hh"
|
||||
|
||||
|
||||
class G4NuDEXLevelDensity;
|
||||
class G4NuDEXInternalConversion;
|
||||
class G4NuDEXPSF;
|
||||
|
||||
|
||||
//This define remains:
|
||||
//#define GENERATEEXPLICITLYALLLEVELSCHEME 1
|
||||
|
||||
//Class to obtain the level density for each excitation energy, spin, and parity
|
||||
//All energies in MeV, all times in s
|
||||
//Some of the class methods could be functions out of the class
|
||||
|
||||
struct Level{
|
||||
G4double Energy;
|
||||
G4int spinx2;
|
||||
G4bool parity; //true/false --> positive,negative
|
||||
unsigned int seed;
|
||||
G4int KnownLevelID;
|
||||
G4int NLevels;
|
||||
G4double Width;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//multipolarity of a transition is ...,-2,-1,0,1,2,... --> ...,M2,M1,Unk,E1,E2,...
|
||||
|
||||
struct KnownLevel{
|
||||
G4int id;
|
||||
G4double Energy;
|
||||
G4int spinx2;
|
||||
G4bool parity; //true/false --> positive,negative
|
||||
G4double T12; //half life - seconds
|
||||
G4int Ndecays;
|
||||
G4double* decayFraction;
|
||||
std::string* decayMode;
|
||||
G4int NGammas;
|
||||
G4int *FinalLevelID,*multipolarity;
|
||||
G4double *Eg,*cumulPtot,*Pg,*Pe,*Icc;
|
||||
};
|
||||
|
||||
|
||||
|
||||
G4int ComparisonLevels(const void* va, const void* vb);
|
||||
void CopyLevel(Level* a,Level* b);
|
||||
void CopyLevel(KnownLevel* a,Level* b);
|
||||
|
||||
|
||||
class G4NuDEXStatisticalNucleus{
|
||||
|
||||
public:
|
||||
G4NuDEXStatisticalNucleus(G4int Z,G4int A);
|
||||
~G4NuDEXStatisticalNucleus();
|
||||
|
||||
public:
|
||||
//Initialize everything. All the required files should be in dirname.
|
||||
//some of the data could also be in inputfname
|
||||
G4int Init(const char* dirname,const char* inputfname=0);
|
||||
|
||||
//If InitialLevel==-1 then we start from the thermal capture level
|
||||
//If ExcitationEnergy>0 then is the excitation energy of the nucleus
|
||||
//If ExcitationEnergy<0 then is a capture reaction of a neutron with energy -ExcitationEnergy (MeV)
|
||||
G4int GenerateCascade(G4int InitialLevel,G4double ExcitationEnergy,std::vector<char>& pType,std::vector<double>& pEnergy,std::vector<double>& pTime);
|
||||
|
||||
G4int GetClosestLevel(G4double Energy,G4int spinx2,G4bool parity); //if spinx2<0, then retrieves the closest level of any spin and parity
|
||||
G4double GetLevelEnergy(G4int i_level);
|
||||
void GetSnAndI0(G4double &sn,G4double &i0){sn=Sn; i0=I0;}
|
||||
Level* GetLevel(G4int i_level);
|
||||
void ChangeLevelSpinParityAndBR(G4int i_level,G4int newspinx2,G4bool newParity,G4int nlevels,G4double width,unsigned int seed=0); //if nlevels or width are negative they don't change. If seed (to generate the BR) is 0 it does not change.
|
||||
void ChangeThermalCaptureLevelBR(G4double LevelEnergy,G4double absoluteIntensity);
|
||||
|
||||
void SetSomeInitalParameters(G4int LDtype=-1,G4int PSFFlag=-1,G4double MaxSpin=-1,G4int minlevelsperband=-1,G4double BandWidth_MeV=0,G4double maxExcEnergy=0,G4int BrOption=-1,G4int sampleGammaWidths=-1,unsigned int aseed1=0,unsigned int aseed2=0,unsigned int aseed3=0);
|
||||
void SetInitialParameters02(G4int knownLevelsFlag=-1,G4int electronConversionFlag=-1,G4double primGamNormFactor=-1,G4double primGamEcut=-1,G4double ecrit=-1);
|
||||
void SetBandWidth(G4double bandWidth){ if(bandWidth==0){bandWidth=-1;} BandWidth=bandWidth;} //So it is not re-written with the lib-params.
|
||||
void SetBrOption(G4int BrOption){BROpt=BrOption;}
|
||||
void SetRandom1Seed(unsigned int seed){theRandom1->SetSeed(seed); Rand1seedProvided=true;}
|
||||
void SetRandom2Seed(unsigned int seed){theRandom2->SetSeed(seed); Rand2seedProvided=true;}
|
||||
void SetRandom3Seed(unsigned int seed){theRandom3->SetSeed(seed); Rand3seedProvided=true;}
|
||||
|
||||
G4NuDEXRandom* GetRandom3(){return theRandom3;}
|
||||
G4bool HasBeenInitialized(){return hasBeenInitialized;}
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
//Print:
|
||||
void PrintAll(std::ostream &out);
|
||||
|
||||
void PrintParameters(std::ostream &out);
|
||||
void PrintKnownLevels(std::ostream &out);
|
||||
void PrintLevelDensity(std::ostream &out);
|
||||
void PrintLevelScheme(std::ostream &out);
|
||||
void PrintThermalPrimaryTransitions(std::ostream &out);
|
||||
void PrintPSF(std::ostream &out);
|
||||
void PrintICC(std::ostream &out);
|
||||
void PrintTotalCumulBR(G4int i_level,std::ostream &out);
|
||||
void PrintBR(G4int i_level,G4double MaxExcEneToPrint_MeV,std::ostream &out);
|
||||
void PrintInput01(std::ostream &out);
|
||||
//----------------
|
||||
void PrintKnownLevelsInDEGENformat(std::ostream &out);
|
||||
void PrintLevelSchemeInDEGENformat(const char* fname,G4int MaxLevelID=-1);
|
||||
//-------------------------------------------------------
|
||||
|
||||
|
||||
private:
|
||||
//-------------------------------------------------------
|
||||
//Used by Init():
|
||||
//Read different data from files (do it in this order). If returnval<0 --> error reading file or nucleus not present in the file:
|
||||
G4int ReadSpecialInputFile(const char* fname);
|
||||
G4int ReadGeneralStatNuclParameters(const char* fname);
|
||||
G4double ReadEcrit(const char* fname);
|
||||
G4double ReadKnownLevels(const char* fname);
|
||||
void CreateLevelScheme();
|
||||
G4int InsertHighEnergyKnownLevels();
|
||||
void ComputeKnownLevelsMissingBR();
|
||||
void MakeSomeParameterChecks01();
|
||||
//-------------------------------------------------------
|
||||
G4double TakeTargetNucleiI0(const char* fname,G4int& check);
|
||||
void CreateThermalCaptureLevel(unsigned int seed=0); //If seed (to generate the BR) is 0 it does not change.
|
||||
void GenerateThermalCaptureLevelBR(const char* dirname);
|
||||
//-------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------
|
||||
//cascade generation:
|
||||
G4double ComputeDecayIntensities(G4int i_level,G4double* cumulativeBR=0,G4double randnumber=-1,G4double TotGR=-1,G4bool AllowE1=false);
|
||||
G4int SampleFinalLevel(G4int i_level,G4int& multipolarity,G4double &icc_fac,G4int nTransition);
|
||||
G4int GetMultipolarity(Level* theInitialLevel,Level* theFinalLevel);
|
||||
//-------------------------------------------------------
|
||||
|
||||
|
||||
private:
|
||||
//-------------------------------------------------------
|
||||
//Used to create the unknown Levels:
|
||||
G4int GenerateLevelsInBigRange(G4double Emin,G4double Emax,G4int spinx2,G4bool parity,Level* someLevels,G4int MaxNLevelsToFill); //salen sin ordenar
|
||||
G4int GenerateLevelsInSmallRange(G4double Emin,G4double Emax,G4int spinx2,G4bool parity,Level* someLevels,G4int MaxNLevelsToFill); //salen sin ordenar
|
||||
G4int GenerateWignerLevels(G4double Emin,G4double Emax,G4int spinx2,G4bool parity,Level* someLevels,G4int MaxNLevelsToFill); //salen ordenados
|
||||
G4int GenerateBandLevels(G4int bandmin,G4int bandmax,G4int spinx2,G4bool parity,Level* someLevels,G4int MaxNLevelsToFill);
|
||||
G4int GenerateAllUnknownLevels(Level* someLevels,G4int MaxNLevelsToFill); //salen ordenados
|
||||
G4int CreateBandsFromLevels(G4int thisNLevels,Level* someLevels,G4int spinx2,G4bool parity);
|
||||
G4int EstimateNumberOfLevelsToFill(); //to estimate the length of "theLevels" vector
|
||||
//-------------------------------------------------------
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//General info:
|
||||
G4int A_Int,Z_Int;
|
||||
G4double Sn,D0,I0; //I0 es el del nucleo A-1 (el que captura)
|
||||
G4bool hasBeenInitialized;
|
||||
std::string theLibDir;
|
||||
|
||||
G4NuDEXRandom* theRandom1; //To generate the unknown level scheme
|
||||
G4NuDEXRandom* theRandom2; //To calculate the Gamma-rho values (i.e. to generate the branching ratios)
|
||||
G4NuDEXRandom* theRandom3; //To generate the cascades
|
||||
unsigned int seed1,seed2,seed3;
|
||||
G4bool Rand1seedProvided,Rand2seedProvided,Rand3seedProvided;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//Parameters which will define how the level scheme will be created:
|
||||
G4double Ecrit; //Energy between the known and unknown levels
|
||||
G4double MaxExcEnergy,BandWidth;
|
||||
G4int maxspinx2,NBands,MinLevelsPerBand; //maximum spin (x2) to consider, number of bands used to "rebin" the stat. part
|
||||
G4int LevelDensityType; //if negative or cero, use the default one.
|
||||
G4int PSFflag; // use IAEA PSF-data (PSFflag==0), use RIPL-3 data (PSFflag==1)
|
||||
G4double E_unk_min,E_unk_max; //min and max energy where the statistical part will be generated
|
||||
G4double Emin_bands,Emax_bands; //limites de energia para calcular las bandas de niveles
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//Level scheme:
|
||||
Level* theLevels; //known+unknown levels
|
||||
KnownLevel* theKnownLevels; // known levels
|
||||
G4int NKnownLevels,NUnknownLevels,NLevels,KnownLevelsVectorSize;
|
||||
Level theThermalCaptureLevel;
|
||||
G4int NLevelsBelowThermalCaptureLevel; //excluding the last one
|
||||
G4int KnownLevelsFlag;
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//Branching ratios:
|
||||
G4int BROpt,SampleGammaWidths;
|
||||
G4double* TotalGammaRho;
|
||||
G4double* theThermalCaptureLevelCumulBR;
|
||||
G4double** TotalCumulBR; //all BR
|
||||
G4double PrimaryGammasIntensityNormFactor;
|
||||
G4double PrimaryGammasEcut; //This variable can be used to avoid generating transitions close to the "Primary Gammas" region
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//LD,ICC, PSF:
|
||||
G4int ElectronConversionFlag;
|
||||
G4NuDEXLevelDensity* theLD;
|
||||
G4NuDEXInternalConversion* theICC;
|
||||
G4NuDEXPSF* thePSF;
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//for internal use, when generating the cascades:
|
||||
G4int theSampledLevel,theSampledMultipolarity;
|
||||
//--------------------------------------------------------------------------
|
||||
};
|
||||
|
||||
//***************************************************************************************************************
|
||||
//***************************************************************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user