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

Merge branch 'b-coverity' into 'v2.4-stable'

[v2.4-stable] Coverity Fixes

See merge request allpix-squared/allpix-squared!963
parents 5d724e24 3f93a782
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ namespace allpix {

        private:
            std::atomic_bool valid_{true};
            mutable std::mutex mutex_;
            mutable std::mutex mutex_{};
            std::queue<T> queue_;
            std::set<uint64_t> completed_ids_;
            uint64_t current_id_{0};
@@ -274,7 +274,7 @@ namespace allpix {
        std::atomic_bool done_{false};

        std::atomic<unsigned int> run_cnt_{0};
        mutable std::mutex run_mutex_;
        mutable std::mutex run_mutex_{};
        std::condition_variable run_condition_;
        std::vector<std::thread> threads_;

+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ namespace allpix {
        std::string user_;
        std::string password_;
        std::string run_id_;
        int run_nr_;
        int run_nr_{0};
        bool timing_global_{};

        // Statistical information about number of objects
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ PrimariesReaderHepMC::PrimariesReaderHepMC(const Configuration& config) {
    } else if(model == FileModel::HEPMCTTREE) {
        file_path = config.getPathWithExtension("file_name", "root", true);
        reader_ = std::make_unique<HepMC3::ReaderRootTree>(file_path);
    } else {
        throw InvalidValueError(config, "model", "failed to instantiate file reader");
    }

    if(reader_->failed()) {
+3 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * @file
 * @brief Definition of [DepositionLaser] module
 *
 * @copyright Copyright (c) 2022 CERN and the Allpix Squared authors.
 * @copyright Copyright (c) 2017-2023 CERN and the Allpix Squared authors.
 * This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
 * In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an
 * Intergovernmental Organization or submit itself to any jurisdiction.
@@ -130,8 +130,8 @@ namespace allpix {

        size_t number_of_photons_;
        double wavelength_;
        double absorption_length_;
        double refractive_index_;
        double absorption_length_{0.};
        double refractive_index_{0.};
        double pulse_duration_;

        // Histograms
+4 −5
Original line number Diff line number Diff line
@@ -355,14 +355,13 @@ void ProjectionPropagationModule::run(Event* event) {
    }
    charge_lost = total_charge - total_projected_charge;

    if(total_charge > 0) {
    LOG(INFO) << "Total charge: " << total_charge << " (lost: " << charge_lost << ", "
                  << (charge_lost / total_charge * 100.) << "%)";
    }
              << (total_charge > 0 ? (charge_lost / total_charge * 100.) : 0) << "%)";

    LOG(DEBUG) << "Total count of propagated charge carriers: " << propagated_charges.size();

    if(output_plots_) {
        recombine_histo_->Fill(static_cast<double>(recombined_charges_count) / total_charge);
        recombine_histo_->Fill(total_charge > 0 ? (static_cast<double>(recombined_charges_count) / total_charge) : 0.);
    }

    // Create a new message with propagated charges
Loading