47G4double G4LivermoreGammaConversion5DModel::lowEnergyLimit = 2.*CLHEP::electron_mass_c2;
48G4int G4LivermoreGammaConversion5DModel::verboseLevel = 0;
49constexpr G4int G4LivermoreGammaConversion5DModel::maxZ;
62 G4cout <<
"G4LivermoreGammaConversion5DModel is constructed " <<
G4endl;
71 for(
G4int i=0; i<maxZ; ++i) {
90 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversion5DModel."
98 if(!fParticleChange) {
107 char* path = std::getenv(
"G4LEDATA");
111 for(
G4int i=0; i<numOfCouples; ++i)
118 for (
G4int j=0; j<nelm; ++j)
120 G4int Z = std::max(1, std::min((*theElementVector)[j]->GetZasInt(), maxZ));
121 if(!data[Z]) { ReadData(Z, path); }
129void G4LivermoreGammaConversion5DModel::ReadData(
size_t Z,
const char* path)
131 if (verboseLevel > 1)
133 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversion5DModel"
137 if(data[Z]) {
return; }
138 const char* datadir = path;
141 datadir = std::getenv(
"G4LEDATA");
144 G4Exception(
"G4LivermoreGammaConversion5DModel::ReadData()",
146 "Environment variable G4LEDATA not defined");
151 std::ostringstream ost;
152 ost << datadir <<
"/epics2017/pair/pp-cs-" << Z <<
".dat";
153 std::ifstream fin(ost.str().c_str());
158 ed <<
"G4LivermoreGammaConversion5DModel data file <" << ost.str().c_str()
159 <<
"> is not opened!" <<
G4endl;
160 G4Exception(
"G4LivermoreGammaConversion5DModel::ReadData()",
162 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
167 if(verboseLevel > 1) {
G4cout <<
"File " << ost.str()
168 <<
" is opened by G4LivermoreGammaConversion5DModel" <<
G4endl;}
182 if (verboseLevel > 1)
184 G4cout <<
"G4LivermoreGammaConversion5DModel::ComputeCrossSectionPerAtom() Z= "
188 if (GammaEnergy < lowEnergyLimit) {
return xs; }
198 if(!pv) {
return xs; }
201 xs = pv->
Value(GammaEnergy);
204 G4cout <<
"*** Gamma conversion xs for Z=" << Z <<
" at energy E(MeV)="
205 << GammaEnergy/MeV <<
" cs=" << xs/millibarn <<
" mb" <<
G4endl;
219 G4AutoLock l(&LivermoreGammaConversion5DModelMutex);
222 if(!data[Z]) { ReadData(Z); }
std::vector< G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
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
G4double Value(G4double theEnergy, std::size_t &lastidx) const
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
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 &)