diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 084d0c2dbb2..2e6b5f42fa9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,7 +81,7 @@ build_exatrkx_cpu: -DACTS_EXATRKX_ENABLE_CUDA=OFF - ccache -z - - cmake --build build -- -j2 + - cmake --build build -- -j6 - ccache -s build_exatrkx: @@ -119,7 +119,7 @@ build_exatrkx: -DCMAKE_CUDA_ARCHITECTURES="75;86" - ccache -z - - cmake --build build -- -j2 + - cmake --build build -- -j6 - ccache -s # test_exatrkx_unittests: @@ -186,7 +186,7 @@ build_linux_ubuntu: -DACTS_BUILD_PLUGIN_ONNX=ON - ccache -z - - cmake --build build -- -j2 + - cmake --build build -- -j6 - ccache -s linux_test_examples: @@ -271,7 +271,7 @@ linux_physmon: -DCMAKE_CXX_STANDARD=${CXXSTD} - ccache -z - - cmake --build build -- -j2 + - cmake --build build -- -j6 - ccache -s - ctest --test-dir build -j$(nproc) @@ -367,7 +367,7 @@ linux_ubuntu_2204_clang: -DACTS_BUILD_PLUGIN_GEOMODEL=OFF # GeoModel is not in LCG at this point - ccache -z - - cmake --build build -- -j2 + - cmake --build build -- -j6 - ccache -s - ctest --test-dir build -j$(nproc) diff --git a/.merge-sentinel.yml b/.merge-sentinel.yml index f62cdb682ce..1394407a063 100644 --- a/.merge-sentinel.yml +++ b/.merge-sentinel.yml @@ -14,6 +14,7 @@ rules: required_checks: - Docs / docs - Analysis / build_debug + - SonarCloud Code Analysis required_pattern: - "Builds / *" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00105903a32..ea1ef7ec79a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,3 +86,10 @@ repos: language: system entry: docs/parse_cmake_options.py --write docs/getting_started.md files: ^CMakeLists.txt$ + + - repo: local + hooks: + - id: leftover_conflict_markers + name: Leftover conflict markers + language: system + entry: git diff --staged --check diff --git a/Alignment/include/ActsAlignment/Kernel/Alignment.hpp b/Alignment/include/ActsAlignment/Kernel/Alignment.hpp index 0d0a524f7bb..2a14da18476 100644 --- a/Alignment/include/ActsAlignment/Kernel/Alignment.hpp +++ b/Alignment/include/ActsAlignment/Kernel/Alignment.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -149,7 +149,7 @@ struct Alignment { /// @tparam fit_options_t The fit options type /// /// @param gctx The current geometry context object - /// @param sourcelinks The fittable uncalibrated measurements + /// @param sourceLinks The fittable uncalibrated measurements /// @param sParameters The initial track parameters /// @param fitOptions The fit Options steering the fit /// @param idxedAlignSurfaces The idxed surfaces to be aligned @@ -161,7 +161,7 @@ struct Alignment { typename fit_options_t> Acts::Result evaluateTrackAlignmentState( const Acts::GeometryContext& gctx, - const std::vector& sourcelinks, + const std::vector& sourceLinks, const start_parameters_t& sParameters, const fit_options_t& fitOptions, const std::unordered_map& idxedAlignSurfaces, diff --git a/Alignment/include/ActsAlignment/Kernel/Alignment.ipp b/Alignment/include/ActsAlignment/Kernel/Alignment.ipp index 9e11bdbb09d..09170ee9ca9 100644 --- a/Alignment/include/ActsAlignment/Kernel/Alignment.ipp +++ b/Alignment/include/ActsAlignment/Kernel/Alignment.ipp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" @@ -15,7 +15,7 @@ template ActsAlignment::Alignment::evaluateTrackAlignmentState( const Acts::GeometryContext& gctx, - const std::vector& sourcelinks, + const std::vector& sourceLinks, const start_parameters_t& sParameters, const fit_options_t& fitOptions, const std::unordered_map& idxedAlignSurfaces, @@ -24,8 +24,8 @@ ActsAlignment::Alignment::evaluateTrackAlignmentState( Acts::VectorMultiTrajectory{}}; // Convert to Acts::SourceLink during iteration - Acts::SourceLinkAdapterIterator begin{sourcelinks.begin()}; - Acts::SourceLinkAdapterIterator end{sourcelinks.end()}; + Acts::SourceLinkAdapterIterator begin{sourceLinks.begin()}; + Acts::SourceLinkAdapterIterator end{sourceLinks.end()}; // Perform the fit auto fitRes = m_fitter.fit(begin, end, sParameters, fitOptions, tracks); @@ -82,13 +82,13 @@ void ActsAlignment::Alignment::calculateAlignmentParameters( alignResult.numTracks = trajectoryCollection.size(); double sumChi2ONdf = 0; for (unsigned int iTraj = 0; iTraj < trajectoryCollection.size(); iTraj++) { - const auto& sourcelinks = trajectoryCollection.at(iTraj); + const auto& sourceLinks = trajectoryCollection.at(iTraj); const auto& sParameters = startParametersCollection.at(iTraj); // Set the target surface fitOptionsWithRefSurface.referenceSurface = &sParameters.referenceSurface(); // The result for one single track auto evaluateRes = evaluateTrackAlignmentState( - fitOptions.geoContext, sourcelinks, sParameters, + fitOptions.geoContext, sourceLinks, sParameters, fitOptionsWithRefSurface, alignResult.idxedAlignSurfaces, alignMask); if (!evaluateRes.ok()) { ACTS_DEBUG("Evaluation of alignment state for track " << iTraj diff --git a/Alignment/include/ActsAlignment/Kernel/AlignmentError.hpp b/Alignment/include/ActsAlignment/Kernel/AlignmentError.hpp index 88cae792a8f..9f77022929e 100644 --- a/Alignment/include/ActsAlignment/Kernel/AlignmentError.hpp +++ b/Alignment/include/ActsAlignment/Kernel/AlignmentError.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Alignment/include/ActsAlignment/Kernel/AlignmentMask.hpp b/Alignment/include/ActsAlignment/Kernel/AlignmentMask.hpp index 735f7de86fb..f3849589152 100644 --- a/Alignment/include/ActsAlignment/Kernel/AlignmentMask.hpp +++ b/Alignment/include/ActsAlignment/Kernel/AlignmentMask.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp b/Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp index 64e7f9c0eb7..1bb21fdc8bd 100644 --- a/Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp +++ b/Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Alignment/src/Kernel/detail/AlignmentEngine.cpp b/Alignment/src/Kernel/detail/AlignmentEngine.cpp index c5c012d08d7..23ff0b14433 100644 --- a/Alignment/src/Kernel/detail/AlignmentEngine.cpp +++ b/Alignment/src/Kernel/detail/AlignmentEngine.cpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #include "ActsAlignment/Kernel/detail/AlignmentEngine.hpp" diff --git a/CI/check_license.py b/CI/check_license.py index 73bc343f763..68296ae6f0e 100755 --- a/CI/check_license.py +++ b/CI/check_license.py @@ -32,90 +32,29 @@ def err(string): return string -class CommitInfo: - date = None - year = None - author = None - subject = None - body = None - - -def check_git_dates(src): - output = ( - check_output(["git", "log", "--format={{{%an|%ad|%s|%b}}}", "--", src]) - .decode("utf-8") - .strip() - ) - - # find single outputs - commits = re.findall(r"{{{((?:.|\n)*?)}}}", output) - commits = [c for c in commits if "[ignore-license]" not in c] - commits = [c.split("|") for c in commits] - - # print(output) - mod = commits[0] - add = commits[-1] - - madd = re.match(r".*\d{2}:\d{2}:\d{2} (\d{4})", add[1]) - assert madd != None, "Regex did not match git log output" - mmod = re.match(r".*\d{2}:\d{2}:\d{2} (\d{4})", mod[1]) - assert mmod != None, "Regex did not match git log output" - - addcommit = CommitInfo() - addcommit.date = add[1] - addcommit.year = int(madd.group(1)) - addcommit.author = add[0] - addcommit.subject = add[2] - addcommit.body = add[3] - - modcommit = CommitInfo() - modcommit.date = mod[1] - modcommit.year = int(mmod.group(1)) - modcommit.author = mod[0] - modcommit.subject = mod[2] - modcommit.body = mod[3] - - return addcommit, modcommit - - def main(): p = argparse.ArgumentParser() p.add_argument("input", nargs="+") p.add_argument( "--fix", action="store_true", help="Attempt to fix any license issues found." ) - p.add_argument( - "--check-years", - action="store_true", - help="Check the license year info using git info for each file.", - ) - p.add_argument( - "--fail-year-mismatch", - action="store_true", - help="Fail if year in license statement is not valid.", - ) p.add_argument("--exclude", "-e", action="append", default=EXCLUDE) args = p.parse_args() print(args.exclude) + extensions = ["cpp", "hpp", "ipp", "cuh", "cu", "C", "h"] + if len(args.input) == 1 and os.path.isdir(args.input[0]): + find_command = ["find", args.input[0]] + for ext in extensions: + find_command.extend(["-iname", f"*.{ext}", "-or"]) + # Remove the last "-or" for a valid command + find_command = find_command[:-1] + srcs = ( str( - check_output( - [ - "find", - args.input[0], - "-iname", - "*.cpp", - "-or", - "-iname", - "*.hpp", - "-or", - "-iname", - "*.ipp", - ] - ), + check_output(find_command), "utf-8", ) .strip() @@ -125,30 +64,30 @@ def main(): else: srcs = args.input - year = int(datetime.now().strftime("%Y")) + founding_year = 2016 + year_str = f"{founding_year}" + year = year_str - raw = """// This file is part of the Acts project. + raw = """// This file is part of the ACTS project. // -// Copyright (C) {year} CERN for the benefit of the Acts project +// Copyright (C) {year} CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/.""" +// file, You can obtain one at https://mozilla.org/MPL/2.0/.""" reg = ( - r"\A// This file is part of the Acts project.\n" + r"\A// This file is part of the ACTS project.\n" + r"//\n" - + r"// Copyright \(C\) (?P.*) CERN for the benefit of the Acts project\n" + + r"// Copyright \(C\) (?P.*) CERN for the benefit of the ACTS project\n" + r"//\n" + r"// This Source Code Form is subject to the terms of the Mozilla Public\n" + r"// License, v\. 2\.0\. If a copy of the MPL was not distributed with this\n" - + r"// file, You can obtain one at http://mozilla.org/MPL/2.0/.\Z" + + r"// file, You can obtain one at https://mozilla.org/MPL/2.0/.\Z" ) ref = re.compile(reg, re.M) clean_re = re.compile(r"(\(C\)) (.*) (CERN)", re.M) - year_re = re.compile(r"^(?P20\d{2}|(?P20\d{2})-(?P20\d{2}))$") - extract_re = re.compile(r"(20\d{2})-?(20\d{2})?") def clean(s): return clean_re.sub(r"\1 XXXX \3", s) @@ -156,54 +95,33 @@ def clean(s): def get_clean_lines(s): return [clean(l) + "\n" for l in s.split("\n")] - def validate_years(year1, year2): - if year1 and year2: - year1 = int(year1) - year2 = int(year2) - if year1 >= year2: - return False - if year1 > year or year2 > year: - return False - else: - theyear = int(year1 if year1 else year2) - if theyear > year: - return False - return True - error_summary = "" - info_summary = "" - def eprint(*args): + def eprint(string): nonlocal error_summary - error_summary += " ".join(map(str, args)) + "\n" - - def year_print(*pargs): - nonlocal error_summary - nonlocal info_summary - string = " ".join(map(str, pargs)) + "\n" - if args.fail_year_mismatch: - error_summary += string - else: - info_summary += string + error_summary += string + "\n" exit = 0 srcs = list(srcs) nsrcs = len(srcs) step = max(int(nsrcs / 20), 1) + # Iterate over all files for i, src in enumerate(srcs): if any([fnmatch(src, e) for e in args.exclude]): continue + # Print progress if nsrcs > 1 and i % step == 0: - string = "{}/{} -> {:.2f}%".format(i, nsrcs, i / float(nsrcs) * 100.0) + string = f"{i}/{nsrcs} -> {i / float(nsrcs) * 100.0:.2f}%" if sys.stdout.isatty(): sys.stdout.write(string + "\r") else: print(string) + # Read the header with open(src, "r+") as f: license = "" - for x in range(len(raw)): + for _ in range(len(raw)): line = f.readline() if not line.startswith("//"): break @@ -211,192 +129,56 @@ def year_print(*pargs): license = ("".join(license)).strip() m = ref.search(license) - if m == None: + # License could not be found in header + if m is None: eprint("Invalid / missing license in " + src + "") - exp = [l + "\n" for l in raw.format(year="XXXX").split("\n")] + exp = [l + "\n" for l in raw.format(year=year_str).split("\n")] act = get_clean_lines(license) diff = difflib.unified_diff(exp, act) eprint("".join(diff)) - eprint() + eprint("") if args.fix: eprint("-> fixing file (prepend)") f.seek(0) file_content = f.read() f.seek(0) - stmnt = raw.format(year=year) + stmnt = raw.format(year=year_str) f.write(stmnt + "\n\n") f.write(file_content) exit = 1 - else: - # we have a match, need to verify year string is right - - if args.check_years: - git_add_commit, git_mod_commit = check_git_dates(src) - git_add_year = git_add_commit.year - git_mod_year = git_mod_commit.year - year_act = m.group("year") - ym = year_re.match(year_act) - valid = True - if not ym: - eprint("Year string does not match format in {}".format(src)) - eprint("Expected: YYYY or YYYY-YYYY (year or year range)") - eprint("Actual: {}\n".format(year_act)) - - if args.fix: - extract = extract_re.search(year_act) - year1 = extract.group(1) - year2 = extract.group(2) - - exit = 1 - valid = False - - else: - extract = extract_re.search(year_act) - year1 = extract.group(1) - year2 = extract.group(2) - - if not validate_years(year1, year2): - eprint("Year string is not valid in {}".format(src)) - eprint("Year string is: " + year_act + "\n") - exit = 1 - valid = False - - if args.check_years: - if git_add_year != git_mod_year: - # need year range in licence - if not (year1 and year2): - year_print("File: {}".format(src)) - # year_print("o File was modified in a different year ({}) than it was added ({})." - # .format(git_mod_year, git_add_year)) - year_print( - "- File was added in {}".format(git_add_year) - ) - year_print( - "- File was modified on {} by {}:\n{}".format( - git_mod_commit.date, - git_mod_commit.author, - git_mod_commit.subject + git_mod_commit.body, - ) - ) - year_print( - "=> License should say {}-{}".format( - git_add_year, git_mod_year - ) - ) - - act_year = year1 if year1 else year2 - year_print( - err( - "{} But says: {}".format(CROSS_SYMBOL, act_year) - ) - ) - - if args.fail_year_mismatch: - exit = 1 - year_print("\n") - else: - year_print("This is not treated as an error\n") - valid = False - else: - if ( - int(year1) != git_add_year - or int(year2) != git_mod_year - ): - year_print("File: {}".format(src)) - year_print( - "Year range {}-{} does not match range from git {}-{}".format( - year1, year2, git_add_year, git_mod_year - ) - ) - year_print( - "- File was added in {}".format(git_add_year) - ) - year_print( - "- File was modified on {} by {}:\n{}".format( - git_mod_commit.date, - git_mod_commit.author, - git_mod_commit.subject - + git_mod_commit.body, - ) - ) - year_print( - "=> License should say {}-{}".format( - git_add_year, git_mod_year - ) - ) - year_print( - err( - "{} But says: {}-{}".format( - CROSS_SYMBOL, year1, year2 - ) - ) - ) - if args.fail_year_mismatch: - exit = 1 - year_print("\n") - else: - year_print("This is not treated as an error\n") - valid = False - - else: - if int(year1) < git_mod_year: - year_print("File: {}".format(src)) - year_print( - "- Year {} does not match git modification year {}".format( - year1, git_mod_year - ) - ) - year_print( - "- File was modified on {} by {}:\n{}".format( - git_mod_commit.date, - git_mod_commit.author, - git_mod_commit.subject + git_mod_commit.body, - ) - ) - year_print( - "=> License should say {}".format(git_mod_year) - ) - year_print( - err("{} But says: {}".format(CROSS_SYMBOL, year1)) - ) - if args.fail_year_mismatch: - exit = 1 - year_print("\n") - else: - year_print("This is not treated as an error\n") - valid = False - - if args.fix and not valid: + continue + + # We have a match, need to verify year string is right + year_act = m.group("year") + if year_act != year_str: + exit = 1 + + eprint(f"File: {src}") + eprint(f"=> License should say {year_str}") + eprint(err(f"{CROSS_SYMBOL} But says: {year_act}")) + + if args.fix: eprint("-> fixing file (patch year)") - year_str = "2016-{}".format(year) - if args.check_years: - if git_add_year == git_mod_year: - year_str = "{}".format(git_add_year) - else: - year_str = "{}-{}".format(git_add_year, git_mod_year) + new_license = raw.format(year=year_str) # preserve rest of file as is - if args.check_years: - old_license_len = len(license) - f.seek(old_license_len) - file_body = f.read() - f.seek(0) - f.truncate() + old_license_len = len(license) + f.seek(old_license_len) + file_body = f.read() + f.seek(0) + f.truncate() f.seek(0) f.write(new_license) + f.write(file_body) - if args.check_years: - f.write(file_body) + eprint("") - print("\n--- INFO ---\n") - print(info_summary) - print("\n--- ERROR ---\n") print(error_summary) if exit != 0 and not args.fix: diff --git a/CI/check_smearing_config.py b/CI/check_smearing_config.py index b3b9ad0d4c8..629095976ea 100755 --- a/CI/check_smearing_config.py +++ b/CI/check_smearing_config.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -# This file is part of the Acts project. +# This file is part of the ACTS project. # -# Copyright (C) 2021 CERN for the benefit of the Acts project +# Copyright (C) 2016 CERN for the benefit of the ACTS project # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http:#mozilla.org/MPL/2.0/. +# file, You can obtain one at https://mozilla.org/MPL/2.0/. # Configuration taken from: https://arxiv.org/pdf/1904.06778.pdf # See also https://github.com/acts-project/acts/issues/946 diff --git a/CI/physmon/phys_perf_mon.sh b/CI/physmon/phys_perf_mon.sh index fa3027bb8f6..841fad5c376 100755 --- a/CI/physmon/phys_perf_mon.sh +++ b/CI/physmon/phys_perf_mon.sh @@ -20,8 +20,8 @@ shopt -s extglob mode=${1:-all} -if ! [[ $mode = @(all|kf|gsf|gx2f|fullchains|simulation) ]]; then - echo "Usage: $0 (outdir)" +if ! [[ $mode = @(all|kf|gsf|gx2f|refit_kf|refit_gsf|fullchains|simulation) ]]; then + echo "Usage: $0 (outdir)" exit 1 fi @@ -152,6 +152,12 @@ fi if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then run_physmon_gen "Truth Tracking GX2F" "trackfitting_gx2f" fi +if [[ "$mode" == "all" || "$mode" == "refit_kf" ]]; then + run_physmon_gen "Truth Tracking KF refit" "trackrefitting_kf" +fi +if [[ "$mode" == "all" || "$mode" == "refit_gsf" ]]; then + run_physmon_gen "Truth Tracking GSF refit" "trackrefitting_gsf" +fi if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then run_physmon_gen "CKF single muon" "trackfinding_1muon" run_physmon_gen "CKF muon 50" "trackfinding_4muon_50vertices" @@ -411,6 +417,26 @@ if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then --config CI/physmon/config/trackfitting_gx2f.yml fi +if [[ "$mode" == "all" || "$mode" == "kf_refit" ]]; then + run_histcmp \ + $outdir/data/trackrefitting_kf/performance_trackrefitting.root \ + $refdir/trackrefitting_kf/performance_trackrefitting.root \ + "Truth tracking (KF refit)" \ + trackrefitting_kf/performance_trackrefitting.html \ + trackrefitting_kf/performance_trackrefitting_plots \ + --config CI/physmon/config/trackfitting_kf.yml +fi + +if [[ "$mode" == "all" || "$mode" == "gsf_refit" ]]; then + run_histcmp \ + $outdir/data/trackrefitting_gsf/performance_trackrefitting.root \ + $refdir/trackrefitting_gsf/performance_trackrefitting.root \ + "Truth tracking (GSF refit)" \ + trackrefitting_gsf/performance_trackrefitting.html \ + trackrefitting_gsf/performance_trackrefitting_plots \ + --config CI/physmon/config/trackfitting_gsf.yml +fi + if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then trackfinding "trackfinding | single muon | truth smeared seeding" trackfinding_1muon/truth_smeared trackfinding "trackfinding | single muon | truth estimated seeding" trackfinding_1muon/truth_estimated diff --git a/CI/physmon/reference/trackfinding_1muon/orthogonal/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/orthogonal/performance_ckf.root index 5234424f09b..305a3bf724f 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/orthogonal/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/orthogonal/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/orthogonal/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/orthogonal/tracksummary_ckf_hist.root index c75d3d72a67..6288387ee09 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/orthogonal/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/orthogonal/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root index a1c99fe2ee0..a9a127efa07 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root index 74b3bcac470..71ece3a740b 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root index a829a2d9280..8b9f8ae4d1d 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root index c61c4932723..d6061a509fb 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root index ca0d1a73f0d..e38e388edce 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root index 44e9fe24671..4e51b3eb49c 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf.root index 6a6ecc7d054..c4507b9636a 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root index c6eca443a79..c4c2af31ec4 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_4muon_50vertices/tracksummary_ckf_hist.root index 07ad96265d6..4ea283d03da 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root index 75a481a3e29..2c7626e0516 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root index f9ffefcbdc1..c5d08a93db0 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root index 7836b12cd4f..26472832eeb 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root index 0980823e57c..1a1651abd5c 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root index 7af2710b5a8..74c3632898b 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackrefitting_gsf/performance_trackrefitting.root b/CI/physmon/reference/trackrefitting_gsf/performance_trackrefitting.root new file mode 100644 index 00000000000..d888ad406d8 Binary files /dev/null and b/CI/physmon/reference/trackrefitting_gsf/performance_trackrefitting.root differ diff --git a/CI/physmon/reference/trackrefitting_kf/performance_trackrefitting.root b/CI/physmon/reference/trackrefitting_kf/performance_trackrefitting.root new file mode 100644 index 00000000000..aade25ba5a2 Binary files /dev/null and b/CI/physmon/reference/trackrefitting_kf/performance_trackrefitting.root differ diff --git a/CI/physmon/workflows/physmon_trackrefitting_gsf.py b/CI/physmon/workflows/physmon_trackrefitting_gsf.py new file mode 100755 index 00000000000..5477121942a --- /dev/null +++ b/CI/physmon/workflows/physmon_trackrefitting_gsf.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +import tempfile +from pathlib import Path +import shutil + +import acts +from truth_tracking_gsf_refitting import runRefittingGsf + +from physmon_common import makeSetup + +setup = makeSetup() + +with tempfile.TemporaryDirectory() as temp: + s = acts.examples.Sequencer( + events=10000, + numThreads=-1, + logLevel=acts.logging.INFO, + ) + + tp = Path(temp) + runRefittingGsf( + trackingGeometry=setup.trackingGeometry, + field=setup.field, + digiConfigFile=setup.digiConfig, + outputDir=tp, + s=s, + ) + + s.run() + + perf_file = tp / "performance_gsf_refit.root" + assert perf_file.exists(), "Performance file not found" + shutil.copy(perf_file, setup.outdir / "performance_trackrefitting.root") diff --git a/CI/physmon/workflows/physmon_trackrefitting_kf.py b/CI/physmon/workflows/physmon_trackrefitting_kf.py new file mode 100755 index 00000000000..ea82d26c701 --- /dev/null +++ b/CI/physmon/workflows/physmon_trackrefitting_kf.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +import tempfile +from pathlib import Path +import shutil + +import acts +from truth_tracking_kalman_refitting import runRefittingKf + +from physmon_common import makeSetup + +setup = makeSetup() + +with tempfile.TemporaryDirectory() as temp: + s = acts.examples.Sequencer( + events=10000, + numThreads=-1, + logLevel=acts.logging.INFO, + ) + + tp = Path(temp) + runRefittingKf( + trackingGeometry=setup.trackingGeometry, + field=setup.field, + digiConfigFile=setup.digiConfig, + outputDir=tp, + s=s, + ) + + s.run() + + perf_file = tp / "performance_kf_refit.root" + assert perf_file.exists(), "Performance file not found" + shutil.copy(perf_file, setup.outdir / "performance_trackrefitting.root") diff --git a/CI/test_coverage.py b/CI/test_coverage.py index 06b13a06abb..0488a71d85d 100755 --- a/CI/test_coverage.py +++ b/CI/test_coverage.py @@ -41,7 +41,7 @@ def call(cmd): ret, gcovr_version_text = check_output(["gcovr", "--version"]) gcovr_version = tuple( - map(int, re.match("gcovr (\d+\.\d+)", gcovr_version_text).group(1).split(".")) + map(int, re.match(r"gcovr (\d+\.\d+)", gcovr_version_text).group(1).split(".")) ) extra_flags = [] @@ -63,7 +63,7 @@ def call(cmd): if not os.path.exists(coverage_dir): os.makedirs(coverage_dir) -excludes = ["-e", "../Tests/", "-e", ".*json\.hpp"] +excludes = ["-e", "../Tests/", "-e", r".*json\.hpp"] # create the html report call( diff --git a/CMakeLists.txt b/CMakeLists.txt index 2444a405ab6..e8e9ab3f583 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ option(ACTS_FORCE_ASSERTIONS "Force assertions regardless of build type" OFF) option(ACTS_USE_SYSTEM_LIBS "Use system libraries by default" OFF) # plugins related options option(ACTS_USE_SYSTEM_ACTSVG "Use the ActSVG system library" ${ACTS_USE_SYSTEM_LIBS}) -option(ACTS_USE_SYSTEM_GEOMODEL "Use a system-provided GeoModel installation" ${ACTS_USE_SYSTEM_LIBS}) option(ACTS_USE_SYSTEM_COVFIE "Use a system-provided covfie installation" ${ACTS_USE_SYSTEM_LIBS}) option(ACTS_USE_SYSTEM_DETRAY "Use a system-provided detray installation" ${ACTS_USE_SYSTEM_LIBS}) option(ACTS_USE_SYSTEM_TRACCC "Use a system-provided traccc installation" ${ACTS_USE_SYSTEM_LIBS}) @@ -168,6 +167,10 @@ set_option_if( ACTS_BUILD_PLUGIN_JSON ACTS_BUILD_PLUGIN_TRACCC ) +set_option_if( + ACTS_BUILD_PLUGIN_ACTSVG + ACTS_BUILD_PLUGIN_TRACCC +) set_option_if( ACTS_BUILD_PLUGIN_HASHING ACTS_BUILD_EXAMPLES_HASHING @@ -221,11 +224,10 @@ endif() # minimal dependency versions. they are defined here in a single place so # they can be easily upgraded, although they might not be used if the # dependency is included via `add_subdirectory(...)`. -set(_acts_actsvg_version 0.4.47) +set(_acts_actsvg_version 0.4.50) set(_acts_boost_version 1.71.0) set(_acts_dd4hep_version 1.21) set(_acts_edm4hep_version 0.7) -set(_acts_geomodel_version 6.3.0) set(_acts_eigen3_version 3.4.0) set(_acts_podio_version 1.0.1) # will try this first set(_acts_podio_fallback_version 0.16) # if not found, will try this one @@ -237,8 +239,8 @@ set(_acts_root_version 6.20) set(_acts_tbb_version 2020.1) set(_acts_pythia8_version 8.309) set(_acts_pybind11_version 2.13.1) -set(_acts_detray_version 0.72.1) -set(_acts_traccc_version 0.15.0) +set(_acts_detray_version 0.75.3) +set(_acts_traccc_version 0.16.0) set(_acts_covfie_version 0.10.0) set(_acts_vecmem_version 1.4.0) set(_acts_algebraplugins_version 0.22.0) @@ -370,8 +372,24 @@ if(ACTS_BUILD_PLUGIN_JSON) endif() endif() if(ACTS_BUILD_PLUGIN_GEOMODEL) - find_package(GeoModelCore ${_acts_geomodel_version} REQUIRED CONFIG) - find_package(GeoModelIO ${_acts_geomodel_version} REQUIRED CONFIG) + find_package(GeoModelCore CONFIG) + if(NOT GeoModelCore_FOUND) + message( + FATAL_ERROR + "GeoModel not found. Please install GeoModel or set ACTS_BUILD_PLUGIN_GEOMODEL to OFF." + ) + endif() + + set(_gm_ver_min 6.3.0) + + if(GeoModelCore_VERSION VERSION_LESS _gm_ver_min) + message( + FATAL_ERROR + "GeoModel version ${GeoModelCore_VERSION} is insufficient. Please install GeoModel version ${_gm_ver_min} or newer." + ) + endif() + # find other GeoModel components of EXACT same version + find_package(GeoModelIO ${GeoModelCore_VERSION} REQUIRED EXACT CONFIG) endif() if(ACTS_BUILD_PLUGIN_TGEO) find_package( diff --git a/CMakePresets.json b/CMakePresets.json index bee5ab514df..2aef0f3fe94 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -46,7 +46,7 @@ "inherits": "common", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "CMAKE_CXX_FLAGS": "-Werror", + "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "ACTS_FORCE_ASSERTIONS": "ON", "ACTS_ENABLE_LOG_FAILURE_THRESHOLD": "ON", "ACTS_BUILD_BENCHMARKS": "ON", diff --git a/Core/ActsVersion.hpp.in b/Core/ActsVersion.hpp.in index 4dc1ba7acb7..982c9d4fb5c 100644 --- a/Core/ActsVersion.hpp.in +++ b/Core/ActsVersion.hpp.in @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -43,7 +43,6 @@ struct VersionInfo { static VersionInfo fromLibrary(); bool operator==(const VersionInfo& other) const; - bool operator!=(const VersionInfo& other) const { return !(*this == other); } friend std::ostream& operator<<(std::ostream& os, const VersionInfo& vi); diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index eeb6bc8b92a..554656f514c 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -110,6 +110,7 @@ add_subdirectory(src/MagneticField) add_subdirectory(src/Material) add_subdirectory(src/Navigation) add_subdirectory(src/Propagator) +add_subdirectory(src/Seeding) add_subdirectory(src/Surfaces) add_subdirectory(src/TrackFinding) add_subdirectory(src/TrackFitting) diff --git a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp index 078d155a27a..13bd9822c86 100644 --- a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp +++ b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.ipp b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.ipp index ec79c36260d..32cbdbbd1e3 100644 --- a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.ipp +++ b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.ipp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp index 1e6019ffd8f..c5c0293b8ad 100644 --- a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp +++ b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp index 3dcf1a20a01..58742d7d11a 100644 --- a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp +++ b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -182,7 +182,6 @@ std::vector Acts::ScoreBasedAmbiguityResolution::simpleScore( ACTS_DEBUG("---> Number of outliers: " << trackFeatures.nOutliers); if ((trackFeatures.nHits < detector.minHits) || - (trackFeatures.nHits > detector.maxHits) || (trackFeatures.nHoles > detector.maxHoles) || (trackFeatures.nOutliers > detector.maxOutliers)) { score = 0; @@ -333,7 +332,6 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( ACTS_DEBUG("---> Number of outliers: " << trackFeatures.nOutliers); if ((trackFeatures.nHits < detector.minHits) || - (trackFeatures.nHits > detector.maxHits) || (trackFeatures.nHoles > detector.maxHoles) || (trackFeatures.nOutliers > detector.maxOutliers)) { score = 0; diff --git a/Core/include/Acts/Clusterization/Clusterization.hpp b/Core/include/Acts/Clusterization/Clusterization.hpp index 39a1dc9b656..a7b4d853b20 100644 --- a/Core/include/Acts/Clusterization/Clusterization.hpp +++ b/Core/include/Acts/Clusterization/Clusterization.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -13,6 +13,26 @@ namespace Acts::Ccl { +template +concept HasRetrievableColumnInfo = requires(Cell cell) { + { getCellColumn(cell) } -> std::same_as; +}; + +template +concept HasRetrievableRowInfo = requires(Cell cell) { + { getCellRow(cell) } -> std::same_as; +}; + +template +concept HasRetrievableLabelInfo = requires(Cell cell) { + { getCellLabel(cell) } -> std::same_as; +}; + +template +concept CanAcceptCell = requires(Cell cell, Cluster cluster) { + { clusterAddCell(cluster, cell) } -> std::same_as; +}; + using Label = int; constexpr Label NO_LABEL = 0; @@ -28,17 +48,21 @@ enum class ConnectResult { // Default connection type for 2-D grids: 4- or 8-cell connectivity template + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) struct Connect2D { - bool conn8; - Connect2D() : conn8{true} {} + bool conn8{true}; + Connect2D() = default; explicit Connect2D(bool commonCorner) : conn8{commonCorner} {} - ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ~Connect2D() = default; }; // Default connection type for 1-D grids: 2-cell connectivity -template +template struct Connect1D { - ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ~Connect1D() = default; }; // Default connection type based on GridDim @@ -49,13 +73,16 @@ struct DefaultConnect { }; template -struct DefaultConnect : public Connect2D { - explicit DefaultConnect(bool commonCorner) : Connect2D(commonCorner) {} - DefaultConnect() : DefaultConnect(true) {} +struct DefaultConnect : public Connect1D { + ~DefaultConnect() override = default; }; template -struct DefaultConnect : public Connect1D {}; +struct DefaultConnect : public Connect2D { + explicit DefaultConnect(bool commonCorner) : Connect2D(commonCorner) {} + DefaultConnect() = default; + ~DefaultConnect() override = default; +}; /// @brief labelClusters /// @@ -70,6 +97,8 @@ struct DefaultConnect : public Connect1D {}; template > + requires( + Acts::Ccl::HasRetrievableLabelInfo) void labelClusters(CellCollection& cells, Connect connect = Connect()); /// @brief mergeClusters @@ -82,6 +111,9 @@ void labelClusters(CellCollection& cells, Connect connect = Connect()); /// @return nothing template + requires(GridDim == 1 || GridDim == 2) && + Acts::Ccl::HasRetrievableLabelInfo< + typename CellCollection::value_type> ClusterCollection mergeClusters(CellCollection& /*cells*/); /// @brief createClusters diff --git a/Core/include/Acts/Clusterization/Clusterization.ipp b/Core/include/Acts/Clusterization/Clusterization.ipp index 16047295912..90a69930ce1 100644 --- a/Core/include/Acts/Clusterization/Clusterization.ipp +++ b/Core/include/Acts/Clusterization/Clusterization.ipp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #include #include @@ -14,60 +14,6 @@ namespace Acts::Ccl::internal { -// Machinery for validating generic Cell/Cluster types at compile-time - -template -struct cellTypeHasRequiredFunctions : std::false_type {}; - -template -struct cellTypeHasRequiredFunctions< - T, 2, - std::void_t())), - decltype(getCellColumn(std::declval())), - decltype(getCellLabel(std::declval()))>> : std::true_type { -}; - -template -struct cellTypeHasRequiredFunctions< - T, 1, - std::void_t())), - decltype(getCellLabel(std::declval()))>> : std::true_type { -}; - -template -struct clusterTypeHasRequiredFunctions : std::false_type {}; - -template -struct clusterTypeHasRequiredFunctions< - T, U, - std::void_t(), std::declval()))>> - : std::true_type {}; - -template -constexpr void staticCheckGridDim() { - static_assert( - GridDim == 1 || GridDim == 2, - "mergeClusters is only defined for grid dimensions of 1 or 2. "); -} - -template -constexpr void staticCheckCellType() { - constexpr bool hasFns = cellTypeHasRequiredFunctions(); - static_assert(hasFns, - "Cell type should have the following functions: " - "'int getCellRow(const Cell&)', " - "'int getCellColumn(const Cell&)', " - "'Label& getCellLabel(Cell&)'"); -} - -template -constexpr void staticCheckClusterType() { - constexpr bool hasFns = clusterTypeHasRequiredFunctions(); - static_assert(hasFns, - "Cluster type should have the following function: " - "'void clusterAddCell(Cluster&, const Cell&)'"); -} - template struct Compare { static_assert(GridDim != 1 && GridDim != 2, @@ -75,25 +21,27 @@ struct Compare { }; // Comparator function object for cells, column-wise ordering -// Specialization for 2-D grid -template -struct Compare { +// Specialization for 1-D grids +template +struct Compare { bool operator()(const Cell& c0, const Cell& c1) const { - int row0 = getCellRow(c0); - int row1 = getCellRow(c1); int col0 = getCellColumn(c0); int col1 = getCellColumn(c1); - return (col0 == col1) ? row0 < row1 : col0 < col1; + return col0 < col1; } }; -// Specialization for 1-D grids +// Specialization for 2-D grid template -struct Compare { + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) +struct Compare { bool operator()(const Cell& c0, const Cell& c1) const { + int row0 = getCellRow(c0); + int row1 = getCellRow(c1); int col0 = getCellColumn(c0); int col1 = getCellColumn(c1); - return col0 < col1; + return (col0 == col1) ? row0 < row1 : col0 < col1; } }; @@ -184,6 +132,10 @@ Connections getConnections(typename std::vector::iterator it, } template + requires( + Acts::Ccl::HasRetrievableLabelInfo && + Acts::Ccl::CanAcceptCell) ClusterCollection mergeClustersImpl(CellCollection& cells) { using Cluster = typename ClusterCollection::value_type; @@ -215,6 +167,8 @@ ClusterCollection mergeClustersImpl(CellCollection& cells) { namespace Acts::Ccl { template + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) ConnectResult Connect2D::operator()(const Cell& ref, const Cell& iter) const { int deltaRow = std::abs(getCellRow(ref) - getCellRow(iter)); @@ -237,7 +191,7 @@ ConnectResult Connect2D::operator()(const Cell& ref, return ConnectResult::eNoConn; } -template +template ConnectResult Connect1D::operator()(const Cell& ref, const Cell& iter) const { int deltaCol = std::abs(getCellColumn(ref) - getCellColumn(iter)); @@ -267,9 +221,10 @@ void recordEquivalences(const internal::Connections seen, } template + requires( + Acts::Ccl::HasRetrievableLabelInfo) void labelClusters(CellCollection& cells, Connect connect) { using Cell = typename CellCollection::value_type; - internal::staticCheckCellType(); internal::DisjointSets ds{}; @@ -277,7 +232,8 @@ void labelClusters(CellCollection& cells, Connect connect) { std::ranges::sort(cells, internal::Compare()); // First pass: Allocate labels and record equivalences - for (auto it = cells.begin(); it != cells.end(); ++it) { + for (auto it = std::ranges::begin(cells); it != std::ranges::end(cells); + ++it) { const internal::Connections seen = internal::getConnections(it, cells, connect); if (seen.nconn == 0) { @@ -299,13 +255,11 @@ void labelClusters(CellCollection& cells, Connect connect) { template + requires(GridDim == 1 || GridDim == 2) && + Acts::Ccl::HasRetrievableLabelInfo< + typename CellCollection::value_type> ClusterCollection mergeClusters(CellCollection& cells) { using Cell = typename CellCollection::value_type; - using Cluster = typename ClusterCollection::value_type; - internal::staticCheckGridDim(); - internal::staticCheckCellType(); - internal::staticCheckClusterType(); - if constexpr (GridDim > 1) { // Sort the cells by their cluster label, only needed if more than // one spatial dimension @@ -318,10 +272,6 @@ ClusterCollection mergeClusters(CellCollection& cells) { template ClusterCollection createClusters(CellCollection& cells, Connect connect) { - using Cell = typename CellCollection::value_type; - using Cluster = typename ClusterCollection::value_type; - internal::staticCheckCellType(); - internal::staticCheckClusterType(); labelClusters(cells, connect); return mergeClusters(cells); } diff --git a/Core/include/Acts/Clusterization/TimedClusterization.hpp b/Core/include/Acts/Clusterization/TimedClusterization.hpp new file mode 100644 index 00000000000..e92ebce44e2 --- /dev/null +++ b/Core/include/Acts/Clusterization/TimedClusterization.hpp @@ -0,0 +1,38 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Clusterization/Clusterization.hpp" +#include "Acts/Definitions/Algebra.hpp" + +#include + +namespace Acts::Ccl { + +template +concept HasRetrievableTimeInfo = requires(Cell cell) { + { getCellTime(cell) } -> std::same_as; +}; + +template +struct TimedConnect : public Acts::Ccl::DefaultConnect { + Acts::ActsScalar timeTolerance{std::numeric_limits::max()}; + + TimedConnect() = default; + TimedConnect(Acts::ActsScalar time); + TimedConnect(Acts::ActsScalar time, bool commonCorner) + requires(N == 2); + ~TimedConnect() override = default; + + ConnectResult operator()(const Cell& ref, const Cell& iter) const override; +}; + +} // namespace Acts::Ccl + +#include "Acts/Clusterization/TimedClusterization.ipp" diff --git a/Core/include/Acts/Clusterization/TimedClusterization.ipp b/Core/include/Acts/Clusterization/TimedClusterization.ipp new file mode 100644 index 00000000000..0e7b3e5bda8 --- /dev/null +++ b/Core/include/Acts/Clusterization/TimedClusterization.ipp @@ -0,0 +1,36 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +namespace Acts::Ccl { + +template +TimedConnect::TimedConnect(Acts::ActsScalar time) + : timeTolerance(time) {} + +template +TimedConnect::TimedConnect(Acts::ActsScalar time, bool commonCorner) + requires(N == 2) + : Acts::Ccl::DefaultConnect(commonCorner), timeTolerance(time) {} + +template +Acts::Ccl::ConnectResult TimedConnect::operator()( + const Cell& ref, const Cell& iter) const { + Acts::Ccl::ConnectResult spaceCompatibility = + Acts::Ccl::DefaultConnect::operator()(ref, iter); + if (spaceCompatibility != Acts::Ccl::ConnectResult::eConn) { + return spaceCompatibility; + } + + if (std::abs(getCellTime(ref) - getCellTime(iter)) < timeTolerance) { + return Acts::Ccl::ConnectResult::eConn; + } + + return Acts::Ccl::ConnectResult::eNoConn; +} + +} // namespace Acts::Ccl diff --git a/Core/include/Acts/Definitions/Algebra.hpp b/Core/include/Acts/Definitions/Algebra.hpp index c489f5ecd94..843958a3282 100644 --- a/Core/include/Acts/Definitions/Algebra.hpp +++ b/Core/include/Acts/Definitions/Algebra.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/Alignment.hpp b/Core/include/Acts/Definitions/Alignment.hpp index 68e9cfa358d..77d8cd8c1e7 100644 --- a/Core/include/Acts/Definitions/Alignment.hpp +++ b/Core/include/Acts/Definitions/Alignment.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/Common.hpp b/Core/include/Acts/Definitions/Common.hpp index 538de54a945..854c54e2bde 100644 --- a/Core/include/Acts/Definitions/Common.hpp +++ b/Core/include/Acts/Definitions/Common.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/Direction.hpp b/Core/include/Acts/Definitions/Direction.hpp index 9254b35a40c..d07646bab26 100644 --- a/Core/include/Acts/Definitions/Direction.hpp +++ b/Core/include/Acts/Definitions/Direction.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -41,7 +41,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static inline constexpr Direction fromScalar(ActsScalar scalar) { + static constexpr Direction fromScalar(ActsScalar scalar) { assert(scalar != 0); return scalar >= 0 ? Value::Positive : Value::Negative; } @@ -53,8 +53,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static inline constexpr Direction fromScalarZeroAsPositive( - ActsScalar scalar) { + static constexpr Direction fromScalarZeroAsPositive(ActsScalar scalar) { return scalar >= 0 ? Value::Positive : Value::Negative; } @@ -62,7 +61,7 @@ class Direction final { /// std::array /// /// @param index is the direction at input - static inline constexpr Direction fromIndex(std::size_t index) { + static constexpr Direction fromIndex(std::size_t index) { if (index == 0u) { return Value::Negative; } @@ -73,7 +72,7 @@ class Direction final { /// objects in std::array /// /// @return either 0 or 1 - inline constexpr std::size_t index() const { + constexpr std::size_t index() const { if (m_value == Value::Negative) { return 0u; } @@ -83,28 +82,24 @@ class Direction final { /// Turns the direction into a signed value /// /// @return a signed value - inline constexpr int sign() const { return static_cast(m_value); } + constexpr int sign() const { return static_cast(m_value); } /// Reverse the direction /// /// @return an opposite direction - inline constexpr Direction invert() const { + constexpr Direction invert() const { return (m_value == Value::Positive) ? Value::Negative : Value::Positive; } std::string toString() const; - inline constexpr Direction() = default; - inline constexpr Direction(Value value) : m_value(value) {} + constexpr Direction() = default; + constexpr Direction(Value value) : m_value(value) {} - inline constexpr bool operator==(Direction other) const { + constexpr bool operator==(Direction other) const { return m_value == other.m_value; } - inline constexpr bool operator!=(Direction other) const { - return m_value != other.m_value; - } - private: Value m_value = Value::Positive; }; @@ -113,15 +108,15 @@ std::ostream& operator<<(std::ostream& os, Direction dir); // Direction * T -inline constexpr int operator*(Direction dir, int value) { +constexpr int operator*(Direction dir, int value) { return dir.sign() * value; } -inline constexpr float operator*(Direction dir, float value) { +constexpr float operator*(Direction dir, float value) { return dir.sign() * value; } -inline constexpr double operator*(Direction dir, double value) { +constexpr double operator*(Direction dir, double value) { return dir.sign() * value; } @@ -131,15 +126,15 @@ inline Acts::Vector3 operator*(Direction dir, const Acts::Vector3& value) { // T * Direction -inline constexpr int operator*(int value, Direction dir) { +constexpr int operator*(int value, Direction dir) { return value * dir.sign(); } -inline constexpr float operator*(float value, Direction dir) { +constexpr float operator*(float value, Direction dir) { return value * dir.sign(); } -inline constexpr double operator*(double value, Direction dir) { +constexpr double operator*(double value, Direction dir) { return value * dir.sign(); } @@ -149,17 +144,17 @@ inline Acts::Vector3 operator*(const Acts::Vector3& value, Direction dir) { // T *= Direction -inline constexpr int operator*=(int& value, Direction dir) { +constexpr int operator*=(int& value, Direction dir) { value *= dir.sign(); return value; } -inline constexpr float operator*=(float& value, Direction dir) { +constexpr float operator*=(float& value, Direction dir) { value *= dir.sign(); return value; } -inline constexpr double operator*=(double& value, Direction dir) { +constexpr double operator*=(double& value, Direction dir) { value *= dir.sign(); return value; } diff --git a/Core/include/Acts/Definitions/ParticleData.hpp b/Core/include/Acts/Definitions/ParticleData.hpp index 420121f4bcf..8cb97a9df9d 100644 --- a/Core/include/Acts/Definitions/ParticleData.hpp +++ b/Core/include/Acts/Definitions/ParticleData.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/PdgParticle.hpp b/Core/include/Acts/Definitions/PdgParticle.hpp index 28f7d248493..f6967671136 100644 --- a/Core/include/Acts/Definitions/PdgParticle.hpp +++ b/Core/include/Acts/Definitions/PdgParticle.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -36,7 +36,7 @@ enum PdgParticle : std::int32_t { }; /// Convert an anti-particle to its particle and leave particles as-is. -static constexpr inline PdgParticle makeAbsolutePdgParticle(PdgParticle pdg) { +static constexpr PdgParticle makeAbsolutePdgParticle(PdgParticle pdg) { const auto value = static_cast(pdg); return static_cast((0 <= value) ? value : -value); } diff --git a/Core/include/Acts/Definitions/Tolerance.hpp b/Core/include/Acts/Definitions/Tolerance.hpp index 0380c732408..0b8ef36e55f 100644 --- a/Core/include/Acts/Definitions/Tolerance.hpp +++ b/Core/include/Acts/Definitions/Tolerance.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/TrackParametrization.hpp b/Core/include/Acts/Definitions/TrackParametrization.hpp index 952fe24c512..ac5f0e09b1b 100644 --- a/Core/include/Acts/Definitions/TrackParametrization.hpp +++ b/Core/include/Acts/Definitions/TrackParametrization.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Definitions/Units.hpp b/Core/include/Acts/Definitions/Units.hpp index b61515234a9..c41aa7dd830 100644 --- a/Core/include/Acts/Definitions/Units.hpp +++ b/Core/include/Acts/Definitions/Units.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2019 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/Blueprint.hpp b/Core/include/Acts/Detector/Blueprint.hpp index 63f442dae0b..3be0d6353db 100644 --- a/Core/include/Acts/Detector/Blueprint.hpp +++ b/Core/include/Acts/Detector/Blueprint.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/CuboidalContainerBuilder.hpp b/Core/include/Acts/Detector/CuboidalContainerBuilder.hpp index 9ec69348116..ea5b98675cf 100644 --- a/Core/include/Acts/Detector/CuboidalContainerBuilder.hpp +++ b/Core/include/Acts/Detector/CuboidalContainerBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/CylindricalContainerBuilder.hpp b/Core/include/Acts/Detector/CylindricalContainerBuilder.hpp index c3023cea84e..4520eea5e07 100644 --- a/Core/include/Acts/Detector/CylindricalContainerBuilder.hpp +++ b/Core/include/Acts/Detector/CylindricalContainerBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/Detector.hpp b/Core/include/Acts/Detector/Detector.hpp index 6ce3d4bc488..fa61327089a 100644 --- a/Core/include/Acts/Detector/Detector.hpp +++ b/Core/include/Acts/Detector/Detector.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/DetectorBuilder.hpp b/Core/include/Acts/Detector/DetectorBuilder.hpp index 11fc60d67a7..d5e0ab7e16b 100644 --- a/Core/include/Acts/Detector/DetectorBuilder.hpp +++ b/Core/include/Acts/Detector/DetectorBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/DetectorComponents.hpp b/Core/include/Acts/Detector/DetectorComponents.hpp index 5f6cf73d6e8..ed5a0c342de 100644 --- a/Core/include/Acts/Detector/DetectorComponents.hpp +++ b/Core/include/Acts/Detector/DetectorComponents.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/DetectorVolume.hpp b/Core/include/Acts/Detector/DetectorVolume.hpp index ac1164342d3..1617721d62f 100644 --- a/Core/include/Acts/Detector/DetectorVolume.hpp +++ b/Core/include/Acts/Detector/DetectorVolume.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/DetectorVolumeBuilder.hpp b/Core/include/Acts/Detector/DetectorVolumeBuilder.hpp index c7b4ae8c6f6..6cb5e6647db 100644 --- a/Core/include/Acts/Detector/DetectorVolumeBuilder.hpp +++ b/Core/include/Acts/Detector/DetectorVolumeBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp b/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp index 95998fdb716..b43ec35277d 100644 --- a/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp +++ b/Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/GeometryCompatibilityConcept.hpp b/Core/include/Acts/Detector/GeometryCompatibilityConcept.hpp index f0bbc6c45a2..643efa1b138 100644 --- a/Core/include/Acts/Detector/GeometryCompatibilityConcept.hpp +++ b/Core/include/Acts/Detector/GeometryCompatibilityConcept.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/GeometryIdGenerator.hpp b/Core/include/Acts/Detector/GeometryIdGenerator.hpp index 83e2ed90b9b..ff8e36cc451 100644 --- a/Core/include/Acts/Detector/GeometryIdGenerator.hpp +++ b/Core/include/Acts/Detector/GeometryIdGenerator.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/GeometryIdMapper.hpp b/Core/include/Acts/Detector/GeometryIdMapper.hpp index f4d6a4163b2..0b9215011e2 100644 --- a/Core/include/Acts/Detector/GeometryIdMapper.hpp +++ b/Core/include/Acts/Detector/GeometryIdMapper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp b/Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp index f985ea3975e..64483115c61 100644 --- a/Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp +++ b/Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/KdtSurfacesProvider.hpp b/Core/include/Acts/Detector/KdtSurfacesProvider.hpp index dda69aeefc7..fd7086e01df 100644 --- a/Core/include/Acts/Detector/KdtSurfacesProvider.hpp +++ b/Core/include/Acts/Detector/KdtSurfacesProvider.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/LayerStructureBuilder.hpp b/Core/include/Acts/Detector/LayerStructureBuilder.hpp index afc04463cc5..02fd726824e 100644 --- a/Core/include/Acts/Detector/LayerStructureBuilder.hpp +++ b/Core/include/Acts/Detector/LayerStructureBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -91,8 +91,9 @@ class LayerStructureBuilder : public IInternalStructureBuilder { /// Minimum number of surfaces to build an internal structure /// - otherwise the tryAll options is used unsigned int nMinimalSurfaces = 4u; - /// Polyhedron approximations - unsigned int nSegments = 1u; + /// Polyhedron approximations: number of segments to be used + /// to approximate a quarter of a circle + unsigned int quarterSegments = 1u; /// Extra information, mainly for screen output std::string auxiliary = ""; }; diff --git a/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp b/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp index 86cce7fce56..939388c223a 100644 --- a/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp +++ b/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/Portal.hpp b/Core/include/Acts/Detector/Portal.hpp index 4c4bc7fe8a4..3cdfce02dc4 100644 --- a/Core/include/Acts/Detector/Portal.hpp +++ b/Core/include/Acts/Detector/Portal.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/PortalGenerators.hpp b/Core/include/Acts/Detector/PortalGenerators.hpp index d8f8bf50614..9468e63d2cc 100644 --- a/Core/include/Acts/Detector/PortalGenerators.hpp +++ b/Core/include/Acts/Detector/PortalGenerators.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/ProtoBinning.hpp b/Core/include/Acts/Detector/ProtoBinning.hpp index 8d5d4db8374..371bfe60bd2 100644 --- a/Core/include/Acts/Detector/ProtoBinning.hpp +++ b/Core/include/Acts/Detector/ProtoBinning.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/ProtoDetector.hpp b/Core/include/Acts/Detector/ProtoDetector.hpp index b1d7877d65d..5e4e4d426c2 100644 --- a/Core/include/Acts/Detector/ProtoDetector.hpp +++ b/Core/include/Acts/Detector/ProtoDetector.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/ProtoSupport.hpp b/Core/include/Acts/Detector/ProtoSupport.hpp index 55f8110a3a2..8f1e2581e77 100644 --- a/Core/include/Acts/Detector/ProtoSupport.hpp +++ b/Core/include/Acts/Detector/ProtoSupport.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/VolumeStructureBuilder.hpp b/Core/include/Acts/Detector/VolumeStructureBuilder.hpp index 812f2e761ec..aede963c78c 100644 --- a/Core/include/Acts/Detector/VolumeStructureBuilder.hpp +++ b/Core/include/Acts/Detector/VolumeStructureBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/BlueprintDrawer.hpp b/Core/include/Acts/Detector/detail/BlueprintDrawer.hpp index cc589bf8e06..775eb83f45b 100644 --- a/Core/include/Acts/Detector/detail/BlueprintDrawer.hpp +++ b/Core/include/Acts/Detector/detail/BlueprintDrawer.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/BlueprintHelper.hpp b/Core/include/Acts/Detector/detail/BlueprintHelper.hpp index 06cc3e2046f..a1c0368a0ad 100644 --- a/Core/include/Acts/Detector/detail/BlueprintHelper.hpp +++ b/Core/include/Acts/Detector/detail/BlueprintHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp b/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp index 34be7576be2..c9ad46744d3 100644 --- a/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp +++ b/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp b/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp index 91b7935482c..05815b1325f 100644 --- a/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp +++ b/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp b/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp index ffc9ae97985..ebea6a7a4d6 100644 --- a/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp +++ b/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/IndexedGridFiller.hpp b/Core/include/Acts/Detector/detail/IndexedGridFiller.hpp index c8f7d416f31..3bbbee0569c 100644 --- a/Core/include/Acts/Detector/detail/IndexedGridFiller.hpp +++ b/Core/include/Acts/Detector/detail/IndexedGridFiller.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/IndexedSurfacesGenerator.hpp b/Core/include/Acts/Detector/detail/IndexedSurfacesGenerator.hpp index 6d87d9f3a50..83dc9170208 100644 --- a/Core/include/Acts/Detector/detail/IndexedSurfacesGenerator.hpp +++ b/Core/include/Acts/Detector/detail/IndexedSurfacesGenerator.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/PortalHelper.hpp b/Core/include/Acts/Detector/detail/PortalHelper.hpp index 52245ee4a66..ec17c487098 100644 --- a/Core/include/Acts/Detector/detail/PortalHelper.hpp +++ b/Core/include/Acts/Detector/detail/PortalHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/ProtoMaterialHelper.hpp b/Core/include/Acts/Detector/detail/ProtoMaterialHelper.hpp index eb483a2f680..a43e96ac521 100644 --- a/Core/include/Acts/Detector/detail/ProtoMaterialHelper.hpp +++ b/Core/include/Acts/Detector/detail/ProtoMaterialHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/ReferenceGenerators.hpp b/Core/include/Acts/Detector/detail/ReferenceGenerators.hpp index 8d03d515bb3..db77685a2bc 100644 --- a/Core/include/Acts/Detector/detail/ReferenceGenerators.hpp +++ b/Core/include/Acts/Detector/detail/ReferenceGenerators.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp b/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp index 1cfef5fdb5b..e956e215e4f 100644 --- a/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp +++ b/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IDetectorBuilder.hpp b/Core/include/Acts/Detector/interface/IDetectorBuilder.hpp index 73a167e08ba..b9950cbd283 100644 --- a/Core/include/Acts/Detector/interface/IDetectorBuilder.hpp +++ b/Core/include/Acts/Detector/interface/IDetectorBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IDetectorComponentBuilder.hpp b/Core/include/Acts/Detector/interface/IDetectorComponentBuilder.hpp index e2b8f5fdd6d..cc9d207aef0 100644 --- a/Core/include/Acts/Detector/interface/IDetectorComponentBuilder.hpp +++ b/Core/include/Acts/Detector/interface/IDetectorComponentBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IExternalStructureBuilder.hpp b/Core/include/Acts/Detector/interface/IExternalStructureBuilder.hpp index 483ddf6299a..7f5177b8e92 100644 --- a/Core/include/Acts/Detector/interface/IExternalStructureBuilder.hpp +++ b/Core/include/Acts/Detector/interface/IExternalStructureBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IGeometryIdGenerator.hpp b/Core/include/Acts/Detector/interface/IGeometryIdGenerator.hpp index bb161cb9d58..61a1461bd6b 100644 --- a/Core/include/Acts/Detector/interface/IGeometryIdGenerator.hpp +++ b/Core/include/Acts/Detector/interface/IGeometryIdGenerator.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IInternalStructureBuilder.hpp b/Core/include/Acts/Detector/interface/IInternalStructureBuilder.hpp index 4ae2e242bf0..0d453248834 100644 --- a/Core/include/Acts/Detector/interface/IInternalStructureBuilder.hpp +++ b/Core/include/Acts/Detector/interface/IInternalStructureBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/IRootVolumeFinderBuilder.hpp b/Core/include/Acts/Detector/interface/IRootVolumeFinderBuilder.hpp index aacb5c5dfc3..ea96a05de8e 100644 --- a/Core/include/Acts/Detector/interface/IRootVolumeFinderBuilder.hpp +++ b/Core/include/Acts/Detector/interface/IRootVolumeFinderBuilder.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/Detector/interface/ISurfacesProvider.hpp b/Core/include/Acts/Detector/interface/ISurfacesProvider.hpp index 7cedfbf6a82..65d810a24dc 100644 --- a/Core/include/Acts/Detector/interface/ISurfacesProvider.hpp +++ b/Core/include/Acts/Detector/interface/ISurfacesProvider.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/Charge.hpp b/Core/include/Acts/EventData/Charge.hpp index 020aa87ce83..6ae62b3d963 100644 --- a/Core/include/Acts/EventData/Charge.hpp +++ b/Core/include/Acts/EventData/Charge.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/ChargeConcept.hpp b/Core/include/Acts/EventData/ChargeConcept.hpp index 4b0540ac407..448722bd4b3 100644 --- a/Core/include/Acts/EventData/ChargeConcept.hpp +++ b/Core/include/Acts/EventData/ChargeConcept.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp index 3d256630f76..f624cd88aee 100644 --- a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -250,6 +250,17 @@ class GenericBoundTrackParameters { return m_surface->referenceFrame(geoCtx, position(geoCtx), momentum()); } + /// Reflect the parameters in place. + void reflectInPlace() { m_params = reflectBoundParameters(m_params); } + + /// Reflect the parameters. + /// @return Reflected parameters. + GenericBoundTrackParameters reflect() const { + GenericBoundTrackParameters reflected = *this; + reflected.reflectInPlace(); + return reflected; + } + private: BoundVector m_params; std::optional m_cov; @@ -282,11 +293,7 @@ class GenericBoundTrackParameters { (lhs.m_surface == rhs.m_surface) && (lhs.m_particleHypothesis == rhs.m_particleHypothesis); } - /// Compare two bound track parameters for bitwise in-equality. - friend bool operator!=(const GenericBoundTrackParameters& lhs, - const GenericBoundTrackParameters& rhs) { - return !(lhs == rhs); - } + /// Print information to the output stream. friend std::ostream& operator<<(std::ostream& os, const GenericBoundTrackParameters& tp) { diff --git a/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp b/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp index edaf2660595..6e4ed9bae7a 100644 --- a/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -111,6 +111,14 @@ class GenericCurvilinearTrackParameters Vector3 position() const { return GenericBoundTrackParameters::position({}); } + + /// Reflect the parameters. + /// @return Reflected parameters. + GenericCurvilinearTrackParameters reflect() const { + GenericCurvilinearTrackParameters reflected = *this; + reflected.reflectInPlace(); + return reflected; + } }; } // namespace Acts diff --git a/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp b/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp index 6c4537b07c0..857d6c328b9 100644 --- a/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -12,7 +12,9 @@ #include "Acts/Definitions/Common.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/TrackParametersConcept.hpp" +#include "Acts/EventData/TransformationHelpers.hpp" #include "Acts/EventData/detail/PrintParameters.hpp" +#include "Acts/Utilities/MathHelpers.hpp" #include "Acts/Utilities/UnitVectors.hpp" #include @@ -154,12 +156,12 @@ class GenericFreeTrackParameters { // [f*sin(theta)*cos(phi), f*sin(theta)*sin(phi), f*cos(theta)] // w/ f,sin(theta) positive, the transverse magnitude is then // sqrt(f^2*sin^2(theta)) = f*sin(theta) - Scalar transverseMagnitude = - std::hypot(m_params[eFreeDir0], m_params[eFreeDir1]); + Scalar transverseMagnitude2 = + square(m_params[eFreeDir0]) + square(m_params[eFreeDir1]); // absolute magnitude is f by construction - Scalar magnitude = std::hypot(transverseMagnitude, m_params[eFreeDir2]); + Scalar magnitude2 = transverseMagnitude2 + square(m_params[eFreeDir2]); // such that we can extract sin(theta) = f*sin(theta) / f - return (transverseMagnitude / magnitude) * absoluteMomentum(); + return std::sqrt(transverseMagnitude2 / magnitude2) * absoluteMomentum(); } /// Momentum three-vector. Vector3 momentum() const { return absoluteMomentum() * direction(); } @@ -174,6 +176,17 @@ class GenericFreeTrackParameters { return m_particleHypothesis; } + /// Reflect the parameters in place. + void reflectInPlace() { m_params = reflectFreeParameters(m_params); } + + /// Reflect the parameters. + /// @return Reflected parameters. + GenericFreeTrackParameters reflect() const { + GenericFreeTrackParameters reflected = *this; + reflected.reflectInPlace(); + return reflected; + } + private: FreeVector m_params; std::optional m_cov; diff --git a/Core/include/Acts/EventData/GenericParticleHypothesis.hpp b/Core/include/Acts/EventData/GenericParticleHypothesis.hpp index 38c70409dc6..46ebe4ff298 100644 --- a/Core/include/Acts/EventData/GenericParticleHypothesis.hpp +++ b/Core/include/Acts/EventData/GenericParticleHypothesis.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -133,11 +133,6 @@ class GenericParticleHypothesis { return (lhs.m_absPdg == rhs.m_absPdg) && (lhs.m_mass == rhs.m_mass) && (lhs.m_chargeType == rhs.m_chargeType); } - friend bool operator!=(const GenericParticleHypothesis& lhs, - const GenericParticleHypothesis& rhs) { - return (lhs.m_absPdg != rhs.m_absPdg) || (lhs.m_mass != rhs.m_mass) || - (lhs.m_chargeType != rhs.m_chargeType); - } }; } // namespace Acts diff --git a/Core/include/Acts/EventData/MeasurementHelpers.hpp b/Core/include/Acts/EventData/MeasurementHelpers.hpp index 9d927e40447..d4aae9b7565 100644 --- a/Core/include/Acts/EventData/MeasurementHelpers.hpp +++ b/Core/include/Acts/EventData/MeasurementHelpers.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index 749435066de..70ad87f8d77 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp index 446348a6ae0..1c065fd7e12 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.hpp +++ b/Core/include/Acts/EventData/MultiTrajectory.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -103,8 +103,6 @@ class TrackStateRange { return false; } - bool operator!=(const Iterator& other) const { return !(*this == other); } - ProxyType operator*() const { return *proxy; } ProxyType operator*() { return *proxy; } }; @@ -698,13 +696,10 @@ class MultiTrajectory { self().allocateCalibrated_impl(istate, measdim); } - // This function will move to an rvalue reference in the next major version - template - void setUncalibratedSourceLink(IndexType istate, source_link_t&& sourceLink) + void setUncalibratedSourceLink(IndexType istate, SourceLink&& sourceLink) requires(!ReadOnly) { - self().setUncalibratedSourceLink_impl( - istate, std::forward(sourceLink)); + self().setUncalibratedSourceLink_impl(istate, std::move(sourceLink)); } SourceLink getUncalibratedSourceLink(IndexType istate) const { diff --git a/Core/include/Acts/EventData/MultiTrajectory.ipp b/Core/include/Acts/EventData/MultiTrajectory.ipp index 81a57f0b24a..c8f12967cd2 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.ipp +++ b/Core/include/Acts/EventData/MultiTrajectory.ipp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #include "Acts/Utilities/AlgebraHelpers.hpp" diff --git a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp index 7898a336754..92ae47270bc 100644 --- a/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp +++ b/Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp b/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp index 2a5fac9b2d6..2cc417bc133 100644 --- a/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp +++ b/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2020-2024 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/ParticleHypothesis.hpp b/Core/include/Acts/EventData/ParticleHypothesis.hpp index 8fb7fe9ec03..f236441ede6 100644 --- a/Core/include/Acts/EventData/ParticleHypothesis.hpp +++ b/Core/include/Acts/EventData/ParticleHypothesis.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/ProxyAccessor.hpp b/Core/include/Acts/EventData/ProxyAccessor.hpp index 2c577c508de..7a9ebe3eff0 100644 --- a/Core/include/Acts/EventData/ProxyAccessor.hpp +++ b/Core/include/Acts/EventData/ProxyAccessor.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once diff --git a/Core/include/Acts/EventData/Seed.hpp b/Core/include/Acts/EventData/Seed.hpp new file mode 100644 index 00000000000..db93b319dcb --- /dev/null +++ b/Core/include/Acts/EventData/Seed.hpp @@ -0,0 +1,43 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include +#include + +namespace Acts { + +template + requires(N >= 3ul) +class Seed { + public: + using value_type = external_spacepoint_t; + static constexpr std::size_t DIM = N; + + template + requires(sizeof...(args_t) == N) && + (std::same_as && ...) + explicit Seed(const args_t&... points); + + void setVertexZ(float vertex); + void setQuality(float seedQuality); + + const std::array& sp() const; + float z() const; + float seedQuality() const; + + private: + std::array m_spacepoints{}; + float m_vertexZ{0.f}; + float m_seedQuality{-std::numeric_limits::infinity()}; +}; + +} // namespace Acts + +#include "Acts/EventData/Seed.ipp" diff --git a/Core/include/Acts/EventData/Seed.ipp b/Core/include/Acts/EventData/Seed.ipp new file mode 100644 index 00000000000..74f2c0e4169 --- /dev/null +++ b/Core/include/Acts/EventData/Seed.ipp @@ -0,0 +1,50 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +namespace Acts { + +template + requires(N >= 3ul) +template + requires(sizeof...(args_t) == N) && + (std::same_as && ...) +Seed::Seed(const args_t&... points) + : m_spacepoints({&points...}) {} + +template + requires(N >= 3ul) +void Seed::setVertexZ(float vertex) { + m_vertexZ = vertex; +} + +template + requires(N >= 3ul) +void Seed::setQuality(float seedQuality) { + m_seedQuality = seedQuality; +} + +template + requires(N >= 3ul) +const std::array& +Seed::sp() const { + return m_spacepoints; +} + +template + requires(N >= 3ul) +float Seed::z() const { + return m_vertexZ; +} + +template + requires(N >= 3ul) +float Seed::seedQuality() const { + return m_seedQuality; +} + +} // namespace Acts diff --git a/Core/include/Acts/EventData/SourceLink.hpp b/Core/include/Acts/EventData/SourceLink.hpp index 57fcb393f8d..ba1515738e6 100644 --- a/Core/include/Acts/EventData/SourceLink.hpp +++ b/Core/include/Acts/EventData/SourceLink.hpp @@ -1,10 +1,10 @@ -// This file is part of the Acts project. +// This file is part of the ACTS project. // -// Copyright (C) 2021 CERN for the benefit of the Acts project +// Copyright (C) 2016 CERN for the benefit of the ACTS project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. #pragma once @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -34,7 +33,7 @@ class SourceLink final { SourceLink& operator=(const SourceLink& other) = default; SourceLink& operator=(SourceLink&& other) = default; - /// Constructor from concrete sourcelink + /// Constructor from concrete source link /// @tparam T The source link type /// @param upstream The upstream source link to store template @@ -86,10 +85,6 @@ struct SourceLinkAdapterIterator { return m_iterator == other.m_iterator; } - bool operator!=(const SourceLinkAdapterIterator& other) const { - return !(*this == other); - } - Acts::SourceLink operator*() const { return Acts::SourceLink{*m_iterator}; } auto operator-(const SourceLinkAdapterIterator& other) const { diff --git a/Core/include/Acts/EventData/SpacePointContainer.hpp b/Core/include/Acts/EventData/SpacePointContainer.hpp new file mode 100644 index 00000000000..619a1393ecc --- /dev/null +++ b/Core/include/Acts/EventData/SpacePointContainer.hpp @@ -0,0 +1,163 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Definitions/Algebra.hpp" +#include "Acts/Definitions/Units.hpp" +#include "Acts/EventData/SpacePointData.hpp" +#include "Acts/EventData/SpacePointProxy.hpp" +#include "Acts/EventData/Utils.hpp" +#include "Acts/Utilities/HashedString.hpp" +#include "Acts/Utilities/Iterator.hpp" + +#include +#include + +namespace Acts { + +struct SpacePointContainerConfig { + bool useDetailedDoubleMeasurementInfo = false; + bool isInInternalUnits = false; + + SpacePointContainerConfig toInternalUnits() const { + if (isInInternalUnits) { + throw std::runtime_error( + "Repeated conversion to internal units for " + "SpacePointContainerConfig"); + } + using namespace Acts::UnitLiterals; + SpacePointContainerConfig config = *this; + config.isInInternalUnits = true; + return config; + }; +}; + +struct SpacePointContainerOptions { + // location of beam in x,y plane. + // used as offset for Space Points + Acts::Vector2 beamPos{0 * Acts::UnitConstants::mm, + 0 * Acts::UnitConstants::mm}; + bool isInInternalUnits = false; + + SpacePointContainerOptions toInternalUnits() const { + if (isInInternalUnits) { + throw std::runtime_error( + "Repeated conversion to internal units for " + "SpacePointContainerOptions"); + } + using namespace Acts::UnitLiterals; + SpacePointContainerOptions options = *this; + options.isInInternalUnits = true; + options.beamPos[0] /= 1_mm; + options.beamPos[1] /= 1_mm; + return options; + } +}; + +template class holder_t> +class SpacePointContainer { + public: + friend class Acts::SpacePointProxy< + Acts::SpacePointContainer>; + + public: + using SpacePointProxyType = + Acts::SpacePointProxy>; + + using iterator = + ContainerIndexIterator, + SpacePointProxyType&, false>; + using const_iterator = + ContainerIndexIterator, + const SpacePointProxyType&, true>; + + using ValueType = typename container_t::ValueType; + using ProxyType = SpacePointProxyType; + using value_type = ProxyType; + using size_type = std::size_t; + + public: + // Constructors + // It makes sense to support both options of + // taking or not the ownership + + // Do not take ownership + // Activate only if holder_t is RefHolder + template