Commit 6b3e6851 authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'this_that' into 'master'

This & That: Linter Fixes & CMake Formatting

See merge request allpix-squared/allpix-squared!736
parents ddbb6244 54593ca6
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -233,8 +233,7 @@ FUNCTION(add_allpix_test)
        NAME "${TEST_NAME}"
        WORKING_DIRECTORY ${TEST_WORKING_DIRECTORY}
        COMMAND ${PROJECT_SOURCE_DIR}/etc/unittests/run_directory.sh "${TEST_NAME}"
                "${CMAKE_INSTALL_PREFIX}/bin/${TEST_EXECUTABLE} -c ${TEST_FILE} ${clioptions}"
                ${before_script})
                "${CMAKE_INSTALL_PREFIX}/bin/${TEST_EXECUTABLE} -c ${TEST_FILE} ${clioptions}" ${before_script})

    # Parse configuration file for pass/fail conditions:
    FILE(STRINGS ${TEST_FILE} PASS_LST_ REGEX "#PASS ")
@@ -329,8 +328,7 @@ MACRO(ALLPIX_MODULE_TESTS name directory)
            SET(TEST_DIR "${TEST_BASE_DIR}/modules/${_allpix_module_dir}/${title}")

            CONFIGURE_FILE(${test} "${CMAKE_CURRENT_BINARY_DIR}/${test}" @ONLY)
            ADD_ALLPIX_TEST(NAME "modules/${_allpix_module_dir}/${title}"
                            FILE ${CMAKE_CURRENT_BINARY_DIR}/${test}
            ADD_ALLPIX_TEST(NAME "modules/${_allpix_module_dir}/${title}" FILE ${CMAKE_CURRENT_BINARY_DIR}/${test}
                            WORKING_DIRECTORY ${TEST_BASE_DIR})

            GET_PROPERTY(old_count GLOBAL PROPERTY COUNT_TESTS_MODULES)
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@

using namespace allpix;

PixelDetectorModel::PixelDetectorModel(std::string type, ConfigReader reader) : DetectorModel(std::move(type), reader) {
PixelDetectorModel::PixelDetectorModel(std::string type, const ConfigReader& reader)
    : DetectorModel(std::move(type), reader) {
    using namespace ROOT::Math;
    auto config = reader.getHeaderConfiguration();

+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ namespace allpix {
         * @param type Name of the model type
         * @param reader Configuration reader with description of the model
         */
        explicit PixelDetectorModel(std::string type, ConfigReader reader);
        explicit PixelDetectorModel(std::string type, const ConfigReader& reader);

        /**
         * @brief Returns if a local position is within the sensitive device
+10 −7
Original line number Diff line number Diff line
@@ -47,12 +47,14 @@ ENDIF()

# Install the files to the data directory
# NOTE: With default install path this does not change anything
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data/ DESTINATION ${CRY_DATA_DIRECTORY}
        FILES_MATCHING PATTERN "*.data")
INSTALL(
    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data/
    DESTINATION ${CRY_DATA_DIRECTORY}
    FILES_MATCHING
    PATTERN "*.data")

ADD_DEFINITIONS(-DALLPIX_CRY_DATA_DIRECTORY="${CRY_DATA_DIRECTORY}")


# Required for CMake when Geant4 has HDF5 enabled
ENABLE_LANGUAGE(C)

@@ -76,7 +78,8 @@ ELSEIF(CMAKE_BUILD_TYPE MATCHES RELEASE)
ENDIF()

# Add source files to library
ALLPIX_MODULE_SOURCES(${MODULE_NAME}
ALLPIX_MODULE_SOURCES(
    ${MODULE_NAME}
    DepositionCosmicsModule.cpp
    CosmicsGeneratorActionG4.cpp
    RNGWrapper.cpp
+7 −7
Original line number Diff line number Diff line
@@ -152,15 +152,15 @@ void GenericPropagationModule::create_output_plots(uint64_t event_num,
    double start_time = std::numeric_limits<double>::max();
    unsigned int total_charge = 0;
    unsigned int max_charge = 0;
    for(auto& [deposit, points] : output_plot_points) {
        for(auto& point : points) {
    for(const auto& [deposit, points] : output_plot_points) {
        for(const auto& point : points) {
            minX = std::min(minX, point.x() / scale_x);
            maxX = std::max(maxX, point.x() / scale_x);

            minY = std::min(minY, point.y() / scale_y);
            maxY = std::max(maxY, point.y() / scale_y);
        }
        auto& [time, charge, type, state] = deposit;
        const auto& [time, charge, type, state] = deposit;
        start_time = std::min(start_time, time);
        total_charge += charge;
        max_charge = std::max(max_charge, charge);
@@ -241,14 +241,14 @@ void GenericPropagationModule::create_output_plots(uint64_t event_num,
    // The vector of unique_pointers is required in order not to delete the objects before the canvas is drawn.
    std::vector<std::unique_ptr<TPolyLine3D>> lines;
    short current_color = 1;
    for(auto& [deposit, points] : output_plot_points) {
    for(const auto& [deposit, points] : output_plot_points) {
        // Check if we should plot this point:
        if(plotting_state != CarrierState::UNKNOWN && plotting_state != std::get<3>(deposit)) {
            continue;
        }

        auto line = std::make_unique<TPolyLine3D>();
        for(auto& point : points) {
        for(const auto& point : points) {
            line->SetNextPoint(point.x() / scale_x, point.y() / scale_y, point.z());
        }
        // Plot all lines with at least three points with different color
@@ -384,8 +384,8 @@ void GenericPropagationModule::create_output_plots(uint64_t event_num,
            text->Draw();

            // Plot all the required points
            for(auto& [deposit, points] : output_plot_points) {
                auto& [time, charge, type, state] = deposit;
            for(const auto& [deposit, points] : output_plot_points) {
                const auto& [time, charge, type, state] = deposit;

                // Check if we should plot this point:
                if(plotting_state != CarrierState::UNKNOWN && plotting_state != state) {
Loading