56G4String G4LivermoreGammaConversionModel::gDataDirectory =
"";
62 fParticleChange =
nullptr;
63 lowEnergyLimit = 2. * CLHEP::electron_mass_c2;
69 if (verboseLevel > 0) {
70 G4cout <<
"G4LivermoreGammaConversionModel is constructed " <<
G4endl;
79 for (
G4int i = 0; i <= maxZ; ++i) {
94 if (verboseLevel > 1) {
95 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversionModel." <<
G4endl
106 std::size_t numElems = (*elemTable).size();
107 for (std::size_t ie = 0; ie < numElems; ++ie) {
109 const G4int Z = std::min(maxZ,
elem->GetZasInt());
110 if (data[Z] ==
nullptr) {
119 isInitialised =
true;
124const G4String& G4LivermoreGammaConversionModel::FindDirectoryPath()
127 if (gDataDirectory.empty()) {
129 std::ostringstream ost;
130 if (param->LivermoreDataDir() ==
"livermore") {
131 ost << param->GetDirLEDATA() <<
"/livermore/pair/";
135 ost << param->GetDirLEDATA() <<
"/epics2017/pair/";
137 gDataDirectory = ost.str();
139 return gDataDirectory;
144void G4LivermoreGammaConversionModel::ReadData(
const G4int Z)
146 if (verboseLevel > 1) {
147 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel" <<
G4endl;
150 if (data[Z] !=
nullptr) {
154 std::ostringstream ost;
155 ost << FindDirectoryPath() <<
"pp-cs-" << Z <<
".dat";
159 std::ifstream fin(ost.str().c_str());
161 if (!fin.is_open()) {
163 ed <<
"G4LivermoreGammaConversionModel data file <" << ost.str().c_str() <<
"> is not opened!"
166 "G4LEDATA version should be G4EMLOW8.0 or later.");
170 if (verboseLevel > 1) {
171 G4cout <<
"File " << ost.str() <<
" is opened by G4LivermoreGammaConversionModel" <<
G4endl;
187 if (verboseLevel > 1) {
188 G4cout <<
"G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom() Z= " << Z <<
G4endl;
191 if (GammaEnergy < lowEnergyLimit) {
211 xs = pv->
Value(GammaEnergy);
213 if (verboseLevel > 0) {
214 G4cout <<
"*** Gamma conversion xs for Z=" << Z <<
" at energy E(MeV)=" << GammaEnergy / MeV
215 <<
" cs=" << xs / millibarn <<
" mb" <<
G4endl;
224 G4AutoLock l(&LivermoreGammaConversionModelMutex);
225 if (data[Z] ==
nullptr) {
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
static G4ElementTable * GetElementTable()
static G4EmParameters * Instance()
~G4LivermoreGammaConversionModel() override
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0.0, G4double cut=0.0, G4double emax=DBL_MAX) override
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4LivermoreGammaConversionModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="LivermoreConversion")
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
G4double Value(const G4double energy, std::size_t &lastidx) const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)