Skip to content

[Tutorial,PWGCF,PWGEM,PWGLF,PWGUD] Use const& and std::move to avoid copies - #17715

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:const-Tutorials
Open

[Tutorial,PWGCF,PWGEM,PWGLF,PWGUD] Use const& and std::move to avoid copies#17715
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:const-Tutorials

Conversation

@vkucera

@vkucera vkucera commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Mostly done automatically by Clang-Tidy.

Mostly done automatically by Clang-Tidy.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 308 errors, ⚠️ 163 warnings, 🔕 0 disabled

@github-actions github-actions Bot changed the title Use const& and std::move to avoid copies [Tutorial,PWGCF,PWGEM,PWGLF,PWGUD] Use const& and std::move to avoid copies Sep 1, 2026
@vkucera
vkucera marked this pull request as ready for review September 1, 2026 15:54
@vkucera
vkucera requested review from a team, ddobrigk, iarsene and ktf as code owners September 1, 2026 15:54
@alibuild

alibuild commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 8244017 at 2026-09-02 02:24:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 23 errors and 170 warnings.'
Found 23 errors and 170 warnings.
++ [[ 23 -gt 0 ]]
++ cat /sw/BUILD/6451af4b3807ffae8fb77705bb6aceba4f1029ae/O2Physics-code-check/errors.txt
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:19:7: error: variable 'mee' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:20:7: error: variable 'mee_orig' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:21:9: error: variable 'histNames' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:23:9: error: variable 'histLegends' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:30:3: error: suspicious string literal, probably missing a comma [bugprone-suspicious-missing-comma,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:37:16: error: do not use C-style cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-cstyle-cast,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:51:5: error: do not use C-style cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-cstyle-cast,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:52:17: error: narrowing conversion from 'Double_t' (aka 'double') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:54:20: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:55:20: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/PWGLF/Resonance/resonancesCombine.cxx:40:8: error: constructor does not initialize these fields: rapidity, mass, pT, paircharge [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
Tutorials/PWGLF/Resonance/resonances_step1.cxx:35:8: error: constructor does not initialize these fields: rapidity, mass, pT, paircharge [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
Tutorials/PWGLF/Resonance/resonances_step2.cxx:39:8: error: constructor does not initialize these fields: rapidity, mass, pT, paircharge [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
Tutorials/PWGLF/Resonance/resonances_step6.cxx:38:8: error: constructor does not initialize these fields: rapidity, mass, pT, paircharge [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:95:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:96:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:97:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:98:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:99:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:100:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:101:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:102:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
Tutorials/Skimming/spectraTPCReference.cxx:103:36: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
++ [[ 170 -gt 0 ]]
++ cat /sw/BUILD/6451af4b3807ffae8fb77705bb6aceba4f1029ae/O2Physics-code-check/warnings.txt
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:103:31: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:105:43: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:107:32: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:109:35: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:111:32: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:113:47: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:115:35: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:117:30: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx:119:29: warning: statement should be inside braces [readability-braces-around-statements]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:19:1: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:20:1: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:21:1: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:23:1: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:33:30: warning: do not declare C-style arrays, use 'std::span' instead [modernize-avoid-c-arrays]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:60:20: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Tutorials/PWGEM/Cocktail/plotLFCocktail.C:62:25: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Tutorials/PWGLF/Resonance/resonancesCombine.cxx:70:21: warning: redundant explicit casting to the same type 'int' as the sub-expression, remove this casting [readability-redundant-casting]
[0 more errors; see full log]

Full log here.

@alibuild

alibuild commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 8244017 at 2026-09-02 16:14:

## sw/BUILD/O2Physics-latest/log
2026-09-02T06:15:40.747+0200 [1528:140169257610880] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:15:40.836+0200 [1528:140169257610880] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame
2026-09-02T06:18:05.662+0200 [1528:140169257610880] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:15:41.649+0200 [1571:140193461718656] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:15:41.650+0200 [1571:140193461718656] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame
2026-09-02T06:18:11.402+0200 [1571:140193461718656] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:15:40.567+0200 [1549:139924123364992] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:15:40.836+0200 [1549:139924123364992] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame
2026-09-02T06:19:49.263+0200 [1549:139924123364992] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "FindMissingBlobs()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:18:39.495+0200 [1648:140101574778496] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:18:39.495+0200 [1648:140101574778496] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame
2026-09-02T06:18:28.812+0200 [1613:140691822587520] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame]
2026-09-02T06:18:28.813+0200 [1613:140691822587520] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: connection attempt timed out before receiving SETTINGS frame

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants