Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into Solve_seedfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Varni committed Dec 14, 2022
2 parents 0b851d4 + d4aac95 commit f439965
Show file tree
Hide file tree
Showing 744 changed files with 16,318 additions and 4,717 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
env:
DOXYGEN_WARN_AS_ERROR: FAIL_ON_WARNINGS
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: >
curl -SL https://sourceforge.net/projects/doxygen/files/rel-1.9.4/doxygen-1.9.4.linux.bin.tar.gz/download | tar -xzC .
Expand Down
29 changes: 23 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ clang_tidy:
- git checkout $HEAD_SHA
- >
apt-get update
&& apt-get install -y clang-10 clang-tidy-10 g++-8 libstdc++-8-dev
&& ln -s /usr/bin/clang++-10 /usr/bin/clang++
&& ln -s /usr/bin/clang-10 /usr/bin/clang
&& ln -s /usr/bin/clang-tidy-10 /usr/bin/clang-tidy
&& apt-get install -y g++-8 libstdc++-8-dev parallel software-properties-common
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add
&& add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal main'
&& apt-get install -y clang-16 clang-tidy-16
&& ln -s /usr/bin/clang++-16 /usr/bin/clang++
&& ln -s /usr/bin/clang-16 /usr/bin/clang
&& ln -s /usr/bin/clang-tidy-16 /usr/bin/clang-tidy
&& mkdir -p /opt/lib/gcc/x86_64-linux-gnu
&& ln -s /usr/lib/gcc/x86_64-linux-gnu/8/ /opt/lib/gcc/x86_64-linux-gnu/
&& clang++ --gcc-toolchain=/opt -v
Expand All @@ -30,10 +33,24 @@ clang_tidy:
-DACTS_RUN_CLANG_TIDY=on
- mkdir clang-tidy
- CI/clang_tidy/run_clang_tidy.sh build > clang-tidy/clang-tidy.log

# Main clang-tidy run during cmake compilation
- CI/clang_tidy/run_clang_tidy.sh build | tee clang-tidy/clang-tidy.log

# Install dependencies for processing scripts
- pip install -r CI/clang_tidy/requirements.txt
- CI/clang_tidy/parse_clang_tidy.py clang-tidy/clang-tidy.log clang-tidy/clang-tidy.json --exclude "*thirdparty*"

# Parse the main clang-tidy run
- >
CI/clang_tidy/parse_clang_tidy.py
clang-tidy/clang-tidy.log
clang-tidy/clang-tidy.json
--exclude "*thirdparty*"
# Check the combined report against the defined limits
- CI/clang_tidy/check_clang_tidy.py --report clang-tidy/clang-tidy.json --config CI/clang_tidy/limits.yml

# Generate an html report
- codereport clang-tidy/clang-tidy.json clang-tidy/html

build:
Expand Down
9 changes: 5 additions & 4 deletions Alignment/include/ActsAlignment/Kernel/Alignment.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ ActsAlignment::Alignment<fitter_t>::evaluateTrackAlignmentState(
const std::unordered_map<const Acts::Surface*, size_t>& idxedAlignSurfaces,
const ActsAlignment::AlignmentMask& alignMask,
Acts::LoggerWrapper logger) const {
// Convert to Acts::SourceLink during iteration
Acts::SourceLinkAdapterIterator begin{sourcelinks.begin()};
Acts::SourceLinkAdapterIterator end{sourcelinks.end()};

// Perform the fit
auto fitRes = m_fitter.fit(sourcelinks.begin(), sourcelinks.end(),
sParameters, fitOptions);
auto fitRes = m_fitter.fit(begin, end, sParameters, fitOptions);
if (not fitRes.ok()) {
ACTS_WARNING("Fit failure");
return fitRes.error();
Expand Down Expand Up @@ -301,7 +304,6 @@ ActsAlignment::Alignment<fitter_t>::align(
// Screen out the final aligned parameters
// @todo
if (alignmentParametersUpdated) {
unsigned int iDetElement = 0;
for (const auto& det : alignOptions.alignedDetElements) {
const auto& surface = &det->surface();
const auto& transform =
Expand All @@ -318,7 +320,6 @@ ActsAlignment::Alignment<fitter_t>::align(
ACTS_VERBOSE(
"Euler angles (rotZ, rotY, rotX) = " << rotAngles.transpose());
ACTS_VERBOSE("Rotation marix = \n" << rotation);
iDetElement++;
}
} else {
ACTS_DEBUG("Alignment parameters is not updated.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ TrackAlignmentState trackAlignmentState(
std::vector<std::pair<size_t, bool>> measurementStates;
measurementStates.reserve(15);
// Number of smoothed states on the track
size_t nSmoothedStates = 0;
// size_t nSmoothedStates = 0; // commented because clang-tidy complains about
// unused
// Number of alignable surfaces on the track
size_t nAlignSurfaces = 0;

// Visit the track states on the track
multiTraj.visitBackwards(entryIndex, [&](const auto& ts) {
// Remember the number of smoothed states
if (ts.hasSmoothed()) {
nSmoothedStates++;
// nSmoothedStates++; // commented because clang-tidy complains about
// unused
} else {
// @note: this should in principle never happen now. But still keep it as a note
return true;
Expand Down
22 changes: 13 additions & 9 deletions CI/clang_tidy/limits.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
limits:
# "readability-inconsistent-declaration-parameter-name": 0
# "readability-named-parameter": 0
"readability-inconsistent-declaration-parameter-name": 0
"readability-named-parameter": 0
"readability-container-size-empty": 0
"modernize-use-using": 0
"readability-braces-around-statements": 0
"modernize-use-override": 0
"modernize-use-equals-default" : 0
"readability-implicit-bool-cast": 0
"readability-implicit-bool-conversion": 0
# "modernize-use-default-member-init": 0
# "performance-unnecessary-value-param": 0
# "modernize-use-equals-default": 0
"modernize-use-using": 0
"modernize-use-override": 0
"modernize-use-equals-default" : 0
"modernize-use-default-member-init": 0
"modernize-use-nullptr": 0
"performance-move-const-arg": 0
"performance-unnecessary-value-param": 0
"performance-move-const-arg": 0
"performance-for-range-copy": 0
"cppcoreguidelines-pro-type-member-init": 0
"cppcoreguidelines-init-variables": 0
"clang-analyzer-optin.cplusplus.UninitializedObject": 0
"clang-diagnostic-error": 0
13 changes: 11 additions & 2 deletions CI/clang_tidy/parse_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse_clang_tidy_item(itemstr):

try:
m = re.match(
r"(?P<file>[/.\-+\w]+):(?P<line>\d+):(?P<col>\d+): (?P<sev>.*?):(?P<msg>[\s\S]*?)\[(?P<code>.*)\]\n(?P<info>[\s\S]*)",
r"(?P<file>[/.\-+\w]+):(?P<line>\d+):(?P<col>\d+): (?P<sev>.*?):(?P<msg>[\s\S]*)\[(?P<code>.*)\]\n(?P<info>[\s\S]*)",
itemstr,
)

Expand All @@ -35,7 +35,7 @@ def parse_clang_tidy_item(itemstr):
line=int(m.group("line")),
col=int(m.group("col")),
# message=m.group("msg").strip(),
message="\n".join(lines[1:]),
message=m.group("msg").strip() + "\n" + "\n".join(lines[1:]),
code=m.group("code"),
severity=m.group("sev"),
)
Expand Down Expand Up @@ -101,6 +101,12 @@ def main():
default=[],
help="Only include files that match any of these patterns",
)
p.add_argument(
"--ignore",
action="append",
default=[],
help="Ignore items with codes matching any of these patterns",
)
p.add_argument("--cwd", type=Path)
p.add_argument("--strip-common", action="store_true")

Expand All @@ -116,6 +122,9 @@ def select(item):
accept = accept and all(fnmatch(item.path, e) for e in args.filter)

accept = accept and not any(fnmatch(item.path, e) for e in args.exclude)

accept = accept and not any(fnmatch(item.code, i) for i in args.ignore)

return accept

items = list(filter(select, items))
Expand Down
2 changes: 1 addition & 1 deletion CI/clang_tidy/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
appdirs==1.4.4
# via fs
codereport==0.3.0
codereport==0.3.2
# via -r CI/clang_tidy/requirements.in
commonmark==0.9.1
# via rich
Expand Down
1 change: 0 additions & 1 deletion CI/clang_tidy/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ export NINJA_STATUS="[ninja][%f/%t] "
pushd $build_dir
ninja | grep -v '\[ninja\]'
popd

20 changes: 20 additions & 0 deletions CI/merge_hashes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import argparse

p = argparse.ArgumentParser()
p.add_argument("output")
p.add_argument("files", nargs="+")

args = p.parse_args()

items = {}

for file in args.files:
with open(file) as fh:
for line in fh:
key, value = line.split(":", 1)
items[key.strip()] = value.strip()

with open(args.output, "w") as fh:
for key, value in items.items():
fh.write(f"{key}: {value}\n")
55 changes: 48 additions & 7 deletions CI/physmon/comment_template.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
## :bar_chart: Physics performance monitoring for {{ commit }}
{% if has_errors %}
> :red_square: **ERROR** The result has missing elements!
> :red_square: **ERROR** The result has missing elements!
> This is likely a physmon job failure
{% endif %}

[Full report]({{ url }}/)
CKF: {{ make_url("seeded", "ckf_seeded.html") }}, {{ make_url("truth smeared", "ckf_truth_smeared.html") }}, {{ make_url("truth estimated", "ckf_truth_estimated.html") }}
IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "ivf_truth_smeared.html") }}, {{ make_url("truth estimated", "ivf_truth_estimated.html") }}
{{ make_url("Ambiguity resolution", "ambi_seeded.html") }}
Seeding: {{ make_url("seeded", "seeding_seeded.html") }}, {{ make_url("truth estimated", "seeding_truth_estimated.html") }}, {{ make_url("orthogonal", "seeding_orthogonal.html") }}
CKF: {{ make_url("seeded", "ckf_seeded.html") }}, {{ make_url("truth smeared", "ckf_truth_smeared.html") }}, {{ make_url("truth estimated", "ckf_truth_estimated.html") }}, {{ make_url("orthogonal", "ckf_orthogonal.html") }}
IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "ivf_truth_smeared.html") }}, {{ make_url("truth estimated", "ivf_truth_estimated.html") }}, {{ make_url("orthogonal", "ivf_orthogonal.html") }}
Ambiguity resolution: {{ make_url("seeded", "ambi_seeded.html") }}, {{ make_url("orthogonal", "ambi_orthogonal.html") }}
{{ make_url("Truth tracking", "truth_tracking.html") }}
{{ make_url("Truth tracking (GSF)", "gsf.html")}}

### Vertexing {{ "" if all_exist(
"vertexing_mu_scan.pdf",
"ivf_seeded_plots",
"ivf_truth_smeared_plots",
"ivf_truth_estimated_plots",
"ivf_orthogonal_plots",
) else ":x: "}}

