Skip to content

[PWGEM] Use const& and std::move to avoid copies - #17708

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

[PWGEM] Use const& and std::move to avoid copies#17708
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:const-PWGEM

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: ❌ 653 errors, ⚠️ 983 warnings, 🔕 0 disabled

@github-actions github-actions Bot added pwgem photon Photon and neutral meson PAG label labels Sep 1, 2026
@github-actions github-actions Bot changed the title Use const& and std::move to avoid copies [PWGEM] 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
@alibuild

alibuild commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for f6fd7c3 at 2026-09-02 22:12:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 173 errors and 302 warnings.'
Found 173 errors and 302 warnings.
++ [[ 173 -gt 0 ]]
++ cat /sw/BUILD/3f2a532f5124f8e8352b439ebf04d58150ae3720/O2Physics-code-check/errors.txt
PWGEM/Dilepton/Core/DielectronCut.h:323:7: error: switch has 2 consecutive identical branches [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:122:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:648:25: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:1115:9: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:1156:105: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:1763:7: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/DileptonSV.h:1795:105: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:110:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:558:25: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:888:9: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:914:105: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:1464:39: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:1548:7: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/Core/Dilepton.h:1566:105: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx:60:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx:176:39: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx:177:24: 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]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx:66:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx:163:39: error: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast,-warnings-as-errors]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx:164:24: 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]
PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx:370:17: error: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:114:8: error: constructor does not initialize these fields: fHistMan, fEventCut [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:135: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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:135:65: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:156:51: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:158:31: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:160:52: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:193:8: error: constructor does not initialize these fields: fHistMan [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:272: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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:272:65: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:297:59: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:303:31: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:306:63: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:343:71: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:372:78: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:419:8: error: constructor does not initialize these fields: fHistMan [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:448:34: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:448:63: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:564:64: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:567:83: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:572:66: 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]
PWGEM/Dilepton/Tasks/MCtemplates.cxx:575:85: 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]
[0 more errors; see full log]

Full log here.

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

Labels

photon Photon and neutral meson PAG label pwgem

Development

Successfully merging this pull request may close these issues.

2 participants