50const G4int G4LivermoreGammaConversion5DModel::maxZ;
51G4double G4LivermoreGammaConversion5DModel::lowEnergyLimit = 2.*CLHEP::electron_mass_c2;
65 G4cout <<
"G4LivermoreGammaConversion5DModel is constructed " <<
G4endl;
74 for(
G4int i=0; i<maxZ; ++i) {
93 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversion5DModel."
101 if(!fParticleChange) {
114 for(
G4int i=0; i<numOfCouples; ++i)
121 for (std::size_t j=0; j<nelm; ++j)
123 G4int Z = std::max(1, std::min((*theElementVector)[j]->GetZasInt(), maxZ));
124 if(!data[
Z]) { ReadData(
Z, path); }
132void G4LivermoreGammaConversion5DModel::ReadData(
size_t Z,
const char* path)
134 if (verboseLevel > 1)
136 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversion5DModel"
140 if(data[
Z]) {
return; }
141 const char* datadir = path;
147 G4Exception(
"G4LivermoreGammaConversion5DModel::ReadData()",
149 "Environment variable G4LEDATA not defined");
153 std::ostringstream ost;
156 ost << datadir <<
"/livermore/pair/pp-cs-" <<
Z <<
".dat";
159 ost << datadir <<
"/epics2017/pair/pp-cs-" <<
Z <<
".dat";
162 std::ifstream fin(ost.str().c_str());
167 ed <<
"G4LivermoreGammaConversion5DModel data file <" << ost.str().c_str()
168 <<
"> is not opened!" <<
G4endl;
169 G4Exception(
"G4LivermoreGammaConversion5DModel::ReadData()",
171 ed,
"G4LEDATA version should be G4EMLOW8.0 or later.");
176 if(verboseLevel > 1) {
G4cout <<
"File " << ost.str()
177 <<
" is opened by G4LivermoreGammaConversion5DModel" <<
G4endl;}
189 if (verboseLevel > 1)
191 G4cout <<
"G4LivermoreGammaConversion5DModel::ComputeCrossSectionPerAtom() Z= "
195 if (GammaEnergy < lowEnergyLimit) {
return xs; }
205 if(!pv) {
return xs; }
208 xs = pv->
Value(GammaEnergy);
211 G4cout <<
"*** Gamma conversion xs for Z=" <<
Z <<
" at energy E(MeV)="
212 << GammaEnergy/MeV <<
" cs=" << xs/millibarn <<
" mb" <<
G4endl;
223 G4AutoLock l(&LivermoreGammaConversion5DModelMutex);
224 if(!data[
Z]) { ReadData(
Z); }
std::vector< const G4Element * > G4ElementVector
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
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
static G4EmParameters * Instance()
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4LivermoreGammaConversion5DModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="Livermore5DConversion")
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0.0, G4double cut=0.0, G4double emax=DBL_MAX) override
virtual ~G4LivermoreGammaConversion5DModel()
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
G4double Value(const G4double energy, std::size_t &lastidx) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
void SetCurrentCouple(const G4MaterialCutsCouple *)
G4double HighEnergyLimit() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)