{% call detail_block("Vertexing vs. mu", "vertexing_mu_scan.pdf") %}
{{ make_image("vertexing_mu_scan.pdf", 350) }}
{% endcall %}

{% for mode in ["seeded", "truth_smeared", "truth_estimated"] %}
{% for mode in ["seeded", "truth_smeared", "truth_estimated", "orthogonal"] %}

{% call detail_block("IVF "+mode, "ivf_"+mode+"_plots") %}

Expand All @@ -40,14 +43,37 @@ IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "

{% endfor %}

### Seeding {{ "" if all_exist(
"seeding_seeded_plots",
"seeding_truth_estimated_plots",
"seeding_orthogonal_plots",
) else ":x: "}}

{% for mode in ["seeded", "truth_estimated", "orthogonal"] %}

{% call detail_block("Seeding "+mode, "seeding_"+mode+"_plots") %}

{% for url in [
"trackeff_vs_eta.pdf",
"trackeff_vs_pT.pdf",
"nDuplicated_vs_eta.pdf",
"nDuplicated_vs_pT.pdf",
] -%}
{{- make_image("seeding_"+mode+"_plots/"+url, "50%") -}}
{%- endfor %}

{% endcall %}

{% endfor %}

### CKF {{ "" if all_exist(
"ckf_seeded_plots",
"ckf_truth_smeared_plots",
"ckf_truth_estimated_plots",
"ckf_orthogonal_plots",
) else ":x: "}}

