Commit 3038dd32 authored by Simon Gardner's avatar Simon Gardner
Browse files

Swapped to changing time of single_source

parent 3d2cf5e1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -352,8 +352,9 @@ void GeneratorActionG4::GeneratePrimaries(G4Event* event) {

    // Set the time of the particle source within the time window
    if(time_window_ > 0) {
        auto* single_source = particle_source_->GetCurrentSource();
        double event_time = time_ + G4UniformRand() * time_window_;
        particle_source_->SetParticleTime(event_time);
        single_source->SetParticleTime(event_time);
    }

    particle_source_->GeneratePrimaryVertex(event);