Commit af047150 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

DepositionGeant4: adapt to finalizeThread aplways being executed

parent c00a1691
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -341,11 +341,6 @@ void DepositionGeant4Module::finalize() {
        }
    }

    // Record the number of sensors and the total charges
    if(!multithreadingEnabled()) {
        record_module_statistics();
    }

    // Print summary or warns if module did not output any charges
    if(number_of_sensors_ > 0 && total_charges_ > 0 && last_event_num_ > 0) {
        size_t average_charge = total_charges_ / number_of_sensors_ / last_event_num_;
@@ -360,9 +355,11 @@ void DepositionGeant4Module::finalizeThread() {
    // Record the number of sensors and the total charges
    record_module_statistics();

    if(multithreadingEnabled()) {
        auto* run_manager_mt = static_cast<MTRunManager*>(run_manager_g4_);
        run_manager_mt->TerminateForThread();
    }
}

void DepositionGeant4Module::construct_sensitive_detectors_and_fields(double fano_factor,
                                                                      double charge_creation_energy,