{% for mode in ["seeded", "truth_smeared", "truth_estimated"] %}
{% for mode in ["seeded", "truth_smeared", "truth_estimated", "orthogonal"] %}

{% call detail_block("CKF "+mode, "ckf_"+mode+"_plots") %}

Expand Down Expand Up @@ -79,7 +105,7 @@ IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "

{% endcall %}

### Truth tracking {{ "" if exists("truth_tracking_plots") else ":x: "}}
### Truth tracking (Kalman Filter) {{ "" if exists("truth_tracking_plots") else ":x: "}}

{% call detail_block("Truth tracking", "truth_tracking_plots") %}

Expand All @@ -97,3 +123,18 @@ IVF: {{ make_url("seeded", "ivf_seeded.html") }}, {{ make_url("truth smeared", "
{%- endfor %}

{% endcall %}

### Truth tracking (GSF) {{ "" if exists("truth_tracking_plots") else ":x: "}}

{% call detail_block("Truth tracking", "truth_tracking_plots") %}

{% for url in [
"pull_d0.pdf",
"res_d0.pdf",
"pull_qop.pdf",
"res_qop.pdf",
] -%}
{{- make_image("gsf_plots/"+url, "50%") -}}
{%- endfor %}

{% endcall %}
13 changes: 13 additions & 0 deletions CI/physmon/gsf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
checks:
"*":
Chi2Test:
threshold: 0.01
KolmogorovTest:
threshold: 0.68
RatioCheck:
threshold: 3
ResidualCheck:
threshold: 3
IntegralCheck:
threshold: 3

31 changes: 25 additions & 6 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ function full_chain() {
fi
echo $config

if [ $suffix != truth_smeared ]; then
run \
$outdir/performance_seeding_hists_${suffix}.root \
$refdir/performance_seeding_hists_${suffix}.root \
--title "Seeding ${suffix}" \
-c $config \
-o $outdir/seeding_${suffix}.html \
-p $outdir/seeding_${suffix}_plots
fi

run \
$outdir/performance_ckf_${suffix}.root \
$refdir/performance_ckf_${suffix}.root \
Expand Down Expand Up @@ -71,6 +81,15 @@ function full_chain() {
full_chain truth_smeared
full_chain truth_estimated
full_chain seeded
full_chain orthogonal

run \
$outdir/performance_gsf.root \
$refdir/performance_gsf.root \
--title "Truth tracking (GSF)" \
-c CI/physmon/gsf.yml \
-o $outdir/gsf.html \
-p $outdir/gsf_plots

run \
$outdir/performance_truth_tracking.root \
Expand All @@ -86,13 +105,13 @@ run \
--title "Ambisolver seeded" \
-o $outdir/ambi_seeded.html \
-p $outdir/ambi_seeded_plots

run \
$outdir/acts_analysis_residuals_and_pulls.root \
$refdir/acts_analysis_residuals_and_pulls.root \
--title "analysis_residuals_and_pulls" \
# -o $outdir/analysis_residuals_and_pulls.html \
# -p $outdir/analysis_residuals_and_pulls
$outdir/performance_ambi_orthogonal.root \
$refdir/performance_ambi_orthogonal.root \
--title "Ambisolver orthogonal" \
-o $outdir/ambi_orthogonal.html \
-p $outdir/ambi_orthogonal_plots

Examples/Scripts/vertex_mu_scan.py \
$outdir/performance_vertexing_*mu*.root \
Expand Down
Loading

0 comments on commit f439965

Please sign in to comment.