| 47 | } |
| 48 | |
| 49 | G4GeneralParticleSource::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 | |
| 72 | G4GeneralParticleSource::~G4GeneralParticleSource() |
| 73 | { |
nothing calls this directly
no test coverage detected