MCPcopy Create free account
hub / github.com/Geant4/geant4 / SetCurrentSourceto

Method SetCurrentSourceto

source/event/src/G4GeneralParticleSource.cc:131–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void G4GeneralParticleSource::SetCurrentSourceto(G4int aV)
132{
133 G4int id = aV;
134 if ( id < GPSData->GetIntensityVectorSize() )
135 {
136 // currentSourceIdx = aV;
137 // currentSource = GPSData->GetCurrentSource(id);
138 theMessenger->SetParticleGun(GPSData->GetCurrentSource(id));
139 }
140 else
141 {
142 G4ExceptionDescription msg;
143 msg << "Trying to set source to index " << aV << " but only "
144 << GPSData->GetIntensityVectorSize() << " sources are defined.";
145 G4Exception("G4GeneralParticleSoruce::SetCurrentSourceto", "G4GPS004",
146 FatalException, msg);
147 }
148}
149
150void G4GeneralParticleSource::SetCurrentSourceIntensity(G4double aV)
151{

Callers 1

SetNewValueMethod · 0.80

Calls 4

G4ExceptionFunction · 0.85
SetParticleGunMethod · 0.80
GetCurrentSourceMethod · 0.45

Tested by

no test coverage detected