Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FindDataDir.cc File Reference
#include <mutex>
#include "G4FindDataDir.hh"
#include "G4Filesystem.hh"
#include <cstdio>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Functions

const char * G4FindDataDir (const char *name)
 

Function Documentation

◆ G4FindDataDir()

const char * G4FindDataDir ( const char *  name)

Definition at line 93 of file G4FindDataDir.cc.

94{
95#if defined(G4MULTITHREADED)
96 static std::mutex mutex;
97 std::lock_guard<std::mutex> lock(mutex);
98#endif
99
100 /* If environment variable is set for this dataset, use it */
101 if (const char *datadir = std::getenv(name))
102 return datadir;
103
104 /* If we know which directory/version to search for, try to find it */
105 if (const char *dataset = G4GetDataDir(name)) {
106 /* If GEANT4_DATA_DIR environment variable is set, use it and don't search further */
107 if (const char *basedir = std::getenv("GEANT4_DATA_DIR"))
108 return G4FindDataDir(name, basedir, dataset);
109
110 /* If GEANT4_DATA_DIR environment variable is not set, search in default system paths */
111 for (const auto prefix : system_paths)
112 if (const auto datadir = G4FindDataDir(name, prefix, dataset))
113 return datadir;
114 }
115
116 return nullptr;
117}
const char * G4FindDataDir(const char *)

Referenced by G4LENDBertiniGammaElectroNuclearBuilder::Build(), G4ParticleHPCapture::BuildPhysicsTable(), G4ParticleHPElastic::BuildPhysicsTable(), G4ParticleHPFission::BuildPhysicsTable(), G4ParticleHPJENDLHEData::BuildPhysicsTable(), G4ParticleHPThermalScatteringData::BuildPhysicsTable(), G4VLEPTSModel::BuildPhysicsTable(), G4IonStoppingData::BuildPhysicsVector(), G4ecpssrBaseKxsModel::G4ecpssrBaseKxsModel(), G4ecpssrBaseLixsModel::G4ecpssrBaseLixsModel(), G4FindDataDir(), G4FissLib::G4FissLib(), G4LevelReader::G4LevelReader(), G4ParticleHPInelastic::G4ParticleHPInelastic(), G4ParticleHPInelasticData::G4ParticleHPInelasticData(), G4PhotoElectricAngularGeneratorPolarized::G4PhotoElectricAngularGeneratorPolarized(), G4RadioactiveDecay::G4RadioactiveDecay(), G4NuclideTable::GenerateNuclide(), G4ParticleHPNames::GetName(), G4ParticleHPInelasticCompFS::Init(), G4ParticleHPInelasticBaseFS::Init(), G4ParticleHPIsoData::Init(), G4IonICRU73Data::Initialise(), G4DNAChampionElasticModel::Initialise(), G4DNACPA100ElasticModel::Initialise(), G4DNASancheExcitationModel::Initialise(), G4BoldyshevTripletModel::Initialise(), G4JAEAElasticScatteringModel::Initialise(), G4JAEAPolarizedElasticScatteringModel::Initialise(), G4LivermoreBremsstrahlungModel::Initialise(), G4LivermoreComptonModel::Initialise(), G4LivermoreGammaConversion5DModel::Initialise(), G4LivermoreGammaConversionModel::Initialise(), G4LivermoreNuclearGammaConversionModel::Initialise(), G4LivermorePolarizedComptonModel::Initialise(), G4LivermorePolarizedGammaConversionModel::Initialise(), G4LivermorePolarizedRayleighModel::Initialise(), G4LivermoreRayleighModel::Initialise(), G4LowEPComptonModel::Initialise(), G4LowEPPolarizedComptonModel::Initialise(), G4MicroElecElasticModel::Initialise(), G4MicroElecElasticModel_new::Initialise(), G4MicroElecInelasticModel::Initialise(), G4MicroElecInelasticModel_new::Initialise(), G4DNABornExcitationModel2::Initialise(), G4DNABornIonisationModel1::Initialise(), G4DNABornIonisationModel2::Initialise(), G4DNACPA100IonisationModel::Initialise(), G4DNAEmfietzoglouIonisationModel::Initialise(), G4DNARelativisticIonisationModel::Initialise(), G4DNAELSEPAElasticModel::Initialise(), G4DNAIonElasticModel::Initialise(), G4ANuElNucleusCcModel::InitialiseModel(), G4ANuElNucleusNcModel::InitialiseModel(), G4ANuMuNucleusCcModel::InitialiseModel(), G4ANuMuNucleusNcModel::InitialiseModel(), G4ANuTauNucleusCcModel::InitialiseModel(), G4ANuTauNucleusNcModel::InitialiseModel(), G4NuElNucleusCcModel::InitialiseModel(), G4NuElNucleusNcModel::InitialiseModel(), G4NuMuNucleusCcModel::InitialiseModel(), G4NuMuNucleusNcModel::InitialiseModel(), G4NuTauNucleusCcModel::InitialiseModel(), G4NuTauNucleusNcModel::InitialiseModel(), G4INCL::HFB::initialize(), G4DNARelativisticIonisationModel::LoadAtomicStates(), G4VCrossSectionHandler::LoadData(), G4ShellData::LoadData(), G4AugerData::LoadData(), G4FluoData::LoadData(), G4GoudsmitSaundersonTable::LoadMSCData(), G4VCrossSectionHandler::LoadNonLogData(), G4FissionProductYieldDist::MakeDirectoryName(), G4OpticalSurface::ReadCompressedFile(), G4AblaDataFile::readData(), G4OpticalSurface::ReadDichroicFile(), G4MicroElecMaterialStructure::ReadMaterialFile(), and G4MuPairProductionModel::RetrieveTables().