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

Method G4GeneralParticleSource

source/event/src/G4GeneralParticleSource.cc:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49G4GeneralParticleSource::G4GeneralParticleSource()
50{
51 GPSData = G4GeneralParticleSourceData::Instance();
52 // currentSource = GPSData->GetCurrentSource();
53 // currentSourceIdx = G4int(GPSData->GetSourceVectorSize() - 1);
54
55 // Messenger is special, only a worker should instantiate it.
56 // Singleton pattern
57 //
58 theMessenger = G4GeneralParticleSourceMessenger::GetInstance(this);
59
60 // Some initialization should be done only once
61 //
62 G4AutoLock l(&messangerInit);
63 static G4bool onlyOnce = false;
64 if ( !onlyOnce )
65 {
66 theMessenger->SetParticleGun(GPSData->GetCurrentSource());
67 IntensityNormalization();
68 onlyOnce = true;
69 }
70}
71
72G4GeneralParticleSource::~G4GeneralParticleSource()
73{

Callers

nothing calls this directly

Calls 3

GetInstanceFunction · 0.85
SetParticleGunMethod · 0.80
GetCurrentSourceMethod · 0.45

Tested by

no test coverage detected