Skip to content

[PWGLF] Use const& and std::move to avoid copies - #17711

Open
vkucera wants to merge 2 commits into
AliceO2Group:masterfrom
vkucera:const-PWGLF
Open

[PWGLF] Use const& and std::move to avoid copies#17711
vkucera wants to merge 2 commits into
AliceO2Group:masterfrom
vkucera:const-PWGLF

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: ❌ 2449 errors, ⚠️ 2010 warnings, 🔕 8 disabled

@github-actions github-actions Bot added the pwglf label Sep 1, 2026
@github-actions github-actions Bot changed the title Use const& and std::move to avoid copies [PWGLF] 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
romainschotter
romainschotter previously approved these changes Sep 1, 2026
@romainschotter
romainschotter enabled auto-merge (squash) September 1, 2026 19:31
@alibuild

alibuild commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 1ca779b at 2026-09-03 21:58:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 526 errors and 4094 warnings.'
Found 526 errors and 4094 warnings.
++ [[ 526 -gt 0 ]]
++ cat /sw/BUILD/862e6d91a891848d0bb88d70ff4bafe70c0aae51/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Common/epvector.cxx:62:8: error: constructor does not initialize these fields: ccdb, offsetFT0, offsetFV0, gainprofile, hrecentere, shiftprofile, shiftprofile2, shiftprofile3, shiftprofile4, shiftprofile5 [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:195:7: error: variable 'pidCuts' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:199:22: error: variable 'hNsigma' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:200:22: error: variable 'hTOFmass' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:201:22: error: variable 'hGenNuclei' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:202:22: error: variable 'hMomRes' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:203:22: error: variable 'hNsigmaEta' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:204:22: error: variable 'hTOFmassEta' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:205:22: error: variable 'hDCAxy' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:206:22: error: variable 'hDCAz' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:207:22: error: variable 'hGloTOFtracks' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:208:22: error: variable 'hDeltaP' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:209:28: error: variable 'hDCAHists' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:210:27: error: variable 'lut' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:210:27: error: variable 'lut' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:212:31: error: variable 'candidates' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:250:8: error: constructor does not initialize these fields: ccdb, pdgDB [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:277:58: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:289:70: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:296:77: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:299:100: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:300:82: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:301:72: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:302:67: 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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:304: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]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:802:7: error: uninitialized record type: 'nSigmaTPC' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:823:7: error: uninitialized record type: 'dcaInfo' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:80:34: error: variable 'metadataInfo' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:201:3: error: constructor does not initialize these fields: betheParams, trkSettings [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:83: error: std::move of the const variable 'v0DaughterVec_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:256:30: error: Address of stack memory associated with temporary object of type 'TString' returned to caller [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:257:33: error: Address of stack memory associated with temporary object of type 'TString' returned to caller [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:268:3: error: constructor does not initialize these fields: dcaToPv, dcaToPvXY, dcaToPvZ, active [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:486:5: error: 'itBegin' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:508:35: error: variable 'hDeDx' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:509:35: error: variable 'hInvMass' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

@vkucera

vkucera commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Ping

@alibuild

alibuild commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 830ad23 at 2026-09-11 11:58:

## sw/BUILD/O2Physics-latest/log
2026-09-11T11:56:36.171+0200 [51490:139921034366592] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "BatchReadBlobs()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.279+0200 [51490:139921034366592] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-11T11:56:36.280+0200 [51490:139921034366592] [executioncontext.cpp:739] [ERROR] Failed to download output blob 0cb1589349faac7b0c619b6de289aea656b1cb9ec9d67eeae641c6ea21b01da3: 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-11T11:56:36.170+0200 [51007:140244556873344] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.284+0200 [51007:140244556873344] [executioncontext.cpp:739] [ERROR] Failed to download output blob 5de2193641b015ce860e9ce2a5e409abc7ffeddd5e2af7253b726cc8cd1d110c: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51033:139895274450560] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.284+0200 [51033:139895274450560] [executioncontext.cpp:739] [ERROR] Failed to download output blob bac5acb2f576d26777e7f639471ce78ab2407ac20f4e38ea76fc6e3358d7486d: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51340:140060550430336] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.284+0200 [51340:140060550430336] [executioncontext.cpp:739] [ERROR] Failed to download output blob e8e38a4e3eafbdc197fa83d2feb01e35bad62469355e881b857c02e4325d33cd: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51447:140516342447744] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "BatchReadBlobs()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.280+0200 [51447:140516342447744] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused]
2026-09-11T11:56:36.280+0200 [51447:140516342447744] [executioncontext.cpp:739] [ERROR] Failed to download output blob 0545e9ff88ec7aff5cbcc4a2806300ff086153972f13685eb0cabd41e7ffd531: 14: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:8980: Failed to connect to remote host: Connection refused
2026-09-11T11:56:36.171+0200 [51102:140204957593216] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.285+0200 [51102:140204957593216] [executioncontext.cpp:739] [ERROR] Failed to download output blob 5599164ea03ce987b97367f8e249dff97c0b9e685d868394b2aeca0a770d0e29: 14: Socket closed
2026-09-11T11:56:36.171+0200 [50955:140269484650112] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.287+0200 [50955:140269484650112] [executioncontext.cpp:739] [ERROR] Failed to download output blob 331c1ddf20618c2c241175fbe855b885d1e519cf4c48e1a905d20ede506ca461: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51276:139939434352256] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.286+0200 [51276:139939434352256] [executioncontext.cpp:739] [ERROR] Failed to download output blob 6d9d10f1796f934e2aa8947ce3a2e3ede56ddb0b67a274744b7e360ce8ff6fd9: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51058:140402794487424] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.288+0200 [51058:140402794487424] [executioncontext.cpp:739] [ERROR] Failed to download output blob 7d633ab6dfeb0ffe3adf5fcead9fc4341c7a8a25fce71f6a538c61eb376445d0: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51146:139755261156992] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.290+0200 [51146:139755261156992] [executioncontext.cpp:739] [ERROR] Failed to download output blob 825cb9b50060dc8a240a72a75a9157b39559496310b6d55863a84b0d129eafcc: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51234:140675802840704] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: recvmsg:Connection reset by peer]
2026-09-11T11:56:36.291+0200 [51234:140675802840704] [executioncontext.cpp:739] [ERROR] Failed to download output blob bd7cd485e3f61925ed3a2416be36d13ee67fb024cbf623e5309cbe62d64d9e07: 14: recvmsg:Connection reset by peer
2026-09-11T11:56:36.170+0200 [51081:140604445286016] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.293+0200 [51081:140604445286016] [executioncontext.cpp:739] [ERROR] Failed to download output blob 0375cf7dc326abe0fa181deb85789c3d48a87c51968a1f0355c19c9d3d28de5d: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51123:140439332572800] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.290+0200 [51123:140439332572800] [executioncontext.cpp:739] [ERROR] Failed to download output blob 69ee0a1142942af6e0f78fddc4d5ea3efab2050ba44cc639923ff35fe2cabe3f: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51233:140598879178368] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ByteStream.Read()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.293+0200 [51233:140598879178368] [executioncontext.cpp:739] [ERROR] Failed to download output blob bbe0520812be1cca00557589eed0e21cd2d1a2f0c74c66ca8d5e174f94072b20: 14: Socket closed
2026-09-11T11:56:36.170+0200 [51515:140328870784640] [buildboxcommon_grpcretrier.cpp:177] [ERROR] Retry limit (0) exceeded for "ActionCache.GetActionResult()", last gRPC error was [14: Socket closed]
2026-09-11T11:56:36.277+0200 [51515:140328870784640] [executioncontext.cpp:544] [ERROR] Error while querying action cache at "http://localhost:8980": 14: Socket closed
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 830ad23 at 2026-09-10 01:58:

No log files found

Full log here.

@vkucera

vkucera commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Ping 2

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

Labels

Development

Successfully merging this pull request may close these issues.

3 participants