54G4double G4LivermoreGammaConversionModel::lowEnergyLimit = 2.*CLHEP::electron_mass_c2;
68 G4cout <<
"G4LivermoreGammaConversionModel is constructed " <<
G4endl;
77 for(
G4int i = 0; i <= maxZ; ++i)
96 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversionModel."
104 if(fParticleChange ==
nullptr) {
116 size_t numElems = (*elemTable).size();
117 for(
size_t ie = 0; ie < numElems; ++ie)
120 const G4int Z = std::min(maxZ,
elem->GetZasInt());
121 if(data[
Z] ==
nullptr)
132void G4LivermoreGammaConversionModel::ReadData(
size_t Z,
const char* path)
134 if (verboseLevel > 1)
136 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel"
140 if(data[
Z]!=
nullptr) {
return; }
142 const char* datadir = path;
144 if(datadir ==
nullptr)
147 if(datadir ==
nullptr)
149 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
151 "Environment variable G4LEDATA not defined");
156 std::ostringstream ost;
159 ost << datadir <<
"/livermore/pair/pp-cs-" <<
Z <<
".dat";
162 ost << datadir <<
"/epics2017/pair/pp-cs-" <<
Z <<
".dat";
165 std::ifstream fin(ost.str().c_str());
170 ed <<
"G4LivermoreGammaConversionModel data file <" << ost.str().c_str()
171 <<
"> is not opened!" <<
G4endl;
172 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
174 ed,
"G4LEDATA version should be G4EMLOW8.0 or later.");
180 if(verboseLevel > 1) {
G4cout <<
"File " << ost.str()
181 <<
" is opened by G4LivermoreGammaConversionModel" <<
G4endl;}
193 if (verboseLevel > 1)
195 G4cout <<
"G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom() Z= "
199 if (GammaEnergy < lowEnergyLimit) {
return 0.0; }
213 if(pv ==
nullptr) {
return xs; }
216 xs = pv->
Value(GammaEnergy);
220 G4cout <<
"*** Gamma conversion xs for Z=" <<
Z <<
" at energy E(MeV)="
221 << GammaEnergy/MeV <<
" cs=" << xs/millibarn <<
" mb" <<
G4endl;
232 G4AutoLock l(&LivermoreGammaConversionModelMutex);
233 if(data[
Z] ==
nullptr) { ReadData(
Z); }
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
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()
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
virtual ~G4LivermoreGammaConversionModel()
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
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)