51G4double G4LivermoreGammaConversionModel::lowEnergyLimit = 2.*CLHEP::electron_mass_c2;
52G4int G4LivermoreGammaConversionModel::verboseLevel = 0;
53constexpr G4int G4LivermoreGammaConversionModel::maxZ;
67 G4cout <<
"G4LivermoreGammaConversionModel is constructed " <<
G4endl;
76 for(
G4int i=0; i<maxZ; ++i) {
93 G4cout <<
"Calling Initialise() of G4LivermoreGammaConversionModel."
101 if(!fParticleChange) {
111 char* path = std::getenv(
"G4LEDATA");
117 for(
G4int i=0; i<numOfCouples; ++i)
125 for (
G4int j=0; j<nelm; ++j)
127 G4int Z = std::min((*theElementVector)[j]->GetZasInt(), maxZ);
128 if(!data[Z]) { ReadData(Z, path); }
137void G4LivermoreGammaConversionModel::ReadData(
size_t Z,
const char* path)
139 if (verboseLevel > 1)
141 G4cout <<
"Calling ReadData() of G4LivermoreGammaConversionModel"
145 if(data[Z]) {
return; }
147 const char* datadir = path;
151 datadir = std::getenv(
"G4LEDATA");
154 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
156 "Environment variable G4LEDATA not defined");
161 std::ostringstream ost;
162 ost << datadir <<
"/epics2017/pair/pp-cs-" << Z <<
".dat";
163 std::ifstream fin(ost.str().c_str());
168 ed <<
"G4LivermoreGammaConversionModel data file <" << ost.str().c_str()
169 <<
"> is not opened!" <<
G4endl;
170 G4Exception(
"G4LivermoreGammaConversionModel::ReadData()",
172 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
178 if(verboseLevel > 1) {
G4cout <<
"File " << ost.str()
179 <<
" is opened by G4LivermoreGammaConversionModel" <<
G4endl;}
193 if (verboseLevel > 1)
195 G4cout <<
"G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom() Z= "
199 if (GammaEnergy < lowEnergyLimit) {
return 0.0; }
213 if(!pv) {
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;
236 G4AutoLock l(&LivermoreGammaConversionModelMutex);
239 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
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")
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
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 &)