Geant4
10.01.p02
|
Andrea Dotti Feb 2015 GPS messenger design requires some explanation for what distributions parameters are concerned : Each thread has its own GPS since primary generation is a user action. More...
#include <G4GeneralParticleSource.hh>
Private Member Functions | |
void | IntensityNormalization () |
Private Attributes | |
G4bool | normalised |
G4GeneralParticleSourceMessenger * | theMessenger |
G4GeneralParticleSourceData * | GPSData |
Additional Inherited Members | |
Static Public Member Functions inherited from G4VPrimaryGenerator | |
static G4bool | CheckVertexInsideWorld (const G4ThreeVector &pos) |
Protected Attributes inherited from G4VPrimaryGenerator | |
G4ThreeVector | particle_position |
G4double | particle_time |
Andrea Dotti Feb 2015 GPS messenger design requires some explanation for what distributions parameters are concerned : Each thread has its own GPS since primary generation is a user action.
However to save memory the underlying structures that provide the GPS functionalities ( the G4SPS*Distribution classes and the G4SPSRandomGenerator class) are shared among threads. This implies that modifying parameters of sources requires some attention: 1- Only one thread should change source parameters. 2- Changing of parameters can happen only between runs, when is guaranteed that no thread is accessing them 2- UI commands require that even if messenger is instantiated in a thread the commands are executed in the master (this is possible since V10.1) The simplest solution is to use UI commands to change GPS parameters and avoid C++ APIs. If this is inevitable a simple solution is to instantiate an instance of G4GeneralParticleSource explicitly in the master thread (for example in G4VUserActionInitialization::BuildForMaster() and set the defaults parameter there).
Definition at line 179 of file G4GeneralParticleSource.hh.
G4GeneralParticleSource::G4GeneralParticleSource | ( | ) |
Definition at line 78 of file G4GeneralParticleSource.cc.
References G4GeneralParticleSourceData::GetCurrentSource(), G4GeneralParticleSourceMessenger::GetInstance(), GPSData, G4GeneralParticleSourceData::Instance(), IntensityNormalization(), G4GeneralParticleSourceMessenger::SetParticleGun(), and theMessenger.
G4GeneralParticleSource::~G4GeneralParticleSource | ( | ) |
Definition at line 97 of file G4GeneralParticleSource.cc.
References G4GeneralParticleSourceMessenger::Destroy(), and theMessenger.
void G4GeneralParticleSource::AddaSource | ( | G4double | aV | ) |
Definition at line 102 of file G4GeneralParticleSource.cc.
References G4GeneralParticleSourceData::AddASource(), G4GeneralParticleSourceData::GetCurrentSource(), GPSData, IntensityNormalization(), G4GeneralParticleSourceData::Lock(), G4GeneralParticleSourceMessenger::SetParticleGun(), theMessenger, and G4GeneralParticleSourceData::Unlock().
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
void G4GeneralParticleSource::ClearAll | ( | ) |
Definition at line 166 of file G4GeneralParticleSource.cc.
References G4GeneralParticleSourceData::ClearSources(), GPSData, G4GeneralParticleSourceData::Normalised(), and normalised.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
void G4GeneralParticleSource::DeleteaSource | ( | G4int | aV | ) |
Definition at line 172 of file G4GeneralParticleSource.cc.
References G4GeneralParticleSourceData::DeleteASource(), G4cout, G4endl, G4GeneralParticleSourceData::GetIntensityVectorSize(), GPSData, G4GeneralParticleSourceData::Normalised(), and normalised.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
virtual |
Implements G4VPrimaryGenerator.
Definition at line 187 of file G4GeneralParticleSource.cc.
References G4UniformRand, G4SingleParticleSource::GeneratePrimaryVertex(), G4GeneralParticleSourceData::GetCurrentSource(), G4GeneralParticleSourceData::GetFlatSampling(), G4GeneralParticleSourceData::GetIntensityVectorSize(), G4GeneralParticleSourceData::GetMultipleVertex(), G4GeneralParticleSourceData::GetSourceProbability(), GPSData, IntensityNormalization(), G4GeneralParticleSourceData::Lock(), G4GeneralParticleSourceData::Normalised(), normalised, and G4GeneralParticleSourceData::Unlock().
Referenced by GammaKnifePrimaryGeneratorAction::GeneratePrimaries(), ExExChPrimaryGeneratorAction::GeneratePrimaries(), ElectronPrimaryGeneratorAction::GeneratePrimaries(), ExGflashPrimaryGeneratorAction::GeneratePrimaries(), exrdmPrimaryGeneratorAction::GeneratePrimaries(), ExG4PrimaryGeneratorAction02::GeneratePrimaries(), WLSPrimaryGeneratorAction::GeneratePrimaries(), UltraPrimaryGeneratorAction::GeneratePrimaries(), RMC01PrimaryGeneratorAction::GeneratePrimaries(), GammaRayTelPrimaryGeneratorAction::GeneratePrimaries(), and XrayTelPrimaryGeneratorAction::GeneratePrimaries().
|
inline |
Definition at line 193 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), and GPSData.
Referenced by UltraPrimaryGeneratorAction::GeneratePrimaries(), and UltraActionInitializer::UltraActionInitializer().
|
inline |
Definition at line 195 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSourceIdx(), and GPSData.
Referenced by GetCurrentSourceIntensity(), and G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 197 of file G4GeneralParticleSource.hh.
References GetCurrentSourceIndex(), G4GeneralParticleSourceData::GetIntensity(), and GPSData.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 238 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetNumberOfParticles(), and GPSData.
|
inline |
Definition at line 189 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetSourceVectorSize(), and GPSData.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 217 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticleDefinition(), and GPSData.
Referenced by WLSPrimaryGeneratorAction::GeneratePrimaries(), UltraPrimaryGeneratorAction::GeneratePrimaries(), and WLSPrimaryGeneratorAction::SetOptPhotonPolar().
|
inline |
Definition at line 244 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticleEnergy(), and GPSData.
Referenced by UltraPrimaryGeneratorAction::GeneratePrimaries().
|
inline |
Definition at line 242 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticleMomentumDirection(), and GPSData.
Referenced by WLSPrimaryGeneratorAction::SetOptPhotonPolar().
|
inline |
Definition at line 226 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticlePolarization(), and GPSData.
|
inline |
Definition at line 240 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticlePosition(), and GPSData.
|
inline |
Definition at line 232 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), G4SingleParticleSource::GetParticleTime(), and GPSData.
|
private |
Definition at line 112 of file G4GeneralParticleSource.cc.
References GPSData, G4GeneralParticleSourceData::IntensityNormalise(), G4GeneralParticleSourceData::Normalised(), and normalised.
Referenced by AddaSource(), G4GeneralParticleSource(), and GeneratePrimaryVertex().
void G4GeneralParticleSource::ListSource | ( | ) |
Definition at line 118 of file G4GeneralParticleSource.cc.
References G4BestUnit, G4cout, G4endl, G4SingleParticleSource::GetAngDist(), G4SPSPosDistribution::GetCentreCoords(), G4GeneralParticleSourceData::GetCurrentSource(), G4GeneralParticleSourceData::GetCurrentSourceIdx(), G4SPSAngDistribution::GetDirection(), G4SPSAngDistribution::GetDistType(), G4SingleParticleSource::GetEneDist(), G4SPSEneDistribution::GetEnergyDisType(), G4GeneralParticleSourceData::GetFlatSampling(), G4GeneralParticleSourceData::GetIntensity(), G4GeneralParticleSourceData::GetIntensityVectorSize(), G4GeneralParticleSourceData::GetMultipleVertex(), G4SingleParticleSource::GetNumberOfParticles(), G4SingleParticleSource::GetParticleDefinition(), G4SingleParticleSource::GetParticleEnergy(), G4ParticleDefinition::GetParticleName(), G4SPSPosDistribution::GetPosDisShape(), G4SingleParticleSource::GetPosDist(), G4SPSPosDistribution::GetPosDisType(), and GPSData.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
void G4GeneralParticleSource::SetCurrentSourceIntensity | ( | G4double | aV | ) |
Definition at line 158 of file G4GeneralParticleSource.cc.
References GPSData, G4GeneralParticleSourceData::Lock(), G4GeneralParticleSourceData::Normalised(), normalised, G4GeneralParticleSourceData::SetCurrentSourceIntensity(), and G4GeneralParticleSourceData::Unlock().
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
void G4GeneralParticleSource::SetCurrentSourceto | ( | G4int | aV | ) |
Definition at line 141 of file G4GeneralParticleSource.cc.
References FatalException, G4Exception(), G4GeneralParticleSourceData::GetCurrentSource(), G4GeneralParticleSourceData::GetIntensityVectorSize(), GPSData, G4GeneralParticleSourceMessenger::SetParticleGun(), and theMessenger.
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 211 of file G4GeneralParticleSource.hh.
References GPSData, normalised, and G4GeneralParticleSourceData::SetFlatSampling().
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 207 of file G4GeneralParticleSource.hh.
References GPSData, and G4GeneralParticleSourceData::SetMultipleVertex().
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
inline |
Definition at line 235 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), GPSData, and G4SingleParticleSource::SetNumberOfParticles().
|
inline |
Definition at line 220 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), GPSData, and G4SingleParticleSource::SetParticleCharge().
|
inline |
Definition at line 214 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), GPSData, and G4SingleParticleSource::SetParticleDefinition().
Referenced by GammaKnifeActionInitialization::GammaKnifeActionInitialization(), and UltraActionInitializer::UltraActionInitializer().
|
inline |
Definition at line 224 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), GPSData, and G4SingleParticleSource::SetParticlePolarization().
Referenced by WLSPrimaryGeneratorAction::SetOptPhotonPolar(), and UltraActionInitializer::UltraActionInitializer().
|
inline |
Definition at line 230 of file G4GeneralParticleSource.hh.
References G4GeneralParticleSourceData::GetCurrentSource(), GPSData, and G4SingleParticleSource::SetParticleTime().
Referenced by WLSPrimaryGeneratorAction::SetOptPhotonTime().
|
inline |
Definition at line 204 of file G4GeneralParticleSource.hh.
References GPSData, and G4GeneralParticleSourceData::SetVerbosityAllSources().
Referenced by G4GeneralParticleSourceMessenger::SetNewValue().
|
private |
Definition at line 259 of file G4GeneralParticleSource.hh.
Referenced by AddaSource(), ClearAll(), DeleteaSource(), G4GeneralParticleSource(), GeneratePrimaryVertex(), GetCurrentSource(), GetCurrentSourceIndex(), GetCurrentSourceIntensity(), GetNumberOfParticles(), GetNumberofSource(), GetParticleDefinition(), GetParticleEnergy(), GetParticleMomentumDirection(), GetParticlePolarization(), GetParticlePosition(), GetParticleTime(), IntensityNormalization(), ListSource(), SetCurrentSourceIntensity(), SetCurrentSourceto(), SetFlatSampling(), SetMultipleVertex(), SetNumberOfParticles(), SetParticleCharge(), SetParticleDefinition(), SetParticlePolarization(), SetParticleTime(), and SetVerbosity().
|
private |
Definition at line 254 of file G4GeneralParticleSource.hh.
Referenced by ClearAll(), DeleteaSource(), GeneratePrimaryVertex(), IntensityNormalization(), SetCurrentSourceIntensity(), and SetFlatSampling().
|
private |
Definition at line 257 of file G4GeneralParticleSource.hh.
Referenced by AddaSource(), G4GeneralParticleSource(), SetCurrentSourceto(), and ~G4GeneralParticleSource().